> For the complete documentation index, see [llms.txt](https://docs.facephi.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.facephi.com/docs.facephi-pt-br/sdks/backend-sdk/backend1n/technical_documentation/api_reference/collections/collections-collectionid.md). Agents can also search and read this documentation through its [MCP server](https://docs.facephi.com/~gitbook/mcp).

# /collections/{collectionId}

Deletes a collection from the database, together with all the images and specimens (faces) that reference it.

```json
{"openapi":"3.0.1","info":{"title":"Backend1n-Service REST API","version":"5.0.0"},"servers":[{"url":"http://127.0.0.1:6982/"}],"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"JWT signed with HS256 (shared secret `auth_jwt_secret`) and with a non-expired `exp` claim; if it includes `nbf`, it must be currently valid. Only applied if `auth_enabled` is true and `auth_accept_authorization_header` is true. The `Bearer` scheme is case-insensitive.\n"},"ApiKeyAuth":{"type":"apiKey","in":"header","name":"x-api-key","description":"The same JWT sent in an API key header. The default name is `x-api-key` and it can be changed with `auth_api_key_header_name`; only applied if `auth_accept_api_key_header` is true. If both headers are sent, `Authorization` takes precedence.\n"}},"schemas":{"CollectionId":{"type":"string","minLength":1,"pattern":"^[A-Za-z0-9_-]+$","description":"An identifier that allows grouping different images or biometric templates in a common space. It can only contain ASCII letters (A-Z, a-z), digits (0-9), underscore (`_`) and hyphen (`-`); it cannot be empty and it is case-sensitive. The following are **not allowed**: spaces, dots, `+`, `:`, `@`, quotes, `%`, `~`, `/`, or non-ASCII characters (`ñ`, accents, emoji...): the identifier is used as a path parameter and any other character prevents its use. It must correspond to a collection previously created with `POST /collections`.\n"},"BadRequestResult":{"type":"object","description":"Result when incorrect parameters arrive in the request.","properties":{"status":{"type":"number"},"error":{"type":"string"},"message":{"type":"string","description":"Specific description of the reason for the error. It is the only field that indicates the real cause."},"timeStamp":{"$ref":"#/components/schemas/TimeStamp"}}},"TimeStamp":{"type":"string","description":"A date/time value (UTC) in \"%Y-%m-%dT%H:%M:%SZ\" format."},"UnauthorizedResult":{"type":"object","description":"JWT authentication is enabled and the request does not pass it. It is accompanied by the header `WWW-Authenticate: Bearer`. Values of `message`: `Missing authentication token` (no token or unsupported scheme), `JWT token validation failed` (invalid signature, algorithm or format), `JWT token is expired`, `JWT token does not include exp claim` and `JWT token is not yet valid` (future `nbf`).\n","properties":{"status":{"type":"number"},"error":{"type":"string"},"message":{"type":"string"},"timeStamp":{"$ref":"#/components/schemas/TimeStamp"}}},"ExceptionResult":{"type":"object","description":"An error occurred while calling the backend services.","properties":{"status":{"type":"number"},"error":{"type":"string"},"exception":{"type":"string","description":"Specific description of the reason for the exception (internal service text; it is not part of the contract)."},"timeStamp":{"$ref":"#/components/schemas/TimeStamp"}}}},"responses":{"Unauthorized":{"description":"JWT authentication is enabled and the token is missing or invalid.","headers":{"WWW-Authenticate":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedResult"}}}}}},"paths":{"/collections/{collectionId}":{"delete":{"description":"Deletes a collection from the database, together with all the images and specimens (faces) that reference it.","tags":["Collections"],"parameters":[{"in":"path","name":"collectionId","schema":{"$ref":"#/components/schemas/CollectionId"},"required":true}],"responses":{"200":{"description":"The result of the deletion.","content":{"application/json":{"schema":{"type":"boolean","description":"true if the collection was deleted"}}}},"400":{"description":"Incorrect parameters arrive in the request, or no collection exists with that collectionId.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestResult"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"description":"An error occurred while calling the backend.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExceptionResult"}}}}}}}}}
```
