Create key

View .md

Create an API key. The full secret is shown once.


The full secret is returned once in this response and never again. Store it securely.

POST/v1/api-keys
Dashboard JWT only

Create an API key. The full secret is shown once in the response and never again.

Authorizationstringheaderrequired

Bearer token. Dashboard JWT (this endpoint is dashboard-only).

Content-Typestringheaderrequired

Must be `application/json` for requests with a JSON body.

namestringrequired

1 to 80 chars.

environmentstring

live | test (default live).

idstring

API key id.

namestring

Label you gave the key.

keystring

The full secret (dra_…). Store it now; it is never shown again.

environmentstring

live or test.

const response = await fetch("https://api.dravo.dev/v1/api-keys", {  method: "POST",  headers: {  "Authorization": "Bearer " + process.env.DRAVO_API_KEY,  "Content-Type": "application/json",},  body: JSON.stringify({  "name": "Production",  "environment": "live"})});const data = await response.json();console.log(data);
{  "id": "key_1",  "name": "Production",  "key": "dra_live_8f2c…",  "environment": "live"}