Loading...
  • Messages
  • Managed Agents
  • Admin
Search...
⌘K
Organization
Admin APIWorkspaces
Authentication
OverviewWorkload Identity FederationWIF reference
Monitoring
Usage and Cost APIRate Limits APIClaude Code Analytics API
Data & compliance
Data residencyAPI and data retention
Compliance API
OverviewGet accessActivity FeedChats, files, and projectsOrganizations, users, roles, and groupsDesign your integrationErrorsFAQ
Log in
Chats, files, and projects
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...

Solutions

  • AI agents
  • Code modernization
  • Coding
  • Customer support
  • Education
  • Financial services
  • Government
  • Life sciences

Partners

  • Amazon Bedrock
  • Google Cloud's Vertex AI

Learn

  • Blog
  • Courses
  • Use cases
  • Connectors
  • Customer stories
  • Engineering at Anthropic
  • Events
  • Powered by Claude
  • Service partners
  • Startups program

Company

  • Anthropic
  • Careers
  • Economic Futures
  • Research
  • News
  • Responsible Scaling Policy
  • Security and compliance
  • Transparency

Learn

  • Blog
  • Courses
  • Use cases
  • Connectors
  • Customer stories
  • Engineering at Anthropic
  • Events
  • Powered by Claude
  • Service partners
  • Startups program

Help and security

  • Availability
  • Status
  • Support
  • Discord

Terms and policies

  • Privacy policy
  • Responsible disclosure policy
  • Terms of service: Commercial
  • Terms of service: Consumer
  • Usage policy
Admin/Compliance API

Retrieve and delete chats, files, and projects

Access chat content, file attachments, and projects for claude.ai organizations through the Compliance API.

The Compliance API is available only on the Claude Enterprise plan and must be enabled before use. See Get access to the Compliance API.

Required scope: read:compliance_user_data on the Compliance Access Key. The delete endpoints also require delete:compliance_user_data.

Prerequisite: To list chats, at least one user ID from List organization users. The other endpoints on this page take resource IDs directly.

The endpoints on this page expose claude.ai chat content, file uploads, projects, and project attachments to compliance reviewers. They support eDiscovery (electronic discovery) exports, data loss prevention (DLP) enforcement, and account-deletion responses. Content is retained for as long as your organization's retention policy allows. Chats that a user has soft-deleted in claude.ai remain visible through the Compliance API with deleted_at populated; chats that have been hard-deleted (through the Compliance API itself, or after the organization's retention window expires) are not retrievable.

Both scopes are granted only on Compliance Access Keys (sk-ant-api01-...) created in claude.ai; see Get access to the Compliance API to provision one. The read:compliance_user_data scope covers retrieval; delete:compliance_user_data is required only for the delete endpoints. The chat, file, project, and attachment endpoints are not available to Admin API keys (sk-ant-admin01-...); calls authenticated with an Admin API key return 403 Forbidden.

Endpoints on this page paginate two ways; see Paginate results for the full reference. Each section notes which scheme applies.

Retrieve chats and messages

Use List chats to page through chat metadata, then Get chat messages to fetch the full message content of one chat.

The chat list endpoint requires at least one user_ids[] value (and accepts up to 10 in one request), so enumerate user IDs first with List organization users, then list chats for each user or for each batch of users. The following request lists chats owned by a specific user since a given date.

cURL
curl --fail-with-body -sS -G \
  "https://api.anthropic.com/v1/compliance/apps/chats" \
  --header "x-api-key: $ANTHROPIC_COMPLIANCE_ACCESS_KEY" \
  --data-urlencode "user_ids[]=user_01XyDMpzjS89pFZXqSFUBDr6" \
  --data-urlencode "organization_ids[]=91012d09-e48b-438e-a489-1bebfd8fa6f9" \
  --data-urlencode "created_at.gte=2025-06-01T00:00:00Z" \
  --data-urlencode "limit=100"
