Skip to navigation

Enterprise API

One organisation key for every workspace of your organisation.

Summary

The Enterprise API lets one organisation key work across the workspaces of an organisation: the organisation operations, and every workspace operation of the API reference. This page covers the key, the header that selects a workspace, and how to get access. It does not cover the steps; see Manage the workspaces of an organisation.

Facts

Access. The Enterprise API is for Enterprise customers. To turn it on for your organisation, contact Rasen at team@rasen.ai. Until Rasen turns it on, an organisation key gets 403 organisation_api_not_enabled on every operation.

ItemValue
AccessEnterprise customers only. Contact Rasen at team@rasen.ai to turn it on for your organisation
KeyAn organisation key. Its secret starts ra_org_. Only the Owner or an Admin of the organisation can create and manage one
HeaderAuthorization: Bearer <organisation key> on every request
Workspace headerRasen-Workspace: <workspace_id> on every workspace operation
Organisation operations10 operations below /organisations/{organisation_id}. See Organisation operations
Workspace operationsEvery operation of the API reference, with Rasen-Workspace
getLimitsGET /limits. With Rasen-Workspace: the numbers of that workspace and of the key in it. Without it: the numbers of the organisation
Capabilitiesorganisation.read for the 6 reads, organisation.manage for the 4 changes
Not turned on403 organisation_api_not_enabled on every operation
ReferenceEnterprise API reference

Get an organisation key

  1. Contact Rasen at team@rasen.ai to turn on the Enterprise API for your organisation.
  2. As the Owner or an Admin of the organisation, open Organization settings in the Rasen app, then API keys, and create a key.
  3. Store the secret in a secret manager. The app shows it once.
  4. Copy the organisation ID from Organization settings, General settings, Organization ID. The organisation operations take it as organisation_id in the path.

No API operation makes, changes, rotates or revokes an organisation key. The key belongs to the organisation: it keeps working when the person who made it leaves.

Two key families

Workspace keyOrganisation key
SecretStarts ra_Starts ra_org_
Who can have oneEvery workspaceAn organisation that Rasen turned the Enterprise API on for
Who manages the keysAny member of the workspaceOnly the Owner or an Admin of the organisation
Acts inIts own workspaceA workspace that Rasen-Workspace names, from the key’s workspace list
Rasen-WorkspaceIgnoredRequired on a workspace operation
Organisation operations403 forbiddenAllowed when the key has organisation operations on
Documented inAPI referenceEnterprise API reference

Workspace operations

An organisation key calls every workspace operation of the API reference: agents, tools, knowledge, calls, campaigns, webhooks and the rest. Each request names its workspace in the Rasen-Workspace header:

curl -sS "$RASEN_API_BASE/agents" \
-H "Authorization: Bearer $RASEN_API_KEY" \
-H "Rasen-Workspace: $WORKSPACE_ID"
  • A missing, empty or malformed Rasen-Workspace is 400 invalid_request with details.field Rasen-Workspace. There is no default workspace.
  • A workspace outside the organisation, or outside the key’s workspace list, is 404 not_found. Both cases get the same answer.
  • The body, the answer and the error codes of each operation are the same as for a workspace key. The Enterprise API reference shows each workspace operation with Rasen-Workspace.

Organisation operations

The organisation operations read and manage the organisation. They need a key with organisation operations on. They cover every workspace of the organisation, also workspaces that are not in the key’s workspace list, and they ignore Rasen-Workspace.

OperationPathCapability
getOrganisationGET /organisations/{organisation_id}organisation.read
listOrganisationWorkspacesGET /organisations/{organisation_id}/workspacesorganisation.read
getOrganisationUsageSummaryGET /organisations/{organisation_id}/usage/summaryorganisation.read
getOrganisationConcurrencyGET /organisations/{organisation_id}/concurrencyorganisation.read
listOrganisationPeopleGET /organisations/{organisation_id}/peopleorganisation.read
listOrganisationPersonKeysGET /organisations/{organisation_id}/people/{person_id}/keysorganisation.read
createOrganisationWorkspacePOST /organisations/{organisation_id}/workspacesorganisation.manage
archiveOrganisationWorkspacePOST /organisations/{organisation_id}/workspaces/{workspace_id}/archiveorganisation.manage
restoreOrganisationWorkspacePOST /organisations/{organisation_id}/workspaces/{workspace_id}/restoreorganisation.manage
setOrganisationWorkspaceConcurrencyPUT /organisations/{organisation_id}/workspaces/{workspace_id}/concurrencyorganisation.manage
  • organisation.manage needs a full_access organisation key with organisation operations on.
  • A workspace key gets 403 forbidden on each of them.
  • An organisation_id that is not the key’s organisation is 404 not_found.
  • No answer has a billing field or a cost.