Skip to content

Project documents

project_documents

Project documents resource group.

Wraps two endpoints for plain-text project documents (custom instructions, reference material attached to a project):

  • GET /v1/compliance/apps/projects/documents/{document_id} — fetch one document including its text content.
  • DELETE /v1/compliance/apps/projects/documents/{document_id} — hard-delete a document.

The list-of-documents view lives on the parent project — call list_attachments and filter by type == "project_doc". The discriminator returns both binary files (project_file) and documents (project_doc) because the API lists them on the same endpoint.

ProjectDocument dataclass

The full content of one project document.

Attributes:

Name Type Description
id str

Tagged document identifier (claude_proj_doc_...).

filename str

Display name (e.g. "instructions.txt").

content str

Document body, as plain text.

created_at str

RFC 3339 creation timestamp.

user dict[str, Any] | None

Creator info (id, email_address) or None when the creator's account has been deleted. Kept as a raw dict.

extra dict[str, Any]

Any additional fields the API adds in a later revision.

from_dict classmethod

from_dict(body: Mapping[str, Any]) -> 'ProjectDocument'

Build a ProjectDocument from one decoded record.

ProjectDocuments

Synchronous client for the Project Documents endpoints.

get

get(document_id: str) -> ProjectDocument

Fetch one project document, content included.

Parameters:

Name Type Description Default
document_id str

Tagged document identifier (e.g. the id from an attachment with type == "project_doc").

required

Raises:

Type Description
NotFoundError

When document_id does not exist or has already been deleted.

APIError

For any other non-2xx response.

delete

delete(document_id: str) -> None

Hard-delete a project document.

Returns None on success; the server's confirmation payload is discarded.

Raises:

Type Description
NotFoundError

When document_id does not exist.

APIError

For any other non-2xx response.

AsyncProjectDocuments

Asynchronous client for the Project Documents endpoints.

get async

get(document_id: str) -> ProjectDocument

Async analogue of get.

delete async

delete(document_id: str) -> None

Async analogue of delete.