Core - Update identity profile
curl --request PATCH \
--url 'https://my.orq.ai/v2/identities/customer_12345' \
--header "Authorization: Bearer $ORQ_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"display_name": "Ada L.",
"tags": ["enterprise", "priority"],
"metadata": {
"plan": "enterprise",
"lifecycle": "renewal"
}
}'
import { Orq } from '@orq-ai/node';
const client = new Orq({
apiKey: process.env.ORQ_API_KEY,
});
const result = await client.identities.update({
id: 'customer_12345',
displayName: 'Ada L.',
tags: ['enterprise', 'priority'],
metadata: {
plan: 'enterprise',
lifecycle: 'renewal',
},
});
console.log(result.identity.displayName);
import os
from orq_ai_sdk import Orq
client = Orq(api_key=os.environ["ORQ_API_KEY"])
result = client.identities.update(
id="customer_12345",
display_name="Ada L.",
tags=["enterprise", "priority"],
metadata={
"plan": "enterprise",
"lifecycle": "renewal",
},
)
print(result.identity.display_name)
{
"identity": {
"_id": "<string>",
"external_id": "<string>",
"workspace_id": "<string>",
"created": "<string>",
"updated": "<string>",
"display_name": "<string>",
"email": "<string>",
"avatar_url": "<string>",
"tags": [
"<string>"
],
"metadata": {},
"metrics": {
"total_tokens": 123,
"total_cost": 123,
"total_requests": 123,
"error_rate": 123
},
"budget": {
"budget_id": "<string>",
"limits": {
"period": "BUDGET_PERIOD_DAILY",
"amount": 123,
"token_limit": 123
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"scope": {
"workspace": {},
"project": {
"project_id": "<string>"
},
"identity": {
"identity_external_id": "<string>"
},
"api_key": {
"api_key_id": "<string>"
},
"provider": {
"provider": "<string>"
},
"model": {
"model_id": "<string>"
}
},
"match": {
"cel": "<string>"
},
"rate_limit": {
"requests_per_minute": 123
},
"is_active": true,
"expires_at": "2023-11-07T05:31:56Z",
"usage": {
"amount": 123,
"tokens": 123,
"requests": 123
},
"alerts": [
{
"threshold_percent": 123,
"notifier_ids": [
"<string>"
],
"id": "<string>",
"dimension": "BUDGET_ALERT_DIMENSION_COST"
}
]
}
}
}{
"message": "<string>",
"code": 123,
"details": [
"<unknown>"
]
}Identities
Update an identity
Updates specific fields of an existing identity. Only the fields provided in the request body will be updated.
PATCH
/
v2
/
identities
/
{id}
Core - Update identity profile
curl --request PATCH \
--url 'https://my.orq.ai/v2/identities/customer_12345' \
--header "Authorization: Bearer $ORQ_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"display_name": "Ada L.",
"tags": ["enterprise", "priority"],
"metadata": {
"plan": "enterprise",
"lifecycle": "renewal"
}
}'
import { Orq } from '@orq-ai/node';
const client = new Orq({
apiKey: process.env.ORQ_API_KEY,
});
const result = await client.identities.update({
id: 'customer_12345',
displayName: 'Ada L.',
tags: ['enterprise', 'priority'],
metadata: {
plan: 'enterprise',
lifecycle: 'renewal',
},
});
console.log(result.identity.displayName);
import os
from orq_ai_sdk import Orq
client = Orq(api_key=os.environ["ORQ_API_KEY"])
result = client.identities.update(
id="customer_12345",
display_name="Ada L.",
tags=["enterprise", "priority"],
metadata={
"plan": "enterprise",
"lifecycle": "renewal",
},
)
print(result.identity.display_name)
{
"identity": {
"_id": "<string>",
"external_id": "<string>",
"workspace_id": "<string>",
"created": "<string>",
"updated": "<string>",
"display_name": "<string>",
"email": "<string>",
"avatar_url": "<string>",
"tags": [
"<string>"
],
"metadata": {},
"metrics": {
"total_tokens": 123,
"total_cost": 123,
"total_requests": 123,
"error_rate": 123
},
"budget": {
"budget_id": "<string>",
"limits": {
"period": "BUDGET_PERIOD_DAILY",
"amount": 123,
"token_limit": 123
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"scope": {
"workspace": {},
"project": {
"project_id": "<string>"
},
"identity": {
"identity_external_id": "<string>"
},
"api_key": {
"api_key_id": "<string>"
},
"provider": {
"provider": "<string>"
},
"model": {
"model_id": "<string>"
}
},
"match": {
"cel": "<string>"
},
"rate_limit": {
"requests_per_minute": 123
},
"is_active": true,
"expires_at": "2023-11-07T05:31:56Z",
"usage": {
"amount": 123,
"tokens": 123,
"requests": 123
},
"alerts": [
{
"threshold_percent": 123,
"notifier_ids": [
"<string>"
],
"id": "<string>",
"dimension": "BUDGET_ALERT_DIMENSION_COST"
}
]
}
}
}{
"message": "<string>",
"code": 123,
"details": [
"<unknown>"
]
}Related guide: Identities guide. See the Identities guide for a walkthrough with examples.
Authorizations
Body
application/json
Was this page helpful?