---
title: Legacy Authorizations
description: API reference for Legacy Authorizations
url: https://docs.influxdata.com/influxdb/v2/api/legacy-authorizations/
estimated_tokens: 3220
product: InfluxDB OSS v2
version: v2
publisher: InfluxData
canonical: https://docs.influxdata.com/influxdb/v2/api/legacy-authorizations/
---

[Download InfluxDB API Spec](/openapi/influxdb-oss-v2-api.yml)

GET`/legacy/authorizations`

### List all legacy authorizations

#### Parameters

##### Query parameters

`userID`string

A user ID.
Only returns legacy authorizations scoped to the specified [user](/influxdb/v2/reference/glossary/#user).

`user`string

A user name.
Only returns legacy authorizations scoped to the specified [user](/influxdb/v2/reference/glossary/#user).

`orgID`string

An organization ID.
Only returns legacy authorizations that belong to the specified [organization](/influxdb/v2/reference/glossary/#organization).

`org`string

An organization name.
Only returns legacy authorizations that belong to the specified [organization](/influxdb/v2/reference/glossary/#organization).

`token`string

An authorization name token.
Only returns legacy authorizations with the specified name.

`authID`string

An authorization ID.
Returns the specified legacy authorization.

##### Header parameters

`Zap-Trace-Span`string

OpenTracing span context

Example request[Ask AI about this](#)

```sh
curl --request GET \
  "http://localhost:8086/legacy/authorizations" \
  --header "Authorization: Bearer INFLUX_TOKEN"
```

#### Responses

200Success. The response body contains a list of legacy `authorizations`.

`authorizations`object[]

`createdAt`string \<date-time\>

`description`string

A description of the token.

`id`string

The authorization ID.

`links`object

Example:`{"self":"/api/v2/authorizations/1","user":"/api/v2/users/12"}`

`self`string \<uri\>

URI of resource.

`user`string \<uri\>

URI of resource.

`org`string

The organization name.
Specifies the [organization](/influxdb/v2/reference/glossary/#organization)that the token is scoped to.

`orgID`requiredstring

The organization ID.
Specifies the [organization](/influxdb/v2/reference/glossary/#organization) that the authorization is scoped to.

`permissions`requiredobject[]

The list of permissions.
An authorization must have at least one permission.

`action`requiredstring

Allowed:`read`, `write`

`resource`requiredobject

`status`string

Status of the token. If `inactive`, InfluxDB rejects requests that use the token.

Allowed:`active`, `inactive`

Default:`active`

`token`string

The API token.
The token value is unique to the authorization.[API tokens](/influxdb/v2/reference/glossary/#token) are
used to authenticate and authorize InfluxDB API requests and `influx`CLI commands–after receiving the request, InfluxDB checks that the
token is valid and that the `permissions` allow the requested action(s).

`updatedAt`string \<date-time\>

`user`string

The user name.
Specifies the [user](/influxdb/v2/reference/glossary/#user) that owns the authorization.
If the authorization is *scoped* to a user, the user;
otherwise, the creator of the authorization.

`userID`string

The user ID. Specifies the [user](/influxdb/v2/reference/glossary/#user) that owns the authorization. If *scoped*, the user that the authorization is scoped to; otherwise, the creator of the authorization.

`links`object

URI pointers for additional paged results.

`next`string \<uri\>

URI of resource.

`prev`string \<uri\>

URI of resource.

`self`requiredstring \<uri\>

URI of resource.

defaultNon 2XX error response from server.

`code`requiredstring

code is the machine-readable error code.

Allowed:`internal error`, `not implemented`, `not found`, `conflict`, `invalid`, `unprocessable entity`, `empty value`, `unavailable`, `forbidden`, `too many requests`, `unauthorized`, `method not allowed`, `request too large`, `unsupported media type`

`err`string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message`string

Human-readable message.

`op`string

Describes the logical code operation when the error occurred. Useful for debugging.

POST`/legacy/authorizations`

### Create a legacy authorization

Creates a legacy authorization and returns the legacy authorization.

#### Required permissions

* `write-users USER_ID` if you pass the `userID` property in the request body.

*`USER_ID`* is the ID of the user that you want to scope the authorization to.

#### Parameters

##### Header parameters

`Zap-Trace-Span`string

OpenTracing span context

#### Request bodyrequired

The legacy authorization to create.

Content-Type:`application/json`

`description`string

A description of the token.

`orgID`requiredstring

The organization ID. Identifies the organization that the authorization is scoped to.

`permissions`requiredobject[]

The list of permissions that provide `read` and `write` access to organization resources.
An authorization must contain at least one permission.

`action`requiredstring

Allowed:`read`, `write`

`resource`requiredobject

`id`string

A resource ID.
Identifies a specific resource.

`name`string

The name of the resource.*Note: not all resource types have a `name` property*.

`org`string

An organization name.
The organization that owns the resource.

`orgID`string

An organization ID.
Identifies the organization that owns the resource.

`type`requiredstring

A resource type.
Identifies the API resource’s type (or *kind*).

Allowed:`authorizations`, `buckets`, `dashboards`, `orgs`, `tasks`, `telegrafs`, `users`, `variables`, `secrets`, `labels`, `views`, `documents`, `notificationRules`, `notificationEndpoints`, `checks`, `dbrp`, `annotations`, `sources`, `scrapers`, `notebooks`, `remotes`, `replications`, `instance`, `flows`, `functions`, `subscriptions`

`status`string

Status of the token. If `inactive`, InfluxDB rejects requests that use the token.

Allowed:`active`, `inactive`

Default:`active`

`token`string

The name that you provide for the authorization.

`userID`string

The user ID. Identifies the user that the authorization is scoped to.

Example request[Ask AI about this](#)

```sh
curl --request POST \
  "http://localhost:8086/legacy/authorizations" \
  --header "Authorization: Bearer INFLUX_TOKEN" \
  --header "Content-Type: application/json" \
  --data-raw '{
  "description": "DESCRIPTION",
  "orgID": "ORGID",
  "permissions": [
    {
      "action": "read",
      "resource": {}
    }
  ],
  "status": "active",
  "token": "TOKEN",
  "userID": "USERID"
}'
```

#### Responses

201Created. The legacy authorization is created.
The response body contains the newly created legacy authorization.

400Non 2XX error response from server.

`code`requiredstring

code is the machine-readable error code.

Allowed:`internal error`, `not implemented`, `not found`, `conflict`, `invalid`, `unprocessable entity`, `empty value`, `unavailable`, `forbidden`, `too many requests`, `unauthorized`, `method not allowed`, `request too large`, `unsupported media type`

`err`string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message`string

Human-readable message.

`op`string

Describes the logical code operation when the error occurred. Useful for debugging.

401Unauthorized.
The API token passed doesn’t have the permissions necessary for the
request.

`code`string

The HTTP status code description. Default is `unauthorized`.

Allowed:`unauthorized`

`message`string

A human-readable message that may contain detail about the error.

defaultNon 2XX error response from server.

`code`requiredstring

code is the machine-readable error code.

Allowed:`internal error`, `not implemented`, `not found`, `conflict`, `invalid`, `unprocessable entity`, `empty value`, `unavailable`, `forbidden`, `too many requests`, `unauthorized`, `method not allowed`, `request too large`, `unsupported media type`

`err`string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message`string

Human-readable message.

`op`string

Describes the logical code operation when the error occurred. Useful for debugging.

GET`/legacy/authorizations/{authID}`

### Retrieve a legacy authorization

#### Parameters

##### Path parameters

`authID`requiredstring

The ID of the legacy authorization to get.

##### Header parameters

`Zap-Trace-Span`string

OpenTracing span context

Example request[Ask AI about this](#)

```sh
curl --request GET \
  "http://localhost:8086/legacy/authorizations/{authID}" \
  --header "Authorization: Bearer INFLUX_TOKEN"
```

#### Responses

200Legacy authorization details

defaultNon 2XX error response from server.

`code`requiredstring

code is the machine-readable error code.

Allowed:`internal error`, `not implemented`, `not found`, `conflict`, `invalid`, `unprocessable entity`, `empty value`, `unavailable`, `forbidden`, `too many requests`, `unauthorized`, `method not allowed`, `request too large`, `unsupported media type`

`err`string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message`string

Human-readable message.

`op`string

Describes the logical code operation when the error occurred. Useful for debugging.

PATCH`/legacy/authorizations/{authID}`

### Update a legacy authorization to be active or inactive

#### Parameters

##### Path parameters

`authID`requiredstring

The ID of the legacy authorization to update.

##### Header parameters

`Zap-Trace-Span`string

OpenTracing span context

#### Request bodyrequired

Legacy authorization to update

Content-Type:`application/json`

`description`string

A description of the token.

`status`string

Status of the token. If `inactive`, InfluxDB rejects requests that use the token.

Allowed:`active`, `inactive`

Default:`active`

Example request[Ask AI about this](#)

```sh
curl --request PATCH \
  "http://localhost:8086/legacy/authorizations/{authID}" \
  --header "Authorization: Bearer INFLUX_TOKEN" \
  --header "Content-Type: application/json" \
  --data-raw '{
  "description": "DESCRIPTION",
  "status": "active"
}'
```

#### Responses

200The active or inactive legacy authorization

defaultNon 2XX error response from server.

`code`requiredstring

code is the machine-readable error code.

Allowed:`internal error`, `not implemented`, `not found`, `conflict`, `invalid`, `unprocessable entity`, `empty value`, `unavailable`, `forbidden`, `too many requests`, `unauthorized`, `method not allowed`, `request too large`, `unsupported media type`

`err`string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message`string

Human-readable message.

`op`string

Describes the logical code operation when the error occurred. Useful for debugging.

DELETE`/legacy/authorizations/{authID}`

### Delete a legacy authorization

#### Parameters

##### Path parameters

`authID`requiredstring

The ID of the legacy authorization to delete.

##### Header parameters

`Zap-Trace-Span`string

OpenTracing span context

Example request[Ask AI about this](#)

```sh
curl --request DELETE \
  "http://localhost:8086/legacy/authorizations/{authID}" \
  --header "Authorization: Bearer INFLUX_TOKEN"
```

#### Responses

204Legacy authorization deleted

defaultNon 2XX error response from server.

`code`requiredstring

code is the machine-readable error code.

Allowed:`internal error`, `not implemented`, `not found`, `conflict`, `invalid`, `unprocessable entity`, `empty value`, `unavailable`, `forbidden`, `too many requests`, `unauthorized`, `method not allowed`, `request too large`, `unsupported media type`

`err`string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message`string

Human-readable message.

`op`string

Describes the logical code operation when the error occurred. Useful for debugging.

POST`/legacy/authorizations/{authID}/password`

### Set a legacy authorization password

#### Parameters

##### Path parameters

`authID`requiredstring

The ID of the legacy authorization to update.

##### Header parameters

`Zap-Trace-Span`string

OpenTracing span context

#### Request bodyrequired

New password

Content-Type:`application/json`

`password`requiredstring

Example request[Ask AI about this](#)

```sh
curl --request POST \
  "http://localhost:8086/legacy/authorizations/{authID}/password" \
  --header "Authorization: Bearer INFLUX_TOKEN" \
  --header "Content-Type: application/json" \
  --data-raw '{
  "password": "PASSWORD"
}'
```

#### Responses

204Legacy authorization password set

defaultNon 2XX error response from server.

`code`requiredstring

code is the machine-readable error code.

Allowed:`internal error`, `not implemented`, `not found`, `conflict`, `invalid`, `unprocessable entity`, `empty value`, `unavailable`, `forbidden`, `too many requests`, `unauthorized`, `method not allowed`, `request too large`, `unsupported media type`

`err`string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message`string

Human-readable message.

`op`string

Describes the logical code operation when the error occurred. Useful for debugging.
