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

# Link a client to a site

> Associates an existing client with an existing site. Idempotent: linking an already-linked client/site pair succeeds without creating a duplicate. Primary-client selection is a separate flow and is intentionally not handled here.



## OpenAPI

````yaml /openapi.yaml put /v1/client/{clientId}/site/{siteId}
openapi: 3.1.0
info:
  title: ProVision Public API
  version: 1.0.0
  description: >-
    Use the ProVision Public API to integrate with ProVision conversations,
    clients, users, and addresses. All endpoints accept and return JSON, are
    authenticated with an `x-api-key` header, and are scoped to a single partner
    tenant.
  contact:
    email: support@onevisionresources.com
    name: OneVision Resources Support
  license:
    name: Proprietary
servers:
  - url: https://connect.provisionapp.io
    description: Production
security: []
paths:
  /v1/client/{clientId}/site/{siteId}:
    put:
      tags:
        - client
      summary: Link a client to a site
      description: >-
        Associates an existing client with an existing site. Idempotent: linking
        an already-linked client/site pair succeeds without creating a
        duplicate. Primary-client selection is a separate flow and is
        intentionally not handled here.
      operationId: linkClientToSite
      parameters:
        - schema:
            allOf:
              - $ref: '#/components/schemas/ClientId'
              - example: ovcid-61f936b9-6f97-438e-856d-1d99c69304f3
          required: true
          name: clientId
          in: path
        - schema:
            allOf:
              - $ref: '#/components/schemas/SiteId'
              - example: ovaid-61f936b9-6f97-438e-856d-1d99c69304f3
          required: true
          name: siteId
          in: path
      responses:
        '201':
          description: Client linked to site
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientSiteLink'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - OpenApiKeyAuth: []
components:
  schemas:
    ClientId:
      type: string
      pattern: ^ovcid-.*$
    SiteId:
      type: string
      pattern: ^ovaid-.*$
      example: ovaid-22222222-2222-4222-8222-222222222222
    ClientSiteLink:
      type: object
      properties:
        clientId:
          $ref: '#/components/schemas/ClientId'
        siteId:
          $ref: '#/components/schemas/SiteId'
        linked:
          type: boolean
          description: True once the client is associated with the site
          example: true
      required:
        - clientId
        - siteId
        - linked
      additionalProperties: false
    ErrorResponse:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/ApiError'
      required:
        - error
    ApiError:
      type: object
      properties:
        code:
          type: string
          description: Machine-readable error code
          example: NOT_FOUND
        message:
          type: string
          description: Human-readable error description
      required:
        - code
        - message
  securitySchemes:
    OpenApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: Send the API key in the x-api-key header.

````