You're reading "Content Management API"

Site upload tags

All the site's upload tags

The Site upload tags object

A Site upload tags object is returned as part of the response body of each successful List all sites upload tags or Create a new upload tag API call. The following table contains the list of all its fields along with their type, description and example values.

Object fields:
namestring

The tag name

This attribute is required

List all sites upload tags

To list all sites upload tags, send a GET request to the /upload-tags 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-tags 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_tag", "id": "42", "attributes": { "name": "Pictures of me" } } ] }

Create a new upload tag

To create a new upload tag, send a POST request to the /upload-tags 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-tags HTTP/1.1
X-Api-Version3
AuthorizationBearer YOUR-API-KEY
Acceptapplication/json
Content-Typeapplication/json
{ "data": { "type": "upload_tag", "attributes": { "name": "Pictures of me" } } }
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_tag", "id": "42", "attributes": { "name": "Pictures of me" } } }