Resources
Envelopes
Send an envelope from a JSON file, check its status, find envelopes by status or topic, and cancel or delete them with the SignatureAPI CLI.
The envelopes commands send envelopes and follow them. Each one sends the same request as the matching API operation:
| Command | API operation |
|---|---|
envelopes create | Create an envelope |
envelopes get | Retrieve an envelope |
envelopes list | List envelopes |
envelopes cancel | Cancel an envelope |
envelopes delete | Delete an envelope |
They act in test mode unless you pass --mode live or use a live API key. See Working with resources for modes, credentials, and confirmation.
Send an envelope from a JSON file
Write a Create an envelope body to a file, such as the envelope.json in Request bodies, and pass it with --body:
npx signatureapi envelopes create --body envelope.jsonThe result shows the new envelope’s ID and its status, processing. Once SignatureAPI has prepared the documents, the envelope moves to in_progress and the recipients get their requests. In test mode, no email reaches them.
In live mode, the command asks for confirmation first, because it reaches real people. In a script, add --yes.
Build the body in a script
--body - reads the body from stdin, so a script can change a template body before it sends it. This one sets the title with jq:
jq '.title = "Service Agreement for Acme Corp"' envelope.json \
| npx signatureapi envelopes create --body -A command that reads stdin can’t prompt, so a live envelope sent this way needs --yes.
To keep the new envelope’s ID for the next commands, read it from the --json result:
id=$(npx signatureapi envelopes create --body envelope.json --json | jq -r 'select(.type == "result") | .data.id')Check an envelope’s status
npx signatureapi envelopes get eb4cf433-a8af-4161-b37b-7ef57d423e56The text output shows the status, mode, title, and creation time. The --json result carries the whole envelope object, with its documents and recipients. This prints each recipient’s ID and status:
npx signatureapi envelopes get eb4cf433-a8af-4161-b37b-7ef57d423e56 --json \
| jq -c 'select(.type == "result") | .data.recipients[] | {id, key, status}'A live envelope needs live mode: --mode live, or a live API key. To see how the envelope got to its status, list its events.
Find envelopes
envelopes list shows envelopes newest first, 20 per page. Filter by status or by topic:
# Completed test envelopes
npx signatureapi envelopes list --status completed
# Envelopes with a topic
npx signatureapi envelopes list --topic onboardingWhen there are more envelopes, the next step in the output is the exact command for the next page. To read every page from a script, see Pagination.
Cancel an envelope
Canceling stops an envelope in progress, so its recipients can no longer sign. --reason goes into the envelope.canceled event:
npx signatureapi envelopes cancel eb4cf433-a8af-4161-b37b-7ef57d423e56 --reason "Replaced by a new version"Canceling can’t be undone, so the command asks for confirmation in test and live mode. In a script, add --yes.
Delete an envelope
Deleting removes a completed, canceled, or failed envelope and its documents:
npx signatureapi envelopes delete eb4cf433-a8af-4161-b37b-7ef57d423e56 --yesIt can’t be undone, so it asks for confirmation in both modes. An envelope still in progress can’t be deleted: cancel it first.
Command reference
Generated from the help of the published signatureapi package.
envelopes list
List envelopes, newest first, up to 20 per page. Filter by status or topic, and pass --cursor to get the next page.
Usagenpx signatureapi envelopes list [options]
| Option | Description |
|---|---|
--status <status> | Only envelopes with this status, such as in_progress. |
--topic <topic> | Only envelopes with this topic. |
--limit <count> | Envelopes per page, 1 to 20 (default: 20). |
--cursor <cursor> | Cursor of the page to get, from a previous result's next_cursor. |
Global options: --mode, --api-key-var, --credential-store, --json.
# List test envelopes
npx signatureapi envelopes list
# List completed live envelopes as JSON
npx signatureapi envelopes list --status completed --mode live --jsonRelated: Envelope
envelopes get
Show an envelope with its documents and recipients. A live envelope needs live mode: --mode live, or a live API key.
Usagenpx signatureapi envelopes get <envelope-id> [options]
| Argument | Description |
|---|---|
<envelope-id> | ID of the envelope, as envelopes list shows it. Required. |
Global options: --mode, --api-key-var, --credential-store, --json.
# Show a test envelope
npx signatureapi envelopes get 5e5ace5e-...Related: Envelope
envelopes create
Create an envelope from a JSON body: the public Create an envelope request. In test mode, recipients get test-mode requests; live mode asks for confirmation first.
Usagenpx signatureapi envelopes create --body <path> [options]
| Option | Description |
|---|---|
--body <path> | JSON file with the envelope, or - to read it from stdin. Required. |
--yes | Confirm a live-mode change without the prompt (required in non-interactive shells). |
Global options: --mode, --api-key-var, --credential-store, --json.
# Create a test envelope from a file
npx signatureapi envelopes create --body envelope.json
# Create a live envelope from a script
npx signatureapi envelopes create --body - --mode live --yes < envelope.jsonRelated: Envelope
envelopes cancel
Cancel an envelope so its recipients can no longer sign. It cannot be undone. Asks for confirmation in test and live mode.
Usagenpx signatureapi envelopes cancel <envelope-id> [options]
| Argument | Description |
|---|---|
<envelope-id> | ID of the envelope, as envelopes list shows it. Required. |
| Option | Description |
|---|---|
--reason <text> | Reason sent in the envelope.canceled event. |
--yes | Confirm without the prompt (required in non-interactive shells). |
Global options: --mode, --api-key-var, --credential-store, --json.
# Cancel a test envelope
npx signatureapi envelopes cancel 5e5ace5e-...
# Cancel a live envelope from a script
npx signatureapi envelopes cancel 5e5ace5e-... --mode live --reason "Replaced by a new version" --yesRelated: Envelope
envelopes delete
Delete a completed, canceled or failed envelope and its documents. It cannot be undone. Asks for confirmation in test and live mode.
Usagenpx signatureapi envelopes delete <envelope-id> [options]
| Argument | Description |
|---|---|
<envelope-id> | ID of the envelope, as envelopes list shows it. Required. |
| Option | Description |
|---|---|
--yes | Confirm without the prompt (required in non-interactive shells). |
Global options: --mode, --api-key-var, --credential-store, --json.
# Delete a test envelope without the prompt
npx signatureapi envelopes delete 5e5ace5e-... --yesRelated: Envelope