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

Send your first envelope

This document explains how to send, track, and download your first envelope with DocStudio API.

Use the envelope UUID to retrieve the envelope, check its status, and download completed documents. For full contracts, response schemas, and status codes, use the linked API reference pages.

Before you start

Prepare the identifiers used by the template and envelope flow. Do not create role IDs, document IDs, or field names manually. Reuse values from the template structure.

You need:

  • API token

  • sender and recipient mailbox UUIDs

  • existing template with its UUID and version

  • role IDs, document IDs, and field names from the template

Read:

A basic envelope sending flow usually looks like this:

  1. Get or create an API token.

  2. Choose the template that will be used to create the envelope.

  3. Read reusable identifiers from the template structure.

  4. Find or prepare mailbox UUIDs for recipients.

  5. Build the envelope XML.

  6. Send the envelope.

  7. Save the returned envelope UUID.

  8. Download the completed envelope archive if needed.

Step 1 Authenticate the request

DocStudio API requests require a token in the Authorization header. Use an application token for long-running integrations and a temporary authorization token only for testing or short-lived user sessions.

Use the same token format in the send request and in follow-up requests, such as retrieving the envelope by UUID.

Step 2 Build the envelope XML

The envelope is sent as XML inside the JSON data field. The XML must reference the template UUID and template version, assign mailbox UUIDs to template roles, and send field values under the correct document IDs and field names.

Escape reserved XML characters before putting the XML into the JSON request body. The data value must be a string, so line breaks and quotes must be valid for JSON.

Step 3 Send the envelope

Use this endpoint to create and send the envelope.

Method
Endpoint

POST

/api/v1/envelope/send

Headers

Header
Required
Description

Authorization

Yes

Bearer authorization token

Content-Type

Yes

Use application/json

Mailbox

Yes

Sender mailbox UUID used as the mailbox context

Request body:

Request body fields

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 added to the envelope

Add metadata only when the envelope requires custom key-value data.

Response 201 Created:

Save the returned uuid. This is the envelope UUID used for follow-up requests, including retrieving the envelope, checking status, downloading documents, and reading audit trail data.

Step 4 Retrieve the envelope

Use the returned envelope UUID to retrieve the envelope and check its current status. Send the request in the context of the mailbox that was used to send the envelope.

Method
Endpoint

GET

/api/v1/mailbox/{mailboxUuid}?UUID={envelopeUuid}

Headers

Header
Required
Description

Authorization

Yes

Bearer authorization token

Content-Type

Yes

Use application/json

mailboxUuid

Yes

UUID of the current mailbox

Path parameters

Parameter
Type
Required
Description

mailboxUuid

UUID

Yes

UUID of the mailbox used to access the envelope

Query parameters

Parameter
Type
Required
Description

UUID

UUID

Yes

UUID of the envelope returned by the send request

Request example

The endpoint returns 200 OK with the matching envelope data. Check the status field before attempting to download the completed envelope documents.

Step 5 Download the completed archive

After the envelope is complete, download the archive if you need the final documents. Use the envelope UUID with the download endpoint.

Troubleshoot the first send request

If validation fails, check the template and mailbox first, then:

  • Confirm the token can access the sender mailbox.

  • Confirm that template UUID, version, role IDs, document IDs, and field names match.

  • Confirm that XML is valid and field values follow template rules.

Last updated

Was this helpful?