Skip to main content

Minting a key

  1. Sign in at dashboard.segmentflow.ai.
  2. Open Settings → API Keys.
  3. Click Create API key, give it a label (e.g. production-zapier), and pick the scopes it needs.
  4. Copy the key — it’s shown once, never again. Store it in your secrets manager.

Using the key

Send the key on every request as the x-api-key header:
curl https://api.segmentflow.ai/api/v1/templates \
  -H "x-api-key: sk_live_..."
A missing or invalid key returns 401 Unauthorized. A valid key without the required scope returns 403 Forbidden.

API Keys versus WriteKeys

API Keys authenticate the unified API and the server-side SDK. Use them from backend services, internal tools, and MCP hosts that call routes such as /api/v1/templates, /api/v1/emails, or /api/v1/events. WriteKeys authenticate the Ingest API and browser/plugin event tracking. They are public, organization-level keys used by the browser SDK, Shopify, WooCommerce, and WordPress integrations. Do not use a WriteKey with the unified API, and do not put an API Key in browser code. Members can read docs and delivery records in the dashboard. Organization owners and admins create or revoke API Keys and run dashboard test sends.

Scopes

Each key carries a fixed set of scopes. The v1 launch surface uses these scopes:
ScopeResourceGrants
profiles:readProfilesList Profiles, retrieve one Profile, and read a Profile’s subscription statuses.
profiles:writeProfilesDelete one Profile or perform bulk Profile deletion.
templates:readTemplatesList and retrieve email Templates.
templates:writeTemplatesCreate, update, delete, duplicate, archive, and unarchive Templates.
assets:readAssetsList Asset metadata.
assets:writeAssetsCreate Assets, request upload sessions, finalize uploads, update, and delete.
brand-kit:readBrand KitList Brand Kits, retrieve one Brand Kit, and read extraction progress.
brand-kit:writeBrand KitCreate, update, rename, delete, clear, set default, and extract Brand Kits.
events:writeEventsTrack server-side business events via events.track.
emails:writeEmailSendsCreate one EmailSend or batch create independent EmailSends.
emails:readEmailSendsRetrieve EmailSend status.
Segments, direct Journey management, Broadcasts, anonymous web routes, and the WriteKey Ingest API are outside the v1 SDK/MCP launch surface.

Rotating and revoking keys

Keys never expire automatically — rotate on a schedule that matches your security policy. Revoke a leaked key from Settings → API Keys → Revoke. Revocation takes effect within seconds; in-flight requests on a revoked key complete, but the next request returns 401.

Idempotency

Some mutating endpoints accept an Idempotency-Key header. Send the same key with the same body to safely retry without acting twice. Email idempotency keys are required and remain reserved for the lifetime of the EmailSend record. Reusing the same key with the same request returns the existing send with its current status. Reusing it with different request parameters returns 409 Conflict. Event tracking idempotency keys are required. Reusing the same key with the same events.track request returns the original accepted event response. Reusing it with different request parameters returns 409 Conflict. For other endpoints, follow the idempotency behavior documented on the endpoint’s API reference page.