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
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
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:
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.
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.
uuid
UUID
Created envelope UUID
Step 5 Manage metadata
Update metadata
Use this endpoint to add or change metadata.
PUT
/api/v1/envelope/{id}/metadata
Use these headers:
Authorization
Yes
Bearer authorization token
Content-Type
Yes
Use application/json
Mailbox
Yes
Current mailbox UUID
Path parameters:
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:
Continue processing
Use the envelope UUID to check the envelope status, process callbacks, or download the completed archive.
Keep document values in fields and external references in metadata.
Include the
AuthorizationheaderUse the sender mailbox UUID in
MailboxConfirm token access to the sender mailbox
Send valid envelope XML in
dataSend a valid JSON object in
metadataUse keys that are 1–32 characters long
Use values that are 0–128 characters long
Use supported metadata value types
Do not include secrets or large data blocks
Add
<metadata show="true" />to display metadata
Last updated
Was this helpful?
