Skip to main content

API Keys

API keys let agents and scripts use Synth without a browser session. They look like synth_sk_....

Create A Key​

In the app: Global Settings -> API Keys.

  1. Open Global Settings, choose API Keys, review the current keys, and click New Key. Project-level provider and MCP connection settings remain under Project Settings.
The Synth API Keys tab showing access summary, existing key list, and the New Key button.
The API Keys tab shows your effective access and existing keys before you add another token.
  1. Open the create dialog and check the defaults before submitting.
The Create API Key dialog before a key name or secret has been generated.
No token is generated until you click Create Key, so this is the safe point to review the owner, permissions, and project access.
  1. Name the key, keep permissions narrow, and restrict project access when the key belongs to one agent or repository.
The Create API Key dialog with a safe key name, read-only permissions, and project access controls visible.
Use the read-only preset for lookup agents, then narrow Project Access so one connected tool cannot read unrelated projects.
  1. Click Create Key, copy the token immediately, and store it in your client secret manager. Synth only shows the generated value once.
The API Key Created dialog with the generated token visually masked.
Copy the generated key before closing this dialog, store it in your secret manager, and never include it in a screenshot or message.

With curl, after setup or login has saved a session cookie:

export SYNTH_URL=https://synth.example.com

SYNTH_API_KEY=$(curl -s -b /tmp/synth.cookie \
-H "Content-Type: application/json" \
-d '{"name":"agent-key","scopes":["knowledge:read"]}' \
$SYNTH_URL/api/auth/api-keys | jq -r .key)

Copy the key immediately. Synth only shows it once.

Scopes​

ScopeUse
knowledge:readsearch, list, and read pages
ingest:writeadd sources and manage watchers
knowledge:writeedit knowledge pages
repo_context:readread repository context metadata
admin:readread admin settings
admin:writechange admin settings
full_accesslocal admin scripts only

Owner And Project Access​

Every key belongs to one User's immutable ID. Synth resolves that User's current direct, Group-derived, and SSO-managed access on every request. Disabling or deleting the User blocks the key; changing the User's access changes what the key can do without recreating it.

The selected scopes and Projects can only narrow the owner's access. They never grant a role or capability the owner does not have. Synth stores Project restrictions with stable Project IDs; the UI shows the corresponding Project names. Restrict AI-agent keys to the Projects they actually need.

Use A Key​

export SYNTH_URL=https://synth.example.com
export SYNTH_PROJECT_ID=prj_...

curl -X POST \
-H "Authorization: Bearer $SYNTH_API_KEY" \
-H "Content-Type: application/json" \
-d "{\"project_id\":\"$SYNTH_PROJECT_ID\",\"query\":\"auth\",\"limit\":10}" \
"$SYNTH_URL/api/v1/projects/$SYNTH_PROJECT_ID/search"

MCP Keys​

For MCP, prefer Project Settings -> Connect because the wizard creates a key with knowledge:read. This scope is enough for a read-only knowledge agent. MCP does not expose ingestion tools today; add ingest:write only for REST API, SDK, or automation keys that should create ingest jobs or manage watchers.

For agents that need repository metadata, add:

["knowledge:read", "repo_context:read"]