Create an API key and reveal its secret once
POST
/api-keys
const url = 'https://api.invogi.com/v1/api-keys';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{}'};
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.invogi.com/v1/api-keys \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{}'ADMIN or OWNER; requires API access to create keys. The plaintext secret is returned only on creation. API keys are workspace-bound and operate at ANALYST role; scopes do not grant an administrative user role.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”X-Invogi-Organization
string format: uuid
For a Clerk session, selects a workspace in which the user has an active membership. If omitted, the remembered accessible workspace is used. API keys remain bound to their own workspace and cannot select another tenant.
Request Body
Section titled “Request Body”Media typeapplication/json
object
scopes
Array<string>
Example
{}Responses
Section titled “Responses”Successful response
Media typeapplication/json
object
id
string
prefix
required
string
secret
required
string
scopes
required
Array<string>
Example generated
{ "id": "example", "prefix": "example", "secret": "example", "scopes": [ "example" ]}Invalid request
Media typeapplication/json
Missing or invalid API key
Media typeapplication/json
API key lacks required scope/role
Media typeapplication/json