Create API key
POST /api/v1/api-keys Select code sample Fetch cURL
description string
expiresAt string
name required string >= 1 characters <= 255 characters
organizationId integer
projectId integer
scopes Array
createdAt string
createdBy
status
List API keys Next
Get API key details
const url = 'https://localhost:8080/api/v1/api-keys';const options = { method: 'POST', headers: {Authorization: '
', 'Content-Type': 'application/json'}, body: '{"allowedIps":["example"],"description":"example","expiresAt":"example","name":"example","organizationId":1,"projectId":1,"scopes":["example"]}'}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}
curl --request POST \ --url https://localhost:8080/api/v1/api-keys \ --header 'Authorization:
' \ --header 'Content-Type: application/json' \ --data '{ "allowedIps": [ "example" ], "description": "example", "expiresAt": "example", "name": "example", "organizationId": 1, "projectId": 1, "scopes": [ "example" ] }'
Create a new API key for service-to-service authentication
Authorizations
Section titled “Authorizations ”Request Body
Section titled “Request Body ”API key configuration
Media type application/json object allowedIps ArrayExample generated
{ "allowedIps": [ "example" ], "description": "example", "expiresAt": "example", "name": "example", "organizationId": 1, "projectId": 1, "scopes": [ "example" ]}
Responses
Section titled “ Responses ”200
Section titled “200 ”Created API key (key shown only once)
Media type application/json object apiKey object allowedIps ArrayKey lifecycle
string description string expiresAt string id string keyId string lastUsedAt string name string organizationId integer projectId integer revocationReason string revokedAt string revokedBy string scopesPermissions and scope
ArrayStatus
string usageCount integer userIdUser context
string keyPrefix string plainKeyOnly returned once during creation
stringExample generated
{ "apiKey": { "allowedIps": [ "example" ], "createdAt": "example", "createdBy": "example", "description": "example", "expiresAt": "example", "id": "example", "keyId": "example", "lastUsedAt": "example", "name": "example", "organizationId": 1, "projectId": 1, "revocationReason": "example", "revokedAt": "example", "revokedBy": "example", "scopes": [ "example" ], "status": "example", "usageCount": 1, "userId": "example" }, "keyPrefix": "example", "plainKey": "example"}
400
Section titled “400 ”Bad request - Invalid request body
Media type application/json object error string error_description stringExample
{ "error": "Unauthorized", "error_description": "Invalid token"}
401
Section titled “401 ”Unauthorized - Authentication required
Media type application/json object error string error_description stringExample
{ "error": "Unauthorized", "error_description": "Invalid token"}
500
Section titled “500 ”Internal server error
Media type application/json object error string error_description stringExample
{ "error": "Unauthorized", "error_description": "Invalid token"}
Previous List API keys Next
Get API key details