# Authorization

### Create an access

In your Feature Experimentation account, go to [**Settings > Feature Experimentation > Remote Control API**](https://app2.abtasty.com/settings/feature-experimentation/remote-control-api)

<figure><img src="/files/zCwSW4EvqB4QXZYLgq2e" alt=""><figcaption></figcaption></figure>

You will need to fill :

* An access name
* Select one or several environments (or let empty to select all your environments)
* Select one or several actions to authorize

When you're done, click on Generate and you will see the following modal :

<figure><img src="/files/3ZZv6t8pJzM2VGHzSg91" alt=""><figcaption></figcaption></figure>

{% hint style="danger" %}
Save your Client id and Client secret now as they will be needed to generate a token.\
For security reasons, they cannot be retrieved again after you close this dialog.
{% endhint %}

### Generate a token

After generating your access credentials, you need to generate a token to authenticate your API calls.&#x20;

To generate a token you will need to do the following request. Or you can use the online generator [here](https://github.com/flagship-io/Gitbook/blob/main/remote-control-api/broken-reference/README.md):

You will find your **ACCOUNT\_ID** in Settings > Account section.

```curl
curl --location --request POST 'https://auth.flagship.io/{ACCOUNT_ID}/token?expires_in=0' \
--header 'Content-Type: application/json' \
--data-raw '{
    "grant_type": "client_credentials",
    "scope": "*",
    "client_id": "{CLIENT_ID}",
    "client_secret": "{CLIENT_SECRET}"
}'
```

**Expiration time :**

You can define the token expiration time. For example, to create a token with an expiration time of 1800 seconds, call :\
`POST https://auth.flagship.io/{ACCOUNT_ID}/token?expires_in=1800`

You now have a valid token with the list of actions you selected previously.

You can verify that your token is valid by making the following request :

```curl
curl --location --request GET 'https://auth.flagship.io/token?access_token={ACCESS_TOKEN}' \
--data-raw ''
```

### Revoke an access

You can preview or revoke your created access in the panel located below the access creation panel.

<figure><img src="/files/uzVt1W6tLKwEeLg721m5" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.abtasty.com/server-side/remote-control-api/authorization.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
