The Compliance API lets organization administrators manage data lifecycle: requesting exports, deleting application records, and configuring retention policies including zero-data-residence regions.

Authentication and authorization

Compliance endpoints require a Clerk JWT and an active organization. Only organization owners and admins can access these endpoints.

Endpoints

Compliance requests

Create an export request

Response 201 Created
If app_filters is omitted or empty, the request covers all supported apps: chats, projects, and artifacts.

Create a deletion request

Retrieve a request

Response 200 OK

Complete a request

Mark a pending or running request as completed. This also marks all pending references as processed.

Download an export

Response 200 OK

Per-app record management

Admins can list and delete records directly. Delete operations are irreversible.

List chats

Response 200 OK

Delete a chat

Response 204 No Content Deleting a chat also removes its messages and replies. Deleting a project removes its files. Deleting an artifact removes its sections and revisions.

Retention policy

Configure how long each app class is retained and whether zero data residence (zero_data_residence) is enforced.

Get the current policy

Response 200 OK
If no policy has been set, the response returns the organization ID with all retention fields set to null and zero_data_residence set to false.

Set the retention policy

Request/response fields

Compliance request object

Retention policy object

Error codes

  • Audit logs — Query administrative actions and compliance events
  • Security model — Trust boundaries and data protection
  • BYOC runtime — Self-hosted and zero-data-residence deployments