Ticket Activities

The Ticket Activities API returns ticket activities by other people affecting the agent making the API request. Ticket activities include assigning a ticket to the agent, increasing the priority of a ticket assigned to the agent, or adding a comment to a ticket assigned to the agent. A possible use case for the API is building a personalized notification service for agents.

JSON Format

Ticket activities are represented as JSON objects with the following keys:

Name Type Comment
id integer Automatically assigned on creation
url string The API url of the activity
title string Description of the activity
verb string The type of activity. Can be "tickets.assignment", "tickets.comment", or "tickets.priority_increase"
user_id integer The id of the agent making the request
actor_id integer The id of user responsible for the ticket activity
object object The content of the activity. Can be a ticket, comment, or change
target object The target of the activity, a ticket.
user User The full user record of the agent making the request
actor User The full user record of the user responsible for the ticket activity
created_at date When the record was created
updated_at date When the record was last updated
Example
{
  "id":          35,
  "url":         "https://company.zendesk.com/api/v2/activities/35.json",
  "verb":        "tickets.assignment",
  "title":       "John Hopeful assigned ticket #123 to you",
  "user_id":      29451,
  "actor_id":     23546,
  "created_at":  "2019-03-05T10:38:52Z",
  "updated_at":  "2019-03-05T10:38:52Z",
  "object":      { ... },
  "target":      { ... },
  "user":        { ... },
  "actor":       { ... }
}

List Activities

GET /api/v2/activities.json

Allowed For
  • Agents

Lists ticket activities in the last 30 days affecting the agent making the request. Also sideloads the following arrays of user records:

  • actors - All actors involved in the listed activities
  • users - All users involved in the listed activities
Request Parameters

You can pass an optional since parameter to return the activities since a specific date. The since parameter takes a UTC time in the ISO 8601 format. Example: "2013-04-03T16:02:46Z".

Using curl
curl https://{subdomain}.zendesk.com/api/v2/activities.json \
  -v -u {email_address}:{password}
Example Response
Status: 200 OK

{
  "activities": [
    {
      "id":          35,
      "url":         "https://company.zendesk.com/api/v2/activities/35.json",
      "verb":        "tickets.assignment",
      "title":       "John Hopeful assigned ticket #123 to you",
      "user":        { ... },
      "actor":       { ... },
      "created_at":  "2019-03-05T10:38:52Z",
      "updated_at":  "2019-03-05T10:38:52Z"
    },
    {
      "id":          45,
      "url":         "https://company.zendesk.com/api/v2/activities/45.json",
      "verb":        "tickets.comment",
      "title":       "John Hopeful commented in ticket #44",
      "user":        { ... },
      "actor":       { ... },
      "created_at":  "2019-03-05T11:32:44Z",
      "updated_at":  "2019-03-05T11:32:44Z"
    }
  ]
}

Show Activity

GET /api/v2/activities/{activity_id}.json

Allowed For
  • Agents

Lists a specific activity.

Using curl
curl https://{subdomain}.zendesk.com/api/v2/activities/{id}.json \
  -v -u {email_address}:{password}
Example Response
Status: 200 OK

{
  "activity": {
    "id":          45,
    "url":         "https://company.zendesk.com/api/v2/activities/45.json",
    "verb":        "tickets.comment",
    "title":       "John Hopeful commented in ticket #44",
    "user":        { ... },
    "actor":       { ... },
    "created_at":  "2019-03-05T11:32:44Z",
    "updated_at":  "2019-03-05T11:32:44Z"
  }
}