Suspended Tickets
JSON Format
Suspended Tickets are represented as JSON objects with the following properties:
Name |
Type |
Read-only |
Mandatory |
Description |
attachments |
array |
true |
false |
The attachments, if any associated to this suspended ticket. See Attachments |
author |
object |
true |
false |
The author id (if available), name and email |
brand_id |
integer |
true |
false |
The id of the brand this ticket is associated with. Only applicable for Enterprise accounts |
cause |
string |
true |
false |
Why the ticket was suspended |
cause_id |
integer |
true |
false |
The ID of the cause |
content |
string |
true |
false |
The content that was flagged |
created_at |
string |
true |
false |
The ticket ID this suspended email is associated with, if available |
error_messages |
array |
true |
false |
The error messages if any associated to this suspended ticket |
id |
integer |
true |
false |
Automatically assigned |
message_id |
string |
true |
false |
The ID of the email, if available |
recipient |
string |
true |
false |
The original recipient e-mail address of the ticket |
subject |
string |
true |
false |
The value of the subject field for this ticket |
ticket_id |
integer |
true |
false |
The ticket ID this suspended email is associated with, if available |
updated_at |
string |
true |
false |
When the ticket was assigned |
url |
string |
true |
false |
The API url of this ticket |
via |
object |
true |
false |
An object explaining how the ticket was created. See the Via object reference |
Example
{
"attachments": [],
"author": {
"email": "[email protected]",
"id": 1111,
"name": "Mr. Roboto"
},
"brand_id": 123,
"cause": "Detected as spam",
"cause_id": 0,
"content": "Out Of Office Reply",
"created_at": "2009-07-20T22:55:29Z",
"error_messages": null,
"id": 435,
"message_id": "[email protected]",
"recipient": "[email protected]",
"subject": "Help, my printer is on fire!",
"ticket_id": 67321,
"updated_at": "2011-05-05T10:38:52Z",
"url": "https://example.zendesk.com/api/v2/tickets/35436.json",
"via": {
"channel": "email",
"source": {
"from": {
"address": "[email protected]",
"name": "TotallyLegit"
},
"rel": null,
"to": {
"address": "[email protected]",
"name": "Example Account"
}
}
}
}
List Suspended Tickets
GET /api/v2/suspended_tickets
Allowed For:
Sorting
You can sort the tickets with the sort_by
and sort_order
query string parameters.
Parameters
Name |
Type |
In |
Required |
Description |
sort_by |
string |
Query |
false |
The field to sort the ticket by, being one of author_email , cause , created_at , or subject . |
sort_order |
string |
Query |
false |
The order in which to sort the suspended tickets. This can take value asc or desc . |
Using curl
curl https://{subdomain}.zendesk.com/api/v2/suspended_tickets.json \
-v -u {email_address}:{password}
Example Response
Status 200 OK
{
"suspended_tickets": [
{
"attachments": [],
"author": {
"email": "[email protected]",
"id": 1,
"name": "Mr. Roboto"
},
"brand_id": 123,
"cause": "Detected as spam",
"cause_id": 0,
"content": "Out Of Office Reply",
"created_at": "2009-07-20T22:55:29Z",
"error_messages": null,
"id": 435,
"message_id": "[email protected]",
"recipient": "[email protected]",
"subject": "Help, my printer is on fire!",
"ticket_id": 67321,
"updated_at": "2011-05-05T10:38:52Z",
"url": "https://example.zendesk.com/api/v2/tickets/35436.json",
"via": {
"channel": "email",
"source": {
"from": {
"address": "[email protected]",
"name": "TotallyLegit"
},
"rel": null,
"to": {
"address": "[email protected]",
"name": "Example Account"
}
}
}
},
{
"attachments": [],
"author": {
"email": "[email protected]",
"id": 1,
"name": "Mr. Roboto"
},
"brand_id": 123,
"cause": "Automated response mail",
"cause_id": 0,
"content": "Out Of Office Reply",
"created_at": "2009-07-20T22:55:29Z",
"error_messages": null,
"id": 207623,
"message_id": "[email protected]",
"recipient": "[email protected]",
"subject": "Not just anybody!",
"ticket_id": 67321,
"updated_at": "2011-05-05T10:38:52Z",
"url": "https://example.zendesk.com/api/v2/tickets/35436.json",
"via": {
"channel": "email",
"source": {
"from": {
"address": "[email protected]",
"name": "TotallyLegit"
},
"rel": null,
"to": {
"address": "[email protected]",
"name": "Example Account"
}
}
}
}
]
}
Delete Multiple Suspended Tickets
DELETE /api/v2/suspended_tickets/destroy_many?ids={ids}
Accepts up to 100 ticket ids.
Allowed For
Parameters
Name |
Type |
In |
Required |
Description |
ids |
string |
Query |
true |
A comma separated list of ids of suspended tickets to delete. |
Using curl
curl https://{subdomain}.zendesk.com/api/v2/suspended_tickets/destroy_many.json?ids=1,2 \
-v -u {email_address}:{password} -X DELETE
Example Response
Status 204 No Content
Recover Multiple Suspended Tickets
PUT /api/v2/suspended_tickets/recover_many?ids={ids}
Accepts up to 100 ticket ids. Note that suspended tickets that fail to be recovered are still included in the response.
Allowed For
Parameters
Name |
Type |
In |
Required |
Description |
ids |
string |
Query |
true |
A comma separated list of ids of suspended tickets to recover. |
Using curl
curl https://{subdomain}.zendesk.com/api/v2/suspended_tickets/recover_many.json?ids=1,2 \
-H "Content-Type: application/json" -X PUT -d '{}' \
-v -u {email_address}:{password}
Example Response
Status 200 OK
{
"tickets": [
{
"author": {
"email": "[email protected]",
"id": 1,
"name": "Mr. Roboto"
},
"brand_id": 123,
"cause": "Detected as spam",
"content": "Out Of Office Reply",
"created_at": "2009-07-20T22:55:29Z",
"id": 3436,
"recipient": "[email protected]",
"subject": "Help I need somebody!",
"ticket_id": 67321,
"updated_at": "2011-05-05T10:38:52Z",
"url": "https://example.zendesk.com/api/v2/tickets/35436.json",
"via": {
"channel": "web"
}
},
{
"author": {
"email": "[email protected]",
"id": 1,
"name": "Mr. Roboto"
},
"brand_id": 123,
"cause": "Detected as spam",
"content": "Out Of Office Reply",
"created_at": "2009-07-20T22:55:29Z",
"id": 3437,
"recipient": "[email protected]",
"subject": "Not just anybody!",
"ticket_id": 67321,
"updated_at": "2011-05-05T10:38:52Z",
"url": "https://example.zendesk.com/api/v2/tickets/35436.json",
"via": {
"channel": "web"
}
}
]
}
Show Suspended Ticket
GET /api/v2/suspended_tickets/{suspended_ticket_id}
Allowed For
Parameters
Name |
Type |
In |
Required |
Description |
suspended_ticket_id |
number |
Path |
true |
The id of the suspended ticket to retrieve |
Using curl
curl https://{subdomain}.zendesk.com/api/v2/suspended_tickets/{suspended_ticket_id}.json \
-v -u {email_address}:{password}
Example Response
Status 200 OK
{
"suspended_tickets": [
{
"attachments": [],
"author": {
"email": "[email protected]",
"id": 1,
"name": "Mr. Roboto"
},
"brand_id": 123,
"cause": "Detected as spam",
"cause_id": 0,
"content": "Out Of Office Reply",
"created_at": "2009-07-20T22:55:29Z",
"error_messages": null,
"id": 435,
"message_id": "[email protected]",
"recipient": "[email protected]",
"subject": "Help, my printer is on fire!",
"ticket_id": 67321,
"updated_at": "2011-05-05T10:38:52Z",
"url": "https://example.zendesk.com/api/v2/tickets/35436.json",
"via": {
"channel": "email",
"source": {
"from": {
"address": "[email protected]",
"name": "TotallyLegit"
},
"rel": null,
"to": {
"address": "[email protected]",
"name": "Example Account"
}
}
}
},
{
"attachments": [],
"author": {
"email": "[email protected]",
"id": 1,
"name": "Mr. Roboto"
},
"brand_id": 123,
"cause": "Automated response mail",
"cause_id": 0,
"content": "Out Of Office Reply",
"created_at": "2009-07-20T22:55:29Z",
"error_messages": null,
"id": 207623,
"message_id": "[email protected]",
"recipient": "[email protected]",
"subject": "Not just anybody!",
"ticket_id": 67321,
"updated_at": "2011-05-05T10:38:52Z",
"url": "https://example.zendesk.com/api/v2/tickets/35436.json",
"via": {
"channel": "email",
"source": {
"from": {
"address": "[email protected]",
"name": "TotallyLegit"
},
"rel": null,
"to": {
"address": "[email protected]",
"name": "Example Account"
}
}
}
}
]
}
Delete Suspended Ticket
DELETE /api/v2/suspended_tickets/{suspended_ticket_id}
Allowed For
Parameters
Name |
Type |
In |
Required |
Description |
suspended_ticket_id |
number |
Path |
true |
The id of the suspended ticket to retrieve |
Using curl
curl https://{subdomain}.zendesk.com/api/v2/suspended_tickets/{suspended_ticket_id}.json \
-v -u {email_address}:{password} -X DELETE
Example Response
Status 204 No Content
Recover Suspended Ticket
PUT /api/v2/suspended_tickets/{suspended_ticket_id}/recover
Note: During recovery, the API sets the requester to the authenticated agent who called the API, not the original requester. This prevents the ticket from being re-suspended after recovery. To preserve the original requester, use the Recover Multiple Suspended Tickets endpoint with the single ticket.
Allowed For
Parameters
Name |
Type |
In |
Required |
Description |
suspended_ticket_id |
number |
Path |
true |
The id of the suspended ticket to retrieve |
Using curl
curl https://{subdomain}.zendesk.com/api/v2/suspended_tickets/{suspended_ticket_id}/recover.json \
-X PUT -v -u {email_address}:{password} -d '{}' -H "Content-Type: application/json"
Example Response
Status 200 OK
{
"ticket": [
{
"author": {
"email": "[email protected]",
"id": 1,
"name": "Mr. Roboto"
},
"brand_id": 123,
"cause": "Detected as spam",
"content": "Out Of Office Reply",
"created_at": "2009-07-20T22:55:29Z",
"id": 3436,
"recipient": "[email protected]",
"subject": "Help I need somebody!",
"ticket_id": 67321,
"updated_at": "2011-05-05T10:38:52Z",
"url": "https://example.zendesk.com/api/v2/tickets/35436.json",
"via": {
"channel": "web"
}
}
]
}