Collections
List Collections
Returns a list of the collections available in the project.
Query Parameters
How many items to skip when fetching data.
What metadata to return in the response.
GET /collections
{
"data": [
{
"collection": "customers",
"translations": [],
"item_duplication_fields": []
}
]
}
Create a Collection
Create a new collection in Directus. The `collection` and `schema` properties are required. To create a collection folder that doesn't have an underlying table, you can set `schema` to `null`. You are able to provide an array of `fields` to be created during the creation of the collection. See the fields object for more information on what properties are available in a field.
Query Parameters
What metadata to return in the response.
Request Body
Unique name of the collection.
The fields contained in this collection. See the fields reference for more information. Each individual field requires field, type, and interface to be provided.
Name of a Google Material Design Icon that's assigned to this collection.
A note describing the collection.
Text representation of how items from this collection are shown across the system.
Whether or not the collection is hidden from the navigation in the admin app.
Whether or not the collection is treated as a single object.
Key value pairs of how to show this collection's name in different languages in the admin app.
Whether or not Content Versioning is enabled for this collection.
What field holds the archive value.
What value to use for "archived" items.
What value to use to "unarchive" items.
Whether or not to show the "archived" filter.
The sort field in the collection.
POST /collections
{
"data": {
"collection": "customers",
"translations": [],
"item_duplication_fields": []
}
}
Retrieve a Collection
Retrieves the details of a single collection by its table name.
Query Parameters
Unique identifier of the collection.
What metadata to return in the response.
GET /collections/{id}
{
"data": {
"collection": "customers",
"translations": [],
"item_duplication_fields": []
}
}
Delete a Collection
Delete an existing collection. Warning: This will delete the whole collection, including the items within. Proceed with caution.
Query Parameters
Unique identifier of the collection.
DELETE /collections/{id}
Update a Collection
Update the metadata for an existing collection. You can only update the `meta` values of the collection object. Updating the collection name is not supported at this time.
Query Parameters
Unique identifier of the collection.
What metadata to return in the response.
Request Body
Metadata of the collection.
PATCH /collections/{id}
{
"data": {
"collection": "customers",
"translations": [],
"item_duplication_fields": []
}
}