Search Documentation

Search API endpoints, webhooks, tools, and guides

On this page6 sections
Is this helpful?
Quick Actions
Download OpenAPI.json
POST/api/integrations/create-tokenIntegrationsPermission: integrations.create

Create Integration Token

Creates a scoped machine-to-machine integration token (`inv_live_...`). Caller cannot grant scopes absent from their own role permissions. Denied for M2M token callers.

Authentication: Requires Authorization: Bearer <ACCESS_TOKEN> (Supabase JWT, OAuth2 M2M token, or integration token).

Request

Provide the following fields in the request payload.

Body application/json
namestringrequired

name parameter.

scopesarray<enum('invoice.create' | 'invoice.view' | 'invoice.delete' | 'outlet.view', ...)>optionaldefault: invoice.create,invoice.view,outlet.view,product.view

scopes parameter.

expiresInDaysinteger | object | nulloptional

expires In Days parameter.

Responses

Select a status code to inspect schema.

OK — Token created (plaintext secret returned once).application/json
successenum('true')

Success (true).

messagestring

Message.

dataobject | null

Response payload or null.

POST/api/integrations/create-token
curl -X POST "https://api.invoger.com/api/integrations/create-token" \
  -H "Authorization: Bearer <ACCESS_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Claude Desktop MCP", "scopes": [ "invoice.create", "invoice.view", "product.view" ], "expiresInDays": 90 }'
Interactive playground

Response

application/json
{
  "success": true,
  "message": "Integration token generated successfully",
  "data": {
    "id": "tok_1",
    "name": "Claude Desktop MCP",
    "plainToken": "inv_live_9876543210...",
    "scopes": [
      "invoice.create",
      "product.view"
    ]
  }
}