Response
{
  "data": [
    {
      "id": "claude_chat_01H5CWunD7RpVJ5bHa8RCkja",
      "name": "Product Requirements Discussion",
      "created_at": "2026-04-10T08:09:10Z",
      "updated_at": "2026-04-10T09:10:11Z",
      "deleted_at": null,
      "href": "https://claude.ai/chat/abcdef01-2345-6789-abcd-ef0123456789",
      "model": "claude-opus-4-7",
      "organization_id": "org_01Wv6QeBcDfGhJkLmNpQrSt8",
      "organization_uuid": "91012d09-e48b-438e-a489-1bebfd8fa6f9",
      "project_id": "claude_proj_01KGp4eZNug9ri4kE35RSppq",
      "user": {
        "id": "user_01XyDMpzjS89pFZXqSFUBDr6",
        "email_address": "[email protected]"
      }
    }
  ],
  "has_more": true,
  "first_id": "claude_chat_01H5CWunD7RpVJ5bHa8RCkja",
  "last_id": "claude_chat_01H5CWunD7RpVJ5bHa8RCkja"
}

Listing chats returns metadata only. See List chats for the full filter list; in addition to the required user_ids[], the updated_at.* bounds are useful for incremental review of chats that have changed since a previous export.

Chat results are sorted by created_at ascending (oldest first), with ties broken by id. Pagination uses the same first_id/last_id/has_more cursor fields as Paginate results; pass last_id as after_id to walk forward toward newer chats, or first_id as before_id to walk back toward older ones.

To pull the actual chat content, attached files, and inline artifacts (structured documents Claude generates inside a chat), follow up with the messages endpoint for each chat ID:

cURL
chat_id="claude_chat_01H5CWunD7RpVJ5bHa8RCkja"

curl --fail-with-body -sS \
  "https://api.anthropic.com/v1/compliance/apps/chats/$chat_id/messages" \
  --header "x-api-key: $ANTHROPIC_COMPLIANCE_ACCESS_KEY"

The messages endpoint returns the chat's metadata plus a chat_messages array sorted by created_at. When limit is omitted, the full message set is returned in one response; pass limit, after_id, or before_id to page through very long chats (see Get chat messages for the cursor parameters). For user messages, created_at is when the message was sent; for assistant messages, it is when Claude finished generating the message. Each message carries its text content and, when present, any uploaded files (typically on user messages), any tool-generated files, and any artifacts the assistant produced or updated (typically on assistant messages):

Response
{
  "id": "claude_chat_01H5CWunD7RpVJ5bHa8RCkja",
  "name": "Product Requirements Discussion",
  "created_at": "2026-04-10T08:09:10Z",
  "updated_at": "2026-04-10T09:10:11Z",
  "deleted_at": null,
  "href": "https://claude.ai/chat/abcdef01-2345-6789-abcd-ef0123456789",
  "model": "claude-opus-4-7",
  "organization_id": "org_01Wv6QeBcDfGhJkLmNpQrSt8",
  "organization_uuid": "91012d09-e48b-438e-a489-1bebfd8fa6f9",
  "project_id": "claude_proj_01KGp4eZNug9ri4kE35RSppq",
  "user": {
    "id": "user_01XyDMpzjS89pFZXqSFUBDr6",
    "email_address": "[email protected]"
  },
  "chat_messages": [
    {
      "id": "claude_chat_msg_01VnBPkLmtj7YdW5QrXKEA8c",
      "role": "user",
      "created_at": "2026-04-10T08:09:10Z",
      "content": [
        {
          "type": "text",
          "text": "Can you help me draft requirements for our new dashboard feature?"
        }
      ],
      "files": [
        {
          "id": "claude_file_01UaT9wBcDfGhJkLmNpQrSv7",
          "filename": "dashboard_mockup_v1.pdf",
          "mime_type": "application/pdf"
        }
      ]
    },
    {
      "id": "claude_chat_msg_01M8tFcHwbQ2kY6NpEjRZv4D",
      "role": "assistant",
      "created_at": "2026-04-10T08:09:11Z",
      "content": [
        {
          "type": "text",
          "text": "I'd be happy to help you draft requirements for your dashboard feature..."
        }
      ],
      "generated_files": [
        {
          "id": "claude_gen_file_01TbR8wAcCeFhJkLnPqStUvX",
          "filename": "requirements_summary.csv",
          "mime_type": "text/csv"
        }
      ],
      "artifacts": [
        {
          "id": "claude_artifact_01HqRsTuVwXyZa2BcDeFgH4J",
          "version_id": "claude_artifact_version_01KmNpQrSt3UvWxYz5AbCdEfG",
          "title": "Dashboard Requirements Draft",
          "artifact_type": "text/markdown"
        }
      ]
    }
  ],
  "has_more": false,
  "first_id": "eyJtc2dfdXVpZCI6ICIwZjcwYjA2Ni0uLi4ifQ==",
  "last_id": "eyJtc2dfdXVpZCI6ICJhNGUwYjE3Mi0uLi4ifQ=="
}

