Using the REST API
This topic describes how to get started using the Optimizely v2 REST API.
Note
This page describes an API to control flags in the Optimizely Feature Experimentation app.
If you are looking for a REST API that delivers the same functionality as the Optimizely Feature Experimentation SDKs, see instead Optimizely Agent.
The Optimizely Feature Experimentation REST API allows you to interface with Optimizely programmatically to build customized integrations and workflows. For example, you can create feature flags from an automated script, build custom dashboards of feature test results, or connect your experiments to other project management tools.
To explore the REST API, we recommend an API client called Postman.
Using Postman, you can import an API collection with example requests for each Feature Experimentation API method.
See below for instructions on setting up Postman to explore the API.

To integrate the API into your application, you will need to generate an API token and use it to call the API directly from your code. For an overview of using the REST API, see the Integrate the REST API section below.
Explore with Postman
To explore the Optimizely Feature Experimentation REST API collection:
- Install Postman if you have not already installed it on your machine or visit their web application.
- Click the Import button.
- Choose Link.
- Enter the URL
<https://api.optimizely.com/collections/fullstack_flag_first.json
>. - Select Continue.
- Click Collections in the left pane, then click a folder to see the available methods.

By default, this collection links to a sample read-only project. To use your own account:
- Hover over Optimizely Full Stack API Flag-First in the left pane and select the View more actions button.
- Click Edit to launch the Edit Collection window, then click the Variables tab.
- Change the host variable to
base_url
. Update Initial Value and Current Value to<https://api.optimizely.com/flags/v1
>. - Replace the default project ID and API token with your own settings.
- Add other variables as needed for various endpoints, for example, {{flag_key}}, {{audience_id}}, {{variation_id}}, etc. You can get the values for these variables by using GET endpoints (for example, for a {{flag_key}}, use the List Flags endpoint).
- Click Save.
See the Integrate the REST API section below for more information on generating an API token.

Integrate the REST API
Note
Because our REST API is used for both Optimizely Web Experimentation and Optimizely Feature Experimentation, some resources may not be applicable for your use cases.
For production use cases, you will want to integrate these API calls directly into your own application. See Getting Started with the REST API to generate an API token and make your first API call.
We recommend authenticating using OAuth 2.0. However, to make our API easily explorable, we have also implemented Personal Tokens. See API Conventions for more information on conventions like authentication and rate-limiting.
For a full guide to all our REST API endpoints, see the Optimizely v2 REST API reference.
Updated about 1 month ago