{
  "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```",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "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": "bulkJobId",
      "value": "",
      "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": "Envelopes",
      "description": "Create, read, update, and delete envelopes. Manage file uploads and downloads.",
      "item": [
        {
          "name": "Create Envelope",
          "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);",
                  "    console.log('Upload POST URL:', jsonData.upload.url);",
                  "}"
                ],
                "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}}/envelopes",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "envelopes"
              ]
            },
            "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 Envelope (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}}/envelopes",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "envelopes"
              ]
            },
            "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 Envelopes",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/envelopes?page=1&limit=50",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "envelopes"
              ],
              "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 Envelope by ID",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/envelopes/{{envelopeId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "envelopes",
                "{{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 Envelope 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}}/envelopes/{{envelopeId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "envelopes",
                "{{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 Envelope",
          "request": {
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/envelopes/{{envelopeId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "envelopes",
                "{{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}}/envelopes/{{envelopeId}}/uploads",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "envelopes",
                "{{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}}/envelopes/{{envelopeId}}/file",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "envelopes",
                "{{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": "Envelope 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}}/envelopes/{{envelopeId}}/recipients",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "envelopes",
                "{{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}}/envelopes/{{envelopeId}}/recipients",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "envelopes",
                "{{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    }\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}}/envelopes/{{envelopeId}}/recipients/{{recipientId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "envelopes",
                "{{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}}/envelopes/{{envelopeId}}/fields",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "envelopes",
                "{{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}}/envelopes/{{envelopeId}}/fields",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "envelopes",
                "{{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}}/envelopes/{{envelopeId}}/fields",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "envelopes",
                "{{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}}/envelopes/{{envelopeId}}/fields/{{fieldId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "envelopes",
                "{{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}}/envelopes/{{envelopeId}}/fields/values",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "envelopes",
                "{{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 Envelope",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/envelopes/{{envelopeId}}/send",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "envelopes",
                "{{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 /envelopes`.\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}}/envelopes/{{envelopeId}}/status",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "envelopes",
                "{{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": "Send Reminder to Recipient",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/envelopes/{{envelopeId}}/recipients/{{recipientId}}/reminders",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "envelopes",
                "{{envelopeId}}",
                "recipients",
                "{{recipientId}}",
                "reminders"
              ]
            },
            "description": "Send a reminder email to a specific recipient who hasn't completed their signing action yet."
          },
          "response": [
            {
              "name": "Reminder Sent",
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "{\n  \"message\": \"Reminder sent successfully\",\n  \"recipientId\": \"rec_abc123\",\n  \"recipientEmail\": \"signer@example.com\",\n  \"remindersSent\": 1\n}"
            }
          ]
        },
        {
          "name": "Cancel Signing",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/envelopes/{{envelopeId}}/cancel",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "envelopes",
                "{{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 Envelope",
          "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}}/envelopes",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "envelopes"
              ]
            },
            "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 Envelope",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/envelopes/{{envelopeId}}/send",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "envelopes",
                "{{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}}/envelopes/{{envelopeId}}/status",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "envelopes",
                "{{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}}/envelopes/{{envelopeId}}/estamp/check",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "envelopes",
                "{{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 reusable document templates with predefined recipients and workflows. Use templates to quickly create new documents.",
      "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\": \"NDA Template\",\n  \"fileName\": \"nda-template.pdf\",\n  \"description\": \"Standard Non-Disclosure Agreement template\",\n  \"recipients\": [\n    {\n      \"id\": \"template-signer-1\",\n      \"email\": \"placeholder@template.com\",\n      \"name\": \"Signer 1\",\n      \"order\": 1,\n      \"role\": \"signer\",\n      \"signatureMethod\": \"electronic\",\n      \"signaturePlacement\": {\n        \"type\": \"coordinates\",\n        \"positions\": [\n          {\n            \"pageNumber\": 2,\n            \"x\": 100,\n            \"y\": 650,\n            \"width\": 200,\n            \"height\": 50\n          }\n        ]\n      }\n    }\n  ],\n  \"workflow\": {\n    \"mode\": \"sequential\",\n    \"verificationMethod\": \"email_verification\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/templates",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "templates"
              ]
            },
            "description": "Create a new reusable template. Returns a presigned upload URL for the PDF.\n\n**Template recipients** use placeholder emails -- when creating an envelope from the template, you map these to actual recipient emails.\n\n**File Constraints:**\n- Only PDF files are supported\n- Max file size: 10MB (enforced at upload)\n\n**Form fields:** templates accept a `formFields` array using the same schema as `POST /envelopes/:id/fields` — including text styling (`fontFamily`/`fontWeight`/`fontStyle`/`fontSize`/`textColor`), checkbox sizing, and `radioGroup` config with `labelFontSize`."
          },
          "response": [
            {
              "name": "Template Created",
              "status": "Created",
              "code": 201,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "{\n  \"id\": \"tmpl_abc123\",\n  \"name\": \"NDA Template\",\n  \"fileName\": \"nda-template.pdf\",\n  \"fileKey\": \"templates/user123/tmpl_abc123/nda-template.pdf\",\n  \"upload\": {\n    \"url\": \"https://bucket.s3.amazonaws.com/\",\n    \"fields\": {\n      \"key\": \"templates/user123/tmpl_abc123/nda-template.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\": \"NDA Template\",\n      \"description\": \"Standard Non-Disclosure Agreement template\",\n      \"fileName\": \"nda-template.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": "Get full details for a specific template, including recipients, workflow, and usage statistics."
          },
          "response": [
            {
              "name": "Template Details",
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "{\n  \"id\": \"tmpl_abc123\",\n  \"name\": \"NDA Template\",\n  \"description\": \"Standard Non-Disclosure Agreement template\",\n  \"fileName\": \"nda-template.pdf\",\n  \"fileSize\": 204800,\n  \"status\": \"active\",\n  \"recipients\": [\n    {\n      \"id\": \"template-signer-1\",\n      \"email\": \"placeholder@template.com\",\n      \"name\": \"Signer 1\",\n      \"order\": 1,\n      \"role\": \"signer\",\n      \"signatureMethod\": \"electronic\"\n    }\n  ],\n  \"workflow\": {\n    \"mode\": \"sequential\",\n    \"verificationMethod\": \"email_verification\"\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}"
            }
          ]
        },
        {
          "name": "Update Template",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Updated NDA Template\",\n  \"description\": \"Updated description for the NDA template\",\n  \"workflow\": {\n    \"mode\": \"parallel\",\n    \"verificationMethod\": \"link_only\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/templates/{{templateId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "templates",
                "{{templateId}}"
              ]
            },
            "description": "Update template metadata, recipients, or workflow configuration. All fields are optional."
          },
          "response": [
            {
              "name": "Template Updated",
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "{\n  \"id\": \"tmpl_abc123\",\n  \"name\": \"Updated NDA Template\",\n  \"description\": \"Updated description for the NDA template\",\n  \"recipientsCount\": 1,\n  \"updatedAt\": \"2026-03-10T13: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 Envelope 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\": \"template-signer-1\",\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  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/templates/{{templateId}}/documents",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "templates",
                "{{templateId}}",
                "documents"
              ]
            },
            "description": "Create a new document from an existing template.\n\n**Recipient Mapping:**\nMap each template recipient (by `templateRecipientId`) to an actual person's name and email. An optional E.164 `phone` enables WhatsApp delivery for that recipient.\n\n**Workflow (optional):**\nOverride the template's default workflow settings."
          },
          "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": "Create a copy of an existing template. Optionally provide a new name for the copy."
          },
          "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}"
            }
          ]
        }
      ]
    },
    {
      "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 & Bulk Jobs",
      "description": "Versioned execution workflows and asynchronous bulk runs. Requires workflows:read/write or bulkSend: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"
              ]
            }
          },
          "response": []
        },
        {
          "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": []
        },
        {
          "name": "Publish Workflow",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/workflows/{{workflowId}}/publish",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "workflows",
                "{{workflowId}}",
                "publish"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Launch Workflow",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"title\": \"NDA — Acme\",\n  \"recipients\": [{\n    \"participantKey\": \"signer\",\n    \"name\": \"Asha Rao\",\n    \"email\": \"asha@example.com\"\n  }],\n  \"idempotencyKey\": \"nda-acme-2026-07\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/workflows/{{workflowId}}/runs",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "workflows",
                "{{workflowId}}",
                "runs"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Create Bulk Run",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"workflowVersionId\": \"{{workflowVersionId}}\",\n  \"idempotencyKey\": \"july-nda-batch\",\n  \"rows\": [{\n    \"rowNumber\": 1,\n    \"title\": \"NDA — Acme\",\n    \"recipients\": [{\n      \"participantKey\": \"signer\",\n      \"name\": \"Asha Rao\",\n      \"email\": \"asha@example.com\"\n    }]\n  }]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/workflows/{{workflowId}}/bulk-runs",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "workflows",
                "{{workflowId}}",
                "bulk-runs"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Create Bulk Run from CSV",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"workflowVersionId\": \"{{workflowVersionId}}\",\n  \"idempotencyKey\": \"july-nda-csv\",\n  \"csv\": \"title,signer.name,signer.email\\nNDA — Acme,Asha Rao,asha@example.com\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/workflows/{{workflowId}}/bulk-runs/csv",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "workflows",
                "{{workflowId}}",
                "bulk-runs",
                "csv"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Get Bulk Job",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/bulk-jobs/{{bulkJobId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "bulk-jobs",
                "{{bulkJobId}}"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Cancel Bulk Job",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/bulk-jobs/{{bulkJobId}}/cancel",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "bulk-jobs",
                "{{bulkJobId}}",
                "cancel"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Retry Failed Rows",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/bulk-jobs/{{bulkJobId}}/retry-failed",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "bulk-jobs",
                "{{bulkJobId}}",
                "retry-failed"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Download Error CSV",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "text/csv"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/bulk-jobs/{{bulkJobId}}/errors.csv",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "bulk-jobs",
                "{{bulkJobId}}",
                "errors.csv"
              ]
            }
          },
          "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 Envelope",
              "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);",
                      "    console.log('Upload POST URL:', jsonData.upload.url);",
                      "}"
                    ],
                    "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}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{baseUrl}}/envelopes",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "envelopes"
                  ]
                },
                "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}}/envelopes/{{envelopeId}}/recipients",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "envelopes",
                    "{{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}}/envelopes/{{envelopeId}}/fields",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "envelopes",
                    "{{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": "{\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}}/envelopes/{{envelopeId}}/send",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "envelopes",
                    "{{envelopeId}}",
                    "send"
                  ]
                },
                "description": "Step 4: Send the envelope for signing. Emails will be sent to all recipients."
              },
              "response": []
            },
            {
              "name": "5. Check Signing Progress",
              "request": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{baseUrl}}/envelopes/{{envelopeId}}/status",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "envelopes",
                    "{{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}}/envelopes/{{envelopeId}}/file",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "envelopes",
                    "{{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"
        }
      ]
    }
  ]
}