Obtain an access token via OAuth (JWT grant or Authorization Code flow) and retrieve the user's base URI from the /oauth/userinfo endpoint.
POST to /restapi/v2.1/accounts/{accountId}/envelopes with envelopeDefinition: set status to 'sent', specify templateId, and populate templateRoles with name, email, and roleName for each signer.
Include any prefill tab values (text, checkbox, date) inside the templateRole's tabs object to pre-populate fields.
Inspect the response for the envelopeId; store it for status polling or webhook correlation.
Optionally POST to /envelopes/{envelopeId}/views/recipient to get an embedded signing URL if you need in-app signing rather than email delivery.
Known gotchas
The base URI differs per account and environment (demo vs production); always derive it from /oauth/userinfo rather than hardcoding.
Setting status to 'created' saves a draft; only 'sent' actually dispatches emails to recipients.
Template role names must exactly match the role names defined in the template or recipients will be silently skipped.
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp