Authorizations (API tokens)
/api/v2/authorizationsList authorizations
Lists authorizations.
To limit which authorizations are returned, pass query parameters in your request. If no query parameters are passed, InfluxDB returns all authorizations.
InfluxDB 3 Cloud Serverless doesn’t expose API token
values in GET /api/v2/authorizations responses;
returns token: redacted for all authorizations.
Required permissions
To retrieve an authorization, the request must use an API token that has the following permissions:
read-authorizationsread-userfor the user that the authorization is scoped to
Related guides
Parameters
Query parameters
userID
stringuser
stringorgID
stringorg
stringtoken
stringAn API token value.
Specifies an authorization by its token property value
and returns the authorization.
Limitations
- The parameter is non-repeatable. If you specify more than one, only the first one is used. If a resource with the specified property value doesn’t exist, then the response body contains an empty list.
Header parameters
Zap-Trace-Span
stringcurl --request GET \
"https://us-east-1-1.aws.cloud2.influxdata.com/api/v2/authorizations" \
--header "Authorization: Bearer INFLUX_TOKEN"Responses
Success. The response body contains a list of authorizations.
If the response body is missing authorizations that you expect, check that the API
token used in the request has read-user permission for the users (userID property value)
in those authorizations.
authorizations
object[]links
stringcode
required
stringinternal 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 typeerr
stringmessage
stringop
stringUnauthorized. The error may indicate one of the following:
- The
Authorization: Tokenheader is missing or malformed. - The API token value is missing from the header.
- The token doesn’t have sufficient permissions to write to this organization and bucket.
code
stringunauthorized.unauthorizedmessage
stringcode
required
stringinternal 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 typeerr
stringmessage
stringop
stringcode
required
stringinternal 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 typeerr
stringmessage
stringop
string/api/v2/authorizationsCreate an authorization
Creates an authorization and returns the authorization with the generated API token.
Use this endpoint to create an authorization, which generates an API token
with permissions to read or write to a specific resource or type of resource.
The API token is the authorization’s token property value.
To follow best practices for secure API token generation and retrieval, InfluxDB enforces access restrictions on API tokens.
- InfluxDB allows access to the API token value immediately after the authorization is created.
- You can’t change access (read/write) permissions for an API token after it’s created.
- Tokens stop working when the user who created the token is deleted.
We recommend the following for managing your tokens:
- Create a generic user to create and manage tokens for writing data.
- Store your tokens in a secure password vault for future access.
Required permissions
write-authorizationswrite-userfor the user that the authorization is scoped to
Related guides
Parameters
Header parameters
Zap-Trace-Span
stringRequest body required
application/jsoncurl --request POST \
"https://us-east-1-1.aws.cloud2.influxdata.com/api/v2/authorizations" \
--header "Authorization: Bearer INFLUX_TOKEN" \
--header "Content-Type: application/json"Responses
code
required
stringinternal 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 typeerr
stringmessage
stringop
stringUnauthorized. The error may indicate one of the following:
- The
Authorization: Tokenheader is missing or malformed. - The API token value is missing from the header.
- The token doesn’t have sufficient permissions to write to this organization and bucket.
code
stringunauthorized.unauthorizedmessage
stringcode
required
stringinternal 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 typeerr
stringmessage
stringop
stringcode
required
stringinternal 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 typeerr
stringmessage
stringop
string/api/v2/authorizations/{authID}Retrieve an authorization
Retrieves an authorization.
Use this endpoint to retrieve information about an API token, including the token’s permissions and the user that the token is scoped to.
Related guides
Parameters
Path parameters
authID
required
stringHeader parameters
Zap-Trace-Span
stringcurl --request GET \
"https://us-east-1-1.aws.cloud2.influxdata.com/api/v2/authorizations/{authID}" \
--header "Authorization: Bearer INFLUX_TOKEN"Responses
code
required
stringinternal 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 typeerr
stringmessage
stringop
stringUnauthorized. The error may indicate one of the following:
- The
Authorization: Tokenheader is missing or malformed. - The API token value is missing from the header.
- The token doesn’t have sufficient permissions to write to this organization and bucket.
code
stringunauthorized.unauthorizedmessage
stringcode
required
stringinternal 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 typeerr
stringmessage
stringop
stringcode
required
stringinternal 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 typeerr
stringmessage
stringop
stringcode
required
stringinternal 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 typeerr
stringmessage
stringop
string/api/v2/authorizations/{authID}Update an API token to be active or inactive
Updates an authorization.
Use this endpoint to set an API token’s status to be active or inactive. InfluxDB rejects requests that use inactive API tokens.
Parameters
Path parameters
authID
required
stringHeader parameters
Zap-Trace-Span
stringRequest body required
application/jsondescription
stringstatus
stringinactive, InfluxDB rejects requests that use the token.active
, inactiveactivecurl --request PATCH \
"https://us-east-1-1.aws.cloud2.influxdata.com/api/v2/authorizations/{authID}" \
--header "Authorization: Bearer INFLUX_TOKEN" \
--header "Content-Type: application/json" \
--data-raw '{
"description": "DESCRIPTION",
"status": "active"
}'Responses
code
required
stringinternal 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 typeerr
stringmessage
stringop
string/api/v2/authorizations/{authID}Delete an authorization
Deletes an authorization.
Use the endpoint to delete an API token.
If you want to disable an API token instead of delete it,
update the authorization’s status to inactive.
Parameters
Path parameters
authID
required
stringHeader parameters
Zap-Trace-Span
stringcurl --request DELETE \
"https://us-east-1-1.aws.cloud2.influxdata.com/api/v2/authorizations/{authID}" \
--header "Authorization: Bearer INFLUX_TOKEN"Responses
code
required
stringinternal 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 typeerr
stringmessage
stringop
stringUnauthorized. The error may indicate one of the following:
- The
Authorization: Tokenheader is missing or malformed. - The API token value is missing from the header.
- The token doesn’t have sufficient permissions to write to this organization and bucket.
code
stringunauthorized.unauthorizedmessage
stringcode
required
stringinternal 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 typeerr
stringmessage
stringop
stringcode
required
stringinternal 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 typeerr
stringmessage
stringop
stringcode
required
stringinternal 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 typeerr
stringmessage
stringop
stringWas this page helpful?
Thank you for your feedback!
Support and feedback
Thank you for being part of our community! We welcome and encourage your feedback and bug reports for InfluxDB Cloud Serverless and this documentation. To find support, use the following resources:
Customers with an annual or support contract can contact InfluxData Support.