The end users API endpoints provide access to the end-user objects. An end-user
object is created for each end user of Contact Center AI Platform (CCAI Platform).

The following are the call API endpoints:

- [Update end-user](https://docs.cloud.google.com/contact-center/ccai-platform/docs/apps-api-end-user#update-end-user)

- [Get end-user](https://docs.cloud.google.com/contact-center/ccai-platform/docs/apps-api-end-user#get-end-user)

## Update end-user

This endpoint lets you update an end-user details including:

- email address

- name

- phone number

    {
        "identifier": "string",
        "email": "string",
        "name": "string",
        "phone": "string"
    }

***Endpoint:***

    Method: POST
    Type: RAW
    URL: https://{subdomain}.{domain}/apps/api/v1/end_users

***Headers:***

| Key | Value | Description |
|---|---|---|
| Content-Type | application/json |   |
| Accept | application/json |   |

***Body:***

    {
        "identifier": "abc123",
        "email": "joe@mydomain.com",
        "name": "Joe Smith",
        "phone": "+16171231234"
    }

### Example request and responses

The following sections provide example requests to the endpoint.

#### End user ID and identifier

This example shows how to update an end-user by providing the ID.

##### Request

***Headers:***

| Key | Value | Description |
|---|---|---|
| Content-Type | application/json |   |

***Body:***

    {
        "identifier": "string",
        "email": "string",
        "name": "string",
        "phone": "string"
    }

##### Response

    {
        "id": "integer",
        "identifier": "string"
    }

***Status Code:*** 200

## Get end-user

This endpoint provides the ability to retrieve an end-user using either the `id`
or `identifier`.

***Endpoint:***

    Method: GET
    Type:
    URL: https://{subdomain}.{domain}/apps/api/v1/end_users

***Headers:***

| Key | Value | Description |
|---|---|---|
| Content-Type | application/json |   |

***Query:***

| Key | Value | Description |
|---|---|---|
| id | integer | Internal ID for the End User |
| identifier | string | External identifier for the End User |

### Example request and responses

The following sections provide example requests to the endpoint.

#### Get by ID

This example shows how to retrieve an end-user by providing the ID.

##### Request

***Headers:***

| Key | Value | Description |
|---|---|---|
| Content-Type | application/json |   |

***Query:***

| Key | Value | Description |
|---|---|---|
| id | integer | Internal ID for the End User |

##### Response

    {
        "id": "integer",
        "identifier": "string"
    }

***Status Code:*** 200

#### Get by identifier

This example shows how to retrieve an end-user by providing the identifier.

##### Request

***Headers:***

| Key | Value | Description |
|---|---|---|
| Content-Type | application/json |   |

***Query:***

| Key | Value | Description |
|---|---|---|
| identifier | string | External identifier for the End User |

##### Response

    {
        "id": "integer",
        "identifier": "string"
    }

***Status Code:*** 200