Register a user
Create your account with a name, email address, and password. Registration automatically creates an initial organization and assigns you as its owner.Response:
An initial organization is created automatically on registration. You do not need to call
POST /api/v1/organizations unless you want to create additional organizations later.Log in and capture your token
Authenticate with your credentials to receive a JWT access token and refresh token. The access token is scoped to your current organization.Response:Save the
token value — you will use it as a bearer token in all subsequent management requests.The access token expires after 1 hour. Use the
refresh_token with POST /api/v1/refresh-token to get a new one. See Authentication for details.Create a project
Projects are the workspace layer between your organization and its environments. Create one to group your flags and environments.Response:Save the
project.id as your PROJECT_ID.Create an environment
Environments represent deployment stages such as production or staging. Flags and API keys are scoped to a specific environment. The current region is automatically assigned to the new environment.Response:Save the
environment.id as your ENV_ID.Create an API key
API keys are environment-scoped machine credentials used to evaluate flags from your application. Create a Response:Save the secret for use in evaluation requests.The three available scopes are:
server scoped key for backend evaluation.| Scope | Use case |
|---|---|
server | Server-side flag evaluation |
sdk | Client SDK flag evaluation |
stream | SSE real-time flag change stream |
Create a feature flag
Flags are the core resource in Togul. Each flag belongs to a specific environment and can be toggled independently. The salt used for percentage rollout hashing is auto-generated.Response:The
default_value is returned when the flag is disabled or no rules match the evaluation context.Evaluate the flag
Call Response:The
POST /api/v1/evaluate from your application using the X-API-Key header with your environment API key. Pass a context object with any attributes you want to use for targeting rules.reason field tells you why that value was returned:| Reason | Meaning |
|---|---|
disabled | The flag is turned off — default_value is returned |
rule_match | An active rule matched the context |
default | The flag is enabled but no rules matched — default_value is returned |
Next steps
Authentication
Learn how to refresh tokens and switch organization context
Flag evaluation
Understand evaluation order and how to add targeting rules
Percentage rollouts
Roll out features to a percentage of users deterministically
Real-time streaming
Subscribe to live flag changes via Server-Sent Events