Choose the right scopes
Scopes specify what a key may do. Many REST and MCP operations use different names; the exact-plan REST review routes accept the same colon-named preview and request scopes as their MCP tools:
Choose the exact scopes listed for your endpoint or MCP tool.
A scope is necessary but does not make every REST route accept a key. A user key with
organization.write can create, update and archive clients while its owner retains that permission. Service keys cannot perform these client writes. Other REST writes may still require a signed-in human session, even if a similarly named write scope appears. Check authentication before automating a write.
For MCP client creation and updates, use the separate organization:write scope on a user key. The owner must retain organization.write permission. Service keys are refused for those tools. See Manage clients with MCP.
To refresh evidence with MCP, use a user key with integration:read for discovery and polling and integration:sync to request collection. The owner must retain the corresponding integration.read and integration.manage permissions. A service key can use the read tools but cannot start collection. REST refresh routes use the dot-separated scopes shown above.
To first-link a PSA/RMM remote record, use integration:read to inspect existing mappings and integration:map to link one unassigned record to an existing client. The owner must retain integration.manage; service keys cannot link. REST uses integration.read/integration.manage for the corresponding narrow routes. A link neither starts source collection nor changes existing assignments.
To copy a curated standard into a disabled draft, use standards:read to choose an exact template and standards:copy to copy it. The owner must retain detection_rule.read and detection_rule.write respectively; service keys cannot copy. REST uses the dot-separated permission scopes for the narrow library routes. Activation and evaluation are separate intentions. For one-client automated evaluation, use the same user-owned key with standards:read and standards:evaluate; its owner needs current detection_rule.read and detection_rule.write. A service key may read the preview or poll but cannot start a run. Neither action collects evidence or performs manual checks.
The MCP remediation review-request workflow needs a user key with remediation:preview and remediation:request; add remediation:read to inspect the outline and follow run status. The owner must currently have remediation.read for preview and both remediation.read and remediation.execute for request, remain active and have no required password change pending. Service keys are refused for preview and request. Tool discovery alone does not grant access.
The form offers Select all and Deselect all for bulk selection. Select all adds every currently offered scope that you are allowed to issue, including scopes hidden by a text filter; it does not mean “select only these search results”. Review the complete selection before creating the key, or choose individual scopes for a narrower client. Scopes you cannot issue and historical scopes that the form no longer offers are excluded.
Create a key
1
Open MCP/API Tokens
In Alignr, open MCP in the main navigation, then select + Generate token on the MCP/API Tokens page. Signed-in users can create keys within their own permissions and manage their own keys. Administrators with
settings.manage can view and manage workspace-wide keys.2
Choose the access
Give the key a recognisable name and choose the required scopes. For the REST quickstart, use
organization.read. For the MCP Organization tool, use organization:read. If you use Select all, clear or deselect anything your script or assistant does not need before creating the key.Choose User key — bound to my account for a personal connection. Its permissions are checked against your current roles on every request, and it stops working if your account is deactivated.A Service key keeps its assigned scopes through staff changes. Creating one requires role.manage and an expiry date. The form interprets Expires on as the end of that date in UTC. Select Create key once the name, scopes and expiry are correct.3
Store the key
Copy the key when it is created; its value is shown only once. Store it in a secret manager or your client’s protected credential store.
Use the key
SendAuthorization: Bearer <your-api-key> with each request. Keys currently retain the ledgr_ prefix; use the value exactly as issued.
Do not put keys in browser code, Git commits, URLs or screenshots. Examples in these docs read ALIGNR_API_KEY from your environment.