Management API
Authenticate Management API requests and find endpoints for own keys, customer keys, usage and white label domains
Use the Management API to manage your team's own and customer API keys, read traffic
and configure white label domains. The base URL is
https://console.zerocopy.sh/api/v1.
The Management API guide covers customer keys, domain setup and retries. The Metrics API guide covers Prometheus scraping, Grafana and historical queries.
Authentication and scopes
Create a management key and send it in
Authorization: Bearer YOUR_MANAGEMENT_KEY. An SWQoS API key cannot authenticate
these requests. The API ignores session cookies. If the management key has IP
restrictions, the request must come from an allowed address.
| Scope | Access |
|---|---|
keys:read | Retrieve your team's own API keys |
keys:write | Create, update and revoke your team's own API keys |
usage:read | Retrieve key statistics, transactions and metrics |
partner:read | Retrieve white label settings, tip accounts, domains, customer keys and customer usage |
partner:write | Manage domains and create, update, revoke, pause or resume customer keys |
A write scope does not grant its read scope. The current-key endpoint needs no
additional scope. White label operations require an enrolled partner team; other
teams receive HTTP 404. Enrollment leaves your own keys on company tip accounts
until all eight vanity accounts are live. You can prepare domains while ZeroCopy
reviews the accounts. Customer keys can only be created after the vanity set is
live. Use the customer-key endpoints or
White label > Customer keys to manage them.
Rate limits
Each management key may make 600 GET requests and 60 other requests per minute.
Authenticated responses carry RateLimit-Limit, RateLimit-Remaining and
RateLimit-Reset. Exceeding a key's limit returns 429 rate_limited with a
Retry-After header.
A team may run two management analytics requests concurrently. Excess requests
return 429 analytics_busy with Retry-After: 1. Prometheus cache hits do not
count toward this concurrent query limit. Use one scrape job per team and let
Grafana query the collected metrics.
Request conventions
Every response carries Request-Id. Keep it when reporting a failed request on
Discord.
JSON request and response fields use snake_case. Times use RFC 3339 unless the field specifies another format. POST and PATCH bodies have a 64 KiB limit, including streamed bodies. The Prometheus endpoint returns text exposition with explicit minute-end timestamps.
Idempotency
Send Idempotency-Key on POST requests when retrying after a timeout. Use 1 to
255 printable ASCII characters. The same management key, idempotency key and
request replay the saved successful response for 24 hours, with
Idempotent-Replayed: true. Refusals are not saved.
A different request under the same key returns 409 idempotency_key_reused.
A concurrent repeat returns 409 idempotency_in_progress. The
retry guide covers recovery when
a saved response is unavailable.
Conditional updates
Key responses include an ETag. Send that value in If-Match on key PATCH,
DELETE or customer-key pause and resume requests to reject a stale version with
412 precondition_failed.
Pagination
Paginated lists accept limit from 1 to 100. Supply the response's
next_cursor as the next request's cursor. A null cursor ends the collection.
The endpoint pages state which lists support pagination and their defaults.
Errors
Errors use application/problem+json with title, status, code, detail
and request_id. Validation errors can include an errors array of
{ path, message } strings. Match on the stable code field. These objects
differ from SWQoS rejections.
Account
| Operation | Method and path | Scope |
|---|---|---|
| Retrieve the current key | GET /me | None |
API keys
| Operation | Method and path | Scope |
|---|---|---|
| List API keys | GET /keys | keys:read |
| Create an API key | POST /keys | keys:write |
| Retrieve an API key | GET /keys/{id} | keys:read |
| Update an API key | PATCH /keys/{id} | keys:write |
| Revoke an API key | DELETE /keys/{id} | keys:write |
| Retrieve key statistics | GET /keys/{id}/stats | usage:read |
Usage
| Operation | Method and path | Scope |
|---|---|---|
| List transactions | GET /transactions | usage:read |
Metrics
| Operation | Method and path | Scope |
|---|---|---|
| Retrieve Prometheus metrics | GET /metrics | usage:read |
| Retrieve metric history | GET /metrics/series | usage:read |
White label
| Operation | Method and path | Scope |
|---|---|---|
| Retrieve partner settings | GET /partner | partner:read |
| List tip accounts | GET /partner/tip-accounts | partner:read |
| List customer keys | GET /customer-keys | partner:read |
| Create a customer key | POST /customer-keys | partner:write |
| Retrieve customer usage | GET /customer-keys/usage | partner:read |
| Retrieve a customer key | GET /customer-keys/{id} | partner:read |
| Update a customer key | PATCH /customer-keys/{id} | partner:write |
| Revoke a customer key | DELETE /customer-keys/{id} | partner:write |
| Pause a customer key | POST /customer-keys/{id}/pause | partner:write |
| Resume a customer key | POST /customer-keys/{id}/resume | partner:write |
| Retrieve customer key statistics | GET /customer-keys/{id}/stats | partner:read |
| List domains | GET /domains | partner:read |
| Add a domain | POST /domains | partner:write |
| Retrieve a domain | GET /domains/{hostname} | partner:read |
| Remove a domain | DELETE /domains/{hostname} | partner:write |
OpenAPI
Download the OpenAPI JSON.
The console also publishes the live contract at
/api/v1/openapi.json, cached
for five minutes.