files, generated_files, and artifacts can each be null on a given message. generated_files lists downloadable files the assistant created during the conversation through tool use (for example, PDFs, spreadsheets, or slide decks). It is distinct from files, which are uploads the user attached to the message. Pass each entry's id to the generated file content endpoint to download it.

Retrieve files and artifacts

Files and artifacts are downloaded by ID, not listed independently. The IDs come from the chat messages endpoint in Retrieve chats and messages (the files, generated_files, and artifacts arrays on each message) or, for project-level uploads, from the project attachments endpoint.

Pick the endpoint that matches your ID type and the data you need. The same file content endpoint serves both chat files and project files.

You haveYou wantUse this endpoint
claude_file_* IDThe file's binary contentDownload file content
claude_gen_file_* IDA tool-generated file's binary contentDownload a Claude-generated file
claude_artifact_version_* IDOne artifact version's textDownload artifact content
claude_file_* IDThe file's metadata only (filename, MIME type, size)Get file metadata
claude_proj_doc_* IDA project document's plain-text contentGet project document content

The file content endpoint streams the original upload as a chunked binary response with these headers:

  • Content-Disposition: attachment; filename*=utf-8''<percent-encoded filename> carries the original upload filename in RFC 5987 extended form. The extended form is used for every filename, not only non-ASCII ones.
  • Content-Type carries the upload's MIME type.
  • Transfer-Encoding: chunked is always set.
cURL
file_id="claude_file_01UaT9wBcDfGhJkLmNpQrSv7"

curl --fail-with-body -sS -OJ \
  --header "x-api-key: $ANTHROPIC_COMPLIANCE_ACCESS_KEY" \
  "https://api.anthropic.com/v1/compliance/apps/chats/files/$file_id/content"

The -OJ flags tell curl to save the response under the filename from Content-Disposition, which is the original filename the user uploaded.

The artifact content endpoint returns the text body of one artifact version. Pass the version_id from one of the entries in an assistant message's artifacts array, not the artifact's stable id. Each new version of an artifact has its own version_id, and the Compliance API serves the exact bytes of that version.

Retrieve projects and attachments

Projects bundle related chats together with custom instructions, knowledge base content, and attached files or text documents. The Compliance API exposes project metadata, project details, and the list of attachments belonging to a project.

  • List projects
  • Get project details
  • List project attachments
  • Get project document content

Project results are sorted by creation date ascending. Attachment results are sorted by created_at ascending, with ties broken by id. Project list and attachment list responses paginate with an opaque next_page page token instead of the first_id/last_id cursors used by chats and the Activity Feed. Pass the token back as the page query parameter on the next request.

Project files versus project documents

A project attachment is one of two distinct shapes, identified by the type discriminator on each entry:

Entries with type of project_file are binary uploads (PDFs, images, spreadsheets) whose IDs start with claude_file_; download them with Download file content. Entries with type of project_doc are plain-text documents (always text/plain) whose IDs start with claude_proj_doc_; fetch them with Get project document content.

