Projects¶
projects ¶
Projects resource group.
Wraps four endpoints under /v1/compliance/apps/projects:
GET /v1/compliance/apps/projects— offset-paginated project list. Exposed vialist(one page) anditer(auto-paginate).GET /v1/compliance/apps/projects/{project_id}— single fetch returning the richerProjectDetailshape.DELETE /v1/compliance/apps/projects/{project_id}— hard delete. Returns 409 /ConflictErrorwhen 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 ( |
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
|
|
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 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
¶
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 usingidasclaude_file_id."project_doc"— plain-text document. Fetch contents viagetusingidas the document ID.
Attributes:
| Name | Type | Description |
|---|---|---|
type |
str
|
Discriminator string. |
id |
str
|
Attachment identifier ( |
created_at |
str
|
RFC 3339 creation timestamp. |
filename |
str
|
Display name. |
mime_type |
str
|
MIME type. |
extra |
dict[str, Any]
|
Any additional fields the API adds in a later revision. |
from_dict
classmethod
¶
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
|
|
None
|
created_at_gt
|
str | None
|
|
None
|
created_at_lte
|
str | None
|
|
None
|
created_at_lt
|
str | None
|
|
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 ¶
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 |
APIError
|
For any other non-2xx response. |
delete ¶
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 |
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 ¶
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.
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.