DELETE /api/data/:collectionName/:id
Permanently removes the document with the given ID from the collection. This operation cannot be undone.
Required Header
x-api-key: sk_live_… by default. pk_live_… is accepted only when the collection has RLS enabled and the request includes Authorization: Bearer <accessToken>.
Path Parameters
The name of the collection containing the document.
The MongoDB ObjectId string of the document to delete.
RLS Ownership Check
When usingpk_live with RLS enabled, urBackend compares the existing document’s owner field against the authenticated user’s ID. Users can only delete their own documents — attempting to delete another user’s document returns 403.
Response Fields
true when the document was deleted.Human-readable confirmation message.
Code Examples
Success Response
Errors
| Status | Cause |
|---|---|
401 Unauthorized | Missing/invalid API key, or missing Bearer token on an RLS-enabled collection |
403 Forbidden | pk_live without RLS, or the authenticated user doesn’t own the document |
404 Not Found | No document with that ID exists in the collection |
