Skip to content

Organizations

organizations

Organizations resource group.

Wraps two Compliance API endpoints:

  • GET /v1/compliance/organizations — offset paginated list of every organisation under the parent organisation. Exposed via list (one page) and iter (auto-paginate).
  • GET /v1/compliance/organizations/{org_uuid}/users — offset paginated list of users in a given organisation. Exposed via list_users (one page) and iter_users (auto-paginate).
  • GET /v1/compliance/organizations/{organization_id}/settings — the settings actually in force for one organisation. Exposed via get_settings.
Example
from claude_compliance_sdk import ComplianceClient

with ComplianceClient(api_key="sk-ant-api01-...") as client:
    for org in client.organizations.iter():
        print(org.uuid, org.name)
        for user in client.organizations.iter_users(org.uuid):
            print("  ", user.email)

Organization dataclass

A single organisation under the parent organisation.

Attributes:

Name Type Description
uuid str

Stable UUID identifier (used as the path segment for /organizations/{org_uuid}/users).

name str

Human-readable organisation name.

created_at str

RFC 3339 creation timestamp.

extra dict[str, Any]

Any additional fields the API adds in a later revision.

from_dict classmethod

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

Build an Organization from one decoded record.

User dataclass

A user member of an organisation.

Custom RBAC role and group memberships are not part of this payload — they come from the Roles and Groups resources. organization_role is a separate axis: the built-in membership level within this organisation.

Attributes:

Name Type Description
id str

Tagged user identifier (user_...).

full_name str

Current display name.

email str

Current email address.

created_at str

RFC 3339 account creation timestamp.

organization_role str | None

Built-in membership level — one of admin, billing, claude_code_user, developer, managed, membership_admin, owner, primary_owner, user. Kept as a plain string: new values ship without notice.

extra dict[str, Any]

Any additional fields the API adds in a later revision.

from_dict classmethod

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

Build a User from one decoded record.

OrganizationSettings dataclass

The settings in force for one organisation.

This is the enforced state after regulatory restrictions, feature availability, organisation-type defaults, and inter-feature dependencies are applied, which can differ from what an administrator configured. It reflects the state at read time; nothing is snapshotted.

A setting the organisation's administrators cannot change is omitted from settings. Treat a missing row as "not controllable here", not as "off" — that distinction is the easiest thing to get wrong about this endpoint.

Attributes:

Name Type Description
organization_id str

The organisation's bare UUID. Note this is not the org_-prefixed form that organization_id carries on Activity Feed, chat, and project records.

settings list[dict[str, Any]]

Typed setting rows, each a raw dict of name, type, and value. type is one of boolean, integer, string, string_list, provisioning_mode, or data_retention, and determines the shape of value. Kept as dicts: there are 50+ setting names and the list grows, so branch on type rather than expecting the SDK to enumerate them.

api_keys list[ComplianceApiKey]

Every Compliance Access Key configured for the parent organisation. The same list comes back whichever linked organisation you query.

type str

Always "effective_organization_settings".

extra dict[str, Any]

Any additional fields the API adds in a later revision.

from_dict classmethod

from_dict(
    body: Mapping[str, Any]
) -> "OrganizationSettings"

Build an OrganizationSettings from one decoded record.

ComplianceApiKey dataclass

One Compliance Access Key configured for the parent organisation.

The secret value is never returned. Deactivated keys are included with is_active false so you can audit what previously had access.

Attributes:

Name Type Description
id str

Key identifier (apikey_...).

name str

Name given to the key at creation.

scopes StrList

Scopes granted to the key. Keys carrying only the retired read:compliance_org_settings scope remain listed for cleanup visibility even though it no longer grants anything.

is_active bool

Whether the key can currently authenticate.

created_at str

RFC 3339 creation timestamp.

created_by_id str | None

The user who created the key, or None when it was created by automation or the creator's account is gone.

expires_at str | None

When the key stops authenticating, or None when it does not expire.

type str

Always "compliance_api_key".

extra dict[str, Any]

Any additional fields the API adds in a later revision.

from_dict classmethod

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

Build a ComplianceApiKey from one decoded record.

Organizations

Synchronous client for the Organizations endpoints.

list

list(
    *, limit: int | None = None, page: str | None = None
) -> OffsetPage[Organization]

Fetch one offset-paginated page of organisations.

Parameters:

Name Type Description Default
limit int | None

Maximum results per page (default 1000, max 1000).

None
page str | None

Opaque pagination token from a prior response's next_page.

None

Returns:

Type Description
OffsetPage[Organization]

One OffsetPage of Organization objects, sorted by

OffsetPage[Organization]

created_at ascending. May be empty.

Raises:

Type Description
InsufficientScopeError

When the API key lacks read:compliance_org_data.

APIError

For any other non-2xx response.

iter

iter(*, limit: int | None = None) -> Iterator[Organization]

Iterate every organisation under the parent, auto-paginating.

Same arguments as list except that page is managed by the iterator and therefore not accepted here.

get_settings

get_settings(organization_id: str) -> OrganizationSettings

Fetch the settings in force for one linked organisation.

Use this to attest that retention windows, content redaction, SSO enforcement, the IP allowlist, and session-duration controls match your documented baseline, without needing administrator Console access.

Requires read:compliance_org_data. The separate read:compliance_org_settings scope was retired on 2026-06-30, so a key created before then that carries only the old scope gets a 403 here.

Parameters:

Name Type Description Default
organization_id str

The organisation's bare UUID, as returned in uuid by list. Must be one of the parent's linked organisations — the parent itself is not a valid target.

required

Returns:

Type Description
OrganizationSettings

An OrganizationSettings describing the enforced state.

OrganizationSettings

Remember that a missing setting row means "administrators

OrganizationSettings

here cannot change it", not "off".

Raises:

Type Description
NotFoundError

When the organisation is not one of your parent's linked organisations, the value is not a valid UUID, or the settings endpoint is not yet enabled for your parent organisation. These three deliberately share one response, so a 404 does not prove the organisation does not exist.

InsufficientScopeError

When the key lacks read:compliance_org_data.

APIError

For any other non-2xx response.

list_users

list_users(
    org_uuid: str,
    *,
    limit: int | None = None,
    page: str | None = None
) -> OffsetPage[User]

Fetch one offset-paginated page of users for an organisation.

Parameters:

Name Type Description Default
org_uuid str

Organisation UUID, from list results.

required
limit int | None

Maximum results per page (default 500, max 1000).

None
page str | None

Opaque pagination token from a prior response's next_page.

None

Returns:

Type Description
OffsetPage[User]

One OffsetPage of User objects.

iter_users

iter_users(
    org_uuid: str, *, limit: int | None = None
) -> Iterator[User]

Iterate every user in an organisation, auto-paginating.

Same filters as list_users except that page is managed by the iterator and therefore not accepted here.

AsyncOrganizations

Asynchronous client for the Organizations endpoints.

list async

list(
    *, limit: int | None = None, page: str | None = None
) -> OffsetPage[Organization]

Async analogue of list.

iter

iter(
    *, limit: int | None = None
) -> AsyncIterator[Organization]

Async analogue of iter.

get_settings async

get_settings(organization_id: str) -> OrganizationSettings

Async analogue of get_settings.

list_users async

list_users(
    org_uuid: str,
    *,
    limit: int | None = None,
    page: str | None = None
) -> OffsetPage[User]

Async analogue of list_users.

iter_users

iter_users(
    org_uuid: str, *, limit: int | None = None
) -> AsyncIterator[User]

Async analogue of iter_users.