Back

Zendesk Chat API Essential Guide

Aug 9, 20246 minute read

What type of API does Zendesk Chat provide?

API Types

Zendesk Chat offers multiple types of APIs:

  1. REST API: Zendesk Chat has a REST API available at {subdomain}.zendesk.com/api/v2/chat.

  2. GraphQL API: The Chat Conversations API is a GraphQL API, which is the first GraphQL API released by Zendesk.

  3. Real-Time API: Zendesk Chat also provides a Real-Time Chat API with both REST endpoints and a Streaming API.

Chat Conversations API (GraphQL)

  • This API allows applications to act as a Zendesk Chat agent and interact with website visitors.
  • It uses GraphQL, which provides more flexibility in defining and retrieving data.
  • The API is available on Zendesk Chat Enterprise or Premium (legacy) plans.
  • It has some limitations, such as not fully supporting roles and permissions or assigned chat routing.

REST API

  • The REST API is available at {subdomain}.zendesk.com/api/v2/chat.
  • It supports OAuth authentication.
  • Each endpoint is rate limited at 200 requests per minute.

Real-Time API

  • Includes both REST endpoints and a Streaming API.
  • The REST endpoints allow pulling data on demand.
  • The Streaming API is recommended for monitoring or processing metrics in real-time.

Authentication

  • The APIs require authentication using OAuth tokens.
  • Access tokens should be included in the Authorization header of requests.

Best Practices

  • Use the appropriate API based on your needs (REST for on-demand data, Streaming for real-time updates, GraphQL for flexible querying).
  • Be aware of rate limits and handle them accordingly in your applications.
  • Ensure proper authentication is implemented using OAuth tokens.
  • For the Chat Conversations API (GraphQL), consider using tools like ChromiQL or GraphQL IDE to help construct queries.

Does the Zendesk Chat API have webhooks?

Yes, the official Zendesk Chat API does have webhooks. Here are the key points about Zendesk webhooks:

Webhook Support

Zendesk supports webhooks that can send HTTP requests in response to activity in Zendesk Support.

Event Types

You can subscribe to various event types with Zendesk webhooks, including:

  • Ticket events
  • User events
  • Organization events
  • Article events (Help Center)
  • Community post events
  • Agent availability events
  • Omnichannel routing configuration events

Subscription Methods

There are two main ways to connect a webhook to Zendesk activity:

  1. Subscribe directly to one or more Zendesk events (for user, organization, help center, etc. activity)
  2. Connect the webhook to a trigger or automation (for ticket-based activity)

Key Points

  • Webhooks subscribed to Zendesk events always use POST requests with JSON payloads.
  • You can't change the HTTP method or payload format for event-based webhooks.
  • A webhook can either subscribe to events OR connect to triggers/automations, not both.
  • Webhooks support authentication methods like API tokens.
  • You can add custom headers to webhook requests for additional information.

Best Practices

  • Use HTTPS endpoints for security
  • Don't include sensitive information in custom headers
  • Verify webhook authenticity using the provided signing secret
  • Monitor webhook invocations and failures using the Zendesk API

In summary, Zendesk's webhook system provides a flexible way to integrate Zendesk activity with external systems, supporting a wide range of event types and configuration options.

Rate Limits and other limitations

Here are the key points about the API Rate Limits for the Zendesk Chat API:

Rate Limit

  • The Zendesk Chat API is rate limited at 200 requests per minute per endpoint [5].

Rate Limit Headers

  • The API response includes headers indicating the current rate limit and remaining requests:
    X-RateLimit: 200
    X-RateLimit-Remaining: 199
    
    [5]

Exceeding the Rate Limit

  • If the rate limit is exceeded, the API will respond with:
    • HTTP 429 Too Many Requests status code
    • A response body explaining the reason for rate limiting [5]

Zendesk Suite Plan Limits

  • For Zendesk Suite plans, the Chat API rate limit is consistently 200 requests per minute across all plan tiers (Team, Growth, Professional, Enterprise, Enterprise Plus) [1]

Monitoring Usage

  • Zendesk provides an API usage summary to help monitor usage against rate limits [3]
  • Usage can be viewed in the Admin Center under Account > Usage > API [3]

Best Practices

  • Monitor API usage to prevent being rate limited [3]
  • Implement proper error handling for 429 responses
  • Use the rate limit headers to track remaining requests [5]

Key Considerations

  • The Chat API rate limit is separate from other Zendesk API rate limits (e.g. Support API) [1]
  • Authentication is required using a Chat OAuth token [5]
  • The API is SSL-only [5]

