> ## Documentation Index
> Fetch the complete documentation index at: https://cpaas.fireflo.au/llms.txt
> Use this file to discover all available pages before exploring further.

# GET /v1/channels/sms/balance

> Your own SMS balance: money on your gateway account, or the units you hold of each SMS type.

What your account holds to send SMS with, and only your own. `kind` says which:

* `"currency"`: your account has a gateway account of its own. `balance` is what it holds.
* `"units"`: your provider gives you units to send with. You hold no money; `units` lists
  what you hold of each SMS type, and `balance` is null.

> [!NOTE]
>
> Needs the `sms.balance:read` scope.

## Request

```bash cURL theme={null}
curl https://api.fireflo.au/v1/channels/sms/balance \
  -H "Authorization: Bearer $OMNI_API_KEY"
```

```python Python theme={null}
import os

import requests

response = requests.get(
    "https://api.fireflo.au/v1/channels/sms/balance",
    headers={"Authorization": f"Bearer {os.environ['OMNI_API_KEY']}"},
)
print(response.status_code, response.json())
```

```javascript Node theme={null}
const response = await fetch("https://api.fireflo.au/v1/channels/sms/balance", {
  headers: {
    Authorization: `Bearer ${process.env.OMNI_API_KEY}`,
  },
});
console.log(response.status, await response.json());
```

## Response

`200 OK`. For a `"currency"` account, `balance` and `sms_count` are the gateway's own figures. `balance` can be the string `"ND"`: the gateway doesn't enforce a balance on this account, which is not the same as zero.

```json theme={null}
{
  "kind": "currency",
  "balance": 12480.5,
  "sms_count": 83203,
  "own_gateway": true,
  "units": null
}
```

For a `"units"` account, each row is one SMS type: `units` is what you hold of it, and `on` is false for a type that isn't switched on for you yet (its units can't be sent until it is).

```json theme={null}
{
  "kind": "units",
  "balance": null,
  "sms_count": null,
  "own_gateway": false,
  "units": [
    { "type": "transactional", "label": "Transactional", "units": 4200, "on": true },
    { "type": "promotional", "label": "Promotional", "units": 0, "on": true }
  ]
}
```

## Errors

Every refusal is `{"error": {"code", "message", "field"}}`; `field` is there when one input is at fault.

| Status | Error code | When |
| :- | :- | :- |
| 404 | `channel_off` | The account doesn't have SMS on. |
| 409 | `provider_refused` | The SMS gateway refused it or couldn't be asked; the message says why. |
| 403 | `scope_missing` | The key doesn't have the `sms.balance:read` scope. |

Any request can also be refused for its key, its account or its rate (`key_required`, `invalid_key`, `account_suspended`, `plan_excludes_api`, `address_not_allowed`, `rate_limited`); see [the overview](https://cpaas.fireflo.au/api-reference/overview.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.