End Users

Anonymize end user

Request the anonymization of an end user.

SecurityApiKeyAuth
Request
path Parameters
userId
required
string <uuid>

The id of the end user to anonymize

query Parameters
force
boolean

Whether to force close all the conversations initiated by the end user, if any are found in a non closed state.

Responses
202

The end user's anonymization request status

400
404
409
500
patch/v1/endusers/{userId}/anonymize
Request samples
Response samples
application/json
{
  • "data": {
    • "id": "6bf55369-a670-4e6b-9f70-ecdb9913549f",
    • "entityType": "UserAnonymizationType",
    • "_type": "User",
    • "initiatedAt": "2021-12-01T12:46:36.581Z[GMT]",
    • "targetEntityId": "f28fafd6-2e42-4441-943c-388a8e0ef433",
    • "requestedBy": "2b01e4c9-0c3a-47d4-9462-cd5a1a4687f5"
    }
}

Create end user

Create an end user.

SecurityApiKeyAuth
Request
Request Body schema: application/json

The end user's details

avatarUrl
string
displayName
string
email
string
firstName
string
lastName
string
middleNames
Array of strings
phoneNumber
string
Responses
201

The created end user

400

Invalid value extracted from request context, Invalid value for: body, Validation failure during enduser creation

500

Internal failure during request processing

post/v1/endusers
Request samples
application/json
{
  • "displayName": "Alice Brown",
  • "email": "alice@brown.com",
  • "phoneNumber": "+551155256325",
  • "firstName": "Alice",
  • "lastName": "Brown",
  • "middleNames": [ ],
  • "avatarUrl": "http://avatar.url"
}
Response samples
application/json
{
  • "data": {
    • "id": "434ce9f5-14c8-4be1-a0a8-f755010deb9b",
    • "createdAt": "2020-12-16T09:41:43Z",
    • "displayName": "Alice Brown",
    • "email": "alice@brown.com",
    • "phoneNumber": "+551155256325",
    • "firstName": "Alice",
    • "lastName": "Brown",
    • "middleNames": [ ],
    }
}

Create end users

Create end users.

SecurityApiKeyAuth
Request
Request Body schema: application/json

The list of end user details

Array of objects (CreateEndUserInput)
Responses
201

The created end users

400

Invalid value extracted from request context, Invalid value for: body

500

Internal failure during request processing

post/v1/endusers/bulk
Request samples
application/json
{
  • "data": [
    • {
      • "displayName": "Alice Brown",
      • "email": "alice@brown.com",
      • "phoneNumber": "+551155256325",
      • "firstName": "Alice",
      • "lastName": "Brown",
      • "middleNames": [ ],
      • "avatarUrl": "http://avatar.url"
      }
    ]
}
Response samples
application/json
{
  • "data": [
    • {
      • "data": {
        • "id": "93b885ad-fe0d-3089-8df6-34904fd59f71",
        • "createdAt": "2020-12-16T09:41:43Z",
        • "displayName": "Enduser 0",
        • "email": "enduser.0@example.org",
        • "middleNames": [ ],
        },
      • "_type": "BulkActionSuccess"
      },
    • {
      • "data": {
        • "id": "55a54008-ad1b-3589-aa21-0d2629c1df41",
        • "createdAt": "2020-12-16T09:41:43Z",
        • "displayName": "Enduser 1",
        • "email": "enduser.1@example.org",
        • "middleNames": [ ],
        },
      • "_type": "BulkActionSuccess"
      },
    • {
      • "data": {
        • "id": "9e688c58-a548-3b8e-af69-c9e1005ad0bf",
        • "createdAt": "2020-12-16T09:41:43Z",
        • "displayName": "Enduser 2",
        • "email": "enduser.2@example.org",
        • "middleNames": [ ],
        },
      • "_type": "BulkActionSuccess"
      },
    • {
      • "data": {
        • "id": "86666835-06aa-3d90-8bbd-5a74ac4edf68",
        • "createdAt": "2020-12-16T09:41:43Z",
        • "displayName": "Enduser 3",
        • "email": "enduser.3@example.org",
        • "middleNames": [ ],
        },
      • "_type": "BulkActionSuccess"
      },
    • {
      • "error": {
        • "id": "1b6d1e11-0626-414e-906a-b80a384cfef0",
        • "message": "Create EndUser [userId=...] in [orgId=...] failed with [errors=...]",
        • "_type": "Validation"
        },
      • "_type": "BulkActionFailure"
      }
    ]
}

Get end user

Get an end user by id.

SecurityApiKeyAuth
Request
path Parameters
userId
required
string <uuid>

The end user id

Responses
200

The end user

400

Invalid value for: path parameter userId, Invalid value extracted from request context

404

An entity in this request could not be found

500

Internal failure during request processing

get/v1/endusers/{userId}
Request samples
Response samples
application/json
{
  • "data": {
    • "id": "434ce9f5-14c8-4be1-a0a8-f755010deb9b",
    • "createdAt": "2020-12-16T09:41:43Z",
    • "displayName": "Alice Brown",
    • "email": "alice@brown.com",
    • "phoneNumber": "+551155256325",
    • "firstName": "Alice",
    • "lastName": "Brown",
    • "middleNames": [ ],
    }
}

