External Connection Identities
Understand service identities, API-key rotation, attribution, and optional user delegation for external agents.
An External Connection is the safe boundary between one outside client and your LeenOps workspace. Use one connection for each agent, application, or deployment so you can identify, restrict, rotate, and revoke it independently.
No manual user account is required
When an Owner or Admin creates an External Connection, LeenOps automatically creates a non-login service identity with the same display name. You do not need to invite a bot user, create a mailbox, or assign a workspace seat.
The connection contains four separate concepts:
| Concept | Meaning |
|---|---|
| Authorizer | The Owner or Admin who approved the connection |
| Service identity | The stable non-human actor recorded on actions and records |
| API key | The secret credential used to authenticate; it can be rotated |
| Delegated user | An optional person used only for inherently personal actions |
Rotating the API key keeps the same service identity and history. Revoking the connection disables both the credential and its service identity.
Normal tools and person-bound tools
Most operations run directly as the service identity. This includes contacts, companies, documents, contracts, forms, projects, and other workspace records. Document ownership, access grants, revisions, restore history, and links retain the service identity as their actor.
A small set of operations is inherently about a person, for example my tasks, my active timer, or my time entries. These operations require the connection's optional Allow person-bound tools to run as me setting. Without that setting, the tool returns:
{
"error": "This person-bound action requires explicit user delegation on the External Connection.",
"code": "human_delegation_required",
"requestId": "request-uuid"
}Do not create a fake employee or bind every connection to the workspace owner. Delegation is explicit because the personal action should be attributed to the selected person; all connection activity still records the service identity and credential separately.
Recommended setup for a nontechnical user
- Open Settings > Administration > API & MCP.
- Select Create External Connection.
- Name it after the client, such as
Hermes ProductionorClaude Desktop. - Start with Read Only or the smallest relevant permission preset.
- Leave Allow person-bound tools to run as me off unless the integration
actually needs a tool described as
my .... - Set an expiry for tests or temporary contractors.
- Create the connection and copy the key once into the client's secret or MCP configuration screen. Never paste it into a chat.
- Verify the connection with
GET /api/mcp/session, then run a read-only tool.
Only an Owner, Admin, or custom role with platform administration access can manage External Connections.
Inspect the active identity
curl "https://workspace.leenops.com/api/mcp/session" \
-H "Authorization: Bearer $LEENOPS_API_KEY"Relevant response fields:
{
"ok": true,
"apiKeyName": "Hermes Production",
"workspaceId": "workspace-uuid",
"principal": {
"id": "principal-uuid",
"type": "service",
"displayName": "Hermes Production"
},
"delegation": {
"mode": "service_principal"
}
}If delegation is enabled, delegation.mode is user and includes its user ID.
The human who created the connection is not returned as its runtime actor.
Audit and troubleshooting
Every MCP call is correlated with the workspace, service identity, API-key ID,
request ID, tool, channel, outcome, and affected entities. Secrets and sensitive
arguments are redacted. Include the X-Request-Id response header or
requestId error field in a support request; never include the API key.
| Code | Meaning | Action |
|---|---|---|
authentication_failed | Key is missing, invalid, expired, revoked, or its connection is inactive | Check the secret and connection status |
permission_denied | The connection lacks the required permission | Grant only the specific required permission |
human_delegation_required | The operation is inherently personal | Enable delegation only if that behavior is intended |
invalid_arguments | Input does not match the live tool schema | Refresh /api/mcp/tools/list and correct the input |
not_found | Resource is absent or not visible to this connection | Verify the workspace and record ID |
conflict | Resource changed since it was read | Fetch current state before retrying |
tool_execution_failed | Safe public failure; internal details are not exposed | Report the request ID to support |

