Zendesk - Love your helpdesk.

we are hiring!
  1. Home
  2. Tour
  3. Extras
  4. Buzz

REST API: Groups

An agent is a member of one or more groups.

Show

GET /groups/#{id}.xml
Returns a single group.

Response

Status: 200
<group> <id>2</id> <is-active>true</is-active> <name>Support</name> <users> <user> <created-at>2006-12-14T16:46:02Z</created-at> <email>alexander@somewhere-strange.com</email> <group-id type="NilClass">2</group-id> <id>3</id> <is-active>true</is-active> <is-verified>true</is-verified> <name>Alexander Allison</name> <roles>15</roles> <time-format>0</time-format> <time-zone>(GMT +01:00) Brussels, Copenhagen, Madrid, Paris</time-zone> <updated-at>2007-06-16T14:15:09Z</updated-at> </user> ... </users> </group>

The returned XML includes users (i.e. agents) assigned to the group.

List All

GET /groups.xml

Response

Status: 200
<groups> <group> ... </group> <group> ... </group> </groups>

Create

POST /groups.xml
Creates a new group.

Request

<group>
  <name>Hardware</name>
  <agents type='array'>
    <agent>43</agent>
  </agents>
</group>

Response

Status: 201
Location: http://account.zendesk.com/groups/#{new-group-id}.xml

Adds a group with one agent as member.

Update

PUT /groups/#{id}.xml
Updates an existing group with new details from the submitted XML.

Request

<group>
  <name>Hardware and ICP</name>
  <agents type='array'>
    <agent>43</agent>
    <agent>67</agent>
  </agents>
</group>

Note that if you do not submit an agents array, no agents get unassigned from the group. If you submit an empty array, all agents get removed from the group:

<group>
  <name>The now empty group</name>
  <agents type='array'></agents>
</group>

Response

Status: 200

Updates the group and sets two users to be a member of this group. Omit the <agents> part, if you do not wish to change the groups’ membership status.

Destroy

DELETE /groups/#{id}.xml
Destroys the group at the referenced URL.

The group is not actually deleted from the system, but is set inactive and can no longer be assigned.

Response

Status: 200