This post was written with AI assistance.

From Swift Labs. We're independent: not affiliated with, endorsed by or sponsored by Zendesk. Facts checked November 26, 2026 against Zendesk's developer docs and help center, linked throughout. This is general technical information, not advice for your account. We ran the script below against a local mock of these endpoints, not against a live Zendesk account, so test it on a sandbox or a short time window first.

Two Zendesk changes make this a good month to own a copy of your support data:

  • API tokens are going away. Zendesk's migration guide says existing accounts can no longer create new API tokens as of October 27, 2026, and "API requests that use API tokens will fail" after April 30, 2027. Scripts need to move to OAuth.
  • Incremental (bulk export) APIs close to third-party developers. From December 2, 2026, with completion targeted for January 19, 2027, Zendesk "will no longer make Incremental APIs available to third-party developers" (announcement). For customers' own internal integrations, the same page says: "No action required. You may continue using Incremental APIs for internal integrations." The Incremental Exports guide adds: "Direct customer accounts retain full access to incremental endpoints."

So if you're an admin who wants your own tickets, users and organizations out of your own account, a script you run yourself is the internal case Zendesk says needs no action. It uses an OAuth client you create in your own Zendesk because API tokens are going away, not as a way around the third-party change: owning the OAuth client doesn't make someone else's tool internal. This post walks through it.

Who this isn't for: if you're building something that other Zendesk customers will connect, Zendesk's third-party migration guide counts integrations "that call Zendesk APIs on behalf of a Zendesk customer" as third-party, and Airbyte writes in an open pull request that "customer-owned OAuth clients fall under the same third-party policy" (Airbyte PR #90850). Follow that guide instead.

Before you start

  • You need an admin. Every incremental export endpoint lists "Allowed For: Admins" in the API reference.
  • Check whether the built-in export is enough. Admin Center has CSV/JSON/XML exports, but Zendesk says they "do not turn on automatically": the account owner has to contact Zendesk Customer Support, and availability depends on your plan (Zendesk help). The API route works without that, within rate limits.
  • Decide where the data goes. An export holds customer names, emails and message bodies. Store it somewhere you'd be comfortable storing your Zendesk data, and keep the client secret out of source control.

1. Create the OAuth client

In Admin Center, go to Apps and integrations > APIs > OAuth clients and click Add OAuth client (Zendesk help).

  • Name: something you'll recognize later, like internal-export.
  • Identifier: auto-filled from the name. This is your client_id.
  • Client kind: Confidential, because the secret stays on your own machine or server. Public clients must use PKCE and can't use the client credentials flow.
  • Redirect URLs: only needed for the authorization code flow. For local testing Zendesk suggests https://localhost.
  • Scopes: set the narrowest list you need (next step). Zendesk calls these "Allowed scopes": a ceiling no token from this client can exceed. Leaving it empty allows all scopes.

Save, then copy the Secret. Zendesk shows it only once.

Who owns the client matters. With the client credentials flow, Zendesk says actions "are attributed to the Zendesk user who created the OAuth client, typically an admin" (migration guide). If you want exports to show up under a named service account in your audit log, create the client while signed in as that admin account.

2. Pick scopes

For a read-only export, these resource scopes cover the endpoints below (scope list):

  • tickets:read: "ticket contents, comments and conversation history, tags, forms and fields, audits, events, and metrics"
  • users:read
  • organizations:read
  • ticket_attachments:read, only if you'll download attachment files

If you don't pass a scope, Zendesk says the token "defaults to full read and write access across all Zendesk resources." Always pass one. If a call returns 403 with an otherwise valid token, check the scope string first: Zendesk notes that a misspelled scope still creates a token, but requests made with it return 403.

3. Get an access token

For a script with nobody at the keyboard, the client credentials grant is the simplest:

curl -X POST "https://$ZD_SUBDOMAIN.zendesk.com/oauth/tokens" \ -H "Content-Type: application/x-www-form-urlencoded" \ --data-urlencode "grant_type=client_credentials" \ --data-urlencode "client_id=$ZD_CLIENT_ID" \ --data-urlencode "client_secret=$ZD_CLIENT_SECRET" \ --data-urlencode "scope=tickets:read users:read organizations:read" 

On a shared machine, run this from a script rather than an interactive command line, since process arguments can be visible to other users.

The response has an access_token and expires_in (1800 seconds, 30 minutes, by default). There's no refresh token in this flow; when the token expires you get a 401 with "error": "invalid_token" and request a new one the same way.

If you'd rather approve access in a browser once, the authorization code flow gives you a refresh token too. Two details from Zendesk's guide: the code from the redirect expires after 120 seconds, and each refresh returns a new refresh token while "the old refresh token stops working right away," so save the new one immediately. OAuth clients created before April 30, 2026 also need an explicit expires_in to get refresh tokens at all.

