Views
Preview Views
You can preview views by constructing the conditions in the proper format and nesting them under the view property. See Conditions reference. The output can also be controlled by passing in any of the following parameters and nesting them under the output property.
| Name | Type | Comment |
|---|---|---|
| columns | Array | The ticket fields to display. System fields are looked up by name, custom fields by title or id. See the View columns table |
| group_by | String | When present, the field by which the tickets are grouped |
| group_order | String | The direction the tickets are grouped. May be one of "asc" or "desc" |
| sort_order | String | The direction the tickets are sorted. May be one of "asc" or "desc" |
| sort_by | String | The ticket field used for sorting. This will either be a title or a custom field id. |
This endpoint is rate limited to 5 requests per minute, per view, per agent.
Pagination
- Cursor pagination (recommended)
- Offset pagination
See Pagination.
Allowed For
- Agents
post/api/v2/views/preview
Response
Success response
Example response
{
"view": {
"active": true,
"conditions": {
"all": [
{
"field": "status",
"operator": "less_than",
"value": "solved"
},
{
"field": "assignee_id",
"operator": "is",
"value": "296220096"
}
],
"any": []
},
"default": false,
"description": "View for recent tickets",
"execution": {
"columns": [
{
"id": "status",
"title": "Status"
},
{
"id": "updated",
"title": "Updated"
},
{
"id": 5,
"title": "Account",
"type": "text",
"url": "https://example.zendesk.com/api/v2/ticket_fields/5.json"
}
],
"group": {
"id": "status",
"order": "desc",
"title": "Status"
},
"sort": {
"id": "updated",
"order": "desc",
"title": "Updated"
}
},
"id": 25,
"position": 8,
"restriction": {
"id": 4,
"type": "User"
},
"title": "Tickets updated <12 Hours"
}
}