Create Deployment Key
POST
/v1/deployments/{deploymentId}/keysPOST
/v1/deployments/{deploymentId}/keysYour instance endpoint, shown on the instance page in the dashboard. Each instance has its own host; there is no shared API host.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
deploymentId | path | string | Yes |
Request Body
| Property | Type | Required | Description |
|---|---|---|---|
tenantId | string | No | |
name | string | No | |
expiresAt | string | No |
Responses
200 Create an API key for a deployment
| Property | Type | Description |
|---|---|---|
key | object | |
rawKey | string |
default An unexpected error response.
| Property | Type | Description |
|---|---|---|
code | integer | |
message | string | |
details | object[] |
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"
}
]
}
