# Delete From Collection

This endpoint can be used to delete on or more documents from a Xenioo Database Collection.&#x20;

### Requirements

To successfully invoke this endpoint :

1. A [Bot Level Authorization Token](https://docs.xenioo.com/xenioo-api/globa-platform-api/authorization#bot-level-token-request) must be created and sent in the header.
2. An active Database package must be active on the target account.
3. The desired [collection ](https://docs.xenioo.com/database/collections)must exist and must be flagged as [accessible through API](https://docs.xenioo.com/collections#enable-api-access).

### Request

The following request shows how to delete a single document from a Xenioo Database Collection:

```bash
curl --location --request DELETE 'https://<API ROUTE>/data/<COLLECTIONNAME>/<DOCUMENT ID>' \
--header 'Authorization: Bearer <BOT AUTH TOKEN>' \
--header 'Content-Type: application/json' \
```

[URL Filtering Syntax](https://docs.xenioo.com/database/database-api-access/url-filtering-syntax) can be used on the request in place of \<DOCUMENT ID> to delete multiple documents with a single call.

### Response

If successful, this call will return the number of documents that were deleted.

```bash
{
    "Affected":XXX
}
```

### Response Codes

This endpoint will reply with the following standard HTTP codes.

| Code | Meaning                                                                   |
| ---- | ------------------------------------------------------------------------- |
| 200  | Ok. The request has been successfully fulfilled.                          |
| 400  | Bad Request. The call does not contain the data required to be fulfilled. |
| 404  | Not Found. The specified collection has not been found.                   |
| 403  | Unauthorized. The specified collection cannot be access through API       |
