Create an API key
POST
/v1/api-keys
const url = 'https://api.segmentationapi.com/v1/api-keys';const options = { method: 'POST', headers: { 'Idempotency-Key': 'example', Authorization: 'Bearer <token>', 'Content-Type': 'application/json' }, body: '{"label":"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://api.segmentationapi.com/v1/api-keys \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'Idempotency-Key: example' \ --data '{ "label": "example" }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
Examplegenerated
{ "label": "example"}Responses
Section titled “Responses”Secret returned once
Media typeapplication/json
object
Examplegenerated
{ "apiKey": { "keyId": "example", "label": "example", "prefix": "example", "revoked": true, "revokedAt": "example", "createdAt": "example", "updatedAt": "example" }, "secret": "example", "secretUnavailable": true}Authentication is missing, invalid, or expired
Media typeapplication/json
object
Examplegenerated
{ "error": "example", "message": "example", "remainingTokens": 1, "requestedTokens": 1, "expiresAt": "2026-04-15T12:00:00Z", "activeJobId": "example", "upgradeUrl": "https://example.com", "retryAfterSeconds": 1}