Delete a Field

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

NameRequiredDescription
collection_slugYesThe slug of the collection.
field_uuidYesThe UUID of the field 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.

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."
}

Search documentation

Find guides and reference pages