Issue an access token
OAuth 2.0 client-credentials token endpoint. Exchanges the API key you are already calling with for a bearer token that authenticates as the same account — use it to sign that account into the dashboard, or to call any endpoint that expects Authorization: Bearer instead of an API key.
Your API key is the client credential, so there is nothing to send: the account is whichever one the X-API-Key header resolves to. An agent-scoped API key returns a token for the account that owns the agent.
The body is optional. If you send one — as JSON or as application/x-www-form-urlencoded, both are accepted — grant_type must be client_credentials; any other value returns 400. There is no authorization-code flow: this endpoint never issues a token for an account other than the caller's.
expires_in is always null: the token does not expire, and no refresh_token is issued because there is nothing to refresh. Treat it as a long-lived credential and store it like a password. The only way to invalidate it is to block or deactivate the account.
Because the token carries exactly the authority the API key already had, any active account can call this — there is no extra permission to hold.
Authorization
ApiKeyAuth API key from your dashboard (Settings > API Keys)
In: header
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://loading/api/v1/oauth/token" \ -H "Content-Type: application/json" \ -d '{ "grant_type": "client_credentials" }'{
"success": true,
"data": {
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"token_type": "Bearer",
"expires_in": null,
"user_id": "ckv9x8y7z6w5v4u3t2s1r0q9"
}
}{
"success": false,
"message": "unsupported_grant_type: only client_credentials is supported"
}{
"success": false,
"message": "user not authenticated"
}{
"success": false,
"message": "account is blocked or inactive"
}{
"success": false,
"message": "internal server error"
}Get an agent's wallet balance GET
Returns the spending allotment, spend-to-date, and remaining balance for one of your agents. This is **not** the account wallet. Agents do not hold their own wallet — they spend against the account balance up to a per-agent cap, and this endpoint reports that cap and what is left of it. For the account balance itself, use the account overview endpoint. Amounts are the raw fixed-point integer used throughout the billing API: divide by 10,000 for the major-currency value (e.g. `5000000000` is ₹500,000.00). `allotment` and `remaining` are `null` when the agent is **uncapped** — they spend against the account balance with no per-agent ceiling. `spend_since` marks the start of the current spend window; `spent` counts only ledger activity after it, so resetting the window resets `spent` without touching the cap. An agent-scoped API key may only read its own agent; any other agent id returns `403`.
Mark Chat As Read POST
Mark every unread inbound message in a recipient's chat as read, and reset the conversation's unread counter. Use it when your own interface has shown the messages to a human, so the dashboard's unread badge agrees with what your agents have actually seen. Returns the chat's total message count, which is the size of the history now available. `read_receipt` reports separately whether WhatsApp was told — the local unread state is always updated, but the blue ticks on the recipient's handset need an inbound message inside the last 24 hours to attach to.


