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

# Generate or set password for a connection

> Generates a new password or sets a specific password for a connection



## OpenAPI

````yaml /api-reference/openapi.json post /connections/{connection_id}/password
openapi: 3.0.0
info:
  title: QuBe Sync API
  description: Integrate with QuickBooks Desktop or QuickBooks Enterprise in a few steps.
  version: 1.0.0
  contact:
    email: support@qubesync.com
servers:
  - url: https://qubesync.com/api/v1
    description: v1 API
  - url: https://dev.qubesync.com/api/v1
    description: Local development server
security: []
tags:
  - name: Connections
    description: Endpoints for managing QuickBooks connections
  - name: Queued Requests
    description: Endpoints for managing queued API requests
  - name: Pre-built Queries
    description: >-
      Endpoints for executing pre-built queries against QuickBooks data. These
      endpoints simplify common data retrieval operations by providing a
      higher-level interface than the raw queued requests API. Each query is
      executed asynchronously and returns a queued request ID that can be used
      to check the status and retrieve results.
paths:
  /connections/{connection_id}/password:
    post:
      tags:
        - Connections
      summary: Generate or set password for a connection
      description: Generates a new password or sets a specific password for a connection
      parameters:
        - name: connection_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: ID of the connection
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                password:
                  type: string
                  description: >-
                    Optional. If provided, will set this as the connection
                    password. If omitted, a random password will be generated.
      responses:
        '200':
          description: Password generated/set successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        description: ID of the connection
                        format: uuid
                      password:
                        type: string
                        description: >-
                          Password for the connection. Regenerates each time
                          this endpoint is called.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - apiKey: []
components:
  responses:
    Unauthorized:
      description: Authentication required or invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: unauthorized
              message: Authentication required
    NotFound:
      description: The requested resource was not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: not_found
              message: The requested resource was not found
  schemas:
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              example: invalid_request
            message:
              type: string
              example: The request was invalid
            details:
              type: object
              description: Additional error details
  securitySchemes:
    apiKey:
      type: http
      scheme: basic
      description: Use your app's API_KEY as the username, and leave the password blank

````