Admin API overview

View as Markdown

The Admin API provides comprehensive programmatic access to all Unleash resources. Use it to manage feature flags, projects, environments, users and roles, integrations, and more. This API powers the Unleash Admin UI and enables automation workflows.

Base path: <your-unleash-url>/api/admin

Primary use: Create and manage flags, configure projects, control access, integrate with third-party tools, and automate deployment workflows.

Authentication

Use service account tokens or personal access tokens for authentication. Service accounts are preferred for production integrations as they’re not tied to individual users.

To create a service account, go to Admin settings > Service accounts > New service account.

To create a personal access token, go to Profile > View profile settings > Personal API tokens > New API token.

All requests require the Authorization header:

$curl -H "Authorization: YOUR_PERSONAL_ACCESS_TOKEN" \
> https://your-unleash-instance.com/api/admin/projects

Learn more about API tokens and client keys.

API specification

You can also access the OpenAPI specification from your Unleash instance:

  • Interactive Swagger UI: <your-unleash-url>/docs/openapi/
  • Raw JSON: <your-unleash-url>/docs/openapi.json

OpenAPI is enabled by default in v5.2+. For v4.13+, set ENABLE_OAS environment variable.

Example requests

Create a feature flag

$curl -X POST \
> https://your-unleash-instance.com/api/admin/projects/default/features \
> -H "Authorization: YOUR_ADMIN_TOKEN" \
> -H "Content-Type: application/json" \
> -d '{
> "name": "new-feature",
> "description": "A new feature flag",
> "type": "release"
> }'

Enable a flag in an environment

$curl -X POST \
> https://your-unleash-instance.com/api/admin/projects/default/features/new-feature/environments/production/on \
> -H "Authorization: YOUR_ADMIN_TOKEN"

Add a strategy to a flag

$curl -X POST \
> https://your-unleash-instance.com/api/admin/projects/default/features/new-feature/environments/production/strategies \
> -H "Authorization: YOUR_ADMIN_TOKEN" \
> -H "Content-Type: application/json" \
> -d '{
> "name": "flexibleRollout",
> "parameters": {
> "rollout": "50",
> "stickiness": "default",
> "groupId": "new-feature"
> }
> }'