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.
- 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.

- Open the create dialog and check the defaults before submitting.

- Name the key, keep permissions narrow, and restrict project access when the key belongs to one agent or repository.

- Click Create Key, copy the token immediately, and store it in your client secret manager. Synth only shows the generated value once.

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
| Scope | Use |
|---|---|
knowledge:read | search, list, and read pages |
ingest:write | add sources and manage watchers |
knowledge:write | edit knowledge pages |
repo_context:read | read repository context metadata |
admin:read | read admin settings |
admin:write | change admin settings |
full_access | local 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"]