Delete a Collection

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

NameRequiredDescription
collection_slugYesThe slug of the collection to delete.

Headers

NameRequiredDescription
AcceptYesSpecifies the response content type. Must be application/json.
AuthorizationYesRequired. Must be a Bearer token with admin scope.
project-idYesThe unique identifier for the project.

Body Parameters

NameTypeRequiredDescription
slugstringYesMust 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."
        ]
    }
}

Search documentation

Find guides and reference pages