{
  "info": {
    "_postman_id": "signsecure-api-v1",
    "name": "SignSecure Sign Pad API v1",
    "description": "Complete Postman collection for the SignSecure Sign Pad REST API.\n\n## Authentication\nAll endpoints (except Health Check) require an API key passed as a Bearer token in the Authorization header.\n\n**Format:** `Authorization: Bearer signsecure_xxxxxxxx...`\n\n**Important:** Do NOT use `X-API-Key` header — it will be rejected.\n\n## Base URL\n- **Production (default):** `https://api.signpad.signsecure.in/api/v1`\n- **Staging:** `https://api-stg.signpad.signsecure.in/api/v1`\n- **Local:** `http://localhost:3000/api/v1`\n\nChange the `baseUrl` collection variable when switching environments.\n\n## Rate Limits\n- 1000 requests/hour per API key\n\n## Error Format\n```json\n{\n  \"code\": \"ERROR_CODE\",\n  \"message\": \"Human-readable message\",\n  \"details\": {},\n  \"requestId\": \"req_xxxxx\",\n  \"timestamp\": \"2026-03-10T...\"\n}\n```\n\n## Access scope\nThe API key selects All resources, Personal only, or One workspace. No workspace header is required. Live workspace permissions still apply.\n\n## Working with this collection\nDocument requests use /documents; /envelopes remains a supported alias. The envelopeId variable is the document ID returned by the API. Set real recipient contacts before sending invitations. Run requests individually in the intended order: management examples include archive, delete, cancel, and send operations.\n\n## PDF upload\nCreation and upload-renewal responses contain upload.url and upload.fields. POST multipart/form-data directly to upload.url with EVERY returned field, followed by the PDF as the final file part. Do not send the API Bearer token to storage. Upload before using a template or sending a document.\n\n## Invitation resend\nOne reminder request queues the enabled email and WhatsApp channels together. The shared cooldown is five minutes per recipient, including failed delivery attempts. A blocked retry returns HTTP 429 / TOO_MANY_REQUESTS. Use resendAvailableAt from a successful response.\n\n## Idempotency\nKeep the same workflowRunKey when retrying the same submission. Change the relevant key for a new run or a changed payload.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
    "version": "1.1.0"
  },
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{apiKey}}",
        "type": "string"
      }
    ]
  },
  "variable": [
    {
      "key": "baseUrl",
      "value": "https://api.signpad.signsecure.in/api/v1",
      "type": "string"
    },
    {
      "key": "apiKey",
      "value": "signsecure_YOUR_API_KEY_HERE",
      "type": "string"
    },
    {
      "key": "envelopeId",
      "value": "",
      "type": "string"
    },
    {
      "key": "recipientId",
      "value": "",
      "type": "string"
    },
    {
      "key": "templateId",
      "value": "",
      "type": "string"
    },
    {
      "key": "fieldId",
      "value": "",
      "type": "string"
    },
    {
      "key": "workflowId",
      "value": "",
      "type": "string"
    },
    {
      "key": "workflowVersionId",
      "value": "",
      "type": "string"
    },
    {
      "key": "templateCopyId",
      "value": "",
      "type": "string"
    },
    {
      "key": "workflowRunKey",
      "value": "postman-run-20260910-001",
      "type": "string"
    }
  ],
  "item": [
    {
      "name": "Health & Info",
      "description": "Server health check and API information endpoints.",
      "item": [
        {
          "name": "Health Check",
          "request": {
            "auth": {
              "type": "noauth"
            },
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/health",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "health"
              ]
            },
            "description": "Check if the API server is healthy. No authentication required."
          },
          "response": [
            {
              "name": "Healthy",
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "{\n  \"status\": \"healthy\",\n  \"timestamp\": \"2026-03-10T12:00:00.000Z\",\n  \"version\": \"1.0.0\"\n}"
            }
          ]
        },
        {
          "name": "API Info",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                ""
              ]
            },
            "description": "Get API information including available endpoints and version."
          },
          "response": [
            {
              "name": "API Info",
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "{\n  \"name\": \"SignSecure Sign Pad API\",\n  \"version\": \"1.0.0\",\n  \"endpoints\": {\n    \"envelopes\": \"/api/v1/envelopes\",\n    \"credits\": \"/api/v1/credits\",\n    \"templates\": \"/api/v1/templates\"\n  },\n  \"documentation\": \"https://docs.signsecure.com/api\"\n}"
            }
          ]
        }
      ]
    },
    {
      "name": "Documents",
      "description": "Create, read, update, and delete envelopes. Manage file uploads and downloads.",
      "item": [
        {
          "name": "Create Document",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "if (pm.response.code === 201) {",
                  "    var jsonData = pm.response.json();",
                  "    pm.collectionVariables.set('envelopeId', jsonData.id);",
                  "    console.log('Envelope ID saved:', jsonData.id);",
                  "}"
                ],
                "type": "text/javascript"
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"fileName\": \"contract.pdf\",\n  \"title\": \"Service Contract 2026\",\n  \"recipients\": [\n    {\n      \"email\": \"signer1@example.com\",\n      \"name\": \"John Doe\",\n      \"order\": 1,\n      \"role\": \"signer\",\n      \"signatureMethod\": \"electronic\",\n      \"verificationMethod\": \"link_only\",\n      \"signaturePlacement\": {\n        \"type\": \"text\",\n        \"searchText\": \"Signature of Party A\",\n        \"pages\": [\n          3\n        ],\n        \"position\": \"below\",\n        \"gap\": 10,\n        \"width\": 200,\n        \"height\": 50\n      },\n      \"phone\": \"+14155552671\"\n    },\n    {\n      \"email\": \"signer2@example.com\",\n      \"name\": \"Jane Smith\",\n      \"order\": 2,\n      \"role\": \"signer\",\n      \"signatureMethod\": \"electronic\",\n      \"signaturePlacement\": {\n        \"type\": \"coordinates\",\n        \"positions\": [\n          {\n            \"pageNumber\": 1,\n            \"x\": 350,\n            \"y\": 600,\n            \"width\": 200,\n            \"height\": 50\n          }\n        ]\n      }\n    }\n  ],\n  \"workflow\": {\n    \"mode\": \"sequential\",\n    \"verificationMethod\": \"link_only\",\n    \"message\": \"Please review and sign this contract.\",\n    \"redirectUrl\": \"https://app.example.com/signing-complete\",\n    \"emailNotifications\": \"all\",\n    \"whatsappNotifications\": \"all\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/documents",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "documents"
              ]
            },
            "description": "Create a new envelope. Returns a presigned POST upload configuration for uploading the PDF file directly to S3.\n\n**Important:** After creating the envelope, use the returned `upload.url` and `upload.fields` to upload your PDF via a multipart form `POST` to S3.\n\n**Upload example:**\n```\nconst formData = new FormData();\nfor (const [key, value] of Object.entries(upload.fields)) {\n  formData.append(key, value);\n}\nformData.append('file', pdfFile);\nawait fetch(upload.url, { method: 'POST', body: formData });\n```\n\n**File Constraints:**\n- Only PDF files are supported\n- Max file size: 10MB (enforced by S3 at upload time)\n\n**Recipients (optional):**\n- `role`: `signer`, `approver`, or `cc`\n- `signatureMethod`: `electronic`, `dsc_usb`, `aadhaar_otp`, or `all`\n- `signaturePlacement`: Text-based (search for text in PDF) or coordinate-based (exact page position)\n- Text-based placement works with `electronic` and `aadhaar_otp` methods (for Aadhaar, text positions are auto-resolved to coordinates)\n- Use `pages` to limit which pages are searched for text placement (omit or `[0]` for all pages)\n\n**Redirect after sign/approval (optional):**\n- Set `workflow.redirectUrl` to send signers and approvers back to your app after they finish\n- Query params appended automatically: `envelopeId`, `signerEmail`, `role`, `status`, `event`\n\n**Notifications:** `workflow.emailNotifications` and `workflow.whatsappNotifications` accept `all` | `completion_only` | `none` (WhatsApp default: `none`). WhatsApp messages are only sent to recipients with a valid E.164 `phone`."
          },
          "response": [
            {
              "name": "Envelope Created",
              "status": "Created",
              "code": 201,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "{\n  \"id\": \"abc123xyz\",\n  \"title\": \"Service Contract 2026\",\n  \"fileName\": \"contract.pdf\",\n  \"status\": \"draft\",\n  \"fileKey\": \"documents/user_example_com/abc123xyz/contract.pdf\",\n  \"upload\": {\n    \"url\": \"https://bucket.s3.amazonaws.com/\",\n    \"fields\": {\n      \"key\": \"documents/user_example_com/abc123xyz/contract.pdf\",\n      \"Content-Type\": \"application/pdf\",\n      \"x-amz-server-side-encryption\": \"AES256\",\n      \"X-Amz-Algorithm\": \"AWS4-HMAC-SHA256\",\n      \"X-Amz-Credential\": \"...\",\n      \"Policy\": \"base64-encoded-policy\",\n      \"X-Amz-Signature\": \"...\"\n    }\n  },\n  \"expiresIn\": 3600,\n  \"maxFileSize\": 10485760,\n  \"createdAt\": \"2026-03-10T12:00:00.000Z\",\n  \"recipientsAdded\": 2\n}"
            }
          ]
        },
        {
          "name": "Create Document (Minimal)",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "if (pm.response.code === 201) {",
                  "    var jsonData = pm.response.json();",
                  "    pm.collectionVariables.set('envelopeId', jsonData.id);",
                  "}"
                ],
                "type": "text/javascript"
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"fileName\": \"simple-document.pdf\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/documents",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "documents"
              ]
            },
            "description": "Create an envelope with only the required fields. Title defaults to fileName. Recipients, form fields, and workflow can be added later."
          },
          "response": []
        },
        {
          "name": "List All Documents",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/documents?page=1&limit=50",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "documents"
              ],
              "query": [
                {
                  "key": "page",
                  "value": "1",
                  "description": "Page number (default: 1)"
                },
                {
                  "key": "limit",
                  "value": "50",
                  "description": "Items per page (default: 50)"
                },
                {
                  "key": "status",
                  "value": "draft",
                  "description": "Filter by status: draft, pending, completed, rejected, failed",
                  "disabled": true
                },
                {
                  "key": "search",
                  "value": "",
                  "description": "Search documents by title",
                  "disabled": true
                }
              ]
            },
            "description": "List all documents owned by the authenticated user with pagination and optional filtering.\n\n**Filters:**\n- `status`: `draft`, `pending`, `completed`, `rejected`, `failed`\n- `search`: Search by document title"
          },
          "response": [
            {
              "name": "Envelope List",
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "{\n  \"items\": [\n    {\n      \"id\": \"abc123xyz\",\n      \"title\": \"Service Contract 2026\",\n      \"status\": \"draft\",\n      \"createdAt\": \"2026-03-10T12:00:00.000Z\",\n      \"updatedAt\": \"2026-03-10T12:00:00.000Z\",\n      \"totalRecipients\": 2,\n      \"completedActions\": 0\n    }\n  ],\n  \"pageInfo\": {\n    \"page\": 1,\n    \"limit\": 50,\n    \"total\": 1,\n    \"totalPages\": 1,\n    \"hasNext\": false,\n    \"hasPrevious\": false\n  }\n}"
            }
          ]
        },
        {
          "name": "Get Document by ID",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/documents/{{envelopeId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "documents",
                "{{envelopeId}}"
              ]
            },
            "description": "Get details for a specific document by ID."
          },
          "response": [
            {
              "name": "Envelope Details",
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "{\n  \"id\": \"abc123xyz\",\n  \"title\": \"Service Contract 2026\",\n  \"status\": \"draft\",\n  \"fileKey\": \"documents/user@example.com/abc123xyz/contract.pdf\",\n  \"createdAt\": \"2026-03-10T12:00:00.000Z\",\n  \"updatedAt\": \"2026-03-10T12:00:00.000Z\"\n}"
            }
          ]
        },
        {
          "name": "Update Document Title",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"title\": \"Updated Contract Title\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/documents/{{envelopeId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "documents",
                "{{envelopeId}}"
              ]
            },
            "description": "Update document metadata. Currently supports updating the title."
          },
          "response": [
            {
              "name": "Envelope Updated",
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "{\n  \"id\": \"abc123xyz\",\n  \"title\": \"Updated Contract Title\",\n  \"updatedAt\": \"2026-03-10T12:30:00.000Z\"\n}"
            }
          ]
        },
        {
          "name": "Delete Document",
          "request": {
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/documents/{{envelopeId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "documents",
                "{{envelopeId}}"
              ]
            },
            "description": "Permanently delete a document and all associated data (recipients, form fields, versions, activity logs)."
          },
          "response": [
            {
              "name": "Envelope Deleted",
              "status": "No Content",
              "code": 204,
              "header": [],
              "body": ""
            }
          ]
        },
        {
          "name": "Generate Upload URL",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/documents/{{envelopeId}}/uploads",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "documents",
                "{{envelopeId}}",
                "uploads"
              ]
            },
            "description": "Generate a new presigned upload URL for a draft document. Use this if the original upload URL has expired.\n\n**Note:** Only works for documents in `draft` status."
          },
          "response": [
            {
              "name": "Upload URL Generated",
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "{\n  \"upload\": {\n    \"url\": \"https://bucket.s3.amazonaws.com/\",\n    \"fields\": {\n      \"key\": \"documents/user_example_com/abc123xyz/contract.pdf\",\n      \"Content-Type\": \"application/pdf\",\n      \"x-amz-server-side-encryption\": \"AES256\",\n      \"X-Amz-Algorithm\": \"AWS4-HMAC-SHA256\",\n      \"X-Amz-Credential\": \"...\",\n      \"Policy\": \"base64-encoded-policy\",\n      \"X-Amz-Signature\": \"...\"\n    }\n  },\n  \"fileKey\": \"documents/user_example_com/abc123xyz/contract.pdf\",\n  \"expiresIn\": 3600,\n  \"maxFileSize\": 10485760\n}"
            }
          ]
        },
        {
          "name": "Generate Download URL",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/documents/{{envelopeId}}/file",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "documents",
                "{{envelopeId}}",
                "file"
              ]
            },
            "description": "Get a presigned download URL for the document file. The URL is valid for 1 hour (3600 seconds)."
          },
          "response": [
            {
              "name": "Download URL",
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "{\n  \"url\": \"https://s3.amazonaws.com/bucket/...\",\n  \"expiresIn\": 3600,\n  \"fileName\": \"Service Contract 2026\"\n}"
            }
          ]
        }
      ]
    },
    {
      "name": "Document Recipients",
      "description": "Manage envelope recipients (signers, approvers, and CC recipients). Recipients are the people who need to take action on or be notified about an envelope.",
      "item": [
        {
          "name": "Add Recipients",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "if (pm.response.code === 201) {",
                  "    var jsonData = pm.response.json();",
                  "    if (jsonData.recipients && jsonData.recipients.length > 0) {",
                  "        pm.collectionVariables.set('recipientId', jsonData.recipients[0].id);",
                  "        console.log('First recipient ID saved:', jsonData.recipients[0].id);",
                  "    }",
                  "}"
                ],
                "type": "text/javascript"
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"recipients\": [\n    {\n      \"email\": \"signer@example.com\",\n      \"name\": \"John Doe\",\n      \"order\": 1,\n      \"role\": \"signer\",\n      \"signatureMethod\": \"electronic\",\n      \"verificationMethod\": \"link_only\",\n      \"signaturePlacement\": {\n        \"type\": \"coordinates\",\n        \"positions\": [\n          {\n            \"pageNumber\": 1,\n            \"x\": 100,\n            \"y\": 600,\n            \"width\": 200,\n            \"height\": 50\n          }\n        ]\n      },\n      \"phone\": \"+14155552671\"\n    },\n    {\n      \"email\": \"approver@example.com\",\n      \"name\": \"Jane Manager\",\n      \"order\": 2,\n      \"role\": \"approver\",\n      \"signatureMethod\": \"electronic\"\n    },\n    {\n      \"email\": \"cc@example.com\",\n      \"name\": \"Bob Observer\",\n      \"order\": 3,\n      \"role\": \"cc\",\n      \"signatureMethod\": \"electronic\"\n    }\n  ],\n  \"replaceExisting\": false\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/documents/{{envelopeId}}/recipients",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "documents",
                "{{envelopeId}}",
                "recipients"
              ]
            },
            "description": "Add recipients to a document, or replace all existing recipients.\n\n**Roles:**\n- `signer` - Must sign the document\n- `approver` - Must approve the document\n- `cc` - Receives notifications only (no action required)\n\n**Signature Methods:**\n- `electronic` - Draw/type/upload signature\n- `dsc_usb` - USB Digital Signature Certificate (coordinate placement only)\n- `aadhaar_otp` - Aadhaar OTP-based eSign (coordinate placement only)\n- `all` - Recipient chooses any method (coordinate placement only)\n\n**Signature Placement:**\n- `text` - Searches for text in PDF and places signature relative to it. Works with `electronic` and `aadhaar_otp` methods. Use `pages` to restrict the search to specific page numbers (omit or pass `[0]` for all pages).\n- `coordinates` - Places signature at exact page coordinates. Works with all signature methods.\n\n**Options:**\n- `replaceExisting: true` - Removes all existing recipients before adding new ones\n- `replaceExisting: false` (default) - Appends to existing recipients (checks for duplicate emails)\n\n**Contact details:**\n- `email` — required unless a valid `phone` is provided (at least one contact method per recipient).\n- `phone` — optional E.164 number (e.g. `+14155552671`). When set, the recipient also receives WhatsApp notifications (per the workflow's `whatsappNotifications` setting). Responses echo `phone` (null when not set)."
          },
          "response": [
            {
              "name": "Recipients Added",
              "status": "Created",
              "code": 201,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "{\n  \"message\": \"Recipients added successfully\",\n  \"recipients\": [\n    {\n      \"id\": \"rec_abc123\",\n      \"name\": \"John Doe\",\n      \"email\": \"signer@example.com\",\n      \"role\": \"signer\",\n      \"order\": 1,\n      \"status\": \"pending\",\n      \"signatureMethod\": \"electronic\"\n    },\n    {\n      \"id\": \"rec_def456\",\n      \"name\": \"Jane Manager\",\n      \"email\": \"approver@example.com\",\n      \"role\": \"approver\",\n      \"order\": 2,\n      \"status\": \"pending\",\n      \"signatureMethod\": \"electronic\"\n    },\n    {\n      \"id\": \"rec_ghi789\",\n      \"name\": \"Bob Observer\",\n      \"email\": \"cc@example.com\",\n      \"role\": \"cc\",\n      \"order\": 3,\n      \"status\": \"pending\",\n      \"signatureMethod\": \"electronic\"\n    }\n  ]\n}"
            }
          ]
        },
        {
          "name": "List Recipients",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/documents/{{envelopeId}}/recipients",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "documents",
                "{{envelopeId}}",
                "recipients"
              ]
            },
            "description": "Get all recipients for a document, ordered by their signing order."
          },
          "response": [
            {
              "name": "Recipients List",
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "{\n  \"items\": [\n    {\n      \"id\": \"rec_abc123\",\n      \"name\": \"John Doe\",\n      \"email\": \"signer@example.com\",\n      \"role\": \"signer\",\n      \"order\": 1,\n      \"status\": \"pending\",\n      \"signatureMethod\": \"electronic\",\n      \"phone\": \"+14155552671\"\n    }\n  ],\n  \"pageInfo\": {\n    \"page\": 1,\n    \"limit\": 1,\n    \"total\": 1,\n    \"totalPages\": 1,\n    \"hasNext\": false,\n    \"hasPrevious\": false\n  }\n}"
            }
          ]
        },
        {
          "name": "Remove Recipient",
          "request": {
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/documents/{{envelopeId}}/recipients/{{recipientId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "documents",
                "{{envelopeId}}",
                "recipients",
                "{{recipientId}}"
              ]
            },
            "description": "Remove a specific recipient from a document by their recipient ID."
          },
          "response": [
            {
              "name": "Recipient Removed",
              "status": "No Content",
              "code": 204,
              "header": [],
              "body": ""
            }
          ]
        }
      ]
    },
    {
      "name": "Form Fields",
      "description": "Add interactive form fields to documents (text inputs, checkboxes, dropdowns, radio buttons, etc.). Form fields are filled by recipients during the signing process.\n\n**Supported field types:** `text`, `textarea`, `email`, `number`, `date`, `checkbox`, `radio`, `dropdown`, `signature`",
      "item": [
        {
          "name": "Save Form Fields",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "if (pm.response.code === 201) {",
                  "    var jsonData = pm.response.json();",
                  "    if (jsonData.fields && jsonData.fields.length > 0) {",
                  "        pm.collectionVariables.set('fieldId', jsonData.fields[0].id);",
                  "        console.log('First field ID saved:', jsonData.fields[0].id);",
                  "    }",
                  "}"
                ],
                "type": "text/javascript"
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"fields\": [\n    {\n      \"type\": \"text\",\n      \"fieldKey\": \"full_name\",\n      \"pageNumber\": 1,\n      \"x\": 100,\n      \"y\": 200,\n      \"width\": 250,\n      \"height\": 30,\n      \"label\": \"Full Name\",\n      \"required\": true,\n      \"placeholder\": \"Enter your full name\",\n      \"recipientId\": \"{{recipientId}}\",\n      \"fontFamily\": \"serif\",\n      \"fontWeight\": \"bold\",\n      \"fontSize\": 12,\n      \"textColor\": \"#1d4ed8\"\n    },\n    {\n      \"type\": \"email\",\n      \"fieldKey\": \"email_address\",\n      \"pageNumber\": 1,\n      \"x\": 100,\n      \"y\": 250,\n      \"width\": 250,\n      \"height\": 30,\n      \"label\": \"Email Address\",\n      \"required\": true,\n      \"recipientId\": \"{{recipientId}}\"\n    },\n    {\n      \"type\": \"date\",\n      \"fieldKey\": \"sign_date\",\n      \"pageNumber\": 1,\n      \"x\": 100,\n      \"y\": 300,\n      \"width\": 150,\n      \"height\": 30,\n      \"label\": \"Date\",\n      \"required\": true\n    },\n    {\n      \"type\": \"checkbox\",\n      \"fieldKey\": \"agree_terms\",\n      \"pageNumber\": 1,\n      \"x\": 100,\n      \"y\": 350,\n      \"width\": 200,\n      \"height\": 20,\n      \"label\": \"I agree to the terms and conditions\",\n      \"required\": true,\n      \"showLabel\": true,\n      \"defaultValue\": false,\n      \"checkboxSize\": 20,\n      \"checkboxLabelFontSize\": 12\n    },\n    {\n      \"type\": \"dropdown\",\n      \"fieldKey\": \"department\",\n      \"pageNumber\": 1,\n      \"x\": 100,\n      \"y\": 400,\n      \"width\": 200,\n      \"height\": 30,\n      \"label\": \"Department\",\n      \"options\": [\n        \"Engineering\",\n        \"Sales\",\n        \"Marketing\",\n        \"Legal\",\n        \"HR\"\n      ]\n    },\n    {\n      \"type\": \"radio\",\n      \"fieldKey\": \"contract_type\",\n      \"pageNumber\": 1,\n      \"x\": 100,\n      \"y\": 450,\n      \"width\": 200,\n      \"height\": 80,\n      \"label\": \"Contract Type\",\n      \"required\": true,\n      \"radioGroup\": {\n        \"options\": [\n          {\n            \"value\": \"full_time\",\n            \"label\": \"Full Time\"\n          },\n          {\n            \"value\": \"part_time\",\n            \"label\": \"Part Time\"\n          },\n          {\n            \"value\": \"contractor\",\n            \"label\": \"Contractor\"\n          }\n        ],\n        \"layout\": \"AUTO\",\n        \"direction\": \"VERTICAL\",\n        \"spacing\": 20,\n        \"radioSize\": 16,\n        \"labelFontSize\": 11\n      }\n    },\n    {\n      \"type\": \"number\",\n      \"fieldKey\": \"salary\",\n      \"pageNumber\": 1,\n      \"x\": 100,\n      \"y\": 550,\n      \"width\": 150,\n      \"height\": 30,\n      \"label\": \"Annual Salary\",\n      \"validation\": {\n        \"min\": 0,\n        \"max\": 1000000\n      }\n    },\n    {\n      \"type\": \"textarea\",\n      \"fieldKey\": \"notes\",\n      \"pageNumber\": 2,\n      \"x\": 100,\n      \"y\": 100,\n      \"width\": 400,\n      \"height\": 100,\n      \"label\": \"Additional Notes\",\n      \"placeholder\": \"Any additional comments...\",\n      \"multiline\": true\n    }\n  ],\n  \"replaceExisting\": true\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/documents/{{envelopeId}}/fields",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "documents",
                "{{envelopeId}}",
                "fields"
              ]
            },
            "description": "Create or replace form fields on a document. Document must be in `draft` status.\n\n**Field Types:**\n- `text` - Single-line text input\n- `textarea` - Multi-line text (set `multiline: true`)\n- `email` - Email input with validation\n- `number` - Numeric input (supports `validation.min`/`validation.max`)\n- `date` - Date picker\n- `checkbox` - Checkbox (use `showLabel: true` + `label` to display a label)\n- `radio` - Radio button group (requires `radioGroup` with options)\n- `dropdown` - Select dropdown (requires `options` array)\n- `signature` - Signature field\n\n**Assignment:**\n- `recipientId` - Assign a field to a specific recipient. If omitted, any recipient can fill it.\n\n**Options:**\n- `replaceExisting: true` (default) - Deletes all existing fields before creating new ones\n- `replaceExisting: false` - Appends fields to existing ones\n\n**Text styling (rendered into the signed PDF):**\n- `fontFamily` — `sans-serif` | `serif` | `monospace`\n- `fontWeight` — `normal` | `bold`; `fontStyle` — `normal` | `italic`\n- `fontSize` — 6-72 pt (omit for auto-sizing to the field height)\n- `textColor` — hex, e.g. `#1d4ed8`\n\n**Checkbox:** `checkboxSize` (px, box is square), `showLabel` + `label`, `checkboxLabelFontSize` (8-24 pt).\n\n**Radio groups (`radioGroup`):** `options[{value,label}]`, `direction` `VERTICAL`|`HORIZONTAL`, `spacing` (distance between option ORIGINS — top-to-top / left-to-left stride, not the gap), `radioSize` (button diameter, px), `labelFontSize` (pt, derived from radioSize when omitted). `layout: MANUAL` supports per-option `x`/`y`/`pageNumber`.\n\n`textarea` fields are always rendered multiline."
          },
          "response": [
            {
              "name": "Fields Saved",
              "status": "Created",
              "code": 201,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "{\n  \"message\": \"Form fields saved successfully\",\n  \"fields\": [\n    {\n      \"id\": \"fld_abc123\",\n      \"type\": \"text\",\n      \"fieldKey\": \"full_name\",\n      \"pageNumber\": 1,\n      \"x\": 100,\n      \"y\": 200,\n      \"width\": 250,\n      \"height\": 30,\n      \"label\": \"Full Name\",\n      \"required\": true,\n      \"readOnly\": false,\n      \"recipientId\": \"rec_abc123\"\n    }\n  ],\n  \"total\": 8\n}"
            }
          ]
        },
        {
          "name": "List Form Fields",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/documents/{{envelopeId}}/fields",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "documents",
                "{{envelopeId}}",
                "fields"
              ]
            },
            "description": "Get all form fields defined on a document, including their types, positions, labels, validation rules, and assigned recipients."
          },
          "response": [
            {
              "name": "Form Fields List",
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "{\n  \"items\": [\n    {\n      \"id\": \"fld_abc123\",\n      \"type\": \"text\",\n      \"fieldKey\": \"full_name\",\n      \"pageNumber\": 1,\n      \"x\": 100,\n      \"y\": 200,\n      \"width\": 250,\n      \"height\": 30,\n      \"label\": \"Full Name\",\n      \"required\": true,\n      \"readOnly\": false,\n      \"recipientId\": \"rec_abc123\",\n      \"defaultValue\": null,\n      \"placeholder\": \"Enter your full name\",\n      \"options\": null,\n      \"validation\": null,\n      \"multiline\": null,\n      \"showLabel\": null,\n      \"checkboxSize\": null,\n      \"checkboxLabelFontSize\": null,\n      \"radioGroup\": null\n    },\n    {\n      \"id\": \"fld_def456\",\n      \"type\": \"checkbox\",\n      \"fieldKey\": \"agree_terms\",\n      \"pageNumber\": 1,\n      \"x\": 100,\n      \"y\": 350,\n      \"width\": 200,\n      \"height\": 20,\n      \"label\": \"I agree to the terms and conditions\",\n      \"required\": true,\n      \"readOnly\": false,\n      \"recipientId\": null,\n      \"defaultValue\": false,\n      \"showLabel\": true,\n      \"checkboxSize\": 20\n    }\n  ],\n  \"total\": 2\n}"
            }
          ]
        },
        {
          "name": "Delete All Form Fields",
          "request": {
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/documents/{{envelopeId}}/fields",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "documents",
                "{{envelopeId}}",
                "fields"
              ]
            },
            "description": "Delete all form fields from a document. Document must be in `draft` status."
          },
          "response": [
            {
              "name": "Fields Deleted",
              "status": "No Content",
              "code": 204,
              "header": [],
              "body": ""
            }
          ]
        },
        {
          "name": "Delete Single Form Field",
          "request": {
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/documents/{{envelopeId}}/fields/{{fieldId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "documents",
                "{{envelopeId}}",
                "fields",
                "{{fieldId}}"
              ]
            },
            "description": "Delete a specific form field by its ID. Document must be in `draft` status."
          },
          "response": [
            {
              "name": "Field Deleted",
              "status": "No Content",
              "code": 204,
              "header": [],
              "body": ""
            }
          ]
        },
        {
          "name": "Get Filled Values",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/documents/{{envelopeId}}/fields/values",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "documents",
                "{{envelopeId}}",
                "fields",
                "values"
              ]
            },
            "description": "Get all filled form field values for a document. Shows which recipient filled each field and the value they entered."
          },
          "response": [
            {
              "name": "Filled Values",
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "{\n  \"items\": [\n    {\n      \"id\": \"val_abc123\",\n      \"fieldId\": \"fld_abc123\",\n      \"recipientId\": \"rec_abc123\",\n      \"value\": \"John Doe\",\n      \"filledAt\": \"2026-03-10T14:30:00.000Z\"\n    },\n    {\n      \"id\": \"val_def456\",\n      \"fieldId\": \"fld_def456\",\n      \"recipientId\": \"rec_abc123\",\n      \"value\": true,\n      \"filledAt\": \"2026-03-10T14:30:00.000Z\"\n    }\n  ],\n  \"total\": 2\n}"
            }
          ]
        }
      ]
    },
    {
      "name": "Signing Workflow",
      "description": "Send documents for signing, track signing progress, send reminders to recipients, and cancel signing workflows.",
      "item": [
        {
          "name": "Send Document",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/documents/{{envelopeId}}/send",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "documents",
                "{{envelopeId}}",
                "send"
              ]
            },
            "description": "Send the envelope to all recipients for signing. Transitions the envelope from `draft` to `pending` status and sends email notifications.\n\nNo request body is needed. Workflow settings (mode, verification, email notifications, redirect URL, etc.) are configured during envelope creation via `POST /documents`.\n\n**Prerequisites:**\n- Envelope must be in `draft` status\n- At least one signer or approver recipient must be added\n- PDF must be uploaded\n\n**Validations performed before sending:**\n- PDF signature positions must reference valid pages\n- Text-based signature placements are verified against PDF content\n- Credits are locked for the signing workflow WhatsApp notifications are sent alongside email when `workflow.whatsappNotifications` is enabled and recipients have a valid `phone`."
          },
          "response": [
            {
              "name": "Envelope Sent",
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "{\n  \"message\": \"Signing requests sent successfully\",\n  \"envelopeId\": \"abc123xyz\",\n  \"status\": \"pending\",\n  \"recipients\": [\n    {\n      \"id\": \"rec_abc123\",\n      \"name\": \"John Doe\",\n      \"email\": \"signer@example.com\",\n      \"role\": \"signer\",\n      \"order\": 1,\n      \"status\": \"pending\",\n      \"actionUrl\": \"https://app.signsecure.com/sign/abc123xyz?inviteToken=xxx&redirectTo=https%3A%2F%2Fapp.example.com%2Fsigning-complete\"\n    }\n  ],\n  \"workflow\": {\n    \"mode\": \"sequential\",\n    \"verificationMethod\": \"link_only\",\n    \"message\": \"Please review and sign this envelope.\",\n    \"reminderEveryHours\": 24,\n    \"expiresAt\": \"2026-04-10T23:59:59.000Z\",\n    \"redirectUrl\": \"https://app.example.com/signing-complete\"\n  }\n}"
            }
          ]
        },
        {
          "name": "Get Signing Progress",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/documents/{{envelopeId}}/status",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "documents",
                "{{envelopeId}}",
                "status"
              ]
            },
            "description": "Get the current signing progress of a document, including completion percentage and per-recipient status with timestamps."
          },
          "response": [
            {
              "name": "Signing Progress",
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "{\n  \"envelopeId\": \"abc123xyz\",\n  \"status\": \"pending\",\n  \"totalRecipients\": 2,\n  \"completedCount\": 1,\n  \"percentage\": 50,\n  \"recipients\": [\n    {\n      \"name\": \"John Doe\",\n      \"email\": \"signer@example.com\",\n      \"status\": \"signed\",\n      \"signedAt\": \"2026-03-10T14:00:00.000Z\",\n      \"order\": 1\n    },\n    {\n      \"name\": \"Jane Smith\",\n      \"email\": \"signer2@example.com\",\n      \"status\": \"pending\",\n      \"signedAt\": null,\n      \"order\": 2\n    }\n  ]\n}"
            }
          ]
        },
        {
          "name": "Resend Signing Invitation (Email + WhatsApp)",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/documents/{{envelopeId}}/recipients/{{recipientId}}/reminders",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "documents",
                "{{envelopeId}}",
                "recipients",
                "{{recipientId}}",
                "reminders"
              ]
            },
            "description": "Resend the signing invitation through all enabled channels in one request. Email requires emailNotifications: all and an email; WhatsApp requires whatsappNotifications: all and an E.164 phone. The recipient must be pending, not CC, unexpired, and ready in signing order. A shared five-minute cooldown applies even after delivery failure. HTTP 429 / TOO_MANY_REQUESTS means wait before retrying. Returns per-channel queue outcomes and resendAvailableAt; queued does not mean delivered. No request body or channel selector is needed."
          },
          "response": [
            {
              "name": "Invitation channels queued",
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "{\n  \"message\": \"Invitation reminders queued\",\n  \"recipientId\": \"rec_example\",\n  \"recipientEmail\": \"signer@example.com\",\n  \"recipientPhone\": \"+14155552671\",\n  \"deliveries\": [\n    {\n      \"channel\": \"email\",\n      \"status\": \"queued\"\n    },\n    {\n      \"channel\": \"whatsapp\",\n      \"status\": \"queued\"\n    }\n  ],\n  \"resendAvailableAt\": \"2026-09-10T12:05:00.000Z\",\n  \"remindersSent\": 1\n}"
            },
            {
              "name": "Shared resend cooldown",
              "status": "Too Many Requests",
              "code": 429,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "{\n  \"code\": \"TOO_MANY_REQUESTS\",\n  \"message\": \"Please wait 5 minute(s) before resending this invitation.\",\n  \"requestId\": \"req_example\",\n  \"timestamp\": \"2026-09-10T12:00:00.000Z\"\n}"
            }
          ]
        },
        {
          "name": "Cancel Signing",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/documents/{{envelopeId}}/cancel",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "documents",
                "{{envelopeId}}",
                "cancel"
              ]
            },
            "description": "Cancel the signing process for a document. All pending signing actions are voided."
          },
          "response": [
            {
              "name": "Signing Cancelled",
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "{\n  \"message\": \"Signing cancelled successfully\",\n  \"envelopeId\": \"abc123xyz\",\n  \"status\": \"rejected\"\n}"
            }
          ]
        }
      ]
    },
    {
      "name": "E-Stamp",
      "description": "Create an envelope that purchases and prepends an e-stamp before the signing workflow begins. Sending is asynchronous: track progress with the standard status endpoint or request an immediate provider check.",
      "item": [
        {
          "name": "Create E-Stamped Document",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "if (pm.response.code === 201) {",
                  "    const jsonData = pm.response.json();",
                  "    pm.collectionVariables.set('envelopeId', jsonData.id);",
                  "}"
                ],
                "type": "text/javascript"
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"fileName\": \"agreement.pdf\",\n  \"title\": \"E-Stamped Service Agreement\",\n  \"recipients\": [\n    {\n      \"name\": \"Authorized Signer\",\n      \"email\": \"signer@example.com\",\n      \"order\": 1,\n      \"role\": \"signer\",\n      \"signatureMethod\": \"electronic\",\n      \"signaturePlacement\": {\n        \"type\": \"text\",\n        \"searchText\": \"Authorized Signatory\",\n        \"position\": \"below\"\n      }\n    }\n  ],\n  \"workflow\": {\n    \"mode\": \"sequential\",\n    \"estampEnabled\": true,\n    \"estampConfig\": {\n      \"state\": \"KA\",\n      \"article\": \"Affidavit\",\n      \"amount\": \"100\",\n      \"considerationAmount\": \"1000\",\n      \"payee\": \"first-party\",\n      \"hardcopy\": \"n\",\n      \"firstParty\": {\n        \"name\": \"Acme Private Limited\",\n        \"email\": \"legal@acme.example\",\n        \"mobile\": \"\",\n        \"address\": \"Bengaluru, Karnataka\"\n      },\n      \"secondParty\": {\n        \"name\": \"Example Industries\",\n        \"email\": \"legal@example.test\",\n        \"mobile\": \"\",\n        \"address\": \"Mumbai, Maharashtra\"\n      }\n    }\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/documents",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "documents"
              ]
            },
            "description": "Creates an e-stamped draft. Upload the PDF using the returned presigned POST before sending. The text-placement example is resolved case-insensitively at send time; the e-stamp cover page is accounted for automatically. Use the provider's exact instrument name for `article`."
          },
          "response": []
        },
        {
          "name": "Send E-Stamped Document",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/documents/{{envelopeId}}/send",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "documents",
                "{{envelopeId}}",
                "send"
              ]
            },
            "description": "Queues the e-stamp purchase and returns HTTP 202 with status `estamping`. Signing invitations are sent only after stamping completes."
          },
          "response": [
            {
              "name": "E-Stamp Queued",
              "status": "Accepted",
              "code": 202,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "{\n  \"success\": true,\n  \"estamp\": true,\n  \"estampStatus\": \"queued\",\n  \"message\": \"E-stamp requested. Recipients will be notified when the document is ready.\",\n  \"envelopeId\": \"env_abc123\",\n  \"status\": \"estamping\"\n}"
            }
          ]
        },
        {
          "name": "Get E-Stamp Progress",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/documents/{{envelopeId}}/status",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "documents",
                "{{envelopeId}}",
                "status"
              ]
            },
            "description": "Reads the normal signing status plus the optional `estamp` progress object. Subscribe to `document.estamp.started`, `document.estamp.completed`, and `document.estamp.failed` webhooks for lifecycle updates, and use this request for reconciliation. Completed stamping automatically starts the signing workflow."
          },
          "response": []
        },
        {
          "name": "Check E-Stamp Status Now",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/documents/{{envelopeId}}/estamp/check",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "documents",
                "{{envelopeId}}",
                "estamp",
                "check"
              ]
            },
            "description": "Requests an immediate asynchronous provider check instead of waiting for the hourly safety poll. It does not block for the provider response; call Get E-Stamp Progress afterward."
          },
          "response": [
            {
              "name": "Check Queued",
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "{\n  \"envelopeId\": \"env_abc123\",\n  \"queued\": true,\n  \"estampStatus\": \"pending\",\n  \"message\": \"E-stamp status check queued\"\n}"
            }
          ]
        }
      ]
    },
    {
      "name": "Templates",
      "description": "Create, inspect, edit, archive, restore, duplicate, and use PDF templates with recipient assignments and sender-prefill values.",
      "item": [
        {
          "name": "Create Template",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "if (pm.response.code === 201) {",
                  "    var jsonData = pm.response.json();",
                  "    pm.collectionVariables.set('templateId', jsonData.id);",
                  "    console.log('Template ID saved:', jsonData.id);",
                  "}"
                ],
                "type": "text/javascript"
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Customer agreement\",\n  \"fileName\": \"agreement.pdf\",\n  \"description\": \"Reusable agreement with sender prefill and a recipient signature.\",\n  \"recipients\": [\n    {\n      \"id\": \"signer\",\n      \"name\": \"Customer\",\n      \"role\": \"signer\",\n      \"order\": 1,\n      \"signatureMethod\": \"electronic\"\n    }\n  ],\n  \"formFields\": [\n    {\n      \"id\": \"company\",\n      \"fieldKey\": \"company_name\",\n      \"type\": \"text\",\n      \"pageNumber\": 1,\n      \"x\": 40,\n      \"y\": 80,\n      \"width\": 200,\n      \"height\": 24,\n      \"required\": true,\n      \"defaultValue\": \"Example Ltd\",\n      \"assignee\": {\n        \"type\": \"sender_prefill\"\n      }\n    },\n    {\n      \"id\": \"customer_signature\",\n      \"fieldKey\": \"customer_signature\",\n      \"type\": \"signature\",\n      \"pageNumber\": 1,\n      \"x\": 40,\n      \"y\": 400,\n      \"width\": 200,\n      \"height\": 50,\n      \"required\": true,\n      \"assignee\": {\n        \"type\": \"recipient\",\n        \"templateRecipientId\": \"signer\"\n      }\n    }\n  ],\n  \"workflow\": {\n    \"mode\": \"sequential\",\n    \"verificationMethod\": \"link_only\",\n    \"emailNotifications\": \"all\",\n    \"whatsappNotifications\": \"all\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/templates",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "templates"
              ]
            },
            "description": "Create a reusable PDF template with recipient placeholders, a sender-prefill field, and a signature field assigned by templateRecipientId. Placeholder recipients need no email or phone. Upload the PDF using every returned upload.fields entry and the file last before using this template. Coordinates are PDF points and pages start at 1. The company field has a sample default so CSV launches can use it; override it through prefillValues for each document as needed."
          },
          "response": [
            {
              "name": "Template Created",
              "status": "Created",
              "code": 201,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "{\n  \"id\": \"tmpl_abc123\",\n  \"name\": \"Customer agreement\",\n  \"fileName\": \"agreement.pdf\",\n  \"fileKey\": \"templates/user123/tmpl_abc123/agreement.pdf\",\n  \"upload\": {\n    \"url\": \"https://bucket.s3.amazonaws.com/\",\n    \"fields\": {\n      \"key\": \"templates/user123/tmpl_abc123/agreement.pdf\",\n      \"Content-Type\": \"application/pdf\",\n      \"x-amz-server-side-encryption\": \"AES256\",\n      \"X-Amz-Algorithm\": \"AWS4-HMAC-SHA256\",\n      \"X-Amz-Credential\": \"...\",\n      \"Policy\": \"base64-encoded-policy\",\n      \"X-Amz-Signature\": \"...\"\n    }\n  },\n  \"expiresIn\": 3600,\n  \"maxFileSize\": 10485760,\n  \"createdAt\": \"2026-03-10T12:00:00.000Z\",\n  \"recipientsCount\": 1\n}"
            }
          ]
        },
        {
          "name": "List All Templates",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/templates?page=1&limit=50",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "templates"
              ],
              "query": [
                {
                  "key": "page",
                  "value": "1",
                  "description": "Page number (default: 1)"
                },
                {
                  "key": "limit",
                  "value": "50",
                  "description": "Items per page (default: 50)"
                },
                {
                  "key": "status",
                  "value": "active",
                  "description": "Filter by status: active, archived",
                  "disabled": true
                },
                {
                  "key": "search",
                  "value": "",
                  "description": "Search templates by name",
                  "disabled": true
                },
                {
                  "key": "sortBy",
                  "value": "createdAt",
                  "description": "Sort by: name, createdAt, usageCount",
                  "disabled": true
                },
                {
                  "key": "sortOrder",
                  "value": "desc",
                  "description": "Sort order: asc, desc",
                  "disabled": true
                }
              ]
            },
            "description": "List all templates with pagination, filtering, and sorting.\n\n**Filters:**\n- `status`: `active` or `archived`\n- `search`: Search by template name\n\n**Sorting:**\n- `sortBy`: `name`, `createdAt`, `usageCount`\n- `sortOrder`: `asc`, `desc`"
          },
          "response": [
            {
              "name": "Templates List",
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "{\n  \"items\": [\n    {\n      \"id\": \"tmpl_abc123\",\n      \"name\": \"Customer agreement\",\n      \"description\": \"Reusable agreement with sender prefill and a recipient signature.\",\n      \"fileName\": \"agreement.pdf\",\n      \"status\": \"active\",\n      \"usageCount\": 5,\n      \"recipientsCount\": 1,\n      \"createdAt\": \"2026-03-10T12:00:00.000Z\",\n      \"updatedAt\": \"2026-03-10T12:00:00.000Z\"\n    }\n  ],\n  \"pageInfo\": {\n    \"page\": 1,\n    \"limit\": 50,\n    \"total\": 1,\n    \"totalPages\": 1,\n    \"hasNext\": false,\n    \"hasPrevious\": false\n  }\n}"
            }
          ]
        },
        {
          "name": "Get Template by ID",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/templates/{{templateId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "templates",
                "{{templateId}}"
              ]
            },
            "description": "Read recipients, their stable IDs, formFields, workflow, status, and usage statistics. Use this configuration to construct recipientMapping and prefillValues. Generated field/recipient IDs must be read from this response before use."
          },
          "response": [
            {
              "name": "Template Details",
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "{\n  \"id\": \"tmpl_abc123\",\n  \"name\": \"Customer agreement\",\n  \"description\": \"Reusable agreement with sender prefill and a recipient signature.\",\n  \"fileName\": \"agreement.pdf\",\n  \"fileSize\": 204800,\n  \"status\": \"active\",\n  \"recipients\": [\n    {\n      \"id\": \"signer\",\n      \"name\": \"Customer\",\n      \"role\": \"signer\",\n      \"order\": 1,\n      \"signatureMethod\": \"electronic\"\n    }\n  ],\n  \"workflow\": {\n    \"mode\": \"sequential\",\n    \"verificationMethod\": \"link_only\",\n    \"emailNotifications\": \"all\",\n    \"whatsappNotifications\": \"all\"\n  },\n  \"usageCount\": 5,\n  \"lastUsedAt\": \"2026-03-09T10:00:00.000Z\",\n  \"createdAt\": \"2026-03-01T12:00:00.000Z\",\n  \"updatedAt\": \"2026-03-09T10:00:00.000Z\",\n  \"formFields\": [\n    {\n      \"id\": \"company\",\n      \"fieldKey\": \"company_name\",\n      \"type\": \"text\",\n      \"pageNumber\": 1,\n      \"x\": 40,\n      \"y\": 80,\n      \"width\": 200,\n      \"height\": 24,\n      \"required\": true,\n      \"defaultValue\": \"Example Ltd\",\n      \"assignee\": {\n        \"type\": \"sender_prefill\"\n      }\n    },\n    {\n      \"id\": \"customer_signature\",\n      \"fieldKey\": \"customer_signature\",\n      \"type\": \"signature\",\n      \"pageNumber\": 1,\n      \"x\": 40,\n      \"y\": 400,\n      \"width\": 200,\n      \"height\": 50,\n      \"required\": true,\n      \"assignee\": {\n        \"type\": \"recipient\",\n        \"templateRecipientId\": \"signer\"\n      }\n    }\n  ]\n}"
            }
          ]
        },
        {
          "name": "Get Document Creation Payload",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/templates/{{templateId}}/document-payload",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "templates",
                "{{templateId}}",
                "document-payload"
              ]
            },
            "description": "Get an editable request body for POST /templates/{{templateId}}/documents. The response contains title, recipientMapping with stable template recipient IDs and example contacts, and prefillValues for sender fields. Replace example contact details and prefill values before generating the document. Requires template read access."
          },
          "response": []
        },
        {
          "name": "Update Template",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Updated customer agreement\",\n  \"description\": \"Revised agreement wording\",\n  \"formFields\": [\n    {\n      \"id\": \"company\",\n      \"fieldKey\": \"company_name\",\n      \"type\": \"text\",\n      \"pageNumber\": 1,\n      \"x\": 40,\n      \"y\": 80,\n      \"width\": 200,\n      \"height\": 24,\n      \"required\": true,\n      \"defaultValue\": \"Example Ltd\",\n      \"assignee\": {\n        \"type\": \"sender_prefill\"\n      }\n    },\n    {\n      \"id\": \"customer_signature\",\n      \"fieldKey\": \"customer_signature\",\n      \"type\": \"signature\",\n      \"pageNumber\": 1,\n      \"x\": 40,\n      \"y\": 400,\n      \"width\": 200,\n      \"height\": 50,\n      \"required\": true,\n      \"assignee\": {\n        \"type\": \"recipient\",\n        \"templateRecipientId\": \"signer\"\n      }\n    }\n  ],\n  \"workflow\": {\n    \"mode\": \"sequential\",\n    \"verificationMethod\": \"link_only\",\n    \"emailNotifications\": \"all\",\n    \"whatsappNotifications\": \"all\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/templates/{{templateId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "templates",
                "{{templateId}}"
              ]
            },
            "description": "Update metadata, recipients, formFields, workflow, or status. Supply at least one property. Arrays replace stored configuration; formFields: [] clears all fields. If recipient IDs change, update their field assignments in the same request. Requires template ownership and template management access."
          },
          "response": [
            {
              "name": "Template Updated",
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "{\n  \"id\": \"tmpl_abc123\",\n  \"name\": \"Updated customer agreement\",\n  \"description\": \"Revised agreement wording\",\n  \"recipientsCount\": 1,\n  \"updatedAt\": \"2026-03-10T13:00:00.000Z\",\n  \"status\": \"active\",\n  \"formFieldsCount\": 2\n}"
            }
          ]
        },
        {
          "name": "Archive Template",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/templates/{{templateId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "templates",
                "{{templateId}}"
              ]
            },
            "description": "Prevent new uses while preserving the reusable configuration. Existing documents remain independent.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"status\": \"archived\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [
            {
              "name": "Archived",
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "{\n  \"id\": \"tmpl_abc123\",\n  \"name\": \"Customer agreement\",\n  \"description\": \"Reusable agreement with sender prefill and a recipient signature.\",\n  \"recipientsCount\": 1,\n  \"status\": \"archived\",\n  \"formFieldsCount\": 2,\n  \"updatedAt\": \"2026-09-10T12:00:00.000Z\"\n}"
            }
          ]
        },
        {
          "name": "Restore Template",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/templates/{{templateId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "templates",
                "{{templateId}}"
              ]
            },
            "description": "Restore an archived template so it can create new draft documents.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"status\": \"active\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [
            {
              "name": "Active",
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "{\n  \"id\": \"tmpl_abc123\",\n  \"name\": \"Customer agreement\",\n  \"description\": \"Reusable agreement with sender prefill and a recipient signature.\",\n  \"recipientsCount\": 1,\n  \"status\": \"active\",\n  \"formFieldsCount\": 2,\n  \"updatedAt\": \"2026-09-10T12:00:00.000Z\"\n}"
            }
          ]
        },
        {
          "name": "Delete Template",
          "request": {
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/templates/{{templateId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "templates",
                "{{templateId}}"
              ]
            },
            "description": "Permanently delete a template."
          },
          "response": [
            {
              "name": "Template Deleted",
              "status": "No Content",
              "code": 204,
              "header": [],
              "body": ""
            }
          ]
        },
        {
          "name": "Create Document from Template",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "if (pm.response.code === 201) {",
                  "    var jsonData = pm.response.json();",
                  "    pm.collectionVariables.set('envelopeId', jsonData.envelopeId);",
                  "    console.log('Envelope ID saved:', jsonData.envelopeId);",
                  "}"
                ],
                "type": "text/javascript"
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"title\": \"NDA - Acme Corp\",\n  \"recipientMapping\": [\n    {\n      \"templateRecipientId\": \"signer\",\n      \"name\": \"Alice Johnson\",\n      \"email\": \"alice@acmecorp.com\",\n      \"phone\": \"+14155552671\"\n    }\n  ],\n  \"workflow\": {\n    \"mode\": \"sequential\",\n    \"verificationMethod\": \"link_only\",\n    \"message\": \"Please sign this NDA.\",\n    \"emailNotifications\": \"all\",\n    \"whatsappNotifications\": \"all\"\n  },\n  \"prefillValues\": [\n    {\n      \"fieldId\": \"company\",\n      \"fieldKey\": \"company_name\",\n      \"value\": \"Acme Corp\"\n    }\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/templates/{{templateId}}/documents",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "templates",
                "{{templateId}}",
                "documents"
              ]
            },
            "description": "Create a draft using an active, uploaded template. Map every recipient exactly once to a real email or E.164 phone. Sender-prefill entries must match both fieldId and fieldKey. Missing required values, unknown or duplicate mappings return 400; archived templates return 409. Saves envelopeId; send the draft separately through POST /documents/{{envelopeId}}/send."
          },
          "response": [
            {
              "name": "Envelope Created from Template",
              "status": "Created",
              "code": 201,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "{\n  \"envelopeId\": \"doc_xyz789\",\n  \"documentId\": \"doc_xyz789\",\n  \"message\": \"Document created successfully from template\",\n  \"status\": \"draft\"\n}"
            }
          ]
        },
        {
          "name": "Duplicate Template",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"newName\": \"NDA Template (Copy)\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/templates/{{templateId}}/copies",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "templates",
                "{{templateId}}",
                "copies"
              ]
            },
            "description": "Copy the selected template. Saves templateCopyId separately so the original templateId remains available."
          },
          "response": [
            {
              "name": "Template Duplicated",
              "status": "Created",
              "code": 201,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "{\n  \"id\": \"tmpl_copy456\",\n  \"name\": \"NDA Template (Copy)\",\n  \"createdAt\": \"2026-03-10T13:00:00.000Z\"\n}"
            }
          ],
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (pm.response.code === 201) {",
                  "    const data = pm.response.json();",
                  "    if (data.id) pm.collectionVariables.set(\"templateCopyId\", data.id);",
                  "}"
                ]
              }
            }
          ]
        }
      ]
    },
    {
      "name": "Credits",
      "description": "Check credit balance, view transaction history, and get usage statistics.\n\n**Pricing model:** every signature is billed **per signer** at the rates of the account's assigned **pricing tier** (default list price: envelope base 1, Aadhaar 20 per signer, electronic 10 per signer, DSC 10 per signer). Rates are locked into a per-envelope snapshot when the envelope is sent, so later tier changes never affect in-flight envelopes.",
      "item": [
        {
          "name": "Get Balance",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/credits/balance",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "credits",
                "balance"
              ]
            },
            "description": "Get the current credit balance. The response shape depends on the API key's context:\n\n- **Personal API key** — returns `context: \"personal\"` with your personal credit balance.\n- **Organization API key (owner/admin)** — returns `context: \"organization\"` with the org wallet's spendable credits, wallet balance, and totals.\n- **Organization API key (member)** — returns `context: \"organization\"` with remaining allocated credits."
          },
          "response": [
            {
              "name": "Personal Balance",
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "{\n  \"context\": \"personal\",\n  \"balance\": 150,\n  \"totalUsed\": 50,\n  \"totalAdded\": 200\n}"
            },
            {
              "name": "Organization Balance (Owner/Admin)",
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "{\n  \"context\": \"organization\",\n  \"organizationId\": \"org_abc123\",\n  \"balance\": 4500,\n  \"walletBalance\": 5000,\n  \"totalUsed\": 500,\n  \"totalAdded\": 5000\n}"
            },
            {
              "name": "Organization Balance (Member)",
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "{\n  \"context\": \"organization\",\n  \"organizationId\": \"org_abc123\",\n  \"balance\": 80,\n  \"allocated\": 100,\n  \"used\": 20\n}"
            }
          ]
        },
        {
          "name": "List Transactions",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/credits/transactions?page=1&limit=50",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "credits",
                "transactions"
              ],
              "query": [
                {
                  "key": "page",
                  "value": "1",
                  "description": "Page number (default: 1)"
                },
                {
                  "key": "limit",
                  "value": "50",
                  "description": "Items per page (default: 50)"
                },
                {
                  "key": "type",
                  "value": "consume",
                  "description": "Filter by type: consume, add, refund",
                  "disabled": true
                }
              ]
            },
            "description": "List credit transactions with pagination and optional type filtering.\n\n**Transaction Types:**\n- `consume` - Credits used for signing\n- `add` - Credits purchased or granted\n- `refund` - Credits refunded"
          },
          "response": [
            {
              "name": "Credit Transactions",
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "{\n  \"items\": [\n    {\n      \"id\": \"txn_abc123\",\n      \"type\": \"consume\",\n      \"amount\": -5,\n      \"balanceAfter\": 145,\n      \"reason\": \"document_signing\",\n      \"description\": \"Credits consumed for document signing\",\n      \"documentId\": \"doc_xyz789\",\n      \"signatureMethod\": \"electronic\",\n      \"source\": \"api\",\n      \"createdAt\": \"2026-03-10T14:00:00.000Z\"\n    },\n    {\n      \"id\": \"txn_def456\",\n      \"type\": \"add\",\n      \"amount\": 200,\n      \"balanceAfter\": 200,\n      \"reason\": \"purchase\",\n      \"description\": \"Credits purchased\",\n      \"documentId\": null,\n      \"signatureMethod\": null,\n      \"source\": \"billing\",\n      \"createdAt\": \"2026-03-01T10:00:00.000Z\"\n    }\n  ],\n  \"pageInfo\": {\n    \"page\": 1,\n    \"limit\": 50,\n    \"total\": 2,\n    \"totalPages\": 1,\n    \"hasNext\": false,\n    \"hasPrevious\": false\n  }\n}"
            }
          ]
        },
        {
          "name": "Get Usage Statistics",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/credits/usage",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "credits",
                "usage"
              ],
              "query": [
                {
                  "key": "startDate",
                  "value": "2026-01-01T00:00:00.000Z",
                  "description": "Start date for usage period (ISO 8601)",
                  "disabled": true
                },
                {
                  "key": "endDate",
                  "value": "2026-03-10T23:59:59.000Z",
                  "description": "End date for usage period (ISO 8601)",
                  "disabled": true
                }
              ]
            },
            "description": "Get credit usage statistics, optionally filtered by date range. Shows total credits consumed and a breakdown by reason."
          },
          "response": [
            {
              "name": "Credit Usage",
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "{\n  \"totalUsed\": 50,\n  \"period\": {\n    \"startDate\": \"2026-01-01T00:00:00.000Z\",\n    \"endDate\": \"2026-03-10T23:59:59.000Z\"\n  },\n  \"breakdown\": {\n    \"document_signing\": 35,\n    \"aadhaar_esign\": 15\n  }\n}"
            }
          ]
        }
      ]
    },
    {
      "name": "Reusable Workflows Jobs",
      "description": "Versioned execution workflows and individual runs. Requires workflows:read/write permissions.",
      "item": [
        {
          "name": "List Workflows",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/workflows",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "workflows"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Create Workflow",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"NDA approval\",\n  \"config\": {\n    \"documents\": [{ \"templateId\": \"{{templateId}}\", \"label\": \"NDA\" }],\n    \"participants\": [{\n      \"key\": \"signer\",\n      \"label\": \"Signer\",\n      \"order\": 1,\n      \"signatureMethod\": \"electronic\"\n    }],\n    \"execution\": { \"mode\": \"sequential\" },\n    \"approvalStages\": []\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/workflows",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "workflows"
              ]
            },
            "description": "Create a draft definition and version; saves workflowId and workflowVersionId. Upload the example template first. Participant keys must match the template recipient IDs: this collection uses signer."
          },
          "response": [],
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (pm.response.code === 201) {",
                  "    const data = pm.response.json();",
                  "    if (data.definition && data.definition.id) pm.collectionVariables.set(\"workflowId\", data.definition && data.definition.id);",
                  "    if (data.version && data.version.id) pm.collectionVariables.set(\"workflowVersionId\", data.version && data.version.id);",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "Get Workflow",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/workflows/{{workflowId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "workflows",
                "{{workflowId}}"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Update Draft",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"description\": \"Approved NDA execution policy\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/workflows/{{workflowId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "workflows",
                "{{workflowId}}"
              ]
            }
          },
          "response": [],
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (pm.response.code === 200) {",
                  "    const data = pm.response.json();",
                  "    if (data.draftVersion && data.draftVersion.id) pm.collectionVariables.set(\"workflowVersionId\", data.draftVersion && data.draftVersion.id);",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "Publish Workflow",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/workflows/{{workflowId}}/publish",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "workflows",
                "{{workflowId}}",
                "publish"
              ]
            },
            "description": "Validate and publish the draft. Saves the published workflowVersionId. The source template must exist, be uploaded, and its recipient IDs must match participant keys."
          },
          "response": [],
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (pm.response.code === 200) {",
                  "    const data = pm.response.json();",
                  "    if (data.id) pm.collectionVariables.set(\"workflowVersionId\", data.id);",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "Launch Workflow",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"title\": \"NDA \\u2014 Acme\",\n  \"recipients\": [\n    {\n      \"participantKey\": \"signer\",\n      \"name\": \"Asha Rao\",\n      \"email\": \"asha@example.com\"\n    }\n  ],\n  \"idempotencyKey\": \"{{workflowRunKey}}\",\n  \"prefillValues\": [\n    {\n      \"fieldId\": \"company\",\n      \"fieldKey\": \"company_name\",\n      \"value\": \"Acme Corp\"\n    }\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/workflows/{{workflowId}}/runs",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "workflows",
                "{{workflowId}}",
                "runs"
              ]
            },
            "description": "Launch the published workflow. This may send signing invitations when approval and sender-confirmation rules allow. Keep workflowRunKey unchanged when retrying the same launch. Saves envelopeId."
          },
          "response": [],
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (pm.response.code === 201) {",
                  "    const data = pm.response.json();",
                  "    if (data.envelopeId) pm.collectionVariables.set(\"envelopeId\", data.envelopeId);",
                  "    if (data.workflowVersionId) pm.collectionVariables.set(\"workflowVersionId\", data.workflowVersionId);",
                  "}"
                ]
              }
            }
          ]
        }
      ]
    },
    {
      "name": "Reports",
      "description": "Export scoped signing activity summaries.",
      "item": [
        {
          "name": "Download Report Summary CSV",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "text/csv"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/reports/summary.csv",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "reports",
                "summary.csv"
              ],
              "query": [
                {
                  "key": "from",
                  "value": "2026-09-01T00:00:00Z",
                  "disabled": true
                },
                {
                  "key": "to",
                  "value": "2026-09-30T23:59:59Z",
                  "disabled": true
                },
                {
                  "key": "workflowDefinitionId",
                  "value": "{{workflowId}}",
                  "disabled": true
                },
                {
                  "key": "status",
                  "value": "completed",
                  "disabled": true
                },
                {
                  "key": "createdVia",
                  "value": "api",
                  "disabled": true
                }
              ]
            },
            "description": "Export report summary CSV for the API key scope. Optional filters: from/to (ISO dates), workflowDefinitionId, status, and createdVia. Requires reports:read and reports.view in a workspace."
          },
          "response": []
        }
      ]
    },
    {
      "name": "Workflows (End-to-End)",
      "description": "End-to-end workflow examples combining multiple API calls.",
      "item": [
        {
          "name": "Complete Signing Flow",
          "item": [
            {
              "name": "1. Create Document",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "exec": [
                      "if (pm.response.code === 201) {",
                      "    var jsonData = pm.response.json();",
                      "    pm.collectionVariables.set('envelopeId', jsonData.id);",
                      "    console.log('Envelope created:', jsonData.id);",
                      "}"
                    ],
                    "type": "text/javascript"
                  }
                }
              ],
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"fileName\": \"agreement.pdf\",\n  \"title\": \"Partnership Agreement\",\n  \"workflow\": {\n    \"mode\": \"sequential\",\n    \"verificationMethod\": \"link_only\",\n    \"message\": \"Please review and sign this partnership agreement.\"\n  }\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{baseUrl}}/documents",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "documents"
                  ]
                },
                "description": "Step 1: Create an envelope record and get the presigned POST upload configuration. Upload your PDF using the returned url and fields via a multipart form POST."
              },
              "response": []
            },
            {
              "name": "2. Add Recipients",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "exec": [
                      "if (pm.response.code === 201) {",
                      "    var jsonData = pm.response.json();",
                      "    if (jsonData.recipients && jsonData.recipients.length > 0) {",
                      "        pm.collectionVariables.set('recipientId', jsonData.recipients[0].id);",
                      "    }",
                      "}"
                    ],
                    "type": "text/javascript"
                  }
                }
              ],
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"recipients\": [\n    {\n      \"email\": \"partner1@example.com\",\n      \"name\": \"Partner One\",\n      \"order\": 1,\n      \"role\": \"signer\",\n      \"signatureMethod\": \"electronic\",\n      \"signaturePlacement\": {\n        \"type\": \"text\",\n        \"searchText\": \"Partner 1 Signature\",\n        \"pages\": [\n          2\n        ],\n        \"position\": \"below\"\n      },\n      \"phone\": \"+14155552671\"\n    },\n    {\n      \"email\": \"partner2@example.com\",\n      \"name\": \"Partner Two\",\n      \"order\": 2,\n      \"role\": \"signer\",\n      \"signatureMethod\": \"electronic\",\n      \"signaturePlacement\": {\n        \"type\": \"text\",\n        \"searchText\": \"Partner 2 Signature\",\n        \"pages\": [\n          2\n        ],\n        \"position\": \"below\"\n      }\n    }\n  ],\n  \"replaceExisting\": true\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{baseUrl}}/documents/{{envelopeId}}/recipients",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "documents",
                    "{{envelopeId}}",
                    "recipients"
                  ]
                },
                "description": "Step 2: Add recipients (signers, approvers, CC) to the envelope."
              },
              "response": []
            },
            {
              "name": "3. Add Form Fields (Optional)",
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"fields\": [\n    {\n      \"type\": \"text\",\n      \"fieldKey\": \"company_name\",\n      \"pageNumber\": 1,\n      \"x\": 100,\n      \"y\": 150,\n      \"width\": 250,\n      \"height\": 30,\n      \"label\": \"Company Name\",\n      \"required\": true,\n      \"recipientId\": \"{{recipientId}}\"\n    },\n    {\n      \"type\": \"date\",\n      \"fieldKey\": \"effective_date\",\n      \"pageNumber\": 1,\n      \"x\": 100,\n      \"y\": 200,\n      \"width\": 150,\n      \"height\": 30,\n      \"label\": \"Effective Date\",\n      \"required\": true\n    }\n  ],\n  \"replaceExisting\": true\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{baseUrl}}/documents/{{envelopeId}}/fields",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "documents",
                    "{{envelopeId}}",
                    "fields"
                  ]
                },
                "description": "Step 3 (Optional): Add form fields that recipients must fill out during signing."
              },
              "response": []
            },
            {
              "name": "4. Send for Signing",
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{baseUrl}}/documents/{{envelopeId}}/send",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "documents",
                    "{{envelopeId}}",
                    "send"
                  ]
                },
                "description": "Send the uploaded draft using workflow settings saved during creation. The send endpoint accepts send options, not a workflow object. This request queues real signing invitations."
              },
              "response": []
            },
            {
              "name": "5. Check Signing Progress",
              "request": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{baseUrl}}/documents/{{envelopeId}}/status",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "documents",
                    "{{envelopeId}}",
                    "status"
                  ]
                },
                "description": "Step 5: Poll the signing status to track completion progress."
              },
              "response": []
            },
            {
              "name": "6. Download Signed Document",
              "request": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{baseUrl}}/documents/{{envelopeId}}/file",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "documents",
                    "{{envelopeId}}",
                    "file"
                  ]
                },
                "description": "Step 6: Once signing is complete, download the signed document."
              },
              "response": []
            }
          ],
          "description": "Complete end-to-end signing workflow:\n1. Create an envelope record\n2. Upload the PDF using the presigned POST (multipart form POST to S3)\n3. Add recipients\n4. Add form fields (optional)\n5. Send for signing\n6. Poll status\n7. Download signed document"
        }
      ]
    }
  ]
}