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

# Bind Quote

> Binds a Field Model V1 quote, creating a Basic Policy. The quote must
not already be bound.

On success, returns the newly created policy ID, policy number, and any
bind errors encountered during the process. Bind errors are non-fatal
warnings — the policy is still created.

**Required permission:** `company.quote:create`




## OpenAPI

````yaml /openapi/generated-external-api.yaml post /api/v1/external/companies/{companyId}/quotes/{quoteId}/bind
openapi: 3.0.3
info:
  title: AI Insurance External API
  description: External API for AI Insurance platform
  version: 1.0.0
  contact:
    email: support@aiinsurance.io
servers:
  - url: https://app.aiinsurance.io
    description: Production
security:
  - ApiKeyAuth: []
paths:
  /api/v1/external/companies/{companyId}/quotes/{quoteId}/bind:
    post:
      tags:
        - Basic Policies
      summary: Bind Quote
      description: |
        Binds a Field Model V1 quote, creating a Basic Policy. The quote must
        not already be bound.

        On success, returns the newly created policy ID, policy number, and any
        bind errors encountered during the process. Bind errors are non-fatal
        warnings — the policy is still created.

        **Required permission:** `company.quote:create`
      operationId: bindQuoteV1
      parameters:
        - $ref: '#/components/parameters/companyId'
        - name: quoteId
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: Quote identifier
      responses:
        '200':
          description: Quote bound successfully
          content:
            application/json:
              schema:
                type: object
                required:
                  - policyId
                  - policyNumber
                  - bindErrors
                properties:
                  policyId:
                    type: string
                    format: uuid
                    description: ID of the newly created policy
                  policyNumber:
                    type: string
                    description: Auto-generated policy number
                  bindErrors:
                    type: array
                    items:
                      type: object
                      required:
                        - message
                      properties:
                        message:
                          type: string
                    description: Non-fatal warnings encountered during binding
              examples:
                success:
                  summary: Quote bound successfully
                  value:
                    policyId: 550e8400-e29b-41d4-a716-446655440099
                    policyNumber: POL-2025-001
                    bindErrors: []
                successWithErrors:
                  summary: Quote bound with non-fatal warnings
                  value:
                    policyId: 550e8400-e29b-41d4-a716-446655440099
                    policyNumber: POL-2025-001
                    bindErrors:
                      - message: Failed to cascade status to related quotes
        '400':
          description: |
            Bad Request — the quote is in a state that can't be bound (already
            bound, cancelled, wrong type) or is missing required policy fields
            (`policyStartDate`, `policyEndDate`, `policyTimeZone`, `policyType`,
            `primaryInsured`, or at least one exposure).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                alreadyBound:
                  summary: Quote already bound
                  value:
                    error:
                      code: VALIDATION_ERROR
                      message: Quote is already bound!
                cancelled:
                  summary: Cannot bind a cancelled quote
                  value:
                    error:
                      code: VALIDATION_ERROR
                      message: Cannot bind a cancelled quote!
                missingDates:
                  summary: Missing policy dates
                  value:
                    error:
                      code: VALIDATION_ERROR
                      message: Start date and end date are required
                noExposures:
                  summary: At least one exposure required
                  value:
                    error:
                      code: VALIDATION_ERROR
                      message: At least one exposure is required
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Quote not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                quoteNotFound:
                  summary: Quote not found
                  value:
                    error:
                      code: NOT_FOUND
                      message: Quote not found
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  parameters:
    companyId:
      name: companyId
      in: path
      required: true
      schema:
        type: string
        format: uuid
      description: Company identifier
  schemas:
    ErrorResponse:
      type: object
      description: Standard error response for all external API endpoints
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              description: Machine-readable error code
              example: VALIDATION_ERROR
            message:
              type: string
              description: Human-readable error message
              example: 'submissionId: Required field is missing'
            details:
              type: array
              description: Additional details for validation errors (field-level errors)
              items:
                type: object
                properties:
                  field:
                    type: string
                    description: The field that caused the error
                    example: submissionId
                  message:
                    type: string
                    description: Description of the field error
                    example: Required field is missing
  responses:
    Unauthorized:
      description: Unauthorized - Invalid or missing API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            missingApiKey:
              summary: Missing API key
              value:
                error:
                  code: UNAUTHORIZED
                  message: Authorization header is required
            bearerTokenNotAllowed:
              summary: Bearer token used instead of API key
              value:
                error:
                  code: UNAUTHORIZED
                  message: External API endpoints require API key authentication
    Forbidden:
      description: Forbidden - Insufficient permissions
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            insufficientPermissions:
              summary: Insufficient permissions
              value:
                error:
                  code: FORBIDDEN
                  message: Insufficient permissions to perform this action
    InternalServerError:
      description: Internal Server Error - Unexpected error occurred
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            internalError:
              summary: Unexpected server error
              value:
                error:
                  code: INTERNAL_ERROR
                  message: An unexpected error occurred. Please try again later.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        API key authentication. Include your API key in the Authorization
        header.

````