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", filter_by={
"tags": [
"premium",
"beta-user",
],
}, include_metrics=False)
# Handle response
print(res)
Show Parameters
Show Parameters
A limit on the number of objects to be returned. Limit can range between 1 and 50, and the default is 10
A cursor for use in pagination.
starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 20 objects, ending with 01JJ1HDHN79XAS7A01WB3HYSDB, your subsequent call can include after=01JJ1HDHN79XAS7A01WB3HYSDB in order to fetch the next page of the list.A cursor for use in pagination.
ending_before is an object ID that defines your place in the list. For instance, if you make a list request and receive 20 objects, starting with 01JJ1HDHN79XAS7A01WB3HYSDB, your subsequent call can include before=01JJ1HDHN79XAS7A01WB3HYSDB in order to fetch the previous page of the list.Search identities by display name or email address. Minimum 2 characters required.
Filter identities by tags. Can be provided as JSON object {“tags”: [“premium”, “beta-user”]} or as query format “tags=premium,beta-user”
Show Response
Show Response
Show Properties of data
Show Properties of data
Unique ULID (Universally Unique Lexicographically Sortable Identifier) for the contact
Unique string value to identify the contact user in the customer’s system. This should be the same ID you use in your system to reference this user.
Display name or nickname of the contact user. This is typically shown in user interfaces.
Email address of the contact user
URL linking to the contact user’s avatar image
Array of tags associated with the contact. Useful for organizing and filtering contacts by categories, departments, or custom classifications.
Additional custom metadata associated with the contact as key-value pairs. Use this to store any extra information specific to your application.
The date and time the resource was created
The date and time the resource was last updated
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. Use this endpoint to add users from your system to orq.ai for tracking their usage and engagement.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.identities.create(request={
"external_id": "user_12345",
"display_name": "Jane Smith",
"email": "jane.smith@example.com",
"avatar_url": "https://example.com/avatars/jane-smith.jpg",
"tags": [
"premium",
"beta-user",
"enterprise",
],
"metadata": {
"department": "Engineering",
"role": "Senior Developer",
"subscription_tier": "premium",
"last_login": "2024-01-15T10:30:00Z",
},
})
# Handle response
print(res)
Show Parameters
Show Parameters
Unique string value to identify the contact user in the customer’s system. This should be the same ID you use in your system to reference this user.
Display name or nickname of the contact user. This is typically shown in user interfaces.
Email address of the contact user
URL linking to the contact user’s avatar image
Array of tags associated with the contact. Useful for organizing and filtering contacts by categories, departments, or custom classifications.
Show Response
Show Response
Unique ULID (Universally Unique Lexicographically Sortable Identifier) for the contact
Unique string value to identify the contact user in the customer’s system. This should be the same ID you use in your system to reference this user.
Unique identifier for the workspace to which the contact belongs
Display name or nickname of the contact user. This is typically shown in user interfaces.
Email address of the contact user
URL linking to the contact user’s avatar image
Array of tags associated with the contact. Useful for organizing and filtering contacts by categories, departments, or custom classifications.
Additional custom metadata associated with the contact as key-value pairs. Use this to store any extra information specific to your application.
The date and time the resource was created
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)
Show Parameters
Show Parameters
Unique identity id or external id
Show Response
Show Response
Unique ULID (Universally Unique Lexicographically Sortable Identifier) for the contact
Unique string value to identify the contact user in the customer’s system. This should be the same ID you use in your system to reference this user.
Display name or nickname of the contact user. This is typically shown in user interfaces.
Email address of the contact user
URL linking to the contact user’s avatar image
Array of tags associated with the contact. Useful for organizing and filtering contacts by categories, departments, or custom classifications.
Additional custom metadata associated with the contact as key-value pairs. Use this to store any extra information specific to your application.
The date and time the resource was created
The date and time the resource was last updated
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>", display_name="Jane Smith", email="jane.smith@example.com", avatar_url="https://example.com/avatars/jane-smith.jpg", tags=[
"premium",
"beta-user",
"enterprise",
], metadata={
"department": "Engineering",
"role": "Senior Developer",
"subscription_tier": "premium",
"last_login": "2024-01-15T10:30:00Z",
})
# Handle response
print(res)
Show Parameters
Show Parameters
Unique identity id or external id
Show Response
Show Response
Unique ULID (Universally Unique Lexicographically Sortable Identifier) for the contact
Unique string value to identify the contact user in the customer’s system. This should be the same ID you use in your system to reference this user.
Display name or nickname of the contact user. This is typically shown in user interfaces.
Email address of the contact user
URL linking to the contact user’s avatar image
Array of tags associated with the contact. Useful for organizing and filtering contacts by categories, departments, or custom classifications.
Additional custom metadata associated with the contact as key-value pairs. Use this to store any extra information specific to your application.
The date and time the resource was created
Delete an Identity
Permanently deletes an identity from your workspace and cleans up associated budget configurations. This action cannot be undone.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
orq.identities.delete(id="<id>")
# Use the SDK ...
Show Parameters
Show Parameters
The request object to use for the request.