Sending Data to Webhooks

Learn how to send data from Portant to your own apps.

To send data from Portant to a Webhook, add the "Send events to Webhook" Workflow Block to your workflow.

By adding a "Send Webhook Events" block to your workflow you can capture events from your automations in Portant in your own app.

Webhook events are sent on a "per source item" basis. A source item is singular package of data from the workflow's source, for example in Google Sheets a single row is a single source item. For an automation that contains multiple source items Portant will send multiple webhook requests for each item.

Payload Schema

All webhook events sent from Portant will follow the same top level schema. The data payload will differ based on the type of event as specified by the event_type property.

FieldDescription

event_id

A unique id generated for this event

event_type

Specified what can be inspected in the data payload as specified below.

data

The data relating to this particular event. The schema will differ based on the eventType.

Schema Example

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

Types of Events

Currently Portant has four types of events that your app can be notified about via webhooks. These events are dependent on the configuration of you workflow. For example you must have an email block to receive "Emails Created" events. The types of events are as follows.

Documents Created

The automation has created new documents such as Google Docs or Google Slides files and/or PDFs.

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

Schema

FieldDescription

documents

An array of all the documents created for this source item.

documents.id

The Google Drive id for this file.

documents.url

The Google Drive url to this file.

documents.name

The name of the file as it is in the Google Drive.

documents.mimetype

The mimetype of the Google Drive file. See below

Mimetypes

MimetypeDescription

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"
      }
    ]
  },
  "eventId": "325d36e717d9ec0943a55857ae2d4988ce33fe4165330e4f",
  "eventType": "DOCUMENTS_CREATED"
}

Emails Created

The automation has created and sent emails.

Workflow Configuration The must workflow contain an email block (Gmail). This does not include signature requests.

Schema

FieldDescription

emails

An array of all the emails created for this source item.

emails.message_id

The Gmail message id.

emails.to

The comma separated string of addresses this email was sent to.

emails.subject

The subject of the email that was sent.

Example Payload

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

Signatures Requested

The automation has sent out signature requests.

Workflow Configuration The must workflow contain a signature request block.

Schema

FieldDescription

documents

An array of all the document created for this source item. The data within this payload is the same as the "Documents Created" event. (see above).

recipients

An array of recipients of signature requests within this workflow.

recipients.email

The email of this recipient.

recipients.order

The order in which this user will complete the signature requests

recipients.status

The current status of the signature request. This will always be "PENDING" for this event.

recipients.signature_url

The URL to the signature portal for the recipient to complete this signature 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"
      }
    ]
  },
  "eventId": "66de24a8c20fa439d47d92a683861f6852c2924632623377",
  "eventType": "SIGNATURES_REQUESTED"
}

Signatures Completed

All signature requests within this automation have been completed

Workflow Configuration The must workflow contain a signature request block.

Schema

The schema for this event is the same as the "Signatures Requested". The recipients.status field will be "COMPLETED" for all recipients.

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"
      }
    ]
  },
  "eventId": "72c32ca744baea46b4be710f052b14a9b73a29d77076e586",
  "eventType": "SIGNATURES_COMPLETED"
}

Last updated