Skip to content

client.projects

View as Markdown

client.projects — the projects operations.

On AsyncKindgi every method is the same, awaited.

get_default(*, timeout: float | None = None) -> Project
Signature

Fetch the tenant's Default project. GET /v1/projects/default

Returns the row where Project.isDefault = true (exactly one per tenant), to a caller who can read it, as GET /v1/projects/{projectId} checks. Returns 404 project-not-found when no Default has been provisioned.

list(
*,
limit: int | None = None,
cursor: str | None = None,
org_id: str | UUID | None = None,
name_contains: str | None = None,
timeout: float | None = None,
) -> ProjectCollectionPage
Signature

List projects in the caller's tenant. GET /v1/projects

Cursor-paginated. Optional ?orgId= narrows to a specific org (projects may have no org; absent = all); ?nameContains= substring-matches on Project.name.

create(
body: ProjectSpec | Mapping[str, Any] | None = None,
/,
*,
idempotency_key: str | None = None,
timeout: float | None = None,
**fields: Any,
) -> CreateResourceResult
Signature

Create a project. POST /v1/projects

A project's slug is unique within its org, and a project without an org's among the tenant's projects without one: two orgs may each have a project with the same slug. A taken slug answers 409 slug-conflict; a second Default, 409 project-default-already-exists.

get(project_id: str | UUID, /, *, timeout: float | None = None) -> Project
Signature

Fetch a project by id. GET /v1/projects/{projectId}

update(
project_id: str | UUID,
body: ProjectPatch | Mapping[str, Any] | None = None,
/,
*,
idempotency_key: str | None = None,
timeout: float | None = None,
**fields: Any,
) -> None
Signature

Partially update a project. PATCH /v1/projects/{projectId}

A new slug, or a move to another org (orgId, or null for none), answers 409 slug-conflict when the slug is taken where the project ends up.

delete(
project_id: str | UUID,
/,
*,
idempotency_key: str | None = None,
timeout: float | None = None,
) -> None
Signature

Delete a project (idempotent). DELETE /v1/projects/{projectId}