Project documents¶
project_documents ¶
Project documents resource group.
Wraps three 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.GET /v1/compliance/apps/projects/documents/{document_id}/metadata— fetch the same document's metadata without its body, which is what you want when enumerating rather than exporting.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 ( |
filename |
str
|
Display name (e.g. |
content |
str
|
Document body, as plain text. |
created_at |
str
|
RFC 3339 creation timestamp. |
user |
dict[str, Any] | None
|
Creator info ( |
extra |
dict[str, Any]
|
Any additional fields the API adds in a later revision. |
from_dict
classmethod
¶
Build a ProjectDocument from one decoded record.
ProjectDocumentMetadata
dataclass
¶
One project document's metadata, without its body.
Use this to enumerate documents cheaply. get returns the same
document with its text, which means pulling every body just to
read a filename or a size.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str
|
Tagged document identifier ( |
claude_project_id |
str
|
The project the document belongs to. |
filename |
str
|
Display name. |
mime_type |
str
|
Always |
size_bytes |
int | None
|
Size of the stored text. |
md5 |
str | None
|
Lowercase hex MD5 of the stored text. |
created_at |
str
|
RFC 3339 creation timestamp. |
user |
dict[str, Any] | None
|
Creator info ( |
extra |
dict[str, Any]
|
Any additional fields the API adds in a later revision. |
from_dict
classmethod
¶
Build a ProjectDocumentMetadata from one decoded record.
ProjectDocuments ¶
Synchronous client for the Project Documents endpoints.
get ¶
Fetch one project document, content included.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
document_id
|
str
|
Tagged document identifier (e.g. the |
required |
Raises:
| Type | Description |
|---|---|
NotFoundError
|
When |
APIError
|
For any other non-2xx response. |
get_metadata ¶
Fetch one project document's metadata, without its body.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
document_id
|
str
|
Tagged document identifier. |
required |
Raises:
| Type | Description |
|---|---|
NotFoundError
|
When |
APIError
|
For any other non-2xx response. |
delete ¶
Hard-delete a project document.
Returns None on success; the server's confirmation payload
is discarded.
Raises:
| Type | Description |
|---|---|
NotFoundError
|
When |
APIError
|
For any other non-2xx response. |
AsyncProjectDocuments ¶
Asynchronous client for the Project Documents endpoints.