API/Keys
List API keys
GET/v1/keys· API key
Every key on the account, newest first. Revoked keys are included
with revoked_at set: a key that was used has to stay recognisable
after it stops working. Secrets are never returned. Only the public
prefix identifies a key.
curl https://api.einvoicing.dev/v1/keys \ -H "Authorization: Bearer $EINVOICING_API_KEY"<?php$client = new GuzzleHttp\Client();$response = $client->request('GET', 'https://api.einvoicing.dev/v1/keys', [ 'headers' => [ 'Authorization' => 'Bearer ' . getenv('EINVOICING_API_KEY'), ],]);$data = json_decode((string) $response->getBody(), true)['data'];req, _ := http.NewRequest(http.MethodGet, "https://api.einvoicing.dev/v1/keys", nil)req.Header.Set("Authorization", "Bearer "+os.Getenv("EINVOICING_API_KEY"))res, err := http.DefaultClient.Do(req)if err != nil { log.Fatal(err)}defer res.Body.Close()const res = await fetch("https://api.einvoicing.dev/v1/keys", { headers: { Authorization: `Bearer ${process.env.EINVOICING_API_KEY}`, },});const { data } = await res.json();Response
200 The account's keys.
| Field | Type | Description |
|---|---|---|
datarequired | ApiKey[] |
{ "data": [ { "id": "01J9Z3M8X5D7F9H1K3M5P7R9T1", "name": "CLI on steve-laptop", "mode": "live", "prefix": "einv_live_k3m9x2qa", "created_at": "2026-09-11T14:05:02.117Z", "last_used_at": "2026-09-11T15:40:18.003Z", "expires_at": null, "revoked_at": null }, { "id": "01J9Z2A1B3C5D7E9F1G3H5J7K9", "name": "Old CI key", "mode": "test", "prefix": "einv_test_b4n8w1ze", "created_at": "2026-09-11T13:01:44.520Z", "last_used_at": "2026-09-11T13:30:02.911Z", "expires_at": null, "revoked_at": "2026-09-11T14:10:00.000Z" } ]}Errors
Every error is application/problem+json (RFC 9457). Branch on type, which is stable, never on title or detail.
| Status | When |
|---|---|
| 401 | No key, or a key that is unknown or revoked. Problem |
| 403 | A test key cannot manage keys or billing. Use a live key. Problem
|
| 429 | Too many requests in a short window. Slow down and retry after the
number of seconds in |
Schemas
ApiKey
An API key, without its secret.
| Field | Type | Description |
|---|---|---|
idrequired | Ulid | A ULID. Opaque and time-ordered. |
namerequired | string | What the key is for. |
moderequired | string | Whether the key is metered (live) or free and limited (test).
|
prefixrequired | string | The public start of the key, enough to recognise it and never enough to use it. |
created_atrequired | Timestamp · date-time | RFC 3339, UTC, millisecond precision. |
last_used_atrequired | string or null · date-time | When the key last authenticated a request. Null if never. |
expires_atrequired | string or null · date-time | When the key stops working. Null if never. |
revoked_atrequired | string or null · date-time | When the key was revoked. Null while it is active. |