---
title: "Envelopes"
description: "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."
canonical: "https://signatureapi.com/docs/cli/envelopes"
source: "https://signatureapi.com/docs/cli/envelopes.md"
last_verified_api_version: "1.18.1"
---

# 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.

_Last verified against API version 1.18.1._

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](https://signatureapi.com/docs/api/resources/envelopes/create) |
| `envelopes get`    | [Retrieve an envelope](https://signatureapi.com/docs/api/resources/envelopes/get)  |
| `envelopes list`   | [List envelopes](https://signatureapi.com/docs/api/resources/envelopes/list)       |
| `envelopes cancel` | [Cancel an envelope](https://signatureapi.com/docs/api/resources/envelopes/cancel) |
| `envelopes delete` | [Delete an envelope](https://signatureapi.com/docs/api/resources/envelopes/delete) |

They act in test mode unless you pass `--mode live` or use a live API key. See [Working with resources](https://signatureapi.com/docs/cli/working-with-resources) for modes, credentials, and confirmation.

## Send an envelope from a JSON file

Write a [Create an envelope](https://signatureapi.com/docs/api/resources/envelopes/create) body to a file, such as the `envelope.json` in [Request bodies](https://signatureapi.com/docs/cli/working-with-resources#request-bodies), and pass it with `--body`:

```bash
npx signatureapi envelopes create --body envelope.json
```

The 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`:

```bash
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:

```bash
id=$(npx signatureapi envelopes create --body envelope.json --json | jq -r 'select(.type == "result") | .data.id')
```

## Check an envelope's status

```bash
npx signatureapi envelopes get eb4cf433-a8af-4161-b37b-7ef57d423e56
```

The text output shows the status, mode, title, and creation time. The `--json` result carries the whole [envelope object](https://signatureapi.com/docs/api/resources/envelopes/object), with its documents and recipients. This prints each recipient's ID and status:

```bash
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](https://signatureapi.com/docs/cli/events).

## Find envelopes

`envelopes list` shows envelopes newest first, 20 per page. Filter by status or by [topic](https://signatureapi.com/docs/api/resources/envelopes/topics):

```bash
# Completed test envelopes
npx signatureapi envelopes list --status completed

# Envelopes with a topic
npx signatureapi envelopes list --topic onboarding
```

When 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](https://signatureapi.com/docs/cli/working-with-resources#pagination).

## Cancel an envelope

Canceling stops an envelope in progress, so its recipients can no longer sign. `--reason` goes into the `envelope.canceled` event:

```bash
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:

```bash
npx signatureapi envelopes delete eb4cf433-a8af-4161-b37b-7ef57d423e56 --yes
```

It 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.

Commands of the `signatureapi` CLI, version 0.7.1. Run `npx signatureapi <command> --help` for the same text in a terminal.

### `envelopes list`

List envelopes, newest first, up to 20 per page. Filter by status or topic, and pass --cursor to get the next page.

```bash
npx signatureapi envelopes list [options]
```

Options:

- `--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:

```bash
npx signatureapi envelopes list
```

List completed live envelopes as JSON:

```bash
npx signatureapi envelopes list --status completed --mode live --json
```

Related: https://signatureapi.com/docs/api/resources/envelopes/object

### `envelopes get`

Show an envelope with its documents and recipients. A live envelope needs live mode: --mode live, or a live API key.

```bash
npx signatureapi envelopes get <envelope-id> [options]
```

Arguments:

- `<envelope-id>`: ID of the envelope, as envelopes list shows it

Global options: `--mode`, `--api-key-var`, `--credential-store`, `--json`.

Show a test envelope:

```bash
npx signatureapi envelopes get 5e5ace5e-...
```

Related: https://signatureapi.com/docs/api/resources/envelopes/object

### `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.

```bash
npx signatureapi envelopes create --body <path> [options]
```

Options:

- `--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:

```bash
npx signatureapi envelopes create --body envelope.json
```

Create a live envelope from a script:

```bash
npx signatureapi envelopes create --body - --mode live --yes < envelope.json
```

Related: https://signatureapi.com/docs/api/resources/envelopes/object

### `envelopes cancel`

Cancel an envelope so its recipients can no longer sign. It cannot be undone. Asks for confirmation in test and live mode.

```bash
npx signatureapi envelopes cancel <envelope-id> [options]
```

Arguments:

- `<envelope-id>`: ID of the envelope, as envelopes list shows it

Options:

- `--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:

```bash
npx signatureapi envelopes cancel 5e5ace5e-...
```

Cancel a live envelope from a script:

```bash
npx signatureapi envelopes cancel 5e5ace5e-... --mode live --reason "Replaced by a new version" --yes
```

Related: https://signatureapi.com/docs/api/resources/envelopes/object

### `envelopes delete`

Delete a completed, canceled or failed envelope and its documents. It cannot be undone. Asks for confirmation in test and live mode.

```bash
npx signatureapi envelopes delete <envelope-id> [options]
```

Arguments:

- `<envelope-id>`: ID of the envelope, as envelopes list shows it

Options:

- `--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:

```bash
npx signatureapi envelopes delete 5e5ace5e-... --yes
```

Related: https://signatureapi.com/docs/api/resources/envelopes/object