List end user conversations

Lists conversations requested by an end user.

SecurityApiKeyAuth
Request
path Parameters
userId
required
string <uuid>
query Parameters
pageKey
string

Base64 encoded form of pagination query parameters. Do not try to construct or change programmatically as the internal structure may change without notice.

pageLimit
integer <int32>

Maximum number of results per page. May be used in combination with pageKey to change the number of results in between page requests.

Responses
200

The list of conversations requested by an EndUser

400

Invalid value for: path parameter userId, Invalid value extracted from request context, Invalid value for: query parameter pageLimit, Invalid value for: query parameter pageKey

404

An entity in this request could not be found

500

Internal failure during request processing

get/v1/endusers/{userId}/conversations
Request samples
Response samples
application/json
{
  • "data": [
    • {
      • "id": 1,
      • "requesterId": "9deb936b-52e5-4c44-828d-4c8d48fe0c7e",
      • "channel": "WidgetChat",
      • "createdAt": "2020-12-16T09:41:43Z",
      • "direction": "Outbound",
      • "state": "Open",
      • "stateUpdatedAt": "2020-12-16T09:41:43Z",
      • "assignment": {
        • "agentId": "0e4d0ead-dc69-470a-9b3a-e7eb16a56453",
        • "assignedAt": "2020-12-16T11:00:34Z"
        },
      • "queue": {
        • "id": "cd87b232-64c8-4ad5-b81a-6f9233352d97",
        • "queuedAt": "2020-12-16T10:40:40Z"
        },
      • "browserInfo": {
        • "name": "Chrome 9",
        • "version": "91.0.4472.114",
        • "ipAddress": "127.0.0.1",
        • "originatingUrl": "http://localhost:3000/"
        },
      • "language": "en",
      • "link": {
        • "parentId": 1234,
        • "_type": "SideConversation"
        },
      • "_type": "ChatConversation"
      }
    ]
}

List end users

Lists all end users in an organization. It is possible to filter by one of the mutually exclusive parameters: email or phone number. In case both are provided, an error is returned.

SecurityApiKeyAuth
Request
query Parameters
email
string

The enduser email filter

pageKey
string

Base64 encoded form of pagination query parameters. Do not try to construct or change programmatically as the internal structure may change without notice.

pageLimit
integer <int32>

Maximum number of results per page. May be used in combination with pageKey to change the number of results in between page requests.

phone
string

The enduser phone number filter

Responses
200

The list of end users

400

Invalid value extracted from request context, Invalid value for: query parameter pageLimit, Invalid value for: query parameter pageKey, Invalid value for: query parameter email, Invalid value for: query parameter phone, Duplicate phone number, Duplicate email address, Invalid filters: Cannot provide both phone number and email address

404

An entity in this request could not be found

500

Internal failure during request processing

get/v1/endusers
Request samples
Response samples
application/json
{
  • "data": [
    • {
      • "id": "93b885ad-fe0d-3089-8df6-34904fd59f71",
      • "createdAt": "2020-12-16T09:41:43Z",
      • "displayName": "Enduser 0",
      • "email": "enduser.0@example.org",
      • "middleNames": [ ],
      },
    • {
      • "id": "55a54008-ad1b-3589-aa21-0d2629c1df41",
      • "createdAt": "2020-12-16T09:41:43Z",
      • "displayName": "Enduser 1",
      • "email": "enduser.1@example.org",
      • "middleNames": [ ],
      },
    • {
      • "id": "9e688c58-a548-3b8e-af69-c9e1005ad0bf",
      • "createdAt": "2020-12-16T09:41:43Z",
      • "displayName": "Enduser 2",
      • "email": "enduser.2@example.org",
      • "middleNames": [ ],
      },
    • {
      • "id": "86666835-06aa-3d90-8bbd-5a74ac4edf68",
      • "createdAt": "2020-12-16T09:41:43Z",
      • "displayName": "Enduser 3",
      • "email": "enduser.3@example.org",
      • "middleNames": [ ],
      }
    ]
}

Patch end user

Patch an end user.

SecurityApiKeyAuth
Request
path Parameters
userId
required
string <uuid>

The end user id to be patched

Request Body schema: application/json

The end user patch

avatarUrl
string
displayName
string
email
string
firstName
string
lastName
string
middleNames
Array of strings
phoneNumber
string
Responses
200

The patched end user

400

Invalid value for: path parameter userId, Invalid value extracted from request context, Invalid value for: body, Validation failure during update

404

An entity in this request could not be found

500

Internal failure during request processing