A consumer that walks the attachment list must branch on type and call the matching content endpoint for each entry. The following request lists one page of attachments; paginate by passing next_page back as the page parameter until has_more is false.

cURL
project_id="claude_proj_01KGp4eZNug9ri4kE35RSppq"

curl --fail-with-body -sS -G \
  "https://api.anthropic.com/v1/compliance/apps/projects/$project_id/attachments" \
  --header "x-api-key: $ANTHROPIC_COMPLIANCE_ACCESS_KEY"
Response
{
  "data": [
    {
      "id": "claude_file_01UaT9wBcDfGhJkLmNpQrSv7",
      "created_at": "2026-04-10T08:09:10Z",
      "filename": "dashboard_mockup_v1.pdf",
      "mime_type": "application/pdf",
      "type": "project_file"
    },
    {
      "id": "claude_proj_doc_01YnT8sBcWvUtXzQpMkRfDgH",
      "created_at": "2026-04-10T08:09:11Z",
      "filename": "requirements.md",
      "mime_type": "text/plain",
      "type": "project_doc"
    }
  ],
  "has_more": false,
  "next_page": null
}

Delete content

Every successful delete is permanent and immediate. There is no recovery window.

The Compliance API exposes hard-delete endpoints for chats, files, project documents, and entire projects. A hard-deleted chat cannot be restored, and it stops appearing in list responses afterward (whereas a chat soft-deleted from claude.ai still appears with deleted_at populated).

  • Delete chat: also removes the chat's messages and any files attached to those messages.
  • Delete file: handles both chat files and project files.
  • Delete project document: removes a single project document by ID.
  • Delete project: see Detach chats before deleting a project.

All four endpoints require the delete:compliance_user_data scope, which is granted separately from the read scope when the Compliance Access Key is created.

The following request deletes one chat. The same pattern applies to the other delete endpoints; only the URL changes.

cURL
# WARNING: This operation PERMANENTLY deletes the chat, all of its messages,
# and any attached files. Deletion is immediate and cannot be undone. It
# requires the `delete:compliance_user_data` scope, which is granted separately
# from `read:compliance_user_data` when the Compliance Access Key is created.
# Ensure you have explicit authorization before running this.

chat_id="claude_chat_01H5CWunD7RpVJ5bHa8RCkja"

curl --fail-with-body -sS -X DELETE \
  "https://api.anthropic.com/v1/compliance/apps/chats/$chat_id" \
  --header "x-api-key: $ANTHROPIC_COMPLIANCE_ACCESS_KEY"
Response
{
  "id": "claude_chat_01H5CWunD7RpVJ5bHa8RCkja",
  "type": "claude_chat_deleted"
}

Each successful delete returns a small confirmation envelope with an id and a type discriminator. The chat endpoint returns claude_chat_deleted; check the type field before treating the delete as confirmed. See the response schema on each delete endpoint's API reference page for the exact type value the other endpoints return.

Detach chats before deleting a project

A project cannot be deleted while any chats remain attached to it. The API returns 409 with this body:

{
  "error": {
    "type": "conflict_error",
    "message": "The \"claude_proj_01KGp4eZNug9ri4kE35RSppq\" project cannot be deleted as it has chats attached to it. Delete or detach all chats, and try deleting the project again."
  }
}

To resolve, list the project's chats with GET /v1/compliance/apps/chats?user_ids[]={user_id}&project_ids[]={project_id} (the chat list endpoint requires at least one user_ids[] value; enumerate IDs through List organization users), delete each one with DELETE /v1/compliance/apps/chats/{claude_chat_id} (or move it out of the project from claude.ai), and then retry the project delete.

Next steps

API reference

The full request and response schema for every chat, file, project, and artifact endpoint.

List organizations, users, roles, and groups

Enumerate the people and teams associated with the chats and projects on this page.

Was this page helpful?

  • Retrieve chats and messages
  • Retrieve files and artifacts
  • Retrieve projects and attachments
  • Project files versus project documents
  • Delete content
  • Detach chats before deleting a project
  • Next steps