- list - List identities
- create - Create an identity
- retrieve - Retrieve an identity
- delete - Delete an identity
- update - Update an identity
Retrieves a paginated list of identities in your workspace. Use pagination parameters to navigate through large identity lists efficiently.
from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.identities.list(limit=10, search="john", include_metrics=False)
# Handle response
print(res)| Parameter | Type | Required | Description |
|---|---|---|---|
limit |
Optional[int] | ➖ | N/A |
starting_after |
Optional[str] | ➖ | Cursor for forward pagination. Set to the _id of the last item fromthe previous page. |
ending_before |
Optional[str] | ➖ | Cursor for backward pagination. Set to the _id of the first item fromthe previous page. |
search |
Optional[str] | ➖ | Case-insensitive search text matched against identity profile fields. |
filter_by_tags |
List[str] | ➖ | Return only identities that have at least one of these tags. |
include_metrics |
Optional[bool] | ➖ | Include aggregate usage metrics on each returned identity. |
sort_by |
Optional[models.IdentitySortField] | ➖ | Field used to order the list. |
include_budget |
Optional[bool] | ➖ | When true, embed each identity's identity-scoped budget (config and limits only, no live usage) on the returned records. Adds one budget lookup for the page; omit to skip it. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
| Error Type | Status Code | Content Type |
|---|---|---|
| models.APIDefaultError | 4XX, 5XX | */* |
Creates a new identity with a unique external_id. If an identity with the same external_id already exists, the operation will fail.
from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.identities.create(external_id="<id>")
# Handle response
print(res)| Parameter | Type | Required | Description |
|---|---|---|---|
external_id |
str | ✔️ | Customer-provided stable identifier for this identity. Must be unique within the workspace. |
display_name |
Optional[str] | ➖ | Human-readable display name for the identity. |
email |
Optional[str] | ➖ | Email address associated with the identity. |
avatar_url |
Optional[str] | ➖ | URL of the identity avatar image. |
tags |
List[str] | ➖ | Free-form labels used to organize and filter identities. |
metadata |
Dict[str, Any] | ➖ | Custom JSON metadata stored with the identity. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
models.CreateIdentityResponse1
| Error Type | Status Code | Content Type |
|---|---|---|
| models.APIDefaultError | 4XX, 5XX | */* |
Retrieves detailed information about a specific identity using their identity ID or external ID from your system.
from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.identities.retrieve(id="<id>", include_metrics=False)
# Handle response
print(res)| Parameter | Type | Required | Description |
|---|---|---|---|
id |
str | ✔️ | Identity ID to retrieve. |
include_metrics |
Optional[bool] | ➖ | Include aggregate usage metrics on the returned identity. |
include_budget |
Optional[bool] | ➖ | When true, embed the identity-scoped budget (config and limits only, no live usage) on the returned record. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
models.RetrieveIdentityResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| models.APIDefaultError | 4XX, 5XX | */* |
Permanently deletes an identity from your workspace and cleans up associated budget configurations.
from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.identities.delete(id="<id>")
# Handle response
print(res)| Parameter | Type | Required | Description |
|---|---|---|---|
id |
str | ✔️ | Identity ID to delete. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
| Error Type | Status Code | Content Type |
|---|---|---|
| models.APIDefaultError | 4XX, 5XX | */* |
Updates specific fields of an existing identity. Only the fields provided in the request body will be updated.
from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.identities.update(id="<id>")
# Handle response
print(res)| Parameter | Type | Required | Description |
|---|---|---|---|
id |
str | ✔️ | Identity ID to update. |
display_name |
Optional[str] | ➖ | New display name. Omit to keep the current display name. |
email |
Optional[str] | ➖ | New email address. Omit to keep the current email. |
avatar_url |
Optional[str] | ➖ | New avatar image URL. Omit to keep the current avatar URL. |
tags |
List[str] | ➖ | Replacement tag list. Leave empty to clear tags. |
metadata |
Dict[str, Any] | ➖ | Replacement custom JSON metadata. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
| Error Type | Status Code | Content Type |
|---|---|---|
| models.APIDefaultError | 4XX, 5XX | */* |