patch/v1/endusers/{userId}
Request samples
application/json
{
  • "displayName": "Alice Brown",
  • "email": "alice@soon.unicorn",
  • "firstName": "Alice",
  • "lastName": "Brown",
  • "middleNames": [ ],
  • "avatarUrl": "http://avatar.url"
}
Response samples
application/json
{
  • "data": {
    • "id": "434ce9f5-14c8-4be1-a0a8-f755010deb9b",
    • "createdAt": "2020-12-16T09:41:43Z",
    • "displayName": "Alice Brown",
    • "email": "alice@brown.com",
    • "phoneNumber": "+551155256325",
    • "firstName": "Alice",
    • "lastName": "Brown",
    • "middleNames": [ ],
    }
}

Patch end users

Bulk patch end users.

SecurityApiKeyAuth
Request
Request Body schema: application/json

List of end user patch actions

Array of objects (BulkPatchEndUserInput)
Responses
200

The patched end users

400

Invalid value extracted from request context, Invalid value for: body

500

Internal failure during request processing

patch/v1/endusers
Request samples
application/json
{
  • "data": [
    • {
      • "id": "43b1fe06-a7c4-4f34-8e48-b0559e6acdb9",
      • "displayName": "Alice Brown",
      • "email": "alice@soon.unicorn",
      • "firstName": "Alice",
      • "lastName": "Brown",
      • "middleNames": [ ],
      • "avatarUrl": "http://avatar.url"
      }
    ]
}
Response samples
application/json
{
  • "data": [
    • {
      • "data": {
        • "id": "434ce9f5-14c8-4be1-a0a8-f755010deb9b",
        • "createdAt": "2020-12-16T09:41:43Z",
        • "displayName": "Alice Brown",
        • "email": "alice@brown.com",
        • "phoneNumber": "+551155256325",
        • "firstName": "Alice",
        • "lastName": "Brown",
        • "middleNames": [ ],
        },
      • "_type": "BulkActionSuccess"
      },
    • {
      • "error": {
        • "id": "ace11abb-4ed0-42bd-9e3b-4ef6db58e0aa",
        • "message": "Updating EndUser [id=ace11abb-4ed0-42bd-9e3b-4ef6db58e0aa] in [org=b86a1842-437c-4c55-ac4b-0a9cd2f44dfb] failed with [errors=PhoneNumberExists]",
        • "_type": "Validation"
        },
      • "_type": "BulkActionFailure"
      }
    ]
}

Update end user

Update an end user.

SecurityApiKeyAuth
Request
path Parameters
userId
required
string <uuid>

The end user id

Request Body schema: application/json

The updated details for an end user

avatarUrl
string
displayName
required
string
email
string
firstName
string
lastName
string
middleNames
Array of strings
phoneNumber
string
Responses
200

The updated end user

400

Invalid value for: path parameter userId, Invalid value extracted from request context, Invalid value for: body, Validation failure during update

404

An entity in this request could not be found

500

Internal failure during request processing

put/v1/endusers/{userId}
Request samples
application/json
{
  • "displayName": "Alice User",
  • "email": "alice@soon.unicorn",
  • "phoneNumber": "+55112233445566",
  • "firstName": "Alice",
  • "lastName": "User",
  • "middleNames": [
    • "End"
    ],
  • "avatarUrl": "http://avatar.url"
}
Response samples
application/json
{
  • "data": {
    • "id": "434ce9f5-14c8-4be1-a0a8-f755010deb9b",
    • "createdAt": "2020-12-16T09:41:43Z",
    • "displayName": "Alice Brown",
    • "email": "alice@brown.com",
    • "phoneNumber": "+551155256325",
    • "firstName": "Alice",
    • "lastName": "Brown",
    • "middleNames": [
      • "End"
      ],
    }
}

Update end users

Bulk update end users.

SecurityApiKeyAuth
Request
Request Body schema: application/json

List of end user update actions

Array of objects (BulkUpdateEndUserInput)
Responses
200

The updated end users

400

Invalid value extracted from request context, Invalid value for: body

500

Internal failure during request processing

put/v1/endusers
Request samples
application/json
{
  • "data": [
    • {
      • "id": "d4826125-559f-496f-ad71-a0340f0cae06",
      • "displayName": "Alice User",
      • "email": "alice@soon.unicorn",
      • "phoneNumber": "+55112233445566",
      • "firstName": "Alice",
      • "lastName": "User",
      • "middleNames": [
        • "End"
        ],
      • "avatarUrl": "http://avatar.url"
      }
    ]
}
Response samples
application/json
{
  • "data": [
    • {
      • "data": {
        • "id": "434ce9f5-14c8-4be1-a0a8-f755010deb9b",
        • "createdAt": "2020-12-16T09:41:43Z",
        • "displayName": "Alice Brown",
        • "email": "alice@brown.com",
        • "phoneNumber": "+551155256325",
        • "firstName": "Alice",
        • "lastName": "Brown",
        • "middleNames": [ ],
        },
      • "_type": "BulkActionSuccess"
      },
    • {
      • "error": {
        • "id": "8fe8f4c3-7bc6-4767-924a-d9afa7ac7009",
        • "message": "Updating EndUser [id:8fe8f4c3-7bc6-4767-924a-d9afa7ac7009] failed with [errors:PhoneNumberExists]",
        • "_type": "Validation"
        },
      • "_type": "BulkActionFailure"
      }
    ]
}