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

# workspace.credits_exhausted

> Triggered when a client workspace uses up its credit limit or budget

This event fires when one of your client workspaces uses up its monthly limit (`MONTHLY`) or its budget (`FIXED`).

## Where it is sent

* To the agency owner's **personal workspace**, not to the client workspace. `workspaceId` is your personal workspace; `data.clientWorkspaceId` is the client workspace that ran out.
* **Owner only:** only the owner of the personal workspace can see, subscribe to or test this event. Other members, admins included, cannot subscribe to it.

## When this event fires

* Spending reaches the workspace's monthly limit or fixed budget.
* A job is refused because it needs more credits than the workspace has left. `remaining` can then be above 0.
* Once per run-out. It fires again only after the workspace has credits again (a top-up, a higher limit or a new billing cycle) and then runs out again.

Workspaces with no limit (`NONE`) never send this event.

> [!WARNING]
>
> **Give every endpoint an explicit event list.** While any enabled endpoint in your personal workspace has no event filter (subscribed to everything), this event is not delivered to any endpoint in that workspace. A run-out that happens during that time is not delivered later either.

## Payload

```json theme={null}
{
  "eventId": "ws_client_abc123_1763388192000",
  "eventType": "workspace.credits_exhausted",
  "timestamp": "2026-11-17T14:03:30.000Z",
  "workspaceId": "ws_personal_xyz789",
  "data": {
    "clientWorkspaceId": "ws_client_abc123",
    "clientWorkspaceName": "Acme Corp",
    "mode": "FIXED",
    "limit": 500,
    "used": 480,
    "remaining": 20,
    "exhaustedAt": "2026-11-17T14:03:12.000Z"
  }
}
```

## Payload Fields

| Field | Type | Description |
| - | - | - |
| `eventId` | string | `{clientWorkspaceId}_{epochMs}`, where epochMs is `exhaustedAt` in milliseconds. Every delivery of one run-out has the same id; use it to drop duplicates |
| `eventType` | string | Always `workspace.credits_exhausted` |
| `timestamp` | string | ISO 8601 time the event was sent |
| `workspaceId` | string | Your personal (agency) workspace, not the client workspace |
| `data.clientWorkspaceId` | string | The client workspace that ran out |
| `data.clientWorkspaceName` | string | Its name when the event was sent |
| `data.mode` | string | `MONTHLY` or `FIXED`; the same value as `creditMode` in the [client workspaces API](https://docs.sendler.ai/api-reference/endpoint/get-client-workspaces.md) |
| `data.limit` | number | `MONTHLY`: credits per cycle. `FIXED`: budget granted so far, top-ups included |
| `data.used` | number | Credits spent this cycle (`MONTHLY`) or since the budget began (`FIXED`) |
| `data.remaining` | number | `max(0, limit - used)`; can be above 0 (see above) |
| `data.exhaustedAt` | string | ISO 8601 time the workspace ran out |

## Use Cases

* Bill the client, or [top up its budget](https://docs.sendler.ai/api-reference/endpoint/post-client-workspace-top-up.md).
* [Raise its limit](https://docs.sendler.ai/api-reference/endpoint/patch-client-workspace-limits.md).
* Tell the account manager.


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