---
title: "Add document to envelope"
method: POST
path: "/v1/accounts/{accountId}/envelopes/{envelopeId}/documents"
tags: ["Envelopes"]
---

# Add document to envelope

`POST /v1/accounts/{accountId}/envelopes/{envelopeId}/documents`

## Request

- Base URL: `https://api.assinafy.com.br`
- URL: `https://api.assinafy.com.br/v1/accounts/{accountId}/envelopes/{envelopeId}/documents`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-Api-Key`

Add a document to an open envelope for some of its signers. The document is checked as on creation: a `metadata_ready` document of the workspace with no assignment, signed on its virtual page or, with `collect`, on the fields placed in `entries`, with its own `expires_at` and `copy_receiver_ids`. An envelope holds up to 20 documents. It charges only its digital-certificate signatures, the envelope having paid for its document and its signers' notifications and identity checks when it was sent, and goes last in the envelope's order; a signer whose identity check the envelope approved is verified on it too. Each chosen signer is sent the envelope's invitation again, through the methods and with the link of their first invitation, now listing the new document, even once the document that invitation was sent from is taken out; the other signers hear nothing. The signers are the envelope's own: no one new joins once it was sent. Needs the Envelopes feature on the workspace's plan, as creating does. A refused request creates and charges nothing; `errors` names every field at fault.

[Copy as Markdown](https://api.assinafy.com.br/v1/docs/markdown?method=post&path=%2Fv1%2Faccounts%2F%7BaccountId%7D%2Fenvelopes%2F%7BenvelopeId%7D%2Fdocuments) [Open in ChatGPT](https://chatgpt.com/?q=Read%20the%20API%20documentation%20at%20https%3A%2F%2Fapi.assinafy.com.br%2Fv1%2Fdocs%2Fmarkdown%3Fmethod%3Dpost%26path%3D%252Fv1%252Faccounts%252F%257BaccountId%257D%252Fenvelopes%252F%257BenvelopeId%257D%252Fdocuments%20and%20help%20me%20integrate%20this%20endpoint.) [Open in Claude](https://claude.ai/new?q=Read%20the%20API%20documentation%20at%20https%3A%2F%2Fapi.assinafy.com.br%2Fv1%2Fdocs%2Fmarkdown%3Fmethod%3Dpost%26path%3D%252Fv1%252Faccounts%252F%257BaccountId%257D%252Fenvelopes%252F%257BenvelopeId%257D%252Fdocuments%20and%20help%20me%20integrate%20this%20endpoint.)

## Path parameters

- `accountId` string, required
- `envelopeId` string, required

## Request body

- object: A document of an envelope, as sent on creation (`documents[]`) and when added.
  - `id` string, required: A `metadata_ready` document of the workspace with no assignment.
  - `method` 'virtual' | 'collect': As on an assignment: `virtual` (the default), signed on its virtual page, or `collect`, signed on the fields placed in `entries`.
  - `entries` object[]: Required for `collect`, as on an assignment: the fields placed on each page of the document. Its signers are the ones on its fields, exactly its `signer_ids`.
    - `page_id` string, required: A page of the document.
    - `fields` object[], required: The fields placed on this page. A page with none adds nothing, as on an assignment.
      - `signer_id` string, required: A signer of the document.
      - `field_id` string, required: A field definition of the workspace.
      - `display_settings` DisplaySettings, required: A field placement rectangle on a document page. Geometry values are pixels in Assinafy's 150-DPI page image, measured from the upper-left corner. Clients must keep the rectangle within the selected page's width and height; the API does not clamp out-of-bounds values.
        - `left` number, float, required: Horizontal distance from the page's left edge, in page-image pixels.
        - `top` number, float, required: Vertical distance from the page's top edge, in page-image pixels.
        - `width` number, float, required: Width of the placement rectangle, in page-image pixels.
        - `height` number, float, required: Height of the placement rectangle, in page-image pixels.
        - `fontFamily` string: Font-family presentation metadata.
        - `fontSize` number, float, required: Font size in the 150-DPI page-image coordinate system.
        - `backgroundColor` string: CSS-compatible background-color presentation metadata.
  - `signer_ids` string[], required: The signers of this document, each listed once: on creation, signers listed in `signers`; when added, signers of the envelope's documents.
  - `expires_at` union: This document's expiration, read as on an assignment, at least one hour in the future. Text is read as a date: ISO 8601 is the format to send (a UTC offset in the value is honored, a value without one is read as UTC, and a date alone means 23:59 UTC that day), and text that is a number is Unix time. A number is Unix time in seconds, its fraction dropped. Null, 0, an empty text or leaving it out means no expiration; a value that can't be read as a date answers `400`.
    - string
    - number
  - `copy_receiver_ids` string[]: Signer IDs that only receive a copy of this document, as on an assignment.
  - `max_total_credits` number: Optional ceiling on what this request may spend, as on an assignment: refused with `409` and code `CreditCeilingExceeded`, nothing created or charged, when the document costs more on its own. A value that is not a number of credits, zero or more, answers `400`; numeric text counts, as a form-encoded body sends it.

## Response `200`

The envelope with the document added

- object: Standard success wrapper. Operations add their own `data`.
  - `status` integer: HTTP status code, mirrored in the body.
  - `message` string: Human-readable message; empty on success.
  - `data` DocumentEnvelope: Documents sent together to the same signers. Each document keeps its own assignment, status, certificate and downloads.
    - `resource` string: Present in single-resource responses.
    - `id` string, required
    - `name` string, required
    - `message` string, nullable, required
    - `documents` object[], required: The envelope's documents, in the order it lists them.
      - `id` string, required
      - `position` integer, required: The document's place in the envelope's order, from 1.
      - `name` string, required
      - `status` string, required: Status code — see GET /v1/documents/statuses.
      - `artifacts` object, required: The document's files, as its own read (`GET /v1/documents/{documentId}`) gives them: always `original`, plus `thumbnail` once one exists, and for a certificated document `certificated`, `certificate-page`, `bundle` and, when signed with a digital certificate, `pades`. In the envelope list (`GET /v1/accounts/{accountId}/envelopes`) only `thumbnail`, given without checking that it exists: its URL answers `404` until the thumbnail is generated.
      - `signers` object[], required: The document's signers: a signer appears only on the documents they are on.
        - `id` string, required
        - `full_name` string, required
        - `email` string, nullable, required
        - `whatsapp_phone_number` string, nullable, required
        - `completed` boolean, required: Whether they have signed this document.
        - `signed_at` string, date-time, nullable, required: When they signed this document; `null` until they do.
    - `counts` object, nullable, required: How many of its documents are in each status (status code => count); only the statuses present. An envelope has no status of its own. `null` once it lists no document: every one deleted or taken out.
    - `signing_urls` SigningUrl[], required: One entry per signer, as on an assignment (`SigningUrl`): the link of the document their invitation is sent from while it waits for them, else of their first document that still does (the e-mail page asks that document for the invitation again; any of their links opens the whole envelope).
      - `signer_id` string
      - `url` string, nullable: See the schema description. `null` for a signer notified only by WhatsApp and for an embedded signer.
      - `embedded` boolean: Whether the signer was marked `embedded` when the assignment was created.
    - `created_at` string, date-time, required

## Other responses

- `400`: Refused as sent; nothing was created or charged. Each field at fault is an entry of `errors`: `id` (missing, or a document that can't take the assignment: not found, not `metadata_ready`, or already assigned); `method` (other than `virtual` or `collect`); `entries` (missing for `collect`, or not a list of pages with fields naming their `signer_id`); `signer_ids` (missing, not a list of ids, listed twice, not a signer of the envelope's documents, for `collect` not exactly the signers on its fields, or a digital-certificate signer on a `collect` document or with another signer); `expires_at` (not text, a number or null); a null `field` when the envelope already has 20 documents, or would hold more than 2,000 fields (a virtual document's being one per signer) or more than 100 copy receivers with this one. A page or field the assignment doesn't find on a `collect` document, a balance too low, an `expires_at` or `copy_receiver_ids` the assignment refuses, and a document another request assigned or put back into processing meanwhile answer `400` with `message` only, as on an assignment.
- `401`: Missing or invalid credentials.
- `403`: The workspace's plan lacks the Envelopes feature, or a signer's method or embedded signing the plan lacks (`PlanRestricted`); or an OAuth app's token lacks `documents:write` (`InsufficientScope`). Also a member deactivated in the workspace, a workspace scheduled for deletion, or an OAuth token of another workspace.
- `404`: The requested resource does not exist.
- `409`: Every document of the envelope is closed (`EnvelopeClosed`), or the document costs more than `max_total_credits` on its own (`CreditCeilingExceeded`).
- `500`: Unexpected server error.

## Changes

- **2026-11-11** `f4fa0790d9f8`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/assinafy/apis/assinafy-api-reference/changes/v1/accounts/:accountId/envelopes/:envelopeId/documents/post.md)

---

[API](https://skmtc.dev/assinafy/apis/assinafy-api-reference.md) - [All operations](https://skmtc.dev/assinafy/apis/assinafy-api-reference/llms.txt) - [OpenAPI document](https://skmtc.dev/assinafy/apis/assinafy-api-reference/revisions/afcdb904d0bf?raw)
