diff --git a/website/docs/how-to/how-to-create-personal-access-tokens.mdx b/website/docs/how-to/how-to-create-personal-access-tokens.mdx index 3422dd1a60..9b7feddd7f 100644 --- a/website/docs/how-to/how-to-create-personal-access-tokens.mdx +++ b/website/docs/how-to/how-to-create-personal-access-tokens.mdx @@ -8,7 +8,7 @@ title: How to create Personal Access Tokens ::: -Personal access tokens are a tool to enable a user to use the Admin API as themselves with their own set of permissions, rather than using an admin token. See [_how to use the Admin API_](how-to-use-the-admin-api.md) for more information. +Personal access tokens are a tool to enable a user to use the Admin API as themselves with their own set of permissions. See [_how to use the Admin API_](how-to-use-the-admin-api.md) for more information. ## Step 1: Navigate to the personal access tokens page {#step-1} @@ -38,4 +38,3 @@ Once your new token is created, the popup will display the new token details. Yo ![The token created popup with the "Copy Token" element highlighted. ](/img/create-pat-5.png) -Your personal access token can now be used in place of an [admin token](../reference/api-tokens-and-client-keys#admin-tokens). diff --git a/website/docs/how-to/how-to-use-the-admin-api.md b/website/docs/how-to/how-to-use-the-admin-api.md index 65eecc7ce2..d20e959dfc 100644 --- a/website/docs/how-to/how-to-use-the-admin-api.md +++ b/website/docs/how-to/how-to-use-the-admin-api.md @@ -2,36 +2,34 @@ title: How to use the Admin API --- -This guide explains the steps required to getting access to and using the Admin API. +This guide explains the steps required to using the Admin API. -## Step 1: Create API token {#step-1-create-api-token} +## Create API token -You'll need either an [admin token](../reference/api-tokens-and-client-keys.mdx#admin-tokens) or a [personal access token](../reference/api-tokens-and-client-keys.mdx#personal-access-tokens) for this to work. To create one, follow the steps in the [_how to create API tokens_](../how-to/how-to-create-api-tokens.mdx) guide or the [_how to create personal access tokens_](./how-to-create-personal-access-tokens.mdx) guide, respectively. +First you'll need to create a [personal access token](../reference/api-tokens-and-client-keys.mdx#personal-access-tokens). To create one, follow the steps in the [_how to create personal access tokens_](./how-to-create-personal-access-tokens.mdx) guide. Please note that it may take up to 60 seconds for the new key to propagate to all Unleash instances due to eager caching. :::note -If you need an API token to use in a client SDK you should create a "client token" as these have fewer access rights. +If you need an API token to use in a client SDK you should create a client token instead, as these have fewer access rights. ::: -## Step 2: Use Admin API {#step-2-use-admin-api} +## Use Admin API -Now that you have an access token with admin privileges we can use that to perform changes in our Unleash instance. +Now that you have an access token with admin privileges, you can use it to make changes in your Unleash instance. -In the example below we will use the [Unleash Admin API](/reference/api/legacy/unleash/admin/features.md) to enable the “Demo” feature flag using curl. +In the example below we will use the [Unleash Admin API](/reference/api/legacy/unleash/admin/features.md) to enable the `Demo` feature flag using curl. ```sh curl -X POST -H "Content-Type: application/json" \ - -H "Authorization: some-token" \ + -H "Authorization: " \ https://app.unleash-hosted.com/demo/api/admin/features/Demo/toggle/on ``` -**Great success!** We have now enabled the feature flag. We can also verify that it was actually changed by the API user by navigating to [Event Log](/reference/events#event-log) and filtering events for this feature flag. +We have now enabled the feature flag. We can also verify that it was actually changed by the API user by navigating to [Event Log](/reference/events#event-log) and filtering events for this feature flag. ![Feature flag events showing that it was last updated by "admin-api".](/img/api_access_history.png) -## API overview {#api-overview} - You can find the full documentation on everything the Unleash API supports in the [Unleash API documentation](/reference/api/legacy/unleash/admin/features.md). diff --git a/website/docs/reference/api-tokens-and-client-keys.mdx b/website/docs/reference/api-tokens-and-client-keys.mdx index bc0e97c10d..99eabe6bc3 100644 --- a/website/docs/reference/api-tokens-and-client-keys.mdx +++ b/website/docs/reference/api-tokens-and-client-keys.mdx @@ -3,11 +3,11 @@ title: API Tokens and Client Keys pagination_next: reference/front-end-api --- -For Unleash to be of any use, it requires at least a server and a [consuming client](../reference/sdks). More advanced use cases may call for multiple clients, automated feature flag updates, the [Unleash proxy](../reference/unleash-proxy) and [Unleash proxy clients](../reference/sdks#front-end-sdks), and more. To facilitate communication between all these moving parts, Unleash uses a system of API tokens and client keys, all with a specific purpose in mind. +For Unleash to be of any use, it requires at least a server and a [consuming client](../reference/sdks). More advanced use cases may call for multiple clients, automated feature flag updates, the [Unleash proxy](../reference/unleash-proxy) and [Unleash proxy clients](../reference/sdks#front-end-sdks), and more. To facilitate communication between all these moving parts, + +Unleash uses a system of API tokens and client keys, to facilitate communication between consuming clients such as [SDKs](../reference/sdks) or Edge. This document details the three kinds of tokens and keys that you will need to fully connect any Unleash system: - -- [Admin tokens](#admin-tokens) for updating resources in Unleash (**Deprecated**) We recommend you use [Personal Access Tokens](#personal-access-tokens) instead. - [Client tokens](#client-tokens) for connecting server-side client SDKs and the Unleash proxy to the Unleash server - [Proxy client keys](#proxy-client-keys) for connecting proxy client SDKs to the Unleash proxy. @@ -19,9 +19,8 @@ This section describes what API tokens are. For information on how to create the ::: -Use API tokens to connect to the Unleash server API. API tokens come in four distinct types: +Use API tokens to connect to the Unleash server API. API tokens come in th distinct types: -- [Admin tokens](#admin-tokens) (**Deprecated**) - [Personal access tokens](#personal-access-tokens) - [Client tokens](#client-tokens) - [Front-end tokens](#front-end-tokens)