You're reading "Content Management API"

Uploads filter

In DatoCMS you can create filters to help you (and other editors) quickly search for uploads

The Uploads filter object

A Uploads filter object is returned as part of the response body of each successful List all filters, Retrieve a filter, Create a new filter, Update a filter or Delete a filter API call. The following table contains the list of all its fields along with their type, description and example values.

Object fields:
filterobject

The actual filter

This attribute is required
namestring

The name of the filter

This attribute is required
sharedboolean

Whether it's a shared filter or not

This attribute is required

List all filters

To list all filters, send a GET request to the /upload-filters endpoint. The following table contains the list of all the possible arguments, along with their type, description and examples values. All the arguments marked as required must be present in the request.

GET https://site-api.datocms.com/upload-filters HTTP/1.1
X-Api-Version3
AuthorizationBearer YOUR-API-KEY
Acceptapplication/json
HTTP Response
HTTP/1.1 200 OK
Content-Typeapplication/json; charset=utf-8
Cache-Controlcache-control: max-age=0, private, must-revalidate
X-RateLimit-Limit30
X-RateLimit-Remaining28
{ "data": [ { "type": "upload_filter", "id": "34", "attributes": { "name": "Draft posts", "filter": { "status": { "eq": "draft" } }, "shared": true } } ] }

Retrieve a filter

To retrieve a filter, send a GET request to the /upload-filters/:upload_filter_id endpoint. The following table contains the list of all the possible arguments, along with their type, description and examples values. All the arguments marked as required must be present in the request.

GET https://site-api.datocms.com/upload-filters/:upload_filter_id HTTP/1.1
X-Api-Version3
AuthorizationBearer YOUR-API-KEY
Acceptapplication/json
HTTP Response
HTTP/1.1 200 OK
Content-Typeapplication/json; charset=utf-8
Cache-Controlcache-control: max-age=0, private, must-revalidate
X-RateLimit-Limit30
X-RateLimit-Remaining28
{ "data": { "type": "upload_filter", "id": "34", "attributes": { "name": "Draft posts", "filter": { "status": { "eq": "draft" } }, "shared": true } } }

Create a new filter

To create a new filter, send a POST request to the /upload-filters endpoint, passing the resource arguments in the request body. The following table contains the list of all the possible arguments, along with their type, description and examples values. All the arguments marked as required must be present in the request.

POST https://site-api.datocms.com/upload-filters HTTP/1.1
X-Api-Version3
AuthorizationBearer YOUR-API-KEY
Acceptapplication/json
Content-Typeapplication/json
{ "data": { "type": "upload_filter", "attributes": { "name": "Draft posts", "filter": { "status": { "eq": "draft" } }, "shared": true } } }
HTTP Response
HTTP/1.1 200 OK
Content-Typeapplication/json; charset=utf-8
Cache-Controlcache-control: max-age=0, private, must-revalidate
X-RateLimit-Limit30
X-RateLimit-Remaining28
{ "data": { "type": "upload_filter", "id": "34", "attributes": { "name": "Draft posts", "filter": { "status": { "eq": "draft" } }, "shared": true } } }

Update a filter

To update a filter, send a PUT request to the /upload-filters/:upload_filter_id endpoint, passing the resource arguments in the request body. The following table contains the list of all the possible arguments, along with their type, description and examples values. All the arguments marked as required must be present in the request.

PUT https://site-api.datocms.com/upload-filters/:upload_filter_id HTTP/1.1
X-Api-Version3
AuthorizationBearer YOUR-API-KEY
Acceptapplication/json
Content-Typeapplication/json
{ "data": { "type": "upload_filter", "id": "34", "attributes": { "name": "Draft posts", "filter": { "status": { "eq": "draft" } } } } }
HTTP Response
HTTP/1.1 200 OK
Content-Typeapplication/json; charset=utf-8
Cache-Controlcache-control: max-age=0, private, must-revalidate
X-RateLimit-Limit30
X-RateLimit-Remaining28
{ "data": { "type": "upload_filter", "id": "34", "attributes": { "name": "Draft posts", "filter": { "status": { "eq": "draft" } }, "shared": true } } }

Delete a filter

To delete a filter, send a DELETE request to the /upload-filters/:upload_filter_id endpoint. The following table contains the list of all the possible arguments, along with their type, description and examples values. All the arguments marked as required must be present in the request.

DELETE https://site-api.datocms.com/upload-filters/:upload_filter_id HTTP/1.1
X-Api-Version3
AuthorizationBearer YOUR-API-KEY
Acceptapplication/json
HTTP Response
HTTP/1.1 200 OK
Content-Typeapplication/json; charset=utf-8
Cache-Controlcache-control: max-age=0, private, must-revalidate
X-RateLimit-Limit30
X-RateLimit-Remaining28
{ "data": { "type": "upload_filter", "id": "34", "attributes": { "name": "Draft posts", "filter": { "status": { "eq": "draft" } }, "shared": true } } }
Go ahead to: Role