Base URL and keys
Every path in this reference sits under https://yesboxes.io/api/v1. Send the key as Authorization: Bearer yb_live_…. Create keys in the dashboard under Settings, then API keys. Money is whole cents in USD, times are ISO 8601 and field names are camelCase.
Scopes
A key is either Read only (domains:read and mailboxes:read) or Full access, or you pick scopes yourself. A call without the scope it needs returns 403 insufficient_scope and lists the missing scopes in details.required. Each operation below names its scopes.
- domains:read
- List and read domains, DNS records, orders and Cloudflare connections.
- domains:write
- Buy and connect domains, edit DNS, rotate and disconnect.
- mailboxes:read
- List and read mailboxes and their insights.
- mailboxes:write
- Create, change and cancel mailboxes.
- credentials:read
- Read mailbox passwords, reset them and export them.
- billing:charge
- Place calls that charge the card: orders, domain purchases and new mailboxes.
- webhooks
- Manage webhook endpoints and deliveries.
- sequencers
- Manage sequencer connections and exports.
| Scope | Allows |
|---|
| domains:read | List and read domains, DNS records, orders and Cloudflare connections. |
|---|
| domains:write | Buy and connect domains, edit DNS, rotate and disconnect. |
|---|
| mailboxes:read | List and read mailboxes and their insights. |
|---|
| mailboxes:write | Create, change and cancel mailboxes. |
|---|
| credentials:read | Read mailbox passwords, reset them and export them. |
|---|
| billing:charge | Place calls that charge the card: orders, domain purchases and new mailboxes. |
|---|
| webhooks | Manage webhook endpoints and deliveries. |
|---|
| sequencers | Manage sequencer connections and exports. |
|---|
Paying
Calls that spend money need a card on file. Add it in the dashboard under Settings, then Billing: the API cannot add one. Without a card, or while a payment has failed, those calls return 402 payment_required with details.reason and a details.billingUrl. Reads, updates, deletes and dry runs work without a card. Domains are charged in the request. Mailboxes are charged by the month, prorated on your next invoice. A daily cap applies to new domain spend and to new mailboxes per workspace; going over returns 429 limit_exceeded.
Idempotency
Send an Idempotency-Key (up to 255 characters) on POST and DELETE calls. The same key with the same request returns the stored response for 24 hours, with Idempotent-Replayed: true. A different body with the same key returns 422. Only 2xx responses are stored, so you can fix a 402 or a 429 and retry with the same key. The key is required on POST /orders, POST /domains, POST /domains/{id}/mailboxes and DELETE /domains/{id}, except on a dry run. On orders and domain purchases the key stays bound to the purchase after the 24 hours, so a retry cannot buy twice. Responses that carry a password are never stored for replay.
Dry runs and price limits
Add "dryRun": true to POST /orders, POST /domains or POST /domains/{id}/mailboxes to get a quote and charge nothing. Add maxTotalCents to an order or a purchase to refuse a total above your limit with 409 price_exceeded.
Lists
List calls take limit (1 to 200, default 50) and cursor, and return { <plural>: [...], nextCursor }. nextCursor is null on the last page.
Errors
Every error has the same shape: { "error": { "code", "message", "details"? } }. Switch on code, not on the message.
- 400
- invalid_request, idempotency_key_required
- 401
- unauthorized
- 402
- payment_required, payment_failed
- 403
- forbidden, insufficient_scope
- 404
- not_found
- 409
- unavailable, conflict, locked, busy (retryable), dns_rule, request_in_progress, price_exceeded, already_created
- 422
- idempotency_key_reuse
- 424
- credential_invalid
- 429
- rate_limited, limit_exceeded
- 500, 501
- internal_error, not_available
| Status | Codes |
|---|
| 400 | invalid_request, idempotency_key_required |
|---|
| 401 | unauthorized |
|---|
| 402 | payment_required, payment_failed |
|---|
| 403 | forbidden, insufficient_scope |
|---|
| 404 | not_found |
|---|
| 409 | unavailable, conflict, locked, busy (retryable), dns_rule, request_in_progress, price_exceeded, already_created |
|---|
| 422 | idempotency_key_reuse |
|---|
| 424 | credential_invalid |
|---|
| 429 | rate_limited, limit_exceeded |
|---|
| 500, 501 | internal_error, not_available |
|---|
busy means another request holds a lock: retry after a second. credential_invalid means the Cloudflare connection stopped working and needs a new token in the dashboard.
Rate limits
Limits count per workspace, not per key, so extra keys do not raise them. Responses carry X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset. Over the limit you get 429 rate_limited with Retry-After in seconds.
- std: 600 per minute
- Everything not listed below.
- heavy: 30 per minute
- Purchases, domain connects and quotes: they call the registrar, Cloudflare or DNS.
- search: 60 per minute
- Domain search.
- secret: 60 per minute
- Endpoints that return mailbox passwords, and sequencer exports.
| Class | Used for |
|---|
| std: 600 per minute | Everything not listed below. |
|---|
| heavy: 30 per minute | Purchases, domain connects and quotes: they call the registrar, Cloudflare or DNS. |
|---|
| search: 60 per minute | Domain search. |
|---|
| secret: 60 per minute | Endpoints that return mailbox passwords, and sequencer exports. |
|---|
Connecting domains is limited to 20 names per hour, previews to 30 per 10 minutes and a nameserver check to one per minute per domain. The dashboard shares these three limits.
Mailbox logins
A mailbox has no password until provisioning finishes. Create it, wait for mailbox.active (or poll until status is active), then call a credentials endpoint. Four endpoints return passwords: the single and bulk credentials calls, the CSV export and the password reset. They need credentials:read, send Cache-Control: no-store and write an audit entry with the key and the IP address.
Connecting a domain you own
POST /domains/connect returns the domain as awaiting_nameservers. A few seconds later GET /domains/{id} shows the nameservers to set at your registrar in ns.expected, and the domain.connecting webhook carries them too. Call POST /domains/{id}/check-nameservers and read ns.status: matched moves the domain on, mismatch and review need a look. With mode: "cloudflare" yesboxes writes the records into your own Cloudflare zones instead, using a connection from POST /cloudflare-credentials. In the preview, canChallenge tells you an ownership challenge is available in the dashboard.