Delete a Field
This endpoint soft-deletes a field from a collection.
Endpoint
[DELETE]
/collections/{collection_slug}/fields/{field_uuid}Permissions
This endpoint requires a token with the admin ability.
Path Parameters
| Name | Required | Description |
|---|---|---|
collection_slug | Yes | The slug of the collection. |
field_uuid | Yes | The UUID of the field 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. |
Example Requests
const collectionSlug = 'blog-posts';
const fieldUuid = 'a1b2c3d4-0001-0000-0000-000000000001';
axios.delete(`https://your-domain.com/api/collections/${collectionSlug}/fields/${fieldUuid}`, {
headers: {
'Accept': 'application/json',
'Authorization': 'Bearer YOUR_API_TOKEN',
'project-id': 'YOUR_PROJECT_UUID'
}
});use Illuminate\Support\Facades\Http;
$collectionSlug = 'blog-posts';
$fieldUuid = 'a1b2c3d4-0001-0000-0000-000000000001';
$response = Http::withToken('YOUR_API_TOKEN')->withHeaders([
'Accept' => 'application/json',
'project-id' => 'YOUR_PROJECT_UUID'
])->delete("https://your-domain.com/api/collections/{$collectionSlug}/fields/{$fieldUuid}");curl -X DELETE "https://your-domain.com/api/collections/blog-posts/fields/a1b2c3d4-0001-0000-0000-000000000001" \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "project-id: YOUR_PROJECT_UUID"Responses
204: No Content
The field was 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 or the field does not exist.
{
"message": "Field not found."
}