Fields

Filter objects have the following fields and links:

Fields

field name description
name name of filter
sort_field what to sort the filter results by, one of priority, created, updated, or active
sort_direction direction to sort the filter results by, asc or desc
position position of the filter in the list of filters
active whether or not this filter is active
routing_enabled whether or not routing is enabled for this filter

Links

rel class embeddable? description
self filter no this filter
user user yes only this user has permission to use this filter
group group yes only this group has permission to use this filter
cases case no cases for this filter

List

Retrieve a paginated list of all filters sorted by the position field.

GET https://yoursite.desk.com/api/v2/filters

Applicable Roles

Agent, Reporting Agent, Workflow Manager, Knowledgebase Manager, Content Manager, Business Manager, Administrative Manager, Administrator, Knowledgebase Adminstrator, and Billing Administrator

Example Curl Request

1
2
3
$ curl https://yoursite.desk.com/api/v2/filters \
    -u email:password \
    -H 'Accept: application/json'

Example Response

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
{
  "total_entries": 2,
  "page": 1,
  "_links": {
    "self": {
      "href": "/api/v2/filters?page=1&per_page=50",
      "class": "page"
    },
    "first": {
      "href": "/api/v2/filters?page=1&per_page=50",
      "class": "page"
    },
    "last": {
      "href": "/api/v2/filters?page=1&per_page=50",
      "class": "page"
    },
    "next": null,
    "previous": null
  },
  "_embedded": {
    "entries": [
      {
        "name": "My Active Cases",
        "sort_field": "priority",
        "sort_direction": "desc",
        "position": 1,
        "active": true,
        "_links": {
          "self": {
            "href": "/api/v2/filters/1",
            "class": "filter"
          },
          "group": null,
          "user": null,
          "cases": {
            "href": "/api/v2/filters/1/cases",
            "class": "case"
          }
        }
      },
      {
        "name": "Spam Cases",
        "sort_field": "priority",
        "sort_direction": "desc",
        "position": 2,
        "active": true,
        "_links": {
          "self": {
            "href": "/api/v2/filters/2",
            "class": "filter"
          },
          "group": null,
          "user": null,
          "cases": {
            "href": "/api/v2/filters/1/cases",
            "class": "case"
          }
        }
      }
    ]
  }
}

Show

Retrieve a single filter.

GET https://yoursite.desk.com/api/v2/filters/:id

Applicable Roles

Agent, Reporting Agent, Workflow Manager, Knowledgebase Manager, Content Manager, Business Manager, Administrative Manager, Administrator, Knowledgebase Adminstrator, and Billing Administrator

Example Curl Request

1
2
3
$ curl https://yoursite.desk.com/api/v2/filters/:id \
    -u email:password \
    -H 'Accept: application/json'

Example Response

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
{
  "name": "My Active Cases",
  "sort_field": "priority",
  "sort_direction": "desc",
  "position": 1,
  "active": true,
  "_links": {
    "self": {
      "href": "/api/v2/filters/1",
      "class": "filter"
    },
    "group": null,
    "user": null,
    "cases": {
      "href": "/api/v2/filters/1/cases",
      "class": "case"
    }
  }
}

List Cases

Retrieve a paginated list of all cases for the given filter.

GET https://yoursite.desk.com/api/v2/filters/:id/cases

Applicable Roles

Agent, Reporting Agent, Workflow Manager, Knowledgebase Manager, Content Manager, Business Manager, Administrative Manager, Administrator, Knowledgebase Adminstrator, and Billing Administrator

Fields

Please see Cases for details on the specific fields for each case.

Sorting

Sorting is supported on cases in a filter by using sort_field and sort_direction parameters in your request.

  • sort_field - case field on which you would like to sort
  • sort_direction - direction to sort - asc for ascending, desc for descending

The following fields can be used for sorting cases: id, created_at, priority, received_at, status, and updated_at. The default sort field is created_at and the default direction is asc.

Limits

The maximum page parameter value for this endpoint is currently 500. See Case list for more information.

Example Curl Request

1
2
3
$ curl https://yoursite.desk.com/api/v2/filters/:id/cases \
    -u email:password \
    -H 'Accept: application/json'

