For the complete documentation index, see llms.txt. This page is also available as Markdown.

Send Envelope with Metadata

This document explains how to store and use envelope metadata through the API.

Scenario

Send an envelope from a template and attach metadata for an external process.

Step 1 Prepare template and metadata values

Method
Endpoint

POST

/api/v1/envelope/send

Prepare the template values and metadata before building the request.

You need:

  • API token

  • sender mailbox UUID

  • template UUID

  • template version UUID

  • role IDs from the template flow

  • recipient mailbox UUIDs

  • document IDs from the template

  • field names from the template

  • metadata keys and values

Metadata rules

Rule
Value

Key length

1–32 characters

Value length

0–128 characters

Supported value types

string, boolean, null

{
  "customerId": "C-1024",
  "crmRecordId": "CRM-77551",
  "source": "crm",
  "priority": true,
  "externalReference": null
}

Step 2 Build envelope XML

Build the envelope XML with template, role, document, and field values.

Pass metadata in the metadata JSON object. Do not add it to the XML.

Step 3 Send the request

Use these headers:

Header
Required
Description

Authorization

Yes

Bearer authorization token

Content-Type

Yes

Use application/json

Mailbox

Yes

Sender mailbox UUID

Send the envelope XML in data and metadata in metadata.

Field
Type
Required
Description

uuid

UUID

No

Envelope UUID when the flow already has an envelope identifier

data

string

Yes

Envelope XML string

metadata

object

No

Custom key-value metadata

Request example

Step 4 Save the envelope UUID

The endpoint returns 201 Created. Save the envelope UUID.

Field
Type
Description

uuid

UUID

Created envelope UUID

Step 5 Manage metadata

Update metadata

Use this endpoint to add or change metadata.

Method
Endpoint

PUT

/api/v1/envelope/{id}/metadata

Use these headers:

Header
Required
Description

Authorization

Yes

Bearer authorization token

Content-Type

Yes

Use application/json

Mailbox

Yes

Current mailbox UUID

Path parameters:

Parameter
Type
Required
Description

id

UUID

Yes

Envelope ID

The request adds new keys and overwrites existing values. The endpoint returns 200 OK.

Read metadata

Read envelope.metadata.

Display metadata

Add this element to the template info section:

Display metadata only when the template includes this element and metadata has a value.

Continue processing

Use the envelope UUID to check the envelope status, process callbacks, or download the completed archive.

Last updated

Was this helpful?