openapi: 3.0.0
info:
  title: InfluxDB OSS API Service
  version: 2.0.0
  description: |
    The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
servers:
  - url: /api/v2
tags:
  - name: Authorizations
    description: |
      Create and manage _API tokens_.
      An _authorization_ contains a list of `read` and `write`
      permissions for organization resources and provides an API token for authentication.
      An authorization belongs to an organization and only contains permissions for that organization.

      An authorization is only visible to the user that created it.
      Optionally, when creating an authorization, you can scope it to a specific user.
      A _user session_ carries all the permissions granted by all the user's authorizations.
      To create a user session, use the [`POST /api/v2/signin`](#operation/PostSignin) endpoint.

      ### Related endpoints

      - [Signin](#tag/Signin)
      - [Signout](#tag/Signout)

      ### Related guides

        - [Authorize API requests](https://docs.influxdata.com/influxdb/v2.3/api-guide/api_intro/#authentication).
        - [Manage API tokens](https://docs.influxdata.com/influxdb/v2.3/security/tokens/).
        - [Assign a token to a specific user](https://docs.influxdata.com/influxdb/v2.3/security/tokens/create-token/).
  - name: Buckets
    description: |
      Store your data in InfluxDB [buckets](https://docs.influxdata.com/influxdb/v2.3/reference/glossary/#bucket).
      A bucket is a named location where time series data is stored. All buckets
      have a [retention period](https://docs.influxdata.com/influxdb/v2.3/reference/glossary/#retention-period),
      a duration of time that each data point persists. InfluxDB drops all
      points with timestamps older than the bucket’s retention period.
      A bucket belongs to an organization.

      ### Related guides

        - [Manage buckets](https://docs.influxdata.com/influxdb/v2.3/organizations/buckets/)
  - name: Debug
    description: |
      Generate profiling and trace reports.

      Use routes under `/debug/pprof` to analyze the Go runtime of InfluxDB.
      These endpoints generate [Go runtime profiles](https://pkg.go.dev/runtime/pprof)
      and **trace** reports.
      **Profiles** are collections of stack traces that show call sequences
      leading to instances of a particular event, such as allocation.

      For more information about **pprof profile** and **trace** reports,
      see the following resources:
        - [Google pprof tool](https://github.com/google/pprof)
        - [Golang diagnostics](https://go.dev/doc/diagnostics)
  - name: Delete
    description: |
      Delete data from an InfluxDB bucket.
  - name: Query
    description: |
      Retrieve data, analyze queries, and get query suggestions.
  - name: Tasks
    description: |
      Process and analyze your data with tasks in the InfluxDB task engine.
      With tasks, you can schedule Flux scripts to query, analyze, modify, and act on data.

      Use the `/api/v2/tasks` endpoints to create and manage tasks, retry task runs, and retrieve run logs.

      #### Related guides

      - [Get started with tasks](https://docs.influxdata.com/influxdb/v2.3/process-data/get-started/)
      - [Common data processing tasks](https://docs.influxdata.com/influxdb/v2.3/process-data/common-tasks/)
  - name: Templates
    description: |
      Export and apply InfluxDB **templates**.
      Manage **stacks** of templated InfluxDB resources.

      InfluxDB templates are prepackaged configurations for
      everything from dashboards and Telegraf to notifications and alerts.
      Use InfluxDB templates to quickly configure a fresh instance of InfluxDB,
      back up your dashboard configuration, or share your configuration with the
      InfluxData community.

      Use the `/api/v2/templates` endpoints to export templates and apply templates.

      **InfluxDB stacks** are stateful InfluxDB templates that let you
      add, update, and remove installed template resources over time, avoid duplicating
      resources when applying the same or similar templates more than once, and
      apply changes to distributed instances of InfluxDB OSS or InfluxDB Cloud.

      Use the `/api/v2/stacks` endpoints to manage installed template resources.

      #### Related guides

      - [InfluxDB stacks](https://docs.influxdata.com/influxdb/v2.3/influxdb-templates/stacks/)
      - [InfluxDB templates](https://docs.influxdata.com/influxdb/v2.3/influxdb-templates/)
  - name: Write
    description: |
      Write time series data to buckets.
  - name: Authentication
    description: |
      Use one of the following schemes to authenticate to the InfluxDB API:

      - [Token authentication](#section/Authentication/TokenAuthentication)
      - [Basic authentication](#section/Authentication/BasicAuthentication)
      - [Querystring authentication](#section/Authentication/QuerystringAuthentication)
      <!-- ReDoc-Inject: <security-definitions> -->
    x-traitTag: true
  - name: Quick start
    x-traitTag: true
    description: |
      See the [**API Quick Start**](https://docs.influxdata.com/influxdb/v2.3/api-guide/api_intro/)
      to get up and running authenticating with tokens, writing to buckets, and querying data.

      [**InfluxDB API client libraries**](https://docs.influxdata.com/influxdb/v2.3/api-guide/client-libraries/)
      are available for popular languages and ready to import into your application.
  - name: Common parameters
    x-traitTag: true
    description: |
      Many InfluxDB API endpoints require parameters to specify resources--for example,
      writing to a **bucket** in an **organization**.

      ### Common query parameters

      | Query parameter          | Value type            | Description                                |
      |:------------------------ |:--------------------- |:-------------------------------------------|
      | `bucket`                 | string                | The bucket name or ID ([find your bucket](https://docs.influxdata.com/influxdb/v2.3/organizations/buckets/view-buckets/). |
      | `bucketID`               | string                | The bucket ID ([find your bucket](https://docs.influxdata.com/influxdb/v2.3/organizations/buckets/view-buckets/). |
      | `org`                    | string                | The organization name or ID ([find your organization](https://docs.influxdata.com/influxdb/v2.3/organizations/view-orgs/). |
      | `orgID`                  | 16-byte string        | The organization ID ([find your organization](https://docs.influxdata.com/influxdb/v2.3/organizations/view-orgs/). |
  - name: Headers
    x-traitTag: true
    description: |
      InfluxDB API endpoints use standard HTTP request and response headers.

      **Note**: Not all operations support all headers.

      ### Request headers

      | Header                   | Value type            | Description                                |
      |:------------------------ |:--------------------- |:-------------------------------------------|
      | `Accept`                 | string                | The content type that the client can understand. |
      | `Authorization`          | string                | The authorization scheme and credential. |
      | `Content-Encoding`       | string                | The compression applied to the line protocol in the request payload. |
      | `Content-Length`         | integer               | The size of the entity-body, in bytes, sent to the database. |
      | `Content-Type`           | string                | The format of the data in the request body. |
  - name: Response codes
    x-traitTag: true
    description: |
      InfluxDB API endpoints use standard HTTP status codes for success and failure responses.
      The response body may include additional details.
      For details about a specific operation's response,
      see **Responses** and **Response Samples** for that operation.

      API operations may return the following HTTP status codes:

      | &nbsp;Code&nbsp; | Status                   | Description      |
      |:-----------:|:------------------------ |:--------------------- |
      | `200`       | Success                  |                       |
      | `204`       | No content               | For a `POST` request, `204` indicates that InfluxDB accepted the request and request data is valid. Asynchronous operations, such as `write`, might not have completed yet. |
      | `400`       | Bad request              | May indicate one of the following: <ul><li>Line protocol is malformed. The response body contains the first malformed line in the data and indicates what was expected. For partial writes, the number of points written and the number of points rejected are also included. For more information, check the `rejected_points` measurement in your `_monitoring` bucket.</li><li>`Authorization` header is missing or malformed or the API token doesn't have permission for the operation.</li></ul> |
      | `401`       | Unauthorized             | May indicate one of the following: <ul><li>`Authorization: Token` header is missing or malformed</li><li>API token value is missing from the header</li><li>API token doesn't have permission. For more information about token types and permissions, see [Manage API tokens](https://docs.influxdata.com/influxdb/latest/security/tokens/)</li></ul> |
      | `404`       | Not found                | Requested resource was not found. `message` in the response body provides details about the requested resource. |
      | `413`       | Request entity too large | Request payload exceeds the size limit. |
      | `422`       | Unprocessable entity     | Request data is invalid. `code` and `message` in the response body provide details about the problem. |
      | `429`       | Too many requests        | API token is temporarily over the request quota. The `Retry-After` header describes when to try the request again. |
      | `500`       | Internal server error    |                       |
      | `503`       | Service unavailable      | Server is temporarily unavailable to process the request. The `Retry-After` header describes when to try the request again. |
x-tagGroups:
  - name: Overview
    tags:
      - Quick start
      - Authentication
      - Headers
      - Response codes
  - name: Popular endpoints
    tags:
      - Data I/O endpoints
      - Security and access endpoints
      - System information endpoints
  - name: All endpoints
    tags: []
paths:
  /signin:
    post:
      operationId: PostSignin
      summary: Create a user session.
      description: 'Authenticates ***Basic Auth*** credentials for a user. If successful, creates a new UI session for the user.'
      tags:
        - Signin
      security:
        - BasicAuthentication: []
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
      responses:
        '204':
          description: Success. User authenticated.
        '401':
          description: Unauthorized access.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: User account is disabled.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          description: Unsuccessful authentication.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /signout:
    post:
      operationId: PostSignout
      summary: Expire the current UI session
      tags:
        - Signout
      description: Expires the current UI session for the user.
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
      responses:
        '204':
          description: Session successfully expired
        '401':
          description: Unauthorized access
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          description: Unsuccessful session expiry
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /ping:
    get:
      operationId: GetPing
      summary: Get the status and version of the instance
      description: Returns the status and InfluxDB version of the instance.
      servers:
        - url: ''
      tags:
        - Ping
        - System information endpoints
      responses:
        '204':
          description: |
            OK.
            Headers contain InfluxDB version information.
          headers:
            X-Influxdb-Build:
              schema:
                type: string
              description: The type of InfluxDB build.
            X-Influxdb-Version:
              schema:
                type: integer
              description: The version of InfluxDB.
    head:
      operationId: HeadPing
      summary: Get the status and version of the instance
      description: Returns the status and InfluxDB version of the instance.
      servers:
        - url: ''
      tags:
        - Ping
      responses:
        '204':
          description: |
            OK.
            Headers contain InfluxDB version information.
          headers:
            X-Influxdb-Build:
              schema:
                type: string
              description: The type of InfluxDB build.
            X-Influxdb-Version:
              schema:
                type: integer
              description: The version of InfluxDB.
  /:
    get:
      operationId: GetRoutes
      summary: List all top level routes
      tags:
        - Routes
        - System information endpoints
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
      responses:
        default:
          description: All routes
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Routes'
  /dbrps:
    get:
      operationId: GetDBRPs
      tags:
        - DBRPs
      summary: List database retention policy mappings
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: query
          name: orgID
          description: Specifies the organization ID to filter on
          schema:
            type: string
        - in: query
          name: org
          description: Specifies the organization name to filter on
          schema:
            type: string
        - in: query
          name: id
          description: Specifies the mapping ID to filter on
          schema:
            type: string
        - in: query
          name: bucketID
          description: Specifies the bucket ID to filter on
          schema:
            type: string
        - in: query
          name: default
          description: Specifies filtering on default
          schema:
            type: boolean
        - in: query
          name: db
          description: Specifies the database to filter on
          schema:
            type: string
        - in: query
          name: rp
          description: Specifies the retention policy to filter on
          schema:
            type: string
      responses:
        '200':
          description: Success. Returns a list of database retention policy mappings.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DBRPs'
        '400':
          description: Bad request. The request has one or more invalid parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    post:
      operationId: PostDBRP
      tags:
        - DBRPs
      summary: Add a database retention policy mapping
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
      requestBody:
        description: The database retention policy mapping to add
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DBRPCreate'
      responses:
        '201':
          description: Created. Returns the created database retention policy mapping.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DBRP'
        '400':
          description: Bad request. The mapping in the request has one or more invalid IDs.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  '/dbrps/{dbrpID}':
    get:
      operationId: GetDBRPsID
      tags:
        - DBRPs
      summary: Retrieve a database retention policy mapping
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: query
          name: orgID
          description: Specifies the organization ID of the mapping
          schema:
            type: string
        - in: query
          name: org
          description: Specifies the organization name of the mapping
          schema:
            type: string
        - in: path
          name: dbrpID
          schema:
            type: string
          required: true
          description: The database retention policy mapping ID
      responses:
        '200':
          description: The database retention policy requested
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DBRPGet'
        '400':
          description: if any of the IDs passed is invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    patch:
      operationId: PatchDBRPID
      tags:
        - DBRPs
      summary: Update a database retention policy mapping
      requestBody:
        description: Database retention policy update to apply
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DBRPUpdate'
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: query
          name: orgID
          description: Specifies the organization ID of the mapping
          schema:
            type: string
        - in: query
          name: org
          description: Specifies the organization name of the mapping
          schema:
            type: string
        - in: path
          name: dbrpID
          schema:
            type: string
          required: true
          description: The database retention policy mapping.
      responses:
        '200':
          description: An updated mapping
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DBRPGet'
        '400':
          description: if any of the IDs passed is invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: The mapping was not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    delete:
      operationId: DeleteDBRPID
      tags:
        - DBRPs
      summary: Delete a database retention policy
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: query
          name: orgID
          description: Specifies the organization ID of the mapping
          schema:
            type: string
        - in: query
          name: org
          description: Specifies the organization name of the mapping
          schema:
            type: string
        - in: path
          name: dbrpID
          schema:
            type: string
          required: true
          description: The database retention policy mapping
      responses:
        '204':
          description: Delete has been accepted
        '400':
          description: if any of the IDs passed is invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /telegraf/plugins:
    get:
      operationId: GetTelegrafPlugins
      tags:
        - Telegraf Plugins
      summary: List all Telegraf plugins
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: query
          name: type
          description: The type of plugin desired.
          schema:
            type: string
      responses:
        '200':
          description: A list of Telegraf plugins.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TelegrafPlugins'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /telegrafs:
    get:
      operationId: GetTelegrafs
      tags:
        - Telegrafs
      summary: List all Telegraf configurations
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: query
          name: orgID
          description: The organization ID the Telegraf config belongs to.
          schema:
            type: string
      responses:
        '200':
          description: A list of Telegraf configurations
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Telegrafs'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    post:
      operationId: PostTelegrafs
      tags:
        - Telegrafs
      summary: Create a Telegraf configuration
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
      requestBody:
        description: Telegraf configuration to create
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TelegrafPluginRequest'
      responses:
        '201':
          description: Telegraf configuration created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Telegraf'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  '/telegrafs/{telegrafID}':
    get:
      operationId: GetTelegrafsID
      tags:
        - Telegrafs
      summary: Retrieve a Telegraf configuration
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: telegrafID
          schema:
            type: string
          required: true
          description: The Telegraf configuration ID.
        - in: header
          name: Accept
          required: false
          schema:
            type: string
            default: application/toml
            enum:
              - application/toml
              - application/json
              - application/octet-stream
      responses:
        '200':
          description: Telegraf configuration details
          content:
            application/toml:
              example: |-
                [agent]
                interval = "10s"
              schema:
                type: string
            application/json:
              schema:
                $ref: '#/components/schemas/Telegraf'
            application/octet-stream:
              example: |-
                [agent]
                interval = "10s"
              schema:
                type: string
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    put:
      operationId: PutTelegrafsID
      tags:
        - Telegrafs
      summary: Update a Telegraf configuration
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: telegrafID
          schema:
            type: string
          required: true
          description: The Telegraf config ID.
      requestBody:
        description: Telegraf configuration update to apply
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TelegrafPluginRequest'
      responses:
        '200':
          description: An updated Telegraf configurations
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Telegraf'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    delete:
      operationId: DeleteTelegrafsID
      tags:
        - Telegrafs
      summary: Delete a Telegraf configuration
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: telegrafID
          schema:
            type: string
          required: true
          description: The Telegraf configuration ID.
      responses:
        '204':
          description: Delete has been accepted
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  '/telegrafs/{telegrafID}/labels':
    get:
      operationId: GetTelegrafsIDLabels
      tags:
        - Telegrafs
      summary: List all labels for a Telegraf config
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: telegrafID
          schema:
            type: string
          required: true
          description: The Telegraf config ID.
      responses:
        '200':
          description: A list of all labels for a Telegraf config
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LabelsResponse'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    post:
      operationId: PostTelegrafsIDLabels
      tags:
        - Telegrafs
      summary: Add a label to a Telegraf config
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: telegrafID
          schema:
            type: string
          required: true
          description: The Telegraf config ID.
      requestBody:
        description: Label to add
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LabelMapping'
      responses:
        '201':
          description: The label added to the Telegraf config
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LabelResponse'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  '/telegrafs/{telegrafID}/labels/{labelID}':
    delete:
      operationId: DeleteTelegrafsIDLabelsID
      tags:
        - Telegrafs
      summary: Delete a label from a Telegraf config
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: telegrafID
          schema:
            type: string
          required: true
          description: The Telegraf config ID.
        - in: path
          name: labelID
          schema:
            type: string
          required: true
          description: The label ID.
      responses:
        '204':
          description: Delete has been accepted
        '404':
          description: Telegraf config not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  '/telegrafs/{telegrafID}/members':
    get:
      operationId: GetTelegrafsIDMembers
      tags:
        - Telegrafs
      summary: List all users with member privileges for a Telegraf config
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: telegrafID
          schema:
            type: string
          required: true
          description: The Telegraf config ID.
      responses:
        '200':
          description: A list of Telegraf config members
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceMembers'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    post:
      operationId: PostTelegrafsIDMembers
      tags:
        - Telegrafs
      summary: Add a member to a Telegraf config
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: telegrafID
          schema:
            type: string
          required: true
          description: The Telegraf config ID.
      requestBody:
        description: User to add as member
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddResourceMemberRequestBody'
      responses:
        '201':
          description: Member added to Telegraf config
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceMember'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  '/telegrafs/{telegrafID}/members/{userID}':
    delete:
      operationId: DeleteTelegrafsIDMembersID
      tags:
        - Telegrafs
      summary: Remove a member from a Telegraf config
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: userID
          schema:
            type: string
          required: true
          description: The ID of the member to remove.
        - in: path
          name: telegrafID
          schema:
            type: string
          required: true
          description: The Telegraf config ID.
      responses:
        '204':
          description: Member removed
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  '/telegrafs/{telegrafID}/owners':
    get:
      operationId: GetTelegrafsIDOwners
      tags:
        - Telegrafs
      summary: List all owners of a Telegraf configuration
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: telegrafID
          schema:
            type: string
          required: true
          description: The Telegraf configuration ID.
      responses:
        '200':
          description: Returns Telegraf configuration owners as a ResourceOwners list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceOwners'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    post:
      operationId: PostTelegrafsIDOwners
      tags:
        - Telegrafs
      summary: Add an owner to a Telegraf configuration
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: telegrafID
          schema:
            type: string
          required: true
          description: The Telegraf configuration ID.
      requestBody:
        description: User to add as owner
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddResourceMemberRequestBody'
      responses:
        '201':
          description: Telegraf configuration owner was added. Returns a ResourceOwner that references the User.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceOwner'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  '/telegrafs/{telegrafID}/owners/{userID}':
    delete:
      operationId: DeleteTelegrafsIDOwnersID
      tags:
        - Telegrafs
      summary: Remove an owner from a Telegraf config
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: userID
          schema:
            type: string
          required: true
          description: The ID of the owner to remove.
        - in: path
          name: telegrafID
          schema:
            type: string
          required: true
          description: The Telegraf config ID.
      responses:
        '204':
          description: Owner removed
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  '/variables/{variableID}/labels':
    get:
      operationId: GetVariablesIDLabels
      tags:
        - Variables
      summary: List all labels for a variable
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: variableID
          schema:
            type: string
          required: true
          description: The variable ID.
      responses:
        '200':
          description: A list of all labels for a variable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LabelsResponse'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    post:
      operationId: PostVariablesIDLabels
      tags:
        - Variables
      summary: Add a label to a variable
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: variableID
          schema:
            type: string
          required: true
          description: The variable ID.
      requestBody:
        description: Label to add
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LabelMapping'
      responses:
        '201':
          description: The newly added label
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LabelResponse'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  '/variables/{variableID}/labels/{labelID}':
    delete:
      operationId: DeleteVariablesIDLabelsID
      tags:
        - Variables
      summary: Delete a label from a variable
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: variableID
          schema:
            type: string
          required: true
          description: The variable ID.
        - in: path
          name: labelID
          schema:
            type: string
          required: true
          description: The label ID to delete.
      responses:
        '204':
          description: Delete has been accepted
        '404':
          description: Variable not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /write:
    post:
      operationId: PostWrite
      tags:
        - Data I/O endpoints
        - Write
      summary: Write data
      description: |
        Writes data to a bucket.

        Use this endpoint to send data in [line protocol](https://docs.influxdata.com/influxdb/v2.3/reference/syntax/line-protocol/) format to InfluxDB.

        #### InfluxDB Cloud

        - Takes the following steps when you send a write request:

          1. Validates the request and queues the write.
          2. If the write is queued, responds with an HTTP `204` status code.
          3. Handles the write asynchronously and reaches eventual consistency.

          An HTTP `2xx` status code acknowledges that the write or delete is queued.
          To ensure that InfluxDB Cloud handles writes and deletes in the order you request them,
          wait for a response before you send the next request.

          Because writes are asynchronous, data might not yet be written
          when you receive the response.

        #### InfluxDB OSS

        - Validates the request, handles the write synchronously,
          and then responds with success or failure.
        - If all points were written successfully, responds with HTTP `204` status code;
          otherwise, returns the first line that failed.

        #### Required permissions

        - `write-buckets` or `write-bucket BUCKET_ID`.

          `BUCKET_ID` is the ID of the destination bucket.

        #### Rate limits (with InfluxDB Cloud)

        `write` rate limits apply.
        For more information, see [limits and adjustable quotas](https://docs.influxdata.com/influxdb/cloud/account-management/limits/).

        #### Related guides

        - [Write data with the InfluxDB API](https://docs.influxdata.com/influxdb/v2.3/write-data/developer-tools/api).
        - [Optimize writes to InfluxDB](https://docs.influxdata.com/influxdb/v2.3/write-data/best-practices/optimize-writes/).
        - [Troubleshoot issues writing data](https://docs.influxdata.com/influxdb/v2.3/write-data/troubleshoot/)
      requestBody:
        description: |
          Data in line protocol format.

          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](https://docs.influxdata.com/influxdb/v2.3/write-data/best-practices/optimize-writes/).
        required: true
        content:
          text/plain:
            schema:
              type: string
              format: byte
            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
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: header
          name: Content-Encoding
          description: |
            The compression applied to the line protocol in the request payload.
            To send a GZIP payload, pass `Content-Encoding: gzip` header.
          schema:
            type: string
            description: |
              Content coding.
              Use `gzip` for compressed data or `identity` for unmodified, uncompressed data.
            default: identity
            enum:
              - gzip
              - identity
        - in: header
          name: Content-Type
          description: |
            The format of the data in the request body.
            To send a line protocol payload, pass `Content-Type: text/plain; charset=utf-8`.
          schema:
            type: string
            description: |
              `text/plain` is the content type for line protocol. `UTF-8` is the default character set.
            default: text/plain; charset=utf-8
            enum:
              - text/plain
              - text/plain; charset=utf-8
        - in: header
          name: Content-Length
          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`.
          schema:
            type: integer
            description: The length in decimal number of octets.
        - in: header
          name: Accept
          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 Cloud

              - Returns only `application/json` for format and limit errors.
              - Returns only `text/html` for some quota limit errors.

            #### InfluxDB OSS

              - Returns only `application/json` for format and limit errors.

            #### Related guides
              - [Troubleshoot issues writing data](https://docs.influxdata.com/influxdb/v2.3/write-data/troubleshoot/).
          schema:
            type: string
            description: Error content type.
            default: application/json
            enum:
              - application/json
        - in: query
          name: org
          description: |
            The destination organization for writes.
            InfluxDB writes all points in the batch to this organization.
            If you pass both `orgID` and `org`, they must both be valid.

            #### InfluxDB Cloud

            - Doesn't require `org` or `orgID`.
            - Writes to the bucket in the organization associated with the authorization (API token).

            #### InfluxDB OSS

            - Requires either `org` or `orgID`.
            - InfluxDB writes all points in the batch to this organization.
          required: true
          schema:
            type: string
            description: The organization name or ID.
        - in: query
          name: orgID
          description: |
            The ID of the destination organization for writes.
            If you pass both `orgID` and `org`, they must both be valid.

            #### InfluxDB Cloud

            - Doesn't require `org` or `orgID`.
            - Writes to the bucket in the organization associated with the authorization (API token).


            #### InfluxDB OSS

            - Requires either `org` or `orgID`.
            - InfluxDB writes all points in the batch to this organization.
          schema:
            type: string
        - in: query
          name: bucket
          description: |
            The destination bucket for writes.
            InfluxDB writes all points in the batch to this bucket.
          required: true
          schema:
            type: string
            description: The bucket name or ID.
        - in: query
          name: precision
          description: The precision for unix timestamps in the line protocol batch.
          schema:
            $ref: '#/components/schemas/WritePrecision'
      responses:
        '204':
          description: |
            Success.

            #### InfluxDB Cloud

            - Validated and queued the request.
            - Handles the write asynchronously - the write might not have completed yet.

            #### InfluxDB OSS

            - Successfully wrote all points in the batch.

            #### Related guides

            - [How to check for write errors](https://docs.influxdata.com/influxdb/v2.3/write-data/troubleshoot/).
        '400':
          description: |
            Bad request. The response body contains detail about the error.

            InfluxDB returns this error if the line protocol data in the request is malformed.
            The response body contains the first malformed line in the data, and indicates what was expected.
            For partial writes, the number of points written and the number of points rejected are also included.
            For more information, check the `rejected_points` measurement in your `_monitoring` bucket.

            #### InfluxDB Cloud

            - Returns this error for bucket schema conflicts.

            #### InfluxDB OSS

            - Returns this error if `org` or `orgID` doesn't match an organization.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LineProtocolError'
              examples:
                measurementSchemaFieldTypeConflict:
                  summary: (Cloud) field type conflict thrown by an explicit bucket schema
                  value:
                    code: invalid
                    message: 'partial write error (2 written): unable to parse ''air_sensor,service=S1,sensor=L1 temperature="90.5",humidity=70.0 1632850122'': schema: field type for field "temperature" not permitted by schema; got String but expected Float'
                orgNotFound:
                  summary: (OSS) organization not found
                  value:
                    code: invalid
                    message: 'failed to decode request body: organization not found'
        '401':
          $ref: '#/components/responses/AuthorizationError'
        '404':
          $ref: '#/components/responses/ResourceNotFoundError'
        '413':
          description: |
            The request payload is too large.
            InfluxDB rejected the batch and did not write any data.

            #### InfluxDB Cloud:

             - Returns this error if the payload exceeds the 50MB size limit.
             - Returns `Content-Type: text/html` for this error.

            #### InfluxDB OSS:

             - Returns this error only if the [Go (golang) `ioutil.ReadAll()`](https://pkg.go.dev/io/ioutil#ReadAll) function raises an error.
             - Returns `Content-Type: application/json` for this error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LineProtocolLengthError'
              examples:
                dataExceedsSizeLimitOSS:
                  summary: InfluxDB OSS response
                  value: |
                    {"code":"request too large","message":"unable to read data: points batch is too large"}
            text/html:
              schema:
                type: string
              examples:
                dataExceedsSizeLimit:
                  summary: InfluxDB Cloud response
                  value: |
                    <html>
                      <head><title>413 Request Entity Too Large</title></head>
                      <body>
                        <center><h1>413 Request Entity Too Large</h1></center>
                        <hr>
                        <center>nginx</center>
                      </body>
                    </html>
        '429':
          description: |
            Too many requests.

            #### InfluxDB Cloud

              - Returns this error if a **read** or **write** request exceeds your plan's [adjustable service quotas](https://docs.influxdata.com/influxdb/cloud/account-management/limits/#adjustable-service-quotas)
                or if a **delete** request exceeds the maximum [global limit](https://docs.influxdata.com/influxdb/cloud/account-management/limits/#global-limits).
              - For rate limits that reset automatically, returns a `Retry-After` header that describes when to try the write again.
              - For limits that can't reset (for example, **cardinality limit**), doesn't return a `Retry-After` header.

              Rates (data-in (writes), queries (reads), and deletes) accrue within a fixed five-minute window.
              Once a rate limit is exceeded, InfluxDB returns an error response until the current five-minute window resets.

            #### InfluxDB OSS

              - Doesn't return this error.
          headers:
            Retry-After:
              description: Non-negative decimal integer indicating seconds to wait before retrying the request.
              schema:
                type: integer
                format: int32
        '500':
          $ref: '#/components/responses/InternalServerError'
        '503':
          description: |
            Service unavailable.

            - Returns this error if
              the server is temporarily unavailable to accept writes.
            - Returns a `Retry-After` header that describes when to try the write again.
          headers:
            Retry-After:
              description: Non-negative decimal integer indicating seconds to wait before retrying the request.
              schema:
                type: integer
                format: int32
        default:
          $ref: '#/components/responses/GeneralServerError'
  /delete:
    post:
      operationId: PostDelete
      tags:
        - Data I/O endpoints
        - Delete
      summary: Delete data
      description: |
        Deletes data from a bucket.

        Use this endpoint to delete points from a bucket in a specified time range.

        #### InfluxDB Cloud

        - Does the following when you send a delete request:

          1. Validates the request and queues the delete.
          2. Returns _success_ if queued; _error_ otherwise.
          3. Handles the delete asynchronously.

        #### InfluxDB OSS

        - Validates the request, handles the delete synchronously,
          and then responds with success or failure.

        #### Required permissions

        - `write-buckets` or `write-bucket BUCKET_ID`.

          `BUCKET_ID` is the ID of the destination bucket.

        #### Rate limits (with InfluxDB Cloud)

        `write` rate limits apply.
        For more information, see [limits and adjustable quotas](https://docs.influxdata.com/influxdb/cloud/account-management/limits/).

        #### Related guides

        - [Delete data](https://docs.influxdata.com/influxdb/v2.3/write-data/delete-data/).
        - Learn how to use [delete predicate syntax](https://docs.influxdata.com/influxdb/v2.3/reference/syntax/delete-predicate/).
        - Learn how InfluxDB handles [deleted tags](https://docs.influxdata.com/flux/v0.x/stdlib/influxdata/influxdb/schema/measurementtagkeys/)
          and [deleted fields](https://docs.influxdata.com/flux/v0.x/stdlib/influxdata/influxdb/schema/measurementfieldkeys/).
      x-codeSamples:
        - lang: Shell
          label: cURL
          source: |
            curl --request POST INFLUX_URL/api/v2/delete?org=INFLUX_ORG&bucket=INFLUX_BUCKET \
              --header 'Authorization: Token INFLUX_API_TOKEN' \
              --header 'Content-Type: application/json' \
              --data '{
                "start": "2020-03-01T00:00:00Z",
                "stop": "2020-11-14T00:00:00Z",
                "predicate": "tag1=\"value1\" and (tag2=\"value2\" and tag3!=\"value3\")"
              }'
      requestBody:
        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.

          #### Related guides

          - [Delete data](https://docs.influxdata.com/influxdb/v2.3/write-data/delete-data/).
          - Learn how to use [delete predicate syntax](https://docs.influxdata.com/influxdb/v2.3/reference/syntax/delete-predicate/).
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeletePredicateRequest'
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: query
          name: org
          description: |
            The organization to delete data from.
            If you pass both `orgID` and `org`, they must both be valid.

            #### InfluxDB Cloud

            - Doesn't require `org` or `orgID`.
            - Deletes data from the bucket in the organization associated with the authorization (API token).

            #### InfluxDB OSS

            - Requires either `org` or `orgID`.
          schema:
            type: string
            description: The organization name or ID.
        - in: query
          name: bucket
          description: |
            The name or ID of the bucket to delete data from.
            If you pass both `bucket` and `bucketID`, `bucketID` takes precedence.
          schema:
            type: string
            description: The bucket name or ID.
        - in: query
          name: orgID
          description: |
            The ID of the organization to delete data from.
            If you pass both `orgID` and `org`, they must both be valid.

            #### InfluxDB Cloud

            - Doesn't require `org` or `orgID`.
            - Deletes data from the bucket in the organization associated with the authorization (API token).

            #### InfluxDB OSS

            - Requires either `org` or `orgID`.
          schema:
            type: string
            description: The organization ID.
        - in: query
          name: bucketID
          description: |
            The ID of the bucket to delete data from.
            If you pass both `bucket` and `bucketID`, `bucketID` takes precedence.
          schema:
            type: string
            description: The bucket ID.
      responses:
        '204':
          description: |
            Success.

            #### InfluxDB Cloud

            - Validated and queued the request.
            - Handles the delete asynchronously - the deletion might not have completed yet.

            An HTTP `2xx` status code acknowledges that the write or delete is queued.
            To ensure that InfluxDB Cloud handles writes and deletes in the order you request them,
            wait for a response before you send the next request.

            Because writes are asynchronous, data might not yet be written
            when you receive the response.

            #### InfluxDB OSS

            - Deleted the data.
        '400':
          description: |
            Bad request.
            The response body contains detail about the error.

            #### InfluxDB OSS

            - Returns this error if `org` or `orgID` doesn't match an organization.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                orgNotFound:
                  summary: Organization not found
                  value:
                    code: invalid
                    message: 'failed to decode request body: organization not found'
        '401':
          $ref: '#/components/responses/AuthorizationError'
        '404':
          $ref: '#/components/responses/ResourceNotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
        default:
          $ref: '#/components/responses/GeneralServerError'
  /labels:
    post:
      operationId: PostLabels
      tags:
        - Labels
      summary: Create a label
      requestBody:
        description: The label to create.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LabelCreateRequest'
      responses:
        '201':
          description: Success. The label was created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LabelResponse'
        '500':
          $ref: '#/components/responses/InternalServerError'
        default:
          $ref: '#/components/responses/GeneralServerError'
    get:
      operationId: GetLabels
      tags:
        - Labels
      summary: List all labels
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: query
          name: orgID
          description: The organization ID.
          schema:
            type: string
      responses:
        '200':
          description: Success. The response body contains a list of labels.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LabelsResponse'
        '500':
          $ref: '#/components/responses/InternalServerError'
        default:
          $ref: '#/components/responses/GeneralServerError'
  '/labels/{labelID}':
    get:
      operationId: GetLabelsID
      tags:
        - Labels
      summary: Retrieve a label
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: labelID
          schema:
            type: string
          required: true
          description: The ID of the label to update.
      responses:
        '200':
          description: Success. The response body contains the label.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LabelResponse'
        '500':
          $ref: '#/components/responses/InternalServerError'
        default:
          $ref: '#/components/responses/GeneralServerError'
    patch:
      operationId: PatchLabelsID
      tags:
        - Labels
      summary: Update a label
      requestBody:
        description: A label update.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LabelUpdate'
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: labelID
          schema:
            type: string
          required: true
          description: The ID of the label to update.
      responses:
        '200':
          description: Success. The response body contains the updated label.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LabelResponse'
        '401':
          $ref: '#/components/responses/AuthorizationError'
        '404':
          $ref: '#/components/responses/ResourceNotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
        default:
          $ref: '#/components/responses/GeneralServerError'
    delete:
      operationId: DeleteLabelsID
      tags:
        - Labels
      summary: Delete a label
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: labelID
          schema:
            type: string
          required: true
          description: The ID of the label to delete.
      responses:
        '204':
          description: Success. The delete was accepted.
        '401':
          $ref: '#/components/responses/AuthorizationError'
        '404':
          $ref: '#/components/responses/ResourceNotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
        default:
          $ref: '#/components/responses/GeneralServerError'
  '/dashboards/{dashboardID}':
    get:
      operationId: GetDashboardsID
      tags:
        - Dashboards
      summary: Retrieve a dashboard
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: dashboardID
          schema:
            type: string
          required: true
          description: The ID of the dashboard to update.
        - in: query
          name: include
          required: false
          schema:
            type: string
            enum:
              - properties
          description: 'If `properties`, includes the cell view properties in the response.'
      responses:
        '200':
          description: Retrieve a single dashboard
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Dashboard'
                  - $ref: '#/components/schemas/DashboardWithViewProperties'
        '404':
          description: Dashboard not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    patch:
      operationId: PatchDashboardsID
      tags:
        - Dashboards
      summary: Update a dashboard
      requestBody:
        description: Patching of a dashboard
        required: true
        content:
          application/json:
            schema:
              type: object
              title: PatchDashboardRequest
              properties:
                name:
                  description: 'optional, when provided will replace the name'
                  type: string
                description:
                  description: 'optional, when provided will replace the description'
                  type: string
                cells:
                  description: 'optional, when provided will replace all existing cells with the cells provided'
                  $ref: '#/components/schemas/CellWithViewProperties'
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: dashboardID
          schema:
            type: string
          required: true
          description: The ID of the dashboard to update.
      responses:
        '200':
          description: Updated dashboard
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Dashboard'
        '404':
          description: Dashboard not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    delete:
      operationId: DeleteDashboardsID
      tags:
        - Dashboards
      summary: Delete a dashboard
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: dashboardID
          schema:
            type: string
          required: true
          description: The ID of the dashboard to update.
      responses:
        '204':
          description: Delete has been accepted
        '404':
          description: Dashboard not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  '/dashboards/{dashboardID}/cells':
    put:
      operationId: PutDashboardsIDCells
      tags:
        - Cells
        - Dashboards
      summary: Replace cells in a dashboard
      description: Replaces all cells in a dashboard. This is used primarily to update the positional information of all cells.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Cells'
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: dashboardID
          schema:
            type: string
          required: true
          description: The ID of the dashboard to update.
      responses:
        '201':
          description: Replaced dashboard cells
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Dashboard'
        '404':
          description: Dashboard not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    post:
      operationId: PostDashboardsIDCells
      tags:
        - Cells
        - Dashboards
      summary: Create a dashboard cell
      requestBody:
        description: Cell that will be added
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCell'
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: dashboardID
          schema:
            type: string
          required: true
          description: The ID of the dashboard to update.
      responses:
        '201':
          description: Cell successfully added
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Cell'
        '404':
          description: Dashboard not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  '/dashboards/{dashboardID}/cells/{cellID}':
    patch:
      operationId: PatchDashboardsIDCellsID
      tags:
        - Cells
        - Dashboards
      summary: Update the non-positional information related to a cell
      description: Updates the non positional information related to a cell. Updates to a single cell's positional data could cause grid conflicts.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CellUpdate'
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: dashboardID
          schema:
            type: string
          required: true
          description: The ID of the dashboard to update.
        - in: path
          name: cellID
          schema:
            type: string
          required: true
          description: The ID of the cell to update.
      responses:
        '200':
          description: Updated dashboard cell
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Cell'
        '404':
          description: Cell or dashboard not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    delete:
      operationId: DeleteDashboardsIDCellsID
      tags:
        - Cells
        - Dashboards
      summary: Delete a dashboard cell
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: dashboardID
          schema:
            type: string
          required: true
          description: The ID of the dashboard to delete.
        - in: path
          name: cellID
          schema:
            type: string
          required: true
          description: The ID of the cell to delete.
      responses:
        '204':
          description: Cell successfully deleted
        '404':
          description: Cell or dashboard not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  '/dashboards/{dashboardID}/cells/{cellID}/view':
    get:
      operationId: GetDashboardsIDCellsIDView
      tags:
        - Cells
        - Dashboards
        - Views
      summary: Retrieve the view for a cell
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: dashboardID
          schema:
            type: string
          required: true
          description: The dashboard ID.
        - in: path
          name: cellID
          schema:
            type: string
          required: true
          description: The cell ID.
      responses:
        '200':
          description: A dashboard cells view
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/View'
        '404':
          description: Cell or dashboard not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    patch:
      operationId: PatchDashboardsIDCellsIDView
      tags:
        - Cells
        - Dashboards
        - Views
      summary: Update the view for a cell
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/View'
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: dashboardID
          schema:
            type: string
          required: true
          description: The ID of the dashboard to update.
        - in: path
          name: cellID
          schema:
            type: string
          required: true
          description: The ID of the cell to update.
      responses:
        '200':
          description: Updated cell view
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/View'
        '404':
          description: Cell or dashboard not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  '/dashboards/{dashboardID}/labels':
    get:
      operationId: GetDashboardsIDLabels
      tags:
        - Dashboards
      summary: List all labels for a dashboard
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: dashboardID
          schema:
            type: string
          required: true
          description: The dashboard ID.
      responses:
        '200':
          description: A list of all labels for a dashboard
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LabelsResponse'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    post:
      operationId: PostDashboardsIDLabels
      tags:
        - Dashboards
      summary: Add a label to a dashboard
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: dashboardID
          schema:
            type: string
          required: true
          description: The dashboard ID.
      requestBody:
        description: Label to add
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LabelMapping'
      responses:
        '201':
          description: The label added to the dashboard
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LabelResponse'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  '/dashboards/{dashboardID}/labels/{labelID}':
    delete:
      operationId: DeleteDashboardsIDLabelsID
      tags:
        - Dashboards
      summary: Delete a label from a dashboard
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: dashboardID
          schema:
            type: string
          required: true
          description: The dashboard ID.
        - in: path
          name: labelID
          schema:
            type: string
          required: true
          description: The ID of the label to delete.
      responses:
        '204':
          description: Delete has been accepted
        '404':
          description: Dashboard not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  '/dashboards/{dashboardID}/members':
    get:
      operationId: GetDashboardsIDMembers
      tags:
        - Dashboards
      summary: List all dashboard members
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: dashboardID
          schema:
            type: string
          required: true
          description: The dashboard ID.
      responses:
        '200':
          description: A list of users who have member privileges for a dashboard
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceMembers'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    post:
      operationId: PostDashboardsIDMembers
      tags:
        - Dashboards
      summary: Add a member to a dashboard
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: dashboardID
          schema:
            type: string
          required: true
          description: The dashboard ID.
      requestBody:
        description: User to add as member
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddResourceMemberRequestBody'
      responses:
        '201':
          description: Added to dashboard members
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceMember'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  '/dashboards/{dashboardID}/members/{userID}':
    delete:
      operationId: DeleteDashboardsIDMembersID
      tags:
        - Dashboards
      summary: Remove a member from a dashboard
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: userID
          schema:
            type: string
          required: true
          description: The ID of the member to remove.
        - in: path
          name: dashboardID
          schema:
            type: string
          required: true
          description: The dashboard ID.
      responses:
        '204':
          description: Member removed
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  '/dashboards/{dashboardID}/owners':
    get:
      operationId: GetDashboardsIDOwners
      tags:
        - Dashboards
      summary: List all dashboard owners
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: dashboardID
          schema:
            type: string
          required: true
          description: The dashboard ID.
      responses:
        '200':
          description: A list of users who have owner privileges for a dashboard
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceOwners'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    post:
      operationId: PostDashboardsIDOwners
      tags:
        - Dashboards
      summary: Add an owner to a dashboard
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: dashboardID
          schema:
            type: string
          required: true
          description: The dashboard ID.
      requestBody:
        description: User to add as owner
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddResourceMemberRequestBody'
      responses:
        '201':
          description: Added to dashboard owners
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceOwner'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  '/dashboards/{dashboardID}/owners/{userID}':
    delete:
      operationId: DeleteDashboardsIDOwnersID
      tags:
        - Dashboards
      summary: Remove an owner from a dashboard
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: userID
          schema:
            type: string
          required: true
          description: The ID of the owner to remove.
        - in: path
          name: dashboardID
          schema:
            type: string
          required: true
          description: The dashboard ID.
      responses:
        '204':
          description: Owner removed
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /query/ast:
    post:
      operationId: PostQueryAst
      tags:
        - Query
      summary: Generate a query Abstract Syntax Tree (AST)
      description: |
        Analyzes a Flux query and returns a complete package source [Abstract Syntax
        Tree (AST)](https://docs.influxdata.com/influxdb/v2.3/reference/glossary/#abstract-syntax-tree-ast)
        for the query.

        Use this endpoint for deep query analysis such as debugging unexpected query
        results.

        A Flux query AST provides a semantic, tree-like representation with contextual
        information about the query. The AST illustrates how the query is distributed
        into different components for execution.

        #### Limitations

        -  The endpoint doesn't validate values in the query--for example:

            The following sample Flux query has correct syntax, but contains an incorrect `from()` property key:

            ```js
            from(foo: "iot_center")
                |> range(start: -90d)
                |> filter(fn: (r) => r._measurement == "environment")
            ```

            The following sample JSON shows how to pass the query in the request body:

            ```js
            from(foo: "iot_center")
            |> range(start: -90d)
            |> filter(fn: (r) => r._measurement == "environment")
            ```

            The following code sample shows how to pass the query as JSON in the request body:
            ```json
            { "query": "from(foo: \"iot_center\")\
                            |> range(start: -90d)\
                            |> filter(fn: (r) => r._measurement == \"environment\")"
            }
            ```

            Passing this to `/api/v2/query/ast` will return a successful response
            with a generated AST.
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: header
          name: Content-Type
          schema:
            type: string
            enum:
              - application/json
      requestBody:
        description: The Flux query to analyze.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LanguageRequest'
      x-codeSamples:
        - lang: Shell
          label: 'cURL: Analyze and generate AST for the query'
          source: |
            curl --request POST "http://localhost:8086/api/v2/query/ast" \
              --header 'Content-Type: application/json' \
              --header 'Accept: application/json' \
              --header "Authorization: Token INFLUX_TOKEN" \
              --data-binary @- << EOL
                  {
                    "query": "from(bucket: \"INFLUX_BUCKET_NAME\")\
                    |> range(start: -5m)\
                    |> filter(fn: (r) => r._measurement == \"example-measurement\")"
                  }
            EOL
      responses:
        '200':
          description: |
            Success.
            The response body contains an Abstract Syntax Tree (AST) of the Flux query.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ASTResponse'
              examples:
                successResponse:
                  value:
                    ast:
                      type: Package
                      package: main
                      files:
                        - type: File
                          location:
                            start:
                              line: 1
                              column: 1
                            end:
                              line: 1
                              column: 109
                            source: 'from(bucket: "example-bucket") |> range(start: -5m) |> filter(fn: (r) => r._measurement == "example-measurement")'
                          metadata: parser-type=rust
                          package: null
                          imports: null
                          body:
                            - type: ExpressionStatement
                              location:
                                start:
                                  line: 1
                                  column: 1
                                end:
                                  line: 1
                                  column: 109
                                source: 'from(bucket: "example-bucket") |> range(start: -5m) |> filter(fn: (r) => r._measurement == "example-measurement")'
                              expression:
                                type: PipeExpression
                                location:
                                  start:
                                    line: 1
                                    column: 1
                                  end:
                                    line: 1
                                    column: 109
                                  source: 'from(bucket: "example-bucket") |> range(start: -5m) |> filter(fn: (r) => r._measurement == "example-measurement")'
                                argument:
                                  type: PipeExpression
                                  location:
                                    start:
                                      line: 1
                                      column: 1
                                    end:
                                      line: 1
                                      column: 47
                                    source: 'from(bucket: "example-bucket") |> range(start: -5m)'
                                  argument:
                                    type: CallExpression
                                    location:
                                      start:
                                        line: 1
                                        column: 1
                                      end:
                                        line: 1
                                        column: 26
                                      source: 'from(bucket: "example-bucket")'
                                    callee:
                                      type: Identifier
                                      location:
                                        start:
                                          line: 1
                                          column: 1
                                        end:
                                          line: 1
                                          column: 5
                                        source: from
                                      name: from
                                    arguments:
                                      - type: ObjectExpression
                                        location:
                                          start:
                                            line: 1
                                            column: 6
                                          end:
                                            line: 1
                                            column: 25
                                          source: 'bucket: "example-bucket"'
                                        properties:
                                          - type: Property
                                            location:
                                              start:
                                                line: 1
                                                column: 6
                                              end:
                                                line: 1
                                                column: 25
                                              source: 'bucket: "example-bucket"'
                                            key:
                                              type: Identifier
                                              location:
                                                start:
                                                  line: 1
                                                  column: 6
                                                end:
                                                  line: 1
                                                  column: 12
                                                source: bucket
                                              name: bucket
                                            value:
                                              type: StringLiteral
                                              location:
                                                start:
                                                  line: 1
                                                  column: 14
                                                end:
                                                  line: 1
                                                  column: 25
                                                source: '"example-bucket"'
                                              value: example-bucket
                                  call:
                                    type: CallExpression
                                    location:
                                      start:
                                        line: 1
                                        column: 30
                                      end:
                                        line: 1
                                        column: 47
                                      source: 'range(start: -5m)'
                                    callee:
                                      type: Identifier
                                      location:
                                        start:
                                          line: 1
                                          column: 30
                                        end:
                                          line: 1
                                          column: 35
                                        source: range
                                      name: range
                                    arguments:
                                      - type: ObjectExpression
                                        location:
                                          start:
                                            line: 1
                                            column: 36
                                          end:
                                            line: 1
                                            column: 46
                                          source: 'start: -5m'
                                        properties:
                                          - type: Property
                                            location:
                                              start:
                                                line: 1
                                                column: 36
                                              end:
                                                line: 1
                                                column: 46
                                              source: 'start: -5m'
                                            key:
                                              type: Identifier
                                              location:
                                                start:
                                                  line: 1
                                                  column: 36
                                                end:
                                                  line: 1
                                                  column: 41
                                                source: start
                                              name: start
                                            value:
                                              type: UnaryExpression
                                              location:
                                                start:
                                                  line: 1
                                                  column: 43
                                                end:
                                                  line: 1
                                                  column: 46
                                                source: '-5m'
                                              operator: '-'
                                              argument:
                                                type: DurationLiteral
                                                location:
                                                  start:
                                                    line: 1
                                                    column: 44
                                                  end:
                                                    line: 1
                                                    column: 46
                                                  source: 5m
                                                values:
                                                  - magnitude: 5
                                                    unit: m
                                call:
                                  type: CallExpression
                                  location:
                                    start:
                                      line: 1
                                      column: 51
                                    end:
                                      line: 1
                                      column: 109
                                    source: 'filter(fn: (r) => r._measurement == "example-measurement")'
                                  callee:
                                    type: Identifier
                                    location:
                                      start:
                                        line: 1
                                        column: 51
                                      end:
                                        line: 1
                                        column: 57
                                      source: filter
                                    name: filter
                                  arguments:
                                    - type: ObjectExpression
                                      location:
                                        start:
                                          line: 1
                                          column: 58
                                        end:
                                          line: 1
                                          column: 108
                                        source: 'fn: (r) => r._measurement == "example-measurement"'
                                      properties:
                                        - type: Property
                                          location:
                                            start:
                                              line: 1
                                              column: 58
                                            end:
                                              line: 1
                                              column: 108
                                            source: 'fn: (r) => r._measurement == "example-measurement"'
                                          key:
                                            type: Identifier
                                            location:
                                              start:
                                                line: 1
                                                column: 58
                                              end:
                                                line: 1
                                                column: 60
                                              source: fn
                                            name: fn
                                          value:
                                            type: FunctionExpression
                                            location:
                                              start:
                                                line: 1
                                                column: 62
                                              end:
                                                line: 1
                                                column: 108
                                              source: (r) => r._measurement == "example-measurement"
                                            params:
                                              - type: Property
                                                location:
                                                  start:
                                                    line: 1
                                                    column: 63
                                                  end:
                                                    line: 1
                                                    column: 64
                                                  source: r
                                                key:
                                                  type: Identifier
                                                  location:
                                                    start:
                                                      line: 1
                                                      column: 63
                                                    end:
                                                      line: 1
                                                      column: 64
                                                    source: r
                                                  name: r
                                                value: null
                                            body:
                                              type: BinaryExpression
                                              location:
                                                start:
                                                  line: 1
                                                  column: 69
                                                end:
                                                  line: 1
                                                  column: 108
                                                source: r._measurement == "example-measurement"
                                              operator: '=='
                                              left:
                                                type: MemberExpression
                                                location:
                                                  start:
                                                    line: 1
                                                    column: 69
                                                  end:
                                                    line: 1
                                                    column: 83
                                                  source: r._measurement
                                                object:
                                                  type: Identifier
                                                  location:
                                                    start:
                                                      line: 1
                                                      column: 69
                                                    end:
                                                      line: 1
                                                      column: 70
                                                    source: r
                                                  name: r
                                                property:
                                                  type: Identifier
                                                  location:
                                                    start:
                                                      line: 1
                                                      column: 71
                                                    end:
                                                      line: 1
                                                      column: 83
                                                    source: _measurement
                                                  name: _measurement
                                              right:
                                                type: StringLiteral
                                                location:
                                                  start:
                                                    line: 1
                                                    column: 87
                                                  end:
                                                    line: 1
                                                    column: 108
                                                  source: '"example-measurement"'
                                                value: example-measurement
        '400':
          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:
                type: string
                example: invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                invalidASTValue:
                  summary: Invalid AST
                  description: |
                    If the request body contains a missing property key in `from()`,
                    returns `invalid` and problem detail.
                  value:
                    code: invalid
                    message: 'invalid AST: loc 1:6-1:19: missing property key'
        default:
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /query/suggestions:
    get:
      operationId: GetQuerySuggestions
      tags:
        - Query
      summary: Retrieve Flux query suggestions
      description: |
        Retrieves a list of Flux query suggestions. Each suggestion contains a
        [Flux function](https://docs.influxdata.com/flux/v0.x/stdlib/all-functions/)
        name and parameters.

        Use this endpoint to retrieve a list of Flux query suggestions used in the
        InfluxDB Flux Query Builder. Helper function names have an underscore (`_`)
        prefix and aren't meant to be used directly in queries--for example:

        - **Recommended**:  Use `top(n, columns=["_value"], tables=<-)` to sort
          on a column and keep the top n records instead of `_sortLimit_`.
          `top` uses the `_sortLimit` helper function.

        #### Limitations

        - Using `/api/v2/query/suggestions/` (note the trailing slash) with cURL
        will result in a HTTP `301 Moved Permanently` status code. Please use
        `/api/v2/query/suggestions` without a trailing slash.

        - When writing a query, avoid using `_functionName()` helper functions
        exposed by this endpoint.

        #### Related Guides

        - [List of all Flux functions](https://docs.influxdata.com/influxdb/v2.3/flux/v0.x/stdlib/all-functions/).
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
      responses:
        '200':
          description: |
            Success.
            The response body contains a list of Flux query suggestions--function
            names used in the Flux Query Builder autocomplete suggestions.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FluxSuggestions'
              examples:
                successResponse:
                  value:
                    funcs:
                      - name: _fillEmpty
                        params:
                          createEmpty: bool
                          tables: stream
                      - name: _highestOrLowest
                        params:
                          _sortLimit: function
                          column: invalid
                          groupColumns: array
                          'n': invalid
                          reducer: function
                          tables: stream
                      - name: _hourSelection
                        params:
                          location: object
                          start: int
                          stop: int
                          tables: stream
                          timeColumn: string
                      - name: _sortLimit
                        params:
                          columns: array
                          desc: bool
                          'n': int
                          tables: stream
                      - name: _window
                        params:
                          createEmpty: bool
                          every: duration
                          location: object
                          offset: duration
                          period: duration
                          startColumn: string
                          stopColumn: string
                          tables: stream
                          timeColumn: string
                      - name: aggregateWindow
                        params:
                          column: invalid
                          createEmpty: bool
                          every: duration
                          fn: function
                          location: object
                          offset: duration
                          period: duration
                          tables: stream
                          timeDst: string
                          timeSrc: string
                      - name: bool
                        params:
                          v: invalid
                      - name: bottom
                        params:
                          columns: array
                          'n': int
                          tables: stream
                      - name: buckets
                        params:
                          host: string
                          org: string
                          orgID: string
                          token: string
                      - name: bytes
                        params:
                          v: invalid
                      - name: cardinality
                        params:
                          bucket: string
                          bucketID: string
                          host: string
                          org: string
                          orgID: string
                          predicate: function
                          start: invalid
                          stop: invalid
                          token: string
                      - name: chandeMomentumOscillator
                        params:
                          columns: array
                          'n': int
                          tables: stream
                      - name: columns
                        params:
                          column: string
                          tables: stream
                      - name: contains
                        params:
                          set: array
                          value: invalid
                      - name: count
                        params:
                          column: string
                          tables: stream
                      - name: cov
                        params:
                          'on': array
                          pearsonr: bool
                          x: invalid
                          'y': invalid
                      - name: covariance
                        params:
                          columns: array
                          pearsonr: bool
                          tables: stream
                          valueDst: string
                      - name: cumulativeSum
                        params:
                          columns: array
                          tables: stream
                      - name: derivative
                        params:
                          columns: array
                          initialZero: bool
                          nonNegative: bool
                          tables: stream
                          timeColumn: string
                          unit: duration
                      - name: die
                        params:
                          msg: string
                      - name: difference
                        params:
                          columns: array
                          initialZero: bool
                          keepFirst: bool
                          nonNegative: bool
                          tables: stream
                      - name: display
                        params:
                          v: invalid
                      - name: distinct
                        params:
                          column: string
                          tables: stream
                      - name: doubleEMA
                        params:
                          'n': int
                          tables: stream
                      - name: drop
                        params:
                          columns: array
                          fn: function
                          tables: stream
                      - name: duplicate
                        params:
                          as: string
                          column: string
                          tables: stream
                      - name: duration
                        params:
                          v: invalid
                      - name: elapsed
                        params:
                          columnName: string
                          tables: stream
                          timeColumn: string
                          unit: duration
                      - name: exponentialMovingAverage
                        params:
                          'n': int
                          tables: stream
                      - name: fill
                        params:
                          column: string
                          tables: stream
                          usePrevious: bool
                          value: invalid
                      - name: filter
                        params:
                          fn: function
                          onEmpty: string
                          tables: stream
                      - name: findColumn
                        params:
                          column: string
                          fn: function
                          tables: stream
                      - name: findRecord
                        params:
                          fn: function
                          idx: int
                          tables: stream
                      - name: first
                        params:
                          column: string
                          tables: stream
                      - name: float
                        params:
                          v: invalid
                      - name: from
                        params:
                          bucket: string
                          bucketID: string
                          host: string
                          org: string
                          orgID: string
                          token: string
                      - name: getColumn
                        params:
                          column: string
                      - name: getRecord
                        params:
                          idx: int
                      - name: group
                        params:
                          columns: array
                          mode: string
                          tables: stream
                      - name: highestAverage
                        params:
                          column: string
                          groupColumns: array
                          'n': int
                          tables: stream
                      - name: highestCurrent
                        params:
                          column: string
                          groupColumns: array
                          'n': int
                          tables: stream
                      - name: highestMax
                        params:
                          column: string
                          groupColumns: array
                          'n': int
                          tables: stream
                      - name: histogram
                        params:
                          bins: array
                          column: string
                          countColumn: string
                          normalize: bool
                          tables: stream
                          upperBoundColumn: string
                      - name: histogramQuantile
                        params:
                          countColumn: string
                          minValue: float
                          quantile: float
                          tables: stream
                          upperBoundColumn: string
                          valueColumn: string
                      - name: holtWinters
                        params:
                          column: string
                          interval: duration
                          'n': int
                          seasonality: int
                          tables: stream
                          timeColumn: string
                          withFit: bool
                      - name: hourSelection
                        params:
                          location: object
                          start: int
                          stop: int
                          tables: stream
                          timeColumn: string
                      - name: increase
                        params:
                          columns: array
                          tables: stream
                      - name: int
                        params:
                          v: invalid
                      - name: integral
                        params:
                          column: string
                          interpolate: string
                          tables: stream
                          timeColumn: string
                          unit: duration
                      - name: join
                        params:
                          method: string
                          'on': array
                          tables: invalid
                      - name: kaufmansAMA
                        params:
                          column: string
                          'n': int
                          tables: stream
                      - name: kaufmansER
                        params:
                          'n': int
                          tables: stream
                      - name: keep
                        params:
                          columns: array
                          fn: function
                          tables: stream
                      - name: keyValues
                        params:
                          keyColumns: array
                          tables: stream
                      - name: keys
                        params:
                          column: string
                          tables: stream
                      - name: last
                        params:
                          column: string
                          tables: stream
                      - name: length
                        params:
                          arr: array
                      - name: limit
                        params:
                          'n': int
                          offset: int
                          tables: stream
                      - name: linearBins
                        params:
                          count: int
                          infinity: bool
                          start: float
                          width: float
                      - name: logarithmicBins
                        params:
                          count: int
                          factor: float
                          infinity: bool
                          start: float
                      - name: lowestAverage
                        params:
                          column: string
                          groupColumns: array
                          'n': int
                          tables: stream
                      - name: lowestCurrent
                        params:
                          column: string
                          groupColumns: array
                          'n': int
                          tables: stream
                      - name: lowestMin
                        params:
                          column: string
                          groupColumns: array
                          'n': int
                          tables: stream
                      - name: map
                        params:
                          fn: function
                          mergeKey: bool
                          tables: stream
                      - name: max
                        params:
                          column: string
                          tables: stream
                      - name: mean
                        params:
                          column: string
                          tables: stream
                      - name: median
                        params:
                          column: string
                          compression: float
                          method: string
                          tables: stream
                      - name: min
                        params:
                          column: string
                          tables: stream
                      - name: mode
                        params:
                          column: string
                          tables: stream
                      - name: movingAverage
                        params:
                          'n': int
                          tables: stream
                      - name: now
                        params: {}
                      - name: pearsonr
                        params:
                          'on': array
                          x: invalid
                          'y': invalid
                      - name: pivot
                        params:
                          columnKey: array
                          rowKey: array
                          tables: stream
                          valueColumn: string
                      - name: quantile
                        params:
                          column: string
                          compression: float
                          method: string
                          q: float
                          tables: stream
                      - name: range
                        params:
                          start: invalid
                          stop: invalid
                          tables: stream
                      - name: reduce
                        params:
                          fn: function
                          identity: invalid
                          tables: stream
                      - name: relativeStrengthIndex
                        params:
                          columns: array
                          'n': int
                          tables: stream
                      - name: rename
                        params:
                          columns: invalid
                          fn: function
                          tables: stream
                      - name: sample
                        params:
                          column: string
                          'n': int
                          pos: int
                          tables: stream
                      - name: set
                        params:
                          key: string
                          tables: stream
                          value: string
                      - name: skew
                        params:
                          column: string
                          tables: stream
                      - name: sort
                        params:
                          columns: array
                          desc: bool
                          tables: stream
                      - name: spread
                        params:
                          column: string
                          tables: stream
                      - name: stateCount
                        params:
                          column: string
                          fn: function
                          tables: stream
                      - name: stateDuration
                        params:
                          column: string
                          fn: function
                          tables: stream
                          timeColumn: string
                          unit: duration
                      - name: stateTracking
                        params:
                          countColumn: string
                          durationColumn: string
                          durationUnit: duration
                          fn: function
                          tables: stream
                          timeColumn: string
                      - name: stddev
                        params:
                          column: string
                          mode: string
                          tables: stream
                      - name: string
                        params:
                          v: invalid
                      - name: sum
                        params:
                          column: string
                          tables: stream
                      - name: tableFind
                        params:
                          fn: function
                          tables: stream
                      - name: tail
                        params:
                          'n': int
                          offset: int
                          tables: stream
                      - name: time
                        params:
                          v: invalid
                      - name: timeShift
                        params:
                          columns: array
                          duration: duration
                          tables: stream
                      - name: timeWeightedAvg
                        params:
                          tables: stream
                          unit: duration
                      - name: timedMovingAverage
                        params:
                          column: string
                          every: duration
                          period: duration
                          tables: stream
                      - name: to
                        params:
                          bucket: string
                          bucketID: string
                          fieldFn: function
                          host: string
                          measurementColumn: string
                          org: string
                          orgID: string
                          tables: stream
                          tagColumns: array
                          timeColumn: string
                          token: string
                      - name: toBool
                        params:
                          tables: stream
                      - name: toFloat
                        params:
                          tables: stream
                      - name: toInt
                        params:
                          tables: stream
                      - name: toString
                        params:
                          tables: stream
                      - name: toTime
                        params:
                          tables: stream
                      - name: toUInt
                        params:
                          tables: stream
                      - name: today
                        params: {}
                      - name: top
                        params:
                          columns: array
                          'n': int
                          tables: stream
                      - name: tripleEMA
                        params:
                          'n': int
                          tables: stream
                      - name: tripleExponentialDerivative
                        params:
                          'n': int
                          tables: stream
                      - name: truncateTimeColumn
                        params:
                          tables: stream
                          timeColumn: invalid
                          unit: duration
                      - name: uint
                        params:
                          v: invalid
                      - name: union
                        params:
                          tables: array
                      - name: unique
                        params:
                          column: string
                          tables: stream
                      - name: wideTo
                        params:
                          bucket: string
                          bucketID: string
                          host: string
                          org: string
                          orgID: string
                          tables: stream
                          token: string
                      - name: window
                        params:
                          createEmpty: bool
                          every: duration
                          location: object
                          offset: duration
                          period: duration
                          startColumn: string
                          stopColumn: string
                          tables: stream
                          timeColumn: string
                      - name: yield
                        params:
                          name: string
                          tables: stream
        '301':
          description: |
            Moved Permanently.
            InfluxData has moved the URL of the endpoint.
            Use `/api/v2/query/suggestions`.
          content:
            text/html:
              schema:
                properties:
                  body:
                    readOnly: true
                    description: Response message with URL of requested resource.
                    type: string
              examples:
                movedPermanently:
                  summary: Invalid URL
                  description: |
                    The URL has been permanently moved. Use `/api/v2/query/suggestions`.
                  value: |
                    <a href="/api/v2/query/suggestions?orgID=INFLUX_ORG_ID">Moved Permanently</a>
        default:
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      x-codeSamples:
        - lang: Shell
          label: cURL
          source: |
            curl --request GET "https://cloud2.influxdata.com/api/v2/query/suggestions" \
              --header "Accept: application/json" \
              --header "Authorization: Token INFLUX_API_TOKEN"
  '/query/suggestions/{name}':
    get:
      operationId: GetQuerySuggestionsName
      tags:
        - Query
      summary: Retrieve a query suggestion for a branching suggestion
      description: |
        Retrieves a query suggestion that contains the name and parameters of the
        requested function.

        Use this endpoint to pass a branching suggestion (a Flux function name) and
        retrieve the parameters of the requested function.

        #### Limitations

        - Use `/api/v2/query/suggestions/{name}` (without a trailing slash).
        `/api/v2/query/suggestions/{name}/` (note the trailing slash) results in a
        HTTP `301 Moved Permanently` status.

        - The function `name` must exist and must be spelled correctly.

        #### Related Guides

        - [List of all Flux functions](https://docs.influxdata.com/influxdb/v2.3/flux/v0.x/stdlib/all-functions/).
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: name
          schema:
            type: string
          required: true
          description: |
            A Flux Function name.
            Only returns functions with this name.
      responses:
        '200':
          description: |
            Success.
            The response body contains the function name and parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FluxSuggestion'
              examples:
                successResponse:
                  value:
                    name: sum
                    params:
                      column: string
                      tables: stream
        '500':
          description: |
            Internal server error.
            The value passed for _`name`_ may have been misspelled.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                internalError:
                  summary: Invalid function
                  description: |
                    The requested function doesn't exist.
                  value:
                    code: internal error
                    message: An internal error has occurred
      x-codeSamples:
        - lang: Shell
          label: cURL
          source: |
            curl --request GET "https://cloud2.influxdata.com/api/v2/query/suggestions/sum/" \
              --header "Accept: application/json" \
              --header "Authorization: Token INFLUX_API_TOKEN"
  /query/analyze:
    post:
      operationId: PostQueryAnalyze
      tags:
        - Query
      summary: Analyze a Flux query
      description: |
        Analyzes a [Flux query](https://docs.influxdata.com/flux/v0.x/) for syntax
        errors and returns the list of errors.

        In the following sample query, `from()` is missing the property key.

            ```json
            { "query": "from(: \"iot_center\")\
                        |> range(start: -90d)\
                        |> filter(fn: (r) => r._measurement == \"environment\")",
              "type": "flux"
            }
            ```

        If you pass this in a request to the `/api/v2/analyze` endpoint,
        InfluxDB returns an `errors` list that contains an error object for the missing key.

        #### Limitations

        -  The endpoint doesn't validate values in the query--for example:

          - The following sample query has correct syntax, but contains an incorrect `from()` property key:

            ```json
            { "query": "from(foo: \"iot_center\")\
                        |> range(start: -90d)\
                        |> filter(fn: (r) => r._measurement == \"environment\")",
              "type": "flux"
            }
            ```

            If you pass this in a request to the `/api/v2/analyze` endpoint,
            InfluxDB returns an empty `errors` list.
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: header
          name: Content-Type
          schema:
            type: string
            enum:
              - application/json
      requestBody:
        description: Flux query to analyze
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Query'
      responses:
        '200':
          description: |
            Success.
            The response body contains the list of `errors`.
            If the query syntax is valid, the endpoint returns an empty `errors` list.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnalyzeQueryResponse'
              examples:
                missingQueryPropertyKey:
                  summary: Missing property key error
                  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\")\

                        ...

                      }
                      ```
                  value:
                    errors:
                      - line: 1
                        column: 6
                        character: 0
                        message: missing property key
        '400':
          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:
                type: string
                example: invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                invalidJSONStringValue:
                  summary: Invalid JSON
                  description: 'If the request body contains invalid JSON, returns `invalid` and problem detail.'
                  value:
                    code: invalid
                    message: 'invalid json: invalid character ''\'''' looking for beginning of value'
        default:
          description: Internal server error
          headers:
            X-Platform-Error-Code:
              description: The reason for the error.
              schema:
                type: string
                example: internal error
            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
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                emptyJSONObject:
                  summary: Empty JSON object in request body
                  description: |
                    If the request body contains an empty JSON object, returns `internal error`.
                  value:
                    code: internal error
                    message: An internal error has occurred - check server logs
      x-codeSamples:
        - lang: Shell
          label: 'cURL: Analyze a Flux query'
          source: |
            curl -v --request POST \
              "http://localhost:8086/api/v2/query/analyze" \
              --header "Authorization: Token INFLUX_API_TOKEN" \
              --header 'Content-type: application/json' \
              --header 'Accept: application/json' \
              --data-binary @- << EOF
              { "query": "from(bucket: \"iot_center\")\
                          |> range(start: -90d)\
                          |> filter(fn: (r) => r._measurement == \"environment\")",
                "type": "flux"
              }
            EOF
  /query:
    post:
      operationId: PostQuery
      tags:
        - Data I/O endpoints
        - Query
      summary: Query data
      description: |
        Retrieves data from buckets.

        Use this endpoint to send a Flux query request and retrieve data from a bucket.

        #### Rate limits (with InfluxDB Cloud)

        `read` rate limits apply.
        For more information, see [limits and adjustable quotas](https://docs.influxdata.com/influxdb/cloud/account-management/limits/).

        #### Related guides

        - [Query with the InfluxDB API](https://docs.influxdata.com/influxdb/v2.3/query-data/execute-queries/influx-api/).
        - [Get started with Flux](https://docs.influxdata.com/flux/v0.x/get-started/)
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: header
          name: Accept-Encoding
          description: The content encoding (usually a compression algorithm) that the client can understand.
          schema:
            type: string
            description: 'The content coding.  Use `gzip` for compressed data or `identity` for unmodified, uncompressed data.'
            default: identity
            enum:
              - gzip
              - identity
        - in: header
          name: Content-Type
          schema:
            type: string
            enum:
              - application/json
              - application/vnd.flux
        - in: query
          name: org
          description: |
            The name or ID of the organization executing the query.

            #### InfluxDB Cloud

            - Doesn't use `org` or `orgID`.
            - Queries the bucket in the organization associated with the authorization (API token).

            #### InfluxDB OSS

            - Requires either `org` or `orgID`.
          schema:
            type: string
        - in: query
          name: orgID
          description: |
            The ID of the organization executing the query.

            #### InfluxDB Cloud

            - Doesn't use `org` or `orgID`.
            - Queries the bucket in the organization associated with the authorization (API token).

            #### InfluxDB OSS

            - Requires either `org` or `orgID`.
          schema:
            type: string
      x-codeSamples:
        - lang: Shell
          label: cURL
          source: |
            curl --request POST 'INFLUX_URL/api/v2/query?org=INFLUX_ORG' \
            --header 'Content-Type: application/vnd.flux' \
            --header 'Accept: application/csv \
            --header 'Authorization: Token INFLUX_API_TOKEN' \
            --data 'from(bucket: "example-bucket")
                      |> range(start: -5m)
                      |> filter(fn: (r) => r._measurement == "example-measurement")'
      requestBody:
        description: Flux query or specification to execute
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Query'
          application/vnd.flux:
            schema:
              type: string
            example: |
              from(bucket: "example-bucket")
                  |> range(start: -5m)
                  |> filter(fn: (r) => r._measurement == "example-measurement")
      responses:
        '200':
          description: Success. The response body contains query results.
          headers:
            Content-Encoding:
              description: Lists encodings (usually compression algorithms) that have been applied to the response payload.
              schema:
                type: string
                description: |
                  The content coding: `gzip` for compressed data or `identity` for unmodified, uncompressed data.
                default: identity
                enum:
                  - gzip
                  - identity
            Trace-Id:
              description: 'The trace ID, if generated, of the request.'
              schema:
                type: string
                description: Trace ID of a request.
          content:
            application/csv:
              schema:
                type: string
              example: |
                result,table,_start,_stop,_time,region,host,_value
                mean,0,2018-05-08T20:50:00Z,2018-05-08T20:51:00Z,2018-05-08T20:50:00Z,east,A,15.43
                mean,0,2018-05-08T20:50:00Z,2018-05-08T20:51:00Z,2018-05-08T20:50:20Z,east,B,59.25
                mean,0,2018-05-08T20:50:00Z,2018-05-08T20:51:00Z,2018-05-08T20:50:40Z,east,C,52.62
        '400':
          description: |
            Bad request.
            The response body contains detail about the error.

            #### InfluxDB OSS

            - Returns this error if `org` or `orgID` doesn't match an organization.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                orgNotFound:
                  summary: Organization not found
                  value:
                    code: invalid
                    message: 'failed to decode request body: organization not found'
        '401':
          $ref: '#/components/responses/AuthorizationError'
        '404':
          $ref: '#/components/responses/ResourceNotFoundError'
        '429':
          description: |
            #### InfluxDB Cloud:
              - returns this error if a **read** or **write** request exceeds your
                plan's [adjustable service quotas](https://docs.influxdata.com/influxdb/v2.3/account-management/limits/#adjustable-service-quotas)
                or if a **delete** request exceeds the maximum
                [global limit](https://docs.influxdata.com/influxdb/v2.3/account-management/limits/#global-limits)
              - returns `Retry-After` header that describes when to try the write again.

            #### InfluxDB OSS:
              - doesn't return this error.
          headers:
            Retry-After:
              description: Non-negative decimal integer indicating seconds to wait before retrying the request.
              schema:
                type: integer
                format: int32
        '500':
          $ref: '#/components/responses/InternalServerError'
        default:
          $ref: '#/components/responses/GeneralServerError'
  /buckets:
    get:
      operationId: GetBuckets
      tags:
        - Buckets
      summary: List buckets
      description: |
        Retrieves a list of [buckets](https://docs.influxdata.com/influxdb/v2.3/reference/glossary/#bucket).

        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`.

        #### Limitations

        - Paging with an `offset` greater than the number of records will result in
        an empty list of buckets--for example:

          The following request is paging to the 50th record, but the user only has
          10 buckets.

          ```sh
          $ curl --request GET "INFLUX_URL/api/v2/scripts?limit=1&offset=50"

          $ {
              "links": {
                  "prev": "/api/v2/buckets?descending=false\u0026limit=1\u0026offset=49\u0026orgID=ORG_ID",
                  "self": "/api/v2/buckets?descending=false\u0026limit=1\u0026offset=50\u0026orgID=ORG_ID"
              },
              "buckets": []
            }
          ```

        #### Related Guides

        - [Manage buckets](https://docs.influxdata.com/influxdb/v2.3/organizations/buckets/)
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - $ref: '#/components/parameters/Offset'
        - $ref: '#/components/parameters/Limit'
        - $ref: '#/components/parameters/After'
        - in: query
          name: org
          description: |
            Organization name.
            The name of the organization.

            #### InfluxDB Cloud

             - Doesn't use `org` or `orgID`.
             - Creates a bucket in the organization associated with the authorization (API token).

             #### InfluxDB OSS

             - Accepts either `org` or `orgID`.
             - InfluxDB creates the bucket within this organization.
          schema:
            type: string
        - in: query
          name: orgID
          description: |
            Organization ID.
            The organization ID.

            #### InfluxDB Cloud

             - Doesn't use `org` or `orgID`.
             - Creates a bucket in the organization associated with the authorization (API token).

             #### InfluxDB OSS

             - Accepts either `org` or `orgID`.
             - InfluxDB creates the bucket within this organization.
          schema:
            type: string
        - in: query
          name: name
          description: |
            Bucket name.
            Only returns buckets with this specific name.
          schema:
            type: string
        - in: query
          name: id
          description: |
            Bucket ID.
            Only returns the bucket with this ID.
          schema:
            type: string
      responses:
        '200':
          description: |
            Success.
            The response body contains a list of buckets.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Buckets'
              examples:
                successResponse:
                  value:
                    links:
                      self: /api/v2/buckets?descending=false&limit=20&name=_monitoring&offset=0&orgID=ORG_ID
                    buckets:
                      - id: 77ca9dace40a9bfc
                        orgID: INFLUX_ORG_ID
                        type: system
                        schemaType: implicit
                        description: System bucket for monitoring logs
                        name: _monitoring
                        retentionRules:
                          - type: expire
                            everySeconds: 604800
                        createdAt: '2022-03-15T17:22:33.72617939Z'
                        updatedAt: '2022-03-15T17:22:33.726179487Z'
                        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
                        labels: []
        '401':
          $ref: '#/components/responses/AuthorizationError'
        '500':
          $ref: '#/components/responses/InternalServerError'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      x-codeSamples:
        - lang: Shell
          label: cURL
          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:
      operationId: PostBuckets
      tags:
        - Buckets
      summary: Create a bucket
      description: |
        Creates a [bucket](https://docs.influxdata.com/influxdb/v2.3/reference/glossary/#bucket)
        and returns the created bucket along with metadata. The default data
        [retention period](https://docs.influxdata.com/influxdb/v2.3/reference/glossary/#retention-period)
        is 30 days.

        #### InfluxDB OSS

        - A single InfluxDB OSS instance supports active writes or queries for
        approximately 20 buckets across all organizations at a given time. Reading
        or writing to more than 20 buckets at a time can adversely affect
        performance.

        #### 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 bucket](https://docs.influxdata.com/influxdb/v2.3/organizations/buckets/create-bucket/)
        - [Create bucket CLI reference](https://docs.influxdata.com/influxdb/v2.3/reference/cli/influx/bucket/create)
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
      requestBody:
        description: Bucket to create
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PostBucketRequest'
      responses:
        '201':
          description: |
            Success.
            The bucket was created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Bucket'
              examples:
                successResponse:
                  value:
                    id: 37407e232b3911d8
                    orgID: INFLUX_ORG_ID
                    type: user
                    schemaType: implicit
                    description: bucket holding air sensor data
                    name: air_sensor
                    retentionRules:
                      - type: expire
                        everySeconds: 2592000
                    createdAt: '2022-08-03T23:04:41.073704121Z'
                    updatedAt: '2022-08-03T23:04:41.073704228Z'
                    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
                    labels: []
        '400':
          description: |
            Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          $ref: '#/components/responses/AuthorizationError'
        '403':
          description: |
            Forbidden.
            The bucket quota is exceeded.
          headers:
            X-Platform-Error-Code:
              description: |
                The reason for the error.
              schema:
                type: string
                example: forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                quotaExceeded:
                  summary: Bucket quota exceeded
                  value:
                    code: forbidden
                    message: creating bucket would exceed quota
        '422':
          description: |
            Unprocessable Entity.
            The request body failed validation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          $ref: '#/components/responses/InternalServerError'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      x-codeSamples:
        - lang: Shell
          label: cURL
          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": "bucket holding air sensor data",
                  "orgID": "INFLUX_ORG_ID",
                  "retentionRules": [
                      {
                          "type": "expire",
                          "everySeconds": 2592000,
                      }
                  ]
                }'
  '/buckets/{bucketID}':
    get:
      operationId: GetBucketsID
      tags:
        - Buckets
      summary: Retrieve a bucket
      description: |
        Retrieves a bucket.

        Use this endpoint to retrieve information for a specific bucket.
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: bucketID
          schema:
            type: string
          required: true
          description: |
            The ID of the bucket to retrieve.
      responses:
        '200':
          description: |
            Success.
            The response body contains the bucket information.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Bucket'
              examples:
                successResponse:
                  value:
                    id: 37407e232b3911d8
                    orgID: bea7ea952287f70d
                    type: user
                    schemaType: implicit
                    description: bucket for air sensor data
                    name: air-sensor
                    retentionRules:
                      - type: expire
                        everySeconds: 2592000
                    createdAt: '2022-08-03T23:04:41.073704121Z'
                    updatedAt: '2022-08-03T23:04:41.073704228Z'
                    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
                    labels: []
        '401':
          $ref: '#/components/responses/AuthorizationError'
        '404':
          description: |
            Not found.
            Bucket not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                notFound:
                  summary: |
                    The requested bucket wasn't found.
                  value:
                    code: not found
                    message: bucket not found
        '500':
          $ref: '#/components/responses/InternalServerError'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    patch:
      operationId: PatchBucketsID
      tags:
        - Buckets
      summary: Update a bucket
      description: |
        Updates a bucket.

        Use this endpoint to update properties
        (`name`, `description`, and `retentionRules`) of a bucket.

        #### InfluxDB Cloud

        - Requires the `retentionRules` property in the request body. If you don't
        provide `retentionRules`, InfluxDB responds with an HTTP `403` status code.

        #### InfluxDB OSS

        - Doesn't require `retentionRules`.

        #### Related Guides

        - [Update a bucket](https://docs.influxdata.com/influxdb/v2.3/organizations/buckets/update-bucket/)
      requestBody:
        description: The bucket update to apply.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchBucketRequest'
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: bucketID
          schema:
            type: string
          required: true
          description: The bucket ID.
      responses:
        '200':
          description: An updated bucket
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Bucket'
              examples:
                successResponse:
                  value:
                    id: 37407e232b3911d8
                    orgID: INFLUX_ORG_ID
                    type: user
                    schemaType: implicit
                    description: bucket holding air sensor data
                    name: air_sensor
                    retentionRules:
                      - type: expire
                        everySeconds: 2592000
                    createdAt: '2022-08-03T23:04:41.073704121Z'
                    updatedAt: '2022-08-07T22:49:49.422962913Z'
                    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
                    labels: []
        '400':
          description: |
            Bad Request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                invalidJSONStringValue:
                  summary: Invalid JSON
                  description: |
                    If the request body contains invalid JSON, InfluxDB returns `invalid`
                    with detail about the problem.
                  value:
                    code: invalid
                    message: 'invalid json: invalid character ''\'''' looking for beginning of value'
        '401':
          $ref: '#/components/responses/AuthorizationError'
        '403':
          description: |
            Forbidden.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              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
        '404':
          description: |
            Not found.
            Bucket not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                notFound:
                  summary: |
                    The requested bucket wasn't found.
                  value:
                    code: not found
                    message: bucket not found
        '500':
          $ref: '#/components/responses/InternalServerError'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      x-codeSamples:
        - lang: Shell
          label: cURL
          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
                      }
                  ]
                }'
    delete:
      operationId: DeleteBucketsID
      tags:
        - Buckets
      summary: Delete a bucket
      description: |
        Deletes a bucket and all associated records.

        #### 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.

        #### InfluxDB OSS

        - Validates the request, handles the delete synchronously,
        and then responds with success or failure.

        #### Limitations

        - Only one bucket can be deleted per request.

        #### Related Guides

        - [Delete a bucket](https://docs.influxdata.com/influxdb/v2.3/organizations/buckets/delete-bucket/#delete-a-bucket-in-the-influxdb-ui)
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: bucketID
          schema:
            type: string
          required: true
          description: |
            Bucket ID.
            The ID of the bucket to delete.
      responses:
        '204':
          description: |
            Success.

            #### InfluxDB Cloud
              - The bucket is queued for deletion.

            #### InfluxDB OSS
              - The bucket is deleted.
        '400':
          description: |
            Bad Request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                invalidID:
                  summary: |
                    Invalid ID.
                  value:
                    code: invalid
                    message: id must have a length of 16 bytes
        '401':
          $ref: '#/components/responses/AuthorizationError'
        '404':
          description: |
            Not found.
            Bucket not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                notFound:
                  summary: |
                    The requested bucket was not found.
                  value:
                    code: not found
                    message: bucket not found
        '500':
          $ref: '#/components/responses/InternalServerError'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      x-codeSamples:
        - lang: Shell
          label: cURL
          source: |
            curl --request DELETE "http://localhost:8086/api/v2/buckets/BUCKET_ID" \
              --header "Authorization: Token INFLUX_TOKEN" \
              --header 'Accept: application/json'
  '/buckets/{bucketID}/labels':
    get:
      operationId: GetBucketsIDLabels
      tags:
        - Buckets
      summary: List all labels for a bucket
      description: |
        Retrieves a list of 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](#tag/Labels) to retrieve and manage labels.
        - [Manage labels in the InfluxDB UI](https://docs.influxdata.com/influxdb/v2.3/visualize-data/labels/)
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: bucketID
          schema:
            type: string
          required: true
          description: |
            The ID of the bucket to retrieve labels for.
      responses:
        '200':
          description: |
            Success.
            The response body contains a list of all labels for the bucket.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LabelsResponse'
              examples:
                successResponse:
                  value:
                    links:
                      self: /api/v2/labels
                    labels:
                      - id: 09cbd068e7ebb000
                        orgID: INFLUX_ORG_ID
                        name: production_buckets
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/AuthorizationError'
        '404':
          $ref: '#/components/responses/ResourceNotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    post:
      operationId: PostBucketsIDLabels
      tags:
        - Buckets
      summary: Add a label to a bucket
      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](#operation/PostLabels)).

        #### Related guides

        - Use the [`/api/v2/labels` InfluxDB API endpoint](#tag/Labels) to retrieve and manage labels.
        - [Manage labels in the InfluxDB UI](https://docs.influxdata.com/influxdb/v2.3/visualize-data/labels/)
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: bucketID
          schema:
            type: string
          required: true
          description: |
            Bucket ID.
            The ID of the bucket to label.
      requestBody:
        description: An object that contains a _`labelID`_ to add to the bucket.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LabelMapping'
      responses:
        '201':
          description: |
            Success.
            The response body contains the label information.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LabelResponse'
              examples:
                successResponse:
                  value:
                    links:
                      self: /api/v2/labels
                    label:
                      id: 09cbd068e7ebb000
                      orgID: INFLUX_ORG_ID
                      name: production_buckets
        '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':
          description: |
            Unprocessable entity.
            Label already exists on the resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                conflictingResource:
                  summary: |
                    Label already exists on the resource.
                  value:
                    code: conflict
                    message: 'Cannot add label, label already exists on resource'
        '500':
          $ref: '#/components/responses/InternalServerError'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      x-codeSamples:
        - lang: Shell
          label: cURL
          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"
                }'
  '/buckets/{bucketID}/labels/{labelID}':
    delete:
      operationId: DeleteBucketsIDLabelsID
      tags:
        - Buckets
      summary: Delete a label from a bucket
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: bucketID
          schema:
            type: string
          required: true
          description: The bucket ID.
        - in: path
          name: labelID
          schema:
            type: string
          required: true
          description: The ID of the label to delete.
      responses:
        '204':
          description: Delete has been accepted
        '404':
          description: Bucket not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  '/buckets/{bucketID}/members':
    get:
      operationId: GetBucketsIDMembers
      tags:
        - Buckets
      summary: List all users with member privileges for a bucket
      description: |
        Retrieves a list of all users for a bucket.

        InfluxDB [users](https://docs.influxdata.com/influxdb/v2.3/reference/glossary/#user) have
        permission to access InfluxDB.

        [Members](https://docs.influxdata.com/influxdb/v2.3/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.

        #### Related guides

        - [Manage users](https://docs.influxdata.com/influxdb/v2.3/users/)
        - [Manage members](https://docs.influxdata.com/influxdb/v2.3/organizations/members/)
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: bucketID
          schema:
            type: string
          required: true
          description: |
            The ID of the bucket to retrieve users for.
      responses:
        '200':
          description: |
            Success.
            The response body contains a list of all users for the bucket.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceMembers'
              examples:
                successResponse:
                  value:
                    links:
                      self: /api/v2/buckets/37407e232b3911d8/members
                    users:
                      - role: member
                        links:
                          self: /api/v2/users/791df274afd48a83
                        id: 791df274afd48a83
                        name: example_user_1
                        status: active
                      - role: owner
                        links:
                          self: /api/v2/users/09cfb87051cbe000
                        id: 09cfb87051cbe000
                        name: example_user_2
                        status: active
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/AuthorizationError'
        '404':
          $ref: '#/components/responses/ResourceNotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    post:
      operationId: PostBucketsIDMembers
      tags:
        - Buckets
      summary: Add a member to a bucket
      description: |
        Add a user to a bucket and return the new user information.

        InfluxDB [users](https://docs.influxdata.com/influxdb/v2.3/reference/glossary/#user) have
        permission to access InfluxDB.

        [Members](https://docs.influxdata.com/influxdb/v2.3/reference/glossary/#member) are users in
        an organization.

        Use this endpoint to give a user member privileges to a bucket.

        #### Related guides

        - [Manage users](https://docs.influxdata.com/influxdb/v2.3/users/)
        - [Manage members](https://docs.influxdata.com/influxdb/v2.3/organizations/members/)
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: bucketID
          schema:
            type: string
          required: true
          description: |
            The ID of the bucket to retrieve users for.
      requestBody:
        description: A user to add as a member to the bucket.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddResourceMemberRequestBody'
      responses:
        '201':
          description: |
            Success.
            The response body contains the user information.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceMember'
              examples:
                successResponse:
                  value:
                    role: member
                    links:
                      self: /api/v2/users/09cfb87051cbe000
                    id: 09cfb87051cbe000
                    name: example_user_1
                    status: active
        '400':
          $ref: '#/components/responses/BadRequestError'
          examples:
            invalidRequest:
              summary: The `userID` 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:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      x-codeSamples:
        - lang: Shell
          label: cURL
          source: |
            curl --request POST "http://localhost:8086/api/v2/buckets/BUCKET_ID/members \
              --header "Authorization: Token INFLUX_TOKEN" \
              --header "Accept: application/json" \
              --header "Content-Type: application/json" \
              --data '{
                  "id": "09cfb87051cbe000"
                }
  '/buckets/{bucketID}/members/{userID}':
    delete:
      operationId: DeleteBucketsIDMembersID
      tags:
        - Buckets
      summary: Remove a member from a bucket
      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](https://docs.influxdata.com/influxdb/v2.3/users/)
        - [Manage members](https://docs.influxdata.com/influxdb/v2.3/organizations/members/)
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: userID
          schema:
            type: string
          required: true
          description: |
            The ID of the user to remove.
        - in: path
          name: bucketID
          schema:
            type: string
          required: true
          description: |
            The ID of the bucket to remove a user from.
      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:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  '/buckets/{bucketID}/owners':
    get:
      operationId: GetBucketsIDOwners
      tags:
        - Buckets
      summary: List all owners of a bucket
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: bucketID
          schema:
            type: string
          required: true
          description: The bucket ID.
      responses:
        '200':
          description: A list of bucket owners
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceOwners'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    post:
      operationId: PostBucketsIDOwners
      tags:
        - Buckets
      summary: Add an owner to a bucket
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: bucketID
          schema:
            type: string
          required: true
          description: The bucket ID.
      requestBody:
        description: User to add as owner
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddResourceMemberRequestBody'
      responses:
        '201':
          description: Success. The user is an owner of the bucket
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceOwner'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  '/buckets/{bucketID}/owners/{userID}':
    delete:
      operationId: DeleteBucketsIDOwnersID
      tags:
        - Buckets
      summary: Remove an owner from a bucket
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: userID
          schema:
            type: string
          required: true
          description: The ID of the owner to remove.
        - in: path
          name: bucketID
          schema:
            type: string
          required: true
          description: The bucket ID.
      responses:
        '204':
          description: Owner removed
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /orgs:
    get:
      operationId: GetOrgs
      tags:
        - Organizations
        - Security and access endpoints
      summary: List organizations
      description: |
        Retrieves a list of [organizations](https://docs.influxdata.com/influxdb/v2.3/reference/glossary/#organization/).

        To limit which organizations are returned, pass query parameters in your request.
        If no query parameters are passed, InfluxDB returns all organizations up to the default `limit`.

        #### InfluxDB Cloud

        - Only returns the organization that owns the token passed in the request.

        #### Related guides

        - [View organizations](https://docs.influxdata.com/influxdb/v2.3/organizations/view-orgs/).
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - $ref: '#/components/parameters/Offset'
        - $ref: '#/components/parameters/Limit'
        - $ref: '#/components/parameters/Descending'
        - in: query
          name: org
          schema:
            type: string
          description: |
            An organization name.
            Only returns organizations with this name.
        - in: query
          name: orgID
          schema:
            type: string
          description: |
            An organization ID.
            Only returns the organization with this ID.
        - in: query
          name: userID
          schema:
            type: string
          description: |
            A user ID.
            Only returns organizations where this user is a member or owner.
      responses:
        '200':
          description: Success. The response body contains a list of organizations.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/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'
    post:
      operationId: PostOrgs
      tags:
        - Organizations
      summary: Create an organization
      description: |
        Creates an organization and returns the newly created organization.

        #### InfluxDB Cloud

        - Doesn't allow you to use this endpoint to create organizations.
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
      requestBody:
        description: The organization to create.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PostOrganizationRequest'
      responses:
        '201':
          description: |
            Success. The organization is created.
            The response body contains the new organization.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Organization'
        '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'
  '/orgs/{orgID}':
    get:
      operationId: GetOrgsID
      tags:
        - Organizations
        - Security and access endpoints
      summary: Retrieve an organization
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: orgID
          schema:
            type: string
          required: true
          description: The ID of the organization to get.
      responses:
        '200':
          description: Organization details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Organization'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    patch:
      operationId: PatchOrgsID
      tags:
        - Organizations
      summary: Update an organization
      requestBody:
        description: Organization update to apply
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchOrganizationRequest'
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: orgID
          schema:
            type: string
          required: true
          description: The ID of the organization to get.
      responses:
        '200':
          description: Organization updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Organization'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    delete:
      operationId: DeleteOrgsID
      tags:
        - Organizations
      summary: Delete an organization
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: orgID
          schema:
            type: string
          required: true
          description: The ID of the organization to delete.
      responses:
        '204':
          description: Delete has been accepted
        '404':
          description: Organization not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  '/orgs/{orgID}/secrets':
    get:
      operationId: GetOrgsIDSecrets
      tags:
        - Secrets
        - Security and access endpoints
      summary: List all secret keys for an organization
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: orgID
          schema:
            type: string
          required: true
          description: The organization ID.
      responses:
        '200':
          description: A list of all secret keys
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SecretKeysResponse'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    patch:
      operationId: PatchOrgsIDSecrets
      tags:
        - Secrets
      summary: Update secrets in an organization
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: orgID
          schema:
            type: string
          required: true
          description: The organization ID.
      requestBody:
        description: Secret key value pairs to update/add
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Secrets'
      responses:
        '204':
          description: Keys successfully patched
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  '/orgs/{orgID}/members':
    get:
      operationId: GetOrgsIDMembers
      tags:
        - Organizations
        - Security and access endpoints
      summary: List all members of an organization
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: orgID
          schema:
            type: string
          required: true
          description: The organization ID.
      responses:
        '200':
          description: A list of organization members
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceMembers'
        '404':
          description: Organization not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    post:
      operationId: PostOrgsIDMembers
      tags:
        - Organizations
      summary: Add a member to an organization
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: orgID
          schema:
            type: string
          required: true
          description: The organization ID.
      requestBody:
        description: User to add as member
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddResourceMemberRequestBody'
      responses:
        '201':
          description: Added to organization created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceMember'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  '/orgs/{orgID}/members/{userID}':
    delete:
      operationId: DeleteOrgsIDMembersID
      tags:
        - Organizations
        - Security and access endpoints
      summary: Remove a member from an organization
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: userID
          schema:
            type: string
          required: true
          description: The ID of the member to remove.
        - in: path
          name: orgID
          schema:
            type: string
          required: true
          description: The organization ID.
      responses:
        '204':
          description: Member removed
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  '/orgs/{orgID}/owners':
    get:
      operationId: GetOrgsIDOwners
      tags:
        - Organizations
        - Security and access endpoints
      summary: List all owners of an organization
      description: |
        Retrieves a list of all owners of an organization.
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: orgID
          schema:
            type: string
          required: true
          description: |
            The ID of the organization to list owners for.
      responses:
        '200':
          description: A list of organization owners
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceOwners'
        '404':
          description: Organization not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    post:
      operationId: PostOrgsIDOwners
      tags:
        - Organizations
      summary: Add an owner to an organization
      description: |
        Adds an owner to an organization.

        Use this endpoint to assign the organization `owner` role to a user.

        #### InfluxDB Cloud

        - Doesn't use `owner` and `member` roles.
          Use [`/api/v2/authorizations`](#tag/Authorizations) to assign user permissions.

        #### Required permissions

        - `write-orgs INFLUX_ORG_ID`

        `INFLUX_ORG_ID` is the ID of the organization that you want add an owner for.

        #### Related endpoints

        - [Authorizations](#tag/Authorizations)
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: orgID
          schema:
            type: string
          required: true
          description: The ID of the organization that you want to add an owner for.
      requestBody:
        description: The user to add as an owner of the organization.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddResourceMemberRequestBody'
      responses:
        '201':
          description: |
            Success. The user is an owner of the organization.
            The response body contains the owner with role and user detail.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceOwner'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  '/orgs/{orgID}/owners/{userID}':
    delete:
      operationId: DeleteOrgsIDOwnersID
      tags:
        - Organizations
        - Security and access endpoints
      summary: Remove an owner from an organization
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: userID
          schema:
            type: string
          required: true
          description: The ID of the owner to remove.
        - in: path
          name: orgID
          schema:
            type: string
          required: true
          description: The organization ID.
      responses:
        '204':
          description: Owner removed
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  '/orgs/{orgID}/secrets/delete':
    post:
      deprecated: true
      operationId: PostOrgsIDSecrets
      tags:
        - Secrets
        - Security and access endpoints
      summary: Delete secrets from an organization
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: orgID
          schema:
            type: string
          required: true
          description: The organization ID.
      requestBody:
        description: Secret key to delete
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SecretKeys'
      responses:
        '204':
          description: Keys successfully patched
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  '/orgs/{orgID}/secrets/{secretID}':
    delete:
      operationId: DeleteOrgsIDSecretsID
      tags:
        - Secrets
        - Security and access endpoints
      summary: Delete a secret from an organization
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: orgID
          schema:
            type: string
          required: true
          description: The organization ID.
        - in: path
          name: secretID
          schema:
            type: string
          required: true
          description: The secret ID.
      responses:
        '204':
          description: Keys successfully deleted
        default:
          description: Unexpected error
          $ref: '#/components/responses/GeneralServerError'
  /resources:
    get:
      operationId: GetResources
      tags:
        - Resources
        - System information endpoints
      summary: List all known resources
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
      responses:
        '200':
          description: All resources targets
          content:
            application/json:
              schema:
                type: array
                items:
                  type: string
        default:
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /stacks:
    get:
      operationId: ListStacks
      tags:
        - Templates
      summary: List installed stacks
      description: |
        Retrieves a list of 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.
      parameters:
        - in: query
          name: orgID
          required: true
          schema:
            type: string
          description: |
            The ID of the organization that owns the stacks.
            Only returns stacks owned by this organization.

            #### InfluxDB Cloud

            - Doesn't require this parameter;
              InfluxDB only returns resources allowed by the API token.
        - in: query
          name: name
          schema:
            type: string
          description: |
            The 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:

            - `http://localhost:8086/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: stackID
          schema:
            type: string
          description: |
            The stack ID.
            Only returns stacks with this ID.

            Repeatable.
            To filter for more than one stack ID,
            repeat this parameter with each ID--for example:

            - `http://localhost:8086/api/v2/stacks?&orgID=INFLUX_ORG_ID&stackID=09bd87cd33be3000&stackID=09bef35081fe3000`
          examples:
            findStackByID:
              summary: Find a stack with the ID
              value: 09bd87cd33be3000
      responses:
        '200':
          description: Success. The response body contains the list of stacks.
          content:
            application/json:
              schema:
                type: object
                properties:
                  stacks:
                    type: array
                    items:
                      $ref: '#/components/schemas/Stack'
        '400':
          description: |
            Bad request.
            The response body contains detail about the error.

            #### InfluxDB OSS

            - Returns this error if an incorrect value is passed for `org` or `orgID`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              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'
        '401':
          $ref: '#/components/responses/AuthorizationError'
        '500':
          $ref: '#/components/responses/InternalServerError'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    post:
      operationId: CreateStack
      tags:
        - Templates
      summary: Create a stack
      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](#operation/ApplyTemplate).

        #### Required permissions

        - `write` permission for the organization

        #### Related guides

        - [InfluxDB stacks](https://docs.influxdata.com/influxdb/v2.3/influxdb-templates/stacks/)
        - [Use InfluxDB templates](https://docs.influxdata.com/influxdb/v2.3/influxdb-templates/use/#apply-templates-to-an-influxdb-instance)
      requestBody:
        description: The stack to create.
        required: true
        content:
          application/json:
            schema:
              type: object
              title: PostStackRequest
              properties:
                orgID:
                  type: string
                name:
                  type: string
                description:
                  type: string
                urls:
                  type: array
                  items:
                    type: string
      responses:
        '201':
          description: Success. Returns the newly created stack.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Stack'
        '401':
          $ref: '#/components/responses/AuthorizationError'
        '422':
          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.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          $ref: '#/components/responses/InternalServerError'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  '/stacks/{stack_id}':
    get:
      operationId: ReadStack
      tags:
        - Templates
      summary: Retrieve a stack
      parameters:
        - in: path
          name: stack_id
          required: true
          schema:
            type: string
          description: The identifier of the stack.
      responses:
        '200':
          description: Returns the stack.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Stack'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    patch:
      operationId: UpdateStack
      tags:
        - Templates
      summary: Update a stack
      parameters:
        - in: path
          name: stack_id
          required: true
          schema:
            type: string
          description: The identifier of the stack.
      requestBody:
        description: The stack to update.
        required: true
        content:
          application/json:
            schema:
              type: object
              title: PatchStackRequest
              properties:
                name:
                  type: string
                  nullable: true
                description:
                  type: string
                  nullable: true
                templateURLs:
                  type: array
                  items:
                    type: string
                  nullable: true
                additionalResources:
                  type: array
                  items:
                    type: object
                    properties:
                      resourceID:
                        type: string
                      kind:
                        type: string
                      templateMetaName:
                        type: string
                    required:
                      - kind
                      - resourceID
      responses:
        '200':
          description: Returns the updated stack.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Stack'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    delete:
      operationId: DeleteStack
      tags:
        - Templates
      summary: Delete a stack and associated resources
      parameters:
        - in: path
          name: stack_id
          required: true
          schema:
            type: string
          description: The identifier of the stack.
        - in: query
          name: orgID
          required: true
          schema:
            type: string
          description: The identifier of the organization.
      responses:
        '204':
          description: The stack and its associated resources were deleted.
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  '/stacks/{stack_id}/uninstall':
    post:
      operationId: UninstallStack
      tags:
        - Templates
      summary: Uninstall a stack
      parameters:
        - in: path
          name: stack_id
          required: true
          schema:
            type: string
          description: The identifier of the stack.
      responses:
        '200':
          description: Returns the uninstalled stack.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Stack'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /templates/apply:
    post:
      operationId: ApplyTemplate
      tags:
        - Templates
      summary: Apply or dry-run a template
      description: |
        Applies a template to
        create or update a [stack](https://docs.influxdata.com/influxdb/v2.3/influxdb-templates/stacks/) of InfluxDB
        [resources](https://docs.influxdata.com/influxdb/v2.3/reference/cli/influx/export/all/#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](https://docs.influxdata.com/influxdb/v2.3/influxdb-templates/create/#include-user-definable-resource-names) for custom metadata.
          To provide custom values for environment references, pass the _`envRefs`_
          property in the request body.
          For more information and examples, see how to
          [define environment references](https://docs.influxdata.com/influxdb/v2.3/influxdb-templates/use/#define-environment-references).

        - Some templates may contain queries that use
          [secrets](https://docs.influxdata.com/influxdb/v2.3/security/secrets/).
          To provide custom secret values, pass the _`secrets`_ property
          in the request body.
          Don't expose secret values in templates.
          For more information, see [how to pass secrets when installing a template](https://docs.influxdata.com/influxdb/v2.3/influxdb-templates/use/#pass-secrets-when-installing-a-template).

        #### 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](https://docs.influxdata.com/influxdb/cloud/account-management/limits/).

        #### Related guides

        - [Use templates](https://docs.influxdata.com/influxdb/v2.3/influxdb-templates/use/)
        - [Stacks](https://docs.influxdata.com/influxdb/v2.3/influxdb-templates/stacks/)
      requestBody:
        required: true
        description: |
          Parameters for applying templates.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TemplateApply'
            examples:
              skipKindAction:
                summary: Skip all bucket and task resources in the provided templates
                value:
                  orgID: INFLUX_ORG_ID
                  actions:
                    - action: skipKind
                      properties:
                        kind: Bucket
                    - action: skipKind
                      properties:
                        kind: Task
                  templates:
                    - contents:
                        - '[object Object]': null
              skipResourceAction:
                summary: Skip specific resources in the provided templates
                value:
                  orgID: INFLUX_ORG_ID
                  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
                  templates:
                    - contents:
                        - apiVersion: influxdata.com/v2alpha1
                          kind: Bucket
                          metadata:
                            name: baz-500
              templateObjectEnvRefs:
                summary: envRefs for template objects
                value:
                  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
                    - contents:
                        - apiVersion: influxdata.com/v2alpha1
                          kind: Bucket
                          metadata:
                            name:
                              envRef:
                                key: docker-bucket
          application/x-jsonnet:
            schema:
              $ref: '#/components/schemas/TemplateApply'
          text/yml:
            schema:
              $ref: '#/components/schemas/TemplateApply'
      x-codeSamples:
        - lang: Shell
          label: 'cURL: Dry run with a remote template'
          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
        - lang: Shell
          label: 'cURL: Apply with secret values'
          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
        - lang: Shell
          label: 'cURL: Apply template objects with environment references'
          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
      responses:
        '200':
          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.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TemplateSummary'
        '201':
          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.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TemplateSummary'
        '422':
          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.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/TemplateSummary'
                  - type: object
                    required:
                      - message
                      - code
                    properties:
                      message:
                        type: string
                      code:
                        type: string
        '500':
          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.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              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\""
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /templates/export:
    post:
      operationId: ExportTemplate
      tags:
        - Templates
      summary: Export a new template
      requestBody:
        description: Export resources as an InfluxDB template.
        required: false
        content:
          application/json:
            schema:
              oneOf:
                - $ref: '#/components/schemas/TemplateExportByID'
                - $ref: '#/components/schemas/TemplateExportByName'
      responses:
        '200':
          description: The template was created successfully. Returns the newly created template.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Template'
            application/x-yaml:
              schema:
                $ref: '#/components/schemas/Template'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  '/tasks/{taskID}/runs':
    get:
      operationId: GetTasksIDRuns
      tags:
        - Tasks
      summary: List runs for a task
      description: |
        Retrieves a list of runs for a [task](https://docs.influxdata.com/influxdb/v2.3/process-data/).

        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`.
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: taskID
          schema:
            type: string
          required: true
          description: |
            The ID of the task to get runs for.
            Only returns runs for this task.
        - in: query
          name: after
          schema:
            type: string
          description: A task run ID. Only returns runs created after this run.
        - in: query
          name: limit
          schema:
            type: integer
            minimum: 1
            maximum: 500
            default: 100
          description: |
            Limits the number of task runs returned. Default is `100`.
        - in: query
          name: afterTime
          schema:
            type: string
            format: date-time
          description: |
            A timestamp ([RFC3339 date/time format](https://docs.influxdata.com/influxdb/v2.3/reference/glossary/#rfc3339-timestamp)).
            Only returns runs scheduled after this time.
        - in: query
          name: beforeTime
          schema:
            type: string
            format: date-time
          description: |
            A timestamp ([RFC3339 date/time format](https://docs.influxdata.com/influxdb/v2.3/reference/glossary/#rfc3339-timestamp)).
            Only returns runs scheduled before this time.
      responses:
        '200':
          description: Success. The response body contains the list of task runs.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Runs'
        '401':
          $ref: '#/components/responses/AuthorizationError'
        '500':
          $ref: '#/components/responses/InternalServerError'
        default:
          $ref: '#/components/responses/GeneralServerError'
    post:
      operationId: PostTasksIDRuns
      tags:
        - Data I/O endpoints
        - Tasks
      summary: 'Start a task run, overriding the schedule'
      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`](#operation/PostTasksIDRunsIDRetry) endpoint.
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: taskID
          schema:
            type: string
          required: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RunManually'
      responses:
        '201':
          description: Success. The run is scheduled to start.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Run'
        '401':
          $ref: '#/components/responses/AuthorizationError'
        '500':
          $ref: '#/components/responses/InternalServerError'
        default:
          $ref: '#/components/responses/GeneralServerError'
  '/tasks/{taskID}/runs/{runID}':
    get:
      operationId: GetTasksIDRunsID
      tags:
        - Tasks
      summary: Retrieve a run for a task.
      description: |
        Retrieves a specific run for a [task](https://docs.influxdata.com/influxdb/v2.3/reference/glossary/#task).

        Use this endpoint to retrieve detail and logs for a specific task run.
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: taskID
          schema:
            type: string
          required: true
          description: The ID of the task to retrieve runs for.
        - in: path
          name: runID
          schema:
            type: string
          required: true
          description: The ID of the run to retrieve.
      responses:
        '200':
          description: Success. The response body contains the task run.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Run'
              examples:
                runSuccess:
                  summary: A successful task run.
                  value:
                    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
                    id: 09b070dadaa7d000
                    taskID: 0996e56b2f378000
                    status: success
                    scheduledFor: '2022-07-18T14:46:06Z'
                    startedAt: '2022-07-18T14:46:07.16222Z'
                    finishedAt: '2022-07-18T14:46:07.308254Z'
                    requestedAt: '2022-07-18T14:46:06Z'
                    log:
                      - runID: 09b070dadaa7d000
                        time: '2022-07-18T14:46:07.101231Z'
                        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.242859Z'
                        message: Completed(success)
        '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'
    delete:
      operationId: DeleteTasksIDRunsID
      tags:
        - Tasks
      summary: Cancel a running task
      description: |
        Cancels a running [task](https://docs.influxdata.com/influxdb/v2.3/reference/glossary/#task).

        Use this endpoint with InfluxDB OSS to cancel a running task.

        #### InfluxDB Cloud

        - Doesn't support this operation.
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: taskID
          schema:
            type: string
          required: true
          description: The ID of the task to cancel.
        - in: path
          name: runID
          schema:
            type: string
          required: true
          description: The ID of the task run to cancel.
      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':
          description: |
            Method not allowed.

            #### InfluxDB Cloud

              - Always returns this error; doesn't support cancelling tasks.

            #### InfluxDB OSS

              - Doesn't return this error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          $ref: '#/components/responses/InternalServerError'
        default:
          $ref: '#/components/responses/GeneralServerError'
  '/tasks/{taskID}/runs/{runID}/retry':
    post:
      operationId: PostTasksIDRunsIDRetry
      tags:
        - Tasks
      summary: Retry a task run
      description: |
        Queues a task run to retry and returns the newly scheduled run.

        To manually start a _new_ task run, use the [`POST /api/v2/tasks/{taskID}/runs`](#operation/PostTasksIDRuns) endpoint.

        #### Limitations

        - The task must be _active_ (`status: "active"`).
      requestBody:
        content:
          application/json; charset=utf-8:
            schema:
              type: object
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: taskID
          schema:
            type: string
          required: true
          description: The ID of the task to retry.
        - in: path
          name: runID
          schema:
            type: string
          required: true
          description: The ID of the task run to retry.
      responses:
        '200':
          description: Success. The response body contains the queued run.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Run'
              examples:
                retryTaskRun:
                  summary: A task run scheduled to retry
                  value:
                    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
                    id: 09d60ffe08738000
                    taskID: 09a776832f381000
                    status: scheduled
                    scheduledFor: '2022-08-15T00:00:00Z'
                    requestedAt: '2022-08-16T20:05:11.84145Z'
        '400':
          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`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                inactiveTask:
                  summary: Can't retry an inactive task
                  value:
                    code: invalid
                    message: 'failed to retry run: inactive task'
        '401':
          $ref: '#/components/responses/AuthorizationError'
        '404':
          $ref: '#/components/responses/ResourceNotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
        default:
          $ref: '#/components/responses/GeneralServerError'
  '/tasks/{taskID}/logs':
    get:
      operationId: GetTasksIDLogs
      tags:
        - Tasks
      summary: Retrieve all logs for a task
      description: |
        Retrieves a list of all logs for a [task](https://docs.influxdata.com/influxdb/v2.3/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.
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: taskID
          schema:
            type: string
          required: true
          description: The task ID.
      responses:
        '200':
          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.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Logs'
              examples:
                taskSuccess:
                  summary: Events for a successful task run.
                  value:
                    events:
                      - runID: 09b070dadaa7d000
                        time: '2022-07-18T14:46:07.101231Z'
                        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.242859Z'
                        message: Completed(success)
                taskFailure:
                  summary: Events for a failed task run.
                  value:
                    events:
                      - runID: 09a946fc3167d000
                        time: '2022-07-13T07:06:54.198167Z'
                        message: 'Started task from script: "option task = {name: \"test task\", every: 3d, offset: 0s}"'
                      - runID: 09a946fc3167d000
                        time: '2022-07-13T07:07:13.104037Z'
                        message: Completed(failed)
                      - runID: 09a946fc3167d000
                        time: '2022-07-13T08:24:37.115323Z'
                        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'
        '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'
  '/tasks/{taskID}/runs/{runID}/logs':
    get:
      operationId: GetTasksIDRunsIDLogs
      tags:
        - Tasks
      summary: Retrieve all logs for a run
      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.
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: taskID
          schema:
            type: string
          required: true
          description: The ID of the task to get logs for.
        - in: path
          name: runID
          schema:
            type: string
          required: true
          description: The ID of the run to get logs for.
      responses:
        '200':
          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.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Logs'
              examples:
                taskSuccess:
                  summary: Events for a successful task run.
                  value:
                    events:
                      - runID: 09b070dadaa7d000
                        time: '2022-07-18T14:46:07.101231Z'
                        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.242859Z'
                        message: Completed(success)
                taskFailure:
                  summary: Events for a failed task.
                  value:
                    events:
                      - runID: 09a946fc3167d000
                        time: '2022-07-13T07:06:54.198167Z'
                        message: 'Started task from script: "option task = {name: \"test task\", every: 3d, offset: 0s}"'
                      - runID: 09a946fc3167d000
                        time: '2022-07-13T07:07:13.104037Z'
                        message: Completed(failed)
                      - runID: 09a946fc3167d000
                        time: '2022-07-13T08:24:37.115323Z'
                        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'
        '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'
  '/tasks/{taskID}/labels':
    get:
      operationId: GetTasksIDLabels
      tags:
        - Tasks
      summary: List labels for a task
      description: |
        Retrieves a list of all labels for a task.

        Labels may be used for grouping and filtering tasks.
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: taskID
          schema:
            type: string
          required: true
          description: The ID of the task to retrieve labels for.
      responses:
        '200':
          description: Success. The response body contains a list of all labels for the task.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LabelsResponse'
        '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'
    post:
      operationId: PostTasksIDLabels
      tags:
        - Tasks
      summary: Add a label to a task
      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.
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: taskID
          schema:
            type: string
          required: true
          description: The ID of the task to label.
      requestBody:
        description: An object that contains a _`labelID`_ to add to the task.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LabelMapping'
      responses:
        '201':
          description: Success. The response body contains a list of all labels for the task.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LabelResponse'
        '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'
  '/tasks/{taskID}/labels/{labelID}':
    delete:
      operationId: DeleteTasksIDLabelsID
      tags:
        - Tasks
      summary: Delete a label from a task
      description: |
        Deletes a label from a task.
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: taskID
          schema:
            type: string
          required: true
          description: The ID of the task to delete the label from.
        - in: path
          name: labelID
          schema:
            type: string
          required: true
          description: The ID of the label to delete.
      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'
  /flags:
    get:
      operationId: GetFlags
      tags:
        - Users
      summary: Return the feature flags for the currently authenticated user
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
      responses:
        '200':
          description: Feature flags for the currently authenticated user
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Flags'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /me:
    get:
      operationId: GetMe
      tags:
        - Users
      summary: Retrieve the currently authenticated user
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
      responses:
        '200':
          description: Success. The response body contains the currently authenticated user.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserResponse'
        '401':
          $ref: '#/components/responses/AuthorizationError'
        '500':
          $ref: '#/components/responses/InternalServerError'
        default:
          $ref: '#/components/responses/GeneralServerError'
  /me/password:
    put:
      operationId: PutMePassword
      tags:
        - Users
      summary: Update a password
      description: |
        #### InfluxDB Cloud

        InfluxDB Cloud doesn't support changing user passwords through the API.
        Use the InfluxDB Cloud user interface to update your password.
      security:
        - BasicAuthentication: []
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
      requestBody:
        description: The new password.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PasswordResetBody'
      responses:
        '204':
          description: Success. The password was updated.
        '400':
          description: |
            Bad request.
            InfluxDB Cloud doesn't support changing passwords through the API and always responds with this status.
        default:
          description: Unsuccessful authentication
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  '/tasks/{taskID}/members':
    get:
      operationId: GetTasksIDMembers
      deprecated: true
      tags:
        - Tasks
      summary: List all task members
      description: |
        **Deprecated**: Tasks don't use `owner` and `member` roles.
        Use [`/api/v2/authorizations`](#tag/Authorizations) to assign user permissions.
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: taskID
          schema:
            type: string
          required: true
          description: The task ID.
      responses:
        '200':
          description: |
            Success. The response body contains a list of `users` that have
            the `member` role for a task.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceMembers'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    post:
      operationId: PostTasksIDMembers
      deprecated: true
      tags:
        - Tasks
      summary: Add a member to a task
      description: |
        **Deprecated**: Tasks don't use `owner` and `member` roles.
        Use [`/api/v2/authorizations`](#tag/Authorizations) to assign user permissions.

        Adds a user to members of a task and returns the newly created member with
        role and user detail.
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: taskID
          schema:
            type: string
          required: true
          description: The task ID.
      requestBody:
        description: A user to add as a member of the task.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddResourceMemberRequestBody'
      responses:
        '201':
          description: Created. The user is added to task members.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceMember'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  '/tasks/{taskID}/members/{userID}':
    delete:
      operationId: DeleteTasksIDMembersID
      deprecated: true
      tags:
        - Tasks
      summary: Remove a member from a task
      description: |
        **Deprecated**: Tasks don't use `owner` and `member` roles.
        Use [`/api/v2/authorizations`](#tag/Authorizations) to assign user permissions.
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: userID
          schema:
            type: string
          required: true
          description: The ID of the member to remove.
        - in: path
          name: taskID
          schema:
            type: string
          required: true
          description: The task ID.
      responses:
        '204':
          description: Member removed
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  '/tasks/{taskID}/owners':
    get:
      operationId: GetTasksIDOwners
      deprecated: true
      tags:
        - Tasks
      summary: List all owners of a task
      description: |
        **Deprecated**: Tasks don't use `owner` and `member` roles.
        Use [`/api/v2/authorizations`](#tag/Authorizations) to assign user permissions.

        Retrieves all users that have owner permission for a task.
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: taskID
          schema:
            type: string
          required: true
          description: The ID of the task to retrieve owners for.
      responses:
        '200':
          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.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceOwners'
        '401':
          $ref: '#/components/responses/AuthorizationError'
        '422':
          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.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          $ref: '#/components/responses/InternalServerError'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    post:
      operationId: PostTasksIDOwners
      deprecated: true
      tags:
        - Tasks
      summary: Add an owner for a task
      description: |
        **Deprecated**: Tasks don't use `owner` and `member` roles.
        Use [`/api/v2/authorizations`](#tag/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.
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: taskID
          schema:
            type: string
          required: true
          description: The task ID.
      requestBody:
        description: A user to add as an owner of the task.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddResourceMemberRequestBody'
      responses:
        '201':
          description: |
            Created. The task `owner` role is assigned to the user.
            The response body contains the resource owner with
            role and user detail.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceOwner'
              examples:
                createdOwner:
                  summary: User has the owner role for the resource
                  value:
                    role: owner
                    links:
                      logs: /api/v2/users/0772396d1f411000/logs
                      self: /api/v2/users/0772396d1f411000
                    id: 0772396d1f411000
                    name: USER_NAME
                    status: active
        '401':
          $ref: '#/components/responses/AuthorizationError'
        '422':
          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.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          $ref: '#/components/responses/InternalServerError'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  '/tasks/{taskID}/owners/{userID}':
    delete:
      operationId: DeleteTasksIDOwnersID
      deprecated: true
      tags:
        - Tasks
      summary: Remove an owner from a task
      description: |
        **Deprecated**: Tasks don't use `owner` and `member` roles.
        Use [`/api/v2/authorizations`](#tag/Authorizations) to assign user permissions.
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: userID
          schema:
            type: string
          required: true
          description: The ID of the owner to remove.
        - in: path
          name: taskID
          schema:
            type: string
          required: true
          description: The task ID.
      responses:
        '204':
          description: Owner removed
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  '/users/{userID}/password':
    post:
      operationId: PostUsersIDPassword
      tags:
        - Security and access endpoints
        - Users
      summary: Update a password
      description: |
        #### InfluxDB Cloud

        InfluxDB Cloud doesn't support changing user passwords through the API.
        Use the InfluxDB Cloud user interface to update your password.
      security:
        - BasicAuthentication: []
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: userID
          schema:
            type: string
          required: true
          description: The user ID.
      requestBody:
        description: New password
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PasswordResetBody'
      responses:
        '204':
          description: Password successfully updated
        '400':
          description: |
            Bad request.
            InfluxDB Cloud doesn't support changing passwords through the API and always responds with this status.
        default:
          description: Unsuccessful authentication
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /checks:
    get:
      operationId: GetChecks
      tags:
        - Checks
      summary: List all checks
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - $ref: '#/components/parameters/Offset'
        - $ref: '#/components/parameters/Limit'
        - in: query
          name: orgID
          required: true
          description: Only show checks that belong to a specific organization ID.
          schema:
            type: string
      responses:
        '200':
          description: A list of checks
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Checks'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    post:
      operationId: CreateCheck
      tags:
        - Checks
      summary: Add new check
      requestBody:
        description: Check to create
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PostCheck'
      responses:
        '201':
          description: Check created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Check'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  '/checks/{checkID}':
    get:
      operationId: GetChecksID
      tags:
        - Checks
      summary: Retrieve a check
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: checkID
          schema:
            type: string
          required: true
          description: The check ID.
      responses:
        '200':
          description: The check requested
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Check'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    put:
      operationId: PutChecksID
      tags:
        - Checks
      summary: Update a check
      requestBody:
        description: Check update to apply
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Check'
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: checkID
          schema:
            type: string
          required: true
          description: The check ID.
      responses:
        '200':
          description: An updated check
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Check'
        '404':
          description: The check was not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    patch:
      operationId: PatchChecksID
      tags:
        - Checks
      summary: Update a check
      requestBody:
        description: Check update to apply
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CheckPatch'
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: checkID
          schema:
            type: string
          required: true
          description: The check ID.
      responses:
        '200':
          description: An updated check
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Check'
        '404':
          description: The check was not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    delete:
      operationId: DeleteChecksID
      tags:
        - Checks
      summary: Delete a check
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: checkID
          schema:
            type: string
          required: true
          description: The check ID.
      responses:
        '204':
          description: Delete has been accepted
        '404':
          description: The check was not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  '/checks/{checkID}/labels':
    get:
      operationId: GetChecksIDLabels
      tags:
        - Checks
      summary: List all labels for a check
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: checkID
          schema:
            type: string
          required: true
          description: The check ID.
      responses:
        '200':
          description: A list of all labels for a check
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LabelsResponse'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    post:
      operationId: PostChecksIDLabels
      tags:
        - Checks
      summary: Add a label to a check
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: checkID
          schema:
            type: string
          required: true
          description: The check ID.
      requestBody:
        description: Label to add
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LabelMapping'
      responses:
        '201':
          description: The label was added to the check
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LabelResponse'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  '/checks/{checkID}/labels/{labelID}':
    delete:
      operationId: DeleteChecksIDLabelsID
      tags:
        - Checks
      summary: Delete label from a check
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: checkID
          schema:
            type: string
          required: true
          description: The check ID.
        - in: path
          name: labelID
          schema:
            type: string
          required: true
          description: The ID of the label to delete.
      responses:
        '204':
          description: Delete has been accepted
        '404':
          description: Check or label not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /notificationRules:
    get:
      operationId: GetNotificationRules
      tags:
        - NotificationRules
      summary: List all notification rules
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - $ref: '#/components/parameters/Offset'
        - $ref: '#/components/parameters/Limit'
        - in: query
          name: orgID
          required: true
          description: Only show notification rules that belong to a specific organization ID.
          schema:
            type: string
        - in: query
          name: checkID
          description: Only show notifications that belong to the specific check ID.
          schema:
            type: string
        - in: query
          name: tag
          description: Only return notification rules that "would match" statuses which contain the tag key value pairs provided.
          schema:
            type: string
            pattern: '^[a-zA-Z0-9_]+:[a-zA-Z0-9_]+$'
            example: 'env:prod'
      responses:
        '200':
          description: A list of notification rules
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotificationRules'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    post:
      operationId: CreateNotificationRule
      tags:
        - NotificationRules
      summary: Add a notification rule
      requestBody:
        description: Notification rule to create
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PostNotificationRule'
      responses:
        '201':
          description: Notification rule created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotificationRule'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  '/checks/{checkID}/query':
    get:
      operationId: GetChecksIDQuery
      tags:
        - Checks
      summary: Retrieve a check query
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: checkID
          schema:
            type: string
          required: true
          description: The check ID.
      responses:
        '200':
          description: The check query requested
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FluxResponse'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Check not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  '/notificationRules/{ruleID}':
    get:
      operationId: GetNotificationRulesID
      tags:
        - NotificationRules
      summary: Retrieve a notification rule
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: ruleID
          schema:
            type: string
          required: true
          description: The notification rule ID.
      responses:
        '200':
          description: The notification rule requested
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotificationRule'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    put:
      operationId: PutNotificationRulesID
      tags:
        - NotificationRules
      summary: Update a notification rule
      requestBody:
        description: Notification rule update to apply
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NotificationRule'
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: ruleID
          schema:
            type: string
          required: true
          description: The notification rule ID.
      responses:
        '200':
          description: An updated notification rule
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotificationRule'
        '404':
          description: The notification rule was not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    patch:
      operationId: PatchNotificationRulesID
      tags:
        - NotificationRules
      summary: Update a notification rule
      requestBody:
        description: Notification rule update to apply
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NotificationRuleUpdate'
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: ruleID
          schema:
            type: string
          required: true
          description: The notification rule ID.
      responses:
        '200':
          description: An updated notification rule
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotificationRule'
        '404':
          description: The notification rule was not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    delete:
      operationId: DeleteNotificationRulesID
      tags:
        - NotificationRules
      summary: Delete a notification rule
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: ruleID
          schema:
            type: string
          required: true
          description: The notification rule ID.
      responses:
        '204':
          description: Delete has been accepted
        '404':
          description: The check was not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  '/notificationRules/{ruleID}/labels':
    get:
      operationId: GetNotificationRulesIDLabels
      tags:
        - NotificationRules
      summary: List all labels for a notification rule
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: ruleID
          schema:
            type: string
          required: true
          description: The notification rule ID.
      responses:
        '200':
          description: A list of all labels for a notification rule
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LabelsResponse'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    post:
      operationId: PostNotificationRuleIDLabels
      tags:
        - NotificationRules
      summary: Add a label to a notification rule
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: ruleID
          schema:
            type: string
          required: true
          description: The notification rule ID.
      requestBody:
        description: Label to add
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LabelMapping'
      responses:
        '201':
          description: The label was added to the notification rule
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LabelResponse'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  '/notificationRules/{ruleID}/labels/{labelID}':
    delete:
      operationId: DeleteNotificationRulesIDLabelsID
      tags:
        - NotificationRules
      summary: Delete label from a notification rule
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: ruleID
          schema:
            type: string
          required: true
          description: The notification rule ID.
        - in: path
          name: labelID
          schema:
            type: string
          required: true
          description: The ID of the label to delete.
      responses:
        '204':
          description: Delete has been accepted
        '404':
          description: Rule or label not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  '/notificationRules/{ruleID}/query':
    get:
      operationId: GetNotificationRulesIDQuery
      tags:
        - Rules
      summary: Retrieve a notification rule query
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: ruleID
          schema:
            type: string
          required: true
          description: The notification rule ID.
      responses:
        '200':
          description: The notification rule query requested
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FluxResponse'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Notification rule not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /notificationEndpoints:
    get:
      operationId: GetNotificationEndpoints
      tags:
        - NotificationEndpoints
      summary: List all notification endpoints
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - $ref: '#/components/parameters/Offset'
        - $ref: '#/components/parameters/Limit'
        - in: query
          name: orgID
          required: true
          description: Only show notification endpoints that belong to specific organization ID.
          schema:
            type: string
      responses:
        '200':
          description: A list of notification endpoints
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotificationEndpoints'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    post:
      operationId: CreateNotificationEndpoint
      tags:
        - NotificationEndpoints
      summary: Add a notification endpoint
      requestBody:
        description: Notification endpoint to create
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PostNotificationEndpoint'
      responses:
        '201':
          description: Notification endpoint created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotificationEndpoint'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  '/notificationEndpoints/{endpointID}':
    get:
      operationId: GetNotificationEndpointsID
      tags:
        - NotificationEndpoints
      summary: Retrieve a notification endpoint
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: endpointID
          schema:
            type: string
          required: true
          description: The notification endpoint ID.
      responses:
        '200':
          description: The notification endpoint requested
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotificationEndpoint'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    put:
      operationId: PutNotificationEndpointsID
      tags:
        - NotificationEndpoints
      summary: Update a notification endpoint
      requestBody:
        description: A new notification endpoint to replace the existing endpoint with
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NotificationEndpoint'
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: endpointID
          schema:
            type: string
          required: true
          description: The notification endpoint ID.
      responses:
        '200':
          description: An updated notification endpoint
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotificationEndpoint'
        '404':
          description: The notification endpoint was not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    patch:
      operationId: PatchNotificationEndpointsID
      tags:
        - NotificationEndpoints
      summary: Update a notification endpoint
      requestBody:
        description: Check update to apply
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NotificationEndpointUpdate'
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: endpointID
          schema:
            type: string
          required: true
          description: The notification endpoint ID.
      responses:
        '200':
          description: An updated notification endpoint
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotificationEndpoint'
        '404':
          description: The notification endpoint was not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    delete:
      operationId: DeleteNotificationEndpointsID
      tags:
        - NotificationEndpoints
      summary: Delete a notification endpoint
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: endpointID
          schema:
            type: string
          required: true
          description: The notification endpoint ID.
      responses:
        '204':
          description: Delete has been accepted
        '404':
          description: The endpoint was not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  '/notificationEndpoints/{endpointID}/labels':
    get:
      operationId: GetNotificationEndpointsIDLabels
      tags:
        - NotificationEndpoints
      summary: List all labels for a notification endpoint
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: endpointID
          schema:
            type: string
          required: true
          description: The notification endpoint ID.
      responses:
        '200':
          description: A list of all labels for a notification endpoint
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LabelsResponse'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    post:
      operationId: PostNotificationEndpointIDLabels
      tags:
        - NotificationEndpoints
      summary: Add a label to a notification endpoint
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: endpointID
          schema:
            type: string
          required: true
          description: The notification endpoint ID.
      requestBody:
        description: Label to add
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LabelMapping'
      responses:
        '201':
          description: The label was added to the notification endpoint
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LabelResponse'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  '/notificationEndpoints/{endpointID}/labels/{labelID}':
    delete:
      operationId: DeleteNotificationEndpointsIDLabelsID
      tags:
        - NotificationEndpoints
      summary: Delete a label from a notification endpoint
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: endpointID
          schema:
            type: string
          required: true
          description: The notification endpoint ID.
        - in: path
          name: labelID
          schema:
            type: string
          required: true
          description: The ID of the label to delete.
      responses:
        '204':
          description: Delete has been accepted
        '404':
          description: Endpoint or label not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /debug/pprof/all:
    get:
      operationId: GetDebugPprofAllProfiles
      tags:
        - Debug
        - System information endpoints
      summary: Retrieve all runtime profiles
      description: |
        Collects samples and returns reports for the following [Go runtime profiles](https://pkg.go.dev/runtime/pprof):

        - **allocs**: All past memory allocations
        - **block**: Stack traces that led to blocking on synchronization primitives
        - **cpu**: (Optional) Program counters sampled from the executing stack.
          Include by passing the `cpu` query parameter with a [duration](https://docs.influxdata.com/influxdb/v2.3/reference/glossary/#duration) value.
          Equivalent to the report from [`GET /debug/pprof/profile?seconds=NUMBER_OF_SECONDS`](#operation/GetDebugPprofProfile).
        - **goroutine**: All current goroutines
        - **heap**: Memory allocations for live objects
        - **mutex**: Holders of contended mutexes
        - **threadcreate**: Stack traces that led to the creation of new OS threads
      x-codeSamples:
        - lang: Shell
          label: 'Shell: Get all profiles'
          source: |
            # Download and extract a `tar.gz` of all profiles after 10 seconds of CPU sampling.

            curl "http://localhost:8086/debug/pprof/all?cpu=10s" | tar -xz

            # x profiles/cpu.pb.gz
            # x profiles/goroutine.pb.gz
            # x profiles/block.pb.gz
            # x profiles/mutex.pb.gz
            # x profiles/heap.pb.gz
            # x profiles/allocs.pb.gz
            # x profiles/threadcreate.pb.gz

            # Analyze a profile.

            go tool pprof profiles/heap.pb.gz
        - lang: Shell
          label: 'Shell: Get all profiles except CPU'
          source: |
            # Download and extract a `tar.gz` of all profiles except CPU.

            curl http://localhost:8086/debug/pprof/all | tar -xz

            # x profiles/goroutine.pb.gz
            # x profiles/block.pb.gz
            # x profiles/mutex.pb.gz
            # x profiles/heap.pb.gz
            # x profiles/allocs.pb.gz
            # x profiles/threadcreate.pb.gz

            # Analyze a profile.

            go tool pprof profiles/heap.pb.gz
      servers:
        - url: ''
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: query
          name: cpu
          description: |
            Collects and returns CPU profiling data for the specified [duration](https://docs.influxdata.com/influxdb/v2.3/reference/glossary/#duration).
          schema:
            type: string
            format: duration
            externalDocs:
              description: InfluxDB duration
              url: 'https://docs.influxdata.com/influxdb/latest/reference/glossary/#duration'
      responses:
        '200':
          description: |
            [Go runtime profile](https://pkg.go.dev/runtime/pprof) reports.
          content:
            application/octet-stream:
              schema:
                description: |
                  GZIP compressed TAR file (`.tar.gz`) that contains
                  [Go runtime profile](https://pkg.go.dev/runtime/pprof) reports.
                type: string
                format: binary
                externalDocs:
                  description: Golang pprof package
                  url: 'https://pkg.go.dev/net/http/pprof'
        default:
          description: Unexpected error
          $ref: '#/components/responses/GeneralServerError'
  /debug/pprof/allocs:
    get:
      operationId: GetDebugPprofAllocs
      tags:
        - Debug
        - System information endpoints
      summary: Retrieve the memory allocations runtime profile
      description: |
        Returns a [Go runtime profile](https://pkg.go.dev/runtime/pprof) report of
        all past memory allocations.
        **allocs** is the same as the **heap** profile,
        but changes the default [pprof](https://pkg.go.dev/runtime/pprof)
        display to __-alloc_space__,
        the total number of bytes allocated since the program began (including garbage-collected bytes).
      x-codeSamples:
        - lang: Shell
          label: 'Shell: go tool pprof'
          source: |
            # Analyze the profile in interactive mode.

            go tool pprof http://localhost:8086/debug/pprof/allocs

            # `pprof` returns the following prompt:
            #   Entering interactive mode (type "help" for commands, "o" for options)
            #   (pprof)

            # At the prompt, get the top N memory allocations.

            (pprof) top10
      servers:
        - url: ''
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: query
          name: debug
          description: |
            - `0`: (Default) Return the report as a gzip-compressed protocol buffer.
            - `1`: Return a response body with the report formatted as human-readable text.
              The report contains comments that translate addresses to function names and line numbers for debugging.

            `debug=1` is mutually exclusive with the `seconds` query parameter.
          schema:
            type: integer
            format: int64
            enum:
              - 0
              - 1
        - in: query
          name: seconds
          description: |
            Number of seconds to collect statistics.

            `seconds` is mutually exclusive with `debug=1`.
          schema:
            type: string
            format: int64
      responses:
        '200':
          description: |
            [Go runtime profile](https://pkg.go.dev/runtime/pprof) report compatible
            with [pprof](https://github.com/google/pprof) analysis and visualization tools.
            If debug is enabled (`?debug=1`), response body contains a human-readable profile.
          content:
            application/octet-stream:
              schema:
                description: |
                  [Go runtime profile](https://pkg.go.dev/runtime/pprof) report in protocol buffer format.
                type: string
                format: binary
                externalDocs:
                  description: Golang pprof package
                  url: 'https://pkg.go.dev/net/http/pprof'
            text/plain:
              schema:
                description: |
                  Response body contains a report formatted in plain text.
                  The report contains comments that translate addresses to
                  function names and line numbers for debugging.
                type: string
                format: Go runtime profile
                externalDocs:
                  description: Golang pprof package
                  url: 'https://pkg.go.dev/net/http/pprof'
        default:
          description: Unexpected error
          $ref: '#/components/responses/GeneralServerError'
  /debug/pprof/block:
    get:
      operationId: GetDebugPprofBlock
      tags:
        - Debug
        - System information endpoints
      summary: Retrieve the block runtime profile
      description: |
        Collects samples and returns a [Go runtime profile](https://pkg.go.dev/runtime/pprof)
        report of stack traces that led to blocking on synchronization primitives.
      x-codeSamples:
        - lang: Shell
          label: 'Shell: go tool pprof'
          source: |
            # Analyze the profile in interactive mode.

            go tool pprof http://localhost:8086/debug/pprof/block

            # `pprof` returns the following prompt:
            #   Entering interactive mode (type "help" for commands, "o" for options)
            #   (pprof)

            #  At the prompt, get the top N entries.

            (pprof) top10
      servers:
        - url: ''
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: query
          name: debug
          description: |
            - `0`: (Default) Return the report as a gzip-compressed protocol buffer.
            - `1`: Return a response body with the report formatted as human-readable text.
              The report contains comments that translate addresses to function names and line numbers for debugging.

            `debug=1` is mutually exclusive with the `seconds` query parameter.
          schema:
            type: integer
            format: int64
            enum:
              - 0
              - 1
        - in: query
          name: seconds
          description: |
            Number of seconds to collect statistics.

            `seconds` is mutually exclusive with `debug=1`.
          schema:
            type: string
            format: int64
      responses:
        '200':
          description: |
            [Go runtime profile](https://pkg.go.dev/runtime/pprof) report compatible
            with [pprof](https://github.com/google/pprof) analysis and visualization tools.
            If debug is enabled (`?debug=1`), response body contains a human-readable profile.
          content:
            application/octet-stream:
              schema:
                description: |
                  [Go runtime profile](https://pkg.go.dev/runtime/pprof) report in protocol buffer format.
                type: string
                format: binary
                externalDocs:
                  description: Golang pprof package
                  url: 'https://pkg.go.dev/net/http/pprof'
            text/plain:
              schema:
                description: |
                  Response body contains a report formatted in plain text.
                  The report contains comments that translate addresses to
                  function names and line numbers for debugging.
                type: string
                format: Go runtime profile
                externalDocs:
                  description: Golang pprof package
                  url: 'https://pkg.go.dev/net/http/pprof'
        default:
          description: Unexpected error
          $ref: '#/components/responses/GeneralServerError'
  /debug/pprof/cmdline:
    get:
      operationId: GetDebugPprofCmdline
      tags:
        - Debug
        - System information endpoints
      summary: Retrieve the command line invocation
      description: |
        Returns the command line that invoked InfluxDB.
      servers:
        - url: ''
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
      responses:
        '200':
          description: Command line invocation.
          content:
            text/plain:
              schema:
                type: string
                format: Command line
        default:
          description: Unexpected error
          $ref: '#/components/responses/GeneralServerError'
  /debug/pprof/goroutine:
    get:
      operationId: GetDebugPprofGoroutine
      tags:
        - Debug
        - System information endpoints
      summary: Retrieve the goroutines runtime profile
      description: |
        Collects statistics and returns a [Go runtime profile](https://pkg.go.dev/runtime/pprof)
        report of all current goroutines.
      x-codeSamples:
        - lang: Shell
          label: 'Shell: go tool pprof'
          source: |
            # Analyze the profile in interactive mode.

            go tool pprof http://localhost:8086/debug/pprof/goroutine

            # `pprof` returns the following prompt:
            #   Entering interactive mode (type "help" for commands, "o" for options)
            #   (pprof)

            #  At the prompt, get the top N entries.

            (pprof) top10
      servers:
        - url: ''
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: query
          name: debug
          description: |
            - `0`: (Default) Return the report as a gzip-compressed protocol buffer.
            - `1`: Return a response body with the report formatted as
                   human-readable text with comments that translate addresses to
                   function names and line numbers for debugging.

            `debug=1` is mutually exclusive with the `seconds` query parameter.
          schema:
            type: integer
            format: int64
            enum:
              - 0
              - 1
        - in: query
          name: seconds
          description: |
            Number of seconds to collect statistics.

            `seconds` is mutually exclusive with `debug=1`.
          schema:
            type: string
            format: int64
      responses:
        '200':
          description: |
            [Go runtime profile](https://pkg.go.dev/runtime/pprof) report compatible
            with [pprof](https://github.com/google/pprof) analysis and visualization tools.
            If debug is enabled (`?debug=1`), response body contains a human-readable profile.
          content:
            application/octet-stream:
              schema:
                description: |
                  [Go runtime profile](https://pkg.go.dev/runtime/pprof) report in protocol buffer format.
                type: string
                format: binary
                externalDocs:
                  description: Golang pprof package
                  url: 'https://pkg.go.dev/net/http/pprof'
            text/plain:
              schema:
                description: |
                  Response body contains a report formatted in plain text.
                  The report contains comments that translate addresses to
                  function names and line numbers for debugging.
                type: string
                format: Go runtime profile
                externalDocs:
                  description: Golang pprof package
                  url: 'https://pkg.go.dev/net/http/pprof'
        default:
          description: Unexpected error
          $ref: '#/components/responses/GeneralServerError'
  /debug/pprof/heap:
    get:
      operationId: GetDebugPprofHeap
      tags:
        - Debug
        - System information endpoints
      summary: Retrieve the heap runtime profile
      description: |
        Collects statistics and returns a [Go runtime profile](https://pkg.go.dev/runtime/pprof)
        report of memory allocations for live objects.

        To run **garbage collection** before sampling,
        pass the `gc` query parameter with a value of `1`.
      x-codeSamples:
        - lang: Shell
          label: 'Shell: go tool pprof'
          source: |
            # Analyze the profile in interactive mode.

            go tool pprof http://localhost:8086/debug/pprof/heap

            # `pprof` returns the following prompt:
            #   Entering interactive mode (type "help" for commands, "o" for options)
            #   (pprof)

            # At the prompt, get the top N memory-intensive nodes.

            (pprof) top10

            # pprof displays the list:
            #   Showing nodes accounting for 142.46MB, 85.43% of 166.75MB total
            #   Dropped 895 nodes (cum <= 0.83MB)
            #   Showing top 10 nodes out of 143
      servers:
        - url: ''
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: query
          name: debug
          description: |
            - `0`: (Default) Return the report as a gzip-compressed protocol buffer.
            - `1`: Return a response body with the report formatted as human-readable text.
              The report contains comments that translate addresses to function names and line numbers for debugging.

            `debug=1` is mutually exclusive with the `seconds` query parameter.
          schema:
            type: integer
            format: int64
            enum:
              - 0
              - 1
        - in: query
          name: seconds
          description: |
            Number of seconds to collect statistics.

            `seconds` is mutually exclusive with `debug=1`.
          schema:
            type: string
            format: int64
        - in: query
          name: gc
          description: |
            - `0`: (Default) don't force garbage collection before sampling.
            - `1`: Force garbage collection before sampling.
          schema:
            type: integer
            format: int64
            enum:
              - 0
              - 1
      responses:
        '200':
          description: |
            [Go runtime profile](https://pkg.go.dev/runtime/pprof) report compatible
            with [pprof](https://github.com/google/pprof) analysis and visualization tools.
            If debug is enabled (`?debug=1`), response body contains a human-readable profile.
          content:
            application/octet-stream:
              schema:
                description: |
                  [Go runtime profile](https://pkg.go.dev/runtime/pprof) report in protocol buffer format.
                type: string
                format: binary
                externalDocs:
                  description: Golang pprof package
                  url: 'https://pkg.go.dev/net/http/pprof'
            text/plain:
              schema:
                description: |
                  Response body contains a report formatted in plain text.
                  The report contains comments that translate addresses to
                  function names and line numbers for debugging.
                type: string
                format: Go runtime profile
                externalDocs:
                  description: Golang pprof package
                  url: 'https://pkg.go.dev/net/http/pprof'
              examples:
                profileDebugResponse:
                  summary: Profile in plain text
                  value: "heap profile: 12431: 137356528 [149885081: 846795139976] @ heap/8192\n23: 17711104 [46: 35422208] @ 0x4c6df65 0x4ce03ec 0x4cdf3c5 0x4c6f4db 0x4c9edbc 0x4bdefb3 0x4bf822a 0x567d158 0x567ced9 0x406c0a1\n#\t0x4c6df64\tgithub.com/influxdata/influxdb/v2/tsdb/engine/tsm1.(*entry).add+0x1a4\t\t\t\t\t/Users/me/github/influxdb/tsdb/engine/tsm1/cache.go:97\n#\t0x4ce03eb\tgithub.com/influxdata/influxdb/v2/tsdb/engine/tsm1.(*partition).write+0x2ab\t\t\t\t/Users/me/github/influxdb/tsdb/engine/tsm1/ring.go:229\n#\t0x4cdf3c4\tgithub.com/influxdata/influxdb/v2/tsdb/engine/tsm1.(*ring).write+0xa4\t\t\t\t\t/Users/me/github/influxdb/tsdb/engine/tsm1/ring.go:95\n#\t0x4c6f4da\tgithub.com/influxdata/influxdb/v2/tsdb/engine/tsm1.(*Cache).WriteMulti+0x31a\t\t\t\t/Users/me/github/influxdb/tsdb/engine/tsm1/cache.go:343\n"
        default:
          description: Unexpected error
          $ref: '#/components/responses/GeneralServerError'
  /debug/pprof/mutex:
    get:
      operationId: GetDebugPprofMutex
      tags:
        - Debug
        - System information endpoints
      summary: Retrieve the mutual exclusion (mutex) runtime profile
      description: |
        Collects statistics and returns a [Go runtime profile](https://pkg.go.dev/runtime/pprof) report of
        lock contentions.
        The profile contains stack traces of holders of contended mutual exclusions (mutexes).
      x-codeSamples:
        - lang: Shell
          label: 'Shell: go tool pprof'
          source: |
            # Analyze the profile in interactive mode.

            go tool pprof http://localhost:8086/debug/pprof/mutex

            # `pprof` returns the following prompt:
            #   Entering interactive mode (type "help" for commands, "o" for options)
            #   (pprof)

            #  At the prompt, get the top N entries.

            (pprof) top10
      servers:
        - url: ''
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: query
          name: debug
          description: |
            - `0`: (Default) Return the report as a gzip-compressed protocol buffer.
            - `1`: Return a response body with the report formatted as human-readable text.
              The report contains comments that translate addresses to function names and line numbers for debugging.

            `debug=1` is mutually exclusive with the `seconds` query parameter.
          schema:
            type: integer
            format: int64
            enum:
              - 0
              - 1
        - in: query
          name: seconds
          description: |
            Number of seconds to collect statistics.

            `seconds` is mutually exclusive with `debug=1`.
          schema:
            type: string
            format: int64
      responses:
        '200':
          description: |
            [Go runtime profile](https://pkg.go.dev/runtime/pprof) report compatible
            with [pprof](https://github.com/google/pprof) analysis and visualization tools.
            If debug is enabled (`?debug=1`), response body contains a human-readable profile.
          content:
            application/octet-stream:
              schema:
                description: |
                  [Go runtime profile](https://pkg.go.dev/runtime/pprof) report in protocol buffer format.
                type: string
                format: binary
                externalDocs:
                  description: Golang pprof package
                  url: 'https://pkg.go.dev/net/http/pprof'
            text/plain:
              schema:
                description: |
                  Response body contains a report formatted in plain text.
                  The report contains comments that translate addresses to
                  function names and line numbers for debugging.
                type: string
                format: Go runtime profile
                externalDocs:
                  description: Golang pprof package
                  url: 'https://pkg.go.dev/net/http/pprof'
        default:
          description: Unexpected error
          $ref: '#/components/responses/GeneralServerError'
  /debug/pprof/profile:
    get:
      operationId: GetDebugPprofProfile
      tags:
        - Debug
        - System information endpoints
      summary: Retrieve the CPU runtime profile
      description: |
        Collects statistics and returns a [Go runtime profile](https://pkg.go.dev/runtime/pprof)
        report of program counters on the executing stack.
      x-codeSamples:
        - lang: Shell
          label: 'Shell: go tool pprof'
          source: |
            # Download the profile report.

            curl http://localhost:8086/debug/pprof/profile -o cpu

            # Analyze the profile in interactive mode.

            go tool pprof ./cpu

            # At the prompt, get the top N functions most often running
            # or waiting during the sample period.

            (pprof) top10
      servers:
        - url: ''
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: query
          name: seconds
          description: Number of seconds to collect profile data. Default is `30` seconds.
          schema:
            type: string
            format: int64
      responses:
        '200':
          description: |
            [Go runtime profile](https://pkg.go.dev/runtime/pprof) report compatible
            with [pprof](https://github.com/google/pprof) analysis and visualization tools.
          content:
            application/octet-stream:
              schema:
                description: |
                  [Go runtime profile](https://pkg.go.dev/runtime/pprof) report in protocol buffer format.
                type: string
                format: binary
                externalDocs:
                  description: Golang pprof package
                  url: 'https://pkg.go.dev/net/http/pprof'
        default:
          description: Unexpected error
          $ref: '#/components/responses/GeneralServerError'
  /debug/pprof/threadcreate:
    get:
      operationId: GetDebugPprofThreadCreate
      tags:
        - Debug
        - System information endpoints
      summary: Retrieve the threadcreate runtime profile
      description: |
        Collects statistics and returns a [Go runtime profile](https://pkg.go.dev/runtime/pprof)
        report of stack traces that led to the creation of new OS threads.
      x-codeSamples:
        - lang: Shell
          label: 'Shell: go tool pprof'
          source: |
            # Analyze the profile in interactive mode.

            go tool pprof http://localhost:8086/debug/pprof/threadcreate

            # `pprof` returns the following prompt:
            #   Entering interactive mode (type "help" for commands, "o" for options)
            #   (pprof)

            #  At the prompt, get the top N entries.

            (pprof) top10
      servers:
        - url: ''
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: query
          name: debug
          description: |
            - `0`: (Default) Return the report as a gzip-compressed protocol buffer.
            - `1`: Return a response body with the report formatted as human-readable text.
              The report contains comments that translate addresses to function names and line numbers for debugging.

            `debug=1` is mutually exclusive with the `seconds` query parameter.
          schema:
            type: integer
            format: int64
            enum:
              - 0
              - 1
        - in: query
          name: seconds
          description: |
            Number of seconds to collect statistics.

            `seconds` is mutually exclusive with `debug=1`.
          schema:
            type: string
            format: int64
      responses:
        '200':
          description: |
            [Go runtime profile](https://pkg.go.dev/runtime/pprof) report compatible
            with [pprof](https://github.com/google/pprof) analysis and visualization tools.
            If debug is enabled (`?debug=1`), response body contains a human-readable profile.
          content:
            application/octet-stream:
              schema:
                description: |
                  [Go runtime profile](https://pkg.go.dev/runtime/pprof) report in protocol buffer format.
                type: string
                format: binary
                externalDocs:
                  description: Golang pprof package
                  url: 'https://pkg.go.dev/net/http/pprof'
            text/plain:
              schema:
                description: |
                  Response body contains a report formatted in plain text.
                  The report contains comments that translate addresses to
                  function names and line numbers for debugging.
                type: string
                format: Go runtime profile
                externalDocs:
                  description: Golang pprof package
                  url: 'https://pkg.go.dev/net/http/pprof'
              examples:
                profileDebugResponse:
                  summary: Profile in plain text
                  value: "threadcreate profile: total 26\n25 @\n#\t0x0\n\n1 @ 0x403dda8 0x403e54b 0x403e810 0x403a90c 0x406c0a1\n#\t0x403dda7\truntime.allocm+0xc7\t\t\t/Users/me/.gvm/gos/go1.17/src/runtime/proc.go:1877\n#\t0x403e54a\truntime.newm+0x2a\t\t\t/Users/me/.gvm/gos/go1.17/src/runtime/proc.go:2201\n#\t0x403e80f\truntime.startTemplateThread+0x8f\t/Users/me/.gvm/gos/go1.17/src/runtime/proc.go:2271\n#\t0x403a90b\truntime.main+0x1cb\t\t\t/Users/me/.gvm/gos/go1.17/src/runtime/proc.go:234\n"
        default:
          description: Unexpected error
          $ref: '#/components/responses/GeneralServerError'
  /debug/pprof/trace:
    get:
      operationId: GetDebugPprofTrace
      tags:
        - Debug
        - System information endpoints
      summary: Retrieve the runtime execution trace
      description: |
        Collects profile data and returns trace execution events for the current program.
      x-codeSamples:
        - lang: Shell
          label: 'Shell: go tool trace'
          source: |
            # Download the trace file.

            curl http://localhost:8086/debug/pprof/trace -o trace

            # Analyze the trace.

            go tool trace ./trace
      servers:
        - url: ''
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: query
          name: seconds
          description: Number of seconds to collect profile data.
          schema:
            type: string
            format: int64
      responses:
        '200':
          description: |
            [Trace file](https://pkg.go.dev/runtime/trace) compatible
            with the [Golang `trace` command](https://pkg.go.dev/cmd/trace).
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
                externalDocs:
                  description: Golang trace package
                  url: 'https://pkg.go.dev/runtime/trace'
        default:
          description: Unexpected error
          $ref: '#/components/responses/GeneralServerError'
  /health:
    get:
      operationId: GetHealth
      tags:
        - Health
        - System information endpoints
      summary: Retrieve the health of the instance
      description: Returns the health of the instance.
      servers:
        - url: ''
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
      responses:
        '200':
          description: |
            The instance is healthy.
            The response body contains the health check items and status.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HealthCheck'
        '503':
          description: The instance is unhealthy.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HealthCheck'
        default:
          description: Unexpected error
          $ref: '#/components/responses/GeneralServerError'
  /metrics:
    get:
      operationId: GetMetrics
      tags:
        - Metrics
        - System information endpoints
      summary: Retrieve workload performance metrics
      description: |
        Returns metrics about the workload performance of an InfluxDB instance.

        Use this endpoint to get performance, resource, and usage metrics.

        #### Related guides

        - For the list of metrics categories, see [InfluxDB OSS metrics](https://docs.influxdata.com/influxdb/v2.3/reference/internals/metrics/).
        - Learn how to use InfluxDB to [scrape Prometheus metrics](https://docs.influxdata.com/influxdb/v2.3/write-data/developer-tools/scrape-prometheus-metrics/).
        - Learn how InfluxDB [parses the Prometheus exposition format](https://docs.influxdata.com/influxdb/v2.3/reference/prometheus-metrics/).
      servers:
        - url: ''
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
      responses:
        '200':
          description: |
            Success. The response body contains metrics in
            [Prometheus plain-text exposition format](https://prometheus.io/docs/instrumenting/exposition_formats)
            Metrics contain a name, an optional set of key-value pairs, and a value.

            The following descriptors precede each metric:

            - `HELP`: description of the metric
            - `TYPE`: [Prometheus metric type](https://prometheus.io/docs/concepts/metric_types/) (`counter`, `gauge`, `histogram`, or `summary`)
          content:
            text/plain:
              schema:
                type: string
                format: Prometheus text-based exposition
                externalDocs:
                  description: Prometheus exposition formats
                  url: 'https://prometheus.io/docs/instrumenting/exposition_formats'
              examples:
                expositionResponse:
                  summary: Metrics in plain text
                  value: |
                    # HELP go_threads Number of OS threads created.
                    # TYPE go_threads gauge
                    go_threads 19
                    # HELP http_api_request_duration_seconds Time taken to respond to HTTP request
                    # TYPE http_api_request_duration_seconds histogram
                    http_api_request_duration_seconds_bucket{handler="platform",method="GET",path="/:fallback_path",response_code="200",status="2XX",user_agent="curl",le="0.005"} 4
                    http_api_request_duration_seconds_bucket{handler="platform",method="GET",path="/:fallback_path",response_code="200",status="2XX",user_agent="curl",le="0.01"} 4
                    http_api_request_duration_seconds_bucket{handler="platform",method="GET",path="/:fallback_path",response_code="200",status="2XX",user_agent="curl",le="0.025"} 5
        default:
          description: Unexpected error
          $ref: '#/components/responses/GeneralServerError'
  /ready:
    get:
      operationId: GetReady
      tags:
        - Ready
        - System information endpoints
      summary: Get the readiness of an instance at startup
      servers:
        - url: ''
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
      responses:
        '200':
          description: The instance is ready
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Ready'
        default:
          description: Unexpected error
          $ref: '#/components/responses/GeneralServerError'
  /users:
    get:
      operationId: GetUsers
      tags:
        - Security and access endpoints
        - Users
      summary: List users
      description: |
        Retrieves a list of users. Default limit is `20`.

        To limit which users are returned, pass query parameters in your request.

        #### Required permissions

        - `read-user USER_ID` permission.
          `USER_ID` is the ID of the user that you want to list.
        - InfluxDB OSS requires an _[operator token](https://docs.influxdata.com/influxdb/latest/security/tokens/#operator-token))_ to list all users.
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - $ref: '#/components/parameters/Offset'
        - $ref: '#/components/parameters/Limit'
        - $ref: '#/components/parameters/After'
        - in: query
          name: name
          schema:
            type: string
        - in: query
          name: id
          schema:
            type: string
      responses:
        '200':
          description: Success. The response contains a list of `users`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Users'
        '401':
          description: |
            Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                tokenNotAuthorized:
                  summary: 'API token doesn''t have `write:users` permission'
                  value:
                    code: unauthorized
                    message: 'write:users/09d8462ce0764000 is unauthorized'
        '422':
          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.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          $ref: '#/components/responses/InternalServerError'
        default:
          description: Unexpected error
          $ref: '#/components/responses/GeneralServerError'
    post:
      operationId: PostUsers
      tags:
        - Users
      summary: Create a user
      description: |
        Creates a user and returns the newly created user.

        #### Required permissions

        - `write-users`. Requires an InfluxDB API **Op** token.
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
      requestBody:
        description: The user to create.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/User'
      responses:
        '201':
          description: |
            Success.
            The response contains the newly created user.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserResponse'
        '401':
          description: |
            Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                tokenNotAuthorized:
                  summary: 'API token doesn''t have `write:users` permission'
                  value:
                    code: unauthorized
                    message: 'write:users/09d8462ce0764000 is unauthorized'
        '422':
          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.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          $ref: '#/components/responses/InternalServerError'
        default:
          description: Unexpected error
          $ref: '#/components/responses/GeneralServerError'
      x-codeSamples:
        - label: 'cURL: create a user and set a password'
          lang: Shell
          source: |
            # Create the user and assign the user ID to a variable.
            USER_ID=$(curl --request POST \
                    "http://localhost:8086/api/v2/users/" \
                    --header "Authorization: Token INFLUX_OP_TOKEN" \
                    --header 'Content-type: application/json' \
                    --data-binary @- << EOF | jq -r '.id'
                    {
                      "name": "USER_NAME",
                      "status": "active"
                    }
            EOF
            )

            # Pass the user ID and a password to set the password for the user.
            curl request POST "http://localhost:8086/api/v2/users/$USER_ID/password/" \
              --header "Authorization: Token INFLUX_OP_TOKEN" \
              --header 'Content-type: application/json' \
              --data '{ "password": "USER_PASSWORD" }'
  '/users/{userID}':
    get:
      operationId: GetUsersID
      tags:
        - Security and access endpoints
        - Users
      summary: Retrieve a user
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: userID
          schema:
            type: string
          required: true
          description: The user ID.
      responses:
        '200':
          description: User details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserResponse'
        default:
          description: Unexpected error
          $ref: '#/components/responses/GeneralServerError'
    patch:
      operationId: PatchUsersID
      tags:
        - Users
      summary: Update a user
      requestBody:
        description: User update to apply
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/User'
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: userID
          schema:
            type: string
          required: true
          description: The ID of the user to update.
      responses:
        '200':
          description: User updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserResponse'
        default:
          description: Unexpected error
          $ref: '#/components/responses/GeneralServerError'
    delete:
      operationId: DeleteUsersID
      tags:
        - Users
      summary: Delete a user
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: userID
          schema:
            type: string
          required: true
          description: The ID of the user to delete.
      responses:
        '204':
          description: User deleted
        default:
          description: Unexpected error
          $ref: '#/components/responses/GeneralServerError'
  /setup:
    get:
      operationId: GetSetup
      tags:
        - Setup
      summary: 'Check if database has default user, org, bucket'
      description: 'Returns `true` if no default user, organization, or bucket has been created.'
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
      responses:
        '200':
          description: allowed true or false
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IsOnboarding'
    post:
      operationId: PostSetup
      tags:
        - Setup
      summary: 'Set up initial user, org and bucket'
      description: 'Post an onboarding request to set up initial user, org and bucket.'
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
      requestBody:
        description: Source to create
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OnboardingRequest'
      responses:
        '201':
          description: 'Created default user, bucket, org'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OnboardingResponse'
        default:
          description: Unexpected error
          $ref: '#/components/responses/GeneralServerError'
  /authorizations:
    get:
      operationId: GetAuthorizations
      tags:
        - Authorizations
        - Security and access endpoints
      summary: List authorizations
      description: |
        Retrieves a list of authorizations.

        To limit which authorizations are returned, pass query parameters in your request.
        If no query parameters are passed, InfluxDB returns all authorizations.

        #### InfluxDB Cloud

        - Doesn't expose [API token](https://docs.influxdata.com/influxdb/v2.3/reference/glossary/#token) values in `GET /api/v2/authorizations` responses; returns `token: redacted` for all authorizations.

        #### InfluxDB OSS

        - Returns
          [API token](https://docs.influxdata.com/influxdb/v2.3/reference/glossary/#token) values in authorizations.
        - Requires an _[operator token](https://docs.influxdata.com/influxdb/latest/security/tokens/#operator-token))_ to view authorizations.

        #### Related guides

        - [View tokens](https://docs.influxdata.com/influxdb/v2.3/security/tokens/view-tokens/).
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: query
          name: userID
          schema:
            type: string
          description: |
            A user ID.
            Only returns authorizations scoped to this user.
        - in: query
          name: user
          schema:
            type: string
          description: |
            A user name.
            Only returns authorizations scoped to this user.
        - in: query
          name: orgID
          schema:
            type: string
          description: An organization ID. Only returns authorizations that belong to this organization.
        - in: query
          name: org
          schema:
            type: string
          description: |
            An organization name.
            Only returns authorizations that belong to this organization.
      responses:
        '200':
          description: Success. The response body contains a list of authorizations.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Authorizations'
        '400':
          description: Invalid request
          $ref: '#/components/responses/GeneralServerError'
        '401':
          $ref: '#/components/responses/AuthorizationError'
        '500':
          $ref: '#/components/responses/InternalServerError'
        default:
          description: Unexpected error
          $ref: '#/components/responses/GeneralServerError'
    post:
      operationId: PostAuthorizations
      tags:
        - Authorizations
      summary: Create an authorization
      description: |
        Creates an authorization and returns the newly created authorization.

        Use this endpoint to generate an API token with resource permissions.
        A permission sets `read` or `write` access to a `type` of resource.

        Keep the following in mind when creating and updating authorizations:

        - A permission with a resource `id` applies only to the resource specified by the ID.
        - A permission that doesn't have a resource `id` applies to all resources of resource `type`.
        - To scope an authorization to a specific user, provide the `userID` property.

        #### Related guides

        - [Create a token](https://docs.influxdata.com/influxdb/v2.3/security/tokens/create-token/).
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
      requestBody:
        description: The authorization to create.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AuthorizationPostRequest'
      responses:
        '201':
          description: Created. The response body contains the newly created authorization.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Authorization'
        '400':
          description: Invalid request
          $ref: '#/components/responses/GeneralServerError'
        '401':
          $ref: '#/components/responses/AuthorizationError'
        '500':
          $ref: '#/components/responses/InternalServerError'
        default:
          description: Unexpected error
          $ref: '#/components/responses/GeneralServerError'
      x-codeSample:
        - lang: Shell
          label: 'cURL: Create auth to read all buckets'
          source: |
            curl --request POST \
            "http://localhost:8086/api/v2/authorizations" \
            --header "Authorization: Token INFLUX_TOKEN" \
            --header 'Content-Type: application/json' \
            --data @- << EOF
              {
                "orgID": "INFLUX_ORG_ID",
                "description": "iot_users read buckets",
                "permissions": [
                  {"action": "read", "resource": {"type": "buckets"}}
                ]
              }
            EOF
        - lang: Shell
        - label: 'cURL: Create auth scoped to a user'
        - source: |
            curl --request POST \
            "http://localhost:8086/api/v2/authorizations" \
            --header "Authorization: Token INFLUX_TOKEN" \
            --header 'Content-Type: application/json' \
            --data @- << EOF
              {
                "orgID": "INFLUX_ORG_ID",
                "userID": "INFLUX_USER_ID",
                "description": "iot_user write to bucket",
                "permissions": [
                  {"action": "write", "resource": {"type": "buckets", "id: "INFLUX_BUCKET_ID"}}
                ]
              }
            EOF
  '/authorizations/{authID}':
    get:
      operationId: GetAuthorizationsID
      tags:
        - Authorizations
        - Security and access endpoints
      summary: Retrieve an authorization
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: authID
          schema:
            type: string
          required: true
          description: The ID of the authorization to get.
      responses:
        '200':
          description: Authorization details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Authorization'
        default:
          description: Unexpected error
          $ref: '#/components/responses/GeneralServerError'
    patch:
      operationId: PatchAuthorizationsID
      tags:
        - Authorizations
      summary: Update an authorization to be active or inactive
      requestBody:
        description: Authorization to update
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AuthorizationUpdateRequest'
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: authID
          schema:
            type: string
          required: true
          description: The ID of the authorization to update.
      responses:
        '200':
          description: The active or inactive authorization
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Authorization'
        default:
          description: Unexpected error
          $ref: '#/components/responses/GeneralServerError'
    delete:
      operationId: DeleteAuthorizationsID
      tags:
        - Authorizations
      summary: Delete an authorization
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: authID
          schema:
            type: string
          required: true
          description: The ID of the authorization to delete.
      responses:
        '204':
          description: Authorization deleted
        default:
          description: Unexpected error
          $ref: '#/components/responses/GeneralServerError'
  /variables:
    get:
      operationId: GetVariables
      tags:
        - Variables
      summary: List all variables
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: query
          name: org
          description: The name of the organization.
          schema:
            type: string
        - in: query
          name: orgID
          description: The organization ID.
          schema:
            type: string
      responses:
        '200':
          description: A list of variables for an organization
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Variables'
        '400':
          description: Invalid request
          $ref: '#/components/responses/GeneralServerError'
        default:
          description: Internal server error
          $ref: '#/components/responses/GeneralServerError'
    post:
      operationId: PostVariables
      summary: Create a variable
      tags:
        - Variables
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
      requestBody:
        description: Variable to create
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Variable'
      responses:
        '201':
          description: Variable created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Variable'
        default:
          description: Internal server error
          $ref: '#/components/responses/GeneralServerError'
  '/variables/{variableID}':
    get:
      operationId: GetVariablesID
      tags:
        - Variables
      summary: Retrieve a variable
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: variableID
          required: true
          schema:
            type: string
          description: The variable ID.
      responses:
        '200':
          description: Variable found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Variable'
        '404':
          description: Variable not found
          $ref: '#/components/responses/GeneralServerError'
        default:
          description: Internal server error
          $ref: '#/components/responses/GeneralServerError'
    delete:
      operationId: DeleteVariablesID
      tags:
        - Variables
      summary: Delete a variable
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: variableID
          required: true
          schema:
            type: string
          description: The variable ID.
      responses:
        '204':
          description: Variable deleted
        default:
          description: Internal server error
          $ref: '#/components/responses/GeneralServerError'
    patch:
      operationId: PatchVariablesID
      summary: Update a variable
      tags:
        - Variables
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: variableID
          required: true
          schema:
            type: string
          description: The variable ID.
      requestBody:
        description: Variable update to apply
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Variable'
      responses:
        '200':
          description: Variable updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Variable'
        default:
          description: Internal server error
          $ref: '#/components/responses/GeneralServerError'
    put:
      operationId: PutVariablesID
      summary: Replace a variable
      tags:
        - Variables
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: variableID
          required: true
          schema:
            type: string
          description: The variable ID.
      requestBody:
        description: Variable to replace
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Variable'
      responses:
        '200':
          description: Variable updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Variable'
        default:
          description: Internal server error
          $ref: '#/components/responses/GeneralServerError'
  /sources:
    post:
      operationId: PostSources
      tags:
        - Sources
      summary: Create a source
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
      requestBody:
        description: Source to create
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Source'
      responses:
        '201':
          description: Created Source
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Source'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    get:
      operationId: GetSources
      tags:
        - Sources
      summary: List all sources
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: query
          name: org
          description: The name of the organization.
          schema:
            type: string
      responses:
        '200':
          description: A list of sources
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Sources'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  '/sources/{sourceID}':
    delete:
      operationId: DeleteSourcesID
      tags:
        - Sources
      summary: Delete a source
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: sourceID
          schema:
            type: string
          required: true
          description: The source ID.
      responses:
        '204':
          description: Delete has been accepted
        '404':
          description: View not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    patch:
      operationId: PatchSourcesID
      tags:
        - Sources
      summary: Update a Source
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: sourceID
          schema:
            type: string
          required: true
          description: The source ID.
      requestBody:
        description: Source update
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Source'
      responses:
        '200':
          description: Created Source
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Source'
        '404':
          description: Source not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    get:
      operationId: GetSourcesID
      tags:
        - Sources
      summary: Retrieve a source
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: sourceID
          schema:
            type: string
          required: true
          description: The source ID.
      responses:
        '200':
          description: A source
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Source'
        '404':
          description: Source not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  '/sources/{sourceID}/health':
    get:
      operationId: GetSourcesIDHealth
      tags:
        - Sources
      summary: Get the health of a source
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: sourceID
          schema:
            type: string
          required: true
          description: The source ID.
      responses:
        '200':
          description: The source is healthy
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HealthCheck'
        '503':
          description: The source is not healthy
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HealthCheck'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  '/sources/{sourceID}/buckets':
    get:
      operationId: GetSourcesIDBuckets
      tags:
        - Sources
        - Buckets
      summary: Get buckets in a source
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: sourceID
          schema:
            type: string
          required: true
          description: The source ID.
        - in: query
          name: org
          description: The name of the organization.
          schema:
            type: string
      responses:
        '200':
          description: A source
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Buckets'
        '404':
          description: Source not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /scrapers:
    get:
      operationId: GetScrapers
      tags:
        - Scraper Targets
      summary: List all scraper targets
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: query
          name: name
          description: Specifies the name of the scraper target.
          schema:
            type: string
        - in: query
          name: id
          description: 'List of scraper target IDs to return. If both `id` and `owner` are specified, only `id` is used.'
          schema:
            type: array
            items:
              type: string
        - in: query
          name: orgID
          description: Specifies the organization ID of the scraper target.
          schema:
            type: string
        - in: query
          name: org
          description: Specifies the organization name of the scraper target.
          schema:
            type: string
      responses:
        '200':
          description: All scraper targets
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScraperTargetResponses'
    post:
      operationId: PostScrapers
      summary: Create a scraper target
      tags:
        - Scraper Targets
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
      requestBody:
        description: Scraper target to create
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ScraperTargetRequest'
      responses:
        '201':
          description: Scraper target created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScraperTargetResponse'
        default:
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  '/scrapers/{scraperTargetID}':
    get:
      operationId: GetScrapersID
      tags:
        - Scraper Targets
      summary: Retrieve a scraper target
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: scraperTargetID
          required: true
          schema:
            type: string
          description: The identifier of the scraper target.
      responses:
        '200':
          description: The scraper target
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScraperTargetResponse'
        default:
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    delete:
      operationId: DeleteScrapersID
      tags:
        - Scraper Targets
      summary: Delete a scraper target
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: scraperTargetID
          required: true
          schema:
            type: string
          description: The identifier of the scraper target.
      responses:
        '204':
          description: Scraper target deleted
        default:
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    patch:
      operationId: PatchScrapersID
      summary: Update a scraper target
      tags:
        - Scraper Targets
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: scraperTargetID
          required: true
          schema:
            type: string
          description: The identifier of the scraper target.
      requestBody:
        description: Scraper target update to apply
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ScraperTargetRequest'
      responses:
        '200':
          description: Scraper target updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScraperTargetResponse'
        default:
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  '/scrapers/{scraperTargetID}/labels':
    get:
      operationId: GetScrapersIDLabels
      tags:
        - Scraper Targets
      summary: List all labels for a scraper target
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: scraperTargetID
          schema:
            type: string
          required: true
          description: The scraper target ID.
      responses:
        '200':
          description: A list of labels for a scraper target.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LabelsResponse'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    post:
      operationId: PostScrapersIDLabels
      tags:
        - Scraper Targets
      summary: Add a label to a scraper target
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: scraperTargetID
          schema:
            type: string
          required: true
          description: The scraper target ID.
      requestBody:
        description: Label to add
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LabelMapping'
      responses:
        '201':
          description: The newly added label
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LabelResponse'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  '/scrapers/{scraperTargetID}/labels/{labelID}':
    delete:
      operationId: DeleteScrapersIDLabelsID
      tags:
        - Scraper Targets
      summary: Delete a label from a scraper target
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: scraperTargetID
          schema:
            type: string
          required: true
          description: The scraper target ID.
        - in: path
          name: labelID
          schema:
            type: string
          required: true
          description: The label ID.
      responses:
        '204':
          description: Delete has been accepted
        '404':
          description: Scraper target not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  '/scrapers/{scraperTargetID}/members':
    get:
      operationId: GetScrapersIDMembers
      tags:
        - Scraper Targets
      summary: List all users with member privileges for a scraper target
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: scraperTargetID
          schema:
            type: string
          required: true
          description: The scraper target ID.
      responses:
        '200':
          description: A list of scraper target members
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceMembers'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    post:
      operationId: PostScrapersIDMembers
      tags:
        - Scraper Targets
      summary: Add a member to a scraper target
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: scraperTargetID
          schema:
            type: string
          required: true
          description: The scraper target ID.
      requestBody:
        description: User to add as member
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddResourceMemberRequestBody'
      responses:
        '201':
          description: Member added to scraper targets
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceMember'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  '/scrapers/{scraperTargetID}/members/{userID}':
    delete:
      operationId: DeleteScrapersIDMembersID
      tags:
        - Scraper Targets
      summary: Remove a member from a scraper target
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: userID
          schema:
            type: string
          required: true
          description: The ID of member to remove.
        - in: path
          name: scraperTargetID
          schema:
            type: string
          required: true
          description: The scraper target ID.
      responses:
        '204':
          description: Member removed
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  '/scrapers/{scraperTargetID}/owners':
    get:
      operationId: GetScrapersIDOwners
      tags:
        - Scraper Targets
      summary: List all owners of a scraper target
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: scraperTargetID
          schema:
            type: string
          required: true
          description: The scraper target ID.
      responses:
        '200':
          description: A list of scraper target owners
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceOwners'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    post:
      operationId: PostScrapersIDOwners
      tags:
        - Scraper Targets
      summary: Add an owner to a scraper target
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: scraperTargetID
          schema:
            type: string
          required: true
          description: The scraper target ID.
      requestBody:
        description: User to add as owner
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddResourceMemberRequestBody'
      responses:
        '201':
          description: Scraper target owner added
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceOwner'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  '/scrapers/{scraperTargetID}/owners/{userID}':
    delete:
      operationId: DeleteScrapersIDOwnersID
      tags:
        - Scraper Targets
      summary: Remove an owner from a scraper target
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: userID
          schema:
            type: string
          required: true
          description: The ID of owner to remove.
        - in: path
          name: scraperTargetID
          schema:
            type: string
          required: true
          description: The scraper target ID.
      responses:
        '204':
          description: Owner removed
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /backup/kv:
    get:
      operationId: GetBackupKV
      tags:
        - Backup
      summary: Download snapshot of metadata stored in the server's embedded KV store. Don't use with InfluxDB versions greater than InfluxDB 2.1.x.
      description: |
        Retrieves a snapshot of metadata stored in the server's embedded KV store.
        InfluxDB versions greater than 2.1.x don't include metadata stored in embedded SQL;
        avoid using this endpoint with versions greater than 2.1.x.
      deprecated: true
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
      responses:
        '200':
          description: Success. The response contains a snapshot of KV metadata.
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
        default:
          description: Unexpected error
          $ref: '#/components/responses/GeneralServerError'
  /backup/metadata:
    get:
      operationId: GetBackupMetadata
      tags:
        - Backup
      summary: Download snapshot of all metadata in the server
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: header
          name: Accept-Encoding
          description: Indicates the content encoding (usually a compression algorithm) that the client can understand.
          schema:
            type: string
            description: 'The content coding.  Use `gzip` for compressed data or `identity` for unmodified, uncompressed data.'
            default: identity
            enum:
              - gzip
              - identity
      responses:
        '200':
          description: Snapshot of metadata
          headers:
            Content-Encoding:
              description: Lists any encodings (usually compression algorithms) that have been applied to the response payload.
              schema:
                type: string
                description: |
                  The content coding: `gzip` for compressed data or `identity` for unmodified, uncompressed data.
                default: identity
                enum:
                  - gzip
                  - identity
          content:
            multipart/mixed:
              schema:
                $ref: '#/components/schemas/MetadataBackup'
        default:
          description: Unexpected error
          $ref: '#/components/responses/GeneralServerError'
  '/backup/shards/{shardID}':
    get:
      operationId: GetBackupShardId
      tags:
        - Backup
      summary: Download snapshot of all TSM data in a shard
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: header
          name: Accept-Encoding
          description: Indicates the content encoding (usually a compression algorithm) that the client can understand.
          schema:
            type: string
            description: 'The content coding.  Use `gzip` for compressed data or `identity` for unmodified, uncompressed data.'
            default: identity
            enum:
              - gzip
              - identity
        - in: path
          name: shardID
          schema:
            type: integer
            format: int64
          required: true
          description: The shard ID.
        - in: query
          name: since
          description: 'The earliest time [RFC3339 date/time format](https://docs.influxdata.com/influxdb/v2.3/reference/glossary/#rfc3339-timestamp) to include in the snapshot.'
          schema:
            type: string
            format: date-time
          examples:
            RFC3339:
              summary: RFC3339 date/time format
              value: '2006-01-02T15:04:05Z07:00'
      responses:
        '200':
          description: TSM snapshot.
          headers:
            Content-Encoding:
              description: Lists any encodings (usually compression algorithms) that have been applied to the response payload.
              schema:
                type: string
                description: |
                  The content coding: `gzip` for compressed data or `identity` for unmodified, uncompressed data.
                default: identity
                enum:
                  - gzip
                  - identity
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
        '404':
          description: Shard not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          description: Unexpected error
          $ref: '#/components/responses/GeneralServerError'
  /restore/kv:
    post:
      operationId: PostRestoreKV
      tags:
        - Restore
      summary: Overwrite the embedded KV store on the server with a backed-up snapshot.
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: header
          name: Content-Encoding
          description: |
            The value tells InfluxDB what compression is applied to the line protocol in the request payload.
            To make an API request with a GZIP payload, send `Content-Encoding: gzip` as a request header.
          schema:
            type: string
            description: 'The content coding.  Use `gzip` for compressed data or `identity` for unmodified, uncompressed data.'
            default: identity
            enum:
              - gzip
              - identity
        - in: header
          name: Content-Type
          schema:
            type: string
            default: application/octet-stream
            enum:
              - application/octet-stream
      requestBody:
        description: Full KV snapshot.
        required: true
        content:
          text/plain:
            schema:
              type: string
              format: binary
      responses:
        '200':
          description: KV store successfully overwritten.
          content:
            application/json:
              schema:
                type: object
                properties:
                  token:
                    description: token is the root token for the instance after restore (this is overwritten during the restore)
                    type: string
        '204':
          description: KV store successfully overwritten.
        default:
          description: Unexpected error
          $ref: '#/components/responses/GeneralServerError'
  /restore/sql:
    post:
      operationId: PostRestoreSQL
      tags:
        - Restore
      summary: Overwrite the embedded SQL store on the server with a backed-up snapshot.
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: header
          name: Content-Encoding
          description: |
            The value tells InfluxDB what compression is applied to the line protocol in the request payload.
            To make an API request with a GZIP payload, send `Content-Encoding: gzip` as a request header.
          schema:
            type: string
            description: Specifies that the line protocol in the body is encoded with gzip or not encoded with identity.
            default: identity
            enum:
              - gzip
              - identity
        - in: header
          name: Content-Type
          schema:
            type: string
            default: application/octet-stream
            enum:
              - application/octet-stream
      requestBody:
        description: Full SQL snapshot.
        required: true
        content:
          text/plain:
            schema:
              type: string
              format: binary
      responses:
        '204':
          description: SQL store successfully overwritten.
        default:
          description: Unexpected error
          $ref: '#/components/responses/GeneralServerError'
  '/restore/bucket/{bucketID}':
    post:
      operationId: PostRestoreBucketID
      tags:
        - Restore
      summary: Overwrite storage metadata for a bucket with shard info from a backup.
      deprecated: true
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: bucketID
          schema:
            type: string
          required: true
          description: The bucket ID.
        - in: header
          name: Content-Type
          schema:
            type: string
            default: application/octet-stream
            enum:
              - application/octet-stream
      requestBody:
        description: Database info serialized as protobuf.
        required: true
        content:
          text/plain:
            schema:
              type: string
              format: byte
      responses:
        '200':
          description: ID mappings for shards in bucket.
          content:
            application/json:
              schema:
                type: string
                format: byte
        default:
          description: Unexpected error
          $ref: '#/components/responses/GeneralServerError'
  /restore/bucketMetadata:
    post:
      operationId: PostRestoreBucketMetadata
      tags:
        - Restore
      summary: Create a new bucket pre-seeded with shard info from a backup.
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
      requestBody:
        description: Metadata manifest for a bucket.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BucketMetadataManifest'
      responses:
        '201':
          description: ID mappings for shards in new bucket.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RestoredBucketMappings'
        default:
          description: Unexpected error
          $ref: '#/components/responses/GeneralServerError'
  '/restore/shards/{shardID}':
    post:
      operationId: PostRestoreShardId
      tags:
        - Restore
      summary: Restore a TSM snapshot into a shard.
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: header
          name: Content-Encoding
          description: |
            The value tells InfluxDB what compression is applied to the line protocol in the request payload.
            To make an API request with a GZIP payload, send `Content-Encoding: gzip` as a request header.
          schema:
            type: string
            description: Specifies that the line protocol in the body is encoded with gzip or not encoded with identity.
            default: identity
            enum:
              - gzip
              - identity
        - in: header
          name: Content-Type
          schema:
            type: string
            default: application/octet-stream
            enum:
              - application/octet-stream
        - in: path
          name: shardID
          schema:
            type: string
          required: true
          description: The shard ID.
      requestBody:
        description: TSM snapshot.
        required: true
        content:
          text/plain:
            schema:
              type: string
              format: binary
      responses:
        '204':
          description: TSM snapshot successfully restored.
        default:
          description: Unexpected error
          $ref: '#/components/responses/GeneralServerError'
  /config:
    get:
      operationId: GetConfig
      tags:
        - Config
        - System information endpoints
      summary: Retrieve runtime configuration
      description: |
        Returns the active runtime configuration of the InfluxDB instance.

        In InfluxDB v2.2+, use this endpoint to view your active runtime configuration,
        including flags and environment variables.

        #### Related guides

        - [View your runtime server configuration](https://docs.influxdata.com/influxdb/v2.3/reference/config-options/#view-your-runtime-server-configuration)
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
      responses:
        '200':
          description: |
            Success.
            The response body contains the active runtime configuration of the InfluxDB instance.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Config'
        '401':
          $ref: '#/components/responses/GeneralServerError'
        default:
          $ref: '#/components/responses/GeneralServerError'
  /remotes:
    get:
      operationId: GetRemoteConnections
      tags:
        - RemoteConnections
      summary: List all remote connections
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: query
          name: orgID
          description: The organization ID.
          required: true
          schema:
            type: string
        - in: query
          name: name
          schema:
            type: string
        - in: query
          name: remoteURL
          schema:
            type: string
            format: uri
      responses:
        '200':
          description: List of remote connections
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteConnections'
        '404':
          $ref: '#/components/responses/GeneralServerError'
        default:
          $ref: '#/components/responses/GeneralServerError'
    post:
      operationId: PostRemoteConnection
      tags:
        - RemoteConnections
      summary: Register a new remote connection
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RemoteConnectionCreationRequest'
      responses:
        '201':
          description: Remote connection saved
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteConnection'
        '400':
          $ref: '#/components/responses/GeneralServerError'
        default:
          $ref: '#/components/responses/GeneralServerError'
  '/remotes/{remoteID}':
    get:
      operationId: GetRemoteConnectionByID
      tags:
        - RemoteConnections
      summary: Retrieve a remote connection
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: remoteID
          schema:
            type: string
          required: true
      responses:
        '200':
          description: Remote connection
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteConnection'
        '404':
          $ref: '#/components/responses/GeneralServerError'
        default:
          $ref: '#/components/responses/GeneralServerError'
    patch:
      operationId: PatchRemoteConnectionByID
      tags:
        - RemoteConnections
      summary: Update a remote connection
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: remoteID
          schema:
            type: string
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RemoteConnectionUpdateRequest'
      responses:
        '200':
          description: Updated information saved
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteConnection'
        '400':
          $ref: '#/components/responses/GeneralServerError'
        '404':
          $ref: '#/components/responses/GeneralServerError'
        default:
          $ref: '#/components/responses/GeneralServerError'
    delete:
      operationId: DeleteRemoteConnectionByID
      tags:
        - RemoteConnections
      summary: Delete a remote connection
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: remoteID
          schema:
            type: string
          required: true
      responses:
        '204':
          description: Remote connection info deleted.
        '404':
          $ref: '#/components/responses/GeneralServerError'
        default:
          $ref: '#/components/responses/GeneralServerError'
  /replications:
    get:
      operationId: GetReplications
      tags:
        - Replications
      summary: List all replications
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: query
          name: orgID
          description: The organization ID.
          required: true
          schema:
            type: string
        - in: query
          name: name
          schema:
            type: string
        - in: query
          name: remoteID
          schema:
            type: string
        - in: query
          name: localBucketID
          schema:
            type: string
      responses:
        '200':
          description: List of replications
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Replications'
        '404':
          $ref: '#/components/responses/GeneralServerError'
        default:
          $ref: '#/components/responses/GeneralServerError'
    post:
      operationId: PostReplication
      tags:
        - Replications
      summary: Register a new replication
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: query
          name: validate
          description: 'If true, validate the replication, but don''t save it.'
          schema:
            type: boolean
            default: false
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReplicationCreationRequest'
      responses:
        '201':
          description: Replication saved
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Replication'
        '204':
          description: 'Replication validated, but not saved'
        '400':
          $ref: '#/components/responses/GeneralServerError'
        default:
          $ref: '#/components/responses/GeneralServerError'
  '/replications/{replicationID}':
    get:
      operationId: GetReplicationByID
      tags:
        - Replications
      summary: Retrieve a replication
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: replicationID
          schema:
            type: string
          required: true
      responses:
        '200':
          description: Replication
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Replication'
        '404':
          $ref: '#/components/responses/GeneralServerError'
        default:
          $ref: '#/components/responses/GeneralServerError'
    patch:
      operationId: PatchReplicationByID
      tags:
        - Replications
      summary: Update a replication
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: replicationID
          schema:
            type: string
          required: true
        - in: query
          name: validate
          description: 'If true, validate the updated information, but don''t save it.'
          schema:
            type: boolean
            default: false
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReplicationUpdateRequest'
      responses:
        '200':
          description: Updated information saved
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Replication'
        '204':
          description: 'Updated replication validated, but not saved'
        '400':
          $ref: '#/components/responses/GeneralServerError'
        '404':
          $ref: '#/components/responses/GeneralServerError'
        default:
          $ref: '#/components/responses/GeneralServerError'
    delete:
      operationId: DeleteReplicationByID
      tags:
        - Replications
      summary: Delete a replication
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: replicationID
          schema:
            type: string
          required: true
      responses:
        '204':
          description: Replication deleted.
        '404':
          $ref: '#/components/responses/GeneralServerError'
        default:
          $ref: '#/components/responses/GeneralServerError'
  '/replications/{replicationID}/validate':
    post:
      operationId: PostValidateReplicationByID
      tags:
        - Replications
      summary: Validate a replication
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: replicationID
          schema:
            type: string
          required: true
      responses:
        '204':
          description: Replication is valid
        '400':
          description: Replication failed validation
          $ref: '#/components/responses/GeneralServerError'
        default:
          $ref: '#/components/responses/GeneralServerError'
  /dashboards:
    post:
      operationId: PostDashboards
      tags:
        - Dashboards
      summary: Create a dashboard
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
      requestBody:
        description: Dashboard to create
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateDashboardRequest'
      responses:
        '201':
          description: Added dashboard
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Dashboard'
                  - $ref: '#/components/schemas/DashboardWithViewProperties'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    get:
      operationId: GetDashboards
      tags:
        - Dashboards
      summary: List all dashboards
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - $ref: '#/components/parameters/Offset'
        - $ref: '#/components/parameters/Limit'
        - $ref: '#/components/parameters/Descending'
        - in: query
          name: owner
          description: A user identifier. Returns only dashboards where this user has the `owner` role.
          schema:
            type: string
        - in: query
          name: sortBy
          description: The column to sort by.
          schema:
            type: string
            enum:
              - ID
              - CreatedAt
              - UpdatedAt
        - in: query
          name: id
          description: 'A list of dashboard identifiers. Returns only the listed dashboards. If both `id` and `owner` are specified, only `id` is used.'
          schema:
            type: array
            items:
              type: string
        - in: query
          name: orgID
          description: The identifier of the organization.
          schema:
            type: string
        - in: query
          name: org
          description: The name of the organization.
          schema:
            type: string
      responses:
        '200':
          description: All dashboards
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Dashboards'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /tasks:
    get:
      operationId: GetTasks
      tags:
        - Data I/O endpoints
        - Tasks
      summary: List tasks
      description: |
        Retrieves a list of [tasks](https://docs.influxdata.com/influxdb/v2.3/process-data/).

        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`.
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: query
          name: name
          description: |
            Task name.
            Only returns tasks with this name.
            Different tasks may have the same name.
          schema:
            type: string
        - in: query
          name: after
          schema:
            type: string
          description: |
            Task ID.
            Only returns tasks created after this task.
        - in: query
          name: user
          schema:
            type: string
          description: |
            User ID.
            Only returns tasks owned by this user.
        - in: query
          name: org
          schema:
            type: string
          description: |
            Organization name.
            Only returns tasks owned by this organization.
        - in: query
          name: orgID
          schema:
            type: string
          description: |
            Organization ID.
            Only returns tasks owned by this organization.
        - in: query
          name: status
          schema:
            type: string
            enum:
              - active
              - inactive
          description: |
            Task status (`active` or `inactive`).
            Only returns tasks with this status.
        - in: query
          name: limit
          schema:
            type: integer
            minimum: 1
            maximum: 500
            default: 100
          description: |
            Limits the number of tasks returned.
            The minimum is `1`, the maximum is `500`, and the default is `100`.
        - in: query
          name: type
          description: |
            Task type (`basic` or `system`).

            The default (`system`) response contains all the metadata properties for tasks.
            To reduce the payload size, pass `basic` to omit some task properties (`flux`, `createdAt`, `updatedAt`) from the response.
          required: false
          schema:
            default: ''
            type: string
            enum:
              - basic
              - system
      responses:
        '200':
          description: |
            Success.
            The response body contains the list of tasks.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Tasks'
              examples:
                basicTypeTaskOutput:
                  summary: Basic output
                  description: Task fields returned with `?type=basic`
                  value:
                    links:
                      self: /api/v2/tasks?limit=100
                    tasks:
                      - 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
                        labels: []
                        id: 09956cbb6d378000
                        orgID: 48c88459ee424a04
                        org: ''
                        ownerID: 0772396d1f411000
                        name: task1
                        status: active
                        flux: ''
                        every: 30m
                        latestCompleted: '2022-06-30T15:00:00Z'
                        lastRunStatus: success
                systemTypeTaskOutput:
                  summary: System output
                  description: Task fields returned with `?type=system`
                  value:
                    links:
                      self: /api/v2/tasks?limit=100
                    tasks:
                      - 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
                        labels: []
                        id: 09956cbb6d378000
                        orgID: 48c88459ee424a04
                        org: my-iot-center
                        ownerID: 0772396d1f411000
                        name: task1
                        description: IoT Center 90-day environment average.
                        status: active
                        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)
                        every: 30m
                        latestCompleted: '2022-06-30T15:00:00Z'
                        lastRunStatus: success
                        createdAt: '2022-06-27T15:09:06Z'
                        updatedAt: '2022-06-28T18:10:15Z'
        '401':
          $ref: '#/components/responses/AuthorizationError'
        '500':
          $ref: '#/components/responses/InternalServerError'
        default:
          $ref: '#/components/responses/GeneralServerError'
      x-codeSamples:
        - lang: Shell
          label: 'cURL: all tasks, basic output'
          source: |
            curl https://localhost:8086/api/v2/tasks/?limit=-1&type=basic \
              --header 'Content-Type: application/json' \
              --header 'Authorization: Token INFLUX_API_TOKEN'
    post:
      operationId: PostTasks
      tags:
        - Data I/O endpoints
        - Tasks
      summary: Create a task
      description: |
        Creates a [task](https://docs.influxdata.com/influxdb/v2.3/process-data/) and returns the created task.

        #### Related guides

        - [Get started with tasks](https://docs.influxdata.com/influxdb/v2.3/process-data/get-started/)
        - [Create a task](https://docs.influxdata.com/influxdb/v2.3/process-data/manage-tasks/create-task/)
        - [Common tasks](https://docs.influxdata.com/influxdb/v2.3/process-data/common-tasks/)
        - [Task configuration options](https://docs.influxdata.com/influxdb/v2.3/process-data/task-options/)
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
      requestBody:
        description: The task to create.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TaskCreateRequest'
      responses:
        '201':
          description: Success. The response body contains a `tasks` list with the new task.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Task'
        '400':
          description: |
            Bad request.
            The response body contains detail about the error.

            #### InfluxDB OSS

            - Returns this error if an incorrect value is passed for `org` or `orgID`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                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'
                missingFluxError:
                  summary: Task in request body is missing Flux query
                  value:
                    code: invalid
                    message: 'failed to decode request: missing flux'
        '401':
          $ref: '#/components/responses/AuthorizationError'
        '500':
          $ref: '#/components/responses/InternalServerError'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      x-codeSamples:
        - lang: Shell
          label: 'cURL: create a task'
          source: |
            curl http://localhost:8086/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
  '/tasks/{taskID}':
    get:
      operationId: GetTasksID
      tags:
        - Data I/O endpoints
        - Tasks
      summary: Retrieve a task
      description: |
        Retrieves a [task](https://docs.influxdata.com/influxdb/v2.3/reference/glossary/#task).
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: taskID
          schema:
            type: string
          required: true
          description: The ID of the task to retrieve.
      responses:
        '200':
          description: Success. The response body contains the task.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/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'
    patch:
      operationId: PatchTasksID
      tags:
        - Tasks
      summary: Update a task
      description: |
        Updates a task and then cancels all scheduled runs of the task.

        Use this endpoint to set, modify, and 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.
      requestBody:
        description: An object that contains updated task properties to apply.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TaskUpdateRequest'
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: taskID
          schema:
            type: string
          required: true
          description: The ID of the task to update.
      responses:
        '200':
          description: Success. The response body contains the updated task.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/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'
    delete:
      operationId: DeleteTasksID
      tags:
        - Tasks
      summary: Delete a task
      description: |
        Deletes a 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`](#operation/PatchTasksID).
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: taskID
          schema:
            type: string
          required: true
          description: The ID of the task to delete.
      responses:
        '204':
          description: Success. The task and 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'
components:
  parameters:
    TraceSpan:
      in: header
      name: Zap-Trace-Span
      description: OpenTracing span context
      example:
        trace_id: '1'
        span_id: '1'
        baggage:
          key: value
      required: false
      schema:
        type: string
    Offset:
      in: query
      name: offset
      required: false
      description: |
        The offset for pagination.
        The number of records to skip.
      schema:
        type: integer
        minimum: 0
    Limit:
      in: query
      name: limit
      required: false
      description: |
        Limits the number of records returned. Default is `20`.
      schema:
        type: integer
        minimum: 1
        maximum: 100
        default: 20
    Descending:
      in: query
      name: descending
      required: false
      schema:
        type: boolean
        default: false
    SortBy:
      in: query
      name: sortBy
      required: false
      schema:
        type: string
    After:
      in: query
      name: after
      required: false
      schema:
        type: string
      description: |
        Resource ID to seek from. Results are not inclusive of this ID. Use `after` instead of `offset`.
  schemas:
    LanguageRequest:
      description: Flux query to be analyzed.
      type: object
      required:
        - query
      properties:
        query:
          description: |
            The Flux query script to be analyzed.
          type: string
    Query:
      description: Query InfluxDB with the Flux language
      type: object
      required:
        - query
      properties:
        extern:
          $ref: '#/components/schemas/File'
        query:
          description: The query script to execute.
          type: string
        type:
          description: The type of query. Must be "flux".
          type: string
          enum:
            - flux
        params:
          type: object
          additionalProperties: true
          description: |
            Key-value pairs passed as parameters during query execution.

            To use parameters in your query, pass a _`query`_ with `params` references (in dot notation)--for example:

            ```json
              query: "from(bucket: params.mybucket) |> range(start: params.rangeStart) |> limit(n:1)"
            ```

            and pass _`params`_ with the key-value pairs--for example:

            ```json
              params: {
                "mybucket": "environment",
                "rangeStart": "-30d"
              }
            ```

            During query execution, InfluxDB passes _`params`_ to your script and substitutes the values.

            #### Limitations

            - If you use _`params`_, you can't use _`extern`_.
        dialect:
          $ref: '#/components/schemas/Dialect'
        now:
          description: |
            Specifies the time that should be reported as `now` in the query.
            Default is the server `now` time.
          type: string
          format: date-time
    Package:
      description: Represents a complete package source tree.
      type: object
      properties:
        type:
          $ref: '#/components/schemas/NodeType'
        path:
          description: Package import path
          type: string
        package:
          description: Package name
          type: string
        files:
          description: Package files
          type: array
          items:
            $ref: '#/components/schemas/File'
    File:
      description: Represents a source from a single file
      type: object
      properties:
        type:
          $ref: '#/components/schemas/NodeType'
        name:
          description: The name of the file.
          type: string
        package:
          $ref: '#/components/schemas/PackageClause'
        imports:
          description: A list of package imports
          type: array
          items:
            $ref: '#/components/schemas/ImportDeclaration'
        body:
          description: List of Flux statements
          type: array
          items:
            $ref: '#/components/schemas/Statement'
    PackageClause:
      description: Defines a package identifier
      type: object
      properties:
        type:
          $ref: '#/components/schemas/NodeType'
        name:
          $ref: '#/components/schemas/Identifier'
    ImportDeclaration:
      description: Declares a package import
      type: object
      properties:
        type:
          $ref: '#/components/schemas/NodeType'
        as:
          $ref: '#/components/schemas/Identifier'
        path:
          $ref: '#/components/schemas/StringLiteral'
    DeletePredicateRequest:
      description: The delete predicate request.
      type: object
      required:
        - start
        - stop
      properties:
        start:
          description: |
            A timestamp ([RFC3339 date/time format](https://docs.influxdata.com/influxdb/v2.3/reference/glossary/#rfc3339-timestamp)).
            The earliest time to delete from.
          type: string
          format: date-time
        stop:
          description: |
            A timestamp ([RFC3339 date/time format](https://docs.influxdata.com/influxdb/v2.3/reference/glossary/#rfc3339-timestamp)).
            The latest time to delete from.
          type: string
          format: date-time
        predicate:
          description: |
            An expression in [delete predicate syntax](https://docs.influxdata.com/influxdb/v2.3/reference/syntax/delete-predicate/).
          example: tag1="value1" and (tag2="value2" and tag3!="value3")
          type: string
    Node:
      oneOf:
        - $ref: '#/components/schemas/Expression'
        - $ref: '#/components/schemas/Block'
    NodeType:
      description: Type of AST node
      type: string
    Block:
      description: A set of statements
      type: object
      properties:
        type:
          $ref: '#/components/schemas/NodeType'
        body:
          description: Block body
          type: array
          items:
            $ref: '#/components/schemas/Statement'
    Statement:
      oneOf:
        - $ref: '#/components/schemas/BadStatement'
        - $ref: '#/components/schemas/VariableAssignment'
        - $ref: '#/components/schemas/MemberAssignment'
        - $ref: '#/components/schemas/ExpressionStatement'
        - $ref: '#/components/schemas/ReturnStatement'
        - $ref: '#/components/schemas/OptionStatement'
        - $ref: '#/components/schemas/BuiltinStatement'
        - $ref: '#/components/schemas/TestStatement'
    BadStatement:
      description: A placeholder for statements for which no correct statement nodes can be created
      type: object
      properties:
        type:
          $ref: '#/components/schemas/NodeType'
        text:
          description: Raw source text
          type: string
    VariableAssignment:
      description: Represents the declaration of a variable
      type: object
      properties:
        type:
          $ref: '#/components/schemas/NodeType'
        id:
          $ref: '#/components/schemas/Identifier'
        init:
          $ref: '#/components/schemas/Expression'
    MemberAssignment:
      description: Object property assignment
      type: object
      properties:
        type:
          $ref: '#/components/schemas/NodeType'
        member:
          $ref: '#/components/schemas/MemberExpression'
        init:
          $ref: '#/components/schemas/Expression'
    ExpressionStatement:
      description: May consist of an expression that doesn't return a value and is executed solely for its side-effects
      type: object
      properties:
        type:
          $ref: '#/components/schemas/NodeType'
        expression:
          $ref: '#/components/schemas/Expression'
    ReturnStatement:
      description: Defines an expression to return
      type: object
      properties:
        type:
          $ref: '#/components/schemas/NodeType'
        argument:
          $ref: '#/components/schemas/Expression'
    OptionStatement:
      description: A single variable declaration
      type: object
      properties:
        type:
          $ref: '#/components/schemas/NodeType'
        assignment:
          oneOf:
            - $ref: '#/components/schemas/VariableAssignment'
            - $ref: '#/components/schemas/MemberAssignment'
    BuiltinStatement:
      description: Declares a builtin identifier and its type
      type: object
      properties:
        type:
          $ref: '#/components/schemas/NodeType'
        id:
          $ref: '#/components/schemas/Identifier'
    TestStatement:
      description: Declares a Flux test case
      type: object
      properties:
        type:
          $ref: '#/components/schemas/NodeType'
        assignment:
          $ref: '#/components/schemas/VariableAssignment'
    Expression:
      oneOf:
        - $ref: '#/components/schemas/ArrayExpression'
        - $ref: '#/components/schemas/DictExpression'
        - $ref: '#/components/schemas/FunctionExpression'
        - $ref: '#/components/schemas/BinaryExpression'
        - $ref: '#/components/schemas/CallExpression'
        - $ref: '#/components/schemas/ConditionalExpression'
        - $ref: '#/components/schemas/LogicalExpression'
        - $ref: '#/components/schemas/MemberExpression'
        - $ref: '#/components/schemas/IndexExpression'
        - $ref: '#/components/schemas/ObjectExpression'
        - $ref: '#/components/schemas/ParenExpression'
        - $ref: '#/components/schemas/PipeExpression'
        - $ref: '#/components/schemas/UnaryExpression'
        - $ref: '#/components/schemas/BooleanLiteral'
        - $ref: '#/components/schemas/DateTimeLiteral'
        - $ref: '#/components/schemas/DurationLiteral'
        - $ref: '#/components/schemas/FloatLiteral'
        - $ref: '#/components/schemas/IntegerLiteral'
        - $ref: '#/components/schemas/PipeLiteral'
        - $ref: '#/components/schemas/RegexpLiteral'
        - $ref: '#/components/schemas/StringLiteral'
        - $ref: '#/components/schemas/UnsignedIntegerLiteral'
        - $ref: '#/components/schemas/Identifier'
    ArrayExpression:
      description: Used to create and directly specify the elements of an array object
      type: object
      properties:
        type:
          $ref: '#/components/schemas/NodeType'
        elements:
          description: Elements of the array
          type: array
          items:
            $ref: '#/components/schemas/Expression'
    DictExpression:
      description: Used to create and directly specify the elements of a dictionary
      type: object
      properties:
        type:
          $ref: '#/components/schemas/NodeType'
        elements:
          description: Elements of the dictionary
          type: array
          items:
            $ref: '#/components/schemas/DictItem'
    DictItem:
      description: A key-value pair in a dictionary.
      type: object
      properties:
        type:
          $ref: '#/components/schemas/NodeType'
        key:
          $ref: '#/components/schemas/Expression'
        val:
          $ref: '#/components/schemas/Expression'
    FunctionExpression:
      description: Function expression
      type: object
      properties:
        type:
          $ref: '#/components/schemas/NodeType'
        params:
          description: Function parameters
          type: array
          items:
            $ref: '#/components/schemas/Property'
        body:
          $ref: '#/components/schemas/Node'
    BinaryExpression:
      description: uses binary operators to act on two operands in an expression
      type: object
      properties:
        type:
          $ref: '#/components/schemas/NodeType'
        operator:
          type: string
        left:
          $ref: '#/components/schemas/Expression'
        right:
          $ref: '#/components/schemas/Expression'
    CallExpression:
      description: Represents a function call
      type: object
      properties:
        type:
          $ref: '#/components/schemas/NodeType'
        callee:
          $ref: '#/components/schemas/Expression'
        arguments:
          description: Function arguments
          type: array
          items:
            $ref: '#/components/schemas/Expression'
    ConditionalExpression:
      description: 'Selects one of two expressions, `Alternate` or `Consequent`, depending on a third boolean expression, `Test`'
      type: object
      properties:
        type:
          $ref: '#/components/schemas/NodeType'
        test:
          $ref: '#/components/schemas/Expression'
        alternate:
          $ref: '#/components/schemas/Expression'
        consequent:
          $ref: '#/components/schemas/Expression'
    LogicalExpression:
      description: Represents the rule conditions that collectively evaluate to either true or false
      type: object
      properties:
        type:
          $ref: '#/components/schemas/NodeType'
        operator:
          type: string
        left:
          $ref: '#/components/schemas/Expression'
        right:
          $ref: '#/components/schemas/Expression'
    MemberExpression:
      description: Represents accessing a property of an object
      type: object
      properties:
        type:
          $ref: '#/components/schemas/NodeType'
        object:
          $ref: '#/components/schemas/Expression'
        property:
          $ref: '#/components/schemas/PropertyKey'
    IndexExpression:
      description: Represents indexing into an array
      type: object
      properties:
        type:
          $ref: '#/components/schemas/NodeType'
        array:
          $ref: '#/components/schemas/Expression'
        index:
          $ref: '#/components/schemas/Expression'
    ObjectExpression:
      description: Allows the declaration of an anonymous object within a declaration
      type: object
      properties:
        type:
          $ref: '#/components/schemas/NodeType'
        properties:
          description: Object properties
          type: array
          items:
            $ref: '#/components/schemas/Property'
    ParenExpression:
      description: Represents an expression wrapped in parenthesis
      type: object
      properties:
        type:
          $ref: '#/components/schemas/NodeType'
        expression:
          $ref: '#/components/schemas/Expression'
    PipeExpression:
      description: Call expression with pipe argument
      type: object
      properties:
        type:
          $ref: '#/components/schemas/NodeType'
        argument:
          $ref: '#/components/schemas/Expression'
        call:
          $ref: '#/components/schemas/CallExpression'
    UnaryExpression:
      description: Uses operators to act on a single operand in an expression
      type: object
      properties:
        type:
          $ref: '#/components/schemas/NodeType'
        operator:
          type: string
        argument:
          $ref: '#/components/schemas/Expression'
    BooleanLiteral:
      description: Represents boolean values
      type: object
      properties:
        type:
          $ref: '#/components/schemas/NodeType'
        value:
          type: boolean
    DateTimeLiteral:
      description: 'Represents an instant in time with nanosecond precision in [RFC3339Nano date/time format](https://docs.influxdata.com/influxdb/v2.3/reference/glossary/#rfc3339nano-timestamp).'
      type: object
      properties:
        type:
          $ref: '#/components/schemas/NodeType'
        value:
          type: string
          format: date-time
    DurationLiteral:
      description: Represents the elapsed time between two instants as an int64 nanosecond count with syntax of golang's time.Duration
      type: object
      properties:
        type:
          $ref: '#/components/schemas/NodeType'
        values:
          description: Duration values
          type: array
          items:
            $ref: '#/components/schemas/Duration'
    FloatLiteral:
      description: Represents floating point numbers according to the double representations defined by the IEEE-754-1985
      type: object
      properties:
        type:
          $ref: '#/components/schemas/NodeType'
        value:
          type: number
    IntegerLiteral:
      description: Represents integer numbers
      type: object
      properties:
        type:
          $ref: '#/components/schemas/NodeType'
        value:
          type: string
    PipeLiteral:
      description: 'Represents a specialized literal value, indicating the left hand value of a pipe expression'
      type: object
      properties:
        type:
          $ref: '#/components/schemas/NodeType'
    RegexpLiteral:
      description: Expressions begin and end with `/` and are regular expressions with syntax accepted by RE2
      type: object
      properties:
        type:
          $ref: '#/components/schemas/NodeType'
        value:
          type: string
    StringLiteral:
      description: Expressions begin and end with double quote marks
      type: object
      properties:
        type:
          $ref: '#/components/schemas/NodeType'
        value:
          type: string
    UnsignedIntegerLiteral:
      description: Represents integer numbers
      type: object
      properties:
        type:
          $ref: '#/components/schemas/NodeType'
        value:
          type: string
    Duration:
      description: A pair consisting of length of time and the unit of time measured. It is the atomic unit from which all duration literals are composed.
      type: object
      properties:
        type:
          $ref: '#/components/schemas/NodeType'
        magnitude:
          type: integer
        unit:
          type: string
    Property:
      description: The value associated with a key
      type: object
      properties:
        type:
          $ref: '#/components/schemas/NodeType'
        key:
          $ref: '#/components/schemas/PropertyKey'
        value:
          $ref: '#/components/schemas/Expression'
    PropertyKey:
      oneOf:
        - $ref: '#/components/schemas/Identifier'
        - $ref: '#/components/schemas/StringLiteral'
    Identifier:
      description: A valid Flux identifier
      type: object
      properties:
        type:
          $ref: '#/components/schemas/NodeType'
        name:
          type: string
    Dialect:
      description: |
        Options for tabular data output.
        Default output is [annotated CSV](https://docs.influxdata.com/influxdb/v2.3/reference/syntax/annotated-csv/#csv-response-format) with headers.

        For more information about tabular data **dialect**,
        see [W3 metadata vocabulary for tabular data](https://www.w3.org/TR/2015/REC-tabular-metadata-20151217/#dialect-descriptions).
      type: object
      properties:
        header:
          description: 'If true, the results contain a header row.'
          type: boolean
          default: true
        delimiter:
          description: 'The separator used between cells. Default is a comma (`,`).'
          type: string
          default: ','
          maxLength: 1
          minLength: 1
        annotations:
          description: |
            Annotation rows to include in the results.
            An _annotation_ is metadata associated with an object (column) in the data model.

            #### Related guides

            - See [Annotated CSV annotations](https://docs.influxdata.com/influxdb/v2.3/reference/syntax/annotated-csv/#annotations) for examples and more information.

            For more information about **annotations** in tabular data,
            see [W3 metadata vocabulary for tabular data](https://www.w3.org/TR/2015/REC-tabular-data-model-20151217/#columns).
          type: array
          uniqueItems: true
          items:
            type: string
            enum:
              - group
              - datatype
              - default
        commentPrefix:
          description: The character prefixed to comment strings. Default is a number sign (`#`).
          type: string
          default: '#'
          maxLength: 1
          minLength: 0
        dateTimeFormat:
          description: |
            The format for timestamps in results.
            Default is [`RFC3339` date/time format](https://docs.influxdata.com/influxdb/v2.3/reference/glossary/#rfc3339-timestamp).
            To include nanoseconds in timestamps, use `RFC3339Nano`.

            #### Example formatted date/time values

            | Format      | Value                       |
            |:------------|:----------------------------|
            | `RFC3339`    | `"2006-01-02T15:04:05Z07:00"` |
            | `RFC3339Nano` | `"2006-01-02T15:04:05.999999999Z07:00"` |
          type: string
          default: RFC3339
          enum:
            - RFC3339
            - RFC3339Nano
    AuthorizationUpdateRequest:
      properties:
        status:
          description: 'Status of the token. If `inactive`, requests using the token will be rejected.'
          default: active
          type: string
          enum:
            - active
            - inactive
        description:
          type: string
          description: A description of the token.
    PostBucketRequest:
      properties:
        orgID:
          description: |
            Organization ID.
            The ID of the organization.
          type: string
        name:
          description: |
            The name of the bucket.
          type: string
        description:
          description: |
            A description of the bucket.
          type: string
        rp:
          description: |
            Retention policy is an InfluxDB 1.x concept that represents the duration
            of time that each data point in the retention policy persists. Use `rp`
            for compatibility with InfluxDB 1.x.
            The InfluxDB 2.x and Cloud equivalent is
            [retention period](https://docs.influxdata.com/influxdb/v2.3/reference/glossary/#retention-period).
          type: string
          default: '0'
        retentionRules:
          $ref: '#/components/schemas/RetentionRules'
        schemaType:
          description: |
            Schema Type.
            Use `explicit` to enforce column names, tags, fields, and data types for
            your data.

            #### InfluxDB Cloud

            - Default is `implicit`.

            #### InfluxDB OSS

            - Doesn't support `schemaType`.
          $ref: '#/components/schemas/SchemaType'
          default: implicit
      required:
        - orgID
        - name
    Bucket:
      properties:
        links:
          type: object
          readOnly: true
          example:
            labels: /api/v2/buckets/1/labels
            members: /api/v2/buckets/1/members
            org: /api/v2/orgs/2
            owners: /api/v2/buckets/1/owners
            self: /api/v2/buckets/1
            write: /api/v2/write?org=2&bucket=1
          properties:
            labels:
              description: URL to retrieve labels for this bucket.
              $ref: '#/components/schemas/Link'
            members:
              description: URL to retrieve members that can read this bucket.
              $ref: '#/components/schemas/Link'
            org:
              description: URL to retrieve parent organization for this bucket.
              $ref: '#/components/schemas/Link'
            owners:
              description: URL to retrieve owners that can read and write to this bucket.
              $ref: '#/components/schemas/Link'
            self:
              description: URL for this bucket.
              $ref: '#/components/schemas/Link'
            write:
              description: URL to write line protocol to this bucket.
              $ref: '#/components/schemas/Link'
        id:
          readOnly: true
          type: string
        type:
          readOnly: true
          type: string
          default: user
          enum:
            - user
            - system
        name:
          type: string
        description:
          type: string
        orgID:
          type: string
        rp:
          type: string
        schemaType:
          $ref: '#/components/schemas/SchemaType'
          default: implicit
        createdAt:
          type: string
          format: date-time
          readOnly: true
        updatedAt:
          type: string
          format: date-time
          readOnly: true
        retentionRules:
          $ref: '#/components/schemas/RetentionRules'
        labels:
          $ref: '#/components/schemas/Labels'
      required:
        - name
        - retentionRules
    Buckets:
      type: object
      properties:
        links:
          readOnly: true
          $ref: '#/components/schemas/Links'
        buckets:
          type: array
          items:
            $ref: '#/components/schemas/Bucket'
    RetentionRules:
      type: array
      description: |
        Retention rules to expire or retain data.
        #### InfluxDB Cloud

        - `retentionRules` is required.

        #### InfluxDB OSS

        - `retentionRules` isn't required.
      items:
        $ref: '#/components/schemas/RetentionRule'
    PatchBucketRequest:
      type: object
      description: |
        An object that contains updated bucket properties to apply.
      properties:
        name:
          type: string
          description: |
            The name of the bucket.
        description:
          description: |
            A description of the bucket.
          type: string
        retentionRules:
          $ref: '#/components/schemas/PatchRetentionRules'
    PatchRetentionRules:
      type: array
      description: Updates to rules to expire or retain data. No rules means no updates.
      items:
        $ref: '#/components/schemas/PatchRetentionRule'
    PatchRetentionRule:
      type: object
      properties:
        type:
          type: string
          default: expire
          enum:
            - expire
        everySeconds:
          type: integer
          format: int64
          description: |
            The number of seconds to keep data.
            Default duration is `2592000` (30 days).
            `0` represents infinite retention.
          example: 86400
          default: 2592000
          minimum: 0
        shardGroupDurationSeconds:
          type: integer
          format: int64
          description: |
            The [shard group duration](https://docs.influxdata.com/influxdb/v2.3/reference/glossary/#shard).
            The number of seconds that each shard group covers.

            #### InfluxDB Cloud

            - Doesn't use `shardGroupDurationsSeconds`.

            #### InfluxDB OSS

            - Default value depends on the [bucket retention period](https://docs.influxdata.com/influxdb/v2.3/reference/internals/shards/#shard-group-duration).

            #### Related guides

            - InfluxDB [shards and shard groups](https://docs.influxdata.com/influxdb/v2.3/reference/internals/shards/)
      required:
        - everySeconds
    RetentionRule:
      type: object
      properties:
        type:
          type: string
          default: expire
          enum:
            - expire
        everySeconds:
          type: integer
          format: int64
          description: |
            The duration in seconds for how long data will be kept in the database.
            The default duration is 2592000 (30 days).
            0 represents infinite retention.
          example: 86400
          default: 2592000
          minimum: 0
        shardGroupDurationSeconds:
          type: integer
          format: int64
          description: |
            The shard group duration.
            The duration or interval (in seconds) that each shard group covers.

            #### InfluxDB Cloud

            - Does not use `shardGroupDurationsSeconds`.

            #### InfluxDB OSS

            - Default value depends on the
            [bucket retention period](https://docs.influxdata.com/influxdb/v2.3/v2.3/reference/internals/shards/#shard-group-duration).
      required:
        - everySeconds
    Link:
      type: string
      format: uri
      readOnly: true
      description: URI of resource.
    Links:
      type: object
      description: |
        URI pointers for additional paged results.
      properties:
        next:
          $ref: '#/components/schemas/Link'
        self:
          $ref: '#/components/schemas/Link'
        prev:
          $ref: '#/components/schemas/Link'
      required:
        - self
    Logs:
      type: object
      properties:
        events:
          readOnly: true
          type: array
          items:
            $ref: '#/components/schemas/LogEvent'
    LogEvent:
      type: object
      properties:
        time:
          readOnly: true
          description: 'The time ([RFC3339Nano date/time format](https://docs.influxdata.com/influxdb/v2.3/reference/glossary/#rfc3339nano-timestamp)) that the event occurred.'
          type: string
          format: date-time
          example: '2006-01-02T15:04:05.999999999Z07:00'
        message:
          readOnly: true
          description: A description of the event that occurred.
          type: string
          example: Halt and catch fire
        runID:
          readOnly: true
          description: The ID of the task run that generated the event.
          type: string
    Organization:
      properties:
        links:
          type: object
          readOnly: true
          example:
            self: /api/v2/orgs/1
            members: /api/v2/orgs/1/members
            owners: /api/v2/orgs/1/owners
            labels: /api/v2/orgs/1/labels
            secrets: /api/v2/orgs/1/secrets
            buckets: /api/v2/buckets?org=myorg
            tasks: /api/v2/tasks?org=myorg
            dashboards: /api/v2/dashboards?org=myorg
          properties:
            self:
              $ref: '#/components/schemas/Link'
            members:
              $ref: '#/components/schemas/Link'
            owners:
              $ref: '#/components/schemas/Link'
            labels:
              $ref: '#/components/schemas/Link'
            secrets:
              $ref: '#/components/schemas/Link'
            buckets:
              $ref: '#/components/schemas/Link'
            tasks:
              $ref: '#/components/schemas/Link'
            dashboards:
              $ref: '#/components/schemas/Link'
        id:
          readOnly: true
          type: string
        name:
          type: string
        description:
          type: string
        createdAt:
          type: string
          format: date-time
          readOnly: true
        updatedAt:
          type: string
          format: date-time
          readOnly: true
        status:
          description: If inactive the organization is inactive.
          default: active
          type: string
          enum:
            - active
            - inactive
      required:
        - name
    Organizations:
      type: object
      properties:
        links:
          $ref: '#/components/schemas/Links'
        orgs:
          type: array
          items:
            $ref: '#/components/schemas/Organization'
    PostOrganizationRequest:
      type: object
      properties:
        name:
          type: string
        description:
          type: string
      required:
        - name
    PatchOrganizationRequest:
      type: object
      properties:
        name:
          type: string
          description: New name to set on the organization
        description:
          type: string
          description: New description to set on the organization
    TemplateApply:
      type: object
      properties:
        dryRun:
          type: boolean
          description: |
            Only applies a dry run of the templates passed in the request.

            - Validates the template and generates a resource diff and summary.
            - Doesn't install templates or make changes to the InfluxDB instance.
        orgID:
          type: string
          description: |
            Organization ID.
            InfluxDB applies templates to this organization.
            The organization owns all resources created by the template.

            To find your organization, see how to
            [view organizations](https://docs.influxdata.com/influxdb/v2.3/organizations/view-orgs/).
        stackID:
          type: string
          description: |
            ID of the stack to update.

            To apply templates to an existing stack in the organization, use the `stackID` parameter.
            If you apply templates without providing a stack ID,
            InfluxDB initializes a new stack with all new resources.

            To find a stack ID, use the InfluxDB [`/api/v2/stacks` API endpoint](#operation/ListStacks) to list stacks.

            #### Related guides

            - [Stacks](https://docs.influxdata.com/influxdb/v2.3/influxdb-templates/stacks/)
            - [View stacks](https://docs.influxdata.com/influxdb/v2.3/influxdb-templates/stacks/view/)
        template:
          type: object
          description: |
            A template object to apply.
            A template object has a `contents` property
            with an array of InfluxDB resource configurations.

            Pass `template` to apply only one template object.
            If you use `template`, you can't use the `templates` parameter.
            If you want to apply multiple template objects, use `templates` instead.
          properties:
            contentType:
              type: string
            sources:
              type: array
              items:
                type: string
            contents:
              $ref: '#/components/schemas/Template'
        templates:
          type: array
          description: |
            A list of template objects to apply.
            A template object has a `contents` property
            with an array of InfluxDB resource configurations.

            Use the `templates` parameter to apply multiple template objects.
            If you use `templates`, you can't use the `template` parameter.
          items:
            type: object
            properties:
              contentType:
                type: string
              sources:
                type: array
                items:
                  type: string
              contents:
                $ref: '#/components/schemas/Template'
        envRefs:
          type: object
          description: |
            An object with key-value pairs that map to **environment references** in templates.

            Environment references in templates are `envRef` objects with an `envRef.key`
            property.
            To substitute a custom environment reference value when applying templates,
            pass `envRefs` with the `envRef.key` and the value.

            When you apply a template, InfluxDB replaces `envRef` objects in the template
            with the values that you provide in the `envRefs` parameter.
            For more examples, see how to [define environment references](https://docs.influxdata.com/influxdb/v2.3/influxdb-templates/use/#define-environment-references).

            The following template fields may use environment references:

              - `metadata.name`
              - `spec.endpointName`
              - `spec.associations.name`

            For more information about including environment references in template fields, see how to
            [include user-definable resource names](https://docs.influxdata.com/influxdb/v2.3/influxdb-templates/create/#include-user-definable-resource-names).
          additionalProperties:
            oneOf:
              - type: string
              - type: integer
              - type: number
              - type: boolean
        secrets:
          type: object
          description: |
            An object with key-value pairs that map to **secrets** in queries.

            Queries may reference secrets stored in InfluxDB--for example,
            the following Flux script retrieves `POSTGRES_USERNAME` and `POSTGRES_PASSWORD`
            secrets and then uses them to connect to a PostgreSQL database:

              ```js
              import "sql"
              import "influxdata/influxdb/secrets"

              username = secrets.get(key: "POSTGRES_USERNAME")
              password = secrets.get(key: "POSTGRES_PASSWORD")

              sql.from(
                driverName: "postgres",
                dataSourceName: "postgresql://${username}:${password}@localhost:5432",
                query: "SELECT * FROM example_table",
              )
              ```

            To define secret values in your `/api/v2/templates/apply` request,
            pass the `secrets` parameter with key-value pairs--for example:

              ```json
              {
                ...
                "secrets": {
                  "POSTGRES_USERNAME": "pguser",
                  "POSTGRES_PASSWORD": "foo"
                }
                ...
              }
              ```

            InfluxDB stores the key-value pairs as secrets that you can access with `secrets.get()`.
            Once stored, you can't view secret values in InfluxDB.

            #### Related guides

            - [How to pass secrets when installing a template](https://docs.influxdata.com/influxdb/v2.3/influxdb-templates/use/#pass-secrets-when-installing-a-template)
          additionalProperties:
            type: string
        remotes:
          type: array
          description: |
            A list of URLs for template files.

            To apply a template manifest file located at a URL, pass `remotes`
            with an array that contains the URL.
          items:
            type: object
            properties:
              url:
                type: string
              contentType:
                type: string
            required:
              - url
        actions:
          type: array
          description: |
            A list of `action` objects.
            Actions let you customize how InfluxDB applies templates in the request.

            You can use the following actions to prevent creating or updating resources:

            - A `skipKind` action skips template resources of a specified `kind`.
            - A `skipResource` action skips template resources with a specified `metadata.name`
              and `kind`.
          items:
            oneOf:
              - type: object
                properties:
                  action:
                    type: string
                    enum:
                      - skipKind
                  properties:
                    type: object
                    properties:
                      kind:
                        $ref: '#/components/schemas/TemplateKind'
                    required:
                      - kind
              - type: object
                properties:
                  action:
                    type: string
                    enum:
                      - skipResource
                  properties:
                    type: object
                    properties:
                      kind:
                        $ref: '#/components/schemas/TemplateKind'
                      resourceTemplateName:
                        type: string
                    required:
                      - kind
                      - resourceTemplateName
    TemplateKind:
      type: string
      enum:
        - Bucket
        - Check
        - CheckDeadman
        - CheckThreshold
        - Dashboard
        - Label
        - NotificationEndpoint
        - NotificationEndpointHTTP
        - NotificationEndpointPagerDuty
        - NotificationEndpointSlack
        - NotificationRule
        - Task
        - Telegraf
        - Variable
    TemplateExportByID:
      type: object
      properties:
        stackID:
          type: string
        orgIDs:
          type: array
          items:
            type: object
            properties:
              orgID:
                type: string
              resourceFilters:
                type: object
                properties:
                  byLabel:
                    type: array
                    items:
                      type: string
                  byResourceKind:
                    type: array
                    items:
                      $ref: '#/components/schemas/TemplateKind'
        resources:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              kind:
                $ref: '#/components/schemas/TemplateKind'
              name:
                type: string
                description: 'if defined with id, name is used for resource exported by id. if defined independently, resources strictly matching name are exported'
            required:
              - id
              - kind
    TemplateExportByName:
      type: object
      properties:
        stackID:
          type: string
        orgIDs:
          type: array
          items:
            type: object
            properties:
              orgID:
                type: string
              resourceFilters:
                type: object
                properties:
                  byLabel:
                    type: array
                    items:
                      type: string
                  byResourceKind:
                    type: array
                    items:
                      $ref: '#/components/schemas/TemplateKind'
        resources:
          type: array
          items:
            type: object
            properties:
              kind:
                $ref: '#/components/schemas/TemplateKind'
              name:
                type: string
            required:
              - name
              - kind
    Template:
      type: array
      items:
        type: object
        description: |
          A template entry.
          Defines an InfluxDB resource in a template.
        properties:
          apiVersion:
            type: string
            example: influxdata.com/v2alpha1
          kind:
            $ref: '#/components/schemas/TemplateKind'
          metadata:
            type: object
            description: |
              Metadata properties used for the resource when the template is applied.
            properties:
              name:
                type: string
          spec:
            type: object
            description: |
              Configuration properties used for the resource when the template is applied.
              Key-value pairs map to the specification for the resource.

              The following code samples show `spec` configurations for template resources:

              - A bucket:

                ```json
                { "spec": {
                    "name": "iot_center",
                    "retentionRules": [{
                        "everySeconds": 2.592e+06,
                        "type": "expire"
                      }]
                  }
                }
                ```

              - A variable:

                ```json
                { "spec": {
                    "language": "flux",
                    "name": "Node_Service",
                    "query": "import \"influxdata/influxdb/v1\"\r\nv1.tagValues(bucket: \"iot_center\",
                        tag: \"service\")",
                    "type": "query"
                  }
                }
                ```
    TemplateEnvReferences:
      type: array
      items:
        type: object
        properties:
          resourceField:
            type: string
            description: Field the environment reference corresponds too
          envRefKey:
            type: string
            description: Key identified as environment reference and is the key identified in the template
          value:
            description: Value provided to fulfill reference
            nullable: true
            oneOf:
              - type: string
              - type: integer
              - type: number
              - type: boolean
          defaultValue:
            description: Default value that will be provided for the reference when no value is provided
            nullable: true
            oneOf:
              - type: string
              - type: integer
              - type: number
              - type: boolean
        required:
          - resourceField
          - envRefKey
    TemplateSummary:
      type: object
      properties:
        sources:
          type: array
          items:
            type: string
        stackID:
          type: string
        summary:
          type: object
          properties:
            buckets:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: string
                  orgID:
                    type: string
                  kind:
                    $ref: '#/components/schemas/TemplateKind'
                  templateMetaName:
                    type: string
                  name:
                    type: string
                  description:
                    type: string
                  retentionPeriod:
                    type: integer
                  labelAssociations:
                    type: array
                    items:
                      $ref: '#/components/schemas/TemplateSummaryLabel'
                  envReferences:
                    $ref: '#/components/schemas/TemplateEnvReferences'
            checks:
              type: array
              items:
                allOf:
                  - $ref: '#/components/schemas/CheckDiscriminator'
                  - type: object
                    properties:
                      kind:
                        $ref: '#/components/schemas/TemplateKind'
                      templateMetaName:
                        type: string
                      labelAssociations:
                        type: array
                        items:
                          $ref: '#/components/schemas/TemplateSummaryLabel'
                      envReferences:
                        $ref: '#/components/schemas/TemplateEnvReferences'
            dashboards:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: string
                  orgID:
                    type: string
                  kind:
                    $ref: '#/components/schemas/TemplateKind'
                  templateMetaName:
                    type: string
                  name:
                    type: string
                  description:
                    type: string
                  labelAssociations:
                    type: array
                    items:
                      $ref: '#/components/schemas/TemplateSummaryLabel'
                  charts:
                    type: array
                    items:
                      $ref: '#/components/schemas/TemplateChart'
                  envReferences:
                    $ref: '#/components/schemas/TemplateEnvReferences'
            labels:
              type: array
              items:
                $ref: '#/components/schemas/TemplateSummaryLabel'
            labelMappings:
              type: array
              items:
                type: object
                properties:
                  status:
                    type: string
                  resourceTemplateMetaName:
                    type: string
                  resourceName:
                    type: string
                  resourceID:
                    type: string
                  resourceType:
                    type: string
                  labelTemplateMetaName:
                    type: string
                  labelName:
                    type: string
                  labelID:
                    type: string
            missingEnvRefs:
              type: array
              items:
                type: string
            missingSecrets:
              type: array
              items:
                type: string
            notificationEndpoints:
              type: array
              items:
                allOf:
                  - $ref: '#/components/schemas/NotificationEndpointDiscriminator'
                  - type: object
                    properties:
                      kind:
                        $ref: '#/components/schemas/TemplateKind'
                      templateMetaName:
                        type: string
                      labelAssociations:
                        type: array
                        items:
                          $ref: '#/components/schemas/TemplateSummaryLabel'
                      envReferences:
                        $ref: '#/components/schemas/TemplateEnvReferences'
            notificationRules:
              type: array
              items:
                type: object
                properties:
                  kind:
                    $ref: '#/components/schemas/TemplateKind'
                  templateMetaName:
                    type: string
                  name:
                    type: string
                  description:
                    type: string
                  endpointTemplateMetaName:
                    type: string
                  endpointID:
                    type: string
                  endpointType:
                    type: string
                  every:
                    type: string
                  offset:
                    type: string
                  messageTemplate:
                    type: string
                  status:
                    type: string
                  statusRules:
                    type: array
                    items:
                      type: object
                      properties:
                        currentLevel:
                          type: string
                        previousLevel:
                          type: string
                  tagRules:
                    type: array
                    items:
                      type: object
                      properties:
                        key:
                          type: string
                        value:
                          type: string
                        operator:
                          type: string
                  labelAssociations:
                    type: array
                    items:
                      $ref: '#/components/schemas/TemplateSummaryLabel'
                  envReferences:
                    $ref: '#/components/schemas/TemplateEnvReferences'
            tasks:
              type: array
              items:
                type: object
                properties:
                  kind:
                    $ref: '#/components/schemas/TemplateKind'
                  templateMetaName:
                    type: string
                  id:
                    type: string
                  name:
                    type: string
                  cron:
                    type: string
                  description:
                    type: string
                  every:
                    type: string
                  offset:
                    type: string
                  query:
                    type: string
                  status:
                    type: string
                  envReferences:
                    $ref: '#/components/schemas/TemplateEnvReferences'
            telegrafConfigs:
              type: array
              items:
                allOf:
                  - $ref: '#/components/schemas/TelegrafRequest'
                  - type: object
                    properties:
                      kind:
                        $ref: '#/components/schemas/TemplateKind'
                      templateMetaName:
                        type: string
                      labelAssociations:
                        type: array
                        items:
                          $ref: '#/components/schemas/TemplateSummaryLabel'
                      envReferences:
                        $ref: '#/components/schemas/TemplateEnvReferences'
            variables:
              type: array
              items:
                type: object
                properties:
                  kind:
                    $ref: '#/components/schemas/TemplateKind'
                  templateMetaName:
                    type: string
                  id:
                    type: string
                  orgID:
                    type: string
                  name:
                    type: string
                  description:
                    type: string
                  arguments:
                    $ref: '#/components/schemas/VariableProperties'
                  labelAssociations:
                    type: array
                    items:
                      $ref: '#/components/schemas/TemplateSummaryLabel'
                  envReferences:
                    $ref: '#/components/schemas/TemplateEnvReferences'
        diff:
          type: object
          properties:
            buckets:
              type: array
              items:
                type: object
                properties:
                  kind:
                    $ref: '#/components/schemas/TemplateKind'
                  stateStatus:
                    type: string
                  id:
                    type: string
                  templateMetaName:
                    type: string
                  new:
                    type: object
                    properties:
                      name:
                        type: string
                      description:
                        type: string
                      retentionRules:
                        $ref: '#/components/schemas/RetentionRules'
                  old:
                    type: object
                    properties:
                      name:
                        type: string
                      description:
                        type: string
                      retentionRules:
                        $ref: '#/components/schemas/RetentionRules'
            checks:
              type: array
              items:
                type: object
                properties:
                  kind:
                    $ref: '#/components/schemas/TemplateKind'
                  stateStatus:
                    type: string
                  id:
                    type: string
                  templateMetaName:
                    type: string
                  new:
                    $ref: '#/components/schemas/CheckDiscriminator'
                  old:
                    $ref: '#/components/schemas/CheckDiscriminator'
            dashboards:
              type: array
              items:
                type: object
                properties:
                  stateStatus:
                    type: string
                  id:
                    type: string
                  kind:
                    $ref: '#/components/schemas/TemplateKind'
                  templateMetaName:
                    type: string
                  new:
                    type: object
                    properties:
                      name:
                        type: string
                      description:
                        type: string
                      charts:
                        type: array
                        items:
                          $ref: '#/components/schemas/TemplateChart'
                  old:
                    type: object
                    properties:
                      name:
                        type: string
                      description:
                        type: string
                      charts:
                        type: array
                        items:
                          $ref: '#/components/schemas/TemplateChart'
            labels:
              type: array
              items:
                type: object
                properties:
                  stateStatus:
                    type: string
                  kind:
                    $ref: '#/components/schemas/TemplateKind'
                  id:
                    type: string
                  templateMetaName:
                    type: string
                  new:
                    type: object
                    properties:
                      name:
                        type: string
                      color:
                        type: string
                      description:
                        type: string
                  old:
                    type: object
                    properties:
                      name:
                        type: string
                      color:
                        type: string
                      description:
                        type: string
            labelMappings:
              type: array
              items:
                type: object
                properties:
                  status:
                    type: string
                  resourceType:
                    type: string
                  resourceID:
                    type: string
                  resourceTemplateMetaName:
                    type: string
                  resourceName:
                    type: string
                  labelID:
                    type: string
                  labelTemplateMetaName:
                    type: string
                  labelName:
                    type: string
            notificationEndpoints:
              type: array
              items:
                type: object
                properties:
                  kind:
                    $ref: '#/components/schemas/TemplateKind'
                  stateStatus:
                    type: string
                  id:
                    type: string
                  templateMetaName:
                    type: string
                  new:
                    $ref: '#/components/schemas/NotificationEndpointDiscriminator'
                  old:
                    $ref: '#/components/schemas/NotificationEndpointDiscriminator'
            notificationRules:
              type: array
              items:
                type: object
                properties:
                  kind:
                    $ref: '#/components/schemas/TemplateKind'
                  stateStatus:
                    type: string
                  id:
                    type: string
                  templateMetaName:
                    type: string
                  new:
                    type: object
                    properties:
                      name:
                        type: string
                      description:
                        type: string
                      endpointName:
                        type: string
                      endpointID:
                        type: string
                      endpointType:
                        type: string
                      every:
                        type: string
                      offset:
                        type: string
                      messageTemplate:
                        type: string
                      status:
                        type: string
                      statusRules:
                        type: array
                        items:
                          type: object
                          properties:
                            currentLevel:
                              type: string
                            previousLevel:
                              type: string
                      tagRules:
                        type: array
                        items:
                          type: object
                          properties:
                            key:
                              type: string
                            value:
                              type: string
                            operator:
                              type: string
                  old:
                    type: object
                    properties:
                      name:
                        type: string
                      description:
                        type: string
                      endpointName:
                        type: string
                      endpointID:
                        type: string
                      endpointType:
                        type: string
                      every:
                        type: string
                      offset:
                        type: string
                      messageTemplate:
                        type: string
                      status:
                        type: string
                      statusRules:
                        type: array
                        items:
                          type: object
                          properties:
                            currentLevel:
                              type: string
                            previousLevel:
                              type: string
                      tagRules:
                        type: array
                        items:
                          type: object
                          properties:
                            key:
                              type: string
                            value:
                              type: string
                            operator:
                              type: string
            tasks:
              type: array
              items:
                type: object
                properties:
                  kind:
                    $ref: '#/components/schemas/TemplateKind'
                  stateStatus:
                    type: string
                  id:
                    type: string
                  templateMetaName:
                    type: string
                  new:
                    type: object
                    properties:
                      name:
                        type: string
                      cron:
                        type: string
                      description:
                        type: string
                      every:
                        type: string
                      offset:
                        type: string
                      query:
                        type: string
                      status:
                        type: string
                  old:
                    type: object
                    properties:
                      name:
                        type: string
                      cron:
                        type: string
                      description:
                        type: string
                      every:
                        type: string
                      offset:
                        type: string
                      query:
                        type: string
                      status:
                        type: string
            telegrafConfigs:
              type: array
              items:
                type: object
                properties:
                  kind:
                    $ref: '#/components/schemas/TemplateKind'
                  stateStatus:
                    type: string
                  id:
                    type: string
                  templateMetaName:
                    type: string
                  new:
                    $ref: '#/components/schemas/TelegrafRequest'
                  old:
                    $ref: '#/components/schemas/TelegrafRequest'
            variables:
              type: array
              items:
                type: object
                properties:
                  kind:
                    $ref: '#/components/schemas/TemplateKind'
                  stateStatus:
                    type: string
                  id:
                    type: string
                  templateMetaName:
                    type: string
                  new:
                    type: object
                    properties:
                      name:
                        type: string
                      description:
                        type: string
                      args:
                        $ref: '#/components/schemas/VariableProperties'
                  old:
                    type: object
                    properties:
                      name:
                        type: string
                      description:
                        type: string
                      args:
                        $ref: '#/components/schemas/VariableProperties'
        errors:
          type: array
          items:
            type: object
            properties:
              kind:
                $ref: '#/components/schemas/TemplateKind'
              reason:
                type: string
              fields:
                type: array
                items:
                  type: string
              indexes:
                type: array
                items:
                  type: integer
    TemplateSummaryLabel:
      type: object
      properties:
        id:
          type: string
        orgID:
          type: string
        kind:
          $ref: '#/components/schemas/TemplateKind'
        templateMetaName:
          type: string
        name:
          type: string
        properties:
          type: object
          properties:
            color:
              type: string
            description:
              type: string
        envReferences:
          $ref: '#/components/schemas/TemplateEnvReferences'
    TemplateChart:
      type: object
      properties:
        xPos:
          type: integer
        yPos:
          type: integer
        height:
          type: integer
        width:
          type: integer
        properties:
          $ref: '#/components/schemas/ViewProperties'
    Stack:
      type: object
      properties:
        id:
          type: string
        orgID:
          type: string
        createdAt:
          type: string
          format: date-time
          readOnly: true
        events:
          type: array
          items:
            type: object
            properties:
              eventType:
                type: string
              name:
                type: string
              description:
                type: string
              sources:
                type: array
                items:
                  type: string
              resources:
                type: array
                items:
                  type: object
                  properties:
                    apiVersion:
                      type: string
                    resourceID:
                      type: string
                    kind:
                      $ref: '#/components/schemas/TemplateKind'
                    templateMetaName:
                      type: string
                    associations:
                      type: array
                      items:
                        type: object
                        properties:
                          kind:
                            $ref: '#/components/schemas/TemplateKind'
                          metaName:
                            type: string
                    links:
                      type: object
                      properties:
                        self:
                          type: string
              urls:
                type: array
                items:
                  type: string
              updatedAt:
                type: string
                format: date-time
                readOnly: true
    Runs:
      type: object
      properties:
        links:
          $ref: '#/components/schemas/Links'
        runs:
          type: array
          items:
            $ref: '#/components/schemas/Run'
    Run:
      properties:
        id:
          readOnly: true
          type: string
        taskID:
          readOnly: true
          type: string
        status:
          readOnly: true
          type: string
          enum:
            - scheduled
            - started
            - failed
            - success
            - canceled
        scheduledFor:
          description: 'The time [RFC3339 date/time format](https://docs.influxdata.com/influxdb/v2.3/reference/glossary/#rfc3339-timestamp) used for the run''s `now` option.'
          type: string
          format: date-time
        log:
          description: An array of logs associated with the run.
          type: array
          readOnly: true
          items:
            $ref: '#/components/schemas/LogEvent'
        flux:
          description: Flux used for the task
          type: string
          readOnly: true
        startedAt:
          readOnly: true
          description: 'The time ([RFC3339Nano date/time format](https://go.dev/src/time/format.go)) the run started executing.'
          type: string
          format: date-time
          example: '2006-01-02T15:04:05.999999999Z07:00'
        finishedAt:
          readOnly: true
          description: 'The time ([RFC3339Nano date/time format](https://go.dev/src/time/format.go)) the run finished executing.'
          type: string
          format: date-time
          example: '2006-01-02T15:04:05.999999999Z07:00'
        requestedAt:
          readOnly: true
          description: 'The time ([RFC3339Nano date/time format](https://docs.influxdata.com/influxdb/v2.3/reference/glossary/#rfc3339nano-timestamp)) the run was manually requested.'
          type: string
          format: date-time
          example: '2006-01-02T15:04:05.999999999Z07:00'
        links:
          type: object
          readOnly: true
          example:
            self: /api/v2/tasks/1/runs/1
            task: /api/v2/tasks/1
            retry: /api/v2/tasks/1/runs/1/retry
          properties:
            self:
              type: string
              format: uri
            task:
              type: string
              format: uri
            retry:
              type: string
              format: uri
    RunManually:
      properties:
        scheduledFor:
          nullable: true
          description: |
            The time [RFC3339 date/time format](https://docs.influxdata.com/influxdb/v2.3/reference/glossary/#rfc3339-timestamp)
            used for the run's `now` option.
            Default is the server _now_ time.
          type: string
          format: date-time
    TaskStatusType:
      type: string
      enum:
        - active
        - inactive
      description: |
        `inactive` cancels scheduled runs and prevents manual runs of the task.
    UserResponse:
      properties:
        id:
          readOnly: true
          type: string
          description: |
            The ID of the user.
        name:
          type: string
          description: |
            The name of the user.
        status:
          description: |
            The status of a user. An inactive user won't have access to resources.
          default: active
          type: string
          enum:
            - active
            - inactive
        links:
          type: object
          readOnly: true
          example:
            self: /api/v2/users/1
          properties:
            self:
              type: string
              format: uri
      required:
        - name
    Flags:
      type: object
      additionalProperties: true
    ResourceMember:
      allOf:
        - $ref: '#/components/schemas/UserResponse'
        - type: object
          properties:
            role:
              type: string
              default: member
              enum:
                - member
    ResourceMembers:
      type: object
      properties:
        links:
          type: object
          properties:
            self:
              type: string
              format: uri
        users:
          type: array
          items:
            $ref: '#/components/schemas/ResourceMember'
    ResourceOwner:
      allOf:
        - $ref: '#/components/schemas/UserResponse'
        - type: object
          properties:
            role:
              type: string
              default: owner
              enum:
                - owner
    ResourceOwners:
      type: object
      properties:
        links:
          type: object
          properties:
            self:
              type: string
              format: uri
        users:
          type: array
          items:
            $ref: '#/components/schemas/ResourceOwner'
    FluxSuggestions:
      type: object
      properties:
        funcs:
          type: array
          items:
            $ref: '#/components/schemas/FluxSuggestion'
    FluxSuggestion:
      type: object
      properties:
        name:
          type: string
        params:
          type: object
          additionalProperties:
            type: string
    Routes:
      properties:
        authorizations:
          type: string
          format: uri
        buckets:
          type: string
          format: uri
        dashboards:
          type: string
          format: uri
        external:
          type: object
          properties:
            statusFeed:
              type: string
              format: uri
        variables:
          type: string
          format: uri
        me:
          type: string
          format: uri
        flags:
          type: string
          format: uri
        orgs:
          type: string
          format: uri
        query:
          type: object
          properties:
            self:
              type: string
              format: uri
            ast:
              type: string
              format: uri
            analyze:
              type: string
              format: uri
            suggestions:
              type: string
              format: uri
        setup:
          type: string
          format: uri
        signin:
          type: string
          format: uri
        signout:
          type: string
          format: uri
        sources:
          type: string
          format: uri
        system:
          type: object
          properties:
            metrics:
              type: string
              format: uri
            debug:
              type: string
              format: uri
            health:
              type: string
              format: uri
        tasks:
          type: string
          format: uri
        telegrafs:
          type: string
          format: uri
        users:
          type: string
          format: uri
        write:
          type: string
          format: uri
    Error:
      properties:
        code:
          description: code is the machine-readable error code.
          readOnly: true
          type: string
          enum:
            - internal error
            - not found
            - conflict
            - invalid
            - unprocessable entity
            - empty value
            - unavailable
            - forbidden
            - too many requests
            - unauthorized
            - method not allowed
            - request too large
            - unsupported media type
        message:
          readOnly: true
          description: Human-readable message.
          type: string
        op:
          readOnly: true
          description: Describes the logical code operation when the error occurred. Useful for debugging.
          type: string
        err:
          readOnly: true
          description: Stack of errors that occurred during processing of the request. Useful for debugging.
          type: string
      required:
        - code
    LineProtocolError:
      properties:
        code:
          description: Code is the machine-readable error code.
          readOnly: true
          type: string
          enum:
            - internal error
            - not found
            - conflict
            - invalid
            - empty value
            - unavailable
        message:
          readOnly: true
          description: Human-readable message.
          type: string
        op:
          readOnly: true
          description: Describes the logical code operation when the error occurred. Useful for debugging.
          type: string
        err:
          readOnly: true
          description: Stack of errors that occurred during processing of the request. Useful for debugging.
          type: string
        line:
          readOnly: true
          description: First line in the request body that contains malformed data.
          type: integer
          format: int32
      required:
        - code
    LineProtocolLengthError:
      properties:
        code:
          description: Code is the machine-readable error code.
          readOnly: true
          type: string
          enum:
            - invalid
        message:
          readOnly: true
          description: Human-readable message.
          type: string
      required:
        - code
        - message
    Field:
      type: object
      properties:
        value:
          description: value is the value of the field.  Meaning of the value is implied by the `type` key
          type: string
        type:
          description: '`type` describes the field type. `func` is a function. `field` is a field reference.'
          type: string
          enum:
            - func
            - field
            - integer
            - number
            - regex
            - wildcard
        alias:
          description: Alias overrides the field name in the returned response.  Applies only if type is `func`
          type: string
        args:
          description: Args are the arguments to the function
          type: array
          items:
            $ref: '#/components/schemas/Field'
    BuilderConfig:
      type: object
      properties:
        buckets:
          type: array
          items:
            type: string
        tags:
          type: array
          items:
            $ref: '#/components/schemas/BuilderTagsType'
        functions:
          type: array
          items:
            $ref: '#/components/schemas/BuilderFunctionsType'
        aggregateWindow:
          type: object
          properties:
            period:
              type: string
            fillValues:
              type: boolean
    BuilderTagsType:
      type: object
      properties:
        key:
          type: string
        values:
          type: array
          items:
            type: string
        aggregateFunctionType:
          $ref: '#/components/schemas/BuilderAggregateFunctionType'
    BuilderAggregateFunctionType:
      type: string
      enum:
        - filter
        - group
    BuilderFunctionsType:
      type: object
      properties:
        name:
          type: string
    DashboardQuery:
      type: object
      properties:
        text:
          type: string
          description: The text of the Flux query.
        editMode:
          $ref: '#/components/schemas/QueryEditMode'
        name:
          type: string
        builderConfig:
          $ref: '#/components/schemas/BuilderConfig'
    QueryEditMode:
      type: string
      enum:
        - builder
        - advanced
    Axis:
      type: object
      description: Axis used in a visualization.
      properties:
        bounds:
          type: array
          minItems: 0
          maxItems: 2
          description: 'The extents of the axis in the form [lower, upper]. Clients determine whether bounds are inclusive or exclusive of their limits.'
          items:
            type: string
        label:
          description: Description of the axis.
          type: string
        prefix:
          description: Label prefix for formatting axis values.
          type: string
        suffix:
          description: Label suffix for formatting axis values.
          type: string
        base:
          description: Radix for formatting axis values.
          type: string
          enum:
            - ''
            - '2'
            - '10'
        scale:
          $ref: '#/components/schemas/AxisScale'
    AxisScale:
      description: 'Scale is the axis formatting scale. Supported: "log", "linear"'
      type: string
      enum:
        - log
        - linear
    DashboardColor:
      type: object
      description: Defines an encoding of data value into color space.
      required:
        - id
        - type
        - hex
        - name
        - value
      properties:
        id:
          description: The unique ID of the view color.
          type: string
        type:
          description: Type is how the color is used.
          type: string
          enum:
            - min
            - max
            - threshold
            - scale
            - text
            - background
        hex:
          description: The hex number of the color
          type: string
          maxLength: 7
          minLength: 7
        name:
          description: The user-facing name of the hex color.
          type: string
        value:
          description: The data value mapped to this color.
          type: number
          format: float
    RenamableField:
      description: Describes a field that can be renamed and made visible or invisible.
      type: object
      properties:
        internalName:
          description: The calculated name of a field.
          readOnly: true
          type: string
        displayName:
          description: The name that a field is renamed to by the user.
          type: string
        visible:
          description: Indicates whether this field should be visible on the table.
          type: boolean
    XYViewProperties:
      type: object
      required:
        - type
        - geom
        - queries
        - shape
        - axes
        - colors
        - note
        - showNoteWhenEmpty
        - position
      properties:
        adaptiveZoomHide:
          type: boolean
        timeFormat:
          type: string
        type:
          type: string
          enum:
            - xy
        queries:
          type: array
          items:
            $ref: '#/components/schemas/DashboardQuery'
        colors:
          description: Colors define color encoding of data into a visualization
          type: array
          items:
            $ref: '#/components/schemas/DashboardColor'
        colorMapping:
          description: An object that contains information about the color mapping
          $ref: '#/components/schemas/ColorMapping'
        shape:
          type: string
          enum:
            - chronograf-v2
        note:
          type: string
        showNoteWhenEmpty:
          description: 'If true, will display note when empty'
          type: boolean
        axes:
          $ref: '#/components/schemas/Axes'
        staticLegend:
          $ref: '#/components/schemas/StaticLegend'
        xColumn:
          type: string
        generateXAxisTicks:
          type: array
          items:
            type: string
        xTotalTicks:
          type: integer
        xTickStart:
          type: number
          format: float
        xTickStep:
          type: number
          format: float
        yColumn:
          type: string
        generateYAxisTicks:
          type: array
          items:
            type: string
        yTotalTicks:
          type: integer
        yTickStart:
          type: number
          format: float
        yTickStep:
          type: number
          format: float
        shadeBelow:
          type: boolean
        hoverDimension:
          type: string
          enum:
            - auto
            - x
            - 'y'
            - xy
        position:
          type: string
          enum:
            - overlaid
            - stacked
        geom:
          $ref: '#/components/schemas/XYGeom'
        legendColorizeRows:
          type: boolean
        legendHide:
          type: boolean
        legendOpacity:
          type: number
          format: float
        legendOrientationThreshold:
          type: integer
    XYGeom:
      type: string
      enum:
        - line
        - step
        - stacked
        - bar
        - monotoneX
        - stepBefore
        - stepAfter
    BandViewProperties:
      type: object
      required:
        - type
        - geom
        - queries
        - shape
        - axes
        - colors
        - note
        - showNoteWhenEmpty
      properties:
        adaptiveZoomHide:
          type: boolean
        timeFormat:
          type: string
        type:
          type: string
          enum:
            - band
        queries:
          type: array
          items:
            $ref: '#/components/schemas/DashboardQuery'
        colors:
          description: Colors define color encoding of data into a visualization
          type: array
          items:
            $ref: '#/components/schemas/DashboardColor'
        shape:
          type: string
          enum:
            - chronograf-v2
        note:
          type: string
        showNoteWhenEmpty:
          description: 'If true, will display note when empty'
          type: boolean
        axes:
          $ref: '#/components/schemas/Axes'
        staticLegend:
          $ref: '#/components/schemas/StaticLegend'
        xColumn:
          type: string
        generateXAxisTicks:
          type: array
          items:
            type: string
        xTotalTicks:
          type: integer
        xTickStart:
          type: number
          format: float
        xTickStep:
          type: number
          format: float
        yColumn:
          type: string
        generateYAxisTicks:
          type: array
          items:
            type: string
        yTotalTicks:
          type: integer
        yTickStart:
          type: number
          format: float
        yTickStep:
          type: number
          format: float
        upperColumn:
          type: string
        mainColumn:
          type: string
        lowerColumn:
          type: string
        hoverDimension:
          type: string
          enum:
            - auto
            - x
            - 'y'
            - xy
        geom:
          $ref: '#/components/schemas/XYGeom'
        legendColorizeRows:
          type: boolean
        legendHide:
          type: boolean
        legendOpacity:
          type: number
          format: float
        legendOrientationThreshold:
          type: integer
    LinePlusSingleStatProperties:
      type: object
      required:
        - type
        - queries
        - shape
        - axes
        - colors
        - note
        - showNoteWhenEmpty
        - prefix
        - suffix
        - decimalPlaces
        - position
      properties:
        adaptiveZoomHide:
          type: boolean
        timeFormat:
          type: string
        type:
          type: string
          enum:
            - line-plus-single-stat
        queries:
          type: array
          items:
            $ref: '#/components/schemas/DashboardQuery'
        colors:
          description: Colors define color encoding of data into a visualization
          type: array
          items:
            $ref: '#/components/schemas/DashboardColor'
        shape:
          type: string
          enum:
            - chronograf-v2
        note:
          type: string
        showNoteWhenEmpty:
          description: 'If true, will display note when empty'
          type: boolean
        axes:
          $ref: '#/components/schemas/Axes'
        staticLegend:
          $ref: '#/components/schemas/StaticLegend'
        xColumn:
          type: string
        generateXAxisTicks:
          type: array
          items:
            type: string
        xTotalTicks:
          type: integer
        xTickStart:
          type: number
          format: float
        xTickStep:
          type: number
          format: float
        yColumn:
          type: string
        generateYAxisTicks:
          type: array
          items:
            type: string
        yTotalTicks:
          type: integer
        yTickStart:
          type: number
          format: float
        yTickStep:
          type: number
          format: float
        shadeBelow:
          type: boolean
        hoverDimension:
          type: string
          enum:
            - auto
            - x
            - 'y'
            - xy
        position:
          type: string
          enum:
            - overlaid
            - stacked
        prefix:
          type: string
        suffix:
          type: string
        decimalPlaces:
          $ref: '#/components/schemas/DecimalPlaces'
        legendColorizeRows:
          type: boolean
        legendHide:
          type: boolean
        legendOpacity:
          type: number
          format: float
        legendOrientationThreshold:
          type: integer
    MosaicViewProperties:
      type: object
      required:
        - type
        - queries
        - colors
        - shape
        - note
        - showNoteWhenEmpty
        - xColumn
        - ySeriesColumns
        - fillColumns
        - xDomain
        - yDomain
        - xAxisLabel
        - yAxisLabel
        - xPrefix
        - yPrefix
        - xSuffix
        - ySuffix
      properties:
        timeFormat:
          type: string
        type:
          type: string
          enum:
            - mosaic
        queries:
          type: array
          items:
            $ref: '#/components/schemas/DashboardQuery'
        colors:
          description: Colors define color encoding of data into a visualization
          type: array
          items:
            type: string
        shape:
          type: string
          enum:
            - chronograf-v2
        note:
          type: string
        showNoteWhenEmpty:
          description: 'If true, will display note when empty'
          type: boolean
        xColumn:
          type: string
        generateXAxisTicks:
          type: array
          items:
            type: string
        xTotalTicks:
          type: integer
        xTickStart:
          type: number
          format: float
        xTickStep:
          type: number
          format: float
        yLabelColumnSeparator:
          type: string
        yLabelColumns:
          type: array
          items:
            type: string
        ySeriesColumns:
          type: array
          items:
            type: string
        fillColumns:
          type: array
          items:
            type: string
        xDomain:
          type: array
          items:
            type: number
          maxItems: 2
        yDomain:
          type: array
          items:
            type: number
          maxItems: 2
        xAxisLabel:
          type: string
        yAxisLabel:
          type: string
        xPrefix:
          type: string
        xSuffix:
          type: string
        yPrefix:
          type: string
        ySuffix:
          type: string
        hoverDimension:
          type: string
          enum:
            - auto
            - x
            - 'y'
            - xy
        legendColorizeRows:
          type: boolean
        legendHide:
          type: boolean
        legendOpacity:
          type: number
          format: float
        legendOrientationThreshold:
          type: integer
    ScatterViewProperties:
      type: object
      required:
        - type
        - queries
        - colors
        - shape
        - note
        - showNoteWhenEmpty
        - xColumn
        - yColumn
        - fillColumns
        - symbolColumns
        - xDomain
        - yDomain
        - xAxisLabel
        - yAxisLabel
        - xPrefix
        - yPrefix
        - xSuffix
        - ySuffix
      properties:
        adaptiveZoomHide:
          type: boolean
        timeFormat:
          type: string
        type:
          type: string
          enum:
            - scatter
        queries:
          type: array
          items:
            $ref: '#/components/schemas/DashboardQuery'
        colors:
          description: Colors define color encoding of data into a visualization
          type: array
          items:
            type: string
        shape:
          type: string
          enum:
            - chronograf-v2
        note:
          type: string
        showNoteWhenEmpty:
          description: 'If true, will display note when empty'
          type: boolean
        xColumn:
          type: string
        generateXAxisTicks:
          type: array
          items:
            type: string
        xTotalTicks:
          type: integer
        xTickStart:
          type: number
          format: float
        xTickStep:
          type: number
          format: float
        yColumn:
          type: string
        generateYAxisTicks:
          type: array
          items:
            type: string
        yTotalTicks:
          type: integer
        yTickStart:
          type: number
          format: float
        yTickStep:
          type: number
          format: float
        fillColumns:
          type: array
          items:
            type: string
        symbolColumns:
          type: array
          items:
            type: string
        xDomain:
          type: array
          items:
            type: number
          maxItems: 2
        yDomain:
          type: array
          items:
            type: number
          maxItems: 2
        xAxisLabel:
          type: string
        yAxisLabel:
          type: string
        xPrefix:
          type: string
        xSuffix:
          type: string
        yPrefix:
          type: string
        ySuffix:
          type: string
        legendColorizeRows:
          type: boolean
        legendHide:
          type: boolean
        legendOpacity:
          type: number
          format: float
        legendOrientationThreshold:
          type: integer
    HeatmapViewProperties:
      type: object
      required:
        - type
        - queries
        - colors
        - shape
        - note
        - showNoteWhenEmpty
        - xColumn
        - yColumn
        - xDomain
        - yDomain
        - xAxisLabel
        - yAxisLabel
        - xPrefix
        - yPrefix
        - xSuffix
        - ySuffix
        - binSize
      properties:
        adaptiveZoomHide:
          type: boolean
        timeFormat:
          type: string
        type:
          type: string
          enum:
            - heatmap
        queries:
          type: array
          items:
            $ref: '#/components/schemas/DashboardQuery'
        colors:
          description: Colors define color encoding of data into a visualization
          type: array
          items:
            type: string
        shape:
          type: string
          enum:
            - chronograf-v2
        note:
          type: string
        showNoteWhenEmpty:
          description: 'If true, will display note when empty'
          type: boolean
        xColumn:
          type: string
        generateXAxisTicks:
          type: array
          items:
            type: string
        xTotalTicks:
          type: integer
        xTickStart:
          type: number
          format: float
        xTickStep:
          type: number
          format: float
        yColumn:
          type: string
        generateYAxisTicks:
          type: array
          items:
            type: string
        yTotalTicks:
          type: integer
        yTickStart:
          type: number
          format: float
        yTickStep:
          type: number
          format: float
        xDomain:
          type: array
          items:
            type: number
          maxItems: 2
        yDomain:
          type: array
          items:
            type: number
          maxItems: 2
        xAxisLabel:
          type: string
        yAxisLabel:
          type: string
        xPrefix:
          type: string
        xSuffix:
          type: string
        yPrefix:
          type: string
        ySuffix:
          type: string
        binSize:
          type: number
        legendColorizeRows:
          type: boolean
        legendHide:
          type: boolean
        legendOpacity:
          type: number
          format: float
        legendOrientationThreshold:
          type: integer
    SingleStatViewProperties:
      type: object
      required:
        - type
        - queries
        - colors
        - shape
        - note
        - showNoteWhenEmpty
        - prefix
        - tickPrefix
        - suffix
        - tickSuffix
        - decimalPlaces
      properties:
        type:
          type: string
          enum:
            - single-stat
        queries:
          type: array
          items:
            $ref: '#/components/schemas/DashboardQuery'
        colors:
          description: Colors define color encoding of data into a visualization
          type: array
          items:
            $ref: '#/components/schemas/DashboardColor'
        shape:
          type: string
          enum:
            - chronograf-v2
        note:
          type: string
        showNoteWhenEmpty:
          description: 'If true, will display note when empty'
          type: boolean
        prefix:
          type: string
        tickPrefix:
          type: string
        suffix:
          type: string
        tickSuffix:
          type: string
        staticLegend:
          $ref: '#/components/schemas/StaticLegend'
        decimalPlaces:
          $ref: '#/components/schemas/DecimalPlaces'
    HistogramViewProperties:
      type: object
      required:
        - type
        - queries
        - colors
        - shape
        - note
        - showNoteWhenEmpty
        - xColumn
        - fillColumns
        - xDomain
        - xAxisLabel
        - position
        - binCount
      properties:
        type:
          type: string
          enum:
            - histogram
        queries:
          type: array
          items:
            $ref: '#/components/schemas/DashboardQuery'
        colors:
          description: Colors define color encoding of data into a visualization
          type: array
          items:
            $ref: '#/components/schemas/DashboardColor'
        shape:
          type: string
          enum:
            - chronograf-v2
        note:
          type: string
        showNoteWhenEmpty:
          description: 'If true, will display note when empty'
          type: boolean
        xColumn:
          type: string
        fillColumns:
          type: array
          items:
            type: string
        xDomain:
          type: array
          items:
            type: number
            format: float
        xAxisLabel:
          type: string
        position:
          type: string
          enum:
            - overlaid
            - stacked
        binCount:
          type: integer
        legendColorizeRows:
          type: boolean
        legendHide:
          type: boolean
        legendOpacity:
          type: number
          format: float
        legendOrientationThreshold:
          type: integer
    GaugeViewProperties:
      type: object
      required:
        - type
        - queries
        - colors
        - shape
        - note
        - showNoteWhenEmpty
        - prefix
        - tickPrefix
        - suffix
        - tickSuffix
        - decimalPlaces
      properties:
        type:
          type: string
          enum:
            - gauge
        queries:
          type: array
          items:
            $ref: '#/components/schemas/DashboardQuery'
        colors:
          description: Colors define color encoding of data into a visualization
          type: array
          items:
            $ref: '#/components/schemas/DashboardColor'
        shape:
          type: string
          enum:
            - chronograf-v2
        note:
          type: string
        showNoteWhenEmpty:
          description: 'If true, will display note when empty'
          type: boolean
        prefix:
          type: string
        tickPrefix:
          type: string
        suffix:
          type: string
        tickSuffix:
          type: string
        decimalPlaces:
          $ref: '#/components/schemas/DecimalPlaces'
    TableViewProperties:
      type: object
      required:
        - type
        - queries
        - colors
        - shape
        - note
        - showNoteWhenEmpty
        - tableOptions
        - fieldOptions
        - timeFormat
        - decimalPlaces
      properties:
        type:
          type: string
          enum:
            - table
        queries:
          type: array
          items:
            $ref: '#/components/schemas/DashboardQuery'
        colors:
          description: Colors define color encoding of data into a visualization
          type: array
          items:
            $ref: '#/components/schemas/DashboardColor'
        shape:
          type: string
          enum:
            - chronograf-v2
        note:
          type: string
        showNoteWhenEmpty:
          description: 'If true, will display note when empty'
          type: boolean
        tableOptions:
          type: object
          properties:
            verticalTimeAxis:
              description: verticalTimeAxis describes the orientation of the table by indicating whether the time axis will be displayed vertically
              type: boolean
            sortBy:
              $ref: '#/components/schemas/RenamableField'
            wrapping:
              description: Wrapping describes the text wrapping style to be used in table views
              type: string
              enum:
                - truncate
                - wrap
                - single-line
            fixFirstColumn:
              description: fixFirstColumn indicates whether the first column of the table should be locked
              type: boolean
        fieldOptions:
          description: fieldOptions represent the fields retrieved by the query with customization options
          type: array
          items:
            $ref: '#/components/schemas/RenamableField'
        timeFormat:
          description: timeFormat describes the display format for time values according to moment.js date formatting
          type: string
        decimalPlaces:
          $ref: '#/components/schemas/DecimalPlaces'
    SimpleTableViewProperties:
      type: object
      required:
        - type
        - showAll
        - queries
        - shape
        - note
        - showNoteWhenEmpty
      properties:
        type:
          type: string
          enum:
            - simple-table
        showAll:
          type: boolean
        queries:
          type: array
          items:
            $ref: '#/components/schemas/DashboardQuery'
        shape:
          type: string
          enum:
            - chronograf-v2
        note:
          type: string
        showNoteWhenEmpty:
          description: 'If true, will display note when empty'
          type: boolean
    MarkdownViewProperties:
      type: object
      required:
        - type
        - shape
        - note
      properties:
        type:
          type: string
          enum:
            - markdown
        shape:
          type: string
          enum:
            - chronograf-v2
        note:
          type: string
    CheckViewProperties:
      type: object
      required:
        - type
        - shape
        - checkID
        - queries
        - colors
      properties:
        adaptiveZoomHide:
          type: boolean
        type:
          type: string
          enum:
            - check
        shape:
          type: string
          enum:
            - chronograf-v2
        checkID:
          type: string
        check:
          $ref: '#/components/schemas/Check'
        queries:
          type: array
          items:
            $ref: '#/components/schemas/DashboardQuery'
        colors:
          description: Colors define color encoding of data into a visualization
          type: array
          items:
            $ref: '#/components/schemas/DashboardColor'
        legendColorizeRows:
          type: boolean
        legendHide:
          type: boolean
        legendOpacity:
          type: number
          format: float
        legendOrientationThreshold:
          type: integer
    GeoViewLayer:
      type: object
      oneOf:
        - $ref: '#/components/schemas/GeoCircleViewLayer'
        - $ref: '#/components/schemas/GeoHeatMapViewLayer'
        - $ref: '#/components/schemas/GeoPointMapViewLayer'
        - $ref: '#/components/schemas/GeoTrackMapViewLayer'
    GeoViewLayerProperties:
      type: object
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - heatmap
            - circleMap
            - pointMap
            - trackMap
    GeoCircleViewLayer:
      allOf:
        - $ref: '#/components/schemas/GeoViewLayerProperties'
        - type: object
          required:
            - radiusField
            - radiusDimension
            - colorField
            - colorDimension
            - colors
          properties:
            radiusField:
              type: string
              description: Radius field
            radiusDimension:
              $ref: '#/components/schemas/Axis'
            colorField:
              type: string
              description: Circle color field
            colorDimension:
              $ref: '#/components/schemas/Axis'
            colors:
              description: Colors define color encoding of data into a visualization
              type: array
              items:
                $ref: '#/components/schemas/DashboardColor'
            radius:
              description: Maximum radius size in pixels
              type: integer
            interpolateColors:
              description: Interpolate circle color based on displayed value
              type: boolean
    GeoPointMapViewLayer:
      allOf:
        - $ref: '#/components/schemas/GeoViewLayerProperties'
        - type: object
          required:
            - colorField
            - colorDimension
            - colors
          properties:
            colorField:
              type: string
              description: Marker color field
            colorDimension:
              $ref: '#/components/schemas/Axis'
            colors:
              description: Colors define color encoding of data into a visualization
              type: array
              items:
                $ref: '#/components/schemas/DashboardColor'
            isClustered:
              description: Cluster close markers together
              type: boolean
            tooltipColumns:
              description: An array for which columns to display in tooltip
              type: array
              items:
                type: string
    GeoTrackMapViewLayer:
      allOf:
        - $ref: '#/components/schemas/GeoViewLayerProperties'
        - type: object
          required:
            - trackWidth
            - speed
            - randomColors
            - trackPointVisualization
      properties:
        trackWidth:
          description: Width of the track
          type: integer
        speed:
          description: Speed of the track animation
          type: integer
        randomColors:
          description: Assign different colors to different tracks
          type: boolean
        colors:
          description: Colors define color encoding of data into a visualization
          type: array
          items:
            $ref: '#/components/schemas/DashboardColor'
    GeoHeatMapViewLayer:
      allOf:
        - $ref: '#/components/schemas/GeoViewLayerProperties'
        - type: object
          required:
            - intensityField
            - intensityDimension
            - radius
            - blur
            - colors
          properties:
            intensityField:
              type: string
              description: Intensity field
            intensityDimension:
              $ref: '#/components/schemas/Axis'
            radius:
              description: Radius size in pixels
              type: integer
            blur:
              description: Blur for heatmap points
              type: integer
            colors:
              description: Colors define color encoding of data into a visualization
              type: array
              items:
                $ref: '#/components/schemas/DashboardColor'
    GeoViewProperties:
      type: object
      required:
        - type
        - shape
        - queries
        - note
        - showNoteWhenEmpty
        - center
        - zoom
        - allowPanAndZoom
        - detectCoordinateFields
        - layers
      properties:
        type:
          type: string
          enum:
            - geo
        queries:
          type: array
          items:
            $ref: '#/components/schemas/DashboardQuery'
        shape:
          type: string
          enum:
            - chronograf-v2
        center:
          description: Coordinates of the center of the map
          type: object
          required:
            - lat
            - lon
          properties:
            lat:
              description: Latitude of the center of the map
              type: number
              format: double
            lon:
              description: Longitude of the center of the map
              type: number
              format: double
        zoom:
          description: Zoom level used for initial display of the map
          type: number
          format: double
          minimum: 1
          maximum: 28
        allowPanAndZoom:
          description: 'If true, map zoom and pan controls are enabled on the dashboard view'
          type: boolean
          default: true
        detectCoordinateFields:
          description: 'If true, search results get automatically regroupped so that lon,lat and value are treated as columns'
          type: boolean
          default: true
        useS2CellID:
          description: 'If true, S2 column is used to calculate lat/lon'
          type: boolean
        s2Column:
          description: String to define the column
          type: string
        latLonColumns:
          $ref: '#/components/schemas/LatLonColumns'
        mapStyle:
          description: 'Define map type - regular, satellite etc.'
          type: string
        note:
          type: string
        showNoteWhenEmpty:
          description: 'If true, will display note when empty'
          type: boolean
        colors:
          description: Colors define color encoding of data into a visualization
          type: array
          items:
            $ref: '#/components/schemas/DashboardColor'
        layers:
          description: List of individual layers shown in the map
          type: array
          items:
            $ref: '#/components/schemas/GeoViewLayer'
    LatLonColumns:
      description: Object type to define lat/lon columns
      type: object
      required:
        - lat
        - lon
      properties:
        lat:
          $ref: '#/components/schemas/LatLonColumn'
        lon:
          $ref: '#/components/schemas/LatLonColumn'
    LatLonColumn:
      description: Object type for key and column definitions
      type: object
      required:
        - key
        - column
      properties:
        key:
          description: Key to determine whether the column is tag/field
          type: string
        column:
          description: Column to look up Lat/Lon
          type: string
    Axes:
      description: The viewport for a View's visualizations
      type: object
      required:
        - x
        - 'y'
      properties:
        x:
          $ref: '#/components/schemas/Axis'
        'y':
          $ref: '#/components/schemas/Axis'
    StaticLegend:
      description: StaticLegend represents the options specific to the static legend
      type: object
      properties:
        colorizeRows:
          type: boolean
        heightRatio:
          type: number
          format: float
        show:
          type: boolean
        opacity:
          type: number
          format: float
        orientationThreshold:
          type: integer
        valueAxis:
          type: string
        widthRatio:
          type: number
          format: float
    DecimalPlaces:
      description: 'Indicates whether decimal places should be enforced, and how many digits it should show.'
      type: object
      properties:
        isEnforced:
          description: Indicates whether decimal point setting should be enforced
          type: boolean
        digits:
          description: The number of digits after decimal to display
          type: integer
          format: int32
    ConstantVariableProperties:
      properties:
        type:
          type: string
          enum:
            - constant
        values:
          type: array
          items:
            type: string
    MapVariableProperties:
      properties:
        type:
          type: string
          enum:
            - map
        values:
          type: object
          additionalProperties:
            type: string
    QueryVariableProperties:
      properties:
        type:
          type: string
          enum:
            - query
        values:
          type: object
          properties:
            query:
              type: string
            language:
              type: string
    VariableProperties:
      type: object
      oneOf:
        - $ref: '#/components/schemas/QueryVariableProperties'
        - $ref: '#/components/schemas/ConstantVariableProperties'
        - $ref: '#/components/schemas/MapVariableProperties'
    ViewProperties:
      oneOf:
        - $ref: '#/components/schemas/LinePlusSingleStatProperties'
        - $ref: '#/components/schemas/XYViewProperties'
        - $ref: '#/components/schemas/SingleStatViewProperties'
        - $ref: '#/components/schemas/HistogramViewProperties'
        - $ref: '#/components/schemas/GaugeViewProperties'
        - $ref: '#/components/schemas/TableViewProperties'
        - $ref: '#/components/schemas/SimpleTableViewProperties'
        - $ref: '#/components/schemas/MarkdownViewProperties'
        - $ref: '#/components/schemas/CheckViewProperties'
        - $ref: '#/components/schemas/ScatterViewProperties'
        - $ref: '#/components/schemas/HeatmapViewProperties'
        - $ref: '#/components/schemas/MosaicViewProperties'
        - $ref: '#/components/schemas/BandViewProperties'
        - $ref: '#/components/schemas/GeoViewProperties'
    View:
      required:
        - name
        - properties
      properties:
        links:
          type: object
          readOnly: true
          properties:
            self:
              type: string
        id:
          readOnly: true
          type: string
        name:
          type: string
        properties:
          $ref: '#/components/schemas/ViewProperties'
    Views:
      type: object
      properties:
        links:
          type: object
          properties:
            self:
              type: string
        views:
          type: array
          items:
            $ref: '#/components/schemas/View'
    CellUpdate:
      type: object
      properties:
        x:
          type: integer
          format: int32
        'y':
          type: integer
          format: int32
        w:
          type: integer
          format: int32
        h:
          type: integer
          format: int32
    CreateCell:
      type: object
      properties:
        name:
          type: string
        x:
          type: integer
          format: int32
        'y':
          type: integer
          format: int32
        w:
          type: integer
          format: int32
        h:
          type: integer
          format: int32
        usingView:
          type: string
          description: Makes a copy of the provided view.
    AnalyzeQueryResponse:
      type: object
      properties:
        errors:
          type: array
          items:
            type: object
            properties:
              line:
                type: integer
              column:
                type: integer
              character:
                type: integer
              message:
                type: string
    CellWithViewProperties:
      type: object
      allOf:
        - $ref: '#/components/schemas/Cell'
        - type: object
          properties:
            name:
              type: string
            properties:
              $ref: '#/components/schemas/ViewProperties'
    Cell:
      type: object
      properties:
        id:
          type: string
        links:
          type: object
          properties:
            self:
              type: string
            view:
              type: string
        x:
          type: integer
          format: int32
        'y':
          type: integer
          format: int32
        w:
          type: integer
          format: int32
        h:
          type: integer
          format: int32
        viewID:
          type: string
          description: The reference to a view from the views API.
    CellsWithViewProperties:
      type: array
      items:
        $ref: '#/components/schemas/CellWithViewProperties'
    Cells:
      type: array
      items:
        $ref: '#/components/schemas/Cell'
    Secrets:
      additionalProperties:
        type: string
      example:
        apikey: abc123xyz
    SecretKeys:
      type: object
      properties:
        secrets:
          type: array
          items:
            type: string
    SecretKeysResponse:
      allOf:
        - $ref: '#/components/schemas/SecretKeys'
        - type: object
          properties:
            links:
              readOnly: true
              type: object
              properties:
                self:
                  type: string
                org:
                  type: string
    CreateDashboardRequest:
      properties:
        orgID:
          type: string
          description: The ID of the organization that owns the dashboard.
        name:
          type: string
          description: The user-facing name of the dashboard.
        description:
          type: string
          description: The user-facing description of the dashboard.
      required:
        - orgID
        - name
    DashboardWithViewProperties:
      type: object
      allOf:
        - $ref: '#/components/schemas/CreateDashboardRequest'
        - type: object
          properties:
            links:
              type: object
              example:
                self: /api/v2/dashboards/1
                cells: /api/v2/dashboards/1/cells
                owners: /api/v2/dashboards/1/owners
                members: /api/v2/dashboards/1/members
                labels: /api/v2/dashboards/1/labels
                org: /api/v2/labels/1
              properties:
                self:
                  $ref: '#/components/schemas/Link'
                cells:
                  $ref: '#/components/schemas/Link'
                members:
                  $ref: '#/components/schemas/Link'
                owners:
                  $ref: '#/components/schemas/Link'
                labels:
                  $ref: '#/components/schemas/Link'
                org:
                  $ref: '#/components/schemas/Link'
            id:
              readOnly: true
              type: string
            meta:
              type: object
              properties:
                createdAt:
                  type: string
                  format: date-time
                updatedAt:
                  type: string
                  format: date-time
            cells:
              $ref: '#/components/schemas/CellsWithViewProperties'
            labels:
              $ref: '#/components/schemas/Labels'
    Dashboard:
      type: object
      allOf:
        - $ref: '#/components/schemas/CreateDashboardRequest'
        - type: object
          properties:
            links:
              type: object
              example:
                self: /api/v2/dashboards/1
                cells: /api/v2/dashboards/1/cells
                owners: /api/v2/dashboards/1/owners
                members: /api/v2/dashboards/1/members
                labels: /api/v2/dashboards/1/labels
                org: /api/v2/labels/1
              properties:
                self:
                  $ref: '#/components/schemas/Link'
                cells:
                  $ref: '#/components/schemas/Link'
                members:
                  $ref: '#/components/schemas/Link'
                owners:
                  $ref: '#/components/schemas/Link'
                labels:
                  $ref: '#/components/schemas/Link'
                org:
                  $ref: '#/components/schemas/Link'
            id:
              readOnly: true
              type: string
            meta:
              type: object
              properties:
                createdAt:
                  type: string
                  format: date-time
                updatedAt:
                  type: string
                  format: date-time
            cells:
              $ref: '#/components/schemas/Cells'
            labels:
              $ref: '#/components/schemas/Labels'
    Dashboards:
      type: object
      properties:
        links:
          $ref: '#/components/schemas/Links'
        dashboards:
          type: array
          items:
            $ref: '#/components/schemas/Dashboard'
    TelegrafRequest:
      type: object
      properties:
        name:
          type: string
        description:
          type: string
        metadata:
          type: object
          properties:
            buckets:
              type: array
              items:
                type: string
        config:
          type: string
        orgID:
          type: string
    TelegrafPluginRequest:
      type: object
      properties:
        name:
          type: string
        description:
          type: string
        plugins:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
              name:
                type: string
              alias:
                type: string
              description:
                type: string
              config:
                type: string
        metadata:
          type: object
          properties:
            buckets:
              type: array
              items:
                type: string
        config:
          type: string
        orgID:
          type: string
    Telegraf:
      type: object
      allOf:
        - $ref: '#/components/schemas/TelegrafRequest'
        - type: object
          properties:
            id:
              type: string
              readOnly: true
            links:
              type: object
              readOnly: true
              example:
                self: /api/v2/telegrafs/1
                lables: /api/v2/telegrafs/1/labels
                owners: /api/v2/telegrafs/1/owners
                members: /api/v2/telegrafs/1/members
              properties:
                self:
                  $ref: '#/components/schemas/Link'
                labels:
                  $ref: '#/components/schemas/Link'
                members:
                  $ref: '#/components/schemas/Link'
                owners:
                  $ref: '#/components/schemas/Link'
            labels:
              readOnly: true
              $ref: '#/components/schemas/Labels'
    Telegrafs:
      type: object
      properties:
        configurations:
          type: array
          items:
            $ref: '#/components/schemas/Telegraf'
    TelegrafPlugin:
      type: object
      properties:
        type:
          type: string
        name:
          type: string
        description:
          type: string
        config:
          type: string
    TelegrafPlugins:
      type: object
      properties:
        version:
          type: string
        os:
          type: string
        plugins:
          type: array
          items:
            $ref: '#/components/schemas/TelegrafPlugin'
    IsOnboarding:
      type: object
      properties:
        allowed:
          description: |
            If `true`, the InfluxDB instance hasn't had initial setup;
            `false` otherwise.
          type: boolean
    PasswordResetBody:
      properties:
        password:
          type: string
      required:
        - password
    AddResourceMemberRequestBody:
      type: object
      properties:
        id:
          type: string
          description: |
            The ID of the user to add to the resource.
        name:
          type: string
          description: |
            The name of the user to add to the resource.
      required:
        - id
    Ready:
      type: object
      properties:
        status:
          type: string
          enum:
            - ready
        started:
          type: string
          format: date-time
          example: '2019-03-13T10:09:33.891196-04:00'
        up:
          type: string
          example: 14m45.911966424s
    HealthCheck:
      type: object
      required:
        - name
        - status
      properties:
        name:
          type: string
        message:
          type: string
        checks:
          type: array
          items:
            $ref: '#/components/schemas/HealthCheck'
        status:
          type: string
          enum:
            - pass
            - fail
        version:
          type: string
        commit:
          type: string
    Labels:
      type: array
      items:
        $ref: '#/components/schemas/Label'
    Label:
      type: object
      properties:
        id:
          readOnly: true
          type: string
        orgID:
          readOnly: true
          type: string
        name:
          type: string
        properties:
          type: object
          additionalProperties:
            type: string
          description: |
            Key-value pairs associated with this label.
            To remove a property, send an update with an empty value (`""`) for the key.
          example:
            color: ffb3b3
            description: this is a description
    LabelCreateRequest:
      type: object
      required:
        - orgID
        - name
      properties:
        orgID:
          type: string
        name:
          type: string
        properties:
          type: object
          additionalProperties:
            type: string
          description: |
            Key-value pairs associated with this label.

            To remove a property, send an update with an empty value (`""`) for the key.
          example:
            color: ffb3b3
            description: this is a description
    LabelUpdate:
      type: object
      properties:
        name:
          type: string
        properties:
          type: object
          additionalProperties:
            type: string
            description: |
              Key-value pairs associated with this label.

              To remove a property, send an update with an empty value (`""`) for the key.
          example:
            color: ffb3b3
            description: this is a description
    LabelMapping:
      type: object
      properties:
        labelID:
          description: |
            Label ID.
            The ID of the label to attach.
          type: string
    LabelsResponse:
      type: object
      properties:
        labels:
          $ref: '#/components/schemas/Labels'
        links:
          $ref: '#/components/schemas/Links'
    LabelResponse:
      type: object
      properties:
        label:
          $ref: '#/components/schemas/Label'
        links:
          $ref: '#/components/schemas/Links'
    ASTResponse:
      description: Contains the AST for the supplied Flux query
      type: object
      properties:
        ast:
          $ref: '#/components/schemas/Package'
    WritePrecision:
      type: string
      enum:
        - ms
        - s
        - us
        - ns
    FluxResponse:
      description: Rendered flux that backs the check or notification.
      properties:
        flux:
          type: string
    CheckPatch:
      type: object
      properties:
        name:
          type: string
        description:
          type: string
        status:
          type: string
          enum:
            - active
            - inactive
    CheckDiscriminator:
      oneOf:
        - $ref: '#/components/schemas/DeadmanCheck'
        - $ref: '#/components/schemas/ThresholdCheck'
        - $ref: '#/components/schemas/CustomCheck'
      discriminator:
        propertyName: type
        mapping:
          deadman: '#/components/schemas/DeadmanCheck'
          threshold: '#/components/schemas/ThresholdCheck'
          custom: '#/components/schemas/CustomCheck'
    Check:
      allOf:
        - $ref: '#/components/schemas/CheckDiscriminator'
    PostCheck:
      allOf:
        - $ref: '#/components/schemas/CheckDiscriminator'
    Checks:
      properties:
        checks:
          type: array
          items:
            $ref: '#/components/schemas/Check'
        links:
          $ref: '#/components/schemas/Links'
    CheckBase:
      properties:
        id:
          readOnly: true
          type: string
        name:
          type: string
        orgID:
          description: The ID of the organization that owns this check.
          type: string
        taskID:
          description: The ID of the task associated with this check.
          type: string
        ownerID:
          description: The ID of creator used to create this check.
          type: string
          readOnly: true
        createdAt:
          type: string
          format: date-time
          readOnly: true
        updatedAt:
          type: string
          format: date-time
          readOnly: true
        query:
          $ref: '#/components/schemas/DashboardQuery'
        status:
          $ref: '#/components/schemas/TaskStatusType'
        description:
          description: An optional description of the check.
          type: string
        latestCompleted:
          type: string
          description: 'A timestamp ([RFC3339 date/time format](https://docs.influxdata.com/influxdb/v2.3/reference/glossary/#rfc3339-timestamp)) of the latest scheduled and completed run.'
          format: date-time
          readOnly: true
        lastRunStatus:
          readOnly: true
          type: string
          enum:
            - failed
            - success
            - canceled
        lastRunError:
          readOnly: true
          type: string
        labels:
          $ref: '#/components/schemas/Labels'
        links:
          type: object
          readOnly: true
          example:
            self: /api/v2/checks/1
            labels: /api/v2/checks/1/labels
            members: /api/v2/checks/1/members
            owners: /api/v2/checks/1/owners
            query: /api/v2/checks/1/query
          properties:
            self:
              description: URL for this check
              $ref: '#/components/schemas/Link'
            labels:
              description: URL to retrieve labels for this check
              $ref: '#/components/schemas/Link'
            members:
              description: URL to retrieve members for this check
              $ref: '#/components/schemas/Link'
            owners:
              description: URL to retrieve owners for this check
              $ref: '#/components/schemas/Link'
            query:
              description: URL to retrieve flux script for this check
              $ref: '#/components/schemas/Link'
      required:
        - name
        - orgID
        - query
    ThresholdCheck:
      allOf:
        - $ref: '#/components/schemas/CheckBase'
        - type: object
          required:
            - type
          properties:
            type:
              type: string
              enum:
                - threshold
            thresholds:
              type: array
              items:
                $ref: '#/components/schemas/Threshold'
            every:
              description: Check repetition interval.
              type: string
            offset:
              description: 'Duration to delay after the schedule, before executing check.'
              type: string
            tags:
              description: List of tags to write to each status.
              type: array
              items:
                type: object
                properties:
                  key:
                    type: string
                  value:
                    type: string
            statusMessageTemplate:
              description: The template used to generate and write a status message.
              type: string
    Threshold:
      oneOf:
        - $ref: '#/components/schemas/GreaterThreshold'
        - $ref: '#/components/schemas/LesserThreshold'
        - $ref: '#/components/schemas/RangeThreshold'
      discriminator:
        propertyName: type
        mapping:
          greater: '#/components/schemas/GreaterThreshold'
          lesser: '#/components/schemas/LesserThreshold'
          range: '#/components/schemas/RangeThreshold'
    DeadmanCheck:
      allOf:
        - $ref: '#/components/schemas/CheckBase'
        - type: object
          required:
            - type
          properties:
            type:
              type: string
              enum:
                - deadman
            timeSince:
              description: String duration before deadman triggers.
              type: string
            staleTime:
              description: String duration for time that a series is considered stale and should not trigger deadman.
              type: string
            reportZero:
              description: 'If only zero values reported since time, trigger an alert'
              type: boolean
            level:
              $ref: '#/components/schemas/CheckStatusLevel'
            every:
              description: Check repetition interval.
              type: string
            offset:
              description: 'Duration to delay after the schedule, before executing check.'
              type: string
            tags:
              description: List of tags to write to each status.
              type: array
              items:
                type: object
                properties:
                  key:
                    type: string
                  value:
                    type: string
            statusMessageTemplate:
              description: The template used to generate and write a status message.
              type: string
    CustomCheck:
      allOf:
        - $ref: '#/components/schemas/CheckBase'
        - type: object
          properties:
            type:
              type: string
              enum:
                - custom
          required:
            - type
    ThresholdBase:
      properties:
        level:
          $ref: '#/components/schemas/CheckStatusLevel'
        allValues:
          description: 'If true, only alert if all values meet threshold.'
          type: boolean
    GreaterThreshold:
      allOf:
        - $ref: '#/components/schemas/ThresholdBase'
        - type: object
          required:
            - type
            - value
          properties:
            type:
              type: string
              enum:
                - greater
            value:
              type: number
              format: float
    LesserThreshold:
      allOf:
        - $ref: '#/components/schemas/ThresholdBase'
        - type: object
          required:
            - type
            - value
          properties:
            type:
              type: string
              enum:
                - lesser
            value:
              type: number
              format: float
    RangeThreshold:
      allOf:
        - $ref: '#/components/schemas/ThresholdBase'
        - type: object
          required:
            - type
            - min
            - max
            - within
          properties:
            type:
              type: string
              enum:
                - range
            min:
              type: number
              format: float
            max:
              type: number
              format: float
            within:
              type: boolean
    CheckStatusLevel:
      description: The state to record if check matches a criteria.
      type: string
      enum:
        - UNKNOWN
        - OK
        - INFO
        - CRIT
        - WARN
    RuleStatusLevel:
      description: The state to record if check matches a criteria.
      type: string
      enum:
        - UNKNOWN
        - OK
        - INFO
        - CRIT
        - WARN
        - ANY
    NotificationRuleUpdate:
      type: object
      properties:
        name:
          type: string
        description:
          type: string
        status:
          type: string
          enum:
            - active
            - inactive
    NotificationRuleDiscriminator:
      oneOf:
        - $ref: '#/components/schemas/SlackNotificationRule'
        - $ref: '#/components/schemas/SMTPNotificationRule'
        - $ref: '#/components/schemas/PagerDutyNotificationRule'
        - $ref: '#/components/schemas/HTTPNotificationRule'
        - $ref: '#/components/schemas/TelegramNotificationRule'
      discriminator:
        propertyName: type
        mapping:
          slack: '#/components/schemas/SlackNotificationRule'
          smtp: '#/components/schemas/SMTPNotificationRule'
          pagerduty: '#/components/schemas/PagerDutyNotificationRule'
          http: '#/components/schemas/HTTPNotificationRule'
          telegram: '#/components/schemas/TelegramNotificationRule'
    NotificationRule:
      allOf:
        - $ref: '#/components/schemas/NotificationRuleDiscriminator'
    PostNotificationRule:
      allOf:
        - $ref: '#/components/schemas/NotificationRuleDiscriminator'
    NotificationRules:
      properties:
        notificationRules:
          type: array
          items:
            $ref: '#/components/schemas/NotificationRule'
        links:
          $ref: '#/components/schemas/Links'
    NotificationRuleBase:
      type: object
      required:
        - orgID
        - status
        - name
        - statusRules
        - endpointID
      properties:
        latestCompleted:
          description: 'A timestamp ([RFC3339 date/time format](https://docs.influxdata.com/influxdb/v2.3/reference/glossary/#rfc3339-timestamp)) of the latest scheduled and completed run.'
          type: string
          format: date-time
          readOnly: true
        lastRunStatus:
          readOnly: true
          type: string
          enum:
            - failed
            - success
            - canceled
        lastRunError:
          readOnly: true
          type: string
        id:
          readOnly: true
          type: string
        endpointID:
          type: string
        orgID:
          description: The ID of the organization that owns this notification rule.
          type: string
        taskID:
          description: The ID of the task associated with this notification rule.
          type: string
        ownerID:
          description: The ID of creator used to create this notification rule.
          type: string
          readOnly: true
        createdAt:
          type: string
          format: date-time
          readOnly: true
        updatedAt:
          type: string
          format: date-time
          readOnly: true
        status:
          $ref: '#/components/schemas/TaskStatusType'
        name:
          description: Human-readable name describing the notification rule.
          type: string
        sleepUntil:
          type: string
        every:
          description: The notification repetition interval.
          type: string
        offset:
          description: 'Duration to delay after the schedule, before executing check.'
          type: string
        runbookLink:
          type: string
        limitEvery:
          description: 'Don''t notify me more than <limit> times every <limitEvery> seconds. If set, limit cannot be empty.'
          type: integer
        limit:
          description: 'Don''t notify me more than <limit> times every <limitEvery> seconds. If set, limitEvery cannot be empty.'
          type: integer
        tagRules:
          description: List of tag rules the notification rule attempts to match.
          type: array
          items:
            $ref: '#/components/schemas/TagRule'
        description:
          description: An optional description of the notification rule.
          type: string
        statusRules:
          description: List of status rules the notification rule attempts to match.
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/StatusRule'
        labels:
          $ref: '#/components/schemas/Labels'
        links:
          type: object
          readOnly: true
          example:
            self: /api/v2/notificationRules/1
            labels: /api/v2/notificationRules/1/labels
            members: /api/v2/notificationRules/1/members
            owners: /api/v2/notificationRules/1/owners
            query: /api/v2/notificationRules/1/query
          properties:
            self:
              description: URL for this endpoint.
              $ref: '#/components/schemas/Link'
            labels:
              description: URL to retrieve labels for this notification rule.
              $ref: '#/components/schemas/Link'
            members:
              description: URL to retrieve members for this notification rule.
              $ref: '#/components/schemas/Link'
            owners:
              description: URL to retrieve owners for this notification rule.
              $ref: '#/components/schemas/Link'
            query:
              description: URL to retrieve flux script for this notification rule.
              $ref: '#/components/schemas/Link'
    TagRule:
      type: object
      properties:
        key:
          type: string
        value:
          type: string
        operator:
          type: string
          enum:
            - equal
            - notequal
            - equalregex
            - notequalregex
    StatusRule:
      type: object
      properties:
        currentLevel:
          $ref: '#/components/schemas/RuleStatusLevel'
        previousLevel:
          $ref: '#/components/schemas/RuleStatusLevel'
        count:
          type: integer
        period:
          type: string
    HTTPNotificationRuleBase:
      type: object
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - http
        url:
          type: string
    HTTPNotificationRule:
      allOf:
        - $ref: '#/components/schemas/NotificationRuleBase'
        - $ref: '#/components/schemas/HTTPNotificationRuleBase'
    SlackNotificationRuleBase:
      type: object
      required:
        - type
        - messageTemplate
      properties:
        type:
          type: string
          enum:
            - slack
        channel:
          type: string
        messageTemplate:
          type: string
    SlackNotificationRule:
      allOf:
        - $ref: '#/components/schemas/NotificationRuleBase'
        - $ref: '#/components/schemas/SlackNotificationRuleBase'
    SMTPNotificationRule:
      allOf:
        - $ref: '#/components/schemas/NotificationRuleBase'
        - $ref: '#/components/schemas/SMTPNotificationRuleBase'
    SMTPNotificationRuleBase:
      type: object
      required:
        - type
        - subjectTemplate
        - to
      properties:
        type:
          type: string
          enum:
            - smtp
        subjectTemplate:
          type: string
        bodyTemplate:
          type: string
        to:
          type: string
    PagerDutyNotificationRule:
      allOf:
        - $ref: '#/components/schemas/NotificationRuleBase'
        - $ref: '#/components/schemas/PagerDutyNotificationRuleBase'
    PagerDutyNotificationRuleBase:
      type: object
      required:
        - type
        - messageTemplate
      properties:
        type:
          type: string
          enum:
            - pagerduty
        messageTemplate:
          type: string
    TelegramNotificationRule:
      allOf:
        - $ref: '#/components/schemas/NotificationRuleBase'
        - $ref: '#/components/schemas/TelegramNotificationRuleBase'
    TelegramNotificationRuleBase:
      type: object
      required:
        - type
        - messageTemplate
        - channel
      properties:
        type:
          description: The discriminator between other types of notification rules is "telegram".
          type: string
          enum:
            - telegram
        messageTemplate:
          description: The message template as a flux interpolated string.
          type: string
        parseMode:
          description: 'Parse mode of the message text per https://core.telegram.org/bots/api#formatting-options. Defaults to "MarkdownV2".'
          type: string
          enum:
            - MarkdownV2
            - HTML
            - Markdown
        disableWebPagePreview:
          description: Disables preview of web links in the sent messages when "true". Defaults to "false".
          type: boolean
    NotificationEndpointUpdate:
      type: object
      properties:
        name:
          type: string
        description:
          type: string
        status:
          type: string
          enum:
            - active
            - inactive
    NotificationEndpointDiscriminator:
      oneOf:
        - $ref: '#/components/schemas/SlackNotificationEndpoint'
        - $ref: '#/components/schemas/PagerDutyNotificationEndpoint'
        - $ref: '#/components/schemas/HTTPNotificationEndpoint'
        - $ref: '#/components/schemas/TelegramNotificationEndpoint'
      discriminator:
        propertyName: type
        mapping:
          slack: '#/components/schemas/SlackNotificationEndpoint'
          pagerduty: '#/components/schemas/PagerDutyNotificationEndpoint'
          http: '#/components/schemas/HTTPNotificationEndpoint'
          telegram: '#/components/schemas/TelegramNotificationEndpoint'
    NotificationEndpoint:
      allOf:
        - $ref: '#/components/schemas/NotificationEndpointDiscriminator'
    PostNotificationEndpoint:
      allOf:
        - $ref: '#/components/schemas/NotificationEndpointDiscriminator'
    NotificationEndpoints:
      properties:
        notificationEndpoints:
          type: array
          items:
            $ref: '#/components/schemas/NotificationEndpoint'
        links:
          $ref: '#/components/schemas/Links'
    NotificationEndpointBase:
      type: object
      required:
        - type
        - name
      properties:
        id:
          type: string
        orgID:
          type: string
        userID:
          type: string
        createdAt:
          type: string
          format: date-time
          readOnly: true
        updatedAt:
          type: string
          format: date-time
          readOnly: true
        description:
          description: An optional description of the notification endpoint.
          type: string
        name:
          type: string
        status:
          description: The status of the endpoint.
          default: active
          type: string
          enum:
            - active
            - inactive
        labels:
          $ref: '#/components/schemas/Labels'
        links:
          type: object
          readOnly: true
          example:
            self: /api/v2/notificationEndpoints/1
            labels: /api/v2/notificationEndpoints/1/labels
            members: /api/v2/notificationEndpoints/1/members
            owners: /api/v2/notificationEndpoints/1/owners
          properties:
            self:
              description: URL for this endpoint.
              $ref: '#/components/schemas/Link'
            labels:
              description: URL to retrieve labels for this endpoint.
              $ref: '#/components/schemas/Link'
            members:
              description: URL to retrieve members for this endpoint.
              $ref: '#/components/schemas/Link'
            owners:
              description: URL to retrieve owners for this endpoint.
              $ref: '#/components/schemas/Link'
        type:
          $ref: '#/components/schemas/NotificationEndpointType'
    SlackNotificationEndpoint:
      type: object
      allOf:
        - $ref: '#/components/schemas/NotificationEndpointBase'
        - type: object
          properties:
            url:
              description: Specifies the URL of the Slack endpoint. Specify either `URL` or `Token`.
              type: string
            token:
              description: Specifies the API token string. Specify either `URL` or `Token`.
              type: string
    PagerDutyNotificationEndpoint:
      type: object
      allOf:
        - $ref: '#/components/schemas/NotificationEndpointBase'
        - type: object
          required:
            - routingKey
          properties:
            clientURL:
              type: string
            routingKey:
              type: string
    HTTPNotificationEndpoint:
      type: object
      allOf:
        - $ref: '#/components/schemas/NotificationEndpointBase'
        - type: object
          required:
            - url
            - authMethod
            - method
          properties:
            url:
              type: string
            username:
              type: string
            password:
              type: string
            token:
              type: string
            method:
              type: string
              enum:
                - POST
                - GET
                - PUT
            authMethod:
              type: string
              enum:
                - none
                - basic
                - bearer
            contentTemplate:
              type: string
            headers:
              type: object
              description: Customized headers.
              additionalProperties:
                type: string
    TelegramNotificationEndpoint:
      type: object
      allOf:
        - $ref: '#/components/schemas/NotificationEndpointBase'
        - type: object
          required:
            - token
            - channel
          properties:
            token:
              description: 'Specifies the Telegram bot token. See https://core.telegram.org/bots#creating-a-new-bot .'
              type: string
            channel:
              description: 'The ID of the telegram channel; a chat_id in https://core.telegram.org/bots/api#sendmessage .'
              type: string
    NotificationEndpointType:
      type: string
      enum:
        - slack
        - pagerduty
        - http
        - telegram
    DBRP:
      type: object
      properties:
        id:
          type: string
          description: The ID of the DBRP mapping.
          readOnly: true
        orgID:
          type: string
          description: The ID of the organization.
        bucketID:
          type: string
          description: The ID of the bucket used as the target for the translation.
        database:
          type: string
          description: InfluxDB v1 database
        retention_policy:
          type: string
          description: InfluxDB v1 retention policy
        default:
          type: boolean
          description: Mapping represents the default retention policy for the database specified.
        virtual:
          type: boolean
          description: 'Indicates an autogenerated, virtual mapping based on the bucket name. Currently only available in OSS.'
        links:
          $ref: '#/components/schemas/Links'
      required:
        - id
        - orgID
        - bucketID
        - database
        - retention_policy
        - default
    DBRPs:
      properties:
        content:
          type: array
          items:
            $ref: '#/components/schemas/DBRP'
    DBRPUpdate:
      properties:
        retention_policy:
          type: string
          description: InfluxDB v1 retention policy
        default:
          type: boolean
    DBRPCreate:
      type: object
      properties:
        orgID:
          type: string
          description: The ID of the organization.
        org:
          type: string
          description: The name of the organization that owns this mapping.
        bucketID:
          type: string
          description: The ID of the bucket used as the target for the translation.
        database:
          type: string
          description: InfluxDB v1 database
        retention_policy:
          type: string
          description: InfluxDB v1 retention policy
        default:
          type: boolean
          description: Mapping represents the default retention policy for the database specified.
      required:
        - bucketID
        - database
        - retention_policy
    DBRPGet:
      type: object
      properties:
        content:
          $ref: '#/components/schemas/DBRP'
          required: true
    SchemaType:
      type: string
      enum:
        - implicit
        - explicit
    ColorMapping:
      type: object
      description: A color mapping is an object that maps time series data to a UI color scheme to allow the UI to render graphs consistent colors across reloads.
      additionalProperties:
        type: string
      example:
        series_id_1: '#edf529'
        series_id_2: '#edf529'
        measurement_birdmigration_europe: '#663cd0'
        configcat_deployments-autopromotionblocker: '#663cd0'
    Authorization:
      required:
        - orgID
        - permissions
      allOf:
        - $ref: '#/components/schemas/AuthorizationUpdateRequest'
        - type: object
          properties:
            createdAt:
              type: string
              format: date-time
              readOnly: true
            updatedAt:
              type: string
              format: date-time
              readOnly: true
            orgID:
              type: string
              description: The ID of the organization.
            permissions:
              type: array
              minItems: 1
              description: |
                A list of permissions for an authorization.
                An authorization must have at least one permission.
              items:
                $ref: '#/components/schemas/Permission'
            id:
              readOnly: true
              type: string
            token:
              readOnly: true
              type: string
              description: |
                The API token for authenticating InfluxDB API and CLI requests.
            userID:
              readOnly: true
              type: string
              description: The ID of the user that created and owns the token.
            user:
              readOnly: true
              type: string
              description: The name of the user that created and owns the token.
            org:
              readOnly: true
              type: string
              description: The name of the organization that the token is scoped to.
            links:
              type: object
              readOnly: true
              example:
                self: /api/v2/authorizations/1
                user: /api/v2/users/12
              properties:
                self:
                  readOnly: true
                  $ref: '#/components/schemas/Link'
                user:
                  readOnly: true
                  $ref: '#/components/schemas/Link'
    Authorizations:
      type: object
      properties:
        links:
          readOnly: true
          $ref: '#/components/schemas/Links'
        authorizations:
          type: array
          items:
            $ref: '#/components/schemas/Authorization'
    AuthorizationPostRequest:
      required:
        - orgID
        - permissions
      allOf:
        - $ref: '#/components/schemas/AuthorizationUpdateRequest'
        - type: object
          properties:
            orgID:
              type: string
              description: |
                The ID of the organization that owns the authorization.
            userID:
              type: string
              description: |
                The ID of the user that the authorization is scoped to.
            permissions:
              type: array
              minItems: 1
              description: |
                A list of permissions for an authorization.
                An authorization must have at least one permission.
              items:
                $ref: '#/components/schemas/Permission'
    Permission:
      required:
        - action
        - resource
      properties:
        action:
          type: string
          enum:
            - read
            - write
        resource:
          $ref: '#/components/schemas/Resource'
    Resource:
      type: object
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - authorizations
            - buckets
            - dashboards
            - orgs
            - sources
            - tasks
            - telegrafs
            - users
            - variables
            - scrapers
            - secrets
            - labels
            - views
            - documents
            - notificationRules
            - notificationEndpoints
            - checks
            - dbrp
            - notebooks
            - annotations
            - remotes
            - replications
            - instance
          description: |
            The type of resource.
            In a `permission`, applies the permission to all resources of this type.
        id:
          type: string
          description: |
            The ID of a specific resource.
            In a `permission`, applies the permission to only the resource with this ID.
        name:
          type: string
          description: |
            Optional: A name for the resource.
            Not all resource types have a name field.
        orgID:
          type: string
          description: |
            The ID of the organization that owns the resource.
            In a `permission`, applies the permission to all resources of `type` owned by this organization.
        org:
          type: string
          description: |
            Optional: The name of the organization with `orgID`.
    User:
      properties:
        id:
          readOnly: true
          type: string
        oauthID:
          type: string
        name:
          type: string
        status:
          description: If inactive the user is inactive.
          default: active
          type: string
          enum:
            - active
            - inactive
      required:
        - name
    Users:
      type: object
      properties:
        links:
          type: object
          properties:
            self:
              type: string
              format: uri
        users:
          type: array
          items:
            $ref: '#/components/schemas/UserResponse'
    OnboardingRequest:
      type: object
      properties:
        username:
          type: string
        password:
          type: string
        org:
          type: string
        bucket:
          type: string
        retentionPeriodSeconds:
          type: integer
          format: int64
        retentionPeriodHrs:
          type: integer
          deprecated: true
          description: |
            Retention period *in nanoseconds* for the new bucket. This key's name has been misleading since OSS 2.0 GA, please transition to use `retentionPeriodSeconds`
        token:
          type: string
          description: |
            Authentication token to set on the initial user. If not specified, the server will generate a token.
      required:
        - username
        - org
        - bucket
    OnboardingResponse:
      type: object
      properties:
        user:
          $ref: '#/components/schemas/UserResponse'
        org:
          $ref: '#/components/schemas/Organization'
        bucket:
          $ref: '#/components/schemas/Bucket'
        auth:
          $ref: '#/components/schemas/Authorization'
    Variable:
      type: object
      required:
        - name
        - orgID
        - arguments
      properties:
        links:
          type: object
          readOnly: true
          properties:
            self:
              type: string
              format: uri
            org:
              type: string
              format: uri
            labels:
              type: string
              format: uri
        id:
          readOnly: true
          type: string
        orgID:
          type: string
        name:
          type: string
        description:
          type: string
        selected:
          type: array
          items:
            type: string
        labels:
          $ref: '#/components/schemas/Labels'
        arguments:
          $ref: '#/components/schemas/VariableProperties'
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    Variables:
      type: object
      example:
        variables:
          - id: '1221432'
            name: ':ok:'
            selected:
              - hello
            arguments:
              type: constant
              values:
                - howdy
                - hello
                - hi
                - yo
                - oy
          - id: '1221432'
            name: ':ok:'
            selected:
              - c
            arguments:
              type: map
              values:
                a: fdjaklfdjkldsfjlkjdsa
                b: dfaksjfkljekfajekdljfas
                c: fdjksajfdkfeawfeea
          - id: '1221432'
            name: ':ok:'
            selected:
              - host
            arguments:
              type: query
              query: 'from(bucket: "foo") |> showMeasurements()'
              language: flux
      properties:
        variables:
          type: array
          items:
            $ref: '#/components/schemas/Variable'
    Source:
      type: object
      properties:
        links:
          type: object
          properties:
            self:
              type: string
            query:
              type: string
            health:
              type: string
            buckets:
              type: string
        id:
          type: string
        orgID:
          type: string
        default:
          type: boolean
        name:
          type: string
        type:
          type: string
          enum:
            - v1
            - v2
            - self
        url:
          type: string
          format: uri
        insecureSkipVerify:
          type: boolean
        telegraf:
          type: string
        token:
          type: string
        username:
          type: string
        password:
          type: string
        sharedSecret:
          type: string
        metaUrl:
          type: string
          format: uri
        defaultRP:
          type: string
        languages:
          type: array
          readOnly: true
          items:
            type: string
            enum:
              - flux
              - influxql
    Sources:
      type: object
      properties:
        links:
          type: object
          properties:
            self:
              type: string
              format: uri
        sources:
          type: array
          items:
            $ref: '#/components/schemas/Source'
    ScraperTargetRequest:
      type: object
      properties:
        name:
          type: string
          description: The name of the scraper target.
        type:
          type: string
          description: The type of the metrics to be parsed.
          enum:
            - prometheus
        url:
          type: string
          description: The URL of the metrics endpoint.
          example: 'http://localhost:9090/metrics'
        orgID:
          type: string
          description: The organization ID.
        bucketID:
          type: string
          description: The ID of the bucket to write to.
        allowInsecure:
          type: boolean
          description: Skip TLS verification on endpoint.
          default: false
    ScraperTargetResponse:
      type: object
      allOf:
        - $ref: '#/components/schemas/ScraperTargetRequest'
        - type: object
          properties:
            id:
              type: string
              readOnly: true
            org:
              type: string
              description: The name of the organization.
            bucket:
              type: string
              description: The bucket name.
            links:
              type: object
              readOnly: true
              example:
                self: /api/v2/scrapers/1
                owners: /api/v2/scrapers/1/owners
                members: /api/v2/scrapers/1/members
                bucket: /api/v2/buckets/1
                organization: /api/v2/orgs/1
              properties:
                self:
                  $ref: '#/components/schemas/Link'
                members:
                  $ref: '#/components/schemas/Link'
                owners:
                  $ref: '#/components/schemas/Link'
                bucket:
                  $ref: '#/components/schemas/Link'
                organization:
                  $ref: '#/components/schemas/Link'
    ScraperTargetResponses:
      type: object
      properties:
        configurations:
          type: array
          items:
            $ref: '#/components/schemas/ScraperTargetResponse'
    MetadataBackup:
      type: object
      properties:
        kv:
          type: string
          format: binary
        sql:
          type: string
          format: binary
        buckets:
          $ref: '#/components/schemas/BucketMetadataManifests'
      required:
        - kv
        - sql
        - buckets
    BucketMetadataManifests:
      type: array
      items:
        $ref: '#/components/schemas/BucketMetadataManifest'
    BucketMetadataManifest:
      type: object
      properties:
        organizationID:
          type: string
        organizationName:
          type: string
        bucketID:
          type: string
        bucketName:
          type: string
        description:
          type: string
        defaultRetentionPolicy:
          type: string
        retentionPolicies:
          $ref: '#/components/schemas/RetentionPolicyManifests'
      required:
        - organizationID
        - organizationName
        - bucketID
        - bucketName
        - defaultRetentionPolicy
        - retentionPolicies
    RetentionPolicyManifests:
      type: array
      items:
        $ref: '#/components/schemas/RetentionPolicyManifest'
    RetentionPolicyManifest:
      type: object
      properties:
        name:
          type: string
        replicaN:
          type: integer
        duration:
          type: integer
          format: int64
        shardGroupDuration:
          type: integer
          format: int64
        shardGroups:
          $ref: '#/components/schemas/ShardGroupManifests'
        subscriptions:
          $ref: '#/components/schemas/SubscriptionManifests'
      required:
        - name
        - replicaN
        - duration
        - shardGroupDuration
        - shardGroups
        - subscriptions
    ShardGroupManifests:
      type: array
      items:
        $ref: '#/components/schemas/ShardGroupManifest'
    ShardGroupManifest:
      type: object
      properties:
        id:
          type: integer
          format: int64
        startTime:
          type: string
          format: date-time
        endTime:
          type: string
          format: date-time
        deletedAt:
          type: string
          format: date-time
        truncatedAt:
          type: string
          format: date-time
        shards:
          $ref: '#/components/schemas/ShardManifests'
      required:
        - id
        - startTime
        - endTime
        - shards
    ShardManifests:
      type: array
      items:
        $ref: '#/components/schemas/ShardManifest'
    ShardManifest:
      type: object
      properties:
        id:
          type: integer
          format: int64
        shardOwners:
          $ref: '#/components/schemas/ShardOwners'
      required:
        - id
        - shardOwners
    ShardOwners:
      type: array
      items:
        $ref: '#/components/schemas/ShardOwner'
    ShardOwner:
      type: object
      properties:
        nodeID:
          type: integer
          format: int64
          description: The ID of the node that owns the shard.
      required:
        - nodeID
    SubscriptionManifests:
      type: array
      items:
        $ref: '#/components/schemas/SubscriptionManifest'
    SubscriptionManifest:
      type: object
      properties:
        name:
          type: string
        mode:
          type: string
        destinations:
          type: array
          items:
            type: string
      required:
        - name
        - mode
        - destinations
    RestoredBucketMappings:
      type: object
      properties:
        id:
          description: New ID of the restored bucket
          type: string
        name:
          type: string
        shardMappings:
          $ref: '#/components/schemas/BucketShardMappings'
      required:
        - id
        - name
        - shardMappings
    BucketShardMappings:
      type: array
      items:
        $ref: '#/components/schemas/BucketShardMapping'
    BucketShardMapping:
      type: object
      properties:
        oldId:
          type: integer
          format: int64
        newId:
          type: integer
          format: int64
      required:
        - oldId
        - newId
    Config:
      type: object
      properties:
        config:
          type: object
    RemoteConnection:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        orgID:
          type: string
        description:
          type: string
        remoteURL:
          type: string
          format: uri
        remoteOrgID:
          type: string
        allowInsecureTLS:
          type: boolean
          default: false
      required:
        - id
        - name
        - orgID
        - remoteURL
        - remoteOrgID
        - allowInsecureTLS
    RemoteConnections:
      type: object
      properties:
        remotes:
          type: array
          items:
            $ref: '#/components/schemas/RemoteConnection'
    RemoteConnectionCreationRequest:
      type: object
      properties:
        name:
          type: string
        description:
          type: string
        orgID:
          type: string
        remoteURL:
          type: string
          format: uri
        remoteAPIToken:
          type: string
        remoteOrgID:
          type: string
        allowInsecureTLS:
          type: boolean
          default: false
      required:
        - name
        - orgID
        - remoteURL
        - remoteAPIToken
        - remoteOrgID
        - allowInsecureTLS
    RemoteConnectionUpdateRequest:
      type: object
      properties:
        name:
          type: string
        description:
          type: string
        remoteURL:
          type: string
          format: uri
        remoteAPIToken:
          type: string
        remoteOrgID:
          type: string
        allowInsecureTLS:
          type: boolean
          default: false
    Replication:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        description:
          type: string
        orgID:
          type: string
        remoteID:
          type: string
        localBucketID:
          type: string
        remoteBucketID:
          type: string
        remoteBucketName:
          type: string
        maxQueueSizeBytes:
          type: integer
          format: int64
        currentQueueSizeBytes:
          type: integer
          format: int64
        latestResponseCode:
          type: integer
        latestErrorMessage:
          type: string
        dropNonRetryableData:
          type: boolean
      required:
        - id
        - name
        - remoteID
        - orgID
        - localBucketID
        - maxQueueSizeBytes
        - currentQueueSizeBytes
    Replications:
      type: object
      properties:
        replications:
          type: array
          items:
            $ref: '#/components/schemas/Replication'
    ReplicationCreationRequest:
      type: object
      properties:
        name:
          type: string
        description:
          type: string
        orgID:
          type: string
        remoteID:
          type: string
        localBucketID:
          type: string
        remoteBucketID:
          type: string
        remoteBucketName:
          type: string
        maxQueueSizeBytes:
          type: integer
          format: int64
          minimum: 33554430
          default: 67108860
        dropNonRetryableData:
          type: boolean
          default: false
        maxAgeSeconds:
          type: integer
          format: int64
          minimum: 0
          default: 604800
      required:
        - name
        - orgID
        - remoteID
        - localBucketID
        - maxQueueSizeBytes
        - maxAgeSeconds
    ReplicationUpdateRequest:
      type: object
      properties:
        name:
          type: string
        description:
          type: string
        remoteID:
          type: string
        remoteBucketID:
          type: string
        remoteBucketName:
          type: string
        maxQueueSizeBytes:
          type: integer
          format: int64
          minimum: 33554430
        dropNonRetryableData:
          type: boolean
        maxAgeSeconds:
          type: integer
          format: int64
          minimum: 0
    Tasks:
      type: object
      properties:
        links:
          readOnly: true
          $ref: '#/components/schemas/Links'
        tasks:
          type: array
          items:
            $ref: '#/components/schemas/Task'
    Task:
      type: object
      properties:
        id:
          readOnly: true
          type: string
        orgID:
          description: The ID of the organization that owns the task.
          type: string
        org:
          description: The name of the organization that owns the task.
          type: string
        name:
          description: The name of the task.
          type: string
        ownerID:
          description: The ID of the user who owns the Task.
          type: string
        description:
          description: The description of the task.
          type: string
        status:
          $ref: '#/components/schemas/TaskStatusType'
        labels:
          $ref: '#/components/schemas/Labels'
        authorizationID:
          description: The ID of the authorization used when the task communicates with the query engine.
          type: string
        flux:
          description: The Flux script that the task runs.
          type: string
        every:
          description: 'An interval ([duration literal](https://docs.influxdata.com/flux/v0.x/spec/lexical-elements/#duration-literals))) at which the task runs. `every` also determines when the task first runs, depending on the specified time.'
          type: string
          format: duration
        cron:
          description: '[Cron expression](https://en.wikipedia.org/wiki/Cron#Overview) that defines the schedule on which the task runs. InfluxDB bases cron runs on the system time.'
          type: string
        offset:
          description: 'A [duration](https://docs.influxdata.com/flux/v0.x/spec/lexical-elements/#duration-literals) to delay execution of the task after the scheduled time has elapsed. `0` removes the offset.'
          type: string
          format: duration
        latestCompleted:
          description: 'A timestamp ([RFC3339 date/time format](https://docs.influxdata.com/flux/v0.x/data-types/basic/time/#time-syntax)) of the latest scheduled and completed run.'
          type: string
          format: date-time
          readOnly: true
        lastRunStatus:
          readOnly: true
          type: string
          enum:
            - failed
            - success
            - canceled
        lastRunError:
          readOnly: true
          type: string
        createdAt:
          type: string
          format: date-time
          readOnly: true
        updatedAt:
          type: string
          format: date-time
          readOnly: true
        links:
          type: object
          readOnly: true
          example:
            self: /api/v2/tasks/1
            owners: /api/v2/tasks/1/owners
            members: /api/v2/tasks/1/members
            labels: /api/v2/tasks/1/labels
            runs: /api/v2/tasks/1/runs
            logs: /api/v2/tasks/1/logs
          properties:
            self:
              $ref: '#/components/schemas/Link'
            owners:
              $ref: '#/components/schemas/Link'
            members:
              $ref: '#/components/schemas/Link'
            runs:
              $ref: '#/components/schemas/Link'
            logs:
              $ref: '#/components/schemas/Link'
            labels:
              $ref: '#/components/schemas/Link'
      required:
        - id
        - name
        - orgID
        - flux
    TaskCreateRequest:
      type: object
      properties:
        orgID:
          description: The ID of the organization that owns this Task.
          type: string
        org:
          description: The name of the organization that owns this Task.
          type: string
        status:
          $ref: '#/components/schemas/TaskStatusType'
        flux:
          description: The Flux script to run for this task.
          type: string
        description:
          description: An optional description of the task.
          type: string
      required:
        - flux
    TaskUpdateRequest:
      type: object
      properties:
        status:
          $ref: '#/components/schemas/TaskStatusType'
        flux:
          description: The Flux script that the task runs.
          type: string
        name:
          description: Update the 'name' option in the flux script.
          type: string
        every:
          description: Update the 'every' option in the flux script.
          type: string
        cron:
          description: Update the 'cron' option in the flux script.
          type: string
        offset:
          description: Update the 'offset' option in the flux script.
          type: string
        description:
          description: Update the description of the task.
          type: string
  responses:
    AuthorizationError:
      description: |
        Unauthorized. The error may indicate one of the following:

          * The `Authorization: Token` header is missing or malformed.
          * The API token value is missing from the header.
          * The token doesn't have sufficient permissions to write to this organization and bucket.
      content:
        application/json:
          schema:
            properties:
              code:
                description: |
                  The HTTP status code description. Default is `unauthorized`.
                readOnly: true
                type: string
                enum:
                  - unauthorized
              message:
                readOnly: true
                description: A human-readable message that may contain detail about the error.
                type: string
          examples:
            tokenNotAuthorized:
              summary: Token is not authorized to access a resource
              value:
                code: unauthorized
                message: unauthorized access
    BadRequestError:
      description: |
        Bad request.
        The response body contains detail about the error.

        #### InfluxDB OSS

        - Returns this error if an incorrect value is passed for `org` or `orgID`.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            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'
    GeneralServerError:
      description: Non 2XX error response from server.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    InternalServerError:
      description: |
        Internal server error.
        The server encountered an unexpected situation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ResourceNotFoundError:
      description: |
        Not found.
        A requested resource was not found.
        The response body contains the requested resource type and the name value
        (if you passed it)--for example:

        - `"organization name \"my-org\" not found"`
        - `"organization not found"`: indicates you passed an ID that did not match
           an organization.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            org-not-found:
              summary: Organization name not found
              value:
                code: not found
                message: organization name "my-org" not found
            bucket-not-found:
              summary: Bucket name not found
              value:
                code: not found
                message: bucket "air_sensor" not found
            orgID-not-found:
              summary: Organization ID not found
              value:
                code: not found
                message: organization not found
  securitySchemes:
    TokenAuthentication:
      type: apiKey
      name: Authorization
      in: header
      description: |
        Use the [Token authentication](#section/Authentication/TokenAuthentication)
        scheme to authenticate to the InfluxDB API.


        In your API requests, send an `Authorization` header.
        For the header value, provide the word `Token` followed by a space and an InfluxDB API token.
        The word `Token` is case-sensitive.


        ### Syntax

        `Authorization: Token YOUR_INFLUX_API_TOKEN`


        For more information and examples, see the following:
          - [`/authorizations`](#tag/Authorizations) endpoint.
          - [Authorize API requests](https://docs.influxdata.com/influxdb/v2.3/api-guide/api_intro/#authentication).
          - [Manage API tokens](https://docs.influxdata.com/influxdb/v2.3/security/tokens/).
    BasicAuthentication:
      type: http
      scheme: basic
      description: |
        Use the HTTP Basic authentication scheme for InfluxDB `/api/v2` API operations that support it.

        Username and password schemes require the following credentials:
          - **username**
          - **password**
security:
  - TokenAuthentication: []