In summary, the Zendesk Chat API has a consistent rate limit of 200 requests per minute across all plan types. Proper monitoring and adherence to this limit is crucial for smooth API integration and usage.

Latest API Version

Based on the search results provided, here are the key points regarding the most recent version of the Zendesk Chat API:

Current Status

The most recent information about the Zendesk Chat API indicates that significant changes are coming:

  1. Starting July 1, 2024, new Messaging customers will no longer have access to the Chat Conversations APIs.

  2. Existing Messaging customers will still be able to access the Chat Conversations APIs as usual.

  3. As of January 1, 2022, the Chat Conversations API is in maintenance mode and will not be receiving new features. However, bug and security fixes will continue when required.

Latest Versions

While the search results don't explicitly state the most recent version number, they provide some information about recent updates:

  1. For the Android Chat SDK, version 3.3.7 is mentioned as a recent release.

  2. The Chat Conversations API, which is a GraphQL API, has received updates for structured messages, including support for sendQuickReplies, sendButtonTemplate, sendPanelTemplate, sendPanelTemplateCarousel, and sendListTemplate mutations.

Key Considerations

  1. The Chat Conversations API is available on Zendesk Chat Enterprise or Premium (legacy) plans.

  2. Zendesk is recommending Sunshine Conversations for Bots as a replacement option for Messaging customers.

  3. The API documentation for the Conversations API is available at https://zendesk.github.io/conversations-api/.

  4. The Chat API (also known as Live Chat API) is still available, but authentication now requires a Chat OAuth token.

Best Practices

  1. Given the upcoming changes, it's advisable to start planning for alternatives if you're currently using the Chat Conversations APIs, especially if you're a new Messaging customer.

  2. Keep an eye on the Zendesk developer changelog for any further updates or changes to the Chat API.

  3. If you're developing new integrations, consider using the recommended alternatives like Sunshine Conversations for Bots.

  4. Ensure you're complying with the rate limits of 200 requests per minute for the Chat API endpoints.

In conclusion, while there isn't a specific "most recent version" number provided, it's clear that the Zendesk Chat API is undergoing significant changes. Users should be aware of the upcoming deprecation for new Messaging customers and plan accordingly.

How to get a Zendesk Chat developer account and API Keys?

1. Sign up for a Zendesk trial account

  • Go to the Zendesk website and sign up for a free 14-day trial account.
  • This will give you access to test out the Zendesk APIs without needing to pay.

2. Create an API client

  • Once you have your trial account, go to Zendesk Chat > Account > API & SDKs.
  • Click the "Add API Client" button.
  • Enter a name for your client and company.
  • For the Redirect URL, enter "http://localhost:8080" (for testing purposes).
  • Click "Create API Client".

3. Get your API credentials

  • After creating the client, you'll be shown a popup with the Client ID and Client Secret.
  • Make sure to save these credentials securely - the Client Secret is only shown once.

4. Enable API access

  • Go to Admin Center > Apps and integrations > APIs > Zendesk API.
  • Enable API token access if you want to use API tokens.

5. Generate an OAuth token

  • You'll need to generate an OAuth token to authenticate API requests.
  • You can do this using either the Implicit grant flow or Authorization Code grant flow.
  • Follow the steps in the Zendesk documentation to complete the OAuth flow and get your access token.

What can you do with the Zendesk Chat API?

Based on the search results provided, here is a list of data models that can be interacted with using the Zendesk Chat API, along with what is possible for each:

Conversations

  • Start agent sessions
  • Subscribe to incoming messages
  • Update agent status
  • Send messages to visitors
  • Send structured messages to visitors
  • Transfer chats to departments

Departments

  • Retrieve department information (ID, name, status)
  • Transfer chats to specific departments

Agents

  • Create agent sessions
  • Update agent status

Visitors

  • Receive messages from visitors
  • Send messages to visitors

Chat Widgets

  • Customize appearance and placement of chat widgets
  • Integrate chat functionality into websites and applications

Analytics

  • Access chat analytics data
  • Gain insights into customer interactions, agent performance, and customer satisfaction

File Attachments

  • Enable file and image sharing during chats

Security

  • Ensure secure data transfer and encryption for chat interactions

Multi-channel Support

  • Enable customer interactions across various platforms (websites, mobile apps, social media)

Chatbots

  • Integrate chatbots for automated responses to common questions

It's important to note that the Zendesk Chat API has some limitations:

  • Does not fully support roles and permissions
  • Limited support for assigned chat routing
  • Only interacts with visitors from Zendesk Web Widget or Chat Widget

The API uses GraphQL for querying data, allowing for flexible and precise data retrieval. Additionally, it supports WebSocket connections for real-time updates.