Skip to content
GTAK Solutions logo
GTAK SolutionsIdentity · Integrations · Micro-SaaS
Zendesk API Token Retirement: 30 April 2027148 days left

Zendesk OAuth Client Credentials Setup Guide

Configure server-to-server OAuth tokens for Python, Node.js, and backend jobs.

Last updated: 6 min readBy GTAK Solutions Engineering

Quick answer

Server-to-server scripts and backend jobs should use the OAuth client credentials grant: create a confidential OAuth client in Zendesk, exchange its client ID and secret for an access token at /oauth/tokens, and send that token in a Bearer header. No refresh token is issued, so request a new access token when the old one expires.

Before You Change Production
Dates and Admin Center paths were checked against Zendesk's official announcement on 1 December 2026. Confirm them in your own Admin Center before making production changes.

1. Overview & Prerequisites

This guide supports the main Zendesk API token deprecation pillar guide. Ensure you have the Zendesk Administrator role (and a sandbox, if your plan includes one) before modifying authentication settings.

2. Create the OAuth Client

  1. In Admin Center, open Apps and integrations → APIs and create a new OAuth client for this one integration.
  2. Make it a confidential client: the client credentials grant is only available to confidential OAuth clients.
  3. Name it after the owning team and job, so anyone reading the client list knows what it is for.
  4. Store the client secret in your secret manager. Never commit it to a repository.

3. Request Tokens from Node.js and Python

Both examples exchange the client ID and secret for an access token, then call the API with a Bearer header.

Node.js 18+ (ES module)
const base = `https://${process.env.ZENDESK_SUBDOMAIN}.zendesk.com`;

async function getAccessToken() {
  const res = await fetch(`${base}/oauth/tokens`, {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({
      grant_type: 'client_credentials',
      client_id: process.env.ZENDESK_CLIENT_ID,
      client_secret: process.env.ZENDESK_CLIENT_SECRET,
      scope: 'read',
    }),
  });
  if (!res.ok) throw new Error(`Token request failed: ${res.status}`);
  const { access_token } = await res.json();
  return access_token;
}

const token = await getAccessToken();
const tickets = await fetch(`${base}/api/v2/tickets.json`, {
  headers: { Authorization: `Bearer ${token}` },
});
Python (requests)
import os
import requests

base = f"https://{os.environ['ZENDESK_SUBDOMAIN']}.zendesk.com"

token_response = requests.post(
    f"{base}/oauth/tokens",
    json={
        "grant_type": "client_credentials",
        "client_id": os.environ["ZENDESK_CLIENT_ID"],
        "client_secret": os.environ["ZENDESK_CLIENT_SECRET"],
        "scope": "read",
    },
    timeout=30,
)
token_response.raise_for_status()
token = token_response.json()["access_token"]

tickets = requests.get(
    f"{base}/api/v2/tickets.json",
    headers={"Authorization": f"Bearer {token}"},
    timeout=30,
)

4. Handle Expiry and Scopes

  • No refresh token is issued with client credentials. When an access token expires, or a request returns 401, request a new one and retry once.
  • Request only the scopes the job needs: read for reporting jobs, write only when the job creates or updates records.
  • Use one OAuth client per integration, so you can rotate or revoke it without affecting anything else.

5. Step-by-Step Walkthrough

  1. Audit existing token usage and confirm the owning team or service.
  2. Create a dedicated, least-privilege OAuth client in Zendesk Admin Center.
  3. Store the client ID and secret in your secret manager or IdP vault.
  4. Switch the integration to OAuth Bearer headers and test non-destructive GET calls.
  5. Monitor for 401/403 errors for 7 days before revoking the legacy token.
Example: Request an OAuth Access Token (Client Credentials)
curl -X POST "https://{subdomain}.zendesk.com/oauth/tokens" \
  -H "Content-Type: application/json" \
  -d '{
    "grant_type": "client_credentials",
    "client_id": "YOUR_CLIENT_ID",
    "client_secret": "YOUR_CLIENT_SECRET",
    "scope": "read write"
  }'

6. Verification & Safe Cutover

Need help auditing dozens of tokens or migrating custom scripts? Request early access to TokenShift or book our Zendesk OAuth migration service.

Get the Zendesk API token migration checklist (PDF)

A practical one-page PDF checklist for inventorying tokens, mapping integrations, and cutting over to OAuth safely.

Want engineers to handle the OAuth migration for you?

Book a fixed-scope migration review with GTAK Solutions.

Explore TokenShift

Start a project

Tell us what you want to connect, secure or build.

Fixed-scope quote after a free scoping call.

How we engage