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

# Generate signature request for a policy.



## OpenAPI

````yaml /openapi.json post /policies/{policyId}/signature
openapi: 3.0.0
info:
  title: Korint Documentation
  description: Korint API Documentation
  version: 1.0.0
  contact: {}
servers: []
security:
  - bearerAuth: []
tags: []
paths:
  /policies/{policyId}/signature:
    post:
      tags:
        - policy
      summary: Generate signature request for a policy.
      operationId: PolicyController_generatePolicySignatureRequest
      parameters:
        - name: policyId
          required: true
          in: path
          description: the policy id
          schema:
            type: string
        - name: whenAt
          required: false
          in: query
          description: 'Optional: the whenAt datetime'
          schema:
            type: string
        - name: branchId
          required: false
          in: query
          description: 'Optional: the branchId'
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GeneratePolicySignatureRequestInputBody'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GeneratePolicySignatureRequestOutput'
        '400':
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/NoSignedDocumentsOnProductErrorDto'
                  - $ref: '#/components/schemas/InvalidEventCreationDateErrorDto'
              examples:
                NO_SIGNED_DOCUMENTS_ON_PRODUCT:
                  $ref: '#/components/schemas/NoSignedDocumentsOnProductErrorDto'
                INVALID_EVENT_CREATION_DATE:
                  $ref: '#/components/schemas/InvalidEventCreationDateErrorDto'
          description: ''
        '403':
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/ForbiddenErrorDto'
              examples:
                FORBIDDEN:
                  $ref: '#/components/schemas/ForbiddenErrorDto'
          description: ''
        '404':
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/PolicyNotFoundErrorDto'
              examples:
                POLICY_NOT_FOUND:
                  $ref: '#/components/schemas/PolicyNotFoundErrorDto'
          description: ''
        '409':
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/ConflictingBranchStatusErrorDto'
                  - $ref: '#/components/schemas/ConflictingBranchTypeErrorDto'
              examples:
                CONFLICTING_BRANCH_STATUS:
                  $ref: '#/components/schemas/ConflictingBranchStatusErrorDto'
                CONFLICTING_BRANCH_TYPE:
                  $ref: '#/components/schemas/ConflictingBranchTypeErrorDto'
          description: ''
        '425':
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: >-
                      #/components/schemas/NoUniqueDocumentTypeReadyToBeSignedErrorDto
                  - $ref: '#/components/schemas/NoDocumentReadyToBeSignedErrorDto'
              examples:
                NO_UNIQUE_DOCUMENT_TYPE_READY_TO_BE_SIGNED:
                  $ref: >-
                    #/components/schemas/NoUniqueDocumentTypeReadyToBeSignedErrorDto
                NO_DOCUMENT_READY_TO_BE_SIGNED:
                  $ref: '#/components/schemas/NoDocumentReadyToBeSignedErrorDto'
          description: ''
