Skip to main content

GET /sms/unread

Unread counts

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

This endpoint gives your unread message count two ways: a per-line count, and a single grand total. Both are returned so a UI showing one overall badge can use the grand total directly — no need to add up the per-line counts — and that badge can never disagree with the per-line numbers, since the server computes the total from the same data.

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​

NameTypeRequiredDescription
linesstringnoComma-separated account numbers. Leave it out to include every number.
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[]The per-line breakdown — one entry per line you can see.
lines[].linestringThe account number (the line) these counts are for.
lines[].countintegerHow many messages you have not read on this line.
{
"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; the type field tells them apart — insufficient_scope (the credential lacks the scope) or permission_denied (the scope is fine, but the user's role lacks the permission).
500internal_error — something failed on our side, not with your request. Safe to retry.

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 →