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

# Zendesk ticket export source

> Read a cursor-based Zendesk ticket export into your app.

Configure [schema discovery](https://docs.bijection.com/integrations/native-rest.md#discover-and-approve-a-provider-schema)
at a protected `data` label. The credential must be allowed to list
ticket fields and read incremental exports.

```ts theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
const selection = {
  provider: "zendesk",
  resource: "tickets",
  origin: "https://example.zendesk.com",
  path: "/api/v2/incremental/tickets/cursor.json",
  start: "1700000000",
};
```

Choose `start` as Unix seconds in text at least one minute in the past.
The proposal includes supported ticket properties and active custom fields
named `custom_field_<id>`. Choose up to 32 fields. Ticket ID keys rows.
The committed `after_cursor` is the next poll's position. A deleted ticket
removes its row. Omissions leave rows in place. A 410 for a retained cursor
stops the feed. Reset rereads from the configured start. Data pages are
limited to 36 KiB. Complete field metadata pages are staged in sealed
parts up to 2 MiB each.
[Zendesk ticket fields](https://developer.zendesk.com/api-reference/ticketing/tickets/ticket_fields/) · [Zendesk incremental exports](https://developer.zendesk.com/documentation/api-basics/working-with-data/using-the-incremental-export-api/)

## Create and update

Bind `zendeskTicketWriter(subdomain, auth, label)` at the mount’s `data`
label and pass it as `receivers.writers.zendesk`. Use
`mode: "zendesk"` with the [REST write commands](https://docs.bijection.com/integrations/native-rest.md#create-and-update-records).
Send a Zendesk `ticket` envelope. Use a numeric ticket ID as text for an
update. HTTP 201 for create or 200 for update with the ticket ID acknowledges
the synchronous write. The app retains the ID. Ticket audits and subsequent
automations have their own evidence. The receiver declares `once`.
[Provider API](https://developer.zendesk.com/api-reference/ticketing/tickets/tickets/)

## Ticket relationships

Use the cursor-export receiver with a protected `data` label and
initialize with `{ mode: "zendeskRelationships", startTime, limit: 10 }`
as the profile. The existing start-time guard applies. Each page accepts
up to 16 tickets and 36 KiB and commits tickets, edges and the incremental
cursor together. Read edges through `relationships.list` or
`get`.

The edge key contains the ticket ID and the role `requester`, `submitter`,
`assignee`, or `organization`. Null assignments clear the corresponding
edge, and an exported deleted ticket clears all of its edges. Unseen
tickets retain their published edges.
[Zendesk ticket fields](https://developer.zendesk.com/api-reference/ticketing/tickets/tickets/)

## Additional observations

Bind one protected REST mount per row in the table. Use a protected `data` label for the receiver and the mount. Call
`providerEndpoint(mode, origin, path, auth, data)` with the exact
mode and reviewed path. Initialize with
`{ profile: { mode: "provider", provider: mode, limit: 25 } }`, adding the
resource selectors below where required.

| Mode | Receiver path | Record key | Position |
| - | - | - | - |
| `zendesk.users.observations` | `/api/v2/users` | User ID | Zendesk cursor |
| `zendesk.organizations.observations` | `/api/v2/organizations` | Organization ID | Zendesk cursor |
| `zendesk.ticket.comments.observations` | `/api/v2/tickets/TICKET/comments` | Comment ID | Zendesk cursor |
| `zendesk.satisfaction-ratings.observations` | `/api/v2/satisfaction_ratings` | Rating ID | Zendesk cursor, legacy CSAT only |
| `zendesk.help-center.articles.observations` | `/api/v2/help_center/articles` | Article ID | Zendesk cursor |
| `zendesk.macros.observations` | `/api/v2/macros` | Macro ID | Zendesk cursor |

Each response admits at most 100 rows and 36 KiB. Oversized or malformed
pages preserve the last committed position. A terminal page restarts the
walk at the next poll. Rows missing from later responses stay published.

Use your Zendesk instance origin. Seal an OAuth bearer token or Basic API
credential with access to the selected Support or Help Center resource.
Use the ticket ID as `selection` for comments. The satisfaction rating
endpoint covers legacy CSAT. Use the ticket audit feed below for audit history.

[Zendesk pagination](https://developer.zendesk.com/documentation/api-basics/pagination/paginating-through-lists/)

## Apply a ticket macro

Pass `zendeskTicketWriter` in `receivers.writers` under its mode, at the installed `data` label.
Submit mode `zendesk.tickets.apply-macro` with
`{ action: "applyMacro", id, macroId, updatedAt }` under an exact command
key. Supply the ticket and macro IDs as strings and use the ticket's
observed `updated_at` value. A sealed agent credential reads the macro
preview and applies the supported changes with Zendesk's safe-update
precondition. The writer supports assignment, status, priority, type,
subject, form, tags, custom fields and plain text comments. An unsupported
preview stops before the update. HTTP 200 must attest the same ticket and
an audit ID. `detail` carries the audit ID. A concurrent ticket edit can
return 409. The host sends each task at most once.
[Macro preview](https://developer.zendesk.com/api-reference/ticketing/business-rules/macros/#show-changes-to-ticket)
[Safe update](https://developer.zendesk.com/documentation/ticketing/managing-tickets/creating-and-updating-tickets/#protecting-against-ticket-update-collisions)

## Ticket audits

Bind `zendeskAudits(subdomain, ticketId, auth, data)` as `receivers.provider`
at a protected `data` label. Initialize with
`{ mode: "zendeskAudits", ticketId: "123", limit: 20 }` and the same
ticket ID as the receiver. Use an agent credential with audit read access.

Read `occurrences.list` or `get`. The key contains the ticket
ID and audit ID. Each capture includes the audit's event list. A page
admits up to 100 audits and 36 KiB. The feed consumes Zendesk's cursor
until the terminal page, then restarts. It also accepts a single bounded
archive response when its count matches the returned rows and both
paging links are null. Repeated audits retain the first capture. A sweep
cannot certify continuous change history.
[Zendesk Ticket Audits](https://developer.zendesk.com/api-reference/ticketing/tickets/ticket_audits/)

## Webhook-assisted polling

Zendesk timestamped HMAC notifications wake ticket export, ticket relationships, audits or a native Zendesk feed.
Bind the REST mount to a protected `data` label and follow the
[verified wake route setup](https://docs.bijection.com/integrations/native-webhooks.md#wake-a-rest-source-from-a-provider-webhook)
to seal the signing secret and register the subscription for this source.

## Additional writes

Follow the [native write mount guide](https://docs.bijection.com/integrations/native-rest.md#native-provider-writes).
Pass the reviewed HTTPS endpoint, sealed credential and any listed scope
as an array to `providerWriter(mode, options, data)`. Pass the result in `receivers.writers` under its mode, on a mount with the same protected `data` label. Use a
distinct exact command key for each command. Writes accept up to 24 KiB
of JSON and carry no read cursor. Each task sends at most once.

| Mode | Scope and action |
| - | - |
| `zendesk.users.create-update` | Empty scope. Zendesk `user` envelope, keyed by user ID. |
| `zendesk.users.upsert` | Same binding. Typed `upsert` by case-insensitive `external_id`. |
| `zendesk.organizations.create-update` | Empty scope. Zendesk `organization` envelope, keyed by organization ID. |
| `zendesk.organizations.upsert` | Same binding. Typed `upsert` by case-insensitive `external_id`. |
| `zendesk.macros.create-update` | Empty scope. Zendesk `macro` envelope, keyed by macro ID. |
| `zendesk.help-center.articles.create-update` | Scope is the section ID for create. Edit article metadata by article ID with an `article` envelope. |
| `zendesk.satisfaction-ratings.create` | Scope is the ticket ID. Use a `satisfaction_rating` envelope with a permitted score. |

Use a sealed bearer or Basic authorization credential for the resource.
For the two upsert modes, construct `providerWriter` with the corresponding
create-update mode and submit the command with the upsert mode. Send
`{ action: "upsert", externalId, payload }`. The payload is the JSON
object inside the user or organization envelope. Supply the external ID
in `externalId` and omit competing identity fields such as `email` and
`id`. The provider matches the ID case-insensitively. Ticket comments
can be added in the `ticket.comment` field using the ticket update above.

[Zendesk users](https://developer.zendesk.com/api-reference/ticketing/users/users/)
[Zendesk organizations](https://developer.zendesk.com/api-reference/ticketing/organizations/organizations/)
[Zendesk articles](https://developer.zendesk.com/api-reference/help_center/help-center-api/articles/)

## Create many tickets

Pass `zendeskTicketWriter` in `receivers.writers` under its mode, at the protected `data` label
with a sealed agent credential. Submit mode `zendesk.tickets.create-many`
with `{ action: "createMany", records }` under an exact command key.
Supply 1–25 JSON ticket objects as strings. The batch request fits 24 KiB.
The writer posts once to `create_many`, retains the returned job ID, then
polls the same tenant's job status path up to the follow-up deadline.

`outcomes` follows input order and is keyed by the zero-based input index
as text. Each successful row carries the returned ticket ID. A failed row
carries its provider code when one is available. `partial` requires complete
per-row evidence with some successful tickets. Missing or duplicate
indices keep the affected records unknown. `detail` shows the terminal job
status on a matched result.
[Create many tickets](https://developer.zendesk.com/api-reference/ticketing/tickets/tickets/#create-many-tickets)
[Job results](https://developer.zendesk.com/api-reference/ticketing/ticket-management/job_statuses/#results)


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