## Get usage

`GET https://whatsapp.paaltech.org/api/v1/usage`

Your PaalChat usage per day and type - `message.sent`, `message.received`,
`template.sent`, `media.processed`, `callback.delivered`, `api.request` - for all your
businesses or one, in the key's environment. Defaults to the last 30 days; at most a
year per call. Meta bills WhatsApp messages separately, directly to each business.

Ability: `businesses.read`

### Query parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `from` | string | no | Format date |
| `to` | string | no | Format date |
| `business` | string | no | A business's external_id. |

### Request

```bash
curl --request GET \
  --url 'https://whatsapp.paaltech.org/api/v1/usage' \
  --header "Authorization: Bearer $PAALCHAT_TOKEN" \
  --header 'Accept: application/json'
```

### Responses

- **200** - Usage per day and type.

```json
{
  "data": {
    "from": "2026-09-03",
    "to": "2026-10-02",
    "business": "presec",
    "days": [
      {"date": "2026-10-01", "type": "message.sent", "quantity": 412},
      {"date": "2026-10-01", "type": "template.sent", "quantity": 398},
      {"date": "2026-10-01", "type": "message.received", "quantity": 57}
    ]
  }
}
```

- **401** - unauthenticated - missing, invalid, revoked or expired token

```json
{
  "error": {"code": "unauthenticated", "message": "A valid product token is required."}
}
```

- **403** - missing_ability, product_suspended or product_token_required

```json
{
  "error": {
    "code": "missing_ability",
    "message": "This token does not have the ability this request needs."
  }
}
```

- **404** - not_found - not yours, or does not exist

```json
{"error": {"code": "not_found", "message": "Business not found."}}
```

- **422** - validation_failed - fields are invalid; see errors.

```json
{
  "error": {
    "code": "validation_failed",
    "message": "The external id field format is invalid. (and 1 more error)"
  },
  "errors": {
    "external_id": ["The external id field format is invalid."],
    "name": ["The name field is required."]
  }
}
```

- **429** - rate_limited - over 300 requests/minute for this product

```json
{
  "error": {
    "code": "rate_limited",
    "message": "Too many requests. Slow down and retry after the Retry-After header."
  }
}
```

