Skip to main content

Track Document and Recipient Lifecycle with Subscriptions

Use GraphQL subscriptions to receive real-time lifecycle updates such as:

  • document creation
  • final PDF creation
  • document rejection
  • recipient email sent
  • recipient visiting
  • recipient completion
  • recipient rejection
  • recipient email opened

For the general payload contract, see:

Feeds and Categories

Lifecycle events are typically delivered on:

  • subscribeGroupFeed

Some lifecycle events may also be fanned out to:

  • subscribeUserFeed

Categories:

  • documentLifecycle
  • recipientLifecycle

Event Names

Document lifecycle

  • documentCreated
  • documentFinalPdfCreated
  • documentRejected

Recipient lifecycle

  • recipientSentEmail
  • recipientVisiting
  • recipientCompleted
  • recipientRejected
  • recipientEmailOpened

Payload Shapes

Document lifecycle

{
"version": "1.0",
"eventId": "evt...",
"timestamp": "2026-04-24T10:38:36.822Z",
"level": "INFO",
"event": "documentCreated",
"category": "documentLifecycle",
"groupId": "grp...",
"userId": "usr...",
"requestId": null,
"batchId": null,
"error": null,
"data": {
"id": "doc...",
"documentName": "Example document"
}
}

Recipient lifecycle

{
"version": "1.0",
"eventId": "evt...",
"timestamp": "2026-04-24T10:38:36.822Z",
"level": "INFO",
"event": "recipientVisiting",
"category": "recipientLifecycle",
"groupId": "grp...",
"userId": "usr...",
"requestId": null,
"batchId": null,
"error": null,
"data": {
"id": "rec...",
"documentId": "doc...",
"documentName": "Example document",
"firstName": "Ada",
"lastName": "Lovelace"
}
}

Subscription Operation

subscription SubscribeGroupFeed($groupId: String!) {
subscribeGroupFeed(groupId: $groupId) {
groupId
data
}
}

JavaScript Example

const parseEnvelope = (payload) => {
const raw = payload?.data;
if (!raw) return null;
return typeof raw === 'string' ? JSON.parse(raw) : raw;
};

const handleGroupFeed = ({ data }) => {
const wrapper = data?.subscribeGroupFeed;
const event = parseEnvelope(wrapper);

if (event?.category === 'documentLifecycle') {
switch (event.event) {
case 'documentCreated':
case 'documentFinalPdfCreated':
case 'documentRejected':
console.log('document lifecycle event', event.event, event.data.id);
break;
default:
break;
}
}

if (event?.category === 'recipientLifecycle') {
switch (event.event) {
case 'recipientSentEmail':
case 'recipientVisiting':
case 'recipientCompleted':
case 'recipientRejected':
case 'recipientEmailOpened':
console.log('recipient lifecycle event', event.event, event.data.id);
break;
default:
break;
}
}
};

When to Use This

This is useful when you want to:

  • update a document list or activity feed in real time
  • show recipient engagement events without polling
  • react immediately when a final PDF is ready
  • drive workflow notifications in a dashboard