Document groups through the API
From Signer 3.5.0, a single call creates a document group: a set of documents and envelopes on the same subject, new or existing, each with its own participants. Whoever takes part in several documents of the group receives a single e-mail, and the operator receives a single link to act for all of their people in the group.
Overview
- Each document of the group keeps its own flow, participants, file and status. The group only brings them together.
- A document may be in more than one group.
- A new document is described with the same structure as
POST /api/documents. An existing document enters by its id. - The rules of operators and single link apply to each document of the group. On top of them there is the group link: a single link to act for people of several documents.
Before you start
- The organization's API key, in the
X-Api-Keyheader, as in the rest of the Integration Guide. The calls in Use the group link are the exception: they carry no key. - Operators enabled in the instance (
CentralizedLink:Enabled, on by default), for the group link. See Operators and single link through the API. - Batch signature in the public area (
General:PublicBatchSignatureEnabled), so that the e-mail of someone in several documents opens the group's batch page. Without it, the e-mail leads to the document list, which asks for login. - Enums are sent as text, for example
"Signer"and"Approver".
1. Upload the files
Upload each file of the new documents, as in Create documents:
POST /api/uploads/bytes
{ "bytes": "<file content in Base64>" }
Existing documents need no upload.
2. Create the group
POST /api/document-groups
{
"name": "November contracts",
"description": "Sample Customer's agreement, annex and terms",
"documents": [
{ "documentId": "<id of the power of attorney already created>" },
{
"document": {
"isEnvelope": true,
"envelopeName": "Agreement 123 with annex",
"files": [
{ "id": "<agreement upload>", "name": "agreement.pdf", "contentType": "application/pdf", "displayName": "Agreement" },
{ "id": "<annex upload>", "name": "annex.pdf", "contentType": "application/pdf", "displayName": "Annex" }
],
"flowActions": [
{ "type": "Signer", "step": 1, "user": { "name": "Company Representative", "identifier": "11122233344", "email": "representative@example.com" } },
{ "type": "Signer", "step": 2, "user": { "name": "Sample Customer", "identifier": "55566677788", "email": "customer@example.com" } }
]
}
},
{
"document": {
"files": [
{ "id": "<terms upload>", "name": "terms.pdf", "contentType": "application/pdf", "displayName": "Terms of adhesion" }
],
"flowActions": [
{ "type": "Signer", "step": 1, "user": { "name": "Sample Customer", "identifier": "55566677788", "email": "customer@example.com" } }
]
}
}
]
}
| Field | Description |
|---|---|
name | Optional, up to 200 characters. Shown on the group link's page. |
description | Optional, up to 600 characters. Shown in the operator's e-mail. |
documents | List of entries, in the order the documents should appear. Each entry carries only one of these fields: documentId, of an existing document, or document, with the same structure as POST /api/documents (files, flowActions, observers, isEnvelope, envelopeName, allowOperators etc.). |
Rules
- The group needs at least one entry, and each entry carries
documentIdordocument, never both. - New document: follows every rule of
POST /api/documents, including theGeneral:MaxSignersPerDocumentlimit. An entry with several files and noisEnvelopecreates one document per file, all in the group and with the sameindexin the response. Templates (templateId) are not accepted in a group. - Existing document: must belong to the key's organization, not be deleted and be pending, and you need permission to edit its flow. It may already be in other groups, but cannot repeat in the same call. Its flow and participants do not change.
- All or nothing: one invalid entry prevents the whole group from being created. Uploads are only read, so they can be sent again with the same ids.
Response
{
"id": "<group id>",
"name": "November contracts",
"description": "Sample Customer's agreement, annex and terms",
"documents": [
{ "index": 0, "documentId": "<power of attorney id>", "isExisting": true },
{ "index": 1, "documentId": "<envelope id>", "isExisting": false, "missingAnchors": [] },
{ "index": 2, "documentId": "<terms id>", "isExisting": false, "uploadId": "<terms upload>", "missingAnchors": [] }
]
}
There is one row per document created or included. index is the entry's position, from 0; an entry that produced several documents shows in several rows with the same index. Existing documents carry only index, documentId and isExisting.
What happens after creation
- Participants' e-mail: whoever is in a single new document receives the document's usual e-mail. Whoever is in two or more new documents receives a single e-mail listing the documents, with the link to the group's batch page. Existing documents send no new e-mail. Only e-mail is grouped: SMS and WhatsApp still send one message per action.
- Participant's batch page: shows the person's actions on the group's documents the link was issued for, even after they are done, so the person can still see the documents. Actions of the same person released later (a later step, for instance), addressed to the same e-mail, show up too. Deleted documents leave; documents of other groups never show.
- Webhook: the call raises a single
DocumentsCreatedevent with the group's new documents. Existing documents raise no creation event. The other events (concluded, refused etc.) stay per document. - Billing: only new documents are billed, as in a standalone creation: one
ENVtransaction per envelope andDOCper document. The notifications sent (to participants and operators) are billed too.
3. Read the group
GET /api/document-groups/{id}
{
"id": "<group id>",
"name": "November contracts",
"description": "Sample Customer's agreement, annex and terms",
"creationDate": "2026-11-23T14:02:00+00:00",
"documents": [
{
"id": "<id>",
"key": "ABCD-1234-EFGH-5678",
"name": "Agreement 123 with annex",
"isEnvelope": true,
"status": "Pending",
"creationDate": "2026-11-23T14:02:00+00:00",
"flowActions": [ "..." ]
}
]
}
- Documents come in the order of the entries. Deleted documents do not show.
- You need permission to view each document of the group; without it, the call is refused.
- With
General:HideParticipantsListAndOrderOfActionsForNonManagerson, whoever does not manage the document sees only their own action. - A group that does not exist, or has no document left, returns
DocumentGroupNotFound.
4. Group with operators
For an operator to act for the participants, each new document carries allowOperators: true and each participant's operatorEmail, in flowActions or on each person of ruleUsers, as in Create the document with operators. Existing documents enter with the operators they already have.
{
"name": "November contracts",
"documents": [
{
"document": {
"allowOperators": true,
"files": [ "..." ],
"flowActions": [
{
"type": "Signer", "step": 1,
"user": { "name": "Sample Customer", "identifier": "55566677788", "email": "customer@example.com" },
"operatorEmail": "operator@example.com"
}
]
}
}
]
}
- An operator error on any document undoes the whole group. With the organization on "digital certificate only", an operator for someone who can only sign electronically is refused with
CentralizedLinkRequiresDigitalSignature. - Operator's e-mail: at creation, each
operatorEmailreceives a single e-mail for the group, instead of one per document. It lists the people and the documents they still have to act on, says who sent them, and has the button that opens the group link. - The operator's link follows the operators at the time it is used: if you change a participant's operator, the former operator's link no longer reaches them.
- There is no group e-mail when the new document has
disablePendingActionNotificationsor the existing one hasdisableNotifications. - After creation, each document notifies the operator when one of their people can act, as outside a group.
- Each document's Events record the operator link sent, the single link generated and each access through an operator link or single link.
5. Generate the group link
POST /api/document-groups/{id}/centralized-link
Generates, on demand, a group link for chosen participants, whether or not they have an operator. Each participant is identified by the document, the flow action and the user (user.id for signers and approvers, or ruleUsers[].id for rules).
{
"participants": [
{ "documentId": "<envelope id>", "flowActionId": "<id>", "userId": "<Sample Customer's user.id>" },
{ "documentId": "<terms id>", "flowActionId": "<id>", "userId": "<Sample Customer's user.id>" }
]
}
Response:
{ "url": "https://<your-instance>/document-group/centralized?ticket=group-..." }
- Only participants of the group's documents who have not concluded yet (
PendingorCreated) may be included. An invalid participant or an empty list refuses the whole request withCentralizedLinkParticipantInvalid. - You need permission to edit the flow of each document involved.
- The API does not e-mail this link: pass the URL on yourself.
- The participant list is fixed in the link. To change it, generate another one.
- The link is valid for 24 hours by default (
General:FlowActionTicketValidityMinutes). Tickets obtained from it never outlive it.
6. Use the group link
The operator's link and the link generated in the previous step work the same way. In the browser, the page shows the group's documents, the people and, for each person, the Sign or Approve buttons per document and Sign all of person's documents. See Document group in the user guide.
To integrate without a browser, use the calls below. They are public: they carry no X-Api-Key, and the link's ticket (group-...), taken from the URL, is what authorizes them.
a) List the group
GET /api/document-groups/public/centralized?ticket={ticket}
{
"isTicketExpired": false,
"digitalSignatureOnly": false,
"groupName": "November contracts",
"documents": [
{ "id": "<envelope id>", "key": "ABCD-1234-EFGH-5678", "name": "Agreement 123 with annex", "mimeType": "application/pdf", "isEnvelope": true, "status": "Pending", "isPaused": false },
{ "id": "<terms id>", "key": "WXYZ-9876-JKLM-5432", "name": "Terms of adhesion", "mimeType": "application/pdf", "isEnvelope": false, "status": "Pending", "isPaused": false }
],
"participants": [
{
"userId": "<Sample Customer's user.id>", "name": "Sample Customer", "identifier": "55566677788", "pendingCount": 1,
"actions": [
{ "documentId": "<terms id>", "flowActionId": "<id>", "ruleUserId": null, "type": "Signer", "step": 1, "status": "Pending", "concludedByAnotherRuleUser": false, "requiresElectronicSignature": false },
{ "documentId": "<envelope id>", "flowActionId": "<id>", "ruleUserId": null, "type": "Signer", "step": 2, "status": "Created", "concludedByAnotherRuleUser": false, "requiresElectronicSignature": false }
]
}
],
"completedCount": 0,
"totalCount": 2
}
- An action's
statusisPendingfor whoever can act now,Createdfor whoever waits for an earlier step, andCompletedorRefusedfor whoever has concluded. isPausedflags a paused document: nobody acts on it until it is resumed.pendingCountcounts thePendingactions of pending documents, paused ones included; leave those out if you show the number.concludedByAnotherRuleUseristruewhen the person is in a rule another member already concluded;statusis then the rule's.requiresElectronicSignatureistruefor someone who can only sign electronically. WithdigitalSignatureOnly, that person cannot sign through the link.mimeTypesays whether the document can be previewed (PDF only). The group ticket gives access to the files of the documents the link reaches.- When
isTicketExpiredistrue, only that field is filled in. A link that no longer reaches anyone is refused withInvalidTicket.
b) Sign or approve a document
Each document's public routes accept the group ticket, together with the person's userId and the action's flowActionId: approval, certificate signature, authentication code, Pix, biometrics, electronic signature and refusal. They are the same as in Through the API, without a browser, plus userId. For example:
POST /api/documents/keys/{key}/electronic-signature
{ "ticket": "group-...", "userId": "<Sample Customer's user.id>", "flowActionId": "<id of the action on the terms>", "emailCode": "<code received by Sample Customer>" }
- The digital certificate must belong to the person.
- Refusal is only accepted when the organization allows it through the links; otherwise it returns
CentralizedLinkRefusalDisabled.
To use Signer's own pages for one person, exchange the group ticket for that person's ticket:
POST /api/document-groups/public/centralized/ticket
{ "ticket": "group-...", "userId": "<Sample Customer's user.id>", "flowActionId": "<action id>" }
Response:
{ "ticket": "<the person's ticket>", "url": "https://<your-instance>/document/key/{key}/sign?ticket=..." }
- With
flowActionId, it returns the ticket and the signature or approval page of that action. The page also opens for an action already concluded or refused, only to view the document. - Without
flowActionId, it returns the ticket and the batch page with all of the person's pending actions in the group. - Each use is recorded in the document's Events.
c) Sign all of a person's documents
With the group ticket, the batch gathers the person's pending actions in the group. Signing is one person at a time.
POST /api/batches/public/electronic-signatures
{ "ticket": "group-...", "userId": "<Sample Customer's user.id>" }
Then request the code (POST /api/batches/electronic-signatures/{id}/authentication-code) and finish with PUT /api/batches/electronic-signatures/{id}, sending the same group ticket. With a digital certificate, use POST /api/batches/public/signatures with ticket, userId and the person's certificate. See the full flow in Sign documents in batch.
- With no pending action for the person, the batch is refused with
SignatureNotPending. - With "digital certificate only", the electronic batch is refused with
CentralizedLinkRequiresDigitalSignatureif any pending action requires electronic signature. - If the link no longer reaches the batch (for instance, the operator was changed), the
PUTreturnsInvalidTicket.
Feature errors
Creation validation errors come back with status 400, grouped by the field's path:
{
"errors": { "Documents[1].Document.FlowActions[0]": [ "..." ] },
"title": "One or more validation errors occurred.",
"status": 400
}
| Path | Situation |
|---|---|
Documents | No entry. |
Documents[i] | Entry with neither documentId nor document, or with both. |
Documents[i].DocumentId | Existing document not found, deleted, not pending or repeated. |
Documents[i].Document.Files | Same upload used in more than one entry. |
Documents[i].Document.TemplateId | Templates are not accepted in a group. |
Documents[i].Document.<field> | Any validation rule of POST /api/documents for that document. |
The other errors come back with status 422 and an ErrorModel, as in Error responses, and undo the whole group when they happen at creation (for instance, the participant limit or an operator error):
| Code | When |
|---|---|
DocumentGroupNotFound | Group does not exist or has no documents left. |
OperatorsDisabled | Operators turned off in the instance. |
CentralizedLinkParticipantInvalid | Invalid participant or empty list when generating the group link. |
CentralizedLinkRequiresDigitalSignature | The organization only allows digital certificates through the links. |
CentralizedLinkRefusalDisabled | Refusal through the link not allowed. |
InvalidTicket / ExpiredTicket | Invalid ticket, one that no longer reaches anyone, or expired. |
DocumentFlowNotFound | The action is not in the link. |
SignatureNotPending | Nothing pending to sign. |
InvalidAuthenticationCode | Wrong authentication code. |