Skip to content

Projects

projects

Projects resource group.

Wraps four endpoints under /v1/compliance/apps/projects:

  • GET /v1/compliance/apps/projects — offset-paginated project list. Exposed via list (one page) and iter (auto-paginate).
  • GET /v1/compliance/apps/projects/{project_id} — single fetch returning the richer ProjectDetail shape.
  • DELETE /v1/compliance/apps/projects/{project_id} — hard delete. Returns 409 / ConflictError when the project still has chats attached. The SDK does not pre-check; the server is the source of truth.
  • GET /v1/compliance/apps/projects/{project_id}/attachments — offset-paginated list of files and documents attached to a project.

Project document content lives on a sibling resource group, ProjectDocuments.

Project dataclass

A single Compliance API project (list-shape).

Use get to fetch the richer ProjectDetail.

Attributes:

Name Type Description
id str

Tagged project identifier (claude_proj_...).

name str

Project name.

created_at str

RFC 3339 creation timestamp.

updated_at str

RFC 3339 last-update timestamp.

organization_id str

Owning organisation's tagged ID.

is_private bool

True when the project is visible only to the creator and specified collaborators.

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]) -> 'Project'

Build a Project from one decoded record.

ProjectDetail dataclass

Bases: Project

Detail view of a project, returned by get.

Inherits every Project field and adds four counts / text fields that the list endpoint omits.

Attributes:

Name Type Description
description str

Free-form project description.

instructions str

Project's custom instructions / prompt.

chats_count int

Number of chats inside the project.

attachments_count int

Number of files + documents attached.

from_dict classmethod

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

Build a ProjectDetail from one decoded record.

ProjectAttachment dataclass

An attachment on a project — either a binary file or a doc.

Discriminate on type:

  • "project_file" — binary file. Download via the Files resource using id as claude_file_id.
  • "project_doc" — plain-text document. Fetch contents via get using id as the document ID.

Attributes:

Name Type Description
type str

Discriminator string. "project_file" or "project_doc".

id str

Attachment identifier (claude_file_... or claude_proj_doc_...).

created_at str

RFC 3339 creation timestamp.

filename str

Display name.

mime_type str

MIME type. "text/plain" for project docs; otherwise whatever the user uploaded.

extra dict[str, Any]

Any additional fields the API adds in a later revision.

from_dict classmethod

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

Build a ProjectAttachment from one decoded record.

Projects

Synchronous client for the Projects endpoints.

list

list(
    *,
    organization_ids: StrList | None = None,
    user_ids: StrList | None = None,
    created_at_gte: str | None = None,
    created_at_gt: str | None = None,
    created_at_lte: str | None = None,
    created_at_lt: str | None = None,
    page: str | None = None,
    limit: int | None = None
) -> OffsetPage[Project]

Fetch one offset-paginated page of projects.

Parameters:

Name Type Description Default
organization_ids StrList | None

Filter to projects in any of these organisations.

None
user_ids StrList | None

Filter to projects owned by any of these users.

None
created_at_gte str | None

created_at >= value (RFC 3339).

None
created_at_gt str | None

created_at > value (RFC 3339).

None
created_at_lte str | None

created_at <= value (RFC 3339).

None
created_at_lt str | None

created_at < value (RFC 3339).

None
page str | None

Opaque pagination token from a prior response.

None
limit int | None

Maximum results, default 20, max 100.

None

iter

iter(
    *,
    organization_ids: StrList | None = None,
    user_ids: StrList | None = None,
    created_at_gte: str | None = None,
    created_at_gt: str | None = None,
    created_at_lte: str | None = None,
    created_at_lt: str | None = None,
    limit: int | None = None
) -> Iterator[Project]

Iterate every matching project, auto-paginating.

Same filters as list except that page is managed by the iterator.

get

get(project_id: str) -> ProjectDetail

Fetch the detail view of one project.

Returns the richer ProjectDetail (description, instructions, chats_count, attachments_count) in addition to every Project field.

Raises:

Type Description
NotFoundError

When project_id does not exist.

APIError

For any other non-2xx response.

delete

delete(project_id: str) -> None

Hard-delete a project and all its associated data.

The project must have no attached chats — the server returns 409 / ConflictError otherwise. Detach or delete the chats first.

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

Raises:

Type Description
ConflictError

When chats are still attached.

NotFoundError

When project_id does not exist.

APIError

For any other non-2xx response.

list_attachments

list_attachments(
    project_id: str,
    *,
    limit: int | None = None,
    page: str | None = None
) -> OffsetPage[ProjectAttachment]

Fetch one offset-paginated page of attachments for a project.

iter_attachments

iter_attachments(
    project_id: str, *, limit: int | None = None
) -> Iterator[ProjectAttachment]

Iterate every attachment on a project, auto-paginating.

AsyncProjects

Asynchronous client for the Projects endpoints.

list async

list(
    *,
    organization_ids: StrList | None = None,
    user_ids: StrList | None = None,
    created_at_gte: str | None = None,
    created_at_gt: str | None = None,
    created_at_lte: str | None = None,
    created_at_lt: str | None = None,
    page: str | None = None,
    limit: int | None = None
) -> OffsetPage[Project]

Async analogue of list.

iter

iter(
    *,
    organization_ids: StrList | None = None,
    user_ids: StrList | None = None,
    created_at_gte: str | None = None,
    created_at_gt: str | None = None,
    created_at_lte: str | None = None,
    created_at_lt: str | None = None,
    limit: int | None = None
) -> AsyncIterator[Project]

Async analogue of iter.

get async

get(project_id: str) -> ProjectDetail

Async analogue of get.

delete async

delete(project_id: str) -> None

Async analogue of delete.

list_attachments async

list_attachments(
    project_id: str,
    *,
    limit: int | None = None,
    page: str | None = None
) -> OffsetPage[ProjectAttachment]

Async analogue of list_attachments.

iter_attachments

iter_attachments(
    project_id: str, *, limit: int | None = None
) -> AsyncIterator[ProjectAttachment]

Async analogue of iter_attachments.