Delete a Collection
This endpoint permanently deletes a collection along with all its fields and content entries. This action is irreversible.
Endpoint
[DELETE]
/collections/{collection_slug}Permissions
This endpoint requires a token with the admin ability.
Path Parameters
| Name | Required | Description |
|---|---|---|
collection_slug | Yes | The slug of the collection to delete. |
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 |
|---|---|---|---|
slug | string | Yes | Must match the collection's slug. This is a safety confirmation to prevent accidental deletions. |
Example Requests
axios.delete('https://your-domain.com/api/collections/blog-posts', {
headers: {
'Accept': 'application/json',
'Authorization': 'Bearer YOUR_API_TOKEN',
'project-id': 'YOUR_PROJECT_UUID'
},
data: {
slug: 'blog-posts'
}
});use Illuminate\Support\Facades\Http;
$response = Http::withToken('YOUR_API_TOKEN')->withHeaders([
'Accept' => 'application/json',
'project-id' => 'YOUR_PROJECT_UUID'
])->delete('https://your-domain.com/api/collections/blog-posts', [
'slug' => 'blog-posts'
]);curl -X DELETE "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 '{ "slug": "blog-posts" }'Responses
204: No Content
The collection and all its data were successfully deleted. No response body is returned.
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 if the slug confirmation does not match.
{
"message": "The collection slug does not match.",
"errors": {
"slug": [
"The collection slug does not match."
]
}
}