Create an API key
const url = 'https://api.deploybase.eu/api/v1/api/v1/api-keys';const options = { method: 'POST', headers: {Authorization: '<Authorization>', 'Content-Type': 'application/json'}, body: '{"kind":"standard","name":"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.deploybase.eu/api/v1/api/v1/api-keys \ --header 'Authorization: <Authorization>' \ --header 'Content-Type: application/json' \ --data '{ "kind": "standard", "name": "example" }'Creates an API key for the current team and returns it with the raw secret in raw_key. The raw key is shown only in this response; store it now. kind is “standard” (default; never expires) or “agent” (expires 90 days after creation; rotate it to extend). The lifetime is set by the server. A team holds at most 25 usable keys (expired and revoked keys do not count). Requires the admin role and a verified email.
Authorizations
Section titled “ Authorizations ”Request Body
Section titled “ Request Body ”Key name and kind
object
Kind is “standard” (the default when empty; never expires) or “agent” (expires 90 days after creation or the last rotation). The server sets the lifetime; a client cannot choose one.
Responses
Section titled “ Responses ”Created
object
object
object
Only returned on create and rotate
Example
{ "data": { "kind": "standard" }}INVALID_INPUT
object
object
Example generated
{ "code": "example", "details": "example", "error": "example", "meta": { "request_id": "example", "timestamp": "example", "trace_id": "example" }}Unauthorized
object
object
Example generated
{ "code": "example", "details": "example", "error": "example", "meta": { "request_id": "example", "timestamp": "example", "trace_id": "example" }}FORBIDDEN or EMAIL_NOT_VERIFIED
object
object
Example generated
{ "code": "example", "details": "example", "error": "example", "meta": { "request_id": "example", "timestamp": "example", "trace_id": "example" }}QUOTA_EXCEEDED
object
object
Example generated
{ "code": "example", "details": "example", "error": "example", "meta": { "request_id": "example", "timestamp": "example", "trace_id": "example" }}Internal Server Error
object
object
Example generated
{ "code": "example", "details": "example", "error": "example", "meta": { "request_id": "example", "timestamp": "example", "trace_id": "example" }}Live 174db30c built