Example Response

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
{
  "total_entries": 2,
  "page": 1,
  "_links": {
    "self": {
      "href": "/api/v2/cases?page=1&per_page=50",
      "class": "page"
    },
    "first": {
      "href": "/api/v2/cases?page=1&per_page=50",
      "class": "page"
    },
    "last": {
      "href": "/api/v2/cases?page=1&per_page=50",
      "class": "page"
    },
    "next": null,
    "previous": null
  },
  "_embedded": {
    "entries": [
      {
        "id": 1,
        "external_id": null,
        "blurb": null,
        "subject": "Welcome",
        "priority": 5,
        "locked_until": null,
        "description": null,
        "status": "new",
        "type": "email",
        "labels": [

        ],
        "label_ids": [

        ],
        "language": "en_us",
        "created_at": "2016-09-22T16:06:17Z",
        "updated_at": "2016-09-22T16:11:17Z",
        "changed_at": "2016-09-22T16:10:17Z",
        "active_at": "2016-09-22T16:11:17Z",
        "received_at": "2016-09-22T16:06:17Z",
        "first_opened_at": "2016-09-22T16:07:17Z",
        "opened_at": "2016-09-22T16:08:17Z",
        "first_resolved_at": "2016-09-22T16:11:17Z",
        "resolved_at": "2016-09-22T16:11:17Z",
        "custom_fields": {
          "level": "vip"
        },
        "_links": {
          "self": {
            "href": "/api/v2/cases/1",
            "class": "case"
          },
          "message": {
            "href": "/api/v2/cases/1/message",
            "class": "message"
          },
          "customer": {
            "href": "/api/v2/customers/1",
            "class": "customer"
          },
          "assigned_user": {
            "href": "/api/v2/users/2",
            "class": "user"
          },
          "assigned_group": {
            "href": "/api/v2/groups/1",
            "class": "group"
          },
          "locked_by": null,
          "replies": {
            "href": "/api/v2/cases/1/replies",
            "class": "reply"
          },
          "draft": {
            "href": "/api/v2/cases/1/replies/draft",
            "class": "reply"
          },
          "notes": {
            "href": "/api/v2/cases/1/notes",
            "class": "note"
          },
          "history": {
            "href": "/api/v2/cases/1/history",
            "class": "history"
          },
          "macro_preview": {
            "href": "/api/v2/cases/1/macros/preview",
            "class": "macro_preview"
          },
          "attachments": {
            "href": "/api/v2/cases/1/attachments",
            "class": "attachment"
          }
        }
      },
      {
        "id": 1,
        "external_id": null,
        "blurb": null,
        "subject": "Help Please!",
        "priority": 5,
        "locked_until": null,
        "description": null,
        "status": "new",
        "type": "email",
        "labels": [

        ],
        "label_ids": [

        ],
        "language": "en_us",
        "created_at": "2016-09-22T16:06:17Z",
        "updated_at": "2016-09-22T16:11:17Z",
        "changed_at": "2016-09-22T16:10:17Z",
        "active_at": "2016-09-22T16:11:17Z",
        "received_at": "2016-09-22T16:06:17Z",
        "first_opened_at": "2016-09-22T16:07:17Z",
        "opened_at": "2016-09-22T16:08:17Z",
        "first_resolved_at": "2016-09-22T16:11:17Z",
        "resolved_at": "2016-09-22T16:11:17Z",
        "custom_fields": {
          "level": "vip"
        },
        "_links": {
          "self": {
            "href": "/api/v2/cases/2",
            "class": "case"
          },
          "message": {
            "href": "/api/v2/cases/1/message",
            "class": "message"
          },
          "customer": {
            "href": "/api/v2/customers/1",
            "class": "customer"
          },
          "assigned_user": {
            "href": "/api/v2/users/2",
            "class": "user"
          },
          "assigned_group": {
            "href": "/api/v2/groups/1",
            "class": "group"
          },
          "locked_by": null,
          "replies": {
            "href": "/api/v2/cases/1/replies",
            "class": "reply"
          },
          "draft": {
            "href": "/api/v2/cases/1/replies/draft",
            "class": "reply"
          },
          "notes": {
            "href": "/api/v2/cases/1/notes",
            "class": "note"
          },
          "history": {
            "href": "/api/v2/cases/1/history",
            "class": "history"
          },
          "macro_preview": {
            "href": "/api/v2/cases/1/macros/preview",
            "class": "macro_preview"
          },
          "attachments": {
            "href": "/api/v2/cases/1/attachments",
            "class": "attachment"
          }
        }
      }
    ]
  }
}