Create an API key — the secret is in THIS response only
POST
/v1/account/api-keys
const url = 'https://api.monita.ai/v1/account/api-keys';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"example","expiresInDays":1}'};
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.monita.ai/v1/account/api-keys \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "expiresInDays": 1 }'Authorizations
Section titled “Authorizations”Request Body
Section titled “Request Body”Media typeapplication/json
object
name
required
string
expiresInDays
integer
Examplegenerated
{ "name": "example", "expiresInDays": 1}Responses
Section titled “Responses”Created
Media typeapplication/json
object
id
required
string
name
required
string
secret
required
string
Examplegenerated
{ "id": "example", "name": "example", "secret": "example"}No user identity
Media typeapplication/json
object
error
required
string
Examplegenerated
{ "error": "example"}Key service unavailable
Media typeapplication/json
object
error
required
string
Examplegenerated
{ "error": "example"}