Update a Collection
This endpoint updates the name and slug of an existing collection.
Endpoint
[PUT]
/collections/{collection_slug}Permissions
This endpoint requires a token with the admin ability.
Path Parameters
| Name | Required | Description |
|---|---|---|
collection_slug | Yes | The current slug of the collection. |
Headers
| Name | Required | Description |
|---|---|---|
Accept | Yes | Specifies the response content type. Must be application/json. |
Authorization | Yes | Required. Must be a Bearer token with admin scope. |
project-id | Yes | The unique identifier for the project. |
Body Parameters
| Name | Type | Required | Description |
|---|---|---|---|
name | string | Yes | The new display name. Max 60 characters. |
slug | string | Yes | The new slug. Must be unique per project. Max 60 characters. |
Example Requests
axios.put('https://your-domain.com/api/collections/blog-posts', {
name: 'Articles',
slug: 'articles'
}, {
headers: {
'Accept': 'application/json',
'Authorization': 'Bearer YOUR_API_TOKEN',
'project-id': 'YOUR_PROJECT_UUID'
}
});use Illuminate\Support\Facades\Http;
$response = Http::withToken('YOUR_API_TOKEN')->withHeaders([
'Accept' => 'application/json',
'project-id' => 'YOUR_PROJECT_UUID'
])->put('https://your-domain.com/api/collections/blog-posts', [
'name' => 'Articles',
'slug' => 'articles'
]);curl -X PUT "https://your-domain.com/api/collections/blog-posts" \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "project-id: YOUR_PROJECT_UUID" \
-H "Content-Type: application/json" \
-d '{
"name": "Articles",
"slug": "articles"
}'Responses
200: Success
Returns the updated collection object.
{
"data": {
"uuid": "d8f7b5c1-e4a3-4b21-8e9f-a9c1e2b3d4f5",
"name": "Articles",
"slug": "articles",
"is_singleton": false,
"created_at": "2026-02-10T10:00:00.000000Z",
"updated_at": "2026-02-10T12:00:00.000000Z"
}
}403: Forbidden
Returned if the API token does not have the admin ability.
{
"message": "API token doesn't have the right abilities!"
}404: Not Found
Returned if the collection with the specified slug does not exist.
{
"message": "Collection not found."
}422: Unprocessable Entity
Returned for validation errors, such as a duplicate or reserved slug.
{
"message": "The slug has already been taken.",
"errors": {
"slug": [
"The slug has already been taken."
]
}
}