API Keys

Create scoped, revocable credentials for the REST API, hosted MCP, and Support public API.

Leenops API keys are workspace-bound bearer credentials. The same key format is used by the REST API, hosted MCP endpoints, the leenops-mcp package, and authenticated Support public-API calls.

Create a key

You must be a workspace Admin or Owner.

  1. Open Settings > AI > External Connections > API Keys.
  2. Select API Keys, then create a key.
  3. Give the key a name and select only the scopes the integration needs.
  4. Copy the plaintext value immediately. Leenops does not show it again.

Keys start with wks_. Send one on every authenticated request:

Authorization: Bearer wks_example_key

The legacy Support > Settings > API Keys screen manages the same workspace keys, but Settings > AI > External Connections is the canonical location.

Available scopes

Leenops currently defines 34 scopes: read/write pairs for 17 API areas.

AreaRead scopeWrite scope
Support ticketstickets.readtickets.write
CRMcrm.readcrm.write
Contactscontacts.readcontacts.write
Dealsdeals.readdeals.write
Projectsprojects.readprojects.write
Project tasks / issuesissues.readissues.write
Planningplanning.readplanning.write
Assetsassets.readassets.write
Bookingsbookings.readbookings.write
Field servicefsm.readfsm.write
Goalsgoals.readgoals.write
Marketingmarketing.readmarketing.write
Procurementprocurement.readprocurement.write
Stockstock.readstock.write
Subscriptionssubscriptions.readsubscriptions.write
Surveyssurveys.readsurveys.write
Timetime.readtime.write

REST reads require a matching read or write scope. Mutations require the matching write scope. Always issue the smallest scope set needed by the integration and verify denied operations return 403.

For the Support public API specifically:

  • tickets.read authorizes GET /api/public/tickets.
  • tickets.write authorizes ticket creation and replies.
  • Authenticated requests are always restricted to the key's workspace.

Responses

  • 401 means the key is missing, malformed, expired, or revoked.
  • 403 means the key is valid but lacks a required scope.

Revoke or rotate

Revocation takes effect on subsequent requests and cannot be undone. To rotate without downtime:

  1. Create a second key with the same minimal scopes.
  2. update the integration and verify it.
  3. revoke the old key.

Use one key per integration, keep it in a secrets manager or uncommitted environment file, and never place it in browser code.