Authentication
The Schematic API uses API keys to authenticate requests. You can view and manage all of your API keys within your Settings page.
Secret Keys are used only for server-side integrations. These keys are meant to be confidential, so they should not be used on clients.
Publishable Keys are used in applications and websites to submit identify and track calls, as well as perform client-side feature evaluations. They can be embedded in your application and website.
API keys are environment scoped and Secret Keys are namespaced accordingly:
- Production environments will have the prefix sch_prod
- Staging environments will have the prefix sch_stag
- Development environments will have the prefix sch_dev
All API requests must be made over HTTPS. API requests without authentication will also fail.
Managing keys and environments
A request authenticated with an API key can list and read API keys, but cannot create, edit, or delete API keys or environments. An admin on your team makes those changes in the Schematic dashboard. See Roles & permissions.
Readonly API keys
API keys can optionally be created as readonly. Readonly keys can access any non-mutative part of the API, including flag checks and GET requests, but cannot perform write operations. A few GET requests that start work or return a credential reject readonly keys with a 403, such as GET /integration/start/{integration_id}, which starts an integration’s data import. When a readonly key reads a webhook, the response returns secret as an empty string. Readonly keys cannot submit events; events sent with a readonly key are accepted but appear in your instance in an error state indicating that a readonly key was used.
Readonly is set at creation time via the “Read-only” toggle in the Create API Key dialog and cannot be changed after the key is created.