Skip to content

Get per-status ticket counts

GET
/tickets/counts
Code sample: Shell / cURL
curl --request GET \
--url 'https://example.com/api/v1/tickets/counts?assignment=assigned&replied=waiting&clientNotifications=enabled&priority=NONE&source=PORTAL' \
--header 'Authorization: Bearer <token>'

Counts client tickets per ticket status for the queue tabs under the same filters as the list, with how many of each the caller has not read (internal notes count only for a caller holding tickets.manage) and how many have nobody assigned, leaving out the assignee filters; total is the sum of the groups, so tabs and the all-tickets count always agree. Requires the tickets.view permission.

assigneeMemberId
string
assignment

assigned keeps tickets with at least one assignee, unassigned those with none.

string
Allowed values: assigned unassigned

assigned keeps tickets with at least one assignee, unassigned those with none.

messagesFromMemberId

Keeps tickets holding a message written by this member. Internal notes count only for a caller holding tickets.manage.

string

Keeps tickets holding a message written by this member. Internal notes count only for a caller holding tickets.manage.

replied

waiting keeps tickets no agent has answered yet, replied the rest.

string
Allowed values: waiting replied

waiting keeps tickets no agent has answered yet, replied the rest.

rating

Keeps tickets the client rated with this score.

integer
>= 1 <= 5

Keeps tickets the client rated with this score.

tagId

Keeps tickets carrying this ticket tag.

string

Keeps tickets carrying this ticket tag.

clientNotifications

Whether the client still receives emails about the ticket.

string
Allowed values: enabled disabled

Whether the client still receives emails about the ticket.

createdFrom

Created at or after this moment.

string

Created at or after this moment.

createdTo

Created at or before this moment.

string

Created at or before this moment.

updatedFrom

Updated at or after this moment.

string

Updated at or after this moment.

updatedTo

Updated at or before this moment.

string

Updated at or before this moment.

closedFrom

Closed at or after this moment.

string

Closed at or after this moment.

closedTo

Closed at or before this moment.

string

Closed at or before this moment.

waitingSinceFrom

Client waiting on the team since this moment or later.

string

Client waiting on the team since this moment or later.

waitingSinceTo

Client waiting on the team since this moment or earlier.

string

Client waiting on the team since this moment or earlier.

clientId
string
requesterMemberId

Keeps the tickets this client person (a client member id) opened: the ones they created, or whose first message from a client person is theirs.

string

Keeps the tickets this client person (a client member id) opened: the ones they created, or whose first message from a client person is theirs.

orderId

Filter by the order this ticket is linked to.

string

Filter by the order this ticket is linked to.

projectId

Narrows the list as a company’s Tickets tab does. A project id keeps the tickets whose work tasks live in that project plus its company’s General tickets (no work task yet), and never another company’s; a project out of the caller’s reach answers 404. general keeps only the General tickets of the company in clientId, which is then required: without exactly one clientId, or for a project that belongs to no company, the answer is 422.

string
>= 1 characters

Narrows the list as a company’s Tickets tab does. A project id keeps the tickets whose work tasks live in that project plus its company’s General tickets (no work task yet), and never another company’s; a project out of the caller’s reach answers 404. general keeps only the General tickets of the company in clientId, which is then required: without exactly one clientId, or for a project that belongs to no company, the answer is 422.

priority
string
Allowed values: NONE LOW MEDIUM HIGH URGENT
source

Keeps tickets that came in through this channel.

string
Allowed values: PORTAL EMAIL API AGENT SMS SLACK

Keeps tickets that came in through this channel.

search

Case-insensitive search in ticket subjects, ticket codes, who asked (client person, company, lead name and email, or the phone that texted it) and message bodies. Every word must match, up to the first 16 words; a message body matches when it holds every word of three or more letters, common English and Spanish words such as the or para aside. Results rank by where they match (ticket code, then subject or company name, then requester, then message bodies) and follow sort within a rank. Internal notes match only for a caller holding tickets.manage.

string

Case-insensitive search in ticket subjects, ticket codes, who asked (client person, company, lead name and email, or the phone that texted it) and message bodies. Every word must match, up to the first 16 words; a message body matches when it holds every word of three or more letters, common English and Spanish words such as the or para aside. Results rank by where they match (ticket code, then subject or company name, then requester, then message bodies) and follow sort within a rank. Internal notes match only for a caller holding tickets.manage.

Per-status ticket counts.

Media typeapplication/json
object
data
required

Per-status ticket counts for the queue tabs.

object
byStatus
required
Array<object>
object
count
required
integer
>= -9007199254740991 <= 9007199254740991
statusId
required

Null groups tickets that have no status assigned.

string | null
unassignedCount
required

Tickets in this status with nobody assigned, leaving out the assignee filters.

integer
>= -9007199254740991 <= 9007199254740991
unreadCount
required

Tickets in this status the caller has not read. Internal notes count only for a caller holding tickets.manage.

integer
>= -9007199254740991 <= 9007199254740991
total
required

Sum of all per-status groups.

integer
>= -9007199254740991 <= 9007199254740991
unassignedTotal
required

Tickets with nobody assigned under the same filters, leaving out assigneeMemberId and assignment: what assignment=unassigned would list.

integer
>= -9007199254740991 <= 9007199254740991
unreadTotal
required

How many of those tickets the caller has not read. Internal notes count only for a caller holding tickets.manage.

integer
>= -9007199254740991 <= 9007199254740991

Example generated

{
"data": {
"byStatus": [
{
"count": 1,
"statusId": "example",
"unassignedCount": 1,
"unreadCount": 1
}
],
"total": 1,
"unassignedTotal": 1,
"unreadTotal": 1
}
}

Validation error. Parse failures include field paths and expectations.

Media typeapplication/json

Validation error with safe field paths and expected values; submitted values are never returned.

object
error
required
object
code
required

Stable machine-readable error code.

string
issues
Array<object>
object
expected
required
string
message
required
string
path
required
Array<string | number>
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

Unauthorized.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

Forbidden.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

Not found.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

Invalid input.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

Rate limit exceeded. Wait for Retry-After before retrying.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}
RateLimit-Limit
string
/^\d+$/

Maximum requests in the current quota window.

RateLimit-Policy
string

Quota policy in requests and window seconds, for example 60;w=60.

RateLimit-Remaining
string
/^\d+$/

Requests left in this quota window (zero when blocked).

RateLimit-Reset
string
/^\d+$/

Seconds until the current quota window resets, when available from the rate-limit store.

Retry-After
string
/^\d+$/

Seconds until another request may be attempted.