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.

is_private bool

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

organization_id str | None

Owning organisation's tagged ID. Deprecated by the API in favour of organization_uuid.

organization_uuid str | None

Owning organisation's UUID. Prefer this over organization_id.

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. Describes the stored content, which for some documents is extracted text rather than the original upload.

md5 str | None

Lowercase hex MD5 of the stored content, when recorded. project_file entries only. Use the file metadata endpoint for the authoritative value.

size_bytes int | None

Size of the stored content, when recorded. project_file entries only.

updated_at str | None

Last-modified timestamp. project_doc entries only, and reserved for future use — currently always None.

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.

ProjectCollaborator dataclass

One active role assignment on a project.

The principal is a discriminated union on type, so the field that identifies who differs by variant:

  • "user" — an individual user. user_id carries the ID, or is None when the account is gone.
  • "group" — an RBAC group. group_id carries the ID.
  • "organization" — an organisation-wide grant. Neither ID is set; the grant covers every member.
  • "organization_role" — everyone holding an organisation-level role. organization_role names it.

Attributes:

Name Type Description
type str

Discriminator. Kept as a plain string so a principal kind that has not shipped yet passes through rather than raising.

role str

Role granted on the project — admin, editor, owner, or viewer.

granted_at str

RFC 3339 timestamp of when access was granted.

user_id str | None

Set on user grants; None elsewhere, and also None on a user grant whose account no longer exists.

group_id str | None

Set on group grants; None elsewhere.

organization_role str | None

Set on organization_role grants; None elsewhere.

extra dict[str, Any]

Any additional fields the API adds in a later revision.

from_dict classmethod

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

Build a ProjectCollaborator 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.

list_collaborators

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

Fetch one page of a project's role assignments.

Each entry is one active grant, and the principal is a discriminated union — branch on type before reading user_id / group_id / organization_role.

Parameters:

Name Type Description Default
project_id str

Tagged project identifier (claude_proj_...).

required
limit int | None

Maximum results per page (default 20, max 100).

None
page str | None

Opaque token from a prior response's next_page.

None

Returns:

Type Description
OffsetPage[ProjectCollaborator]

One OffsetPage of ProjectCollaborator objects, sorted

OffsetPage[ProjectCollaborator]

by granted_at ascending.

iter_collaborators

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

Iterate every collaborator 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.

list_collaborators async

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

Async analogue of list_collaborators.

iter_collaborators

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

Async analogue of iter_collaborators.