> ## Documentation Index
> Fetch the complete documentation index at: https://docs.repdata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Patch a bucket

> # Description

Update a bucket using the bucketId set in the url.

# Payload

```json
{
    "aggregations": {
        "1": {
            "options": [number],
            "label": "string"
        },
        "2": {
            "label": "string",
            "options": [number],
            "excluded": boolean
        }
    },
    "projectId": "string"
}
```

- `aggregations`: Object containing question options to aggregate. Optional.
- `projectId`: Id of the project. Optional.

# Response

## 200 OK

```json
    "createdAt": "string",
    "updatedAt": "string",
    "questionId": "string",
    "aggregations": {
        "1": {
            "options": [number],
            "label": "string"
        },
        "2": {
            "label": "string",
            "options": [number],
            "excluded": boolean
        }
    },
    "id": "string",
    "projectId": "string"
}
```

where:

- `createdAt`: Creation date for the bucket with the format `YYYY-MM-DDTHH:mm:ss.SSSZ`.
- `updatedAt`: Last update date for the bucket with the format `YYYY-MM-DDTHH:mm:ss.SSSZ`.
- `aggregations`: Object containing question options to aggregate.
- `questionId`: Id of the question to aggregate.
- `projectId`: Id of the project.
- `id`: Bucket Id.

## 401 Unauthorized

> The user doesn't have permissions.

## 500 Internal Server Error

> Error occurred while processing the request.

# Description

Update a bucket using the bucketId set in the url.

# Payload

```json theme={null}
{
    "aggregations": {
        "1": {
            "options": [number],
            "label": "string"
        },
        "2": {
            "label": "string",
            "options": [number],
            "excluded": boolean
        }
    },
    "projectId": "string"
}
```

* `aggregations`: Object containing question options to aggregate. Optional.
* `projectId`: Id of the project. Optional.

# Response

## 200 OK

```json theme={null}
    "createdAt": "string",
    "updatedAt": "string",
    "questionId": "string",
    "aggregations": {
        "1": {
            "options": [number],
            "label": "string"
        },
        "2": {
            "label": "string",
            "options": [number],
            "excluded": boolean
        }
    },
    "id": "string",
    "projectId": "string"
}
```

where:

* `createdAt`: Creation date for the bucket with the format `YYYY-MM-DDTHH:mm:ss.SSSZ`.
* `updatedAt`: Last update date for the bucket with the format `YYYY-MM-DDTHH:mm:ss.SSSZ`.
* `aggregations`: Object containing question options to aggregate.
* `questionId`: Id of the question to aggregate.
* `projectId`: Id of the project.
* `id`: Bucket Id.

## 401 Unauthorized

> The user doesn't have permissions.

## 500 Internal Server Error

> Error occurred while processing the request.


## OpenAPI

````yaml PATCH /projects-api/v1/questionAggregations/{bucketId}
openapi: 3.0.3
info:
  title: SightX API
  version: 1.0.0
  description: >-
    SightX REST API documentation. Most responses are JSON; some export
    endpoints return files. API access is a paid add-on — contact
    sales@sightx.io for details.
servers:
  - url: https://auth.admin.sightx.io
    description: Authentication (Production)
  - url: https://auth.staging-admin.sightx.io
    description: Authentication (Staging)
security:
  - AuthorizationHeader: []
paths:
  /projects-api/v1/questionAggregations/{bucketId}:
    patch:
      summary: Patch a bucket
      description: >-
        # Description


        Update a bucket using the bucketId set in the url.


        # Payload


        ```json

        {
            "aggregations": {
                "1": {
                    "options": [number],
                    "label": "string"
                },
                "2": {
                    "label": "string",
                    "options": [number],
                    "excluded": boolean
                }
            },
            "projectId": "string"
        }

        ```


        - `aggregations`: Object containing question options to aggregate.
        Optional.

        - `projectId`: Id of the project. Optional.


        # Response


        ## 200 OK


        ```json
            "createdAt": "string",
            "updatedAt": "string",
            "questionId": "string",
            "aggregations": {
                "1": {
                    "options": [number],
                    "label": "string"
                },
                "2": {
                    "label": "string",
                    "options": [number],
                    "excluded": boolean
                }
            },
            "id": "string",
            "projectId": "string"
        }

        ```


        where:


        - `createdAt`: Creation date for the bucket with the format
        `YYYY-MM-DDTHH:mm:ss.SSSZ`.

        - `updatedAt`: Last update date for the bucket with the format
        `YYYY-MM-DDTHH:mm:ss.SSSZ`.

        - `aggregations`: Object containing question options to aggregate.

        - `questionId`: Id of the question to aggregate.

        - `projectId`: Id of the project.

        - `id`: Bucket Id.


        ## 401 Unauthorized


        > The user doesn't have permissions.


        ## 500 Internal Server Error


        > Error occurred while processing the request.
      operationId: patch-a-bucket-patch-projects-api-v1-questionaggregations-bucketid
      parameters:
        - name: Authorization
          in: header
          required: true
          description: Authorization token
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: true
      responses:
        '200':
          description: Patch a bucket
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
              example:
                createdAt: '2021-09-20T23:06:34.708Z'
                updatedAt: '2021-09-20T23:06:34.708Z'
                questionId: 612eb151347a291dcb1cxxxx
                aggregations:
                  '1':
                    options:
                      - 1
                      - 2
                    label: Gender
                  '2':
                    label: <p>Other</p>
                    options:
                      - 3
                    excluded: true
                id: 614913fa9e3abc0d3b38275d
                projectId: 6143da1e9e3abc0d3b382735
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '500':
          description: Internal server error
      servers:
        - url: https://project.sightx.io
components:
  securitySchemes:
    AuthorizationHeader:
      type: apiKey
      in: header
      name: Authorization
      description: Access token obtained from the m2m-token endpoint.

````