# Usage, suspension and deletion

Count each customer’s runs for billing, pause a customer, and delete one.

## Usage

Each account’s runs over a range of days. Read it with [Get an account’s usage](https://docs.gorunner.io/embed/api/usage/get-account-usage) or [List every account’s usage](https://docs.gorunner.io/embed/api/usage/list-usage). Your staff use the **Usage** view of **Platform › Organizations**, with **Your app’s customers** chosen, and **Export CSV**: 7, 30 or 90 days, or any range up to 366 days.

![Platform › Organizations, Usage view: each customer’s Runs, Worked, Failed, Held, Cancelled or running, and Keel tokens.](https://docs.gorunner.io/img/embed/usage-view-light.jpg)

- `runs.worked`: Finished and worked.
- `runs.failed`: Failed. A timeout is a failure.
- `runs.held`: Waiting now, on a person or a timer.
- `runs.cancelled`: Cancelled.
- `runs.inProgress`: Queued for a free slot, or running now.
- `runs.total`: The five together.
- `testRuns`: Test runs from the editor, counted apart.
- `assistantTokens`: Assistant tokens your installation’s AI key paid for.

- **What counts**: Production runs, on the day they started, in UTC. A sub-flow is part of the run that called it.
- **The range**: `from` and `to` are days (`YYYY-MM-DD`), both counted: at most 366 days, ending no later than today.
- **When**: Counted every 5 minutes. `asOf` says when, and is `null` until the first count has caught up.

A run that worked, failed or was cancelled stays counted after it is deleted, so cleaning up history never lowers a bill. Held and in progress are “right now”: a run that started last month and is approved today moves to worked in last month’s numbers.

## Suspend an account

For a customer who hasn’t paid, or while you look into something. Use [Suspend an account](https://docs.gorunner.io/embed/api/accounts/suspend-account), or **Suspend…** on the customer’s record, with a reason. Everything is kept, and nothing new runs.

- **Triggers stop**: Webhooks and hosted forms answer `503 ACCOUNT_SUSPENDED` with `Retry-After: 3600`, which senders retry. Schedules don’t tick, and polls don’t call out. Nothing is caught up later.
- **Nothing new runs**: A queued run is cancelled, and timed waits don’t come due. An approval answered meanwhile isn’t recorded; its link works again once the account is active. A run already going finishes.
- **The embed is read-only**: Sessions renew at once. Customers see “Workflows are paused.” and can look at everything; a change is refused with `403 ACCOUNT_SUSPENDED`. Your page hears an `error` event with `account_suspended`, not fatal.
- **You can still manage it**: Your server can read and change it, and give its people login codes.

**Resume** with [Resume an account](https://docs.gorunner.io/embed/api/accounts/resume-account) or **Resume…** on the record. It runs again from now: sessions renew writable, and nothing that arrived meanwhile is replayed. Webhook senders that kept retrying deliver again.

## Delete and restore

[Delete an account](https://docs.gorunner.io/embed/api/accounts/delete-account) deletes it for 30 days. Deleting happens only through the API, never from the Platform.

- **At once**: Its sessions end, and its webhooks and forms answer as if they never existed. Nothing runs, and login codes for it are refused with `409 ACCOUNT_DELETED`. It stops counting against the license’s organization limit.
- **Within 30 days**: [Restore an account](https://docs.gorunner.io/embed/api/accounts/restore-account), or **Restore…** on the record, brings it back as it was. It counts against the limit again, so it is refused if the limit is reached.
- **After 30 days**: Restoring answers `409 RESTORE_EXPIRED`.

> **Danger** After 30 days the account is removed for good, with everything in it, its runs’ stored data included.

## Related

- [Accounts and people](https://docs.gorunner.io/embed/accounts-and-people): Accounts, workspaces and limits
- [Notifications](https://docs.gorunner.io/embed/notifications): Hear runs as they finish
- [Partner API](https://docs.gorunner.io/embed/api): Usage and accounts from your server

Source: https://docs.gorunner.io/embed/usage-suspension-deletion
