3.2 KiB
title | seotitle | description | menu | weight | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Delete a token | Delete an API token from InfluxDB | Delete an API token from InfluxDB using the InfluxDB UI or the `influx` CLI. |
|
204 |
Delete API tokens using the InfluxDB user interface (UI), influx
command line
interface (CLI), or InfluxDB API.
Once deleted, all users and external integrations using the API token will no longer
have access to your InfluxDB instance.
{{< tabs-wrapper >}} {{% tabs %}} InfluxDB UI influx CLI InfluxDB API {{% /tabs %}}
{{% tab-content %}}
Delete tokens in the InfluxDB UI
-
In the navigation menu on the left, select Load Data > API Tokens.
{{< nav-icon "data" >}}
-
Find the token that you would like to delete.
-
Click the {{< icon "delete" >}} icon located far right of the token description.
-
Click {{< caps >}}Confirm{{< /caps >}} to delete the token.
{{% /tab-content %}}
{{% tab-content %}}
Delete a token using the influx CLI
Use the influx auth delete
command
to delete a token.
Provide the following flags:
--token
: API token with permission to delete authorizations--id
: Authorization ID to delete (available in the output ofinflux auth find
)
{{% code-placeholders "(API|AUTHORIZATION)_(TOKEN|ID)" %}}
influx auth delete \
--token API_TOKEN \
--id AUTHORIZATION_ID
{{% /code-placeholders %}}
{{% /tab-content %}}
{{% tab-content %}}
Delete a token using the InfluxDB API
Use the /api/v2/authorizations
InfluxDB API endpoint to delete a token.
{{< api-endpoint method="DELETE" endpoint="https://{{< influxdb/host >}}/api/v2/authorizations/{AUTH_ID}" api-ref="/influxdb/v2/api/#operation/DeleteAuthorizationsID" >}}
Include the following in your request:
- Headers:
- Authorization:
Token API_TOKEN
(API token with thewrite: authorizations
permission) - Content-type:
application/json
- Authorization:
- Path parameters:
- authID: Authorization ID to delete
{{% code-placeholders "API_TOKEN" %}}
# Delete the first authorization listed for the user.
curl --request GET \
https://{{< influxdb/host >}}/api/v2/authorizations?user=user2 \
--header "Authorization: Token API_TOKEN" \
--header 'Content-type: application/json' \
| jq .authorizations[0].id \
| xargs -I authid curl --request DELETE \
https://{{< influxdb/host >}}/api/v2/authorizations/authid \
--header "Authorization: Token API_TOKEN" \
--header 'Content-type: application/json'
{{% /code-placeholders %}}
{{% /tab-content %}}
{{< /tabs-wrapper >}}