Core - Update identity profile
curl --request PATCH \
--url 'https://api.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": {
"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>"
}
]
}
}
}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://api.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": {
"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>"
}
]
}
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Identity ID to update.
Body
application/json
New display name. Omit to keep the current display name.
New email address. Omit to keep the current email.
New avatar image URL. Omit to keep the current avatar URL.
Replacement tag list. Leave empty to clear tags.
Replacement custom JSON metadata.
Response
200 - application/json
OK
Updated identity.
Show child attributes
Show child attributes
Was this page helpful?
⌘I