Users and assistants
Identifiers
The phone numbers and email addresses that belong to a user, so inbound messages and calls reach the right person.
/identifiersList identifiers
Returns identifiers in your account, filtered by `type` or `userId`. Called as a user, returns only that user's identifiers.
Query parameters
Responses
trueactiveinactivesuspendedemailphoneexternal_idemployee_idgooglemicrosoftapplecustomimessagesmswhatsappnullRequest
curl 'https://api.agnt.ai/identifiers' \
-H "Authorization: Bearer ak_live_..."Response
{
"ok": true,
"identifiers": [
{
"id": "6660c4a1f2e3b7d8a9c01234",
"account": "account",
"user": {
"id": "6660c4a1f2e3b7d8a9c01234",
"name": "Ava",
"status": "active"
},
"type": "email",
"value": "value",
"verified": true
}
]
}/identifiersCreate an identifier
Adds an email address, phone number or other handle to a user, so messages from it reach that user. With an account key, pass `userId`. Phone numbers are stored in E.164; a number without a leading `+` uses the user's country. A value held by any user in your account returns `400`.
Request body
emailphoneexternal_idemployee_idgooglemicrosoftapplecustomResponses
trueadminmemberguestmemberadminownernullactiveinactivesuspendedemailphoneexternal_idemployee_idgooglemicrosoftapplecustomimessagesmswhatsappnullRequest
curl 'https://api.agnt.ai/identifiers' \
-X POST \
-H "Authorization: Bearer ak_live_..." \
-H "Content-Type: application/json" \
-d '{
"type": "email",
"value": "value"
}'Response
{
"ok": true,
"identifier": {
"id": "6660c4a1f2e3b7d8a9c01234",
"account": "account",
"user": {
"id": "6660c4a1f2e3b7d8a9c01234",
"account": "account",
"assistant": "assistant",
"name": "Ava",
"avatarUrl": "https://example.com",
"timezone": "America/New_York"
},
"type": "email",
"value": "value",
"verified": true
}
}/identifiers/{identifierId}Retrieve an identifier
Retrieves an identifier.
Path parameters
Responses
trueadminmemberguestmemberadminownernullactiveinactivesuspendedemailphoneexternal_idemployee_idgooglemicrosoftapplecustomimessagesmswhatsappnullRequest
curl 'https://api.agnt.ai/identifiers/<identifierId>' \
-H "Authorization: Bearer ak_live_..."Response
{
"ok": true,
"identifier": {
"id": "6660c4a1f2e3b7d8a9c01234",
"account": "account",
"user": {
"id": "6660c4a1f2e3b7d8a9c01234",
"account": "account",
"assistant": "assistant",
"name": "Ava",
"avatarUrl": "https://example.com",
"timezone": "America/New_York"
},
"type": "email",
"value": "value",
"verified": true
}
}/identifiers/{identifierId}Update an identifier
Updates an identifier's `verified` flag, label, platforms and metadata. To change the value, create a new identifier.
Path parameters
Request body
Responses
trueadminmemberguestmemberadminownernullactiveinactivesuspendedemailphoneexternal_idemployee_idgooglemicrosoftapplecustomimessagesmswhatsappnullRequest
curl 'https://api.agnt.ai/identifiers/<identifierId>' \
-X PUT \
-H "Authorization: Bearer ak_live_..." \
-H "Content-Type: application/json" \
-d '{
"verified": true,
"label": "label",
"platforms": {},
"metadata": {}
}'Response
{
"ok": true,
"identifier": {
"id": "6660c4a1f2e3b7d8a9c01234",
"account": "account",
"user": {
"id": "6660c4a1f2e3b7d8a9c01234",
"account": "account",
"assistant": "assistant",
"name": "Ava",
"avatarUrl": "https://example.com",
"timezone": "America/New_York"
},
"type": "email",
"value": "value",
"verified": true
}
}/identifiers/{identifierId}Delete an identifier
Deletes an identifier. A user's last identifier and their primary email cannot be deleted.
Path parameters
Responses
trueRequest
curl 'https://api.agnt.ai/identifiers/<identifierId>' \
-X DELETE \
-H "Authorization: Bearer ak_live_..."Response
{
"ok": true,
"identifier": {
"id": "6660c4a1f2e3b7d8a9c01234"
}
}/identifiers/{identifierId}/linkLink an identifier to a user
Attaches the identifier to the user given by `userId`.
Path parameters
Request body
Responses
trueadminmemberguestmemberadminownernullactiveinactivesuspendedemailphoneexternal_idemployee_idgooglemicrosoftapplecustomimessagesmswhatsappnullRequest
curl 'https://api.agnt.ai/identifiers/<identifierId>/link' \
-X POST \
-H "Authorization: Bearer ak_live_..." \
-H "Content-Type: application/json" \
-d '{
"userId": "6660c4a1f2e3b7d8a9c01234"
}'Response
{
"ok": true,
"identifier": {
"id": "6660c4a1f2e3b7d8a9c01234",
"account": "account",
"user": {
"id": "6660c4a1f2e3b7d8a9c01234",
"account": "account",
"assistant": "assistant",
"name": "Ava",
"avatarUrl": "https://example.com",
"timezone": "America/New_York"
},
"type": "email",
"value": "value",
"verified": true
}
}/identifiers/{identifierId}/make-primaryMake an email primary
Makes an email identifier the user's primary email, which changes the user's `email`. Only email identifiers can be primary.
Path parameters
Responses
trueadminmemberguestmemberadminownernullactiveinactivesuspendedemailphoneexternal_idemployee_idgooglemicrosoftapplecustomRequest
curl 'https://api.agnt.ai/identifiers/<identifierId>/make-primary' \
-X POST \
-H "Authorization: Bearer ak_live_..."Response
{
"ok": true,
"makePrimary": {
"user": {
"id": "6660c4a1f2e3b7d8a9c01234",
"account": "account",
"assistant": "assistant",
"name": "Ava",
"avatarUrl": "https://example.com",
"timezone": "America/New_York"
},
"identifier": {
"id": "6660c4a1f2e3b7d8a9c01234",
"type": "email",
"value": "value",
"verified": true,
"primary": true
}
}
}