# Yellow.ai

> Manage Yellow.ai users, events, Inbox tickets and views across supported regions.

App · 18 actions. Web page: https://docs.lodol.com/docs/integrations/yellow-ai

## Actions

### Add user

Add user.

**Inputs**

- User ID (`employee_id`, text, required): Unique identifier of the user.
- First name (`first_name`, text): The first name of the user.
- Last name (`last_name`, text): Last name of the user.
- Gender (`gender`, text): Gender of the user.
- Country (`country`, text): Country of the user.
- City (`city`, text): City of the user according to the user's address.
- Language (`language`, text): Preferred language of the user.
- Email (`email`, text): Email address of the user.
- Phone (`phone`, text): Phone number of the user with country code.
- Last channel (`last_channel`, text): Recent channel (set up on yellow.ai) where the user had an active session. You can update this property to cover touch-points/channels outside yellow.ai.
- Dob (`dob`, date): Date of birth of the user.
- Email optin (`email_optin`, true/false): Subscription status of the user to emails. Pass `true` to subscribe for emails, else pass `false`.
- Sms optin (`sms_optin`, true/false): Subscription status of the user to SMS. Pass `true` to subscribe the user to SMS, else pass `false`.
- Whats app optin (`whats_app_optin`, true/false): WhatsApp subscription status of the user. Pass `true` to subscribe the user to your WhatsApp notifications, else pass `false`.
- Tags (`tags`, list): List of groups associated with the user. You can add tags to users manually.

**Outputs**

- `data` (object): Returned value.

**Example output**

```json
{
  "data": {
    "data": {
      "botId": {
        "value": "example"
      },
      "country": {
        "propertyType": "example",
        "value": "example"
      },
      "createdAt": {
        "propertyType": "example",
        "value": "example"
      },
      "emailOptIn": {
        "propertyType": "example",
        "value": false
      },
      "id": {
        "value": "example"
      },
      "lastName": {
        "propertyType": "example",
        "value": "example"
      },
      "phone": {
        "propertyType": "example",
        "value": "example"
      },
      "profileComplete": {
        "value": "example"
      },
      "tags": {
        "propertyType": "example",
        "value": []
      },
      "updatedAt": {
        "propertyType": "example",
        "value": "example"
      },
      "userId": {
        "propertyType": "example",
        "value": "example"
      }
    },
    "message": "example"
  }
}
```

### Agent chat concurrency

Agent chat concurrency.

**Inputs**: None.

**Outputs**

- `data` (object): Returned value.

**Example output**

```json
{
  "data": {
    "agents": []
  }
}
```

### Create a ticket

Create a ticket.

**Inputs**

- Requester (`requester`, object, required): Identifies the end user. At least one of email, phone, or external_id is required; the first present (in that order) becomes the ticket uid.
- Source (`source`, text, required): Channel the ticket originates from. Required. One of: `whatsapp`, `facebook`, `yellowmessenger`, `appleBusinessChat`, `email`, `lazada`, `instagram`.
- Subject (`subject`, text): Ticket subject text. Alias `issue` is also accepted.
- Priority (`priority`, text): Priority. Common aliases are mapped: normal→MEDIUM, urgent→HIGH. Accepted: LOW, MEDIUM, HIGH (or low/normal/high/urgent). One of: `low`, `normal`, `high`, `urgent`. Default: `normal`.
- Tags (`tags`, list): Tags to set on the ticket. Must be an array.
- Category (`category`, text): Group/category code to assign. Alias `group_id` is also accepted.
- Assigned to (`assigned_to`, text): Agent to assign the ticket to. Alias `assignee_id` is also accepted.
- Custom fields (`custom_fields`, object): Key-value custom fields. Keys must be configured in the bot's support settings; unknown keys are rejected. The legacy array format (`[{ id, value }]`) is not supported.

**Outputs**

- `data` (object): Returned value.

**Example output**

```json
{
  "data": {
    "ticket": {}
  }
}
```

### Create new event

Create new event.

**Inputs**

- User ID (`employee_id`, text, required): The user's unique ID
- Event name (`event_name`, text, required): The name of the event
- Payload (`payload`, object): Payload.

**Outputs**

- `data` (object): Returned value.

**Example output**

```json
{
  "data": {
    "data": {
      "botId": "example",
      "createdAt": "example",
      "event": "example",
      "id": "example",
      "payload": {
        "firstName": "example"
      },
      "source": "example",
      "userId": "example"
    },
    "message": "example"
  }
}
```

### Delete user

Delete user.

**Inputs**

- User ID (`employee_id`, text, required): The unique ID of the user that needs to be deleted

**Outputs**

- `data` (object): Returned value.

**Example output**

```json
{
  "data": {
    "contactDetails": {}
  }
}
```

### Get user details

Get user details.

**Inputs**

- User ID (`employee_id`, text, required): The unique identifier for the user.
- All properties (`all_properties`, text): Pass `true` to fetch all user properties; else, set `false`. One of: `true`, `false`.
- Properties (`properties`, text): Use to fetch specific system or custom user properties. A comma-separated list of user properties to fetch. Leave empty to fetch all properties.
- User id (`include_user_id`, text): Whether to include the `userId` field in the response. Defaults to `yes`. One of: `yes`, `no`.

**Outputs**

