> ## Documentation Index
> Fetch the complete documentation index at: https://university.triggr-app.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Zendesk

> Connect Zendesk to Triggr with a Zendesk API token and the email address of the user Triggr acts as.

Triggr creates, lists and searches Zendesk tickets, reads ticket comments, and lists organizations and views.

## Set up Zendesk

You need a Zendesk admin account.

<Steps>
  <Step title="Turn on API token access">
    In Admin Center, go to **Apps and integrations > APIs > API configuration**, select Allow API token access and click Save. See Zendesk's [Turning on and off API access](https://support.zendesk.com/hc/en-us/articles/8662004958746-Turning-on-and-off-API-access).
  </Step>

  <Step title="Create an API token">
    Go to **APIs > API tokens**, click Add API token, enter a Description such as `Triggr` and click Save. Copy the token before you click Save again; Zendesk won't show it in full afterwards. See Zendesk's [Managing API token access](https://support.zendesk.com/hc/en-us/articles/4408889192858-Managing-access-to-the-Zendesk-API).
  </Step>

  <Step title="Choose the user Triggr acts as">
    Triggr sends the token with a user's email address and sees only what that user can. Use an admin, or an agent with access to the tickets, organizations and views your workflows need; a dedicated user such as `triggr@yourcompany.com` makes Triggr's changes easy to spot.
  </Step>
</Steps>

## Connect it in Triggr

The Base Configuration serves workflows that don't run for a client.

<Steps>
  <Step title="Open the configuration">
    Go to **Integrations > Zendesk** and click **Configure** on the Base Configuration card.

    <Frame>
      <img src="https://mintcdn.com/triggr/nyuVXZ1rouDTTEvu/images/integrations-common/base-configuration.png?fit=max&auto=format&n=nyuVXZ1rouDTTEvu&q=85&s=bb81acb082055015f91beda7b4876f35" alt="The Base Configuration card with Status Not Configured, Admin Consent Not Required and a Configure button." width="2272" height="330" data-path="images/integrations-common/base-configuration.png" />
    </Frame>
  </Step>

  <Step title="Enter the token, address and user">
    Enter the token as ApiKey, your Zendesk address with nothing after the host as BaseURL (such as `https://yourcompany.zendesk.com`), and the user's email as EmailAddress. Click Save Configuration.

    <Frame>
      <img src="https://mintcdn.com/triggr/0aCLuL0-lL3gEqxH/images/zendesk/configure.png?fit=max&auto=format&n=0aCLuL0-lL3gEqxH&q=85&s=93fd0a017da718531275ff839e6acaf5" alt="The Zendesk configuration window with ApiKey, BaseURL and EmailAddress fields, an Allow insecure TLS switch under Advanced, and a Save Configuration button." width="1344" height="1354" data-path="images/zendesk/configure.png" />
    </Frame>
  </Step>
</Steps>

## Set up each client

Per-client integrations never fall back to the Base Configuration, so a client's Zendesk steps fail until it's configured. Click **Configure** on each client's row and fill in all three fields: your own Zendesk details, or a token from the client's own Zendesk account.

<Frame>
  <img src="https://mintcdn.com/triggr/nyuVXZ1rouDTTEvu/images/integrations-common/per-client-configuration.png?fit=max&auto=format&n=nyuVXZ1rouDTTEvu&q=85&s=11464b4946bea0b580c73330d9114a41" alt="The Per-Client Configuration card listing Acme Corp and Globex, each Not Configured with Admin Consent Not Required and a Configure button." width="2272" height="646" data-path="images/integrations-common/per-client-configuration.png" />
</Frame>

## Use Zendesk in workflows

* Create Ticket takes a `ticket` object in `jsonBody`, in the shape of Zendesk's [Create Ticket](https://developer.zendesk.com/api-reference/ticketing/tickets/tickets/#create-ticket) endpoint. Only `comment` is required; add `requester_id` or `organization_id` as needed.

  ```json theme={null}
  {
    "ticket": {
      "subject": "New starter: Jane Smith",
      "comment": { "body": "Please set up a laptop and accounts for Jane Smith, starting Monday." },
      "priority": "normal"
    }
  }
  ```

* List Tickets For Organization takes an `organizationId` from Get Organizations.

* Global Search takes Zendesk [search syntax](https://developer.zendesk.com/api-reference/ticketing/ticket-management/search/), such as `type:ticket status:open`, with `page` and `perPage` (up to 100).

* Actions with `pageSize` use [cursor pagination](https://developer.zendesk.com/api-reference/introduction/pagination/): pass `meta.after_cursor` as `afterCursor` while `meta.has_more` is `true`.

## Troubleshooting

<AccordionGroup>
  <Accordion title="no Zendesk integration is configured for this client">
    Configure the client as described in [Set up each client](#set-up-each-client).
  </Accordion>

  <Accordion title="Authentication errors (401)">
    Check ApiKey is the full token, EmailAddress is a verified user in the same account, the token is still active (Zendesk deletes tokens unused for 30 days) and Allow API token access is still on.
  </Accordion>

  <Accordion title="Permission errors (403) or missing results">
    The EmailAddress user can't see what the action asks for. Use an admin, or widen the user's role.
  </Accordion>

  <Accordion title="Every request returns 404">
    BaseURL must be `https://` plus the host only. Triggr adds `/api/v2` itself.
  </Accordion>

  <Accordion title="Replace the token">
    Create a new one, paste it into ApiKey in every configuration that uses it, then deactivate the old one under APIs > API tokens.
  </Accordion>
</AccordionGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.