Delete a collection
DELETE
/cms/data/{collection}
const url = 'https://api.example.com/cms/data/matches?force=1';const options = {method: 'DELETE', headers: {'API-Key': '<API-Key>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request DELETE \ --url 'https://api.example.com/cms/data/matches?force=1' \ --header 'API-Key: <API-Key>'Refused while other collections’ fields point to it. A collection with records needs force=1: its records are then deleted in the background (202). Requires the “Structured data - Delete collection” permission.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”collection
required
string
Collection key
Example
matchesQuery Parameters
Section titled “Query Parameters”force
string
1 to delete the records too
Responses
Section titled “Responses”Being deleted with its records
Deleted
Needs an API key linked to a CMS user with the Structured data permission
No such collection or record
Still has records (without force=1), or other collections point to it