SyncFlo AI
Security

API Key Scopes

Restrict API keys to specific permissions using scopes. Fine-grained access control ensures each integration only has the permissions it needs.

How Scopes Work

Keys can optionally be restricted to a set of scopes. When creating or editing an API key in the dashboard, select only the scopes your integration requires.

A key with no scopes assigned has full account access — this is backward-compatible with existing integrations.

Available Scopes

ScopeGrants
leads:readView leads
leads:writeView, update, assign, create, delete leads
conversations:readView conversations and messages
messages:sendView conversations + send messages
campaigns:readView campaigns
campaigns:writeView + create campaigns
campaigns:sendView + send/queue campaigns
orders:readView orders
orders:writeView + create/update orders
catalogue:readView product catalogue
knowledge:readView knowledge base sources
knowledge:writeView + upload to knowledge base
agents:readView AI agents
agents:writeView + create/update agents
analytics:readView analytics and usage
ai:useUse AI simulation endpoint

Scoped Request Example

API Request with Scoped Key

curl -X GET https://dashboard.syncflo.xyz/api/v1/leads \
  -H "Authorization: Bearer sfk_scoped_key_here"

# This key only has leads:read scope
# ✓ GET /api/v1/leads       → 200 OK
# ✗ DELETE /api/v1/leads/123 → 403 Forbidden

Exceeding Key Scope

A request that requires a permission not included in the key's scopes will return a 403 Forbidden response with a clear error message indicating the missing scope.

{
  "error": "Insufficient scope: requires leads:write",
  "code": "forbidden"
}

Scope Best Practices

Follow the principle of least privilege — only grant scopes each integration actually needs.
Use separate API keys for different services (e.g., one for analytics, another for messaging).
Audit key scopes periodically in the dashboard to remove unnecessary permissions.
Combine read and write scopes intentionally — write scopes always include read access for the same resource.