Fields
List All Fields
Returns a list of the fields available in the project.
Query Parameters
A limit on the number of objects that are returned.
How to sort the returned items. sort
is a CSV of fields used to sort the fetched items. Sorting defaults to ascending (ASC) order but a minus sign (-
) can be used to reverse this to descending (DESC) order. Fields are prioritized by their order in the CSV. You can also use a ?
to sort randomly.
GET /fields
{
"data": [
{
"collection": "about_us",
"field": "id",
"special": [],
"options": {},
"translations": []
}
]
}
List Fields in Collection
Returns a list of the fields available in the given collection.
Query Parameters
Unique identifier of the collection the item resides in.
How to sort the returned items. sort
is a CSV of fields used to sort the fetched items. Sorting defaults to ascending (ASC) order but a minus sign (-
) can be used to reverse this to descending (DESC) order. Fields are prioritized by their order in the CSV. You can also use a ?
to sort randomly.
GET /fields/{collection}
{
"data": [
{
"collection": "about_us",
"field": "id",
"special": [],
"options": {},
"translations": []
}
]
}
Create Field in Collection
Create a new field in a given collection.
Query Parameters
Unique identifier of the collection the item resides in.
Request Body
Directus specific data type. Used to cast values in the API.
Unique name of the field. Field name is unique within the collection.
The schema info.
The meta info.
POST /fields/{collection}
{
"data": {
"collection": "about_us",
"field": "id",
"special": [],
"options": {},
"translations": []
}
}
Retrieve a Field
Retrieves the details of a single field in a given collection.
Query Parameters
Unique identifier of the collection the item resides in.
Unique identifier of the field.
GET /fields/{collection}/{id}
{
"data": {
"collection": "about_us",
"field": "id",
"special": [],
"options": {},
"translations": []
}
}
Delete a Field
Delete an existing field. This action can't be undone.
Query Parameters
Unique identifier of the collection the item resides in.
Unique identifier of the field.
DELETE /fields/{collection}/{id}
Update a Field
Updates the given field in the given collection.
Query Parameters
Unique identifier of the collection the item resides in.
Unique identifier of the field.
Request Body
Directus specific data type. Used to cast values in the API.
Unique name of the field. Field name is unique within the collection.
The schema info.
The meta info.
PATCH /fields/{collection}/{id}
{
"data": {
"collection": "about_us",
"field": "id",
"special": [],
"options": {},
"translations": []
}
}