Create Api Key
POST
/api-keys
const url = 'https://api.mengi.cloud/api-keys';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"name":"example","description":"example","expires_at":"2026-04-15T12:00:00Z"}'};
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.mengi.cloud/api-keys \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "description": "example", "expires_at": "2026-04-15T12:00:00Z" }'Create a new API key.
The full API key is only returned once in this response. Store it securely - you won’t be able to see it again.
Request Body required
Section titled “Request Body required ”Responses
Section titled “ Responses ”Successful Response
Media type application/json
APIKeyCreateResponse
Response when creating a new API key - includes the full key (only shown once).
object
Example generated
{ "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "name": "example", "description": "example", "key": "example", "key_prefix": "example", "expires_at": "2026-04-15T12:00:00Z", "created_at": "2026-04-15T12:00:00Z"}Validation Error
Media type application/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationErrorobject
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Example generated
{ "detail": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ]}