Skip to main content
Create a key when connecting a script or MCP client. You do not need one for normal use of the Alignr app.

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

Send Authorization: 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.

Review a key

Open a token from the list to review its owner, status, Last used, expiry and Scopes. A key marked active can still lack permission for a particular request. For a user key, also check the owner’s current roles. Use Search API keys to match a key name or prefix, or its owner’s name or email. Combine that search with the Status filter (all, active, expired or revoked). Select Name, Accountable to, Scopes, Last used, Expires or Status to cycle each heading through ascending, descending and default order. On a narrow screen, use Sort API keys. The desktop page uses the sortable column headings. The existing default is Name A–Z; missing owners and dates stay last in either direction. Search, filtering and sorting apply to the available collection before pagination; choose 25, 50 or 100 rows per page. The creation form offers scopes for the current Alignr product. Older keys may display historical scopes that are no longer offered in this form. Check the live reference for the deployment’s current reference.

Replace or revoke a key

Scopes are fixed at creation. Create a replacement key to change its access, update the consuming client, verify it works, then revoke the old key. To revoke, open the token, select Revoke, then confirm Revoke key. Revoke a suspected exposed key promptly.

Try the key

Continue with your first REST request or connect an MCP client.