- `data` (object): Returned value.

**Example output**

```json
{
  "data": {
    "data": {},
    "message": "example"
  }
}
```

### Get user events

Get user events.

**Inputs**

- User ID (`employee_id`, text, required): The unique ID of the user generated internally. This is usually in the format `{botId_userId}`
- Event name (`event_name`, text): The name of the event. Use this parameter to filter results by event name.
- Offset timestamp (`offset_timestamp`, date and time): The offset timestamp (ISO format) from which to start retrieving events. Use this parameter to paginate through event results.
- Limit (`limit`, number): The maximum number of events to retrieve per request. Use this parameter for result pagination and limiting the response size.

**Outputs**

- `data` (object): Returned value.

**Example output**

```json
{
  "data": {
    "data": [],
    "message": "example"
  }
}
```

### List custom views

List custom views.

**Inputs**: None.

**Outputs**

- `data` (object): Returned value.

**Example output**

```json
{
  "data": {
    "count": 1,
    "views": []
  }
}
```

### List outbound templates

List the bot’s outbound message templates.

**Inputs**: None.

**Outputs**

- `data` (object): Returned value.

**Example output**

```json
{
  "data": {
    "templates": []
  }
}
```

### List ticket messages

List ticket messages. Returns one page; use its continuation fields to request the next page.

**Inputs**

- Ticket ID (`id`, text, required): The ticket ID.
- Sort order (`sort_order`, text): `asc` (oldest first within the page, default) or `desc` (newest first within the page). One of: `asc`, `desc`. Default: `asc`.
- Page (`page`, number): Zero-based page number (100 messages per page, newest page first). Default: `0`.

**Outputs**

- `data` (object): Returned value.

**Example output**

```json
{
  "data": {
    "count": 1,
    "messages": [],
    "next_page": 1,
    "previous_page": 1,
    "total": 1
  }
}
```

### List tickets in a view

List tickets in a view. Returns one page; use its continuation fields to request the next page.

**Inputs**

- View (`view_id`, text, required): The custom view ID.
- Page (`page`, number): Zero-based page number (100 tickets per page). Default: `0`.

**Outputs**

- `data` (object): Returned value.

**Example output**

```json
{
  "data": {
    "count": 1,
    "next_page": 1,
    "previous_page": 1,
    "tickets": [],
    "total": 1
  }
}
```

### Mark a ticket missed

Mark a ticket missed.

**Inputs**

- Ticket ID (`id`, text, required): The ticket ID.

**Outputs**

- `data` (object): Returned value.

**Example output**

```json
{
  "data": {
    "ticket": {}
  }
}
```

### Remove ticket tags

Remove ticket tags.

**Inputs**

- Ticket ID (`id`, text, required): The ticket ID.
- Tags (`tags`, list, required): Tags.

**Outputs**

- `data` (object): Returned value.

**Example output**

```json
{
  "data": {
    "tags": []
  }
}
```

### Replace ticket tags

Replace ticket tags.

**Inputs**

- Ticket ID (`id`, text, required): The ticket ID.
- Tags (`tags`, list, required): Tags.

**Outputs**

- `data` (object): Returned value.

**Example output**

```json
{
  "data": {
    "tags": []
  }
}
```

### Retrieve a ticket

Retrieve a ticket.

**Inputs**

- Ticket ID (`id`, text, required): The ticket ID.

**Outputs**

- `data` (object): Returned value.

**Example output**

```json
{
  "data": {
    "ticket": {}
  }
}
```

### Search tickets

Search tickets. Returns one page; use its continuation fields to request the next page.

**Inputs**

- Query (`query`, text): Search query, e.g. `type:ticket status<solved` or `status:open`.
- Page (`page`, number): Zero-based page number (100 tickets per page). Default: `0`.

**Outputs**

- `data` (object): Returned value.

**Example output**

```json
{
  "data": {
    "count": 1,
    "next_page": 1,
    "previous_page": 1,
    "tickets": [],
    "total": 1
  }
}
```

### Update a ticket

Update a ticket.

**Inputs**

- Ticket ID (`id`, text, required): The ticket ID.
- Status (`status`, text): `solved` or `closed` resolves; `open` reopens. Other values (e.g. `pending`) return 422. One of: `solved`, `closed`, `open`.
- Comment (`comment`, object): Comment.
- Category (`category`, text): Group/category code. Alias `group_id`.
- Assigned to (`assigned_to`, text): Agent to reassign to. Alias `assignee_id`.
- Custom fields (`custom_fields`, object): Key-value custom fields; unknown keys are rejected.
- Tags (`tags`, list): Tags.

**Outputs**

- `data` (object): Returned value.

**Example output**

```json
{
  "data": {
    "previousTicketId": "example",
    "ticket": {}
  }
}
```

### Update user

Update user.

**Inputs**

- User ID (`employee_id`, text, required): The unique ID of the user.
- First name (`first_name`, text): The first name of the user
- Last name (`last_name`, text): The last name of the user
- Phone (`phone`, text): The phone number of the user
- Tags (`tags`, list): An array of tags
- Country (`country`, text): The country of the user
- Email opt in (`email_opt_in`, true/false): Indicates whether the user has opted in for email notifications

**Outputs**

- `data` (object): Response.

**Example output**

```json
{
  "data": {}
}
```
