GET /sms/unread
Unread counts
| Scope | messages:read |
| Role permission | Phone numbers — only lines the credential is authorized for |
| Cost | Free |
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
| Name | Type | Required | Description |
|---|---|---|---|
lines | string | no | Comma-separated account numbers. Leave it out to include every number. |
since | string (RFC 3339) | no | Only count messages after this instant, RFC 3339. |
Responses
200
Unread counts.
| Field | Type | Description |
|---|---|---|
total | integer | The sum across every line reported, so one badge cannot disagree with the per-line numbers. |
lines | object[] | The per-line breakdown — one entry per line you can see. |
lines[].line | string | The account number (the line) these counts are for. |
lines[].count | integer | How many messages you have not read on this line. |
{
"data": {
"total": 7,
"lines": [
{
"line": "12125550188",
"count": 5
},
{
"line": "12125550199",
"count": 2
}
]
}
}
Errors
| Status | Meaning |
|---|---|
400 | invalid_request — a missing or malformed field, an unknown enum value, or an unknown field in the body. Nothing was charged. |
401 | unauthenticated — no credential, or one that is invalid, revoked or expired. The WWW-Authenticate header names the scope the endpoint wanted. |
403 | Two 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). |
500 | internal_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"