API/Keys
Revoke an API key
DELETE/v1/keys/{key_id}· API key
Revokes a key immediately. It is marked, not deleted, so it still
appears in GET /v1/keys with revoked_at set. Revoking a key that
is already revoked succeeds and changes nothing. A key may revoke
itself; the next request made with it is 401.
curl -X DELETE https://api.einvoicing.dev/v1/keys/<key_id> \ -H "Authorization: Bearer $EINVOICING_API_KEY"<?php$client = new GuzzleHttp\Client();$response = $client->request('DELETE', 'https://api.einvoicing.dev/v1/keys/<key_id>', [ 'headers' => [ 'Authorization' => 'Bearer ' . getenv('EINVOICING_API_KEY'), ],]);$data = json_decode((string) $response->getBody(), true)['data'];req, _ := http.NewRequest(http.MethodDelete, "https://api.einvoicing.dev/v1/keys/<key_id>", 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/<key_id>", { method: "DELETE", headers: { Authorization: `Bearer ${process.env.EINVOICING_API_KEY}`, },});const { data } = await res.json();Parameters
| Name | In | Type | Description |
|---|---|---|---|
key_idrequired | path | Ulid | The key's |
Response
204 The key is revoked.
No body.
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
|
| 404 | No such resource on this account. Problem |
| 429 | Too many requests in a short window. Slow down and retry after the
number of seconds in |