Skip to content

POLICY_DOC_GENERATED

This event is fired after a policy document generation process completes successfully.

When and what fires this event?

If this event is defined on a product, and it has actions that are enabled:

  • API: can fire this event externally on demand.

Request payload

POST: https://api.{ENV}.dais.com/ioi/v3/event/fire

curl --location --request POST 'https://api.{ENV}.dais.com/ioi/v3/event/fire' --header 'Authorization: Basic <yourAuthHere>' --header 'Content-Type: application/json' --data-raw '{
  "lineId": "<UUID of the product>",
  "type": "POLICY_DOC_GENERATED",
  "payload": {
    "clientId": "<UUID of the client>",
    "policyId": "<UUID of the policy>",
    "documents": [
      {
        "name": "PolicyDeclarations.pdf",
        "extension": "pdf",
        "contentId": "<CMS-CONTENT-ID>",
        "url": "https://public.cdn/<...>"
      },
      {
        "name": "CertificateOfInsurance.pdf",
        "extension": "pdf",
        "contentId": "<CMS-CONTENT-ID>",
        "url": null
      }
    ]
  }
}'
{
  "lineId": "262e67be-c08c-43c0-bb51-06fe4408b4e9",
  "type": "POLICY_DOC_GENERATED",
  "payload": {
    "clientId": "220c4020-7f20-4a16-ba51-d0945804dd83",
    "policyId": "b31e1d1e-31e0-4d9a-9a86-7f9d0a1a2b33",
    "documents": [
      {
        "name": "PolicyDeclarations.pdf",
        "extension": "pdf",
        "contentId": "CMS-12345",
        "url": "https://public.cdn/documents/policy/12345"
      }
    ]
  }
}

Request fields

PropertyRequiredDescription
lineIdtrueUUID for the product.
typetrueMust be POLICY_DOC_GENERATED.
payloadtrueSee below.

Payload fields

PropertyRequiredDescription
policyIdtrueThe target policy for which documents were generated.
clientIdtrueThe client associated with the policy.
documents[]trueList of document objects that were generated.
documents[].nametrueFile name of the generated document.
documents[].extensiontrueFile extension (e.g., pdf, docx).
documents[].contentIdtrueIdentifier of the document stored in CMS.
documents[].urlfalsePublic or internal URL to the stored file.

Response json

A standard trigger response is returned.

{
  "triggerRequestId": "<UUID>",
  "executedActionCount": 0,
  "expectedResponseCount": 0,
  "metadata": {
    "POLICY_DOC_GENERATED": {
      "policyId": "b31e1d1e-31e0-4d9a-9a86-7f9d0a1a2b33",
      "clientId": "220c4020-7f20-4a16-ba51-d0945804dd83",
      "documents": [
        {
          "name": "PolicyDeclarations.pdf",
          "extension": "pdf",
          "contentId": "CMS-12345",
          "url": "https://public.cdn/documents/policy/12345"
        }
      ]
    }
  }
}

Response fields

PropertyRequiredDescription
triggerRequestIdtrueUUID that identifies the execution of the trigger.
executedActionCounttrueNumber of workflow actions executed for this trigger.
expectedResponseCounttrueNumber of responses expected from executed actions.
metadatatrueContains dynamically generated data from payment setup actions.