> For the complete documentation index, see [llms.txt](https://guides.ia.numerique.gouv.fr/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://guides.ia.numerique.gouv.fr/albert-api/api-reference/liste-des-endpoint/collections.md).

# Collections

## Get Collections

> Get list of collections.

```json
{"openapi":"3.1.0","info":{"title":"Albert API","version":"0.4.9"},"security":[{"HTTPBearer":[]}],"components":{"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}},"schemas":{"CollectionVisibility":{"type":"string","enum":["private","public"],"title":"CollectionVisibility"},"Collections":{"properties":{"object":{"type":"string","const":"list","title":"Object","default":"list"},"data":{"items":{"$ref":"#/components/schemas/Collection"},"type":"array","title":"Data"}},"additionalProperties":true,"type":"object","required":["data"],"title":"Collections"},"Collection":{"properties":{"object":{"type":"string","const":"collection","title":"Object","default":"collection"},"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"},"owner":{"type":"string","title":"Owner"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"visibility":{"anyOf":[{"$ref":"#/components/schemas/CollectionVisibility"},{"type":"null"}]},"created":{"type":"integer","title":"Created"},"updated":{"type":"integer","title":"Updated"},"documents":{"type":"integer","title":"Documents","default":0},"size":{"type":"integer","title":"Size","default":0}},"additionalProperties":true,"type":"object","required":["id","name","owner","created","updated"],"title":"Collection"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/v1/collections":{"get":{"tags":["Collections"],"summary":"Get Collections","description":"Get list of collections.","operationId":"get_collections_v1_collections_get","parameters":[{"name":"name","in":"query","required":false,"schema":{"type":"string","description":"Filter by collection name.","title":"Name"},"description":"Filter by collection name."},{"name":"visibility","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/CollectionVisibility"},{"type":"null"}],"description":"Filter by collection visibility.","title":"Visibility"},"description":"Filter by collection visibility."},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"The offset of the collections to get.","default":0,"title":"Offset"},"description":"The offset of the collections to get."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"The limit of the collections to get.","default":10,"title":"Limit"},"description":"The limit of the collections to get."},{"name":"order_by","in":"query","required":false,"schema":{"enum":["id","name","created","updated"],"type":"string","description":"The order by field to sort the collections by.","default":"id","title":"Order By"},"description":"The order by field to sort the collections by."},{"name":"order_direction","in":"query","required":false,"schema":{"enum":["asc","desc"],"type":"string","description":"The direction to order the collections by.","default":"asc","title":"Order Direction"},"description":"The direction to order the collections by."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Collections"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

## Create Collection

> Create a new collection.

```json
{"openapi":"3.1.0","info":{"title":"Albert API","version":"0.4.9"},"security":[{"HTTPBearer":[]}],"components":{"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}},"schemas":{"CollectionRequest":{"properties":{"name":{"type":"string","minLength":1,"title":"Name","description":"The name of the collection."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"The description of the collection."},"visibility":{"$ref":"#/components/schemas/CollectionVisibility","description":"The type of the collection. Public collections are available to all users, private collections are only available to the user who created them.","default":"private"}},"additionalProperties":true,"type":"object","required":["name"],"title":"CollectionRequest"},"CollectionVisibility":{"type":"string","enum":["private","public"],"title":"CollectionVisibility"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/v1/collections":{"post":{"tags":["Collections"],"summary":"Create Collection","description":"Create a new collection.","operationId":"create_collection_v1_collections_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectionRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

## Get Collection

> Get a collection by ID.

```json
{"openapi":"3.1.0","info":{"title":"Albert API","version":"0.4.9"},"security":[{"HTTPBearer":[]}],"components":{"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}},"schemas":{"Collection":{"properties":{"object":{"type":"string","const":"collection","title":"Object","default":"collection"},"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"},"owner":{"type":"string","title":"Owner"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"visibility":{"anyOf":[{"$ref":"#/components/schemas/CollectionVisibility"},{"type":"null"}]},"created":{"type":"integer","title":"Created"},"updated":{"type":"integer","title":"Updated"},"documents":{"type":"integer","title":"Documents","default":0},"size":{"type":"integer","title":"Size","default":0}},"additionalProperties":true,"type":"object","required":["id","name","owner","created","updated"],"title":"Collection"},"CollectionVisibility":{"type":"string","enum":["private","public"],"title":"CollectionVisibility"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/v1/collections/{collection_id}":{"get":{"tags":["Collections"],"summary":"Get Collection","description":"Get a collection by ID.","operationId":"get_collection_v1_collections__collection_id__get","parameters":[{"name":"collection_id","in":"path","required":true,"schema":{"type":"integer","description":"The collection ID","title":"Collection Id"},"description":"The collection ID"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Collection"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

## Delete Collection

> Delete a collection.

```json
{"openapi":"3.1.0","info":{"title":"Albert API","version":"0.4.9"},"security":[{"HTTPBearer":[]}],"components":{"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}},"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/v1/collections/{collection_id}":{"delete":{"tags":["Collections"],"summary":"Delete Collection","description":"Delete a collection.","operationId":"delete_collection_v1_collections__collection_id__delete","parameters":[{"name":"collection_id","in":"path","required":true,"schema":{"type":"integer","description":"The collection ID","title":"Collection Id"},"description":"The collection ID"},{"name":"required","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Required"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

## Update Collection

> Update a collection.

```json
{"openapi":"3.1.0","info":{"title":"Albert API","version":"0.4.9"},"security":[{"HTTPBearer":[]}],"components":{"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}},"schemas":{"CollectionUpdateRequest":{"properties":{"name":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"Name","description":"The name of the collection."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"The description of the collection."},"visibility":{"anyOf":[{"$ref":"#/components/schemas/CollectionVisibility"},{"type":"null"}],"description":"The type of the collection. Public collections are available to all users, private collections are only available to the user who created them."}},"additionalProperties":true,"type":"object","title":"CollectionUpdateRequest"},"CollectionVisibility":{"type":"string","enum":["private","public"],"title":"CollectionVisibility"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/v1/collections/{collection_id}":{"patch":{"tags":["Collections"],"summary":"Update Collection","description":"Update a collection.","operationId":"update_collection_v1_collections__collection_id__patch","parameters":[{"name":"collection_id","in":"path","required":true,"schema":{"type":"integer","description":"The collection ID","title":"Collection Id"},"description":"The collection ID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectionUpdateRequest","description":"The collection to update."}}}},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://guides.ia.numerique.gouv.fr/albert-api/api-reference/liste-des-endpoint/collections.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
