9 API Access and Integrations

This chapter covers everything that connects TraxrGRC to other systems: API tokens, the REST API, the Model Context Protocol server for AI assistants, and the practices that keep machine access safe.

9.1 Integration points

IntegrationAddressAuthenticates withTurned on by
REST API/api/v1/...API tokenAlways available
OpenAPI document/api/v1/openapiNone (public)Always available
AI assistants (MCP)/api/mcpAPI token, or Microsoft Entra ID access tokenSettings → AI assistants
SCIM provisioning/scim/v2SCIM tokenSettings → Provisioning (see Authentication and Single Sign-On)
LDAP and SAML sign-inDirectory or identity providerSettings → Integrations (see Authentication and Single Sign-On)
Outbound emailYour SMTP serverSMTP credentialsSettings → Integrations (see Notifications and Email)
Outside assessments/assess/<token>A per-request linkSending an assessment (see the User Manual, Online Assessments)
Health check/api/healthNone (public)Always available; answers {"status":"ok"} or 503

TraxrGRC has no outbound webhooks and sends nothing to outside addresses except assessment emails, by design. Systems that need to react to changes read the REST API on a schedule.

9.2 API tokens

Settings → API Tokens (address /settings/api-tokens) issues bearer tokens for the REST API and the MCP server.

ActionNeeds
Open the pageapiTokens:read. With it at all you see every token; otherwise only your own.
Create a tokenapiTokens:create
Revoke your own tokenapiTokens:update
Revoke someone else'sapiTokens:update at all

None of the built-in roles holds API token rights, so by default only administrators can issue tokens.

The list shows each token's Name, Scopes, Created by, Created, Last used, Expires and Status (Active, Expired or Revoked). Last used is updated at most once a minute.

9.2.1 Creating a token

  1. Click Create token. The Create API token dialog opens.
  2. Enter a Name that says what uses it and who owns it, for example "SIEM export (Security Ops)". Up to 120 characters.
  3. Optionally set an Expiry date. The label states the longest lifetime allowed (365 days unless changed on the Sessions page). Blank gets the longest lifetime; a later date is refused. When the maximum is 0, a blank date means the token never expires.
  4. Tick the scopes: per module, Read, Create, Update, Delete, and Review where the module has it (Risks, Compliance, Policies, Data privacy). At least one is required.
  5. Click Create token.
  6. The Token created dialog shows the token once. Copy it into your secret store, then click Done. Only a SHA-256 hash is kept; a lost token cannot be recovered, only replaced.
The Create API token dialog with the name, expiry date and scope matrix.
Figure 9.1. The Create API token dialog with the name, expiry date and scope matrix.

Creating a token is recorded in the Audit Log and emails every administrator a security alert naming the token, its scopes and expiry.

9.2.2 What a token can do

A token acts as the user who created it, and every request must pass both checks:

A token works on the REST API and the MCP server. It does not work at the SCIM address, and SCIM tokens do not work on the API.

9.2.3 Expiry, revocation and restores

9.3 The REST API for administrators

Developers find the endpoints, parameters and payloads in the OpenAPI document and the User Manual chapter REST API. What an administrator needs to know:

A quick check that a token works:

curl -s -H "Authorization: Bearer $GRC_API_TOKEN" \
  "https://grc.example.com/api/v1/risks?pageSize=1"

9.4 AI assistants (MCP)

TraxrGRC includes a Model Context Protocol server at /api/mcp, so AI assistants (Microsoft Copilot Studio agents, GitHub Copilot in VS Code, Claude Code and other MCP clients) can search and read records and attach evidence on behalf of a user. The full reference, with setup for each client, is docs/MCP.md; this section covers the administrator's decisions.

The AI assistants (MCP) screen with the endpoint switches and the Microsoft Entra ID sign-in card.
Figure 9.2. The AI assistants (MCP) screen with the endpoint switches and the Microsoft Entra ID sign-in card.

9.4.1 Turning it on

Settings → AI assistants (address /settings/mcp) opens with settings:read; only an administrator can save. Every save is audited and emailed to every administrator.

SettingDefaultEffect
Allow AI assistants to connectOffTurns on /api/mcp. While off, the address and its metadata documents answer 404.
Include privacy recordsOffWhile off, processing activities, DPIAs, personal data breaches, transfer impact assessments, DPA fields on vendors, system data fields on assets and Data Liaison questionnaires are never returned or accepted, whatever the user may see in the app.
Accept Entra ID access tokensOffLets people sign in to a shared Copilot Studio agent as themselves. Needs the Directory (tenant) ID, Application (client) ID, optionally the Application ID URI (default api://<client ID>) and the Required scope (default Mcp.Access).

There is no per-user switch: while the endpoint is on, anyone with an API token or an Entra sign-in can use it. Control access through who may hold tokens.

9.4.2 What an assistant can do

Nine tools, all acting as one named user with that user's live permissions:

ToolPurpose
searchText search across risks, controls, policies, requirements, vendors, assets, audit plans and findings, incidents, projects, business units and evidence (processing activities when privacy records are included)
get_recordOne record in full, with key linked records and attachment details (including each file's SHA-256)
list_risks, list_controls, list_compliance, list_policiesFiltered lists
my_open_itemsWhat is waiting on the user
list_evidenceEvidence and vendor reports with status, files, links and lock state
create_evidence, link_evidence, lock_evidenceRecord evidence or a vendor's report, link it to the records it supports (or unlink it), and lock it; they need evidence:create or evidence:update, and unlocking stays in the app and the REST API
upload_evidenceAttach short evidence the assistant writes (up to 10 MB) to a record the user may update; for a control or compliance requirement it lands on new evidence linked to the record, which needs evidence:create
request_upload_linkA browser link, valid 15 minutes, for the user to upload up to 10 files (25 MB each) to a record

No tool deletes, unlocks, edits record fields or decides anything; the evidence tools only create evidence, change its links and lock it.

9.4.3 Authentication

9.4.4 Limits, auditing and reachability

To connect Claude Code with a token, for example:

claude mcp add --transport http grc https://grc.example.com/api/mcp \
  --header "Authorization: Bearer aat_..."

9.5 Service accounts and token practice

A token acts as its creator, so the account that creates it decides what the integration can ever do and whose name appears in the Audit Log.

Use a dedicated service account for each long-lived integration:

  1. Create a user for the integration, for example svc-siem@example.com, with a recognizable name ("Service: SIEM export"). Leave Administrator off.
  2. Create a role holding exactly the rights the integration needs, plus Read and Create on API tokens, and attach it to a group containing only the service account.
  3. Sign in as the service account once, create the token with the same narrow scopes, and store it in your secret manager.
  4. Take the API token rights off the role afterward if you want no one using that account to issue more. The existing token keeps working.

With SSO only turned on, password sign-in is refused for everyone except break-glass administrators, so a service account must then exist in your identity provider to sign in and create its token.

Tokens created by a person's own account stop working when that person leaves and their account is deactivated, which breaks the integration. Short-lived tokens for one-off jobs (such as the bundle loader) can come from an administrator's account, revoked when the job is done.

Good practice for every token: