Skip to main content

GET /sms/unread

Unread counts

Scopemessages:read
Role permissionPhone numbers — only lines the credential is authorized for
CostFree

How many messages you have not read, per line and in total. Both are returned so a client rendering one badge does not have to add them up and cannot disagree with the per-line numbers.

An API key has no user behind it and therefore no personal unread state; it gets the line-level counts, which is the only honest answer available to a credential that is not a person.

Query parameters

NameTypeRequiredExampleDescription
linesstringnoComma-separated account numbers. Omit for all of them.
sincestring (RFC 3339)noOnly count messages after this instant, RFC 3339.

Responses

200

Unread counts.

FieldTypeDescription
totalintegerThe sum across every line reported, so one badge cannot disagree with the per-line numbers.
linesobject[]
lines[].linestring
lines[].countinteger
{
"data": {
"total": 7,
"lines": [
{
"line": "12125550188",
"count": 5
},
{
"line": "12125550199",
"count": 2
}
]
}
}

Errors

StatusMeaning
400invalid_request — a missing or malformed field, an unknown enum value, or an unknown field in the body. Nothing was charged.
401unauthenticated — no credential, or one that is invalid, revoked or expired. The WWW-Authenticate header names the scope the endpoint wanted.
403Two different failures share this status, and the type tells them apart:
500internal_error — something failed on our side. For a send, nothing was charged, guaranteed, which is what makes a retry safe.

See Errors for the full catalog and what to do about each.

Example

curl -X GET 'https://api.account.telebroad.com/api/public/v1/sms/unread' \
-H "Authorization: Bearer $TB_KEY"

Try it in the playground →