openapi: 3.0.0 info: title: InfluxDB 3 Cloud Serverless API Service description: | The InfluxDB v2 HTTP API for InfluxDB 3 Cloud Serverless provides a programmatic interface for writing data stored in an InfluxDB 3 Cloud Serverless bucket. The InfluxDB v2 HTTP API lets you use `/api/v2` endpoints for managing retention policy mappings and writing data stored in an InfluxDB 3 instance. This documentation is generated from the [InfluxDB OpenAPI specification](https://raw.githubusercontent.com/influxdata/openapi/master/contracts/ref/cloud.yml). license: name: MIT url: https://opensource.org/licenses/MIT version: '' contact: name: InfluxData url: https://www.influxdata.com email: support@influxdata.com x-influxdata-short-title: v2 API x-influxdata-short-description: The InfluxDB v2 HTTP API for InfluxDB 3 Cloud Serverless provides a programmatic interface for writing data stored in an InfluxDB 3 Cloud Serverless bucket. servers: - url: https://{baseurl} description: InfluxDB 3 Cloud Serverless API URL variables: baseurl: enum: - us-east-1-1.aws.cloud2.influxdata.com default: us-east-1-1.aws.cloud2.influxdata.com description: InfluxDB 3 Cloud Serverless URL security: - TokenAuthentication: [] tags: - description: Overview of the InfluxDB v1 and v2 compatible write and query endpoints available in InfluxDB 3 Cloud Serverless. name: API compatibility x-traitTag: true - description: |- Use one of the following schemes to authenticate to the InfluxDB 3 Cloud Serverless API: - Token authentication - Basic authentication name: Authentication x-traitTag: true - description: Create and manage API token authorizations that grant read and write permissions to InfluxDB 3 Cloud Serverless organization resources. name: Authorizations (API tokens) x-related: - title: Manage API tokens href: /influxdb3/cloud-serverless/security/tokens/ - name: Bucket Schemas description: Manage explicit schemas for InfluxDB 3 Cloud Serverless buckets to enforce column names and data types. - description: Create and manage named storage locations (buckets) in InfluxDB 3 Cloud Serverless, each with a configurable retention period. name: Buckets x-related: - title: Manage buckets href: /influxdb3/cloud-serverless/admin/buckets/ - name: Cells description: Manage cells within InfluxDB 3 Cloud Serverless dashboards. - name: Checks description: Create and manage monitoring checks that query data and generate notification statuses in InfluxDB 3 Cloud Serverless. - description: Common query parameters used by InfluxDB 3 Cloud Serverless API endpoints, including `bucket`, `bucketID`, `org`, and `orgID`. name: Common parameters x-traitTag: true - name: Config description: Retrieve configuration information for an InfluxDB 3 Cloud Serverless instance. - name: Dashboards description: Create and manage dashboards in InfluxDB 3 Cloud Serverless. - description: Manage database and retention policy (DBRP) mappings that route InfluxDB v1-compatible requests to InfluxDB 3 Cloud Serverless buckets. name: DBRPs x-related: - title: Database and retention policy mapping href: /influxdb3/cloud-serverless/reference/api/influxdb-1x/dbrp/ - description: Delete time series data from an InfluxDB 3 Cloud Serverless bucket by specifying a time range and optional predicate. name: Delete - description: Standard HTTP request headers used by InfluxDB 3 Cloud Serverless API endpoints, including `Accept`, `Authorization`, `Content-Length`, and `Content-Type`. name: Headers x-traitTag: true - description: Store, manage, and execute custom Flux scripts in InfluxDB 3 Cloud Serverless. Scripts accept runtime parameters and can be invoked via dedicated endpoints. name: Invokable Scripts - name: Labels description: Create and manage labels for organizing InfluxDB 3 Cloud Serverless resources. - name: Legacy Authorizations description: Manage legacy (v1-compatible) authorization credentials in InfluxDB 3 Cloud Serverless. - name: Limits description: Retrieve rate limits and usage quotas for an InfluxDB 3 Cloud Serverless organization. - name: NotificationEndpoints description: Create and manage notification endpoints that receive alert notifications from InfluxDB 3 Cloud Serverless monitoring checks. - name: NotificationRules description: Create and manage notification rules that define when and how InfluxDB 3 Cloud Serverless sends notifications to endpoints. - description: View and manage InfluxDB 3 Cloud Serverless organizations, which are workspaces that group users, buckets, and resources. name: Organizations x-related: - title: View and manage organizations href: /influxdb3/cloud-serverless/admin/ - description: Query parameters for paginating results from list operations in the InfluxDB 3 Cloud Serverless API. name: Pagination x-traitTag: true - name: Ping description: Check the availability of the InfluxDB 3 Cloud Serverless instance. - description: Query data stored in InfluxDB 3 Cloud Serverless using InfluxQL via the v1-compatible `/query` endpoint, or using SQL and InfluxQL via Flight+gRPC clients. name: Query data x-related: - title: Get started querying InfluxDB href: /influxdb3/cloud-serverless/get-started/query/ - title: Execute queries href: /influxdb3/cloud-serverless/query-data/execute-queries/ - description: Get started writing and querying data with the InfluxDB 3 Cloud Serverless API. name: Quick start x-traitTag: true - name: Resources description: Retrieve a list of top-level resource types available in the InfluxDB 3 Cloud Serverless API. - description: Standard HTTP status codes returned by InfluxDB 3 Cloud Serverless API endpoints and their meanings. name: Response codes x-traitTag: true - name: Routes description: Retrieve top-level routes for the InfluxDB 3 Cloud Serverless API. - name: Rules description: Manage notification rules in InfluxDB 3 Cloud Serverless. - name: Secrets description: Create and manage secrets (key-value pairs) for use in InfluxDB 3 Cloud Serverless Flux scripts and tasks. - name: Security and access endpoints description: Endpoints for managing authentication and access control in InfluxDB 3 Cloud Serverless. - name: Setup description: Configure an initial InfluxDB 3 Cloud Serverless instance, including creating the initial user, organization, and bucket. - name: Signin description: Create a user session by signing in with username and password credentials. - name: Signout description: End a user session by signing out. - description: Overview of the common CRUD operations supported by the InfluxDB 3 Cloud Serverless API. name: Supported operations x-traitTag: true - name: System information endpoints description: Endpoints for retrieving system-level information about the InfluxDB 3 Cloud Serverless instance. - description: Schedule and manage Flux tasks that process and transform data on a recurring basis in InfluxDB 3 Cloud Serverless. name: Tasks - name: Telegraf Plugins description: Retrieve available Telegraf plugin configuration templates for use with InfluxDB 3 Cloud Serverless. - name: Telegrafs description: Create and manage Telegraf agent configurations that collect and write data to InfluxDB 3 Cloud Serverless. - description: Export and apply InfluxDB templates, and manage template stacks for InfluxDB 3 Cloud Serverless. name: Templates - name: Usage description: Retrieve usage metrics and cardinality data for an InfluxDB 3 Cloud Serverless organization. - description: View specific users that are members of your InfluxDB 3 Cloud Serverless organization. name: Users x-related: - title: Manage users href: /influxdb3/cloud-serverless/organizations/users/ - name: Variables description: Create and manage variables for use in InfluxDB 3 Cloud Serverless dashboards. - name: Views description: Manage cell views within InfluxDB 3 Cloud Serverless dashboards. - description: Write time series data to InfluxDB 3 Cloud Serverless buckets using the v2-compatible `/api/v2/write` endpoint or the v1-compatible `/write` endpoint with line protocol. name: Write data x-related: - title: Write data href: /influxdb3/cloud-serverless/write-data/ paths: /api/v2: get: description: | Retrieves all the top level routes for the InfluxDB API. The response includes routes for all InfluxDB v2 API resources, including resources that are not supported for InfluxDB Cloud Serverless (powered by the InfluxDB 3 storage engine). For supported endpoints, see API compatibility. #### Limitations - Only returns top level routes--for example, the response contains `"tasks":"/api/v2/tasks"`, and doesn't contain resource-specific routes for tasks (`/api/v2/tasks/TASK_ID/...`). operationId: GetRoutes parameters: - $ref: '#/components/parameters/TraceSpan' responses: '200': content: application/json: schema: $ref: '#/components/schemas/Routes' description: | Success. The response body contains key-value pairs with the resource name and top-level route. summary: List all top level routes tags: - Routes /api/v2/authorizations: get: description: | 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](/influxdb3/cloud-serverless/reference/glossary/#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-authorizations` - `read-user` for the user that the authorization is scoped to #### Related guides - [View tokens](/influxdb3/cloud-serverless/security/tokens/view-tokens/) operationId: GetAuthorizations parameters: - $ref: '#/components/parameters/TraceSpan' - description: | A user ID. Only returns authorizations scoped to the specified [user](/influxdb3/cloud-serverless/reference/glossary/#user). in: query name: userID schema: type: string - description: | A user name. Only returns authorizations scoped to the specified [user](/influxdb3/cloud-serverless/reference/glossary/#user). in: query name: user schema: type: string - description: An organization ID. Only returns authorizations that belong to the specified [organization](/influxdb3/cloud-serverless/reference/glossary/#organization). in: query name: orgID schema: type: string - description: | An organization name. Only returns authorizations that belong to the specified [organization](/influxdb3/cloud-serverless/reference/glossary/#organization). in: query name: org schema: type: string - description: | An API [token](/influxdb3/cloud-serverless/reference/glossary/#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. in: query name: token schema: type: string responses: '200': content: application/json: schema: $ref: '#/components/schemas/Authorizations' description: | 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. '400': $ref: '#/components/responses/GeneralServerError' description: Invalid request '401': $ref: '#/components/responses/AuthorizationError' '500': $ref: '#/components/responses/InternalServerError' default: $ref: '#/components/responses/GeneralServerError' description: Unexpected error summary: List authorizations tags: - Authorizations (API tokens) - Security and access endpoints post: description: | Creates an authorization and returns the authorization with the generated API [token](/influxdb3/cloud-serverless/reference/glossary/#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-authorizations` - `write-user` for the user that the authorization is scoped to #### Related guides - [Create a token](/influxdb3/cloud-serverless/security/tokens/create-token/) operationId: PostAuthorizations parameters: - $ref: '#/components/parameters/TraceSpan' requestBody: content: application/json: examples: AuthorizationPostRequest: $ref: '#/components/examples/AuthorizationPostRequest' AuthorizationWithResourcePostRequest: $ref: '#/components/examples/AuthorizationWithResourcePostRequest' AuthorizationWithUserPostRequest: $ref: '#/components/examples/AuthorizationWithUserPostRequest' schema: $ref: '#/components/schemas/AuthorizationPostRequest' description: The authorization to create. required: true responses: '201': content: application/json: schema: $ref: '#/components/schemas/Authorization' description: | Success. The authorization is created. The response body contains the authorization. '400': $ref: '#/components/responses/GeneralServerError' description: Invalid request '401': $ref: '#/components/responses/AuthorizationError' '500': $ref: '#/components/responses/InternalServerError' default: $ref: '#/components/responses/GeneralServerError' description: Unexpected error summary: Create an authorization tags: - Authorizations (API tokens) - Security and access endpoints /api/v2/authorizations/{authID}: delete: description: | 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`. operationId: DeleteAuthorizationsID parameters: - $ref: '#/components/parameters/TraceSpan' - description: An authorization ID. Specifies the authorization to delete. in: path name: authID required: true schema: type: string responses: '204': description: Success. The authorization is deleted. '400': content: application/json: examples: notFound: summary: | The specified resource ID is invalid. value: code: invalid message: id must have a length of 16 bytes schema: $ref: '#/components/schemas/Error' description: | Bad request. '401': $ref: '#/components/responses/AuthorizationError' '404': content: application/json: examples: notFound: summary: | The requested authorization doesn't exist. value: code: not found message: authorization not found schema: $ref: '#/components/schemas/Error' description: | Not found. '500': $ref: '#/components/responses/InternalServerError' default: $ref: '#/components/responses/GeneralServerError' description: Unexpected error summary: Delete an authorization tags: - Authorizations (API tokens) - Security and access endpoints get: description: | 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 - [View tokens](/influxdb3/cloud-serverless/security/tokens/view-tokens/) operationId: GetAuthorizationsID parameters: - $ref: '#/components/parameters/TraceSpan' - description: An authorization ID. Specifies the authorization to retrieve. in: path name: authID required: true schema: type: string responses: '200': content: application/json: schema: $ref: '#/components/schemas/Authorization' description: Success. The response body contains the authorization. '400': content: application/json: examples: notFound: summary: | The specified resource ID is invalid. value: code: invalid message: id must have a length of 16 bytes schema: $ref: '#/components/schemas/Error' description: | Bad request. '401': $ref: '#/components/responses/AuthorizationError' '404': content: application/json: examples: notFound: summary: | The requested authorization doesn't exist. value: code: not found message: authorization not found schema: $ref: '#/components/schemas/Error' description: | Not found. '500': $ref: '#/components/responses/InternalServerError' default: $ref: '#/components/responses/GeneralServerError' description: Unexpected error summary: Retrieve an authorization tags: - Authorizations (API tokens) - Security and access endpoints patch: description: | 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. operationId: PatchAuthorizationsID parameters: - $ref: '#/components/parameters/TraceSpan' - description: An authorization ID. Specifies the authorization to update. in: path name: authID required: true schema: type: string requestBody: content: application/json: schema: $ref: '#/components/schemas/AuthorizationUpdateRequest' description: In the request body, provide the authorization properties to update. required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/Authorization' description: Success. The response body contains the updated authorization. default: $ref: '#/components/responses/GeneralServerError' description: Unexpected error summary: Update an API token to be active or inactive tags: - Authorizations (API tokens) - Security and access endpoints /api/v2/buckets: get: description: | Lists [buckets](/influxdb3/cloud-serverless/reference/glossary/#bucket). InfluxDB retrieves buckets owned by the [organization](/influxdb3/cloud-serverless/reference/glossary/#organization) associated with the authorization ([API token](/influxdb3/cloud-serverless/reference/glossary/#token)). To limit which buckets are returned, pass query parameters in your request. If no query parameters are passed, InfluxDB returns all buckets up to the default `limit`. #### Required permissions | Action | Permission required | |:--------------------------|:--------------------| | Retrieve _user buckets_ | `read-buckets` | | Retrieve [_system buckets_](/influxdb3/cloud-serverless/reference/internals/system-buckets/) | `read-orgs` | #### Related Guides - [Manage buckets](/influxdb3/cloud-serverless/admin/buckets/) operationId: GetBuckets parameters: - $ref: '#/components/parameters/TraceSpan' - $ref: '#/components/parameters/Offset' - $ref: '#/components/parameters/Limit' - $ref: '#/components/parameters/After' - description: | An organization name. #### InfluxDB 3 Cloud Serverless - Doesn't use the `org` parameter or `orgID` parameter. - Lists buckets for the organization associated with the authorization (API token). in: query name: org schema: type: string - description: | An organization ID. #### InfluxDB 3 Cloud Serverless - Doesn't use the `org` parameter or `orgID` parameter. - Lists buckets for the organization associated with the authorization (API token). in: query name: orgID schema: type: string - description: | A bucket name. Only returns buckets with the specified name. in: query name: name schema: type: string - description: | A bucket ID. Only returns the bucket with the specified ID. in: query name: id schema: type: string responses: '200': content: application/json: examples: successResponse: value: buckets: - createdAt: '2022-03-15T17:22:33.72617939Z' description: System bucket for monitoring logs id: 77ca9dace40a9bfc labels: [] links: labels: /api/v2/buckets/77ca9dace40a9bfc/labels members: /api/v2/buckets/77ca9dace40a9bfc/members org: /api/v2/orgs/INFLUX_ORG_ID owners: /api/v2/buckets/77ca9dace40a9bfc/owners self: /api/v2/buckets/77ca9dace40a9bfc write: /api/v2/write?org=ORG_ID&bucket=77ca9dace40a9bfc name: _monitoring orgID: INFLUX_ORG_ID retentionRules: - everySeconds: 604800 type: expire schemaType: implicit type: system updatedAt: '2022-03-15T17:22:33.726179487Z' links: self: /api/v2/buckets?descending=false&limit=20&name=_monitoring&offset=0&orgID=ORG_ID schema: $ref: '#/components/schemas/Buckets' description: | Success. The response body contains a list of `buckets`. '401': $ref: '#/components/responses/AuthorizationError' '500': $ref: '#/components/responses/InternalServerError' default: content: application/json: schema: $ref: '#/components/schemas/Error' description: Unexpected error summary: List buckets tags: - Buckets x-codeSamples: - label: 'cURL: filter buckets by name' lang: Shell source: | curl --request GET "http://localhost:8086/api/v2/buckets?name=_monitoring" \ --header "Authorization: Token INFLUX_TOKEN" \ --header "Accept: application/json" \ --header "Content-Type: application/json" post: description: | Creates a [bucket](/influxdb3/cloud-serverless/reference/glossary/#bucket) and returns the bucket resource. The default data [retention period](/influxdb3/cloud-serverless/reference/glossary/#retention-period) is 30 days. #### Limitations - InfluxDB Cloud Free Plan allows users to create up to two buckets. Exceeding the bucket quota will result in an HTTP `403` status code. For additional information regarding InfluxDB Cloud offerings, see [InfluxDB Cloud Pricing](https://www.influxdata.com/influxdb-cloud-pricing/). #### Related Guides - [Create a bucket](/influxdb3/cloud-serverless/admin/buckets/create-bucket/) - [Create bucket CLI reference](/influxdb3/cloud-serverless/reference/cli/influx/bucket/create) operationId: PostBuckets parameters: - $ref: '#/components/parameters/TraceSpan' requestBody: content: application/json: schema: $ref: '#/components/schemas/PostBucketRequest' description: The bucket to create. required: true responses: '201': content: application/json: examples: successResponse: value: createdAt: '2022-08-03T23:04:41.073704121Z' description: A bucket holding air sensor data id: 37407e232b3911d8 labels: [] links: labels: /api/v2/buckets/37407e232b3911d8/labels members: /api/v2/buckets/37407e232b3911d8/members org: /api/v2/orgs/INFLUX_ORG_ID owners: /api/v2/buckets/37407e232b3911d8/owners self: /api/v2/buckets/37407e232b3911d8 write: /api/v2/write?org=INFLUX_ORG_ID&bucket=37407e232b3911d8 name: air_sensor orgID: INFLUX_ORG_ID retentionRules: - everySeconds: 2592000 type: expire schemaType: implicit type: user updatedAt: '2022-08-03T23:04:41.073704228Z' schema: $ref: '#/components/schemas/Bucket' description: | Success. The bucket is created. '400': content: application/json: schema: $ref: '#/components/schemas/Error' description: | Bad request. '401': $ref: '#/components/responses/AuthorizationError' '403': content: application/json: examples: quotaExceeded: summary: Bucket quota exceeded value: code: forbidden message: creating bucket would exceed quota schema: $ref: '#/components/schemas/Error' description: | Forbidden. The bucket quota is exceeded. headers: X-Platform-Error-Code: description: | The reason for the error. schema: example: forbidden type: string '422': content: application/json: schema: $ref: '#/components/schemas/Error' description: | Unprocessable Entity. The request body failed validation. '500': $ref: '#/components/responses/InternalServerError' default: content: application/json: schema: $ref: '#/components/schemas/Error' description: Unexpected error summary: Create a bucket tags: - Buckets x-codeSamples: - label: 'cURL: create a bucket with retention period' lang: Shell source: | curl --request POST "http://localhost:8086/api/v2/buckets \ --header "Authorization: Token INFLUX_TOKEN" \ --header "Accept: application/json" \ --header "Content-Type: application/json" \ --data '{ "name": "air_sensor", "description": "A bucket holding air sensor data", "orgID": "INFLUX_ORG_ID", "retentionRules": [ { "type": "expire", "everySeconds": 2592000, } ] }' - label: cURL lang: Shell source: '' /api/v2/buckets/{bucketID}: delete: description: | Deletes a bucket and all associated records. #### InfluxDB 3 Cloud Serverless - Does the following when you send a delete request: 1. Validates the request and queues the delete. 2. Returns an HTTP `204` status code if queued; _error_ otherwise. 3. Handles the delete asynchronously. #### Limitations - Only one bucket can be deleted per request. #### Related Guides - [Manage buckets](/influxdb3/cloud-serverless/admin/buckets/) operationId: DeleteBucketsID parameters: - $ref: '#/components/parameters/TraceSpan' - description: | Bucket ID. The ID of the bucket to delete. in: path name: bucketID required: true schema: type: string responses: '204': description: | Success. #### InfluxDB 3 Cloud Serverless - The bucket is queued for deletion. '400': content: application/json: examples: invalidID: summary: | Invalid ID. value: code: invalid message: id must have a length of 16 bytes schema: $ref: '#/components/schemas/Error' description: | Bad Request. '401': $ref: '#/components/responses/AuthorizationError' '404': content: application/json: examples: notFound: summary: | The requested bucket was not found. value: code: not found message: bucket not found schema: $ref: '#/components/schemas/Error' description: | Not found. Bucket not found. '500': $ref: '#/components/responses/InternalServerError' default: content: application/json: schema: $ref: '#/components/schemas/Error' description: Unexpected error summary: Delete a bucket tags: - Buckets x-codeSamples: - label: cURL lang: Shell source: | curl --request DELETE "http://localhost:8086/api/v2/buckets/BUCKET_ID" \ --header "Authorization: Token INFLUX_TOKEN" \ --header 'Accept: application/json' get: description: | Retrieves a bucket. Use this endpoint to retrieve information for a specific bucket. operationId: GetBucketsID parameters: - $ref: '#/components/parameters/TraceSpan' - description: | The ID of the bucket to retrieve. in: path name: bucketID required: true schema: type: string responses: '200': content: application/json: examples: successResponse: value: createdAt: '2022-08-03T23:04:41.073704121Z' description: bucket for air sensor data id: 37407e232b3911d8 labels: [] links: labels: /api/v2/buckets/37407e232b3911d8/labels members: /api/v2/buckets/37407e232b3911d8/members org: /api/v2/orgs/INFLUX_ORG_ID owners: /api/v2/buckets/37407e232b3911d8/owners self: /api/v2/buckets/37407e232b3911d8 write: /api/v2/write?org=INFLUX_ORG_ID&bucket=37407e232b3911d8 name: air-sensor orgID: bea7ea952287f70d retentionRules: - everySeconds: 2592000 type: expire schemaType: implicit type: user updatedAt: '2022-08-03T23:04:41.073704228Z' schema: $ref: '#/components/schemas/Bucket' description: | Success. The response body contains the bucket information. '401': $ref: '#/components/responses/AuthorizationError' '404': content: application/json: examples: notFound: summary: | The requested bucket wasn't found. value: code: not found message: bucket not found schema: $ref: '#/components/schemas/Error' description: | Not found. Bucket not found. '500': $ref: '#/components/responses/InternalServerError' default: content: application/json: schema: $ref: '#/components/schemas/Error' description: Unexpected error summary: Retrieve a bucket tags: - Buckets patch: description: | Updates a bucket. Use this endpoint to update properties (`name`, `description`, and `retentionRules`) of a bucket. #### InfluxDB 3 Cloud Serverless - Requires the `retentionRules` property in the request body. If you don't provide `retentionRules`, InfluxDB responds with an HTTP `403` status code. #### Related Guides - [Update a bucket](/influxdb3/cloud-serverless/admin/buckets/update-bucket/) operationId: PatchBucketsID parameters: - $ref: '#/components/parameters/TraceSpan' - description: The bucket ID. in: path name: bucketID required: true schema: type: string requestBody: content: application/json: schema: $ref: '#/components/schemas/PatchBucketRequest' description: The bucket update to apply. required: true responses: '200': content: application/json: examples: successResponse: value: createdAt: '2022-08-03T23:04:41.073704121Z' description: bucket holding air sensor data id: 37407e232b3911d8 labels: [] links: labels: /api/v2/buckets/37407e232b3911d8/labels members: /api/v2/buckets/37407e232b3911d8/members org: /api/v2/orgs/INFLUX_ORG_ID owners: /api/v2/buckets/37407e232b3911d8/owners self: /api/v2/buckets/37407e232b3911d8 write: /api/v2/write?org=INFLUX_ORG_ID&bucket=37407e232b3911d8 name: air_sensor orgID: INFLUX_ORG_ID retentionRules: - everySeconds: 2592000 type: expire schemaType: implicit type: user updatedAt: '2022-08-07T22:49:49.422962913Z' schema: $ref: '#/components/schemas/Bucket' description: An updated bucket '400': content: application/json: examples: invalidJSONStringValue: description: | If the request body contains invalid JSON, InfluxDB returns `invalid` with detail about the problem. summary: Invalid JSON value: code: invalid message: 'invalid json: invalid character ''\'''' looking for beginning of value' schema: $ref: '#/components/schemas/Error' description: | Bad Request. '401': $ref: '#/components/responses/AuthorizationError' '403': content: application/json: examples: invalidRetention: summary: | The retention policy provided exceeds the max retention for the organization. value: code: forbidden message: provided retention exceeds orgs maximum retention duration schema: $ref: '#/components/schemas/Error' description: | Forbidden. '404': content: application/json: examples: notFound: summary: | The requested bucket wasn't found. value: code: not found message: bucket not found schema: $ref: '#/components/schemas/Error' description: | Not found. Bucket not found. '500': $ref: '#/components/responses/InternalServerError' default: content: application/json: schema: $ref: '#/components/schemas/Error' description: Unexpected error summary: Update a bucket tags: - Buckets x-codeSamples: - label: cURL lang: Shell source: | curl --request PATCH "http://localhost:8086/api/v2/buckets/BUCKET_ID \ --header "Authorization: Token INFLUX_TOKEN" \ --header "Accept: application/json" \ --header "Content-Type: application/json" \ --data '{ "name": "air_sensor", "description": "bucket holding air sensor data", "retentionRules": [ { "type": "expire", "everySeconds": 2592000 } ] }' /api/v2/buckets/{bucketID}/labels: get: description: | Lists all labels for a bucket. Labels are objects that contain `labelID`, `name`, `description`, and `color` key-value pairs. They may be used for grouping and filtering InfluxDB resources. Labels are also capable of grouping across different resources--for example, you can apply a label named `air_sensor` to a bucket and a task to quickly organize resources. #### Related guides - Use the `/api/v2/labels` InfluxDB API endpoint to retrieve and manage labels. - [Manage buckets](/influxdb3/cloud-serverless/admin/buckets/) operationId: GetBucketsIDLabels parameters: - $ref: '#/components/parameters/TraceSpan' - description: | The ID of the bucket to retrieve labels for. in: path name: bucketID required: true schema: type: string responses: '200': content: application/json: examples: successResponse: value: labels: - id: 09cbd068e7ebb000 name: production_buckets orgID: INFLUX_ORG_ID links: self: /api/v2/labels schema: $ref: '#/components/schemas/LabelsResponse' description: | Success. The response body contains a list of all labels for the bucket. '400': $ref: '#/components/responses/BadRequestError' '401': $ref: '#/components/responses/AuthorizationError' '404': $ref: '#/components/responses/ResourceNotFoundError' '500': $ref: '#/components/responses/InternalServerError' default: content: application/json: schema: $ref: '#/components/schemas/Error' description: Unexpected error summary: List all labels for a bucket tags: - Buckets post: description: | Adds a label to a bucket and returns the new label information. Labels are objects that contain `labelID`, `name`, `description`, and `color` key-value pairs. They may be used for grouping and filtering across one or more kinds of **resources**--for example, you can apply a label named `air_sensor` to a bucket and a task to quickly organize resources. #### Limitations - Before adding a label to a bucket, you must create the label if you haven't already. To create a label with the InfluxDB API, send a `POST` request to the `/api/v2/labels` endpoint. #### Related guides - Use the `/api/v2/labels` InfluxDB API endpoint to retrieve and manage labels. - [Manage labels in the InfluxDB UI](/influxdb3/cloud-serverless/visualize-data/labels/) operationId: PostBucketsIDLabels parameters: - $ref: '#/components/parameters/TraceSpan' - description: | Bucket ID. The ID of the bucket to label. in: path name: bucketID required: true schema: type: string requestBody: content: application/json: schema: $ref: '#/components/schemas/LabelMapping' description: An object that contains a _`labelID`_ to add to the bucket. required: true responses: '201': content: application/json: examples: successResponse: value: label: id: 09cbd068e7ebb000 name: production_buckets orgID: INFLUX_ORG_ID links: self: /api/v2/labels schema: $ref: '#/components/schemas/LabelResponse' description: | Success. The response body contains the label information. '400': $ref: '#/components/responses/BadRequestError' examples: invalidRequest: summary: The `labelID` is missing from the request body. value: code: invalid message: label id is required '401': $ref: '#/components/responses/AuthorizationError' '404': $ref: '#/components/responses/ResourceNotFoundError' '422': content: application/json: examples: conflictingResource: summary: | Label already exists on the resource. value: code: conflict message: Cannot add label, label already exists on resource schema: $ref: '#/components/schemas/Error' description: | Unprocessable entity. Label already exists on the resource. '500': $ref: '#/components/responses/InternalServerError' default: content: application/json: schema: $ref: '#/components/schemas/Error' description: Unexpected error summary: Add a label to a bucket tags: - Buckets x-codeSamples: - label: cURL lang: Shell source: | curl --request POST "http://localhost:8086/api/v2/buckets/BUCKETS_ID/labels \ --header "Authorization: Token INFLUX_TOKEN" \ --header "Accept: application/json" \ --header "Content-Type: application/json" \ --data '{ "labelID": "09cbd068e7ebb000" }' /api/v2/buckets/{bucketID}/labels/{labelID}: delete: operationId: DeleteBucketsIDLabelsID parameters: - $ref: '#/components/parameters/TraceSpan' - description: The bucket ID. in: path name: bucketID required: true schema: type: string - description: The ID of the label to delete. in: path name: labelID required: true schema: type: string responses: '204': description: Delete has been accepted '404': content: application/json: schema: $ref: '#/components/schemas/Error' description: Bucket not found default: content: application/json: schema: $ref: '#/components/schemas/Error' description: Unexpected error summary: Delete a label from a bucket tags: - Buckets /api/v2/buckets/{bucketID}/members: get: description: | Lists all users for a bucket. InfluxDB [users](/influxdb3/cloud-serverless/reference/glossary/#user) have permission to access InfluxDB. [Members](/influxdb3/cloud-serverless/reference/glossary/#member) are users in an organization with access to the specified resource. Use this endpoint to retrieve all users with access to a bucket. operationId: GetBucketsIDMembers parameters: - $ref: '#/components/parameters/TraceSpan' - description: | The ID of the bucket to retrieve users for. in: path name: bucketID required: true schema: type: string responses: '200': content: application/json: examples: successResponse: value: links: self: /api/v2/buckets/37407e232b3911d8/members users: - id: 791df274afd48a83 links: self: /api/v2/users/791df274afd48a83 name: example_user_1 role: member status: active - id: 09cfb87051cbe000 links: self: /api/v2/users/09cfb87051cbe000 name: example_user_2 role: owner status: active schema: $ref: '#/components/schemas/ResourceMembers' description: | Success. The response body contains a list of all users for the bucket. '400': $ref: '#/components/responses/BadRequestError' '401': $ref: '#/components/responses/AuthorizationError' '404': $ref: '#/components/responses/ResourceNotFoundError' '500': $ref: '#/components/responses/InternalServerError' default: content: application/json: schema: $ref: '#/components/schemas/Error' description: Unexpected error summary: List all users with member privileges for a bucket tags: - Buckets post: description: | Add a user to a bucket and return the new user information. InfluxDB [users](/influxdb3/cloud-serverless/reference/glossary/#user) have permission to access InfluxDB. [Members](/influxdb3/cloud-serverless/reference/glossary/#member) are users in an organization. Use this endpoint to give a user member privileges to a bucket. #### Related guides - [Manage users](/influxdb3/cloud-serverless/users/) - [Manage members](/influxdb3/cloud-serverless/organizations/members/) operationId: PostBucketsIDMembers parameters: - $ref: '#/components/parameters/TraceSpan' - description: | The ID of the bucket to retrieve users for. in: path name: bucketID required: true schema: type: string requestBody: content: application/json: schema: $ref: '#/components/schemas/AddResourceMemberRequestBody' description: A user to add as a member to the bucket. required: true responses: '201': content: application/json: examples: successResponse: value: id: 09cfb87051cbe000 links: self: /api/v2/users/09cfb87051cbe000 name: example_user_1 role: member status: active schema: $ref: '#/components/schemas/ResourceMember' description: | Success. The response body contains the user information. '400': $ref: '#/components/responses/BadRequestError' examples: invalidRequest: summary: The user `id` is missing from the request body. value: code: invalid message: user id missing or invalid '401': $ref: '#/components/responses/AuthorizationError' '404': $ref: '#/components/responses/ResourceNotFoundError' '500': $ref: '#/components/responses/InternalServerError' default: content: application/json: schema: $ref: '#/components/schemas/Error' description: Unexpected error summary: Add a member to a bucket tags: - Buckets x-codeSamples: - label: cURL lang: Shell source: | curl --request POST "http://localhost:8086/api/v2/buckets/BUCKET_ID/members \ --header "Authorization: Token INFLUX_API_TOKEN" \ --header "Accept: application/json" \ --header "Content-Type: application/json" \ --data '{ "id": "09cfb87051cbe000" } /api/v2/buckets/{bucketID}/members/{userID}: delete: description: | Removes a member from a bucket. Use this endpoint to remove a user's member privileges from a bucket. This removes the user's `read` and `write` permissions for the bucket. #### Related guides - [Manage users](/influxdb3/cloud-serverless/users/) - [Manage members](/influxdb3/cloud-serverless/organizations/members/) operationId: DeleteBucketsIDMembersID parameters: - $ref: '#/components/parameters/TraceSpan' - description: | The ID of the user to remove. in: path name: userID required: true schema: type: string - description: | The ID of the bucket to remove a user from. in: path name: bucketID required: true schema: type: string responses: '204': description: | Success. The user is no longer a member of the bucket. '401': $ref: '#/components/responses/AuthorizationError' '404': $ref: '#/components/responses/ResourceNotFoundError' '500': $ref: '#/components/responses/InternalServerError' default: content: application/json: schema: $ref: '#/components/schemas/Error' description: Unexpected error summary: Remove a member from a bucket tags: - Buckets /api/v2/buckets/{bucketID}/owners: get: description: | Lists all [owners](/influxdb3/cloud-serverless/reference/glossary/#owner) of a bucket. Bucket owners have permission to delete buckets and remove user and member permissions from the bucket. InfluxDB 3 Cloud Serverless uses `/api/v2/authorizations` to assign resource permissions; doesn't use `owner` and `member` roles. #### Limitations - Owner permissions are separate from API token permissions. - Owner permissions are used in the context of the InfluxDB UI. #### Required permissions - `read-orgs INFLUX_ORG_ID` *`INFLUX_ORG_ID`* is the ID of the organization that you want to retrieve a list of owners for. #### Related endpoints - Authorizations (API tokens) operationId: GetBucketsIDOwners parameters: - $ref: '#/components/parameters/TraceSpan' - description: | The ID of the bucket to retrieve owners for. in: path name: bucketID required: true schema: type: string responses: '200': content: application/json: examples: successResponse: value: links: self: /api/v2/buckets/BUCKET_ID/owners users: - id: d88d182d91b0950f links: self: /api/v2/users/d88d182d91b0950f name: example-owner role: owner status: active schema: $ref: '#/components/schemas/ResourceOwners' description: | Success. The response body contains a list of all owners for the bucket. '400': $ref: '#/components/responses/BadRequestError' '401': $ref: '#/components/responses/AuthorizationError' '404': $ref: '#/components/responses/ResourceNotFoundError' '500': $ref: '#/components/responses/InternalServerError' default: content: application/json: schema: $ref: '#/components/schemas/Error' description: Unexpected error summary: List all owners of a bucket tags: - Buckets post: description: | Adds an owner to a bucket and returns the [owners](/influxdb3/cloud-serverless/reference/glossary/#owner) with role and user detail. Use this endpoint to create a _resource owner_ for the bucket. Bucket owners have permission to delete buckets and remove user and member permissions from the bucket. InfluxDB 3 Cloud Serverless uses `/api/v2/authorizations` to assign resource permissions; doesn't use `owner` and `member` roles. #### Limitations - Owner permissions are separate from API token permissions. - Owner permissions are used in the context of the InfluxDB UI. #### Required permissions - `write-orgs INFLUX_ORG_ID` *`INFLUX_ORG_ID`* is the ID of the organization that you want to add an owner for. #### Related endpoints - Authorizations (API tokens) #### Related guides - [Manage users](/influxdb3/cloud-serverless/users/) operationId: PostBucketsIDOwners parameters: - $ref: '#/components/parameters/TraceSpan' - description: | The ID of the bucket to add an owner for. in: path name: bucketID required: true schema: type: string requestBody: content: application/json: examples: successResponse: value: id: d88d182d91b0950f links: self: /api/v2/users/d88d182d91b0950f name: example-user role: owner status: active schema: $ref: '#/components/schemas/AddResourceMemberRequestBody' description: A user to add as an owner for the bucket. required: true responses: '201': content: application/json: schema: $ref: '#/components/schemas/ResourceOwner' description: | Created. The bucket `owner` role is assigned to the user. The response body contains the resource owner with role and user detail. '400': $ref: '#/components/responses/BadRequestError' examples: invalidRequest: summary: The user `id` is missing from the request body. value: code: invalid message: user id missing or invalid '401': $ref: '#/components/responses/AuthorizationError' '404': $ref: '#/components/responses/ResourceNotFoundError' '500': $ref: '#/components/responses/InternalServerError' default: content: application/json: schema: $ref: '#/components/schemas/Error' description: Unexpected error summary: Add an owner to a bucket tags: - Buckets x-codeSamples: - label: cURL lang: Shell source: | curl --request POST "http://localhost:8086/api/v2/buckets/BUCKET_ID/owners \ --header "Authorization: Token INFLUX_API_TOKEN" \ --header "Accept: application/json" \ --header "Content-Type: application/json" \ --data '{ "id": "09cfb87051cbe000" } /api/v2/buckets/{bucketID}/owners/{userID}: delete: description: | Removes an owner from a bucket. Use this endpoint to remove a user's `owner` role for a bucket. InfluxDB 3 Cloud Serverless uses `/api/v2/authorizations` to assign resource permissions; doesn't use `owner` and `member` roles. #### Limitations - Owner permissions are separate from API token permissions. - Owner permissions are used in the context of the InfluxDB UI. #### Required permissions - `write-orgs INFLUX_ORG_ID` *`INFLUX_ORG_ID`* is the ID of the organization that you want to remove an owner from. #### Related endpoints - Authorizations (API tokens) #### Related guides - [Manage users](/influxdb3/cloud-serverless/users/) operationId: DeleteBucketsIDOwnersID parameters: - $ref: '#/components/parameters/TraceSpan' - description: | The ID of the owner to remove. in: path name: userID required: true schema: type: string - description: | The ID of the bucket to remove an owner from. in: path name: bucketID required: true schema: type: string responses: '204': description: | Success. The user is no longer an owner of the bucket. '401': $ref: '#/components/responses/AuthorizationError' '404': $ref: '#/components/responses/ResourceNotFoundError' '500': $ref: '#/components/responses/InternalServerError' default: content: application/json: schema: $ref: '#/components/schemas/Error' description: Unexpected error summary: Remove an owner from a bucket tags: - Buckets /api/v2/buckets/{bucketID}/schema/measurements: get: description: | Lists _explicit_ [schemas](/influxdb3/cloud-serverless/reference/glossary/#schema) (`"schemaType": "explicit"`) for a bucket. _Explicit_ schemas are used to enforce column names, tags, fields, and data types for your data. By default, buckets have an _implicit_ schema-type (`"schemaType": "implicit"`) that conforms to your data. #### Related guides - [Using bucket schemas](https://www.influxdata.com/blog/new-bucket-schema-option-protect-from-unwanted-schema-changes/) operationId: getMeasurementSchemas parameters: - description: | An organization name. Specifies the organization that owns the schema. in: query name: org schema: type: string - description: | An organization ID. Specifies the organization that owns the schema. in: query name: orgID schema: type: string - description: | A measurement name. Only returns measurement schemas with the specified name. in: query name: name schema: type: string - description: | A bucket ID. Lists measurement schemas for the specified bucket. in: path name: bucketID required: true schema: type: string responses: '200': content: application/json: schema: $ref: '#/components/schemas/MeasurementSchemaList' description: A list of measurement schemas returning summary information. headers: ETag: description: The current version of the bucket schema schema: type: string '400': content: application/json: examples: invalidSchemaType: summary: Invalid schema type. value: code: invalid message: bucket schemaType must be explicit schema: $ref: '#/components/schemas/Error' description: | Bad request. '401': $ref: '#/components/responses/AuthorizationError' '404': $ref: '#/components/responses/ResourceNotFoundError' '500': $ref: '#/components/responses/InternalServerError' summary: List measurement schemas of a bucket tags: - Bucket Schemas post: description: | Creates an _explicit_ measurement [schema](/influxdb3/cloud-serverless/reference/glossary/#schema) for a bucket. _Explicit_ schemas are used to enforce column names, tags, fields, and data types for your data. By default, buckets have an _implicit_ schema-type (`"schemaType": "implicit"`) that conforms to your data. Use this endpoint to create schemas that prevent non-conforming write requests. #### Limitations - Buckets must be created with the "explicit" `schemaType` in order to use schemas. operationId: createMeasurementSchema parameters: - description: | An organization name. Specifies the organization that owns the schema. in: query name: org schema: type: string - description: | An organization ID. Specifies the organization that owns the schema. in: query name: orgID schema: type: string - description: | A bucket ID. Adds a schema for the specified bucket. in: path name: bucketID required: true schema: type: string requestBody: content: application/json: schema: $ref: '#/components/schemas/MeasurementSchemaCreateRequest' required: true responses: '201': content: application/json: schema: $ref: '#/components/schemas/MeasurementSchema' description: The current version of the measurement schema. headers: ETag: description: The current version of the measurement schema schema: type: string '400': content: application/json: examples: badNameExample: description: The error returned when the name is invalid, such as too few or too many characters or the name contains non-printable ASCII or is not valid UTF-8. summary: Invalid name value: code: invalid message: name is invalid duplicateColumnNamesExample: description: The error returned when the request body contains duplicate column names. summary: Duplicate column names value: code: invalid message: Duplicate column names missingColumnsExample: description: The error returned when the request body is missing the columns property. summary: Missing columns value: code: invalid message: columns is required missingFieldExample: description: The error returned when the request body is missing at least one field type column. summary: Missing field value: code: invalid message: At least one field column is required missingTimestampExample: description: The error returned when the request body is missing a timestamp type column. summary: Missing timestamp value: code: invalid message: Timestamp column is required schema: $ref: '#/components/schemas/Error' description: | Bad request. '401': $ref: '#/components/responses/AuthorizationError' '404': $ref: '#/components/responses/ResourceNotFoundError' '500': $ref: '#/components/responses/InternalServerError' summary: Create a measurement schema for a bucket tags: - Bucket Schemas x-codeSamples: - label: cURL lang: Shell source: | curl --request POST "INFLUX_URL/api/v2/buckets/BUCKET_ID/schema/measurements \ --header "Authorization: Token INFLUX_API_TOKEN" \ --header "Accept: application/json" \ --header "Content-Type: application/json" \ --data '{ "name": "temperature", "column": [ { "type": "tag", "name": "location" }, { "type": "field", "name": "value", "dataType": "float" }, { "type": "timestamp", "name": "time" } ] }' summary: Bucket schemas /api/v2/buckets/{bucketID}/schema/measurements/{measurementID}: get: description: | Retrieves an explicit measurement [schema](/influxdb3/cloud-serverless/reference/glossary/#schema). operationId: getMeasurementSchema parameters: - description: | Organization name. Specifies the organization that owns the schema. in: query name: org schema: type: string - description: | Organization ID. Specifies the organization that owns the schema. in: query name: orgID schema: type: string - description: | A bucket ID. Retrieves schemas for the specified bucket. in: path name: bucketID required: true schema: type: string - description: | The measurement schema ID. Specifies the measurement schema to retrieve. in: path name: measurementID required: true schema: type: string responses: '200': content: application/json: schema: $ref: '#/components/schemas/MeasurementSchema' description: Schema definition for a single measurement headers: ETag: description: The current version of the measurement schema schema: type: string '401': $ref: '#/components/responses/AuthorizationError' '404': $ref: '#/components/responses/ResourceNotFoundError' '500': $ref: '#/components/responses/InternalServerError' summary: Retrieve a measurement schema tags: - Bucket Schemas patch: description: | Updates a measurement [schema](/influxdb3/cloud-serverless/reference/glossary/#schema). Use this endpoint to update the fields (`name`, `type`, and `dataType`) of a measurement schema. #### Limitations - You can't update the `name` of a measurement. #### Related guides - [Manage bucket schemas](/influxdb3/cloud-serverless/admin/buckets/bucket-schema/). - [Using bucket schemas](https://www.influxdata.com/blog/new-bucket-schema-option-protect-from-unwanted-schema-changes/). operationId: updateMeasurementSchema parameters: - description: | An organization name. Specifies the organization that owns the schema. in: query name: org schema: type: string - description: | An organization ID. Specifies the organization that owns the schema. in: query name: orgID schema: type: string - description: | A bucket ID. Specifies the bucket to retrieve schemas for. in: path name: bucketID required: true schema: type: string - description: | A measurement schema ID. Retrieves the specified measurement schema. in: path name: measurementID required: true schema: type: string requestBody: content: application/json: schema: $ref: '#/components/schemas/MeasurementSchemaUpdateRequest' required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/MeasurementSchema' description: | Success. The response body contains the measurement schema. '400': content: application/json: examples: missingColumnsExample: description: The error returned when the request body does not contain all the columns from the source. summary: Deleted columns value: code: invalid message: Unable to delete columns from schema schema: $ref: '#/components/schemas/Error' description: | Bad request. '401': $ref: '#/components/responses/AuthorizationError' '404': $ref: '#/components/responses/ResourceNotFoundError' '500': $ref: '#/components/responses/InternalServerError' summary: Update a measurement schema tags: - Bucket Schemas x-codeSamples: - label: cURL lang: Shell source: | curl --request PATCH "INFLUX_URL/api/v2/buckets/BUCKET_ID/schema/measurements \ --header "Authorization: Token INFLUX_API_TOKEN" \ --header "Accept: application/json" \ --header "Content-Type: application/json" \ --data '{ "column": [ { "type": "tag", "name": "location" }, { "type": "field", "name": "value", "dataType": "float" }, { "type": "timestamp", "name": "time" } ] }' summary: Bucket Schema # InfluxDB Cloud (TSM) endpoints — not supported for Cloud Serverless (InfluxDB 3 storage engine): # /api/v2/checks: {} # /api/v2/checks/{checkID}: {} # /api/v2/checks/{checkID}/labels: {} # /api/v2/checks/{checkID}/labels/{labelID}: {} # /api/v2/checks/{checkID}/query: {} # /api/v2/dashboards: {} # /api/v2/dashboards/{dashboardID}: {} # /api/v2/dashboards/{dashboardID}/cells: {} # /api/v2/dashboards/{dashboardID}/cells/{cellID}: {} # /api/v2/dashboards/{dashboardID}/cells/{cellID}/view: {} # /api/v2/dashboards/{dashboardID}/labels: {} # /api/v2/dashboards/{dashboardID}/labels/{labelID}: {} # /api/v2/dashboards/{dashboardID}/members: {} # /api/v2/dashboards/{dashboardID}/members/{userID}: {} # /api/v2/dashboards/{dashboardID}/owners: {} # /api/v2/dashboards/{dashboardID}/owners/{userID}: {} # /api/v2/dbrps: # get: # description: | # Lists database retention policy (DBRP) mappings. # #### Related guide # - [Database and retention policy mapping](/influxdb3/cloud-serverless/reference/api/influxdb-1x/dbrp/) # operationId: GetDBRPs # parameters: # - $ref: '#/components/parameters/TraceSpan' # - description: | # An organization ID. # Only returns DBRP mappings for the specified organization. # in: query # name: orgID # schema: # type: string # - description: | # An organization name. # Only returns DBRP mappings for the specified organization. # in: query # name: org # schema: # type: string # - description: | # A DBPR mapping ID. # Only returns the specified DBRP mapping. # in: query # name: id # schema: # type: string # - description: | # A bucket ID. # Only returns DBRP mappings that belong to the specified bucket. # in: query # name: bucketID # schema: # type: string # - description: Specifies filtering on default # in: query # name: default # schema: # type: boolean # - description: | # A database. # Only returns DBRP mappings that belong to the 1.x database. # in: query # name: db # schema: # type: string # - description: | # A [retention policy](/influxdb3/cloud-serverless/reference/glossary/#retention-policy-rp). # Specifies the 1.x retention policy to filter on. # in: query # name: rp # schema: # type: string # responses: # '200': # content: # application/json: # examples: # successResponse: # value: # content: # - bucketID: 4d4d9d5b61dee751 # database: example_database_1 # default: true # id: 0a3cbb5dd526a000 # orgID: bea7ea952287f70d # retention_policy: autogen # - bucketID: 4d4d9d5b61dee751 # database: example_database_2 # default: false # id: 0a3cbcde20e38000 # orgID: bea7ea952287f70d # retention_policy: example_retention_policy # schema: # $ref: '#/components/schemas/DBRPs' # description: Success. The response body contains a list of database retention policy mappings. # '400': # content: # application/json: # examples: # invalidRequest: # description: | # The query parameters contain invalid values. # value: # code: invalid # message: invalid ID # schema: # $ref: '#/components/schemas/Error' # description: Bad request. The request has one or more invalid parameters. # '401': # $ref: '#/components/responses/AuthorizationError' # '500': # $ref: '#/components/responses/InternalServerError' # default: # content: # application/json: # schema: # $ref: '#/components/schemas/Error' # description: Unexpected error # summary: List database retention policy mappings # tags: # - DBRPs # post: # description: | # Creates a database retention policy (DBRP) mapping and returns the mapping. # Use this endpoint to add InfluxDB 1.x API compatibility to your # InfluxDB Cloud or InfluxDB OSS 2.x buckets. Your buckets must contain a # DBRP mapping in order to query and write using the InfluxDB 1.x API. # object. # #### Related guide # - [Database and retention policy mapping](/influxdb3/cloud-serverless/reference/api/influxdb-1x/dbrp/) # operationId: PostDBRP # parameters: # - $ref: '#/components/parameters/TraceSpan' # requestBody: # content: # application/json: # schema: # $ref: '#/components/schemas/DBRPCreate' # description: | # The database retention policy mapping to add. # Note that _`retention_policy`_ is a required parameter in the request body. # The value of _`retention_policy`_ can be any arbitrary `string` name or # value, with the default value commonly set as `autogen`. # The value of _`retention_policy`_ isn't a [retention_policy](/influxdb3/cloud-serverless/reference/glossary/#retention-policy-rp) # required: true # responses: # '201': # content: # application/json: # examples: # successResponse: # value: # bucketID: 4d4d9d5b61dee751 # database: example_database # default: true # id: 0a3cbb5dd526a000 # orgID: bea7ea952287f70d # retention_policy: autogen # schema: # $ref: '#/components/schemas/DBRP' # description: Created. The response body contains the database retention policy mapping. # '400': # content: # application/json: # examples: # invalidRequest: # description: | # The query parameters contain invalid values. # value: # code: invalid # message: invalid ID # schema: # $ref: '#/components/schemas/Error' # description: Bad request. The mapping in the request has one or more invalid IDs. # '401': # $ref: '#/components/responses/AuthorizationError' # '404': # $ref: '#/components/responses/ResourceNotFoundError' # '500': # $ref: '#/components/responses/InternalServerError' # default: # content: # application/json: # schema: # $ref: '#/components/schemas/Error' # description: Unexpected error # summary: Add a database retention policy mapping # tags: # - DBRPs # x-codeSamples: # - label: 'cURL: create a database retention policy mapping' # lang: Shell # source: | # curl --request POST \ # "http://localhost:8086/api/v2/dbrp/" \ # --header 'Content-type: application/json' \ # --header "Authorization: Token INFLUXDB_TOKEN" \ # --data-binary @- << EOF # { \ # "bucketID": "INFLUXDB_BUCKET_ID", \ # "orgID": "INFLUXDB_ORG_ID", \ # "database": "database_name", \ # "default": true, \ # "retention_policy": "example_retention_policy_name" \ # } # EOF # /api/v2/dbrps/{dbrpID}: # delete: # description: | # Deletes the specified database retention policy (DBRP) mapping. # #### Related guide # - [Database and retention policy mapping](/influxdb3/cloud-serverless/reference/api/influxdb-1x/dbrp/) # operationId: DeleteDBRPID # parameters: # - $ref: '#/components/parameters/TraceSpan' # - description: | # An organization ID. # Specifies the organization that owns the DBRP mapping. # in: query # name: orgID # schema: # type: string # - description: | # An organization name. # Specifies the organization that owns the DBRP mapping. # in: query # name: org # schema: # type: string # - description: | # A DBRP mapping ID. # Only returns the specified DBRP mapping. # in: path # name: dbrpID # required: true # schema: # type: string # responses: # '204': # description: Success. The delete is accepted. # '400': # content: # application/json: # examples: # invalidRequest: # description: | # The query parameters contain invalid values. # value: # code: invalid # message: invalid ID # schema: # $ref: '#/components/schemas/Error' # description: Bad Request. Query parameters contain invalid values. # '401': # $ref: '#/components/responses/AuthorizationError' # '404': # $ref: '#/components/responses/ResourceNotFoundError' # '500': # $ref: '#/components/responses/InternalServerError' # default: # content: # application/json: # schema: # $ref: '#/components/schemas/Error' # description: Unexpected error # summary: Delete a database retention policy # tags: # - DBRPs # get: # description: | # Retrieves the specified retention policy (DBRP) mapping. # #### Related guide # - [Database and retention policy mapping](/influxdb3/cloud-serverless/reference/api/influxdb-1x/dbrp/) # operationId: GetDBRPsID # parameters: # - $ref: '#/components/parameters/TraceSpan' # - description: | # An organization ID. # Specifies the organization that owns the DBRP mapping. # in: query # name: orgID # schema: # type: string # - description: | # An organization name. # Specifies the organization that owns the DBRP mapping. # in: query # name: org # schema: # type: string # - description: | # A DBRP mapping ID. # Specifies the DBRP mapping. # in: path # name: dbrpID # required: true # schema: # type: string # responses: # '200': # content: # application/json: # examples: # successResponse: # value: # content: # bucketID: 4d4d9d5b61dee751 # database: example_database_1 # default: true # id: 0a3cbb5dd526a000 # orgID: bea7ea952287f70d # retention_policy: autogen # schema: # $ref: '#/components/schemas/DBRPGet' # description: Success. The response body contains the DBRP mapping. # '400': # content: # application/json: # examples: # invalidRequest: # description: | # The query parameters contain invalid values. # value: # code: invalid # message: invalid ID # schema: # $ref: '#/components/schemas/Error' # description: Bad Request. Query parameters contain invalid values. # '401': # $ref: '#/components/responses/AuthorizationError' # '404': # $ref: '#/components/responses/ResourceNotFoundError' # '500': # $ref: '#/components/responses/InternalServerError' # default: # content: # application/json: # schema: # $ref: '#/components/schemas/Error' # description: Unexpected error # summary: Retrieve a database retention policy mapping # tags: # - DBRPs # patch: # operationId: PatchDBRPID # parameters: # - $ref: '#/components/parameters/TraceSpan' # - description: | # An organization ID. # Specifies the organization that owns the DBRP mapping. # in: query # name: orgID # schema: # type: string # - description: | # An organization name. # Specifies the organization that owns the DBRP mapping. # in: query # name: org # schema: # type: string # - description: | # A DBRP mapping ID. # Specifies the DBRP mapping. # in: path # name: dbrpID # required: true # schema: # type: string # requestBody: # content: # application/json: # schema: # $ref: '#/components/schemas/DBRPUpdate' # description: | # Updates the database retention policy (DBRP) mapping and returns the mapping. # Use this endpoint to modify the _retention policy_ (`retention_policy` property) of a DBRP mapping. # #### Related guide # - [Database and retention policy mapping](/influxdb3/cloud-serverless/reference/api/influxdb-1x/dbrp/) # required: true # responses: # '200': # content: # application/json: # examples: # successResponse: # value: # content: # bucketID: 4d4d9d5b61dee751 # database: example_database # default: false # id: 0a3cbb5dd526a000 # orgID: bea7ea952287f70d # retention_policy: example_retention_policy # schema: # $ref: '#/components/schemas/DBRPGet' # description: An updated mapping # '400': # content: # application/json: # examples: # invalidRequest: # description: | # The query parameters contain invalid values. # value: # code: invalid # message: invalid ID # schema: # $ref: '#/components/schemas/Error' # description: Bad Request. Query parameters contain invalid values. # '401': # $ref: '#/components/responses/AuthorizationError' # '404': # $ref: '#/components/responses/ResourceNotFoundError' # '500': # $ref: '#/components/responses/InternalServerError' # default: # content: # application/json: # schema: # $ref: '#/components/schemas/Error' # description: Unexpected error # summary: Update a database retention policy mapping # tags: # - DBRPs # x-codeSamples: # - label: 'cURL: Update a DBRP mapping' # lang: Shell # source: | # curl --request PATCH \ # "http://localhost:8086/api/v2/dbrp/DBRP_ID" \ # --header 'Content-type: application/json' \ # --header "Authorization: Token INFLUX_API_TOKEN" \ # --data-binary @- << EOF # { # "default": true, # "retention_policy": "example_retention_policy_name" # } # EOF # /api/v2/delete: # post: # description: | # Deletes data from a bucket. # **NOTE**: This endpoint has been **disabled** for InfluxDB 3 Cloud Serverless organizations. # See how to [**delete data**](/influxdb3/cloud-serverless/write-data/delete-data/). # #### Related guides # - [Delete data](/influxdb3/cloud-serverless/write-data/delete-data/) # operationId: PostDelete # parameters: # - $ref: '#/components/parameters/TraceSpan' # - description: | # An organization name or ID. # #### InfluxDB 3 Cloud Serverless # - Doesn't use the `org` parameter or `orgID` parameter. # in: query # name: org # schema: # description: The organization name or ID. # type: string # - description: | # A bucket name or ID. # Specifies the bucket to delete data from. # If you pass both `bucket` and `bucketID`, `bucketID` takes precedence. # in: query # name: bucket # schema: # description: The bucket name or ID. # type: string # - description: | # An organization ID. # #### InfluxDB 3 Cloud Serverless # - Doesn't use the `org` parameter or `orgID` parameter. # in: query # name: orgID # schema: # description: The organization ID. # type: string # - description: | # A bucket ID. # Specifies the bucket to delete data from. # If you pass both `bucket` and `bucketID`, `bucketID` takes precedence. # in: query # name: bucketID # schema: # description: The bucket ID. # type: string # requestBody: # content: # application/json: # schema: # $ref: '#/components/schemas/DeletePredicateRequest' # description: | # Time range parameters and an optional **delete predicate expression**. # To select points to delete within the specified time range, pass a # **delete predicate expression** in the `predicate` property of the request body. # If you don't pass a `predicate`, InfluxDB deletes all data with timestamps # in the specified time range. # required: true # responses: # '204': # description: | # **NOTE**: This endpoint has been **disabled** for InfluxDB 3 Cloud Serverless organizations. # See how to [**delete data**](/influxdb3/cloud-serverless/write-data/delete-data/). # '400': # content: # application/json: # examples: # orgNotFound: # summary: Organization not found # value: # code: invalid # message: 'failed to decode request body: organization not found' # schema: # $ref: '#/components/schemas/Error' # description: | # Bad request. # The response body contains detail about the error. # '401': # $ref: '#/components/responses/AuthorizationError' # '404': # $ref: '#/components/responses/ResourceNotFoundError' # '500': # $ref: '#/components/responses/InternalServerError' # default: # $ref: '#/components/responses/GeneralServerError' # summary: Delete data # tags: # - Delete # /api/v2/flags: {} # /api/v2/labels: {} # /api/v2/labels/{labelID}: {} # /api/v2/maps/mapToken: # get: # operationId: getMapboxToken # responses: # '200': # content: # application/json: # schema: # $ref: '#/components/schemas/Token' # description: Temporary token for Mapbox. # '401': # $ref: '#/components/responses/ServerError' # '500': # $ref: '#/components/responses/ServerError' # default: # $ref: '#/components/responses/ServerError' # summary: Get a mapbox token # /api/v2/me: {} # /api/v2/me/password: {} # /api/v2/notificationEndpoints: {} # /api/v2/notificationEndpoints/{endpointID}: {} # /api/v2/notificationEndpoints/{endpointID}/labels: {} # /api/v2/notificationEndpoints/{endpointID}/labels/{labelID}: {} # /api/v2/notificationRules: {} # /api/v2/notificationRules/{ruleID}: {} # /api/v2/notificationRules/{ruleID}/labels: {} # /api/v2/notificationRules/{ruleID}/labels/{labelID}: {} # /api/v2/notificationRules/{ruleID}/query: {} /api/v2/orgs: get: description: | Lists [organizations](/influxdb3/cloud-serverless/reference/glossary/#organization/). InfluxDB 3 Cloud Serverless only returns the organization that owns the token passed in the request. #### Related guides - [View organizations](/influxdb3/cloud-serverless/admin/organizations/view-orgs/) operationId: GetOrgs parameters: - $ref: '#/components/parameters/TraceSpan' - $ref: '#/components/parameters/Offset' - $ref: '#/components/parameters/Limit' - $ref: '#/components/parameters/Descending' - description: | An organization name. Only returns the specified organization. in: query name: org schema: type: string - description: | An organization ID. Only returns the specified organization. in: query name: orgID schema: type: string - description: | A user ID. Only returns organizations where the specified user is a member or owner. in: query name: userID schema: type: string responses: '200': content: application/json: examples: successResponse: value: links: self: /api/v2/orgs orgs: - createdAt: '2022-07-17T23:00:30.778487Z' description: Example InfluxDB organization id: INFLUX_ORG_ID links: buckets: /api/v2/buckets?org=INFLUX_ORG dashboards: /api/v2/dashboards?org=INFLUX_ORG labels: /api/v2/orgs/INFLUX_ORG_ID/labels logs: /api/v2/orgs/INFLUX_ORG_ID/logs members: /api/v2/orgs/INFLUX_ORG_ID/members owners: /api/v2/orgs/INFLUX_ORG_ID/owners secrets: /api/v2/orgs/INFLUX_ORG_ID/secrets self: /api/v2/orgs/INFLUX_ORG_ID tasks: /api/v2/tasks?org=InfluxData name: INFLUX_ORG updatedAt: '2022-07-17T23:00:30.778487Z' schema: $ref: '#/components/schemas/Organizations' description: Success. The response body contains a list of organizations. '400': $ref: '#/components/responses/BadRequestError' '401': $ref: '#/components/responses/AuthorizationError' '404': $ref: '#/components/responses/ResourceNotFoundError' '500': $ref: '#/components/responses/InternalServerError' default: $ref: '#/components/responses/GeneralServerError' summary: List organizations tags: - Organizations post: description: | Creates an [organization](/influxdb3/cloud-serverless/reference/glossary/#organization) and returns the newly created organization. InfluxDB 3 Cloud Serverless doesn't allow you to use this endpoint to create organizations. #### Related guides - [Manage organizations](/influxdb3/cloud-serverless/organizations) operationId: PostOrgs parameters: - $ref: '#/components/parameters/TraceSpan' requestBody: content: application/json: schema: $ref: '#/components/schemas/PostOrganizationRequest' description: The organization to create. required: true responses: '201': content: application/json: examples: successResponse: value: createdAt: '2022-08-24T23:05:52.881317Z' description: '' id: INFLUX_ORG_ID links: buckets: /api/v2/buckets?org=INFLUX_ORG dashboards: /api/v2/dashboards?org=INFLUX_ORG labels: /api/v2/orgs/INFLUX_ORG_ID/labels logs: /api/v2/orgs/INFLUX_ORG_ID/logs members: /api/v2/orgs/INFLUX_ORG_ID/members owners: /api/v2/orgs/INFLUX_ORG_ID/owners secrets: /api/v2/orgs/INFLUX_ORG_ID/secrets self: /api/v2/orgs/INFLUX_ORG_ID tasks: /api/v2/tasks?org=INFLUX_ORG name: INFLUX_ORG updatedAt: '2022-08-24T23:05:52.881318Z' schema: $ref: '#/components/schemas/Organization' description: Created. The response body contains the organization information. '400': $ref: '#/components/responses/BadRequestError' examples: invalidRequest: summary: The `name` field is missing from the request body. value: code: invalid message: org name is empty '401': $ref: '#/components/responses/AuthorizationError' '404': $ref: '#/components/responses/ResourceNotFoundError' '500': $ref: '#/components/responses/InternalServerError' default: content: application/json: schema: $ref: '#/components/schemas/Error' description: Unexpected error summary: Create an organization tags: - Organizations x-codeSamples: - label: cURL lang: Shell source: | curl --request POST "http://localhost:8086/api/v2/orgs \ --header "Authorization: Token INFLUX_API_TOKEN" \ --header "Accept: application/json" \ --header "Content-Type: application/json" \ --data '{ "name": "INFLUX_ORG", "description: "Example InfluxDB organization" }' /api/v2/orgs/{orgID}: delete: description: | Deletes an organization. Deleting an organization from InfluxDB Cloud can't be undone. Once deleted, all data associated with the organization is removed. #### InfluxDB Cloud - Does the following when you send a delete request: 1. Validates the request and queues the delete. 2. Returns an HTTP `204` status code if queued; _error_ otherwise. 3. Handles the delete asynchronously. #### Limitations - Only one organization can be deleted per request. #### Related guides - [Delete organizations](/influxdb3/cloud-serverless/organizations/delete-orgs/) operationId: DeleteOrgsID parameters: - $ref: '#/components/parameters/TraceSpan' - description: | The ID of the organization to delete. in: path name: orgID required: true schema: type: string responses: '204': description: | Success. #### InfluxDB Cloud - The organization is queued for deletion. '400': $ref: '#/components/responses/BadRequestError' '401': $ref: '#/components/responses/AuthorizationError' '404': content: application/json: examples: notFound: summary: | The requested organization was not found. value: code: not found message: org not found schema: $ref: '#/components/schemas/Error' description: | Not found. InfluxDB can't find the organization. '500': $ref: '#/components/responses/InternalServerError' default: content: application/json: schema: $ref: '#/components/schemas/Error' description: Unexpected error summary: Delete an organization tags: - Organizations get: description: | Retrieves an organization. Use this endpoint to retrieve information for a specific organization. #### Related guides - [View organizations](/influxdb3/cloud-serverless/admin/organizations/view-orgs/) operationId: GetOrgsID parameters: - $ref: '#/components/parameters/TraceSpan' - description: | The ID of the organization to retrieve. in: path name: orgID required: true schema: type: string responses: '200': content: application/json: schema: $ref: '#/components/schemas/Organization' description: | Success. The response body contains the organization information. '401': $ref: '#/components/responses/AuthorizationError' '404': content: application/json: examples: notFound: summary: | The requested organization wasn't found. value: code: not found message: organization not found schema: $ref: '#/components/schemas/Error' description: | Not found. Organization not found. '500': $ref: '#/components/responses/InternalServerError' default: content: application/json: schema: $ref: '#/components/schemas/Error' description: Unexpected error summary: Retrieve an organization tags: - Organizations patch: description: | Updates an organization. Use this endpoint to update properties (`name`, `description`) of an organization. Updating an organization’s name affects all resources that reference the organization by name, including the following: - Queries - Dashboards - Tasks - Telegraf configurations - Templates If you change an organization name, be sure to update the organization name in these resources as well. #### Related Guides - [Update an organization](/influxdb3/cloud-serverless/organizations/update-org/) operationId: PatchOrgsID parameters: - $ref: '#/components/parameters/TraceSpan' - description: | The ID of the organization to update. in: path name: orgID required: true schema: type: string requestBody: content: application/json: schema: $ref: '#/components/schemas/PatchOrganizationRequest' description: The organization update to apply. required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/Organization' description: Success. The response body contains the updated organization. '400': $ref: '#/components/responses/BadRequestError' '401': $ref: '#/components/responses/AuthorizationError' '404': $ref: '#/components/responses/ResourceNotFoundError' '500': $ref: '#/components/responses/InternalServerError' default: content: application/json: schema: $ref: '#/components/schemas/Error' description: Unexpected error summary: Update an organization tags: - Organizations /api/v2/orgs/{orgID}/limits: get: operationId: GetOrgLimitsID parameters: - description: The ID of the organization. in: path name: orgID required: true schema: type: string responses: '200': content: application/json: schema: description: These are org limits similar to those configured in/by quartz. properties: limits: $ref: '#/components/schemas/Limit' links: $ref: '#/components/schemas/Links' type: object description: Limits defined for the organization. default: $ref: '#/components/responses/GeneralServerError' description: unexpected error summary: Retrieve limits for an organization tags: - Limits /api/v2/orgs/{orgID}/members: get: description: | Lists all users that belong to an organization. InfluxDB 3 Cloud Serverless doesn't use `owner` and `member` roles. Use `/api/v2/authorizations` to manage resource permissions. operationId: GetOrgsIDMembers parameters: - $ref: '#/components/parameters/TraceSpan' - description: | The ID of the organization to retrieve users for. in: path name: orgID required: true schema: type: string responses: '200': content: application/json: examples: successResponse: value: links: self: /api/v2/orgs/055aa4783aa38398/members users: - id: 791df274afd48a83 links: self: /api/v2/users/791df274afd48a83 name: example_user_1 role: member status: active - id: 09cfb87051cbe000 links: self: /api/v2/users/09cfb87051cbe000 name: example_user_2 role: owner status: active schema: $ref: '#/components/schemas/ResourceMembers' description: | Success. The response body contains a list of all users within the organization. '400': $ref: '#/components/responses/BadRequestError' '401': $ref: '#/components/responses/AuthorizationError' '404': content: application/json: examples: notFound: summary: | The requested organization wasn't found. value: code: not found message: 404 page not found schema: $ref: '#/components/schemas/Error' description: | Not found. InfluxDB can't find the organization. '500': $ref: '#/components/responses/InternalServerError' default: content: application/json: schema: $ref: '#/components/schemas/Error' description: Unexpected error summary: List all members of an organization tags: - Organizations post: description: | Add a user to an organization. InfluxDB 3 Cloud Serverless doesn't use `owner` and `member` roles. Use `/api/v2/authorizations` to manage resource permissions. operationId: PostOrgsIDMembers parameters: - $ref: '#/components/parameters/TraceSpan' - description: | The ID of the organization. in: path name: orgID required: true schema: type: string requestBody: content: application/json: schema: $ref: '#/components/schemas/AddResourceMemberRequestBody' description: | The user to add to the organization. required: true responses: '201': content: application/json: examples: successResponse: value: id: 09cfb87051cbe000 links: self: /api/v2/users/09cfb87051cbe000 name: example_user_1 role: member status: active schema: $ref: '#/components/schemas/ResourceMember' description: | Success. The response body contains the user information. '400': $ref: '#/components/responses/BadRequestError' examples: invalidRequest: summary: The user `id` is missing from the request body. value: code: invalid message: user id missing or invalid '401': $ref: '#/components/responses/AuthorizationError' '404': $ref: '#/components/responses/ResourceNotFoundError' '500': $ref: '#/components/responses/InternalServerError' default: content: application/json: schema: $ref: '#/components/schemas/Error' description: Unexpected error summary: Add a member to an organization tags: - Organizations x-codeSamples: - label: cURL lang: Shell source: | curl --request POST "http://localhost:8086/api/v2/orgs/INFLUX_ORG_ID/members \ --header "Authorization: Token INFLUX_API_TOKEN" \ --header "Accept: application/json" \ --header "Content-Type: application/json" \ --data '{ "id": "09cfb87051cbe000" }' /api/v2/orgs/{orgID}/members/{userID}: delete: description: | Removes a member from an organization. InfluxDB 3 Cloud Serverless doesn't use `owner` and `member` roles. Use `/api/v2/authorizations` to manage resource permissions. operationId: DeleteOrgsIDMembersID parameters: - $ref: '#/components/parameters/TraceSpan' - description: The ID of the user to remove. in: path name: userID required: true schema: type: string - description: The ID of the organization to remove a user from. in: path name: orgID required: true schema: type: string responses: '204': description: | Success. The user is no longer a member of the organization. '401': $ref: '#/components/responses/AuthorizationError' '404': $ref: '#/components/responses/ResourceNotFoundError' '500': $ref: '#/components/responses/InternalServerError' default: content: application/json: schema: $ref: '#/components/schemas/Error' description: Unexpected error summary: Remove a member from an organization tags: - Organizations /api/v2/orgs/{orgID}/owners: get: description: | Lists all owners of an organization. InfluxDB 3 Cloud Serverless doesn't use `owner` and `member` roles. Use `/api/v2/authorizations` to manage resource permissions. operationId: GetOrgsIDOwners parameters: - $ref: '#/components/parameters/TraceSpan' - description: | The ID of the organization to list owners for. in: path name: orgID required: true schema: type: string responses: '200': content: application/json: examples: successResponse: value: links: self: /api/v2/orgs/055aa4783aa38398/owners users: - id: 09cfb87051cbe000 links: self: /api/v2/users/09cfb87051cbe000 name: example_user_2 role: owner status: active schema: $ref: '#/components/schemas/ResourceOwners' description: A list of organization owners '404': content: application/json: schema: $ref: '#/components/schemas/Error' description: Organization not found default: content: application/json: schema: $ref: '#/components/schemas/Error' description: Unexpected error summary: List all owners of an organization tags: - Organizations post: description: | Adds an owner to an organization. InfluxDB 3 Cloud Serverless doesn't use `owner` and `member` roles. Use `/api/v2/authorizations` to manage resource permissions. operationId: PostOrgsIDOwners parameters: - $ref: '#/components/parameters/TraceSpan' - description: The ID of the organization that you want to add an owner for. in: path name: orgID required: true schema: type: string requestBody: content: application/json: examples: successResponse: value: id: 09cfb87051cbe000 links: self: /api/v2/users/09cfb87051cbe000 name: example_user_1 role: owner status: active schema: $ref: '#/components/schemas/AddResourceMemberRequestBody' description: The user to add as an owner of the organization. required: true responses: '201': content: application/json: schema: $ref: '#/components/schemas/ResourceOwner' description: | Success. The user is an owner of the organization. The response body contains the owner with role and user detail. '400': $ref: '#/components/responses/BadRequestError' '401': $ref: '#/components/responses/AuthorizationError' '404': $ref: '#/components/responses/ResourceNotFoundError' '500': $ref: '#/components/responses/InternalServerError' default: content: application/json: schema: $ref: '#/components/schemas/Error' description: Unexpected error summary: Add an owner to an organization tags: - Organizations x-codeSamples: - label: cURL lang: Shell source: | curl --request POST "http://localhost:8086/api/v2/orgs/INFLUX_ORG_ID/owners \ --header "Authorization: Token INFLUX_API_TOKEN" \ --header "Accept: application/json" \ --header "Content-Type: application/json" \ --data '{ "id": "09cfb87051cbe000" }' /api/v2/orgs/{orgID}/owners/{userID}: delete: description: | Removes an [owner](/influxdb3/cloud-serverless/reference/glossary/#owner) from the organization. InfluxDB 3 Cloud Serverless doesn't use `owner` and `member` roles. Use `/api/v2/authorizations` to manage resource permissions. operationId: DeleteOrgsIDOwnersID parameters: - $ref: '#/components/parameters/TraceSpan' - description: The ID of the user to remove. in: path name: userID required: true schema: type: string - description: | The ID of the organization to remove an owner from. in: path name: orgID required: true schema: type: string responses: '204': description: | Success. The user is no longer an owner of the organization. '401': $ref: '#/components/responses/AuthorizationError' '404': $ref: '#/components/responses/ResourceNotFoundError' '500': $ref: '#/components/responses/InternalServerError' default: content: application/json: schema: $ref: '#/components/schemas/Error' description: Unexpected error summary: Remove an owner from an organization tags: - Organizations /api/v2/orgs/{orgID}/secrets: get: operationId: GetOrgsIDSecrets parameters: - $ref: '#/components/parameters/TraceSpan' - description: The organization ID. in: path name: orgID required: true schema: type: string responses: '200': content: application/json: schema: $ref: '#/components/schemas/SecretKeysResponse' description: A list of all secret keys default: content: application/json: schema: $ref: '#/components/schemas/Error' description: Unexpected error summary: List all secret keys for an organization tags: - Secrets patch: operationId: PatchOrgsIDSecrets parameters: - $ref: '#/components/parameters/TraceSpan' - description: The organization ID. in: path name: orgID required: true schema: type: string requestBody: content: application/json: schema: $ref: '#/components/schemas/Secrets' description: Secret key value pairs to update/add required: true responses: '204': description: Keys successfully patched default: content: application/json: schema: $ref: '#/components/schemas/Error' description: Unexpected error summary: Update secrets in an organization tags: - Secrets /api/v2/orgs/{orgID}/secrets/{secretID}: delete: operationId: DeleteOrgsIDSecretsID parameters: - $ref: '#/components/parameters/TraceSpan' - description: The organization ID. in: path name: orgID required: true schema: type: string - description: The secret ID. in: path name: secretID required: true schema: type: string responses: '204': description: Keys successfully deleted default: $ref: '#/components/responses/GeneralServerError' description: Unexpected error summary: Delete a secret from an organization tags: - Secrets /api/v2/orgs/{orgID}/secrets/delete: post: deprecated: true operationId: PostOrgsIDSecrets parameters: - $ref: '#/components/parameters/TraceSpan' - description: The organization ID. in: path name: orgID required: true schema: type: string requestBody: content: application/json: schema: $ref: '#/components/schemas/SecretKeys' description: Secret key to delete required: true responses: '204': description: Keys successfully patched default: content: application/json: schema: $ref: '#/components/schemas/Error' description: Unexpected error summary: Delete secrets from an organization tags: - Secrets /api/v2/orgs/{orgID}/usage: get: operationId: GetOrgUsageID parameters: - description: The ID of the organization. in: path name: orgID required: true schema: type: string - description: | Earliest time ([unix timestamp format](/influxdb3/cloud-serverless/reference/glossary/#unix-timestamp)) to include in results. in: query name: start required: true schema: format: unix timestamp type: integer - description: | Latest time ([unix timestamp format](/influxdb3/cloud-serverless/reference/glossary/#unix-timestamp)) to include in results. in: query name: stop required: false schema: format: unix timestamp type: integer - description: return raw usage data in: query name: raw required: false schema: default: false type: boolean responses: '200': content: text/csv: schema: example: | #group,false,false,true,true,false,false,true,true,true,true #datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string,string #default,_result,,,,,,,,, ,result,table,_start,_stop,_time,_value,_field,_measurement,bucket_id,org_id ,,0,2021-05-10T14:25:10.865702397Z,2021-05-10T15:25:10.865702397Z,2021-05-10T15:00:00Z,5434066,gauge,storage_usage_bucket_bytes,2f6ba0cf9a2fdcbb,cec6fc1d2176dc11 ,,1,2021-05-10T14:25:10.865702397Z,2021-05-10T15:25:10.865702397Z,2021-05-10T15:00:00Z,9924053.966666665,gauge,storage_usage_bucket_bytes,8af67bcaf69d9daf,cec6fc1d2176dc11 type: string description: Usage data headers: Content-Encoding: description: Lists any encodings (usually compression algorithms) that have been applied to the response payload. schema: default: identity description: The content coding. `gzip` for compressed data or `identity` for unmodified, uncompressed data. enum: - gzip - identity type: string default: $ref: '#/components/responses/GeneralServerError' description: unexpected error summary: Retrieve usage for an organization tags: - Usage # InfluxDB Cloud (TSM) endpoints — not supported for Cloud Serverless (InfluxDB 3 storage engine): # /ping: {} # /api/v2/query: # post: # deprecated: true # description: | # Retrieves data from buckets. # This endpoint isn't supported in InfluxDB 3 Cloud Serverless. # See how to [query data](/influxdb3/cloud-serverless/query-data/). # operationId: PostQuery # parameters: # - $ref: '#/components/parameters/TraceSpan' # - description: The content encoding (usually a compression algorithm) that the client can understand. # in: header # name: Accept-Encoding # schema: # default: identity # description: The content coding. Use `gzip` for compressed data or `identity` for unmodified, uncompressed data. # enum: # - gzip # - identity # type: string # - in: header # name: Content-Type # schema: # enum: # - application/json # - application/vnd.flux # type: string # - description: | # An organization name or ID. # #### InfluxDB 3 Cloud Serverless # - Doesn't use the `org` parameter or `orgID` parameter. # in: query # name: org # schema: # type: string # - description: | # An organization ID. # #### InfluxDB 3 Cloud Serverless # - Doesn't use the `org` parameter or `orgID` parameter. # in: query # name: orgID # schema: # type: string # requestBody: # content: # application/json: # schema: # $ref: '#/components/schemas/Query' # application/vnd.flux: # schema: # type: string # description: Flux query or specification to execute # responses: # '200': # content: # application/csv: # schema: # type: string # description: | # This endpoint isn't supported in InfluxDB 3 Cloud Serverless. # See how to [query data](/influxdb3/cloud-serverless/query-data/). # headers: # Content-Encoding: # description: Lists encodings (usually compression algorithms) that have been applied to the response payload. # schema: # default: identity # description: | # The content coding: `gzip` for compressed data or `identity` for unmodified, uncompressed data. # enum: # - gzip # - identity # type: string # Trace-Id: # description: The trace ID, if generated, of the request. # schema: # description: Trace ID of a request. # type: string # '400': # content: # application/json: # examples: # orgNotFound: # summary: Organization not found # value: # code: invalid # message: 'failed to decode request body: organization not found' # schema: # $ref: '#/components/schemas/Error' # description: | # Bad request. # The response body contains detail about the error. # '401': # $ref: '#/components/responses/AuthorizationError' # '404': # $ref: '#/components/responses/ResourceNotFoundError' # '429': # description: | # #### InfluxDB 3 Cloud Serverless: # - returns this error if a **read** or **write** request exceeds your # plan's [adjustable service quotas](/influxdb3/cloud-serverless/account-management/limits/#adjustable-service-quotas) # or if a **delete** request exceeds the maximum # [global limit](/influxdb3/cloud-serverless/account-management/limits/#global-limits). # headers: # Retry-After: # description: Non-negative decimal integer indicating seconds to wait before retrying the request. # schema: # format: int32 # type: integer # '500': # $ref: '#/components/responses/InternalServerError' # default: # $ref: '#/components/responses/GeneralServerError' # summary: Query data # tags: # - Query data # /api/v2/query/analyze: # post: # deprecated: true # description: | # This endpoint isn't supported in InfluxDB 3 Cloud Serverless. # See how to [query data](/influxdb3/cloud-serverless/query-data/). # operationId: PostQueryAnalyze # parameters: # - $ref: '#/components/parameters/TraceSpan' # - in: header # name: Content-Type # schema: # enum: # - application/json # type: string # requestBody: # content: # application/json: # schema: # $ref: '#/components/schemas/Query' # description: Flux query to analyze # responses: # '200': # content: # application/json: # examples: # missingQueryPropertyKey: # description: | # Returns an error object if the Flux query is missing a property key. # The following sample query is missing the _`bucket`_ property key: # ```json # { # "query": "from(: \"iot_center\")\ # ... # } # ``` # summary: Missing property key error # value: # errors: # - character: 0 # column: 6 # line: 1 # message: missing property key # schema: # $ref: '#/components/schemas/AnalyzeQueryResponse' # description: | # This endpoint isn't supported in InfluxDB 3 Cloud Serverless. # See how to [query data](/influxdb3/cloud-serverless/query-data/). # '400': # content: # application/json: # examples: # invalidJSONStringValue: # description: If the request body contains invalid JSON, returns `invalid` and problem detail. # summary: Invalid JSON # value: # code: invalid # message: 'invalid json: invalid character ''\'''' looking for beginning of value' # schema: # $ref: '#/components/schemas/Error' # description: | # Bad request. # InfluxDB is unable to parse the request. # The response body contains detail about the problem. # headers: # X-Platform-Error-Code: # description: | # The reason for the error. # schema: # example: invalid # type: string # default: # content: # application/json: # examples: # emptyJSONObject: # description: | # If the request body contains an empty JSON object, returns `internal error`. # summary: Empty JSON object in request body # value: # code: internal error # message: An internal error has occurred - check server logs # schema: # $ref: '#/components/schemas/Error' # description: Internal server error # headers: # X-Influx-Error: # description: A string that describes the problem. # schema: # type: string # X-Influx-Reference: # description: The numeric reference code for the error type. # schema: # type: integer # X-Platform-Error-Code: # description: The reason for the error. # schema: # example: internal error # type: string # summary: Analyze a Flux query # tags: # - Query data # /api/v2/query/ast: # post: # deprecated: true # description: | # This endpoint isn't supported in InfluxDB 3 Cloud Serverless. # See how to [query data](/influxdb3/cloud-serverless/query-data/). # operationId: PostQueryAst # parameters: # - $ref: '#/components/parameters/TraceSpan' # - in: header # name: Content-Type # schema: # enum: # - application/json # type: string # requestBody: # content: # application/json: # schema: # $ref: '#/components/schemas/LanguageRequest' # description: The Flux query to analyze. # responses: # '200': # content: # schema: # $ref: '#/components/schemas/ASTResponse' # description: | # This endpoint isn't supported in InfluxDB 3 Cloud Serverless. # See how to [query data](/influxdb3/cloud-serverless/query-data/). # '400': # content: # application/json: # examples: # invalidASTValue: # description: | # If the request body contains a missing property key in `from()`, # returns `invalid` and problem detail. # summary: Invalid AST # value: # code: invalid # message: 'invalid AST: loc 1:6-1:19: missing property key' # schema: # $ref: '#/components/schemas/Error' # description: | # Bad request. # InfluxDB is unable to parse the request. # The response body contains detail about the problem. # headers: # X-Platform-Error-Code: # description: | # The reason for the error. # schema: # example: invalid # type: string # default: # content: # application/json: # schema: # $ref: '#/components/schemas/Error' # description: Internal server error. # summary: Generate a query Abstract Syntax Tree (AST) # tags: # - Query data # /api/v2/query/suggestions: # get: # deprecated: true # description: | # This endpoint isn't supported in InfluxDB 3 Cloud Serverless. # See how to [query data](/influxdb3/cloud-serverless/query-data/). # operationId: GetQuerySuggestions # parameters: # - $ref: '#/components/parameters/TraceSpan' # responses: # '200': # description: | # This endpoint isn't supported in InfluxDB 3 Cloud Serverless. # See how to [query data](/influxdb3/cloud-serverless/query-data/). # '301': # content: # text/html: # examples: # movedPermanently: # description: | # The URL has been permanently moved. Use `/api/v2/query/suggestions`. # summary: Invalid URL # value: | # Moved Permanently # schema: # properties: # body: # description: Response message with URL of requested resource. # readOnly: true # type: string # description: | # Moved Permanently. # InfluxData has moved the URL of the endpoint. # Use `/api/v2/query/suggestions` (without a trailing slash). # default: # content: # application/json: # schema: # $ref: '#/components/schemas/Error' # description: Internal server error. # summary: List Flux query suggestions # tags: # - Query data # x-codeSamples: # - label: cURL # lang: Shell # source: | # curl --request GET "INFLUX_URL/api/v2/query/suggestions" \ # --header "Accept: application/json" \ # --header "Authorization: Token INFLUX_API_TOKEN" # /api/v2/query/suggestions/{name}: # get: # deprecated: true # description: | # This endpoint isn't supported in InfluxDB 3 Cloud Serverless. # See how to [query data](/influxdb3/cloud-serverless/query-data/). # operationId: GetQuerySuggestionsName # parameters: # - $ref: '#/components/parameters/TraceSpan' # - description: | # A [Flux function](https://docs.influxdata.com/flux/v0.x/stdlib/all-functions/) name. # in: path # name: name # required: true # schema: # type: string # responses: # '200': # description: | # This endpoint isn't supported in InfluxDB 3 Cloud Serverless. # See how to [query data](/influxdb3/cloud-serverless/query-data/). # '500': # content: # application/json: # examples: # internalError: # description: | # The requested function doesn't exist. # summary: Invalid function # value: # code: internal error # message: An internal error has occurred # schema: # $ref: '#/components/schemas/Error' # description: | # Internal server error. # The value passed for _`name`_ may have been misspelled. # summary: Retrieve a query suggestion for a branching suggestion # tags: # - Query data # /api/v2/resources: # get: # operationId: GetResources # parameters: # - $ref: '#/components/parameters/TraceSpan' # responses: # '200': # content: # application/json: # schema: # items: # type: string # type: array # description: All resources targets # default: # content: # application/json: # schema: # $ref: '#/components/schemas/Error' # description: Internal server error # summary: List all known resources # tags: # - Resources # - System information endpoints # /api/v2/scripts: # get: # description: | # Lists scripts. # # operationId: GetScripts # parameters: # - description: | # The offset for pagination. # The number of records to skip. # For more information about pagination parameters, see Pagination. # in: query # name: offset # required: false # schema: # minimum: 0 # type: integer # - description: | # The maximum number of scripts to return. Default is `100`. # in: query # name: limit # required: false # schema: # default: 100 # maximum: 500 # minimum: 0 # type: integer # - description: The script name. Lists scripts with the specified name. # in: query # name: name # required: false # schema: # type: string # responses: # '200': # content: # application/json: # examples: # successResponse: # value: # scripts: # - createdAt: '2022-07-17T23:49:45.731237Z' # description: find the last point from Sample Bucket # id: 09afa3b220fe4000 # language: flux # name: getLastPointFromSampleBucket # orgID: bea7ea952287f70d # script: 'from(bucket: SampleBucket) |> range(start: -7d) |> limit(n:1)' # updatedAt: '2022-07-17T23:49:45.731237Z' # - createdAt: '2022-07-17T23:43:26.660308Z' # description: getLastPoint finds the last point in a bucket # id: 09afa23ff13e4000 # language: flux # name: getLastPoint # orgID: bea7ea952287f70d # script: 'from(bucket: params.mybucket) |> range(start: -7d) |> limit(n:1)' # updatedAt: '2022-07-17T23:43:26.660308Z' # schema: # $ref: '#/components/schemas/Scripts' # description: | # Success. # The response body contains the list of scripts. # '400': # content: # application/json: # examples: # invalidSyntaxError: # summary: Query parameter contains invalid syntax. # value: # code: 3 # details: [] # message: 'parsing field "limit": strconv.ParseUint: parsing "-1": invalid syntax' # schema: # $ref: '#/components/schemas/Error' # description: | # Bad request. # InfluxDB is unable to parse the request. # The response body contains detail about the error. # '401': # $ref: '#/components/responses/AuthorizationError' # '500': # $ref: '#/components/responses/InternalServerError' # default: # content: # application/json: # schema: # $ref: '#/components/schemas/Error' # description: Unexpected error. # summary: List scripts # tags: # - Invokable Scripts # x-codeSamples: # - label: 'cURL: retrieves the first 100 scripts.' # lang: Shell # source: | # curl --request GET "INFLUX_URL/api/v2/scripts?limit=100&offset=0" \ # --header "Authorization: Token INFLUX_API_TOKEN" \ # --header "Accept: application/json" \ # --header "Content-Type: application/json" # post: # description: | # Creates an invokable script # and returns the script. # # operationId: PostScripts # requestBody: # content: # application/json: # schema: # $ref: '#/components/schemas/ScriptCreateRequest' # description: The script to create. # required: true # responses: # '201': # content: # application/json: # examples: # successResponse: # value: # createdAt: '2022-07-17T23:43:26.660308Z' # description: getLastPoint finds the last point in a bucket # id: 09afa23ff13e4000 # language: flux # name: getLastPoint # orgID: bea7ea952287f70d # script: 'from(bucket: params.mybucket) |> range(start: -7d) |> limit(n:1)' # updatedAt: '2022-07-17T23:43:26.660308Z' # schema: # $ref: '#/components/schemas/Script' # description: | # Success. # The response body contains the script and its metadata. # '400': # $ref: '#/components/responses/BadRequestError' # '401': # $ref: '#/components/responses/AuthorizationError' # '422': # content: # application/json: # examples: # uniquenessError: # description: | # A script with the same `name` exists. # value: # code: conflict # message: uniqueness violation # schema: # $ref: '#/components/schemas/Error' # description: | # Unprocessable entity. # '500': # $ref: '#/components/responses/InternalServerError' # default: # content: # application/json: # schema: # $ref: '#/components/schemas/Error' # description: Unexpected error. # summary: Create a script # tags: # - Invokable Scripts # /api/v2/scripts/{scriptID}: # delete: # description: | # Deletes a script and all associated records. # #### Limitations # - You can delete only one script per request. # - If the script ID you provide doesn't exist for the organization, InfluxDB # responds with an HTTP `204` status code. # # operationId: DeleteScriptsID # parameters: # - description: | # A script ID. # Deletes the specified script. # in: path # name: scriptID # required: true # schema: # type: string # responses: # '204': # description: | # Success. # The script is queued for deletion. # '401': # $ref: '#/components/responses/AuthorizationError' # '500': # $ref: '#/components/responses/InternalServerError' # default: # $ref: '#/components/responses/ServerError' # description: Unexpected error # summary: Delete a script # tags: # - Invokable Scripts # x-codeSamples: # - label: cURL # lang: Shell # source: | # curl -X 'DELETE' \ # "https://cloud2.influxdata.com/api/v2/scripts/SCRIPT_ID" \ # --header "Authorization: Token INFLUX_TOKEN" \ # --header 'Accept: application/json' # get: # description: | # Retrieves a script. # # operationId: GetScriptsID # parameters: # - description: | # A script ID. # Retrieves the specified script. # in: path # name: scriptID # required: true # schema: # type: string # responses: # '200': # content: # application/json: # examples: # successResponse: # value: # createdAt: '2022-07-17T23:49:45.731237Z' # description: getLastPoint finds the last point in a bucket # id: 09afa3b220fe4000 # language: flux # name: getLastPoint # orgID: bea7ea952287f70d # script: 'from(bucket: my-bucket) |> range(start: -7d) |> limit(n:1)' # updatedAt: '2022-07-17T23:49:45.731237Z' # schema: # $ref: '#/components/schemas/Script' # description: Success. The response body contains the script. # '401': # $ref: '#/components/responses/AuthorizationError' # '404': # content: # application/json: # examples: # notFound: # summary: | # The requested script was not found. # value: # code: not found # message: script "09afa3b220fe400" not found # schema: # $ref: '#/components/schemas/Error' # description: | # Not found. # '500': # $ref: '#/components/responses/InternalServerError' # default: # $ref: '#/components/responses/ServerError' # description: Internal server error. # summary: Retrieve a script # tags: # - Invokable Scripts # patch: # description: | # Updates an invokable script. # Use this endpoint to modify values for script properties (`description` and `script`). # To update a script, pass an object that contains the updated key-value pairs. # #### Limitations # - If you send an empty request body, the script will neither update nor # store an empty script, but InfluxDB will respond with an HTTP `200` status # code. # # operationId: PatchScriptsID # parameters: # - description: | # A script ID. # Updates the specified script. # in: path # name: scriptID # required: true # schema: # type: string # requestBody: # content: # application/json: # schema: # $ref: '#/components/schemas/ScriptUpdateRequest' # description: | # An object that contains the updated script properties to apply. # required: true # responses: # '200': # content: # application/json: # examples: # successResponse: # value: # createdAt: '2022-07-17T23:49:45.731237Z' # description: get last point from new bucket # id: 09afa3b220fe4000 # language: flux # name: getLastPoint # orgID: bea7ea952287f70d # script: 'from(bucket: newBucket) |> range(start: -7d) |> limit(n:1)' # updatedAt: '2022-07-19T22:27:23.185436Z' # schema: # $ref: '#/components/schemas/Script' # description: Success. The response body contains the updated script. # '401': # $ref: '#/components/responses/AuthorizationError' # '404': # content: # application/json: # examples: # notFound: # summary: | # The requested script wasn't found. # value: # code: not found # message: script "09afa3b220fe400" not found # schema: # $ref: '#/components/schemas/Error' # description: | # Not found. # '500': # $ref: '#/components/responses/InternalServerError' # default: # $ref: '#/components/responses/ServerError' # description: Internal server error # summary: Update a script # tags: # - Invokable Scripts # x-codeSamples: # - label: cURL # lang: Shell # source: | # curl -X 'PATCH' \ # "https://cloud2.influxdata.com/api/v2/scripts/SCRIPT_ID" \ # --header "Authorization: Token INFLUX_TOKEN" \ # --header "Accept: application/json" # --header "Content-Type: application/json" # --data '{ # "description": "get last point from new bucket", # "script": "from(bucket: updatedBucket) |> range(start: -7d) |> limit(n:1)", "language": "flux" # }' # /api/v2/scripts/{scriptID}/invoke: # post: # description: | # Runs a script and returns the result. # When the script runs, InfluxDB replaces `params` keys referenced in the script with # `params` key-values passed in the request body--for example: # The following sample script contains a _`mybucket`_ parameter : # ```json # "script": "from(bucket: params.mybucket) # |> range(start: -7d) # |> limit(n:1)" # ``` # The following example `POST /api/v2/scripts/SCRIPT_ID/invoke` request body # passes a value for the _`mybucket`_ parameter: # ```json # { # "params": { # "mybucket": "air_sensor" # } # } # ``` # # operationId: PostScriptsIDInvoke # parameters: # - description: | # A script ID. # Runs the specified script. # in: path # name: scriptID # required: true # schema: # type: string # requestBody: # content: # application/json: # schema: # $ref: '#/components/schemas/ScriptInvocationParams' # responses: # '200': # content: # text/csv: # examples: # successResponse: # value: | # ,result,table,_start,_stop,_time,_value,_field,_measurement,host # ,_result,0,2019-10-30T01:28:02.52716421Z,2022-07-26T01:28:02.52716421Z,2020-01-01T00:00:00Z,72.01,used_percent,mem,host2 # schema: # $ref: '#/components/schemas/ScriptHTTPResponseData' # description: | # Success. # The response body contains the result of the script execution. # '400': # content: # application/json: # examples: # invalidParameters: # summary: The parameters passed to the script are invalid. # value: # code: invalid # message: invalid parameters provided # schema: # $ref: '#/components/schemas/Error' # description: | # Bad request. # InfluxDB is unable to parse the request. # The response body contains detail about the error. # headers: # X-Platform-Error-Code: # description: | # The reason for the error. # schema: # example: invalid # type: string # '401': # $ref: '#/components/responses/AuthorizationError' # '404': # content: # application/json: # examples: # bucketNotFound: # description: InfluxDB can't find the requested bucket. # summary: | # Bucket not found # value: # code: not found # message: 'failed to initialize execute state: could not find bucket "test-bucket"' # scriptNotFound: # description: InfluxDB can't find the requested script. # summary: | # Script not found # value: # code: not found # message: script "09afa3b220fe400" not found # schema: # $ref: '#/components/schemas/Error' # description: | # Not found. # headers: # X-Platform-Error-Code: # description: | # The reason for the error. # schema: # example: not found # type: string # '500': # $ref: '#/components/responses/InternalServerError' # default: # content: # application/json: # schema: # $ref: '#/components/schemas/Error' # description: Unexpected error. # summary: Invoke a script # tags: # - Invokable Scripts # /api/v2/scripts/{scriptID}/params: # get: # description: | # Analyzes a script and determines required parameters. # Find all `params` keys referenced in a script and return a list # of keys. If it is possible to determine the type of the value # from the context then the type is also returned -- for example: # The following sample script contains a _`mybucket`_ parameter : # ```json # "script": "from(bucket: params.mybucket) # |> range(start: -7d) # |> limit(n:1)" # ``` # Requesting the parameters using `GET /api/v2/scripts/SCRIPT_ID/params` # returns the following: # ```json # { # "params": { # "mybucket": "string" # } # } # ``` # The type name returned for a parameter will be one of: # - `any` # - `bool` # - `duration` # - `float` # - `int` # - `string` # - `time` # - `uint` # The type name `any` is used when the type of a parameter cannot # be determined from the context, or the type is determined to # be a structured type such as an array or record. # # operationId: GetScriptsIDParams # parameters: # - description: | # A script ID. # The script to analyze for params. # in: path # name: scriptID # required: true # schema: # type: string # responses: # '200': # content: # application/json: # examples: # successResponse: # value: # params: # mybucket: string # schema: # $ref: '#/components/schemas/Params' # description: | # Success. # The response body contains the parameters found, along with their types. # '401': # $ref: '#/components/responses/AuthorizationError' # '404': # content: # application/json: # examples: # scriptNotFound: # description: InfluxDB can't find the requested script. # summary: | # Script not found # value: # code: not found # message: script "09afa3b220fe400" not found # schema: # $ref: '#/components/schemas/Error' # description: | # Not found. # headers: # X-Platform-Error-Code: # description: | # The reason for the error. # schema: # example: not found # type: string # '500': # $ref: '#/components/responses/InternalServerError' # default: # content: # application/json: # schema: # $ref: '#/components/schemas/Error' # description: Unexpected error. # summary: Find script parameters. # tags: # - Invokable Scripts # x-codeSamples: # - label: cURL # lang: Shell # source: | # curl --request GET "https://cloud2.influxdata.com/api/v2/scripts/SCRIPT_ID/params" \ # --header "Authorization: Token INFLUX_TOKEN" # /api/v2/setup: {} # /api/v2/setup/user: {} # /api/v2/signin: {} # /api/v2/signout: {} # /api/v2/stacks: # get: # description: | # Lists installed InfluxDB stacks. # To limit stacks in the response, pass query parameters in your request. # If no query parameters are passed, InfluxDB returns all installed stacks # for the organization. # # operationId: ListStacks # parameters: # - description: | # An organization ID. # Only returns stacks owned by the specified [organization](/influxdb3/cloud-serverless/reference/glossary/#organization). # #### InfluxDB Cloud # - Doesn't require this parameter; # InfluxDB only returns resources allowed by the API token. # in: query # name: orgID # required: true # schema: # type: string # - description: | # A stack name. # Finds stack `events` with this name and returns the stacks. # Repeatable. # To filter for more than one stack name, # repeat this parameter with each name--for example: # - `INFLUX_URL/api/v2/stacks?&orgID=INFLUX_ORG_ID&name=project-stack-0&name=project-stack-1` # examples: # findStackByName: # summary: Find stacks with the event name # value: project-stack-0 # in: query # name: name # schema: # type: string # - description: | # A stack ID. # Only returns the specified stack. # Repeatable. # To filter for more than one stack ID, # repeat this parameter with each ID--for example: # - `INFLUX_URL/api/v2/stacks?&orgID=INFLUX_ORG_ID&stackID=09bd87cd33be3000&stackID=09bef35081fe3000` # examples: # findStackByID: # summary: Find a stack with the ID # value: 09bd87cd33be3000 # in: query # name: stackID # schema: # type: string # responses: # '200': # content: # application/json: # schema: # properties: # stacks: # items: # $ref: '#/components/schemas/Stack' # type: array # type: object # description: Success. The response body contains the list of stacks. # '400': # content: # application/json: # examples: # orgIdMissing: # summary: The orgID query parameter is missing # value: # code: invalid # message: 'organization id[""] is invalid: id must have a length of 16 bytes' # orgProvidedNotFound: # summary: The org or orgID passed doesn't own the token passed in the header # value: # code: invalid # message: 'failed to decode request body: organization not found' # schema: # $ref: '#/components/schemas/Error' # description: | # Bad request. # The response body contains detail about the error. # '401': # $ref: '#/components/responses/AuthorizationError' # '500': # $ref: '#/components/responses/InternalServerError' # default: # content: # application/json: # schema: # $ref: '#/components/schemas/Error' # description: Unexpected error # summary: List installed stacks # tags: # - Templates # post: # description: | # Creates or initializes a stack. # Use this endpoint to _manually_ initialize a new stack with the following # optional information: # - Stack name # - Stack description # - URLs for template manifest files # To automatically create a stack when applying templates, # use the /api/v2/templates/apply endpoint. # #### Required permissions # - `write` permission for the organization # # operationId: CreateStack # requestBody: # content: # application/json: # schema: # properties: # description: # type: string # name: # type: string # orgID: # type: string # urls: # items: # type: string # type: array # title: PostStackRequest # type: object # description: The stack to create. # required: true # responses: # '201': # content: # application/json: # schema: # $ref: '#/components/schemas/Stack' # description: Success. Returns the newly created stack. # '401': # $ref: '#/components/responses/AuthorizationError' # '422': # content: # application/json: # schema: # $ref: '#/components/schemas/Error' # description: | # Unprocessable entity. # The error may indicate one of the following problems: # - The request body isn't valid--the request is well-formed, but InfluxDB can't process it due to semantic errors. # - You passed a parameter combination that InfluxDB doesn't support. # '500': # $ref: '#/components/responses/InternalServerError' # default: # content: # application/json: # schema: # $ref: '#/components/schemas/Error' # description: Unexpected error # summary: Create a stack # tags: # - Templates # /api/v2/stacks/{stack_id}: # delete: # operationId: DeleteStack # parameters: # - description: The identifier of the stack. # in: path # name: stack_id # required: true # schema: # type: string # - description: The identifier of the organization. # in: query # name: orgID # required: true # schema: # type: string # responses: # '204': # description: The stack and its associated resources were deleted. # default: # content: # application/json: # schema: # $ref: '#/components/schemas/Error' # description: Unexpected error # summary: Delete a stack and associated resources # tags: # - Templates # get: # operationId: ReadStack # parameters: # - description: The identifier of the stack. # in: path # name: stack_id # required: true # schema: # type: string # responses: # '200': # content: # application/json: # schema: # $ref: '#/components/schemas/Stack' # description: Returns the stack. # default: # content: # application/json: # schema: # $ref: '#/components/schemas/Error' # description: Unexpected error # summary: Retrieve a stack # tags: # - Templates # patch: # operationId: UpdateStack # parameters: # - description: The identifier of the stack. # in: path # name: stack_id # required: true # schema: # type: string # requestBody: # content: # application/json: # schema: # properties: # additionalResources: # items: # properties: # kind: # type: string # resourceID: # type: string # templateMetaName: # type: string # required: # - kind # - resourceID # type: object # type: array # description: # nullable: true # type: string # name: # nullable: true # type: string # templateURLs: # items: # type: string # nullable: true # type: array # title: PatchStackRequest # type: object # description: The stack to update. # required: true # responses: # '200': # content: # application/json: # schema: # $ref: '#/components/schemas/Stack' # description: Returns the updated stack. # default: # content: # application/json: # schema: # $ref: '#/components/schemas/Error' # description: Unexpected error # summary: Update a stack # tags: # - Templates # /api/v2/stacks/{stack_id}/uninstall: # post: # operationId: UninstallStack # parameters: # - description: The identifier of the stack. # in: path # name: stack_id # required: true # schema: # type: string # responses: # '200': # content: # application/json: # schema: # $ref: '#/components/schemas/Stack' # description: Returns the uninstalled stack. # default: # content: # application/json: # schema: # $ref: '#/components/schemas/Error' # description: Unexpected error # summary: Uninstall a stack # tags: # - Templates # /api/v2/tasks: # get: # description: | # Retrieves a list of [tasks](/influxdb3/cloud-serverless/reference/glossary/#task). # To limit which tasks are returned, pass query parameters in your request. # If no query parameters are passed, InfluxDB returns all tasks up to the default `limit`. # operationId: GetTasks # parameters: # - $ref: '#/components/parameters/TraceSpan' # - description: | # A [task](/influxdb3/cloud-serverless/reference/glossary/#task) name. # Only returns tasks with the specified name. # Different tasks may have the same name. # in: query # name: name # schema: # type: string # - description: | # A [task](/influxdb3/cloud-serverless/reference/glossary/#task) ID. # Only returns tasks created after the specified task. # in: query # name: after # schema: # type: string # - description: | # A [user](/influxdb3/cloud-serverless/reference/glossary/#user) ID. # Only returns tasks owned by the specified user. # in: query # name: user # schema: # type: string # - description: | # An [organization](/influxdb3/cloud-serverless/reference/glossary/#organization) name. # Only returns tasks owned by the specified organization. # in: query # name: org # schema: # type: string # - description: | # An [organization](/influxdb3/cloud-serverless/reference/glossary/#organization) ID. # Only returns tasks owned by the specified organization. # in: query # name: orgID # schema: # type: string # - description: | # A [task](/influxdb3/cloud-serverless/reference/glossary/#task) status. # Only returns tasks that have the specified status (`active` or `inactive`). # in: query # name: status # schema: # enum: # - active # - inactive # type: string # - description: | # The maximum number of [tasks](/influxdb3/cloud-serverless/reference/glossary/#task) to return. # Default is `100`. # The minimum is `1` and the maximum is `500`. # To reduce the payload size, combine _`type=basic`_ and _`limit`_ (see _Request samples_). # For more information about the `basic` response, see the _`type`_ parameter. # examples: # all: # summary: Return all tasks, without pagination. # value: '-1' # minPaginated: # summary: Return a maximum of 50 tasks. # value: '50' # in: query # name: limit # schema: # default: 100 # maximum: 500 # minimum: -1 # type: integer # - description: The number of records to skip. # in: query # name: offset # required: false # schema: # default: 0 # minimum: 0 # type: integer # - description: | # The sort field. Only `name` is supported. # Specifies the field used to sort records in the list. # in: query # name: sortBy # required: false # schema: # enum: # - name # type: string # - description: | # A [task](/influxdb3/cloud-serverless/reference/glossary/#task) type (`basic` or `system`). # Default is `system`. # Specifies the level of detail for tasks in the response. # The default (`system`) response contains all the metadata properties for tasks. # To reduce the response size, pass `basic` to omit some task properties (`flux`, `createdAt`, `updatedAt`). # in: query # name: type # required: false # schema: # default: '' # enum: # - basic # - system # type: string # - description: | # A script ID. # Only returns tasks that use the specified invokable script. # in: query # name: scriptID # schema: # type: string # responses: # '200': # content: # application/json: # examples: # basicTypeTaskOutput: # description: | # A sample response body for the `?type=basic` parameter. # `type=basic` omits some task fields (`createdAt` and `updatedAt`) # and field values (`org`, `flux`) in the response. # summary: Basic output # value: # links: # self: /api/v2/tasks?limit=100 # tasks: # - every: 30m # flux: '' # id: 09956cbb6d378000 # labels: [] # lastRunStatus: success # latestCompleted: '2022-06-30T15:00:00Z' # links: # labels: /api/v2/tasks/09956cbb6d378000/labels # logs: /api/v2/tasks/09956cbb6d378000/logs # members: /api/v2/tasks/09956cbb6d378000/members # owners: /api/v2/tasks/09956cbb6d378000/owners # runs: /api/v2/tasks/09956cbb6d378000/runs # self: /api/v2/tasks/09956cbb6d378000 # name: task1 # org: '' # orgID: 48c88459ee424a04 # ownerID: 0772396d1f411000 # status: active # systemTypeTaskOutput: # description: | # A sample response body for the `?type=system` parameter. # `type=system` returns all task fields. # summary: System output # value: # links: # self: /api/v2/tasks?limit=100 # tasks: # - createdAt: '2022-06-27T15:09:06Z' # description: IoT Center 90-day environment average. # every: 30m # flux: |- # option task = {name: "task1", every: 30m} # from(bucket: "iot_center") # |> range(start: -90d) # |> filter(fn: (r) => r._measurement == "environment") # |> aggregateWindow(every: 1h, fn: mean) # id: 09956cbb6d378000 # labels: [] # lastRunStatus: success # latestCompleted: '2022-06-30T15:00:00Z' # links: # labels: /api/v2/tasks/09956cbb6d378000/labels # logs: /api/v2/tasks/09956cbb6d378000/logs # members: /api/v2/tasks/09956cbb6d378000/members # owners: /api/v2/tasks/09956cbb6d378000/owners # runs: /api/v2/tasks/09956cbb6d378000/runs # self: /api/v2/tasks/09956cbb6d378000 # name: task1 # org: my-iot-center # orgID: 48c88459ee424a04 # ownerID: 0772396d1f411000 # status: active # updatedAt: '2022-06-28T18:10:15Z' # schema: # $ref: '#/components/schemas/Tasks' # description: | # Success. # The response body contains the list of tasks. # '401': # $ref: '#/components/responses/AuthorizationError' # '500': # $ref: '#/components/responses/InternalServerError' # default: # $ref: '#/components/responses/GeneralServerError' # summary: List all tasks # tags: # - Tasks # x-codeSamples: # - label: 'cURL: all tasks, basic output' # lang: Shell # source: | # curl INFLUX_URL/api/v2/tasks/?limit=-1&type=basic \ # --header 'Content-Type: application/json' \ # --header 'Authorization: Token INFLUX_API_TOKEN' # post: # description: | # Creates a [task](/influxdb3/cloud-serverless/reference/glossary/#task) and returns the task. # Use this endpoint to create a scheduled task that runs a Flux script. # #### InfluxDB Cloud # - You can use either `flux` or `scriptID` to provide the task script. # - `flux`: a string of "raw" Flux that contains task options and the script--for example: # ```json # { # "flux": "option task = {name: \"CPU Total 1 Hour New\", every: 1h}\ # from(bucket: \"telegraf\") # |> range(start: -1h) # |> filter(fn: (r) => (r._measurement == \"cpu\")) # |> filter(fn: (r) =>\n\t\t(r._field == \"usage_system\")) # |> filter(fn: (r) => (r.cpu == \"cpu-total\")) # |> aggregateWindow(every: 1h, fn: max) # |> to(bucket: \"cpu_usage_user_total_1h\", org: \"INFLUX_ORG\")", # "status": "active", # "description": "This task downsamples CPU data every hour" # } # ``` # - `scriptID`: the ID of an invokable script # for the task to run. # To pass task options when using `scriptID`, pass the options as # properties in the request body--for example: # ```json # { # "name": "CPU Total 1 Hour New", # "description": "This task downsamples CPU data every hour", # "every": "1h", # "scriptID": "SCRIPT_ID", # "scriptParameters": # { # "rangeStart": "-1h", # "bucket": "telegraf", # "filterField": "cpu-total" # } # } # ``` # #### Limitations: # - You can't use `flux` and `scriptID` for the same task. # # operationId: PostTasks # parameters: # - $ref: '#/components/parameters/TraceSpan' # requestBody: # content: # application/json: # schema: # $ref: '#/components/schemas/TaskCreateRequest' # description: The task to create # required: true # responses: # '201': # content: # application/json: # schema: # $ref: '#/components/schemas/Task' # description: Success. The response body contains a `tasks` list with the new task. # '400': # content: # application/json: # examples: # fluxAndScriptError: # summary: The request body can't contain both flux and scriptID # value: # code: invalid # message: 'failed to decode request: can not provide both scriptID and flux' # missingFluxError: # summary: The request body requires either a flux parameter or scriptID parameter # value: # code: invalid # message: 'failed to decode request: flux required' # schema: # $ref: '#/components/schemas/Error' # description: | # Bad request. # The response body contains detail about the error. # #### InfluxDB Cloud # - Returns this error if the task doesn't contain one of _`flux`_ or _`scriptID`_. # - Returns this error if the task contains _`flux`_ _and_ _`scriptID`_. # '401': # $ref: '#/components/responses/AuthorizationError' # '500': # $ref: '#/components/responses/InternalServerError' # default: # content: # application/json: # schema: # $ref: '#/components/schemas/Error' # description: Unexpected error # summary: Create a task # tags: # - Tasks # x-codeSamples: # - label: 'cURL: create a Flux script task' # lang: Shell # source: | # curl INFLUX_URL/api/v2/tasks \ # --header "Content-type: application/json" \ # --header "Authorization: Token INFLUX_API_TOKEN" \ # --data-binary @- << EOF # { # "orgID": "INFLUX_ORG_ID", # "description": "IoT Center 30d environment average.", # "flux": "option task = {name: \"iot-center-task-1\", every: 30m}\ # from(bucket: \"iot_center\")\ # |> range(start: -30d)\ # |> filter(fn: (r) => r._measurement == \"environment\")\ # |> aggregateWindow(every: 1h, fn: mean)" # } # EOF # - label: 'cURL: create a Flux script reference task' # lang: Shell # source: | # curl INFLUX_URL/api/v2/tasks \ # --header "Content-type: application/json" \ # --header "Authorization: Token INFLUX_API_TOKEN" \ # --data-binary @- << EOF # { # "orgID": "INFLUX_ORG_ID", # "description": "IoT Center 30d environment average.", # "scriptID": "085138a111448000", # "scriptParameters": # { # "rangeStart": "-30d", # "bucket": "air_sensor", # "filterField": "temperature", # "groupColumn": "_time" # } # } # EOF # /api/v2/tasks/{taskID}: # delete: # description: | # Deletes a [task](/influxdb3/cloud-serverless/reference/glossary/#task) and associated records. # Use this endpoint to delete a task and all associated records (task runs, logs, and labels). # Once the task is deleted, InfluxDB cancels all scheduled runs of the task. # If you want to disable a task instead of delete it, update the task status to `inactive`. # operationId: DeleteTasksID # parameters: # - $ref: '#/components/parameters/TraceSpan' # - description: A [task](/influxdb3/cloud-serverless/reference/glossary/#task) ID. Specifies the task to delete. # in: path # name: taskID # required: true # schema: # type: string # responses: # '204': # description: Success. The task and task runs are deleted. Scheduled runs are canceled. # '400': # $ref: '#/components/responses/BadRequestError' # '401': # $ref: '#/components/responses/AuthorizationError' # '404': # $ref: '#/components/responses/ResourceNotFoundError' # '500': # $ref: '#/components/responses/InternalServerError' # default: # $ref: '#/components/responses/GeneralServerError' # summary: Delete a task # tags: # - Tasks # get: # description: | # Retrieves a [task](/influxdb3/cloud-serverless/reference/glossary/#task). # operationId: GetTasksID # parameters: # - $ref: '#/components/parameters/TraceSpan' # - description: | # A [task](/influxdb3/cloud-serverless/reference/glossary/#task) ID. # Specifies the task to retrieve. # in: path # name: taskID # required: true # schema: # type: string # responses: # '200': # content: # application/json: # schema: # $ref: '#/components/schemas/Task' # description: Success. The response body contains the task. # '400': # $ref: '#/components/responses/BadRequestError' # '401': # $ref: '#/components/responses/AuthorizationError' # '404': # $ref: '#/components/responses/ResourceNotFoundError' # '500': # $ref: '#/components/responses/InternalServerError' # default: # $ref: '#/components/responses/GeneralServerError' # summary: Retrieve a task # tags: # - Tasks # patch: # description: | # Updates a [task](/influxdb3/cloud-serverless/reference/glossary/#task), # and then cancels all scheduled runs of the task. # Use this endpoint to set, modify, or clear task properties--for example: `cron`, `name`, `flux`, `status`. # Once InfluxDB applies the update, it cancels all previously scheduled runs of the task. # To update a task, pass an object that contains the updated key-value pairs. # To activate or inactivate a task, set the `status` property. # _`"status": "inactive"`_ cancels scheduled runs and prevents manual runs of the task. # #### InfluxDB Cloud # - Use either `flux` or `scriptID` to provide the task script. # - `flux`: a string of "raw" Flux that contains task options and the script--for example: # ```json # { # "flux": "option task = {name: \"CPU Total 1 Hour New\", every: 1h}\ # from(bucket: \"telegraf\") # |> range(start: -1h) # |> filter(fn: (r) => (r._measurement == \"cpu\")) # |> filter(fn: (r) =>\n\t\t(r._field == \"usage_system\")) # |> filter(fn: (r) => (r.cpu == \"cpu-total\")) # |> aggregateWindow(every: 1h, fn: max) # |> to(bucket: \"cpu_usage_user_total_1h\", org: \"INFLUX_ORG\")", # "status": "active", # "description": "This task downsamples CPU data every hour" # } # ``` # - `scriptID`: the ID of an invokable script # for the task to run. # To pass task options when using `scriptID`, pass the options as # properties in the request body--for example: # ```json # { # "name": "CPU Total 1 Hour New", # "description": "This task downsamples CPU data every hour", # "every": "1h", # "scriptID": "SCRIPT_ID", # "scriptParameters": # { # "rangeStart": "-1h", # "bucket": "telegraf", # "filterField": "cpu-total" # } # } # ``` # #### Limitations: # - You can't use `flux` and `scriptID` for the same task. # operationId: PatchTasksID # parameters: # - $ref: '#/components/parameters/TraceSpan' # - description: | # A [task](/influxdb3/cloud-serverless/reference/glossary/#task) ID. # Specifies the task to update. # in: path # name: taskID # required: true # schema: # type: string # requestBody: # content: # application/json: # schema: # $ref: '#/components/schemas/TaskUpdateRequest' # description: An task update to apply. # required: true # responses: # '200': # content: # application/json: # schema: # $ref: '#/components/schemas/Task' # description: Success. The response body contains the updated task. # '400': # $ref: '#/components/responses/BadRequestError' # '401': # $ref: '#/components/responses/AuthorizationError' # '404': # $ref: '#/components/responses/ResourceNotFoundError' # '500': # $ref: '#/components/responses/InternalServerError' # default: # $ref: '#/components/responses/GeneralServerError' # summary: Update a task # tags: # - Tasks # /api/v2/tasks/{taskID}/labels: # get: # description: | # Retrieves a list of all labels for a task. # Labels may be used for grouping and filtering tasks. # operationId: GetTasksIDLabels # parameters: # - $ref: '#/components/parameters/TraceSpan' # - description: The ID of the task to retrieve labels for. # in: path # name: taskID # required: true # schema: # type: string # responses: # '200': # content: # application/json: # schema: # $ref: '#/components/schemas/LabelsResponse' # description: Success. The response body contains a list of all labels for the task. # '400': # $ref: '#/components/responses/BadRequestError' # '401': # $ref: '#/components/responses/AuthorizationError' # '404': # $ref: '#/components/responses/ResourceNotFoundError' # '500': # $ref: '#/components/responses/InternalServerError' # default: # $ref: '#/components/responses/GeneralServerError' # summary: List labels for a task # tags: # - Tasks # post: # description: | # Adds a label to a task. # Use this endpoint to add a label that you can use to filter tasks in the InfluxDB UI. # operationId: PostTasksIDLabels # parameters: # - $ref: '#/components/parameters/TraceSpan' # - description: The ID of the task to label. # in: path # name: taskID # required: true # schema: # type: string # requestBody: # content: # application/json: # schema: # $ref: '#/components/schemas/LabelMapping' # description: An object that contains a _`labelID`_ to add to the task. # required: true # responses: # '201': # content: # application/json: # schema: # $ref: '#/components/schemas/LabelResponse' # description: Success. The response body contains a list of all labels for the task. # '400': # $ref: '#/components/responses/BadRequestError' # '401': # $ref: '#/components/responses/AuthorizationError' # '404': # $ref: '#/components/responses/ResourceNotFoundError' # '500': # $ref: '#/components/responses/InternalServerError' # default: # $ref: '#/components/responses/GeneralServerError' # summary: Add a label to a task # tags: # - Tasks # /api/v2/tasks/{taskID}/labels/{labelID}: # delete: # description: | # Deletes a label from a task. # operationId: DeleteTasksIDLabelsID # parameters: # - $ref: '#/components/parameters/TraceSpan' # - description: The ID of the task to delete the label from. # in: path # name: taskID # required: true # schema: # type: string # - description: The ID of the label to delete. # in: path # name: labelID # required: true # schema: # type: string # responses: # '204': # description: Success. The label is deleted. # '400': # $ref: '#/components/responses/BadRequestError' # '401': # $ref: '#/components/responses/AuthorizationError' # '404': # $ref: '#/components/responses/ResourceNotFoundError' # '500': # $ref: '#/components/responses/InternalServerError' # default: # $ref: '#/components/responses/GeneralServerError' # summary: Delete a label from a task # tags: # - Tasks # /api/v2/tasks/{taskID}/logs: # get: # description: | # Retrieves a list of all logs for a [task](/influxdb3/cloud-serverless/reference/glossary/#task). # When an InfluxDB task runs, a “run” record is created in the task’s history. # Logs associated with each run provide relevant log messages, timestamps, and the exit status of the run attempt. # Use this endpoint to retrieve only the log events for a task, # without additional task metadata. # operationId: GetTasksIDLogs # parameters: # - $ref: '#/components/parameters/TraceSpan' # - description: The task ID. # in: path # name: taskID # required: true # schema: # type: string # responses: # '200': # content: # application/json: # examples: # taskFailure: # summary: Events for a failed task run. # value: # events: # - message: 'Started task from script: "option task = {name: \"test task\", every: 3d, offset: 0s}"' # runID: 09a946fc3167d000 # time: '2022-07-13T07:06:54.198167Z' # - message: Completed(failed) # runID: 09a946fc3167d000 # time: '2022-07-13T07:07:13.104037Z' # - message: 'error exhausting result iterator: error in query specification while starting program: this Flux script returns no streaming data. Consider adding a "yield" or invoking streaming functions directly, without performing an assignment' # runID: 09a946fc3167d000 # time: '2022-07-13T08:24:37.115323Z' # taskSuccess: # summary: Events for a successful task run. # value: # events: # - message: 'Started task from script: "option task = {name: \"task1\", every: 30m} from(bucket: \"iot_center\") |> range(start: -90d) |> filter(fn: (r) => r._measurement == \"environment\") |> aggregateWindow(every: 1h, fn: mean)"' # runID: 09b070dadaa7d000 # time: '2022-07-18T14:46:07.101231Z' # - message: Completed(success) # runID: 09b070dadaa7d000 # time: '2022-07-18T14:46:07.242859Z' # schema: # $ref: '#/components/schemas/Logs' # description: | # Success. The response body contains an `events` list with logs for the task. # Each log event `message` contains detail about the event. # If a task run fails, InfluxDB logs an event with the reason for the failure. # '400': # $ref: '#/components/responses/BadRequestError' # '401': # $ref: '#/components/responses/AuthorizationError' # '404': # $ref: '#/components/responses/ResourceNotFoundError' # '500': # $ref: '#/components/responses/InternalServerError' # default: # $ref: '#/components/responses/GeneralServerError' # summary: Retrieve all logs for a task # tags: # - Tasks # /api/v2/tasks/{taskID}/members: # get: # deprecated: true # description: | # **Deprecated**: Tasks don't use `owner` and `member` roles. # Use `/api/v2/authorizations` to assign user permissions. # Lists all users that have the `member` role for the specified [task](/influxdb3/cloud-serverless/reference/glossary/#task). # operationId: GetTasksIDMembers # parameters: # - $ref: '#/components/parameters/TraceSpan' # - description: The task ID. # in: path # name: taskID # required: true # schema: # type: string # responses: # '200': # content: # application/json: # schema: # $ref: '#/components/schemas/ResourceMembers' # description: | # Success. The response body contains a list of `users` that have # the `member` role for a task. # default: # content: # application/json: # schema: # $ref: '#/components/schemas/Error' # description: Unexpected error # summary: List all task members # tags: # - Tasks # post: # deprecated: true # description: | # **Deprecated**: Tasks don't use `owner` and `member` roles. # Use `/api/v2/authorizations` to assign user permissions. # Adds a user to members of a task and returns the member. # operationId: PostTasksIDMembers # parameters: # - $ref: '#/components/parameters/TraceSpan' # - description: The task ID. # in: path # name: taskID # required: true # schema: # type: string # requestBody: # content: # application/json: # schema: # $ref: '#/components/schemas/AddResourceMemberRequestBody' # description: A user to add as a member of the task. # required: true # responses: # '201': # content: # application/json: # schema: # $ref: '#/components/schemas/ResourceMember' # description: Created. The user is added to task members. # default: # content: # application/json: # schema: # $ref: '#/components/schemas/Error' # description: Unexpected error # summary: Add a member to a task # tags: # - Tasks # /api/v2/tasks/{taskID}/members/{userID}: # delete: # deprecated: true # description: | # **Deprecated**: Tasks don't use `owner` and `member` roles. # Use `/api/v2/authorizations` to assign user permissions. # Removes a member from a [task](/influxdb3/cloud-serverless/reference/glossary/#task). # operationId: DeleteTasksIDMembersID # parameters: # - $ref: '#/components/parameters/TraceSpan' # - description: The ID of the member to remove. # in: path # name: userID # required: true # schema: # type: string # - description: The task ID. # in: path # name: taskID # required: true # schema: # type: string # responses: # '204': # description: Member removed # default: # content: # application/json: # schema: # $ref: '#/components/schemas/Error' # description: Unexpected error # summary: Remove a member from a task # tags: # - Tasks # /api/v2/tasks/{taskID}/owners: # get: # deprecated: true # description: | # **Deprecated**: Tasks don't use `owner` and `member` roles. # Use `/api/v2/authorizations` to assign user permissions. # Retrieves all users that have owner permission for a task. # operationId: GetTasksIDOwners # parameters: # - $ref: '#/components/parameters/TraceSpan' # - description: The ID of the task to retrieve owners for. # in: path # name: taskID # required: true # schema: # type: string # responses: # '200': # content: # application/json: # schema: # $ref: '#/components/schemas/ResourceOwners' # description: | # Success. # The response contains a list of `users` that have the `owner` role for the task. # If the task has no owners, the response contains an empty `users` array. # '401': # $ref: '#/components/responses/AuthorizationError' # '422': # content: # application/json: # schema: # $ref: '#/components/schemas/Error' # description: | # Unprocessable entity. # The error may indicate one of the following problems: # - The request body isn't valid--the request is well-formed, but InfluxDB can't process it due to semantic errors. # - You passed a parameter combination that InfluxDB doesn't support. # '500': # $ref: '#/components/responses/InternalServerError' # default: # content: # application/json: # schema: # $ref: '#/components/schemas/Error' # description: Unexpected error # summary: List all owners of a task # tags: # - Tasks # post: # deprecated: true # description: | # **Deprecated**: Tasks don't use `owner` and `member` roles. # Use `/api/v2/authorizations` to assign user permissions. # Assigns a task `owner` role to a user. # Use this endpoint to create a _resource owner_ for the task. # A _resource owner_ is a user with `role: owner` for a specific resource. # operationId: PostTasksIDOwners # parameters: # - $ref: '#/components/parameters/TraceSpan' # - description: The task ID. # in: path # name: taskID # required: true # schema: # type: string # requestBody: # content: # application/json: # schema: # $ref: '#/components/schemas/AddResourceMemberRequestBody' # description: A user to add as an owner of the task. # required: true # responses: # '201': # content: # application/json: # examples: # createdOwner: # summary: User has the owner role for the resource # value: # id: 0772396d1f411000 # links: # logs: /api/v2/users/0772396d1f411000/logs # self: /api/v2/users/0772396d1f411000 # name: USER_NAME # role: owner # status: active # schema: # $ref: '#/components/schemas/ResourceOwner' # description: | # Created. The task `owner` role is assigned to the user. # The response body contains the resource owner with # role and user detail. # '401': # $ref: '#/components/responses/AuthorizationError' # '422': # content: # application/json: # schema: # $ref: '#/components/schemas/Error' # description: | # Unprocessable entity. # The error may indicate one of the following problems: # - The request body isn't valid--the request is well-formed, but InfluxDB can't process it due to semantic errors. # - You passed a parameter combination that InfluxDB doesn't support. # '500': # $ref: '#/components/responses/InternalServerError' # default: # content: # application/json: # schema: # $ref: '#/components/schemas/Error' # description: Unexpected error # summary: Add an owner for a task # tags: # - Tasks # /api/v2/tasks/{taskID}/owners/{userID}: # delete: # deprecated: true # description: | # **Deprecated**: Tasks don't use `owner` and `member` roles. # Use `/api/v2/authorizations` to assign user permissions. # operationId: DeleteTasksIDOwnersID # parameters: # - $ref: '#/components/parameters/TraceSpan' # - description: The ID of the owner to remove. # in: path # name: userID # required: true # schema: # type: string # - description: The task ID. # in: path # name: taskID # required: true # schema: # type: string # responses: # '204': # description: Owner removed # default: # content: # application/json: # schema: # $ref: '#/components/schemas/Error' # description: Unexpected error # summary: Remove an owner from a task # tags: # - Tasks # /api/v2/tasks/{taskID}/runs: # get: # description: | # Retrieves a list of runs for a task. # To limit which task runs are returned, pass query parameters in your request. # If no query parameters are passed, InfluxDB returns all task runs up to the default `limit`. # # operationId: GetTasksIDRuns # parameters: # - $ref: '#/components/parameters/TraceSpan' # - description: | # The ID of the task to get runs for. # Only returns runs for this task. # in: path # name: taskID # required: true # schema: # type: string # - description: A task run ID. Only returns runs created after this run. # in: query # name: after # schema: # type: string # - description: | # Limits the number of task runs returned. Default is `100`. # in: query # name: limit # schema: # default: 100 # maximum: 500 # minimum: 1 # type: integer # - description: | # A timestamp ([RFC3339 date/time format](/influxdb3/cloud-serverless/reference/glossary/#rfc3339-timestamp)). # Only returns runs scheduled after this time. # in: query # name: afterTime # schema: # format: date-time # type: string # - description: | # A timestamp ([RFC3339 date/time format](/influxdb3/cloud-serverless/reference/glossary/#rfc3339-timestamp)). # Only returns runs scheduled before this time. # in: query # name: beforeTime # schema: # format: date-time # type: string # responses: # '200': # content: # application/json: # schema: # $ref: '#/components/schemas/Runs' # description: Success. The response body contains the list of task runs. # '401': # $ref: '#/components/responses/AuthorizationError' # '500': # $ref: '#/components/responses/InternalServerError' # default: # $ref: '#/components/responses/GeneralServerError' # summary: List runs for a task # tags: # - Tasks # post: # description: | # Schedules a task run to start immediately, ignoring scheduled runs. # Use this endpoint to manually start a task run. # Scheduled runs will continue to run as scheduled. # This may result in concurrently running tasks. # To _retry_ a previous run (and avoid creating a new run), # use the `POST /api/v2/tasks/{taskID}/runs/{runID}/retry` endpoint. # # operationId: PostTasksIDRuns # parameters: # - $ref: '#/components/parameters/TraceSpan' # - in: path # name: taskID # required: true # schema: # type: string # requestBody: # content: # application/json: # schema: # $ref: '#/components/schemas/RunManually' # responses: # '201': # content: # application/json: # schema: # $ref: '#/components/schemas/Run' # description: Success. The run is scheduled to start. # '401': # $ref: '#/components/responses/AuthorizationError' # '500': # $ref: '#/components/responses/InternalServerError' # default: # $ref: '#/components/responses/GeneralServerError' # summary: Start a task run, overriding the schedule # tags: # - Tasks # /api/v2/tasks/{taskID}/runs/{runID}: # delete: # description: | # Cancels a running [task](/influxdb3/cloud-serverless/reference/glossary/#task). # Use this endpoint with InfluxDB OSS to cancel a running task. # #### InfluxDB Cloud # - Doesn't support this operation. # # operationId: DeleteTasksIDRunsID # parameters: # - $ref: '#/components/parameters/TraceSpan' # - description: The ID of the task to cancel. # in: path # name: taskID # required: true # schema: # type: string # - description: The ID of the task run to cancel. # in: path # name: runID # required: true # schema: # type: string # responses: # '204': # description: | # Success. The `DELETE` is accepted and the run will be cancelled. # #### InfluxDB Cloud # - Doesn't support this operation. # - Doesn't return this status. # '400': # $ref: '#/components/responses/BadRequestError' # '401': # $ref: '#/components/responses/AuthorizationError' # '404': # $ref: '#/components/responses/ResourceNotFoundError' # '405': # content: # application/json: # schema: # $ref: '#/components/schemas/Error' # description: | # Method not allowed. # #### InfluxDB Cloud # - Always returns this error; doesn't support cancelling tasks. # '500': # $ref: '#/components/responses/InternalServerError' # default: # $ref: '#/components/responses/GeneralServerError' # summary: Cancel a running task # tags: # - Tasks # get: # description: | # Retrieves a specific run for a task. # Use this endpoint to retrieve detail and logs for a specific task run. # # operationId: GetTasksIDRunsID # parameters: # - $ref: '#/components/parameters/TraceSpan' # - description: The ID of the task to retrieve runs for. # in: path # name: taskID # required: true # schema: # type: string # - description: The ID of the run to retrieve. # in: path # name: runID # required: true # schema: # type: string # responses: # '200': # content: # application/json: # examples: # runSuccess: # summary: A successful task run. # value: # finishedAt: '2022-07-18T14:46:07.308254Z' # id: 09b070dadaa7d000 # links: # logs: /api/v2/tasks/0996e56b2f378000/runs/09b070dadaa7d000/logs # retry: /api/v2/tasks/0996e56b2f378000/runs/09b070dadaa7d000/retry # self: /api/v2/tasks/0996e56b2f378000/runs/09b070dadaa7d000 # task: /api/v2/tasks/0996e56b2f378000 # log: # - message: 'Started task from script: "option task = {name: \"task1\", every: 30m} from(bucket: \"iot_center\") |> range(start: -90d) |> filter(fn: (r) => r._measurement == \"environment\") |> aggregateWindow(every: 1h, fn: mean)"' # runID: 09b070dadaa7d000 # time: '2022-07-18T14:46:07.101231Z' # - message: Completed(success) # runID: 09b070dadaa7d000 # time: '2022-07-18T14:46:07.242859Z' # requestedAt: '2022-07-18T14:46:06Z' # scheduledFor: '2022-07-18T14:46:06Z' # startedAt: '2022-07-18T14:46:07.16222Z' # status: success # taskID: 0996e56b2f378000 # schema: # $ref: '#/components/schemas/Run' # description: Success. The response body contains the task run. # '400': # $ref: '#/components/responses/BadRequestError' # '401': # $ref: '#/components/responses/AuthorizationError' # '404': # $ref: '#/components/responses/ResourceNotFoundError' # '500': # $ref: '#/components/responses/InternalServerError' # default: # $ref: '#/components/responses/GeneralServerError' # summary: Retrieve a run for a task. # tags: # - Tasks # /api/v2/tasks/{taskID}/runs/{runID}/logs: # get: # description: | # Retrieves all logs for a task run. # A log is a list of run events with `runID`, `time`, and `message` properties. # Use this endpoint to help analyze task performance and troubleshoot failed task runs. # # operationId: GetTasksIDRunsIDLogs # parameters: # - $ref: '#/components/parameters/TraceSpan' # - description: The ID of the task to get logs for. # in: path # name: taskID # required: true # schema: # type: string # - description: The ID of the run to get logs for. # in: path # name: runID # required: true # schema: # type: string # responses: # '200': # content: # application/json: # examples: # taskFailure: # summary: Events for a failed task. # value: # events: # - message: 'Started task from script: "option task = {name: \"test task\", every: 3d, offset: 0s}"' # runID: 09a946fc3167d000 # time: '2022-07-13T07:06:54.198167Z' # - message: Completed(failed) # runID: 09a946fc3167d000 # time: '2022-07-13T07:07:13.104037Z' # - message: 'error exhausting result iterator: error in query specification while starting program: this Flux script returns no streaming data. Consider adding a "yield" or invoking streaming functions directly, without performing an assignment' # runID: 09a946fc3167d000 # time: '2022-07-13T08:24:37.115323Z' # taskSuccess: # summary: Events for a successful task run. # value: # events: # - message: 'Started task from script: "option task = {name: \"task1\", every: 30m} from(bucket: \"iot_center\") |> range(start: -90d) |> filter(fn: (r) => r._measurement == \"environment\") |> aggregateWindow(every: 1h, fn: mean)"' # runID: 09b070dadaa7d000 # time: '2022-07-18T14:46:07.101231Z' # - message: Completed(success) # runID: 09b070dadaa7d000 # time: '2022-07-18T14:46:07.242859Z' # schema: # $ref: '#/components/schemas/Logs' # description: | # Success. The response body contains an `events` list with logs for the task run. # Each log event `message` contains detail about the event. # If a run fails, InfluxDB logs an event with the reason for the failure. # '400': # $ref: '#/components/responses/BadRequestError' # '401': # $ref: '#/components/responses/AuthorizationError' # '404': # $ref: '#/components/responses/ResourceNotFoundError' # '500': # $ref: '#/components/responses/InternalServerError' # default: # $ref: '#/components/responses/GeneralServerError' # summary: Retrieve all logs for a run # tags: # - Tasks # /api/v2/tasks/{taskID}/runs/{runID}/retry: # post: # description: | # Queues a task run to # retry and returns the scheduled run. # To manually start a _new_ task run, use the # `POST /api/v2/tasks/{taskID}/runs` endpoint. # #### Limitations # - The task must be _active_ (`status: "active"`). # operationId: PostTasksIDRunsIDRetry # parameters: # - $ref: '#/components/parameters/TraceSpan' # - description: | # A [task](/influxdb3/cloud-serverless/reference/glossary/#task) ID. # Specifies the task to retry. # in: path # name: taskID # required: true # schema: # type: string # - description: | # A [task](/influxdb3/cloud-serverless/reference/glossary/#task) run ID. # Specifies the task run to retry. # To find a task run ID, use the # `GET /api/v2/tasks/{taskID}/runs` endpoint # to list task runs. # in: path # name: runID # required: true # schema: # type: string # requestBody: # content: # application/json; charset=utf-8: # schema: # type: object # responses: # '200': # content: # application/json: # examples: # retryTaskRun: # summary: A task run scheduled to retry # value: # id: 09d60ffe08738000 # links: # logs: /api/v2/tasks/09a776832f381000/runs/09d60ffe08738000/logs # retry: /api/v2/tasks/09a776832f381000/runs/09d60ffe08738000/retry # self: /api/v2/tasks/09a776832f381000/runs/09d60ffe08738000 # task: /api/v2/tasks/09a776832f381000 # requestedAt: '2022-08-16T20:05:11.84145Z' # scheduledFor: '2022-08-15T00:00:00Z' # status: scheduled # taskID: 09a776832f381000 # schema: # $ref: '#/components/schemas/Run' # description: Success. The response body contains the queued run. # '400': # content: # application/json: # examples: # inactiveTask: # summary: Can't retry an inactive task # value: # code: invalid # message: 'failed to retry run: inactive task' # schema: # $ref: '#/components/schemas/Error' # description: | # Bad request. # The response body contains detail about the error. # InfluxDB may return this error for the following reasons: # - The task has `status: inactive`. # '401': # $ref: '#/components/responses/AuthorizationError' # '404': # $ref: '#/components/responses/ResourceNotFoundError' # '500': # $ref: '#/components/responses/InternalServerError' # default: # $ref: '#/components/responses/GeneralServerError' # summary: Retry a task run # tags: # - Tasks # /api/v2/telegraf/plugins: {} # /api/v2/telegrafs: # get: # operationId: GetTelegrafs # parameters: # - $ref: '#/components/parameters/TraceSpan' # - description: The organization ID the Telegraf config belongs to. # in: query # name: orgID # schema: # type: string # responses: # '200': # content: # application/json: # schema: # $ref: '#/components/schemas/Telegrafs' # description: A list of Telegraf configurations # default: # content: # application/json: # schema: # $ref: '#/components/schemas/Error' # description: Unexpected error # summary: List all Telegraf configurations # tags: # - Telegrafs # post: # operationId: PostTelegrafs # parameters: # - $ref: '#/components/parameters/TraceSpan' # requestBody: # content: # application/json: # schema: # $ref: '#/components/schemas/TelegrafPluginRequest' # description: Telegraf configuration to create # required: true # responses: # '201': # content: # application/json: # schema: # $ref: '#/components/schemas/Telegraf' # description: Telegraf configuration created # default: # content: # application/json: # schema: # $ref: '#/components/schemas/Error' # description: Unexpected error # summary: Create a Telegraf configuration # tags: # - Telegrafs # /api/v2/telegrafs/{telegrafID}: # delete: # operationId: DeleteTelegrafsID # parameters: # - $ref: '#/components/parameters/TraceSpan' # - description: The Telegraf configuration ID. # in: path # name: telegrafID # required: true # schema: # type: string # responses: # '204': # description: Delete has been accepted # default: # content: # application/json: # schema: # $ref: '#/components/schemas/Error' # description: Unexpected error # summary: Delete a Telegraf configuration # tags: # - Telegrafs # get: # operationId: GetTelegrafsID # parameters: # - $ref: '#/components/parameters/TraceSpan' # - description: The Telegraf configuration ID. # in: path # name: telegrafID # required: true # schema: # type: string # - in: header # name: Accept # required: false # schema: # default: application/toml # enum: # - application/toml # - application/json # - application/octet-stream # type: string # responses: # '200': # content: # application/json: # schema: # $ref: '#/components/schemas/Telegraf' # application/octet-stream: # example: |- # [agent] # interval = "10s" # schema: # type: string # application/toml: # example: |- # [agent] # interval = "10s" # schema: # type: string # description: Telegraf configuration details # default: # content: # application/json: # schema: # $ref: '#/components/schemas/Error' # description: Unexpected error # summary: Retrieve a Telegraf configuration # tags: # - Telegrafs # put: # operationId: PutTelegrafsID # parameters: # - $ref: '#/components/parameters/TraceSpan' # - description: The Telegraf config ID. # in: path # name: telegrafID # required: true # schema: # type: string # requestBody: # content: # application/json: # schema: # $ref: '#/components/schemas/TelegrafPluginRequest' # description: Telegraf configuration update to apply # required: true # responses: # '200': # content: # application/json: # schema: # $ref: '#/components/schemas/Telegraf' # description: An updated Telegraf configurations # default: # content: # application/json: # schema: # $ref: '#/components/schemas/Error' # description: Unexpected error # summary: Update a Telegraf configuration # tags: # - Telegrafs # /api/v2/telegrafs/{telegrafID}/labels: # get: # operationId: GetTelegrafsIDLabels # parameters: # - $ref: '#/components/parameters/TraceSpan' # - description: The Telegraf config ID. # in: path # name: telegrafID # required: true # schema: # type: string # responses: # '200': # content: # application/json: # schema: # $ref: '#/components/schemas/LabelsResponse' # description: A list of all labels for a Telegraf config # default: # content: # application/json: # schema: # $ref: '#/components/schemas/Error' # description: Unexpected error # summary: List all labels for a Telegraf config # tags: # - Telegrafs # post: # operationId: PostTelegrafsIDLabels # parameters: # - $ref: '#/components/parameters/TraceSpan' # - description: The Telegraf config ID. # in: path # name: telegrafID # required: true # schema: # type: string # requestBody: # content: # application/json: # schema: # $ref: '#/components/schemas/LabelMapping' # description: Label to add # required: true # responses: # '201': # content: # application/json: # schema: # $ref: '#/components/schemas/LabelResponse' # description: The label added to the Telegraf config # default: # content: # application/json: # schema: # $ref: '#/components/schemas/Error' # description: Unexpected error # summary: Add a label to a Telegraf config # tags: # - Telegrafs # /api/v2/telegrafs/{telegrafID}/labels/{labelID}: # delete: # operationId: DeleteTelegrafsIDLabelsID # parameters: # - $ref: '#/components/parameters/TraceSpan' # - description: The Telegraf config ID. # in: path # name: telegrafID # required: true # schema: # type: string # - description: The label ID. # in: path # name: labelID # required: true # schema: # type: string # responses: # '204': # description: Delete has been accepted # '404': # content: # application/json: # schema: # $ref: '#/components/schemas/Error' # description: Telegraf config not found # default: # content: # application/json: # schema: # $ref: '#/components/schemas/Error' # description: Unexpected error # summary: Delete a label from a Telegraf config # tags: # - Telegrafs # /api/v2/telegrafs/{telegrafID}/members: # get: # operationId: GetTelegrafsIDMembers # parameters: # - $ref: '#/components/parameters/TraceSpan' # - description: The Telegraf config ID. # in: path # name: telegrafID # required: true # schema: # type: string # responses: # '200': # content: # application/json: # schema: # $ref: '#/components/schemas/ResourceMembers' # description: A list of Telegraf config members # default: # content: # application/json: # schema: # $ref: '#/components/schemas/Error' # description: Unexpected error # summary: List all users with member privileges for a Telegraf config # tags: # - Telegrafs # post: # operationId: PostTelegrafsIDMembers # parameters: # - $ref: '#/components/parameters/TraceSpan' # - description: The Telegraf config ID. # in: path # name: telegrafID # required: true # schema: # type: string # requestBody: # content: # application/json: # schema: # $ref: '#/components/schemas/AddResourceMemberRequestBody' # description: User to add as member # required: true # responses: # '201': # content: # application/json: # schema: # $ref: '#/components/schemas/ResourceMember' # description: Member added to Telegraf config # default: # content: # application/json: # schema: # $ref: '#/components/schemas/Error' # description: Unexpected error # summary: Add a member to a Telegraf config # tags: # - Telegrafs # /api/v2/telegrafs/{telegrafID}/members/{userID}: # delete: # operationId: DeleteTelegrafsIDMembersID # parameters: # - $ref: '#/components/parameters/TraceSpan' # - description: The ID of the member to remove. # in: path # name: userID # required: true # schema: # type: string # - description: The Telegraf config ID. # in: path # name: telegrafID # required: true # schema: # type: string # responses: # '204': # description: Member removed # default: # content: # application/json: # schema: # $ref: '#/components/schemas/Error' # description: Unexpected error # summary: Remove a member from a Telegraf config # tags: # - Telegrafs # /api/v2/telegrafs/{telegrafID}/owners: # get: # operationId: GetTelegrafsIDOwners # parameters: # - $ref: '#/components/parameters/TraceSpan' # - description: The Telegraf configuration ID. # in: path # name: telegrafID # required: true # schema: # type: string # responses: # '200': # content: # application/json: # schema: # $ref: '#/components/schemas/ResourceOwners' # description: Returns Telegraf configuration owners as a ResourceOwners list # default: # content: # application/json: # schema: # $ref: '#/components/schemas/Error' # description: Unexpected error # summary: List all owners of a Telegraf configuration # tags: # - Telegrafs # post: # operationId: PostTelegrafsIDOwners # parameters: # - $ref: '#/components/parameters/TraceSpan' # - description: The Telegraf configuration ID. # in: path # name: telegrafID # required: true # schema: # type: string # requestBody: # content: # application/json: # schema: # $ref: '#/components/schemas/AddResourceMemberRequestBody' # description: User to add as owner # required: true # responses: # '201': # content: # application/json: # schema: # $ref: '#/components/schemas/ResourceOwner' # description: Telegraf configuration owner was added. Returns a ResourceOwner that references the User. # default: # content: # application/json: # schema: # $ref: '#/components/schemas/Error' # description: Unexpected error # summary: Add an owner to a Telegraf configuration # tags: # - Telegrafs # /api/v2/telegrafs/{telegrafID}/owners/{userID}: # delete: # operationId: DeleteTelegrafsIDOwnersID # parameters: # - $ref: '#/components/parameters/TraceSpan' # - description: The ID of the owner to remove. # in: path # name: userID # required: true # schema: # type: string # - description: The Telegraf config ID. # in: path # name: telegrafID # required: true # schema: # type: string # responses: # '204': # description: Owner removed # default: # content: # application/json: # schema: # $ref: '#/components/schemas/Error' # description: Unexpected error # summary: Remove an owner from a Telegraf config # tags: # - Telegrafs # /api/v2/templates/apply: # post: # description: | # Applies a template to # create or update a stack of InfluxDB # resources. # The response contains the diff of changes and the stack ID. # Use this endpoint to install an InfluxDB template to an organization. # Provide template URLs or template objects in your request. # To customize which template resources are installed, use the `actions` # parameter. # By default, when you apply a template, InfluxDB installs the template to # create and update stack resources and then generates a diff of the changes. # If you pass `dryRun: true` in the request body, InfluxDB validates the # template and generates the resource diff, but doesn’t make any # changes to your instance. # #### Custom values for templates # - Some templates may contain environment references for custom metadata. # To provide custom values for environment references, pass the _`envRefs`_ # property in the request body. # - Some templates may contain queries that use # [secrets](/influxdb3/cloud-serverless/reference/glossary/#secret). # To provide custom secret values, pass the _`secrets`_ property # in the request body. # Don't expose secret values in templates. # #### Required permissions # - `write` permissions for resource types in the template. # #### Rate limits (with InfluxDB Cloud) # - Adjustable service quotas apply. # For more information, see [limits and adjustable quotas](/influxdb3/cloud-serverless/account-management/limits/). # # operationId: ApplyTemplate # requestBody: # content: # application/json: # examples: # skipKindAction: # summary: Skip all bucket and task resources in the provided templates # value: # actions: # - action: skipKind # properties: # kind: Bucket # - action: skipKind # properties: # kind: Task # orgID: INFLUX_ORG_ID # templates: # - contents: # - '[object Object]': null # skipResourceAction: # summary: Skip specific resources in the provided templates # value: # actions: # - action: skipResource # properties: # kind: Label # resourceTemplateName: foo-001 # - action: skipResource # properties: # kind: Bucket # resourceTemplateName: bar-020 # - action: skipResource # properties: # kind: Bucket # resourceTemplateName: baz-500 # orgID: INFLUX_ORG_ID # templates: # - contents: # - apiVersion: influxdata.com/v2alpha1 # kind: Bucket # metadata: # name: baz-500 # templateObjectEnvRefs: # summary: envRefs for template objects # value: # envRefs: # docker-bucket: MY_DOCKER_BUCKET # docker-spec-1: MY_DOCKER_SPEC # linux-cpu-label: MY_CPU_LABEL # orgID: INFLUX_ORG_ID # templates: # - contents: # - apiVersion: influxdata.com/v2alpha1 # kind: Label # metadata: # name: # envRef: # key: linux-cpu-label # spec: # color: '#326BBA' # name: inputs.cpu # - contents: # - apiVersion: influxdata.com/v2alpha1 # kind: Bucket # metadata: # name: # envRef: # key: docker-bucket # schema: # $ref: '#/components/schemas/TemplateApply' # application/x-jsonnet: # schema: # $ref: '#/components/schemas/TemplateApply' # text/yml: # schema: # $ref: '#/components/schemas/TemplateApply' # description: | # Parameters for applying templates. # required: true # responses: # '200': # content: # application/json: # schema: # $ref: '#/components/schemas/TemplateSummary' # description: | # Success. # The template dry run succeeded. # The response body contains a resource diff of changes that the # template would have made if installed. # No resources were created or updated. # The diff and summary won't contain IDs for resources # that didn't exist at the time of the dry run. # '201': # content: # application/json: # schema: # $ref: '#/components/schemas/TemplateSummary' # description: | # Success. # The template applied successfully. # The response body contains the stack ID, a diff, and a summary. # The diff compares the initial state to the state after the template installation. # The summary contains newly created resources. # '422': # content: # application/json: # schema: # allOf: # - $ref: '#/components/schemas/TemplateSummary' # - properties: # code: # type: string # message: # type: string # required: # - message # - code # type: object # description: | # Unprocessable entity. # The error may indicate one of the following problems: # - The template failed validation. # - You passed a parameter combination that InfluxDB doesn't support. # '500': # content: # application/json: # examples: # createExceedsQuota: # summary: 'InfluxDB Cloud: Creating resource would exceed quota.' # value: # code: internal error # message: "resource_type=\"tasks\" err=\"failed to apply resource\"\n\tmetadata_name=\"alerting-gates-b84003\" err_msg=\"failed to create tasks[\\\"alerting-gates-b84003\\\"]: creating task would exceed quota\"" # schema: # $ref: '#/components/schemas/Error' # description: | # Internal server error. # #### InfluxDB Cloud # - Returns this error if creating one of the template # resources (bucket, dashboard, task, user) exceeds your plan’s # adjustable service quotas. # default: # content: # application/json: # schema: # $ref: '#/components/schemas/Error' # description: Unexpected error # summary: Apply or dry-run a template # tags: # - Templates # x-codeSamples: # - label: 'cURL: Dry run with a remote template' # lang: Shell # source: | # curl --request POST "http://localhost:8086/api/v2/templates/apply" \ # --header "Authorization: Token INFLUX_API_TOKEN" \ # --data @- << EOF # { # "dryRun": true, # "orgID": "INFLUX_ORG_ID", # "remotes": [ # { # "url": "https://raw.githubusercontent.com/influxdata/community-templates/master/linux_system/linux_system.yml" # } # ] # } # EOF # - label: 'cURL: Apply with secret values' # lang: Shell # source: | # curl "http://localhost:8086/api/v2/templates/apply" \ # --header "Authorization: Token INFLUX_API_TOKEN" \ # --data @- << EOF | jq . # { # "orgID": "INFLUX_ORG_ID", # "secrets": { # "SLACK_WEBHOOK": "YOUR_SECRET_WEBHOOK_URL" # }, # "remotes": [ # { # "url": "https://raw.githubusercontent.com/influxdata/community-templates/master/fortnite/fn-template.yml" # } # ] # } # EOF # - label: 'cURL: Apply template objects with environment references' # lang: Shell # source: | # curl --request POST "http://localhost:8086/api/v2/templates/apply" \ # --header "Authorization: Token INFLUX_API_TOKEN" \ # --data @- << EOF # { "orgID": "INFLUX_ORG_ID", # "envRefs": { # "linux-cpu-label": "MY_CPU_LABEL", # "docker-bucket": "MY_DOCKER_BUCKET", # "docker-spec-1": "MY_DOCKER_SPEC" # }, # "templates": [ # { "contents": [{ # "apiVersion": "influxdata.com/v2alpha1", # "kind": "Label", # "metadata": { # "name": { # "envRef": { # "key": "linux-cpu-label" # } # } # }, # "spec": { # "color": "#326BBA", # "name": "inputs.cpu" # } # }] # }, # "templates": [ # { "contents": [{ # "apiVersion": "influxdata.com/v2alpha1", # "kind": "Label", # "metadata": { # "name": { # "envRef": { # "key": "linux-cpu-label" # } # } # }, # "spec": { # "color": "#326BBA", # "name": "inputs.cpu" # } # }] # }, # { "contents": [{ # "apiVersion": "influxdata.com/v2alpha1", # "kind": "Bucket", # "metadata": { # "name": { # "envRef": { # "key": "docker-bucket" # } # } # } # }] # } # ] # } # EOF # /api/v2/templates/export: # post: # operationId: ExportTemplate # requestBody: # content: # application/json: # schema: # oneOf: # - $ref: '#/components/schemas/TemplateExportByID' # - $ref: '#/components/schemas/TemplateExportByName' # description: Export resources as an InfluxDB template. # required: false # responses: # '200': # content: # application/json: # schema: # $ref: '#/components/schemas/Template' # application/x-yaml: # schema: # $ref: '#/components/schemas/Template' # description: The template was created successfully. Returns the newly created template. # default: # content: # application/json: # schema: # $ref: '#/components/schemas/Error' # description: Unexpected error # summary: Export a new template # tags: # - Templates # /api/v2/users: {} # /api/v2/users/{userID}: {} # /api/v2/users/{userID}/password: {} # /api/v2/variables: # get: # operationId: GetVariables # parameters: # - $ref: '#/components/parameters/TraceSpan' # - description: The name of the organization. # in: query # name: org # schema: # type: string # - description: The organization ID. # in: query # name: orgID # schema: # type: string # responses: # '200': # content: # application/json: # schema: # $ref: '#/components/schemas/Variables' # description: A list of variables for an organization. # '400': # $ref: '#/components/responses/GeneralServerError' # description: Invalid request # default: # $ref: '#/components/responses/GeneralServerError' # description: Internal server error # summary: List all variables # tags: # - Variables # post: # operationId: PostVariables # parameters: # - $ref: '#/components/parameters/TraceSpan' # requestBody: # content: # application/json: # schema: # $ref: '#/components/schemas/Variable' # description: Variable to create # required: true # responses: # '201': # content: # application/json: # schema: # $ref: '#/components/schemas/Variable' # description: Variable created # default: # $ref: '#/components/responses/GeneralServerError' # description: Internal server error # summary: Create a variable # tags: # - Variables # /api/v2/variables/{variableID}: # delete: # operationId: DeleteVariablesID # parameters: # - $ref: '#/components/parameters/TraceSpan' # - description: The variable ID. # in: path # name: variableID # required: true # schema: # type: string # responses: # '204': # description: Variable deleted # default: # $ref: '#/components/responses/GeneralServerError' # description: Internal server error # summary: Delete a variable # tags: # - Variables # get: # operationId: GetVariablesID # parameters: # - $ref: '#/components/parameters/TraceSpan' # - description: The variable ID. # in: path # name: variableID # required: true # schema: # type: string # responses: # '200': # content: # application/json: # schema: # $ref: '#/components/schemas/Variable' # description: Variable found # '404': # $ref: '#/components/responses/GeneralServerError' # description: Variable not found # default: # $ref: '#/components/responses/GeneralServerError' # description: Internal server error # summary: Retrieve a variable # tags: # - Variables # patch: # operationId: PatchVariablesID # parameters: # - $ref: '#/components/parameters/TraceSpan' # - description: The variable ID. # in: path # name: variableID # required: true # schema: # type: string # requestBody: # content: # application/json: # schema: # $ref: '#/components/schemas/Variable' # description: Variable update to apply # required: true # responses: # '200': # content: # application/json: # schema: # $ref: '#/components/schemas/Variable' # description: Variable updated # default: # $ref: '#/components/responses/GeneralServerError' # description: Internal server error # summary: Update a variable # tags: # - Variables # put: # operationId: PutVariablesID # parameters: # - $ref: '#/components/parameters/TraceSpan' # - description: The variable ID. # in: path # name: variableID # required: true # schema: # type: string # requestBody: # content: # application/json: # schema: # $ref: '#/components/schemas/Variable' # description: Variable to replace # required: true # responses: # '200': # content: # application/json: # schema: # $ref: '#/components/schemas/Variable' # description: Variable updated # default: # $ref: '#/components/responses/GeneralServerError' # description: Internal server error # summary: Replace a variable # tags: # - Variables # /api/v2/variables/{variableID}/labels: # get: # operationId: GetVariablesIDLabels # parameters: # - $ref: '#/components/parameters/TraceSpan' # - description: The variable ID. # in: path # name: variableID # required: true # schema: # type: string # responses: # '200': # content: # application/json: # schema: # $ref: '#/components/schemas/LabelsResponse' # description: A list of all labels for a variable # default: # content: # application/json: # schema: # $ref: '#/components/schemas/Error' # description: Unexpected error # summary: List all labels for a variable # tags: # - Variables # post: # operationId: PostVariablesIDLabels # parameters: # - $ref: '#/components/parameters/TraceSpan' # - description: The variable ID. # in: path # name: variableID # required: true # schema: # type: string # requestBody: # content: # application/json: # schema: # $ref: '#/components/schemas/LabelMapping' # description: Label to add # required: true # responses: # '201': # content: # application/json: # schema: # $ref: '#/components/schemas/LabelResponse' # description: The newly added label # default: # content: # application/json: # schema: # $ref: '#/components/schemas/Error' # description: Unexpected error # summary: Add a label to a variable # tags: # - Variables # /api/v2/variables/{variableID}/labels/{labelID}: # delete: # operationId: DeleteVariablesIDLabelsID # parameters: # - $ref: '#/components/parameters/TraceSpan' # - description: The variable ID. # in: path # name: variableID # required: true # schema: # type: string # - description: The label ID to delete. # in: path # name: labelID # required: true # schema: # type: string # responses: # '204': # description: Delete has been accepted # '404': # content: # application/json: # schema: # $ref: '#/components/schemas/Error' # description: Variable not found # default: # content: # application/json: # schema: # $ref: '#/components/schemas/Error' # description: Unexpected error # summary: Delete a label from a variable # tags: # - Variables /api/v2/write: post: description: | Writes data to a bucket. Use this endpoint to send data in [line protocol](/influxdb3/cloud-serverless/reference/syntax/line-protocol/) format to InfluxDB. InfluxDB 3 Cloud Serverless does the following when you send a write request: 1. Validates the request. 2. If successful, attempts to [ingest data](/influxdb3/cloud-serverless/reference/internals/durability/#data-ingest) from the request body; otherwise, responds with an [error status](/influxdb3/cloud-serverless/write-data/troubleshoot/#review-http-status-codes). 3. Ingests or rejects data in the batch and returns one of the following HTTP status codes: - `204 No Content`: All data in the batch is ingested. - `400 Bad Request`: Data from the batch was rejected and not written. The response body indicates if a partial write occurred. The response body contains error details about [rejected points](/influxdb3/cloud-serverless/write-data/troubleshoot/#troubleshoot-rejected-points), up to 100 points. Writes are synchronous--the response status indicates the final status of the write and all ingested data is queryable. To ensure that InfluxDB handles writes in the order you request them, wait for the response before you send the next request. #### Write endpoints The `/write` and `/api/v2/write` endpoints are functionally equivalent for writing data to InfluxDB Cloud Serverless. - Use the `/write` endpoint for [InfluxDB v1 parameter compatibility](/influxdb3/cloud-serverless/guides/api-compatibility/v1/). - Use `/api/v2/write` endpoint for [InfluxDB v2 parameter compatibility](/influxdb3/cloud-serverless/guides/api-compatibility/v2/). #### Rate limits _Write_ rate limits apply. For more information, see [limits and adjustable quotas](/influxdb3/cloud-serverless/admin/billing/limits/). #### Related guides - [Get started writing data](/influxdb3/cloud-serverless/get-started/write/) - [Write data with the InfluxDB API](/influxdb3/cloud-serverless/get-started/write/) - [Best practices for writing data](/influxdb3/cloud-serverless/write-data/best-practices/) - [Troubleshoot issues writing data](/influxdb3/cloud-serverless/write-data/troubleshoot/) operationId: PostWrite parameters: - $ref: '#/components/parameters/TraceSpan' - description: | The compression applied to the line protocol in the request payload. To send a gzip payload, pass `Content-Encoding: gzip` header. in: header name: Content-Encoding schema: default: identity description: | Content coding. Use `gzip` for compressed data or `identity` for unmodified, uncompressed data. enum: - gzip - identity type: string - description: | The format of the data in the request body. To send a line protocol payload, pass `Content-Type: text/plain; charset=utf-8`. in: header name: Content-Type schema: default: text/plain; charset=utf-8 description: | `text/plain` is the content type for line protocol. `UTF-8` is the default character set. enum: - text/plain - text/plain; charset=utf-8 type: string - description: | The size of the entity-body, in bytes, sent to InfluxDB. If the length is greater than the `max body` configuration option, the server responds with status code `413`. in: header name: Content-Length schema: description: The length in decimal number of octets. type: integer - description: | The content type that the client can understand. Writes only return a response body if they fail--for example, due to a formatting problem or quota limit. #### InfluxDB 3 Cloud Serverless - Returns only `application/json` for format and limit errors. - Returns only `text/html` for some quota limit errors. #### Related guides - [Troubleshoot issues writing data](/influxdb3/cloud-serverless/write-data/troubleshoot/) in: header name: Accept schema: default: application/json description: Error content type. enum: - application/json type: string - description: | An organization name or ID. InfluxDB 3 Cloud Serverless writes data to the bucket in the organization associated with the authorization (API token); doesn't use the `org` parameter or `orgID` parameter. in: query name: org required: true schema: description: The organization name or ID. type: string - description: | An organization ID. InfluxDB 3 Cloud Serverless writes data to the bucket in the organization associated with the authorization (API token); doesn't use the `org` parameter or `orgID` parameter. in: query name: orgID schema: type: string - description: | A bucket name or ID. InfluxDB writes all points in the batch to the specified bucket. in: query name: bucket required: true schema: description: The bucket name or ID. type: string - description: The precision for unix timestamps in the line protocol batch. in: query name: precision schema: $ref: '#/components/schemas/WritePrecision' requestBody: content: text/plain: examples: plain-utf8: value: | airSensors,sensor_id=TLM0201 temperature=73.97038159354763,humidity=35.23103248356096,co=0.48445310567793615 1630424257000000000 airSensors,sensor_id=TLM0202 temperature=75.30007505999716,humidity=35.651929918691714,co=0.5141876544505826 1630424257000000000 schema: format: byte type: string description: | In the request body, provide data in [line protocol format](/influxdb3/cloud-serverless/reference/syntax/line-protocol/). To send compressed data, do the following: 1. Use [gzip](https://www.gzip.org/) to compress the line protocol data. 2. In your request, send the compressed data and the `Content-Encoding: gzip` header. #### Related guides - [Best practices for optimizing writes](/influxdb3/cloud-serverless/write-data/best-practices/optimize-writes/) required: true responses: '204': description: Success ("No Content"). All data in the batch is written and queryable. '400': description: | Data from the batch was rejected and not written. The response body indicates if a partial write occurred or all data was rejected. If a partial write occurred, then some points from the batch are written and queryable. The response body contains details about the [rejected points](/influxdb3/cloud-serverless/write-data/troubleshoot/#troubleshoot-rejected-points), up to 100 points. content: application/json: examples: rejectedAllPoints: summary: Rejected all points value: code: invalid line: 2 message: 'no data written, errors encountered on line(s): error message for first rejected point error message for second rejected point error message for Nth rejected point (up to 100 rejected points)' partialWriteErrorWithRejectedPoints: summary: Partial write rejects some points value: code: invalid line: 2 message: 'partial write has occurred, errors encountered on line(s): error message for first rejected point error message for second rejected point error message for Nth rejected point (up to 100 rejected points)' schema: $ref: '#/components/schemas/LineProtocolError' '401': $ref: '#/components/responses/AuthorizationError' '404': $ref: '#/components/responses/ResourceNotFoundError' '413': content: application/json: examples: dataExceedsSizeLimitOSS: summary: InfluxDB OSS response value: | {"code":"request too large","message":"unable to read data: points batch is too large"} schema: $ref: '#/components/schemas/LineProtocolLengthError' text/html: examples: dataExceedsSizeLimit: summary: InfluxDB Cloud response value: |