Returns the workspace's account state. The state is derived from unpaid invoices each time you call this endpoint, unless operations pinned it. Use it to show a billing banner or to check why calls return 402.
Request#
This endpoint takes no path, query or body parameters.
Example request#
curl https://api.tried.com.au/account-status \
-H "Authorization: Bearer $TRIED_API_KEY"const res = await fetch("https://api.tried.com.au/account-status", {
headers: { Authorization: `Bearer ${process.env.TRIED_API_KEY}` },
});
const status = await res.json();import os, requests
res = requests.get(
"https://api.tried.com.au/account-status",
headers={"Authorization": f"Bearer {os.environ['TRIED_API_KEY']}"},
)
status = res.json()Response#
200 OK
{
"state": "invoice_overdue",
"reason": "Invoice TR-202609-4831207 is 16 days overdue",
"pinned": false,
"oldest_unpaid_invoice": {
"invoice_id": "inv_8d2e4f6a1b3c5d7e9f0a1b2c",
"amount": 184.5,
"created_timestamp": 1759276800000
},
"label": "Invoice Overdue",
"blocks": [
"calls",
"batch_calls",
"chats"
],
"states": [
"active",
"verification_needed",
"invoice_past_due",
"invoice_overdue"
]
}| Field | Type | Description |
|---|---|---|
state |
string | One of the account states below. |
reason |
string or null | Why the account is in this state, or null when active. |
pinned |
boolean | true when operations set the state by hand. A pinned state is not recomputed from invoices, and oldest_unpaid_invoice is null. |
oldest_unpaid_invoice |
object or null | Oldest invoice with status open, unpaid, past_due or failed: invoice_id, amount (AUD) and created_timestamp. |
label |
string | Display label: Active, Verification Needed, Invoice Past Due or Invoice Overdue. |
blocks |
string[] | What the state blocks: calls, batch_calls, chats or outbound_calls. Empty when nothing is blocked. |
states |
string[] | Every possible state. |
Account states#
| State | Set by | Blocks |
|---|---|---|
active |
Default | Nothing. |
verification_needed |
Operations only | Outbound phone calls and batch calls (POST /v2/create-phone-call, POST /create-batch-call). |
invoice_past_due |
An invoice unpaid for 1 day or more | Nothing. A warning only. |
invoice_overdue |
An invoice unpaid for 14 days or more | New calls, batch calls and chats. |
402 errors on blocked routes#
When the state blocks a request, call and chat creation routes return 402 with an error_code:
{
"status": 402,
"message": "Account is overdue: Invoice TR-202609-4831207 is 16 days overdue. Pay the invoice in Billing to resume calls.",
"error_code": "invoice_overdue"
}error_code |
Message |
|---|---|
invoice_overdue |
Account is overdue: <reason>. Pay the invoice in Billing to resume calls. |
verification_needed |
Account verification is needed before placing outbound calls: <reason>. |
credit_exhausted |
Credit exhausted (balance $<balance>). Add credits or turn on auto-recharge. See Get billing. |
budget_reached |
Monthly budget of $<budget> reached. Raise the budget in Billing. See Update billing settings. |
The account state is checked first, then credit and budget.
Errors#
| Status | When |
|---|---|
401 |
Missing or invalid API key. |
403 |
The key's IP allowlist or scopes reject the request. This route needs the admin scope. |
429 |
Rate limit exceeded. See Rate limits. |
See Errors for the body format.