Ticket Import

You can use the imports API to move tickets in bulk from legacy systems into Zendesk Support.

Ticket imports support the normal ticket properties outlined in Tickets, but have some additional features and restrictions.

Timestamps

You can set the following time stamps on the tickets: solved_at, updated_at, and created_at. However, providing a value for created_at or updated_at before 1970 will be automatically rounded up to 1970.

Comments

You can include one or more comments with a ticket. See Ticket Comments for the properties. You can use value, body, or html_body for the comment body. You can also set the comment's created_at time stamp. However, you can't set the time stamp before 1970 or in the future.

Direct to archive

Ticket imports support the additional request parameter of archive_immediately. If true, any ticket created with a closed status bypasses the normal ticket lifecycle and will be created directly in your ticket archive. It's important to note that archived tickets have a handful of restrictions around their use. You can read more about it here.

You may want to explore this option if you are importing a large amount of historical data (750,000+ tickets) and don't want to impact the performance of your active tickets.

Attachments

Attachments are handled the same way as in the tickets API. You upload the files then supply the token in the comment parameters. See Attaching files.

Triggers

No triggers are run on the imported tickets. As a result, there won't be any detailed ticket metrics for the tickets. Zendesk recommends setting a tag to signify that these tickets were added to Zendesk Support using import.

Notifications

No notifications are sent to users cc'ed on the imported tickets. Notifications are sent on subsequent updates to the tickets.

Ticket Import

POST /api/v2/imports/tickets.json

Allowed For
  • Admins
Request body

The endpoint takes a ticket object describing the ticket. Example:

{
  "ticket": {
    "requester_id": 827,
    "assignee_id": 19,
    "subject": "Some subject",
    "description": "A description",
    "tags": [ "foo", "bar" ],
    "comments": [
      { "author_id": 827, "value": "This is a comment", "created_at": "2009-06-25T10:15:18Z" },
      { "author_id": 19, "value": "This is a private comment", "public": false }
    ]
  }
}
Using curl
curl https://{subdomain}.zendesk.com/api/v2/imports/tickets.json \
  -v -u {email_address}:{password} -X POST \
  -d '{"ticket": {"subject": "Help", "comments": [{ "author_id": 19, "value": "This is a comment" }]}}' \
  -H "Content-Type: application/json"
Example Response
Status: 201 Created
Location: https://{subdomain}.zendesk.com/api/v2/tickets/{id}.json

{
  "ticket": {
    {
      "id":      35436,
      "subject": "Help",
      ...
    }
  }
}

Ticket Bulk Import

POST /api/v2/imports/tickets/create_many.json

Accepts an array of up to 100 ticket objects.

Allowed For
  • Admins
Request body

The endpoint takes a tickets array of up to 100 ticket objects. Example:

{
  "tickets": [
    {
      "requester_id": 827,
      "assignee_id": 19,
      "subject": "Some subject",
      "description": "A description",
      "tags": [ "foo", "bar" ],
      "comments": [
        { "author_id": 827, "value": "This is a comment", "created_at": "2009-06-25T10:15:18Z" },
        { "author_id": 19, "value": "This is a private comment", "public": false }
      ]
    },
    {
      "requester_id": 830,
      "assignee_id": 21,
      "subject": "Some subject",
      "description": "A description",
      "tags": [ "foo", "bar" ],
      "comments": [
        { "author_id": 830, "value": "This is a comment", "created_at": "2009-06-25T10:15:18Z" },
        { "author_id": 21, "value": "This is a private comment", "public": false }
      ]
    }
  ]
}
Using curl
curl https://{subdomain}.zendesk.com/api/v2/imports/tickets/create_many.json \
  -v -u {email_address}:{password} -X POST \
  -d '{"tickets": [{"subject": "Help!", "comments": [{ "author_id": 19, "value": "This is a comment" }]}, {"subject": "Help!!", "comments": [{ "author_id": 21, "value": "This is a comment" }]}]}' \
  -H "Content-Type: application/json"
Example Response

This endpoint returns a job_status JSON object and queues a background job to do the work. Use the Show Job Status endpoint to check for the job's completion.