Ticket Import

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

In addition to setting the normal ticket properties outlined in Tickets, 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.

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.

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.

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.

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.