> ## 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.

# Set Enabled Coverage Types

> Replaces the company's enabled coverage types list wholesale. The provided
`coverageTypeKeys` array becomes the new complete list of enabled coverage
types for the company.

Each key must refer to an existing coverage type that is either:
- A **global** coverage type (e.g., `general_liability`, `inland_marine`)
- A **company-specific** coverage type owned by this company

Duplicate keys in the request are automatically deduplicated.
At least one key must be provided.

Coverage types that belong to other companies are treated as not found
to avoid leaking information about other companies' configurations.

**Required permission:** `company:update`




## OpenAPI

````yaml /openapi/generated-external-api.yaml put /api/external/companies/{companyId}/coverage-types/enabled
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/external/companies/{companyId}/coverage-types/enabled:
    put:
      tags:
        - Coverage Types
      summary: Set Enabled Coverage Types
      description: >
        Replaces the company's enabled coverage types list wholesale. The
        provided

        `coverageTypeKeys` array becomes the new complete list of enabled
        coverage

        types for the company.


        Each key must refer to an existing coverage type that is either:

        - A **global** coverage type (e.g., `general_liability`,
        `inland_marine`)

        - A **company-specific** coverage type owned by this company


        Duplicate keys in the request are automatically deduplicated.

        At least one key must be provided.


        Coverage types that belong to other companies are treated as not found

        to avoid leaking information about other companies' configurations.


        **Required permission:** `company:update`
      operationId: setEnabledCoverageTypes
      parameters:
        - $ref: '#/components/parameters/companyId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SetEnabledCoverageTypesRequest'
            examples:
              globalTypes:
                summary: Enable global coverage types
                value:
                  coverageTypeKeys:
                    - general_liability
                    - inland_marine
              mixed:
                summary: Enable global and company-specific types
                value:
                  coverageTypeKeys:
                    - general_liability
                    - vfs_custom_type
      responses:
        '200':
          description: Enabled coverage types updated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  enabledCoverageTypeKeys:
                    type: array
                    items:
                      type: string
                    description: >-
                      The deduplicated list of coverage type keys that are now
                      enabled
              examples:
                success:
                  summary: Coverage types enabled
                  value:
                    enabledCoverageTypeKeys:
                      - general_liability
                      - inland_marine
        '400':
          description: Bad Request - Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                emptyArray:
                  summary: Empty array
                  value:
                    error:
                      code: NoCoverageTypesProvided
                      message: No coverage types provided
                emptyString:
                  summary: Empty string in array
                  value:
                    error:
                      code: InvalidProperties
                      message: 'coverageTypeKeys: Some elements were invalid'
                      details:
                        - field: coverageTypeKeys
                          message: Some elements were invalid
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          description: >-
            Not Found - Coverage type does not exist or is not available to this
            company
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                notFound:
                  summary: Non-existent coverage type key
                  value:
                    error:
                      code: CoverageTypeNotFound
                      message: 'Coverage types not found: does_not_exist'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  parameters:
    companyId:
      name: companyId
      in: path
      required: true
      schema:
        type: string
        format: uuid
      description: Company identifier
  schemas:
    SetEnabledCoverageTypesRequest:
      type: object
      description: Request to set the enabled coverage types for a company
      required:
        - coverageTypeKeys
      properties:
        coverageTypeKeys:
          type: array
          description: |
            The complete list of coverage type keys to enable for the company.
            This replaces the existing list wholesale. At least one key must
            be provided.

            Each key must be either a global coverage type or a company-specific
            coverage type owned by this company.
          minItems: 1
          items:
            type: string
            minLength: 1
          example:
            - general_liability
            - inland_marine
            - vfs_custom_type
    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.

````