Portant Portant Docs

Listen to events from Portant via webhooks

Have Portant POST events to your own server when an automation runs. Add the Send Webhook Events block to your workflow and Portant will fire a request for every source item processed.

Events are sent per source item. A source item is a single unit of source data (for example, one row in Google Sheets). If an automation runs over multiple source items, Portant sends one webhook per item.

Payload schema

Every event Portant sends shares the same top-level shape. The contents of data change based on event_type.

Field Description
event_id A unique ID generated for this event.
event_type The type of event. Determines what's in data (see the event types below).
data The event payload. Schema varies by event_type.

Schema example

{
  "data": {
    ... // Determined by the type of event
  },
  "event_id": "325d36e717d9ec0943a55857ae2d4988ce33fe4165330e4f",
  "event_type": "<EVENT_TYPE>"
}

Types of events

Portant currently sends four event types. Which ones you receive depends on your workflow: for example, you only get EMAILS_CREATED if your workflow includes an email block.

Documents created

The automation created new documents (Google Docs, Google Slides, or PDFs).

Workflow configuration

The workflow must contain a template block (Google Docs or Google Slides).

Schema

Field Description
documents An array of all documents created for this source item.
documents.id The Google Drive ID for the file.
documents.url The Google Drive URL for the file.
documents.name The file name as it appears in Google Drive.
documents.mimetype The MIME type of the file (see below).

MIME types

Mimetype Description
application/vnd.google-apps.document Google Docs file
application/vnd.google-apps.presentation Google Slides file
application/pdf PDF document

Example payload

{
  "data": {
    "documents": [
      {
        "id": "12XXXXX..................",
        "url": "https://docs.google.com/document/d/12XXXXX................../edit?usp=drivesdk",
        "name": "Invoice #1200",
        "mimetype": "application/vnd.google-apps.document"
      },
      {
        "id": "13XXXXX..................",
        "url": "https://drive.google.com/file/d/13XXXXX................../view?usp=drivesdk",
        "name": "Invoice #1200",
        "mimetype": "application/pdf"
      }
    ]
  },
  "event_id": "325d36e717d9ec0943a55857ae2d4988ce33fe4165330e4f",
  "event_type": "DOCUMENTS_CREATED"
}

Emails created

The automation created and sent emails. This event doesn't fire for signature requests.

Workflow configuration

The workflow must contain an email block (Gmail).

Schema

Field Description
emails An array of all emails created for this source item.
emails.message_id The Gmail message ID.
emails.to A comma-separated string of recipient addresses.
emails.subject The email subject line.

Example payload

{
  "data": {
    "emails": [
      {
        "to": "contact@portant.co",
        "subject": "Hello World",
        "message_id": "18xxxx........."
      }
    ]
  },
  "event_id": "eac17961e3edcfafcc064015131e8a518c9f375005b8cec2",
  "event_type": "EMAILS_CREATED"
}

Signatures requested

The automation sent signature requests.

Workflow configuration

The workflow must contain a signature request block.

Schema

Field Description
documents An array of documents created for this source item. Same shape as the Documents created event.
recipients An array of signature request recipients in the workflow.
recipients.email The recipient's email.
recipients.order The order in which this recipient signs.
recipients.status The current status. Always "PENDING" for this event.
recipients.signature_url The URL to the signature portal where the recipient can complete the request.

Example payload

{
  "data": {
    "documents": [
      {
        "id": "10XXXXX.................",
        "url": "https://drive.google.com/file/d/10XXXXX................./view?usp=drivesdk",
        "name": "Employment Contact",
        "mimetype": "application/pdf"
      }
    ],
    "recipients": [
      {
        "email": "bwlockley@gmail.com",
        "order": 1,
        "status": "PENDING",
        "signature_url": "https://sign.portant.co/xxxxxxxxxxxxx"
      }
    ]
  },
  "event_id": "66de24a8c20fa439d47d92a683861f6852c2924632623377",
  "event_type": "SIGNATURES_REQUESTED"
}

Signatures completed

Every signature request in the automation has been completed.

Workflow configuration

The workflow must contain a signature request block.

Schema

Same as the Signatures requested event. The recipients.status field is "COMPLETED" for every recipient.

Example payload

{
  "data": {
    "documents": [
      {
        "id": "10XXXXX.................",
        "url": "https://drive.google.com/file/d/10XXXXX......../view?usp=drivesdk",
        "name": "Employment Contact",
        "mimetype": "application/pdf"
      }
    ],
    "recipients": [
      {
        "email": "bwlockley@gmail.com",
        "order": 1,
        "status": "COMPLETED",
        "signatureUrl": "https://sign.portant.co/xxxxxxxxxxxxx"
      }
    ]
  },
  "event_id": "72c32ca744baea46b4be710f052b14a9b73a29d77076e586",
  "event_type": "SIGNATURES_COMPLETED"
}