
Here's a summary of what you can do with Claude Enterprise's Compliance API
This page has been translated by machine translation. View original
This is Katagiri from the AI Business Division / Generative AI Integration Department / West Japan Development Team.
This time, I actually tried out the Compliance API for Claude Enterprise and organized what it can do.
Introduction
Claude Enterprise has an API that allows you to retrieve and delete chats, files, and projects that cannot be confirmed from the admin panel.
The official documentation is divided into separate pages such as "Activity Feed," "Organization Data," "Content Retrieval," and "Integration Design," and since it took me a little time to grasp the overall picture, I decided to organize it all at once.
Target Audience
- Those who want to understand the overall picture of what the Compliance API can do
- Those who want to clarify the differences from audit log exports
What is the Compliance API?
The Compliance API is an API that allows security, legal, and compliance teams to programmatically perform the following for Claude Enterprise organizations:
- Audit organization activity (who did what and when)
- Retrieve or delete the content of chats, files, and projects on claude.ai
- Check the directory of linked organizations, users, roles, and groups, as well as the effective settings of each organization
- Send these events to a SIEM or similar system
All endpoints are under https://api.anthropic.com/v1/compliance/* and are authenticated using the x-api-key header.
Two Types of Keys and How to Use Them
There are two types of keys for calling the Compliance API, and they differ in where they are created and who can create them.
| Key Type | Where Created | Who Can Create | Scope of Use |
|---|---|---|---|
Compliance Access Key (sk-ant-api01-...) |
claude.ai > Organization Settings > API | Primary owner of the parent organization (organization owners can also create one limited to their own organization) | All Compliance API endpoints |
Admin API Key (sk-ant-admin01-...) |
Claude Console > Settings > Admin keys | Organization administrators | Activity Feed only |
Note that only Admin API keys created after the Compliance API was enabled for the organization can have the read:compliance_activities scope.
Admin API keys created before it was enabled do not have this scope.
Analytics API keys and regular Claude API keys (sk-ant-api03-...) cannot be used for Compliance API authentication.
List of Scopes
Compliance Access Keys can be granted the following four scopes in combination, depending on the use case.
Scopes cannot be changed after creation, so a new key must be created.
| Scope | What It Allows |
|---|---|
read:compliance_activities |
Reading the Activity Feed |
read:compliance_org_data |
Reading organization metadata, roles, groups, and effective settings |
read:compliance_user_data |
Reading chats, messages, files, projects, organization users, and group members |
delete:compliance_user_data |
Deleting chats, files, and projects |
The key point is that scopes are separated for reading and deleting.
It is officially recommended to use separate keys for reading and deleting so that "even if a read-only key is leaked, deletion is not possible."
What You Can Do with the Compliance API
1. Activity Feed
GET /v1/compliance/activities retrieves various authentication, chat, file, project, and administrative operations within the organization as individual events.
This is useful when you want to retrospectively check "who did what operation and when" during an incident investigation.
- Available within 1 minute of occurrence, retained for 6 years
- Can be filtered by
activity_types[],actor_ids[],organization_ids[], andcreated_at.* - Does not include prompt or chat text content
Below are the results I got when I checked the activity log after retrieving the organization's user list via API.
Execution Results (partially masked)
{
"data": [
{
"actor": {
"api_key_id": "apikey_01xxxxxxxxxx",
"ip_address": "<IP address>",
"type": "api_actor",
"user_agent": "Python-urllib/3.12"
},
"created_at": "2026-07-23T13:42:54.833688Z",
"id": "activity_01xxxxxxxxxx",
"organization_id": null,
"request_body": null,
"request_id": "req_xxxxxxxxxx",
"request_method": "GET",
"status_code": 200,
"type": "compliance_api_accessed",
"url": "https://api.anthropic.com/v1/compliance/organizations/<organization UUID>/users?limit=100",
"organization_uuid": null
}
],
"has_more": true,
"first_id": "xxxxxxxxxx",
"last_id": "xxxxxxxxxx"
}
You can see when, from which IP address, and which API was accessed.
2. Checking Organizations, Users, Roles, Groups, and Various Settings
Retrieves directory information for the organization and the security settings actually applied. This is useful when you want to mechanically verify "who has what permissions" for user inventory, permission checks for departing or transferred employees, or audit responses.
| Endpoint | Content |
|---|---|
GET /v1/compliance/organizations |
List of organizations |
GET /v1/compliance/organizations/{org_uuid}/users |
List of users in the target organization |
GET /v1/compliance/organizations/{org_uuid}/roles |
List of custom RBAC (role-based access control) roles in the target organization |
GET /v1/compliance/groups |
List of groups |
GET /v1/compliance/groups/{group_id}/members |
List of members in the target group |
GET /v1/compliance/organizations/{org_uuid}/settings |
Settings status (can check SSO enforcement, IP allowlists, data retention periods, etc.) |
Here are the results of retrieving the organization's user list.
Execution Results (partially masked)
{
"data": [
{
"id": "user_xxxxxxxxxx",
"full_name": "Primary Owner",
"email": "<primary owner's email address>",
"created_at": "2026-03-27T04:26:07.728434Z",
"organization_role": "primary_owner"
},
{
"id": "user_xxxxxxxxxx",
"full_name": "tsubasa katagiri",
"email": "katagiri.tsubasa@example.com",
"created_at": "2026-05-18T05:58:34.372882Z",
"organization_role": "owner"
}
],
"has_more": false,
"next_page": null
}
Some users have been omitted, but the organization's user list was successfully retrieved.
3. Retrieving and Deleting Chats, Files, and Projects
The endpoints introduced here allow you to access actual chat content and file contents.
| Endpoint | Content |
|---|---|
GET /v1/compliance/apps/chats |
List of chats (can be filtered to the entire organization or specific users with user_ids[]) |
GET /v1/compliance/apps/chats/{chat_id}/messages |
Message body, attached files, and artifact reference information for a single chat |
GET /v1/compliance/apps/chats/files/{file_id}/content |
Download the contents of a chat attachment |
GET /v1/compliance/apps/chats/generated_files/{id}/content |
Download a file generated by Claude using a tool |
GET /v1/compliance/apps/artifacts/{version_id}/content |
Retrieve the text content of an artifact (one version) |
GET /v1/compliance/apps/projects |
List of projects |
GET /v1/compliance/apps/projects/{project_id} |
Retrieve details of the target project |
GET /v1/compliance/apps/projects/{project_id}/attachments |
List of attachments and documents for a project |
DELETE /v1/compliance/apps/chats/{chat_id} |
Hard delete a chat (including messages and attachments) |
DELETE /v1/compliance/apps/chats/files/{file_id} |
Hard delete a file |
DELETE /v1/compliance/apps/projects/{project_id} |
Hard delete a project (returns a 409 error if chats are still attached) |
All delete operations are executed immediately and cannot be undone.
These features are intended for use cases such as eDiscovery, DLP (data loss prevention), and account deletion for departed employees.
Let me search my chat history.
Execution Results (partially masked)
{
"data": [
{
"id": "claude_chat_xxxxxxxxxx",
"name": "Chat from browser",
"created_at": "2026-07-23T13:52:57.093288Z",
"updated_at": "2026-07-23T14:00:04.063823Z",
"deleted_at": null,
"organization_id": "org_xxxxxxxxxx",
"organization_uuid": "xxxxxxxxxx",
"project_id": null,
"model": "claude-sonnet-5",
"user": {
"id": "user_xxxxxxxxxx",
"email_address": "katagiri.tsubasa@example.com"
},
"href": "https://claude.ai/chat/xxxxxxxxxx"
},
{
"id": "claude_chat_xxxxxxxxxx",
"name": "Chat from app",
"created_at": "2026-07-23T13:55:34.535915Z",
"updated_at": "2026-07-23T13:59:09.917345Z",
"deleted_at": null,
"organization_id": "org_xxxxxxxxxx",
"organization_uuid": "xxxxxxxxxx",
"project_id": null,
"model": "claude-haiku-4-5-20251001",
"user": {
"id": "user_xxxxxxxxxx",
"email_address": "katagiri.tsubasa@example.com"
},
"href": "https://claude.ai/chat/xxxxxxxxxx"
}
],
"has_more": false,
"first_id": "xxxxxxxxxx",
"last_id": "xxxxxxxxxx"
}
I was able to confirm that not only browser chats but also chats from Claude Desktop are recorded in the history.
I was also able to view the messages as shown below.
Full message retrieval results (partially masked)
{
"id": "claude_chat_xxxxxxxxxx",
"name": "Chat from app",
"created_at": "2026-07-23T13:55:34.535915Z",
"updated_at": "2026-07-23T13:59:09.917345Z",
"deleted_at": null,
"organization_id": "org_xxxxxxxxxx",
"organization_uuid": "xxxxxxxxxx",
"project_id": null,
"model": "claude-haiku-4-5-20251001",
"user": {
"id": "user_xxxxxxxxxx",
"email_address": "katagiri.tsubasa@example.com"
},
"chat_messages": [
{
"id": "claude_chat_msg_xxxxxxxxxx",
"role": "user",
"created_at": "2026-07-23T13:55:35.619504Z",
"content": [
{
"type": "text",
"text": "This is a request from the app.",
"truncated": false,
"thinking_redacted": false
}
],
"files": null,
"generated_files": null,
"artifacts": null
},
{
"id": "claude_chat_msg_xxxxxxxxxx",
"role": "assistant",
"created_at": "2026-07-23T13:55:40.215829Z",
"content": [
{
"type": "text",
"text": "Hello. This is a request from the app. Understood.\n\nIf there is anything I can help you with, please feel free to let me know. I can support you with the following:\n\n- Document creation and editing (Word, PDF, Excel, PowerPoint)\n- Programming and coding\n- Data analysis and spreadsheets\n- Writing text and articles\n- Information search and research\n- Other general business tasks\n\nHowever, in accordance with organizational instructions, the following information cannot be entered:\n- Personal or confidential information of customers or business partners\n- Internal documents or sales information classified as confidential\n- Unpublished product information, R&D information, or patent-related information\n- Other people's passwords or authentication information\n\nWhat kind of assistance do you need?",
"truncated": false,
"thinking_redacted": false
}
],
"files": null,
"generated_files": null,
"artifacts": null
}
],
"href": "https://claude.ai/chat/xxxxxxxxxx",
"has_more": false,
"first_id": "xxxxxxxxxx",
"last_id": "xxxxxxxxxx"
}
Differences from Adjacent Features
There are two features whose roles overlap with the Compliance API.
| Feature | What's Different |
|---|---|
| Admin panel audit log export (CSV) | Can reference up to 180 days in the past. CSV download only. Cannot retrieve content of chats, files, or projects. |
| Analytics API | Can retrieve aggregate values for IT/FinOps/platform teams. The Compliance API can retrieve event-level data. |
Things to Know When Operating in Production
When actually operating the Compliance API in production, it is reassuring to understand the following design knowledge.
- Feed retrieval patterns
You can choose between a fixed-schedule execution approach or a method that reads from where you left off using a cursor. - Ingesting into a SIEM and joining data (if you have already deployed Datadog, etc.)
The Activity Feed functions as an audit trail on its own, but if you ingest the retrieved data into a SIEM like Datadog, you can join it with already-aggregated VPN and IdP logs usingactor.user_id,actor.ip_address, andcreated_atto verify "whether it was really that person's operation." - Retention period planning
Activity Feed is retained for 6 years (managed by Anthropic), content depends on the organization's retention policy (unlimited by default, managed by the organization), and hard-deleted data is not retained.
Let me actually try the "method that reads from where you left off using a cursor."
Simply pass the last_id from the first response directly as the after_id in the second request.
Execution results for the 1st and 2nd runs (partially masked)
Here are the 1st results.
{
"data": [
{ "type": "compliance_api_accessed", "created_at": "2026-07-23T14:04:42Z", "id": "<activity_id>" },
{ "type": "compliance_api_accessed", "created_at": "2026-07-23T14:00:30Z", "id": "<activity_id>" }
],
"has_more": true,
"first_id": "<opaque cursor>",
"last_id": "<page1のlast_id>"
}
Here are the 2nd results, where the last_id was passed directly as after_id. Older activities different from the 1st run are returned, confirming that the cursor is properly advancing.
{
"data": [
{ "type": "compliance_api_accessed", "created_at": "2026-07-23T14:00:20Z", "id": "<activity_id>" },
{ "type": "claude_chat_deleted", "created_at": "2026-07-23T14:00:18Z", "id": "<activity_id>" }
],
"has_more": true,
"first_id": "<opaque cursor>",
"last_id": "<opaque cursor>"
}
Also note that the type compliance_api_accessed is recorded as-is in the Activity Feed.
This means that "who called the Compliance API, when, and from which IP" is recorded in the Activity Feed.
From this record, I was able to confirm that "access to the Compliance API itself can also be audited against other security logs."
Limitations and Notes
- The rate limit is 600 requests per minute per parent organization.
- Content-related endpoints only target data from claude.ai.
Prompts and responses from Claude Console or Claude API workloads are not included at all. - Hard deletions are immediate, permanent, and cannot be undone.
- The pagination method differs depending on the endpoint.
Summary
I found it easier to understand the overall picture of the Compliance API by dividing it into three areas: Activity Feed (audit logs), directory-related (organizations/users/roles/groups/effective settings), and content-related (retrieval and deletion of chats/files/projects).
In addition, when operating in production, it is necessary to separately understand feed retrieval patterns, SIEM ingestion, and retention period design.
Being able to access these via API makes it easy to automate periodic retrieval, which is a point I would like to actively take advantage of.
The following article is helpful for daily retrieval, so please check it out.
