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

# Reinstate Policy Transaction

> Reinstates a previously cancelled policy as of a given date via a REINSTATE
transaction. The policy must be Cancelled at the reinstatement date. The action
sets `policyStatus` back to `active` from the reinstatement date through the
end of the policy term and clears the `policyEarlyTerminationDate` on
`fullTermPolicyInfo`.

Optional `fullTermDeltas` allow adjusting `fullTermPolicyBilling` fields (e.g.
reinstatement fees). Only `fullTermPolicyBilling`-prefixed paths are accepted —
per-segment data and policy dates are not modifiable via reinstate. Dates are
not accepted on these deltas because they always span the full policy term;
the server injects them.

**Required permission:** `company.policy:update`




## OpenAPI

````yaml /openapi/generated-external-api.yaml post /api/v1/external/companies/{companyId}/policies/{policyId}/transaction/reinstate
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}/policies/{policyId}/transaction/reinstate:
    post:
      tags:
        - Field Model Policy Transactions
      summary: Reinstate Policy Transaction
      description: >
        Reinstates a previously cancelled policy as of a given date via a
        REINSTATE

        transaction. The policy must be Cancelled at the reinstatement date. The
        action

        sets `policyStatus` back to `active` from the reinstatement date through
        the

        end of the policy term and clears the `policyEarlyTerminationDate` on

        `fullTermPolicyInfo`.


        Optional `fullTermDeltas` allow adjusting `fullTermPolicyBilling` fields
        (e.g.

        reinstatement fees). Only `fullTermPolicyBilling`-prefixed paths are
        accepted —

        per-segment data and policy dates are not modifiable via reinstate.
        Dates are

        not accepted on these deltas because they always span the full policy
        term;

        the server injects them.


        **Required permission:** `company.policy:update`
      operationId: reinstatePolicyTransaction
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/policyIdPath'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - reinstatementDate
              properties:
                reinstatementDate:
                  type: string
                  format: date
                  description: >
                    The date the reinstatement takes effect in ISO 8601 format.
                    Must fall

                    within the policy term, and the policy must be Cancelled at
                    this date.
                transactionTimestamp:
                  type: string
                  format: date-time
                  description: >
                    When the business decision was made. Defaults to the current
                    time if omitted.

                    Set explicitly for imports (e.g., aligning to a bordereau
                    booking date).
                fullTermDeltas:
                  type: array
                  description: >
                    Optional billing-only deltas. Each delta specifies a
                    `fullTermPolicyBilling`

                    path and a new value. These are applied as Overwrite actions
                    across the full

                    policy term (since `fullTermPolicyBilling` is a
                    cross-segment invariant that

                    must be identical in every segment).


                    Note: `policyPremium` must remain equal to the pre-cancel
                    premium (within

                    0.01 tolerance). Fees, taxes, and grand total may be
                    adjusted freely.
                  items:
                    type: object
                    required:
                      - path
                      - value
                    properties:
                      path:
                        type: string
                        description: |
                          Path within `fullTermPolicyBilling` (e.g.
                          `policy.fullTermPolicyBilling.reinstatementFee`).
                      value:
                        description: The new value to set at the path.
            examples:
              simpleReinstatement:
                summary: Reinstate cancelled policy
                value:
                  reinstatementDate: '2025-07-01'
              reinstatementWithFees:
                summary: Reinstate with reinstatement fee
                value:
                  reinstatementDate: '2025-07-01'
                  fullTermDeltas:
                    - path: policy.fullTermPolicyBilling.reinstatementFee
                      value: 1500
                    - path: policy.fullTermPolicyBilling.policyGrandTotal
                      value: 87000
              reinstatementWithTimestamp:
                summary: Reinstate with explicit transaction timestamp
                value:
                  reinstatementDate: '2025-07-01'
                  transactionTimestamp: '2025-06-30T12:00:00Z'
      responses:
        '201':
          description: Policy reinstated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PolicyTransactionVersionResponse'
              examples:
                success:
                  summary: Reinstatement transaction response
                  value:
                    policyId: 550e8400-e29b-41d4-a716-446655440001
                    policyVersion: 3
                    transactionId: 550e8400-e29b-41d4-a716-446655440050
                    startDate: '2025-01-01'
                    endDate: '2025-12-31'
                    createdAt: '2025-07-01T10:30:00.000Z'
                    fullTermPolicyInfo:
                      policyStatus: active
                      policyStartDate:
                        year: 2025
                        month: 1
                        day: 1
                        timezone: America/New_York
                      policyEndDate:
                        year: 2025
                        month: 12
                        day: 31
                        timezone: America/New_York
                      primaryInsuredId: 550e8400-e29b-41d4-a716-446655440010
                    fullTermPolicyBilling:
                      policyPremium: 85000
                      policyTaxes: 0
                      policyFees: 500
                      policyGrandTotal: 85500
                    segments:
                      - startDate: '2025-01-01'
                        endDate: '2025-06-14'
                        fieldModelV1Data:
                          policy:
                            policyStatus: active
                            annualPremium: 85000
                            fullTermPolicyInfo:
                              policyStatus: active
                              policyStartDate:
                                year: 2025
                                month: 1
                                day: 1
                                timezone: America/New_York
                              policyEndDate:
                                year: 2025
                                month: 12
                                day: 31
                                timezone: America/New_York
                              primaryInsuredId: 550e8400-e29b-41d4-a716-446655440010
                            fullTermPolicyBilling:
                              policyPremium: 85000
                              policyTaxes: 0
                              policyFees: 500
                              policyGrandTotal: 85500
                      - startDate: '2025-06-15'
                        endDate: '2025-06-30'
                        fieldModelV1Data:
                          policy:
                            policyStatus: cancelled
                            annualPremium: 85000
                            fullTermPolicyInfo:
                              policyStatus: active
                              policyStartDate:
                                year: 2025
                                month: 1
                                day: 1
                                timezone: America/New_York
                              policyEndDate:
                                year: 2025
                                month: 12
                                day: 31
                                timezone: America/New_York
                              primaryInsuredId: 550e8400-e29b-41d4-a716-446655440010
                            fullTermPolicyBilling:
                              policyPremium: 85000
                              policyTaxes: 0
                              policyFees: 500
                              policyGrandTotal: 85500
                      - startDate: '2025-07-01'
                        endDate: '2025-12-31'
                        fieldModelV1Data:
                          policy:
                            policyStatus: active
                            annualPremium: 85000
                            fullTermPolicyInfo:
                              policyStatus: active
                              policyStartDate:
                                year: 2025
                                month: 1
                                day: 1
                                timezone: America/New_York
                              policyEndDate:
                                year: 2025
                                month: 12
                                day: 31
                                timezone: America/New_York
                              primaryInsuredId: 550e8400-e29b-41d4-a716-446655440010
                            fullTermPolicyBilling:
                              policyPremium: 85000
                              policyTaxes: 0
                              policyFees: 500
                              policyGrandTotal: 85500
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                noExistingVersion:
                  summary: Policy has no NEW_BUSINESS transaction
                  value:
                    error:
                      code: InvalidRequest
                      message: >-
                        Policy has no existing version — NEW_BUSINESS must be
                        created first
                dateOutsidePolicyPeriod:
                  summary: Reinstatement date outside policy term
                  value:
                    error:
                      code: InvalidRequest
                      message: >-
                        Reinstatement date 2026-03-01 falls outside policy
                        period [2025-01-01, 2025-12-31]
                policyNotCancelled:
                  summary: Policy is not Cancelled at reinstatement date
                  value:
                    error:
                      code: InvalidRequest
                      message: >-
                        Policy must be Cancelled at reinstatement date
                        2025-07-01 — current status is "active"
                invalidDeltaPath:
                  summary: fullTermDeltas path not targeting fullTermPolicyBilling
                  value:
                    error:
                      code: InvalidDelta
                      message: >-
                        Invalid fullTermDeltas path "policy.annualPremium" —
                        must target policy.fullTermPolicyBilling
                missingPremium:
                  summary: Reinstate transaction missing required premium
                  value:
                    error:
                      code: InvalidRequest
                      message: >-
                        Reinstate transaction must specify a premium
                        (policy.fullTermPolicyBilling.policyPremium)
                premiumMismatch:
                  summary: Reinstate premium does not match pre-cancel premium
                  value:
                    error:
                      code: InvalidRequest
                      message: >-
                        Reinstate premium (90000) must equal pre-cancel premium
                        (85000).
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Policy not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                policyNotFound:
                  summary: Policy does not exist
                  value:
                    error:
                      code: NOT_FOUND
                      message: Policy 550e8400-e29b-41d4-a716-446655440099 not found
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  parameters:
    companyId:
      name: companyId
      in: path
      required: true
      schema:
        type: string
        format: uuid
      description: Company identifier
    policyIdPath:
      name: policyId
      in: path
      required: true
      schema:
        type: string
        format: uuid
      description: Policy identifier
  schemas:
    PolicyTransactionVersionResponse:
      type: object
      description: >
        Response returned by policy transaction endpoints. Contains the policy
        version

        produced by the transaction, including all derived segments.
      required:
        - policyId
        - policyVersion
        - transactionId
        - startDate
        - endDate
        - createdAt
        - segments
      properties:
        policyId:
          type: string
          format: uuid
          description: Policy identifier
        policyVersion:
          type: integer
          description: Sequential version number produced by this transaction
        transactionId:
          type: string
          format: uuid
          description: Identifier of the transaction that produced this version
        startDate:
          type: string
          format: date
          description: Policy term start date (ISO 8601)
        endDate:
          type: string
          format: date
          description: Policy term end date (ISO 8601)
        createdAt:
          type: string
          format: date-time
          description: When the transaction was created (ISO 8601)
        fullTermPolicyInfo:
          type: object
          nullable: true
          description: >
            Full-term policy information. Contains policy status, term dates,
            and primary insured reference.
          additionalProperties: true
        fullTermPolicyBilling:
          type: object
          nullable: true
          description: >
            Full-term billing aggregates. Contains premium, taxes, fees, and
            grand total for the full policy term.
          additionalProperties: true
        segments:
          type: array
          description: >
            Derived segments for this policy version. Each segment represents a
            maximal contiguous

            date range where policy state is identical. Adjacent segments with
            identical data are

            automatically merged.
          items:
            $ref: '#/components/schemas/PolicyTransactionSegmentResponse'
    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
    PolicyTransactionSegmentResponse:
      type: object
      description: >
        A derived policy segment representing a date range where policy state is
        identical.

        Contains the full policy data (policy-level fields and nested exposures)
        for this period.
      required:
        - startDate
        - endDate
        - fieldModelV1Data
      properties:
        startDate:
          type: string
          format: date
          description: Segment start date (ISO 8601)
        endDate:
          type: string
          format: date
          description: Segment end date (ISO 8601)
        fieldModelV1Data:
          type: object
          description: >
            Policy state for this segment. Contains a `policy` key with
            policy-level fields

            and a nested `exposures` array.
          properties:
            policy:
              type: object
              description: Policy-level fields and nested exposures for this segment.
              additionalProperties: true
          additionalProperties: true
  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.

````