components:
  schemas:
    GeneratePolicySignatureRequestInputBody:
      type: object
      properties:
        deliveryMode:
          type: string
          description: the delivery mode
          enum:
            - EMAIL
            - URL
        neededForPolicySigned:
          type: boolean
          description: >-
            Do we want to sign the documents needed for the policy to be signed?
            If yes, it signs all those documents at the same time.
          default: true
        isOtp:
          type: boolean
          description: if the signature request is an otp one or not
        phoneNumber:
          type: string
          description: the phone number
      required:
        - deliveryMode
    GeneratePolicySignatureRequestOutput:
      type: object
      properties:
        signatures:
          description: the signature requests
          type: array
          items:
            $ref: '#/components/schemas/SignatureRequestOutput'
      required:
        - signatures
    NoSignedDocumentsOnProductErrorDto:
      type: object
      properties:
        code:
          type: string
          enum:
            - NO_SIGNED_DOCUMENTS_ON_PRODUCT
        message:
          type: string
          example: No signed documents configured on product {productId}
        details:
          $ref: '#/components/schemas/NoSignedDocumentsOnProductDetailsDto'
      required:
        - code
        - message
        - details
    InvalidEventCreationDateErrorDto:
      type: object
      properties:
        code:
          type: string
          enum:
            - INVALID_EVENT_CREATION_DATE
        message:
          type: string
          example: >-
            You are trying to push an event that is created on {createdAt}, but
            the creation date should be after the latest event which was created
            on {latestCreatedAt}
        details:
          $ref: '#/components/schemas/InvalidEventCreationDateDetailsDto'
      required:
        - code
        - message
        - details
    ForbiddenErrorDto:
      type: object
      properties:
        code:
          type: string
          enum:
            - FORBIDDEN
        message:
          type: string
          example: Forbidden
        details:
          $ref: '#/components/schemas/ForbiddenDetailsDto'
      required:
        - code
        - message
        - details
    PolicyNotFoundErrorDto:
      type: object
      properties:
        code:
          type: string
          enum:
            - POLICY_NOT_FOUND
        message:
          type: string
          example: Policy {policyId} ({branchId}) not found
        details:
          $ref: '#/components/schemas/PolicyNotFoundDetailsDto'
      required:
        - code
        - message
        - details
    ConflictingBranchStatusErrorDto:
      type: object
      properties:
        code:
          type: string
          enum:
            - CONFLICTING_BRANCH_STATUS
        message:
          type: string
          example: Branch status {requirement} {branchStatus} to perform {action}
        details:
          $ref: '#/components/schemas/ConflictingBranchStatusDetailsDto'
      required:
        - code
        - message
        - details
    ConflictingBranchTypeErrorDto:
      type: object
      properties:
        code:
          type: string
          enum:
            - CONFLICTING_BRANCH_TYPE
        message:
          type: string
          example: Branch type {requirement} {branchType} to perform {action}
        details:
          $ref: '#/components/schemas/ConflictingBranchTypeDetailsDto'
      required:
        - code
        - message
        - details
    NoUniqueDocumentTypeReadyToBeSignedErrorDto:
      type: object
      properties:
        code:
          type: string
          enum:
            - NO_UNIQUE_DOCUMENT_TYPE_READY_TO_BE_SIGNED
        message:
          type: string
          example: >-
            No unique {type} document ready to be signed for this policy (found
            {documentNumber})
        details:
          $ref: '#/components/schemas/NoUniqueDocumentReadyTypeToBeSignedDetailsDto'
      required:
        - code
        - message
        - details
    NoDocumentReadyToBeSignedErrorDto:
      type: object
      properties:
        code:
          type: string
          enum:
            - NO_DOCUMENT_READY_TO_BE_SIGNED
        message:
          type: string
          example: No document ready to be signed for this policy
        details:
          $ref: '#/components/schemas/NoDocumentReadyToBeSignedDetailsDto'
      required:
        - code
        - message
        - details
    SignatureRequestOutput:
      type: object
      properties:
        id:
          type: string
          description: the signature id
        signers:
          description: the signers
          type: array
          items:
            $ref: '#/components/schemas/SignerDto'
      required:
        - id
        - signers
    NoSignedDocumentsOnProductDetailsDto:
      type: object
      properties:
        productId:
          type: string
      required:
        - productId
    InvalidEventCreationDateDetailsDto:
      type: object
      properties:
        createdAt:
          format: date-time
          type: string
        latestCreatedAt:
          format: date-time
          type: string
      required:
        - createdAt
        - latestCreatedAt
    ForbiddenDetailsDto:
      type: object
      properties:
        message:
          type: string
        documentKey:
          type: string
        userId:
          type: string
        ownerId:
          type: string
      required:
        - message
        - documentKey
        - userId
        - ownerId
    PolicyNotFoundDetailsDto:
      type: object
      properties:
        policyId:
          type: string
        branchId:
          type: string
        whenAt:
          type: string
        simulatedAt:
          type: string
      required:
        - policyId
    ConflictingBranchStatusDetailsDto:
      type: object
      properties:
        branchStatus:
          allOf:
            - $ref: '#/components/schemas/BranchStatus'
        requirement:
          allOf:
            - $ref: '#/components/schemas/OperationRequirement'
        action:
          allOf:
            - $ref: '#/components/schemas/Action'
      required:
        - branchStatus
        - requirement
        - action
    ConflictingBranchTypeDetailsDto:
      type: object
      properties:
        branchType:
          allOf:
            - $ref: '#/components/schemas/BranchType'
        requirement:
          allOf:
            - $ref: '#/components/schemas/OperationRequirement'
        action:
          allOf:
            - $ref: '#/components/schemas/Action'
      required:
        - branchType
        - requirement
        - action
    NoUniqueDocumentReadyTypeToBeSignedDetailsDto:
      type: object
      properties:
        type:
          type: string
        documentNumber:
          type: number
      required:
        - type
        - documentNumber
    NoDocumentReadyToBeSignedDetailsDto:
      type: object
      properties: {}
    SignerDto:
      type: object
      properties:
        customerId:
          type: string
          description: Customer Id
        url:
          type: string
          description: Signature url
      required:
        - customerId
        - url
    BranchStatus:
      type: string
      enum:
        - BRANCH_OPEN
        - BRANCH_MERGED
        - BRANCH_CLOSED
    OperationRequirement:
      type: string
      enum:
        - must be
        - must NOT be
        - must contain
        - must NOT contain
    Action:
      type: string
      enum:
        - PERFORM THIS ACTION
        - CREATE POLICY
        - CREATE ASSET
        - CREATE ASSET WITH START DATE
        - REPLACE ASSET
        - REMOVE ASSET
        - CHOOSE ASSET OPTIONS
        - STOP ASSET
        - EDIT ASSET
        - EDIT ASSET WITH START DATE
        - CREATE BRANCH
        - CREATE DEROGATION
        - CREATE MTA BRANCH
        - FORK TO NEW MTA BRANCH
        - FORK TO NEW NB BRANCH
        - FORK TO NEW RENEWAL BRANCH
        - FORK TO NEW REPRICING BRANCH
        - DEFINE PARENT POLICY ID
        - INITIALIZE CUSTOMER
        - EDIT CUSTOMER
        - DELETE CUSTOMER FROM POLICY
        - DECLARE CLAIMS HISTORY
        - SIGN
        - EDIT POLICY
        - EDIT POLICY EXTERNAL ID
        - CONFIRM POLICY
        - QUOTE POLICY
        - RETRIEVING QUOTE
        - STOP POLICY
        - SUSPEND POLICY
        - ACTIVATE POLICY
        - GENERATE MANDATE SIGNATURE REQUEST
        - GENERATE PAYMENT METHOD SECRET
        - CREATE CLAIM
        - FINALIZE RENEWAL
        - SEND CONTRACT TO SIGNATURE
        - GENERATE SIGNATURE REQUEST
        - GENERATE DOCUMENTS FOR SIGNATURE
        - APPROVE DISTRIBUTION REQUEST
        - DENY DISTRIBUTION REQUEST
        - REVOKED_DISTRIBUTION_REQUEST
        - DELETE DISTRIBUTION REQUEST
        - WAITING FOR SIGNATURE DISTRIBUTION REQUEST
        - UPDATE POLICY QUOTE
    BranchType:
      type: string
      enum:
        - BASE
        - NEW_BUSINESS
        - MTA
        - RENEWAL
        - REPRICING

````