Mint an API key
POST
/api/v1/keys
const url = 'http://localhost:3000/api/v1/keys';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"example","scope":"read"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:3000/api/v1/keys \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "scope": "read" }'Scope: admin.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
name
required
string
scope
required
string
Responses
Section titled “Responses”The key, with its secret, shown this once
Media typeapplication/json
object
data
required
object
id
required
string format: uuid
name
required
string
prefix
required
string
scope
required
string
createdAt
required
string format: date-time
calls
required
Requests that presented it
integer
owner
required
Whose agent it is, for one a person connected; null for a key an admin made
string | null
waiting
required
Assets it proposed that wait in Review
integer
projects
Any of:
Array<string>
null
secret
required
Shown once. Send as Authorization: Bearer <secret>
string
Example
{ "data": { "scope": "read" }}default
Section titled “default”An error
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
detail
Examplegenerated
{ "error": { "code": "example", "message": "example", "detail": "example" }}