docs-v2/content/influxdb3/cloud-serverless/admin/tokens/delete-token.md

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.
influxdb3_cloud_serverless
name parent
Delete a token Manage tokens
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

  1. In the navigation menu on the left, select Load Data > API Tokens.

    {{< nav-icon "data" >}}

  2. Find the token that you would like to delete.

  3. Click the {{< icon "delete" >}} icon located far right of the token description.

  4. 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 of influx 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 the write: authorizations permission)
    • Content-type: application/json
  • 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 >}}