List activity segments

GET/v2/helpdesk/activity/segments

Return the periods in which Helpdesk members were Available, Away or Offline, with start and end times, newest first.

Working draft. These docs are illustrative: names, endpoints and examples describe the intended behaviour and can change before launch.

Returns the individual periods behind the attendance totals. A segment is an unbroken stretch of time in which one member stayed in one attendance state. Call it for a timeline of who was at their desk and when, or to check why a member received no tickets at a given hour.

Request

GET /v2/helpdesk/activity/segments

Query parameters:

Name Type Required Description
memberId string No Only segments of this member, starting with usr_.
teamId string No Only members of this team, starting with team_.
state string No available, away or offline.
from string No Only segments that end at or after this ISO 8601 UTC time. Defaults to 24 hours ago.
to string No Only segments that start before this ISO 8601 UTC time. Defaults to now.
limit integer No Items per page, from 1 to 100. Defaults to 20.
cursor string No The nextCursor value from the previous page.

For daily totals instead of raw periods, use List attendance rows.

Example request

curl "https://api.askocto.co/v2/helpdesk/activity/segments?memberId=usr_6k9d2r&from=2026-03-20T00:00:00Z" \
  -H "Authorization: Bearer $OCTO_API_KEY"
const url = new URL("https://api.askocto.co/v2/helpdesk/activity/segments")
url.searchParams.set("memberId", "usr_6k9d2r")
url.searchParams.set("from", "2026-03-20T00:00:00Z")

const response = await fetch(url, {
  headers: { Authorization: `Bearer ${process.env.OCTO_API_KEY}` },
})

const { data } = await response.json()
for (const segment of data) {
  console.log(segment.state, segment.startedAt, segment.endedAt ?? "still running")
}

Example response

A successful call returns 200 OK.

{
  "data": [
    {
      "memberId": "usr_6k9d2r",
      "state": "available",
      "startedAt": "2026-03-20T13:15:00Z",
      "endedAt": null
    },
    {
      "memberId": "usr_6k9d2r",
      "state": "away",
      "startedAt": "2026-03-20T12:30:00Z",
      "endedAt": "2026-03-20T13:15:00Z"
    },
    {
      "memberId": "usr_6k9d2r",
      "state": "available",
      "startedAt": "2026-03-20T08:00:00Z",
      "endedAt": "2026-03-20T12:30:00Z"
    }
  ],
  "nextCursor": null
}

Response fields

Name Type Description
data[].memberId string The workspace member, starting with usr_.
data[].state string available, away or offline.
data[].startedAt string When the member entered the state, as an ISO 8601 UTC time.
data[].endedAt string or null When the state ended. null while the member is still in it.
nextCursor string or null Pass it as cursor for the next page. null on the last page.

Segments are sorted by startedAt, newest first. A segment that crosses the from or to boundary is returned whole, so its times can fall outside your range. The states are the same as in the dashboard, see Attendance.

Errors

Status Code When
400 invalid_request state has an unknown value, from or to is not an ISO 8601 time, or limit is outside 1 to 100.
401 unauthorized The API key is missing, malformed or deleted.
404 not_found The team or member does not exist in your workspace.
429 rate_limited Too many requests. Wait for the number of seconds in the Retry-After header.

Read more about cursors in Pagination.

Something unclear or missing? Tell us and we will fix the page.