# Zendesk

Zendesk is a customer service platform for managing support tickets, help center articles, users, and organizations. Use Zendesk in Stack AI to automate support workflows, search your help center, create and update tickets, and route conversations to human agents.

### Connect your account

Zendesk supports two authentication methods.

#### API Token

{% stepper %}
{% step %}
**Open Zendesk API settings**

In your Zendesk admin panel, go to **Apps and Integrations → APIs → Zendesk API → Settings**.
{% endstep %}

{% step %}
**Enable token access**

Turn on **Token Access**.
{% endstep %}

{% step %}
**Create a token**

Click **Add API Token**.

Enter a label, then copy the generated token.
{% endstep %}

{% step %}
**Add the connection in Stack AI**

Create a new Zendesk connection and enter:

* **Subdomain** — your Zendesk subdomain
* **Email** — the admin account email
* **API Token** — the token you copied
  {% endstep %}
  {% endstepper %}

Use `mycompany` as the subdomain if your Zendesk URL is `mycompany.zendesk.com`.

***

#### OAuth2

{% stepper %}
{% step %}
**Create a new Zendesk connection**

In Stack AI, add a new Zendesk connection and select **OAuth2**.
{% endstep %}

{% step %}
**Enter your subdomain**

Provide your Zendesk **Subdomain**.
{% endstep %}

{% step %}
**Authorize the account**

Click **Authorize** and complete the Zendesk OAuth flow.
{% endstep %}
{% endstepper %}

***

### Use Zendesk in workflows

Once your connection is set up, choose an action in the Zendesk node.

### Actions

These are some of the most common Zendesk actions used in Stack AI.

This page covers:

* **Search Articles**
* **Create Ticket**
* **Update Ticket**
* **Show Ticket**
* **List Tickets**
* **Create User**
* **List Users**
* **Add Comment**

#### Tickets

**Create Ticket**

Create a new support ticket.

**Input**

| Field        | Type   | Required | Description   |
| ------------ | ------ | -------- | ------------- |
| Request Body | Object | No       | Ticket object |

**Example request body**

{% code title="Create ticket example" %}

```json
{
  "ticket": {
    "subject": "Printer on fire",
    "comment": {
      "body": "The smoke is colorful."
    },
    "requester": {
      "email": "user@example.com"
    }
  }
}
```

{% endcode %}

**Output**

Returns the created ticket object, including `id`, `subject`, `status`, `url`, and all ticket fields.

***

**Show Ticket**

Retrieve a single ticket by ID.

**Input**

| Field     | Type   | Required | Description                  |
| --------- | ------ | -------- | ---------------------------- |
| Ticket ID | String | Yes      | The numeric ID of the ticket |

**Output**

Returns the full ticket object.

***

**Update Ticket**

Update fields on an existing ticket.

**Input**

| Field        | Type   | Required | Description                  |
| ------------ | ------ | -------- | ---------------------------- |
| Ticket ID    | String | Yes      | The numeric ID of the ticket |
| Request Body | Object | No       | Fields to update             |

**Example request body**

{% code title="Update ticket example" %}

```json
{
  "ticket": {
    "status": "solved",
    "assignee_id": 12345
  }
}
```

{% endcode %}

**Output**

Returns the updated ticket object.

***

**List Tickets**

Retrieve a paginated list of tickets.

**Input**

| Field      | Type    | Required | Description                                |
| ---------- | ------- | -------- | ------------------------------------------ |
| Page       | Integer | No       | Page number for pagination                 |
| Per Page   | Integer | No       | Number of tickets per page. Max `100`      |
| Sort By    | String  | No       | Field to sort by, for example `created_at` |
| Sort Order | String  | No       | `asc` or `desc`                            |

**Output**

Returns an array of ticket objects and pagination metadata.

#### Help Center Articles

**Search Articles**

Search your Zendesk Help Center articles by keyword.

You can also filter by category, section, label, and locale.

**Input**

| Field            | Type    | Required | Description                                                             |
| ---------------- | ------- | -------- | ----------------------------------------------------------------------- |
| Search Query     | String  | Yes      | The search text to match against articles                               |
| Category ID      | String  | No       | Limit results to a specific Help Center category                        |
| Section ID       | String  | No       | Limit results to a specific Help Center section                         |
| Label Names      | String  | No       | Comma-separated label names to filter by, for example `billing,account` |
| Locale           | String  | No       | Language code to filter by, for example `en-us`                         |
| Results Per Page | Integer | No       | Number of results to return. Default `20`, max `100`                    |
| Sort By          | Select  | No       | `relevance` (default), `created_at`, or `updated_at`                    |
| Sort Order       | Select  | No       | `asc` or `desc`                                                         |

**Output**

| Field    | Type    | Description                                                                                                                                                          |
| -------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| articles | Array   | List of matching articles. Each article includes `id`, `title`, `snippet`, `body`, `html_url`, `section_id`, `label_names`, `locale`, `created_at`, and `updated_at` |
| count    | Integer | Total number of matching articles                                                                                                                                    |

**Example use case**

Connect a chat input to **Search Articles**, then pass `articles[*].body` into an LLM node as context.

This is a simple way to answer support questions using your help center content.

#### Users

**Create User**

Create a new end user or agent.

**Input**

| Field        | Type   | Required | Description |
| ------------ | ------ | -------- | ----------- |
| Request Body | Object | No       | User object |

**Example request body**

{% code title="Create user example" %}

```json
{
  "user": {
    "name": "Jane Smith",
    "email": "jane@example.com",
    "role": "end-user"
  }
}
```

{% endcode %}

**Output**

Returns the created user object including `id`, `email`, `name`, `role`, and `created_at`.

***

**List Users**

Retrieve a paginated list of users.

**Input**

| Field    | Type    | Required | Description                         |
| -------- | ------- | -------- | ----------------------------------- |
| Page     | Integer | No       | Page number for pagination          |
| Per Page | Integer | No       | Number of users per page. Max `100` |
| Role     | String  | No       | Limit results to a specific role    |

**Output**

Returns an array of user objects and pagination metadata.

#### Ticket Comments

**Add Comment**

Add a comment to an existing ticket.

**Input**

| Field        | Type   | Required | Description                  |
| ------------ | ------ | -------- | ---------------------------- |
| Ticket ID    | String | Yes      | The numeric ID of the ticket |
| Request Body | Object | No       | Comment payload              |

**Example request body**

{% code title="Add comment example" %}

```json
{
  "ticket": {
    "comment": {
      "body": "We are reviewing this issue now."
    }
  }
}
```

{% endcode %}

**Output**

Returns the updated ticket object with the new comment.

### Related

* [HubSpot](https://docs.stackai.com/workflow-builder/apps/hubspot)
* [Salesforce](https://docs.stackai.com/workflow-builder/apps/salesforce)
