Skip to main content

Identities

List Identities

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)

Create an Identity

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)

Retrieve an Identity

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)

Delete an Identity

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)

Update an Identity

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)