Users

Create a conversation user

post

Creates a new conversation user using either an email or phoneNumber.

Authorizations
Body
one ofOptional
or
or
Responses
201
Successfully created a new conversation user.
application/json
post
POST /external/users HTTP/1.1
Host: api.raia2.com
Agent-Secret-Key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 211

{
  "firstName": "John",
  "lastName": "Doe",
  "context": "Support",
  "source": "webchat",
  "fkUserId": "123456",
  "customData": {
    "key1": "value1",
    "key2": "value2"
  },
  "phoneNumber": "+1234567890",
  "email": "test@test.com",
  "fkId": "123456"
}
{
  "id": "5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3b",
  "firstName": "John",
  "lastName": "Doe",
  "context": "Support",
  "source": "webchat",
  "fkId": "123456",
  "fkUserId": "123456",
  "email": "test@test.com",
  "phoneNumber": "+1234567890",
  "metadata": {
    "customData": {
      "key1": "value1",
      "key2": "value2"
    }
  }
}
get

Retrieves a user by their email, phone number or fkId, along with their conversation IDs for the current agent.

Authorizations
Query parameters
emailstringOptional

User email

Example: test@test.com
phoneNumberstringOptional

User phone number

Example: +1234567890
fkIdstringOptional

User fkId

Example: 123456
Responses
200
Successfully retrieved the user and conversation ids
application/json
get
GET /external/users/search HTTP/1.1
Host: api.raia2.com
Agent-Secret-Key: YOUR_API_KEY
Accept: */*
{
  "user": {
    "id": "5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3b",
    "firstName": "John",
    "lastName": "Doe",
    "context": "Support",
    "source": "webchat",
    "fkId": "123456",
    "fkUserId": "123456",
    "email": "test@test.com",
    "phoneNumber": "+1234567890",
    "metadata": {
      "customData": {
        "key1": "value1",
        "key2": "value2"
      }
    }
  },
  "conversationIds": [
    "5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3b",
    "5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3b"
  ]
}

Get conversation user by ID

get

Retrieves a conversation user by their unique identifier.

Authorizations
Path parameters
idstringRequired

Unique identifier of the conversation user.

Example: 5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3b
Responses
200
Successfully retrieved the conversation user.
application/json
get
GET /external/users/{id} HTTP/1.1
Host: api.raia2.com
Agent-Secret-Key: YOUR_API_KEY
Accept: */*
{
  "id": "5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3b",
  "firstName": "John",
  "lastName": "Doe",
  "context": "Support",
  "source": "webchat",
  "fkId": "123456",
  "fkUserId": "123456",
  "email": "test@test.com",
  "phoneNumber": "+1234567890",
  "metadata": {
    "customData": {
      "key1": "value1",
      "key2": "value2"
    }
  }
}

Delete conversation user by ID

delete

Delete a conversation user by their unique identifier.

Authorizations
Path parameters
idstringRequired

Unique identifier of the conversation user.

Example: 5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3b
Responses
204
Successfully delete the conversation user.
delete
DELETE /external/users/{id} HTTP/1.1
Host: api.raia2.com
Agent-Secret-Key: YOUR_API_KEY
Accept: */*

No content