Send the token as Authorization: Bearer <token> on every request.

4. Try the sample endpoint first

Before a full run, check the response shape with the sample endpoint:

curl "https://$ZD_SUBDOMAIN.zendesk.com/api/v2/incremental/tickets/sample?start_time=1735689600" \ -H "Authorization: Bearer $ZD_TOKEN" 

It returns at most 50 results and is limited to "10 requests per 20 minutes," so use it to look, not to export. incremental_resource can be tickets, ticket_events, users or organizations.

5. Which endpoint for what

Data Endpoint Pagination
Tickets GET /api/v2/incremental/tickets/cursor.json Cursor
Users GET /api/v2/incremental/users/cursor.json Cursor
Organizations GET /api/v2/incremental/organizations.json Time only
Ticket events, with comment bodies GET /api/v2/incremental/ticket_events.json?include=comment_events Time only

Zendesk says cursor-based exports are "highly encouraged" where they exist (tickets, users, custom object records) because they provide "more consistent performance and response body sizes." Organizations and ticket events only support time-based exports (guide).

Both styles take start_time (Unix time) on the very first request. It must be more than a minute in the past, and the ticket and ticket event endpoints never return the most recent minute. Pages hold up to 1,000 items (per_page can lower that if requests time out).

Zendesk also says: "You should not use this API to repeatedly export complete data sets." Do one full export from an early start_time, then run it again on a schedule from the point where the last run stopped.

6. Cursors, end times and end_of_stream

Cursor-based (tickets, users): after the first request, send only cursor=<after_cursor>. Keep going while end_of_stream is false. When it's true, save the last after_cursor; that's where the next scheduled run starts.

Time-based (organizations, ticket events): each page has an end_time. Use it as the next page's start_time. When end_of_stream is true, save that end_time for the next run. Two warnings from Zendesk's guide:

  • Don't treat count as a completeness check. Pages can exceed 1,000 items when records share a timestamp. Use end_of_stream.
  • Time-based exports contain duplicates on purpose, so items at a page boundary aren't skipped. Dedupe afterwards on id + updated_at (tickets, users, organizations) or id + created_at (ticket events).

Save your cursor or end time after every page, not just at the end. Then a crash costs you one page of re-download, not the whole run.

7. Rate limits

