InfluxDB Buckets API

Store your data in InfluxDB [buckets](https://docs.influxdata.com/influxdb/cloud/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/cloud/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/cloud/organizations/buckets/)

OpenAPI Specification

influxdb-buckets-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: Complete InfluxDB Cloud Authorizations (API tokens) Authorizations (API tokens) Buckets API
  description: 'Create and manage authorizations (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.


    We recommend the following for managing your tokens:


    - Create a generic user to create and manage tokens for writing data.

    - Store your tokens in a secure password vault for future access.


    ### User sessions with authorizations


    Optionally, when creating an authorization, you can scope it to a specific user.

    If the user signs in with username and password, creating a _user session_,

    the session carries the permissions granted by all the user''s authorizations.

    For more information, see [how to assign a token to a specific user](https://docs.influxdata.com/influxdb/cloud/security/tokens/create-token/).

    To create a user session, use the [`POST /api/v2/signin` endpoint](#operation/PostSignin).


    ### Related endpoints


    - [Signin](#tag/Signin)

    - [Signout](#tag/Signout)


    ### Related guides


    - [Authorize API requests](https://docs.influxdata.com/influxdb/cloud/api-guide/api_intro/#authentication)

    - [Manage API tokens](https://docs.influxdata.com/influxdb/cloud/security/tokens/)

    - [Assign a token to a specific user](https://docs.influxdata.com/influxdb/cloud/security/tokens/create-token/)

    '
servers:
- url: ''
security:
- TokenAuthentication: []
tags:
- description: 'Store your data in InfluxDB [buckets](https://docs.influxdata.com/influxdb/cloud/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/cloud/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/cloud/organizations/buckets/)

    '
  name: Buckets
paths:
  /api/v2/buckets:
    get:
      description: "Lists [buckets](https://docs.influxdata.com/influxdb/cloud/reference/glossary/#bucket).\n\nInfluxDB retrieves buckets owned by the\n[organization](https://docs.influxdata.com/influxdb/cloud/reference/glossary/#organization)\nassociated with the authorization\n([API token](https://docs.influxdata.com/influxdb/cloud/reference/glossary/#token)).\nTo limit which buckets are returned, pass query parameters in your request.\nIf no query parameters are passed, InfluxDB returns all buckets up to the\ndefault `limit`.\n\n#### InfluxDB OSS\n\n- If you use an _[operator token](https://docs.influxdata.com/influxdb/cloud/security/tokens/#operator-token)_\n  to authenticate your request, InfluxDB retrieves resources for _all\n  organizations_ in the instance.\n  To retrieve resources for only a specific organization, use the\n  `org` parameter or the `orgID` parameter to specify the organization.\n\n#### Required permissions\n\n| Action                    | Permission required |\n|:--------------------------|:--------------------|\n| Retrieve _user buckets_   | `read-buckets`      |\n| Retrieve [_system buckets_](https://docs.influxdata.com/influxdb/cloud/reference/internals/system-buckets/) | `read-orgs`         |\n\n#### Related Guides\n\n- [Manage buckets](https://docs.influxdata.com/influxdb/cloud/organizations/buckets/)\n"
      operationId: GetBuckets
      parameters:
      - $ref: '#/components/parameters/TraceSpan'
      - $ref: '#/components/parameters/Offset'
      - $ref: '#/components/parameters/Limit'
      - $ref: '#/components/parameters/After'
      - description: 'An organization name.


          #### InfluxDB Cloud


          - Doesn''t use the `org` parameter or `orgID` parameter.

          - Lists buckets for the organization associated with the authorization (API token).


          #### InfluxDB OSS


          - Lists buckets for the specified organization.

          '
        in: query
        name: org
        schema:
          type: string
      - description: 'An organization ID.


          #### InfluxDB Cloud


          - Doesn''t use the `org` parameter or `orgID` parameter.

          - Lists buckets for the organization associated with the authorization (API token).


          #### InfluxDB OSS


          - Requires either the `org` parameter or `orgID` parameter.

          - Lists buckets for the specified organization.

          '
        in: query
        name: orgID
        schema:
          type: string
      - description: 'A bucket name.

          Only returns buckets with the specified name.

          '
        in: query
        name: name
        schema:
          type: string
      - description: 'A bucket ID.

          Only returns the bucket with the specified ID.

          '
        in: query
        name: id
        schema:
          type: string
      responses:
        '200':
          content:
            application/json:
              examples:
                successResponse:
                  value:
                    buckets:
                    - createdAt: '2022-03-15T17:22:33.72617939Z'
                      description: System bucket for monitoring logs
                      id: 77ca9dace40a9bfc
                      labels: []
                      links:
                        labels: /api/v2/buckets/77ca9dace40a9bfc/labels
                        members: /api/v2/buckets/77ca9dace40a9bfc/members
                        org: /api/v2/orgs/INFLUX_ORG_ID
                        owners: /api/v2/buckets/77ca9dace40a9bfc/owners
                        self: /api/v2/buckets/77ca9dace40a9bfc
                        write: /api/v2/write?org=ORG_ID&bucket=77ca9dace40a9bfc
                      name: _monitoring
                      orgID: INFLUX_ORG_ID
                      retentionRules:
                      - everySeconds: 604800
                        type: expire
                      schemaType: implicit
                      type: system
                      updatedAt: '2022-03-15T17:22:33.726179487Z'
                    links:
                      self: /api/v2/buckets?descending=false&limit=20&name=_monitoring&offset=0&orgID=ORG_ID
              schema:
                $ref: '#/components/schemas/Buckets'
          description: 'Success.

            The response body contains a list of `buckets`.

            '
        '401':
          $ref: '#/components/responses/AuthorizationError'
        '500':
          $ref: '#/components/responses/InternalServerError'
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Unexpected error
      summary: List buckets
      tags:
      - Buckets
      x-codeSamples:
      - label: 'cURL: filter buckets by name'
        lang: Shell
        source: "curl --request GET \"http://localhost:8086/api/v2/buckets?name=_monitoring\" \\\n  --header \"Authorization: Token INFLUX_TOKEN\" \\\n  --header \"Accept: application/json\" \\\n  --header \"Content-Type: application/json\"\n"
    post:
      description: 'Creates a [bucket](https://docs.influxdata.com/influxdb/cloud/reference/glossary/#bucket)

        and returns the bucket resource.

        The default data

        [retention period](https://docs.influxdata.com/influxdb/cloud/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 a bucket](https://docs.influxdata.com/influxdb/cloud/organizations/buckets/create-bucket/)

        - [Create bucket CLI reference](https://docs.influxdata.com/influxdb/cloud/reference/cli/influx/bucket/create)

        '
      operationId: PostBuckets
      parameters:
      - $ref: '#/components/parameters/TraceSpan'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PostBucketRequest'
        description: The bucket to create.
        required: true
      responses:
        '201':
          content:
            application/json:
              examples:
                successResponse:
                  value:
                    createdAt: '2022-08-03T23:04:41.073704121Z'
                    description: A bucket holding air sensor data
                    id: 37407e232b3911d8
                    labels: []
                    links:
                      labels: /api/v2/buckets/37407e232b3911d8/labels
                      members: /api/v2/buckets/37407e232b3911d8/members
                      org: /api/v2/orgs/INFLUX_ORG_ID
                      owners: /api/v2/buckets/37407e232b3911d8/owners
                      self: /api/v2/buckets/37407e232b3911d8
                      write: /api/v2/write?org=INFLUX_ORG_ID&bucket=37407e232b3911d8
                    name: air_sensor
                    orgID: INFLUX_ORG_ID
                    retentionRules:
                    - everySeconds: 2592000
                      type: expire
                    schemaType: implicit
                    type: user
                    updatedAt: '2022-08-03T23:04:41.073704228Z'
              schema:
                $ref: '#/components/schemas/Bucket'
          description: 'Success.

            The bucket is created.

            '
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Bad request.

            '
        '401':
          $ref: '#/components/responses/AuthorizationError'
        '403':
          content:
            application/json:
              examples:
                quotaExceeded:
                  summary: Bucket quota exceeded
                  value:
                    code: forbidden
                    message: creating bucket would exceed quota
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Forbidden.

            The bucket quota is exceeded.

            '
          headers:
            X-Platform-Error-Code:
              description: 'The reason for the error.

                '
              schema:
                example: forbidden
                type: string
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Unprocessable Entity.

            The request body failed validation.

            '
        '500':
          $ref: '#/components/responses/InternalServerError'
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Unexpected error
      summary: Create a bucket
      tags:
      - Buckets
      x-codeSamples:
      - label: 'cURL: create a bucket with retention period'
        lang: Shell
        source: "curl --request POST \"http://localhost:8086/api/v2/buckets \\\n  --header \"Authorization: Token INFLUX_TOKEN\" \\\n  --header \"Accept: application/json\" \\\n  --header \"Content-Type: application/json\" \\\n  --data '{\n      \"name\": \"air_sensor\",\n      \"description\": \"A bucket holding air sensor data\",\n      \"orgID\": \"INFLUX_ORG_ID\",\n      \"retentionRules\": [\n          {\n              \"type\": \"expire\",\n              \"everySeconds\": 2592000,\n          }\n      ]\n    }'\n"
      - label: cURL
        lang: Shell
        source: ''
  /api/v2/buckets/{bucketID}:
    delete:
      description: "Deletes a bucket and all associated records.\n\n#### InfluxDB Cloud\n\n- Does the following when you send a delete request:\n\n  1. Validates the request and queues the delete.\n  2. Returns an HTTP `204` status code if queued; _error_ otherwise.\n  3. Handles the delete asynchronously.\n\n#### InfluxDB OSS\n\n- Validates the request, handles the delete synchronously,\nand then responds with success or failure.\n\n#### Limitations\n\n- Only one bucket can be deleted per request.\n\n#### Related Guides\n\n- [Delete a bucket](https://docs.influxdata.com/influxdb/cloud/organizations/buckets/delete-bucket/#delete-a-bucket-in-the-influxdb-ui)\n"
      operationId: DeleteBucketsID
      parameters:
      - $ref: '#/components/parameters/TraceSpan'
      - description: 'Bucket ID.

          The ID of the bucket to delete.

          '
        in: path
        name: bucketID
        required: true
        schema:
          type: string
      responses:
        '204':
          description: "Success.\n\n#### InfluxDB Cloud\n  - The bucket is queued for deletion.\n\n#### InfluxDB OSS\n  - The bucket is deleted.\n"
        '400':
          content:
            application/json:
              examples:
                invalidID:
                  summary: 'Invalid ID.

                    '
                  value:
                    code: invalid
                    message: id must have a length of 16 bytes
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Bad Request.

            '
        '401':
          $ref: '#/components/responses/AuthorizationError'
        '404':
          content:
            application/json:
              examples:
                notFound:
                  summary: 'The requested bucket was not found.

                    '
                  value:
                    code: not found
                    message: bucket not found
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Not found.

            Bucket not found.

            '
        '500':
          $ref: '#/components/responses/InternalServerError'
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Unexpected error
      summary: Delete a bucket
      tags:
      - Buckets
      x-codeSamples:
      - label: cURL
        lang: Shell
        source: "curl --request DELETE \"http://localhost:8086/api/v2/buckets/BUCKET_ID\" \\\n  --header \"Authorization: Token INFLUX_TOKEN\" \\\n  --header 'Accept: application/json'\n"
    get:
      description: 'Retrieves a bucket.


        Use this endpoint to retrieve information for a specific bucket.

        '
      operationId: GetBucketsID
      parameters:
      - $ref: '#/components/parameters/TraceSpan'
      - description: 'The ID of the bucket to retrieve.

          '
        in: path
        name: bucketID
        required: true
        schema:
          type: string
      responses:
        '200':
          content:
            application/json:
              examples:
                successResponse:
                  value:
                    createdAt: '2022-08-03T23:04:41.073704121Z'
                    description: bucket for air sensor data
                    id: 37407e232b3911d8
                    labels: []
                    links:
                      labels: /api/v2/buckets/37407e232b3911d8/labels
                      members: /api/v2/buckets/37407e232b3911d8/members
                      org: /api/v2/orgs/INFLUX_ORG_ID
                      owners: /api/v2/buckets/37407e232b3911d8/owners
                      self: /api/v2/buckets/37407e232b3911d8
                      write: /api/v2/write?org=INFLUX_ORG_ID&bucket=37407e232b3911d8
                    name: air-sensor
                    orgID: bea7ea952287f70d
                    retentionRules:
                    - everySeconds: 2592000
                      type: expire
                    schemaType: implicit
                    type: user
                    updatedAt: '2022-08-03T23:04:41.073704228Z'
              schema:
                $ref: '#/components/schemas/Bucket'
          description: 'Success.

            The response body contains the bucket information.

            '
        '401':
          $ref: '#/components/responses/AuthorizationError'
        '404':
          content:
            application/json:
              examples:
                notFound:
                  summary: 'The requested bucket wasn''t found.

                    '
                  value:
                    code: not found
                    message: bucket not found
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Not found.

            Bucket not found.

            '
        '500':
          $ref: '#/components/responses/InternalServerError'
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Unexpected error
      summary: Retrieve a bucket
      tags:
      - Buckets
    patch:
      description: 'Updates a bucket.


        Use this endpoint to update properties

        (`name`, `description`, and `retentionRules`) of a bucket.


        #### InfluxDB 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/cloud/organizations/buckets/update-bucket/)

        '
      operationId: PatchBucketsID
      parameters:
      - $ref: '#/components/parameters/TraceSpan'
      - description: The bucket ID.
        in: path
        name: bucketID
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchBucketRequest'
        description: The bucket update to apply.
        required: true
      responses:
        '200':
          content:
            application/json:
              examples:
                successResponse:
                  value:
                    createdAt: '2022-08-03T23:04:41.073704121Z'
                    description: bucket holding air sensor data
                    id: 37407e232b3911d8
                    labels: []
                    links:
                      labels: /api/v2/buckets/37407e232b3911d8/labels
                      members: /api/v2/buckets/37407e232b3911d8/members
                      org: /api/v2/orgs/INFLUX_ORG_ID
                      owners: /api/v2/buckets/37407e232b3911d8/owners
                      self: /api/v2/buckets/37407e232b3911d8
                      write: /api/v2/write?org=INFLUX_ORG_ID&bucket=37407e232b3911d8
                    name: air_sensor
                    orgID: INFLUX_ORG_ID
                    retentionRules:
                    - everySeconds: 2592000
                      type: expire
                    schemaType: implicit
                    type: user
                    updatedAt: '2022-08-07T22:49:49.422962913Z'
              schema:
                $ref: '#/components/schemas/Bucket'
          description: An updated bucket
        '400':
          content:
            application/json:
              examples:
                invalidJSONStringValue:
                  description: 'If the request body contains invalid JSON, InfluxDB returns `invalid`

                    with detail about the problem.

                    '
                  summary: Invalid JSON
                  value:
                    code: invalid
                    message: 'invalid json: invalid character ''\'''' looking for beginning of value'
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Bad Request.

            '
        '401':
          $ref: '#/components/responses/AuthorizationError'
        '403':
          content:
            application/json:
              examples:
                invalidRetention:
                  summary: 'The retention policy provided exceeds the max retention for the

                    organization.

                    '
                  value:
                    code: forbidden
                    message: provided retention exceeds orgs maximum retention duration
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Forbidden.

            '
        '404':
          content:
            application/json:
              examples:
                notFound:
                  summary: 'The requested bucket wasn''t found.

                    '
                  value:
                    code: not found
                    message: bucket not found
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Not found.

            Bucket not found.

            '
        '500':
          $ref: '#/components/responses/InternalServerError'
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Unexpected error
      summary: Update a bucket
      tags:
      - Buckets
      x-codeSamples:
      - label: cURL
        lang: Shell
        source: "curl --request PATCH \"http://localhost:8086/api/v2/buckets/BUCKET_ID \\\n  --header \"Authorization: Token INFLUX_TOKEN\" \\\n  --header \"Accept: application/json\" \\\n  --header \"Content-Type: application/json\" \\\n  --data '{\n      \"name\": \"air_sensor\",\n      \"description\": \"bucket holding air sensor data\",\n      \"retentionRules\": [\n          {\n              \"type\": \"expire\",\n              \"everySeconds\": 2592000\n          }\n      ]\n    }'\n"
  /api/v2/buckets/{bucketID}/labels:
    get:
      description: 'Lists all labels for a bucket.


        Labels are objects that contain `labelID`, `name`, `description`, and `color`

        key-value pairs. They may be used for grouping and filtering InfluxDB

        resources.

        Labels are also capable of grouping across different resources--for example,

        you can apply a label named `air_sensor` to a bucket and a task to quickly

        organize resources.


        #### Related guides


        - Use the [`/api/v2/labels` InfluxDB API endpoint](#tag/Labels) to retrieve and manage labels.

        - [Manage labels in the InfluxDB UI](https://docs.influxdata.com/influxdb/cloud/visualize-data/labels/)

        '
      operationId: GetBucketsIDLabels
      parameters:
      - $ref: '#/components/parameters/TraceSpan'
      - description: 'The ID of the bucket to retrieve labels for.

          '
        in: path
        name: bucketID
        required: true
        schema:
          type: string
      responses:
        '200':
          content:
            application/json:
              examples:
                successResponse:
                  value:
                    labels:
                    - id: 09cbd068e7ebb000
                      name: production_buckets
                      orgID: INFLUX_ORG_ID
                    links:
                      self: /api/v2/labels
              schema:
                $ref: '#/components/schemas/LabelsResponse'
          description: 'Success.

            The response body contains a list of all labels for the bucket.

            '
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/AuthorizationError'
        '404':
          $ref: '#/components/responses/ResourceNotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Unexpected error
      summary: List all labels for a bucket
      tags:
      - Buckets
    post:
      description: "Adds a label to a bucket and returns the new label information.\n\nLabels are objects that contain `labelID`, `name`, `description`, and `color`\nkey-value pairs. They may be used for grouping and filtering across one or\nmore kinds of **resources**--for example, you can apply a label named\n`air_sensor` to a bucket and a task to quickly organize resources.\n\n#### Limitations\n\n- Before adding a label to a bucket, you must create the label if you\n  haven't already. To create a label with the InfluxDB API, send a `POST`\n  request to the [`/api/v2/labels` endpoint](#operation/PostLabels)).\n\n#### Related guides\n\n- Use the [`/api/v2/labels` InfluxDB API endpoint](#tag/Labels) to retrieve and manage labels.\n- [Manage labels in the InfluxDB UI](https://docs.influxdata.com/influxdb/cloud/visualize-data/labels/)\n"
      operationId: PostBucketsIDLabels
      parameters:
      - $ref: '#/components/parameters/TraceSpan'
      - description: 'Bucket ID.

          The ID of the bucket to label.

          '
        in: path
        name: bucketID
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LabelMapping'
        description: An object that contains a _`labelID`_ to add to the bucket.
        required: true
      responses:
        '201':
          content:
            application/json:
              examples:
                successResponse:
                  value:
                    label:
                      id: 09cbd068e7ebb000
                      name: production_buckets
                      orgID: INFLUX_ORG_ID
                    links:
                      self: /api/v2/labels
              schema:
                $ref: '#/components/schemas/LabelResponse'
          description: 'Success.

            The response body contains the label information.

            '
        '400':
          $ref: '#/components/responses/BadRequestError'
          examples:
            invalidRequest:
              summary: The `labelID` is missing from the request body.
              value:
                code: invalid
                message: label id is required
        '401':
          $ref: '#/components/responses/AuthorizationError'
        '404':
          $ref: '#/components/responses/ResourceNotFoundError'
        '422':
          content:
            application/json:
              examples:
                conflictingResource:
                  summary: 'Label already exists on the resource.

                    '
                  value:
                    code: conflict
                    message: Cannot add label, label already exists on resource
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Unprocessable entity.

            Label already exists on the resource.

            '
        '500':
          $ref: '#/components/responses/InternalServerError'
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Unexpected error
      summary: Add a label to a bucket
      tags:
      - Buckets
      x-codeSamples:
      - label: cURL
        lang: Shell
        source: "curl --request POST \"http://localhost:8086/api/v2/buckets/BUCKETS_ID/labels \\\n  --header \"Authorization: Token INFLUX_TOKEN\" \\\n  --header \"Accept: application/json\" \\\n  --header \"Content-Type: application/json\" \\\n  --data '{\n      \"labelID\": \"09cbd068e7ebb000\"\n    }'\n"
  /api/v2/buckets/{bucketID}/labels/{labelID}:
    delete:
      operationId: DeleteBucketsIDLabelsID
      parameters:
      - $ref: '#/components/parameters/TraceSpan'
      - description: The bucket ID.
        in: path
        name: bucketID
        required: true
        schema:
          type: string
      - description: The ID of the label to delete.
        in: path
        name: labelID
        required: true
        schema:
          type: string
      responses:
        '204':
          description: Delete has been accepted
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Bucket not found
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Unexpected error
      summary: Delete a label from a bucket
      tags:
      - Buckets
  /api/v2/buckets/{bucketID}/members:
    get:
      description: 'Lists all users for a bucket.


        InfluxDB [users](https://docs.influxdata.com/influxdb/cloud/reference/glossary/#user) have

        permission to access InfluxDB.


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

        - [Manage members](https://docs.influxdata.com/influxdb/cloud/organizations/members/)

        '
      operationId: GetBucketsIDMembers
      parameters:
      - $ref: '#/components/parameters/TraceSpan'
      - description: 'The ID of the bucket to retrieve users for.

          '
        in: path
        name: bucketID
        required: true
        schema:
          type: string
      responses:
        '200':
          content:
            application/json:
              examples:
                successResponse:
                  value:
                    links:
                      self: /api/v2/buckets/37407e232b3911d8/members
                    users:
                    - id: 791df274afd48a83
                      links:
                        self: /api/v2/users/791df274afd48a83
                      name: example_user_1
                      role: member
                      status: active
                    - id: 09cfb87051cbe000
                      links:
                        self: /api/v2/users/09cfb87051cbe000
                      name: example_user_2
                      role: owner
                      status: active
              schema:
                $ref: '#/components/schemas/ResourceMembers'
          description: 'Success.

            The response body contains a list of all users for the bucket.

            '
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/AuthorizationError'
        '404':
          $ref: '#/components/responses/ResourceNotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Unexpected error
      summary: List all users with member privileges for a bucket
      tags:
      - Buckets
    post:
      description: 'Add a user to a bucket and return the new user information.


        InfluxDB [users](https://docs.influxdata.com/influxdb/cloud/reference/glossary/#user) have

        permission to access InfluxDB.


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

        - [Manage members](https://docs.influxdata.com/influxdb/cloud/organizations/members/)

        '
      operationId: PostBucketsIDMembers
      parameters:
      - $ref: '#/components/parameters/TraceSpan'
      - descripti

# --- truncated at 32 KB (64 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/influxdb/refs/heads/main/openapi/influxdb-buckets-api-openapi.yml