Skip to main content

Envelopes

Envelopes are the core resource in Loyva. An envelope represents a document sent for electronic signature.

All partner envelope endpoints are mounted under /api/v2/partner/* and authenticated with X-API-Key: lk_.... Every successful response is wrapped in { "data": ... }. List responses include a meta page object.

Envelope lifecycle

pending → uploaded/preparing → sent → viewed → completed → vaulted
↘ declined
↘ voided
↘ expired
StatusDescription
pendingCreated but not yet prepared
uploaded / preparingUpload or wizard in progress
sentSent to signers, awaiting action
viewedAt least one signer has opened the document
completedAll signers have signed; vault pipeline may still be running
vaultedAuthoritative copy stored + compliance certificate generated
declined / voided / expiredTerminal non-success states

List envelopes

GET /partner/envelopes

Required scope: envelopes:read

Query parameters: page, limit (max 100), customer_id, status (any lifecycle value).

Response:

{
"data": [
{
"envelope_id": "env_x7k9m2p4q1w3",
"envelope_name": "Q1 Sales Agreement",
"status": "completed",
"customer_id": "cust_abc123",
"external_id": "ext_order_4521",
"created_at": "2026-04-01T10:00:00.000Z",
"updated_at": "2026-04-05T14:30:00.000Z"
}
],
"meta": { "page": 1, "limit": 20, "total": 42 }
}

Get envelope

GET /partner/envelopes/:id

Required scope: envelopes:read

Metadata is filtered to a partner-safe subset.

{
"data": {
"envelope_id": "env_x7k9m2p4q1w3",
"envelope_name": "Q1 Sales Agreement",
"status": "vaulted",
"customer_id": "cust_abc123",
"external_id": "ext_order_4521",
"template_id": "tmpl_lease_v2",
"created_at": "2026-04-01T10:00:00.000Z",
"updated_at": "2026-04-11T10:16:10.000Z",
"vaulted": true,
"compliant": true,
"metadata": { /* partner-safe subset */ }
}
}

Get status

GET /partner/envelopes/:id/status

Required scope: envelopes:read

Lightweight status + vault summary — use this for polling.

{
"data": {
"envelope_id": "env_x7k9m2p4q1w3",
"status": "vaulted",
"vaulted": true,
"compliant": true,
"signed_at": "2026-04-11T10:14:55.000Z",
"updated_at": "2026-04-11T10:16:10.000Z"
}
}

The compliant flag reflects whether a certificate has been generated. Call GET /partner/envelopes/:id/compliance for the full 8-check result.


Create envelope

POST /partner/envelopes

Required scope: envelopes:write

Partners identify the customer by email + name. Loyva provisions the customer on the fly if needed.

FieldTypeRequiredDescription
envelope_namestringYesDisplay name
customer_emailstringYesCustomer email
customer_namestringYesCustomer display name
template_idstringNoTemplate to use
external_idstringNoYour system's reference ID
prefilled_dataobjectNoTemplate field pre-fill
secured_partyobjectNo{ name, role?, address?, email?, identifier? } — populate for UCC Check 8

Response: 201 Created with { "data": { "envelope_id": "...", ... } }. Also fires the envelope.created webhook.


GET /partner/envelopes/:id/signing-links

Required scope: envelopes:read

Returns one short-lived embed URL per signer. Use these to redirect the signer to the Loyva signing page, or email the URLs to recipients.

{
"data": {
"signers": [
{
"email": "[email protected]",
"name": "John Smith",
"slug": "abc123",
"embed_url": "https://embed.stg.loyva.net/sign/env_x7k9m2p4q1w3",
"status": "pending"
}
]
}
}