> ## 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 a signature request for a policy



## OpenAPI

````yaml /openapi.json post /policies/{policyId}/signature
openapi: 3.0.0
info:
  title: Korint API
  description: >-
    Quoting, policy issuance, billing, claims, documents and compliance for
    insurance distribution.
  version: 1.0.0
  contact: {}
servers:
  - url: https://api.korint.io
    description: Production
  - url: https://api.sandbox.korint.io
    description: Sandbox
security:
  - oauth2: []
  - bearerAuth: []
tags: []
paths:
  /policies/{policyId}/signature:
    post:
      tags:
        - policy
      summary: Generate a signature request for a policy
      operationId: PolicyController_generatePolicySignatureRequest
      parameters:
        - name: tenant
          in: header
          required: true
          description: Your tenant identifier. Requests without it are rejected.
          schema:
            type: string
        - name: policyId
          required: true
          in: path
          description: the policy id
          schema:
            pattern: >-
              ^policy(_test)?_[346789ABCDEFGHJKLMNPQRTUVWXYabcdefghijkmnpqrtwxyz]{21}$
            type: string
        - name: whenAt
          required: false
          in: query
          description: 'Optional: the whenAt datetime'
          schema:
            type: string
            format: date-time
        - name: branchId
          required: false
          in: query
          description: 'Optional: the branchId'
          schema:
            pattern: >-
              ^branch(_test)?_[346789ABCDEFGHJKLMNPQRTUVWXYabcdefghijkmnpqrtwxyz]{21}$
            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:
                  value:
                    code: NO_SIGNED_DOCUMENTS_ON_PRODUCT
                    message: No signed documents configured on product {productId}
                    details: {}
                INVALID_EVENT_CREATION_DATE:
                  value:
                    code: INVALID_EVENT_CREATION_DATE
                    message: >-
                      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: {}
          description: ''
        '403':
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/ForbiddenErrorDto'
              examples:
                FORBIDDEN:
                  value:
                    code: FORBIDDEN
                    message: Forbidden
                    details: {}
          description: ''
        '404':
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/PolicyNotFoundErrorDto'
              examples:
                POLICY_NOT_FOUND:
                  value:
                    code: POLICY_NOT_FOUND
                    message: Policy {policyId} ({branchId}) not found
                    details: {}
          description: ''
        '409':
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/ConflictingBranchStatusErrorDto'
                  - $ref: '#/components/schemas/ConflictingBranchTypeErrorDto'
              examples:
                CONFLICTING_BRANCH_STATUS:
                  value:
                    code: CONFLICTING_BRANCH_STATUS
                    message: >-
                      Branch status {requirement} {branchStatus} to perform
                      {action}
                    details: {}
                CONFLICTING_BRANCH_TYPE:
                  value:
                    code: CONFLICTING_BRANCH_TYPE
                    message: Branch type {requirement} {branchType} to perform {action}
                    details: {}
          description: ''
        '425':
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: >-
                      #/components/schemas/NoUniqueDocumentTypeReadyToBeSignedErrorDto
                  - $ref: '#/components/schemas/NoDocumentReadyToBeSignedErrorDto'
              examples:
                NO_UNIQUE_DOCUMENT_TYPE_READY_TO_BE_SIGNED:
                  value:
                    code: NO_UNIQUE_DOCUMENT_TYPE_READY_TO_BE_SIGNED
                    message: >-
                      No unique {type} document ready to be signed for this
                      policy (found {documentNumber})
                    details: {}
                NO_DOCUMENT_READY_TO_BE_SIGNED:
                  value:
                    code: NO_DOCUMENT_READY_TO_BE_SIGNED
                    message: No document ready to be signed for this policy
                    details: {}
          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:
          pattern: >-
            ^signature(_test)?_[346789ABCDEFGHJKLMNPQRTUVWXYabcdefghijkmnpqrtwxyz]{21}$
          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:
          type: string
          format: date-time
        latestCreatedAt:
          type: string
          format: date-time
      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
        documentIds:
          description: >-
            Ids of the conflicting documents of this type (populated when more
            than one).
          type: array
          items:
            type: string
        documentNames:
          description: >-
            Names of the conflicting documents of this type, for support
            diagnosis.
          type: array
          items:
            type: string
      required:
        - type
        - documentNumber
    NoDocumentReadyToBeSignedDetailsDto:
      type: object
      properties: {}
    SignerDto:
      type: object
      properties:
        customerId:
          pattern: >-
            ^customer(_test)?_[346789ABCDEFGHJKLMNPQRTUVWXYabcdefghijkmnpqrtwxyz]{21}$
          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
        - 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
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: https://korint-tenant.auth.eu-west-3.amazoncognito.com/oauth2/token
          scopes:
            korint.io/account: Read account information
            korint.io/analytics: Access analytics endpoints
            korint.io/assets: Access asset endpoints
            korint.io/billing: Access billing endpoints
            korint.io/branches: Access branch endpoints
            korint.io/broker: Access broker endpoints
            korint.io/claims: Access claim endpoints
            korint.io/comments: Access comment endpoints
            korint.io/customers: Access customer endpoints
            korint.io/derogations: Access derogation endpoints
            korint.io/documents: Access document endpoints
            korint.io/external: Access external lookup endpoints
            korint.io/external-claims: Declare claims from an external system
            korint.io/internal-notes: Access internal note endpoints
            korint.io/invitations: Access invitation endpoints
            korint.io/payments: Access payment endpoints
            korint.io/permissions: Access permission management endpoints
            korint.io/policies: Access policy endpoints
            korint.io/quotes: Access quote endpoints
            korint.io/reportings: Access reporting endpoints
            korint.io/signature: Access signature endpoints
      description: >-
        Machine-to-machine clients use the OAuth 2.0 client credentials grant.
        Each tenant has its own authorization server: in the token URL below,
        replace `tenant` with your tenant identifier.
    bearerAuth:
      scheme: bearer
      bearerFormat: JWT
      type: http
      description: An access token obtained from your tenant authorization server.

````