> For the complete documentation index, see [llms.txt](https://docs.xenioo.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.xenioo.com/xenioo-api/globa-platform-api/database/collections/list.md).

# List

This endpoint will retrieve the list of all the collections associated to a specific bot.

### Request

The following request will fetch the existing collections in the bot specified in the request token.

```bash
curl --location --request GET 'https://<SERVICE ENDPOINT>/data/collections' \
--header 'Authorization: Bearer <BOT_AUTH_TOKEN>' \
--header 'Content-Type: application/json'
```

### Response

If successful, the response will contain the list of all the collections associated with bot specified in the request token.

```javascript
[
    {
        "CollectionId": "The ID of the collection",
        "Name": "Name of the collection",
        "Fields": [{
            "Group": "Group of the Field",
            "Name": "Name of the Field",
            "Value": "Value of the Field",
            "Mandatory": boolean,
            "DisplayInView": boolean,
            "Indexed": boolean,            
            "Type": number,
            "OrderField": "The position of the field",            
        }],
    }
]
```

The Type property is a number that goes from 0 to 8 that specifies the Field Type.

```
Text            = 0,
LongText        = 1,
MultiChoice     = 2,
Date            = 3,
DateTime        = 4,
IntegerNumber   = 5,
DecimalNumber   = 6,
Boolean         = 7,
Upload          = 8
```

### Response Codes

This endpoint will reply with the following standard HTTP codes.

<table data-header-hidden><thead><tr><th width="276">Code</th><th>Meaning</th></tr></thead><tbody><tr><td>Code</td><td>Meaning</td></tr><tr><td>200</td><td>Ok. The request has been successfully fulfilled.</td></tr><tr><td>400</td><td>Bad Request. The supplied token is invalid or does not have enough permissions.</td></tr><tr><td>401</td><td>Unauthorized. The account associated to the token is not authorized</td></tr><tr><td>404</td><td>Not Found. The account or the chatbot specified could not be found.</td></tr></tbody></table>
