Overview
Thescim client implements the SCIM 2.0 protocol for automated user provisioning. It supports both SCIM token management (for authenticating your identity provider) and full SCIM 2.0 user lifecycle operations.
Access the SCIM client via client.scim.
Token Management
SCIM tokens authenticate your identity provider (IdP) when it provisions users. Tokens are bearer tokens — the raw secret is only returned once at creation time.Create Token
ScimTokenWithSecret
| Field | Type | Description |
|---|---|---|
id | str | Unique token identifier. |
label | str | Human-readable label. |
token | str | The bearer token secret (only returned at creation). |
created_at | str | ISO 8601 creation timestamp. |
last_used_at | str | None | ISO 8601 timestamp of last use (or None). |
List Tokens
ListScimTokensResponse
| Field | Type | Description |
|---|---|---|
tokens | tuple[ScimToken, ...] | The list of SCIM tokens (without secrets). |
ScimToken
| Field | Type | Description |
|---|---|---|
id | str | Unique token identifier. |
label | str | Human-readable label. |
created_at | str | ISO 8601 creation timestamp. |
last_used_at | str | None | ISO 8601 timestamp of last use. |
Revoke Token
User Operations
SCIM 2.0 user operations support the full user lifecycle: create, read, update (full and partial), list, and delete.List Users
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
start_index | int | None | No | 1-based index of the first result. |
count | int | None | No | Maximum number of results to return. |
ScimListResponse
| Field | Type | Description |
|---|---|---|
total_results | int | Total number of matching users. |
start_index | int | 1-based index of the first result. |
items_per_page | int | Number of results per page. |
resources | tuple[ScimUser, ...] | The list of users. |
Create User
CreateScimUserParams
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
user_name | str | Yes | — | The user’s username (typically email). |
display_name | str | None | No | None | Display name. |
external_id | str | None | No | None | External ID from the IdP. |
emails | list[dict[str, Any]] | None | No | None | List of email objects. |
active | bool | No | True | Whether the user is active. |
Get User
Replace User (PUT)
Full replacement of a user’s attributes:Update User (PATCH)
Partial update using SCIM Operations:Delete User
Deprovision a user:ScimUser Type
TheScimUser frozen dataclass has the following fields:
| Field | Type | Description |
|---|---|---|
id | str | Unique user identifier. |
user_name | str | The user’s username. |
active | bool | Whether the user is active. |
emails | tuple[ScimEmail, ...] | The user’s email addresses. |
meta | ScimUserMeta | SCIM metadata (timestamps, type). |
external_id | str | None | External ID from the IdP. |
display_name | str | None | Display name. |
ScimEmail
| Field | Type | Description |
|---|---|---|
value | str | The email address. |
primary | bool | Whether this is the primary email. |
ScimUserMeta
| Field | Type | Description |
|---|---|---|
resource_type | str | The SCIM resource type. |
created | str | ISO 8601 creation timestamp. |
last_modified | str | ISO 8601 last-modified timestamp. |