From Zendesk's rate limits page and the incremental exports reference:

  • Incremental exports: 10 requests per minute for GET /api/v2/incremental/*, 30 with the High Volume API add-on. At up to 1,000 items a page, that's a ceiling of roughly 10,000 records a minute, often less.
  • The users cursor endpoint documents its own allocation (20 a minute, 60 with the add-on) and a Zendesk-RateLimit-incremental-exports-cursor header.
  • Everything else counts against your plan's per-minute API limit, from 200 a minute on Suite Team up to 2,500 on Enterprise Plus.
  • On a 429, wait for the number of seconds in the Retry-After header, then retry. Don't retry in a tight loop.

8. A minimal script

Python 3 with requests. It writes one JSON object per line to tickets.jsonl, users.jsonl, organizations.jsonl and ticket_events.jsonl, and keeps its position in zd_state.json, so running it again picks up where it left off.

import json, os, time import requests SUBDOMAIN = os.environ["ZD_SUBDOMAIN"] BASE = f"https://{SUBDOMAIN}.zendesk.com" START = int(os.environ.get("ZD_START_TIME", "0")) # Unix time for the first run only STATE_FILE = "zd_state.json" SCOPE = "tickets:read users:read organizations:read" def get_token(): r = requests.post(f"{BASE}/oauth/tokens", data={ "grant_type": "client_credentials", "client_id": os.environ["ZD_CLIENT_ID"], "client_secret": os.environ["ZD_CLIENT_SECRET"], "scope": SCOPE, }, timeout=30) r.raise_for_status() return r.json()["access_token"] class Zendesk: def __init__(self): self.token = get_token() def get(self, path, params): retried_401 = False while True: r = requests.get(f"{BASE}{path}", params=params, timeout=120, headers={"Authorization": f"Bearer {self.token}"}) if r.status_code == 429: # rate limited: wait as long as Zendesk says time.sleep(int(r.headers.get("Retry-After", "60"))) continue if r.status_code == 401 and "invalid_token" in r.text and not retried_401: self.token = get_token() # token expired: get a new one, once retried_401 = True continue r.raise_for_status() return r.json() def load_state(): try: with open(STATE_FILE) as f: return json.load(f) except FileNotFoundError: return {} def save_state(state): with open(STATE_FILE + ".tmp", "w") as f: json.dump(state, f) os.replace(STATE_FILE + ".tmp", STATE_FILE) def export_cursor(zd, state, resource): """tickets and users: cursor-based incremental export.""" path = f"/api/v2/incremental/{resource}/cursor.json" params = {"cursor": state[resource]} if state.get(resource) else {"start_time": START} with open(f"{resource}.jsonl", "a") as out: while True: page = zd.get(path, params) for item in page[resource]: out.write(json.dumps(item) + "\n") out.flush() if page.get("after_cursor"): state[resource] = page["after_cursor"] save_state(state) if page["end_of_stream"]: return params = {"cursor": page["after_cursor"]} def export_time(zd, state, resource, include=None): """organizations and ticket_events: time-based incremental export.""" path = f"/api/v2/incremental/{resource}.json" start = state.get(resource, START) with open(f"{resource}.jsonl", "a") as out: while True: params = {"start_time": start} if include: params["include"] = include page = zd.get(path, params) for item in page[resource]: out.write(json.dumps(item) + "\n") out.flush() if page.get("end_time"): start = page["end_time"] state[resource] = start save_state(state) if page["end_of_stream"]: return if __name__ == "__main__": zd = Zendesk() state = load_state() export_cursor(zd, state, "tickets") export_cursor(zd, state, "users") export_time(zd, state, "organizations") export_time(zd, state, "ticket_events", include="comment_events") 

Run it with the three variables set in your shell (not in the file):

export ZD_SUBDOMAIN=yourcompany ZD_CLIENT_ID=internal-export read -s ZD_CLIENT_SECRET && export ZD_CLIENT_SECRET python3 zd_export.py 

ZD_START_TIME=0 asks for everything from the beginning. If your account rejects it, use a Unix time from before your first ticket. Because the files are appended to, a re-run after a crash can repeat a page; dedupe as described in section 6.

9. Comments and attachments

The ticket export gives you each ticket's fields and its first comment (description), not the full comment thread. Two ways to get the comments:

  • In bulk: the ticket events export with include=comment_events (what the script does). Without that sideload, Zendesk says a comment shows up only as comment_present and comment_public flags; "The comment itself is not included." With it, each comment appears in child_events with body, html_body, public, author_id and an attachments array.
  • Per ticket: GET /api/v2/tickets/{ticket_id}/comments (reference). That's one request per ticket against your plan limit, so it's better for filling gaps than for a full export.

Attachments are files behind each attachment's content_url, downloaded one at a time. Zendesk warns that the file "may be hosted externally so take care not to inadvertently send Zendesk authentication credentials" (attachments reference, working with url properties). Only send your bearer token to your own {subdomain}.zendesk.com host. The attachment object also carries malware_scan_result, and files flagged as malware can't be downloaded unless malware_access_override is true. The attachment content endpoint has its own limit of 2,500 requests a minute.

10. What doesn't export cleanly

Plan for these before you call an export "complete". All are from Zendesk's Incremental Exports guide unless noted.

  • Deleted tickets stay in the stream, scrubbed. Zendesk scrubs user-provided information 30 days after deletion (or right away on permanent deletion): subjects become "SCRUBBED", text fields become X. Filter on status: "deleted" if you don't want them. After permanent deletion Zendesk keeps a minimal record for 90 days, then it disappears from exports. If you need deleted-ticket stubs, export within that window.
  • Old ticket events can show up in a recent window. When tickets are archived or deleted, their event history moves to a new generated_timestamp, so "a request with a start time of January 1, 2019, may return ticket events from 2014."
  • System updates. Ticket exports can include tickets touched only by the system (for example a Zendesk backfill). In time-based exports these have updated_at earlier than your start_time; filter them out if they're noise.
  • AI agent tickets. The ticket export endpoints take a support_type_scope parameter ("all", "agent" or "ai_agent") that "Defaults to "agent"" (reference). If your account uses Zendesk AI agents, add support_type_scope=all to the first tickets request and check the result on a short window.
  • Time-based duplicates. Expected; dedupe as in section 6.
  • Not in these four endpoints: Help Center articles, side conversations, custom object records, Talk and Chat data, and account configuration (macros, triggers, views, fields) each have their own APIs and limits. Zendesk lists separate incremental endpoints for several of them.
  • Ticket metrics need their own export (Incremental Ticket Metric Events).

If you rely on a vendor's tool instead

Everything above is about a script you run yourself. If a vendor's app or connector reads your Zendesk data through the Incremental APIs, the December 2 change applies to it, and Zendesk gives admins a way to request a 60-day extension for partners in Admin Center > Apps & integrations > APIs > API Configuration (announcement). Ask each vendor what it will do.

I work at Swift Labs. We keep a sourced page on what Zendesk's December 2 change breaks for third-party tools and what's still unclear: zd-export.deadlinkpatrol.com