Sorry, no results found for "".

Show examples in:
Javascript HTTP
Endpoint info
Available examples

Content Management API > Upload Collection

Update a upload collection

Body parameters

type string Required

Must be exactly "upload_collection". JSON API type field

attributes.label string Optional

The label of the upload collection

Example: "Posts"
attributes.position integer Optional

Ordering index

Example: 1
relationships.parent.data Optional

Parent upload collection

relationships.children.data Optional

Underlying upload collections

Returns

Returns a resource object of type upload_collection.

Examples

PUT https://site-api.datocms.com/upload-collections/:upload_collection_id HTTP/1.1
Authorization: Bearer YOUR-API-TOKEN
Accept: application/json
X-Api-Version: 3
Content-Type: application/vnd.api+json
{
"data": {
"type": "upload_collection",
"id": "uinr2zfqQLeCo_1O0-ao-Q"
}
}
Terminal window
curl -g 'https://site-api.datocms.com/upload-collections/:upload_collection_id' \
-X PUT \
-H "Authorization: Bearer YOUR-API-TOKEN" \
-H "Accept: application/json" \
-H "X-Api-Version: 3" \
-H "Content-Type: application/vnd.api+json" \
--data-binary '{"data":{"type":"upload_collection","id":"uinr2zfqQLeCo_1O0-ao-Q"}}'
await fetch(
"https://site-api.datocms.com/upload-collections/:upload_collection_id",
{
method: "PUT",
headers: {
Authorization: "Bearer YOUR-API-TOKEN",
Accept: "application/json",
"X-Api-Version": "3",
"Content-Type": "application/vnd.api+json",
},
body: JSON.stringify({
data: { type: "upload_collection", id: "uinr2zfqQLeCo_1O0-ao-Q" },
}),
},
);
HTTP/1.1 200 OK
Content-Type: application/json
Cache-Control: cache-control: max-age=0, private, must-revalidate
X-RateLimit-Limit: 30
X-RateLimit-Remaining: 28
{
"data": {
"type": "upload_collection",
"id": "uinr2zfqQLeCo_1O0-ao-Q",
"relationships": {
"parent": {
"data": null
},
"children": {
"data": [
{
"type": "upload_collection",
"id": "uinr2zfqQLeCo_1O0-ao-Q"
}
]
}
},
"attributes": {
"label": "Posts",
"position": 1
}
}
}