Everstack
API ReferenceAgentsCreate Deployment Key

Create Deployment Key

POST/v1/deployments/{deploymentId}/keys
POST/v1/deployments/{deploymentId}/keys

Your instance endpoint, shown on the instance page in the dashboard. Each instance has its own host; there is no shared API host.

Parameters

NameInTypeRequiredDescription
deploymentIdpathstringYes

Request Body

PropertyTypeRequiredDescription
tenantIdstringNo
namestringNo
expiresAtstringNo

Responses

200 Create an API key for a deployment

PropertyTypeDescription
keyobject
rawKeystring

default An unexpected error response.

PropertyTypeDescription
codeinteger
messagestring
detailsobject[]

Request

curl -X POST "http://localhost:8089/v1/deployments/{deploymentId}/keys" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"tenantId":"string","name":"string","expiresAt":"2024-01-01T00:00:00Z"}'
const response = await fetch("http://localhost:8089/v1/deployments/{deploymentId}/keys", {
  method: "POST",
  headers: {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
  "tenantId": "string",
  "name": "string",
  "expiresAt": "2024-01-01T00:00:00Z"
}),
});
const data = await response.json();
import requests

response = requests.post(
    "http://localhost:8089/v1/deployments/{deploymentId}/keys",
    headers={
        "Authorization": "Bearer YOUR_API_KEY",
        "Content-Type": "application/json",
    },
    json={
  "tenantId": "string",
  "name": "string",
  "expiresAt": "2024-01-01T00:00:00Z"
},
)
data = response.json()

Response

{
  "key": {
    "id": "string",
    "deploymentId": "string",
    "name": "string",
    "keyPrefix": "string",
    "isActive": true,
    "expiresAt": "2024-01-01T00:00:00Z",
    "lastUsedAt": "2024-01-01T00:00:00Z",
    "createdAt": "2024-01-01T00:00:00Z"
  },
  "rawKey": "string"
}
{
  "code": 0,
  "message": "string",
  "details": [
    {
      "@type": "string"
    }
  ]
}