{
  "info": {
    "name": "Lexgo Sign API v1",
    "description": "Lexgo Sign public API (v1): a ready-to-run Postman collection with tests and saved examples.\n\nFolders are numbered and tagged. Folders tagged SAFE only create or read unsent drafts with fictional data. Folders tagged EFFECT send emails, change tenant settings, call outbound URLs or create Alerts, and are skipped unless the variable effects_confirmed is yes. Any request outside folder 0 is skipped on a production host unless production_confirmed is yes.\n\nSet api_url, api_key (and the other variables listed in the README) in an environment. Authentication is the Authorization header with the API key; there is no collection-level auth, so the storage upload in folder 2 never receives the key.\n\nPublic documentation lives in the API docs site (pages under api/). See README.md in this bundle for setup, the variable contract and the newman commands.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "item": [
    {
      "name": "0. SAFE - Connectivity",
      "description": "Safe. Liveness and authenticated test calls. No data is created. This is the only folder that runs on a production host without production_confirmed.",
      "item": [
        {
          "name": "Liveness (no authentication)",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Status is 200', () => pm.response.to.have.status(200));",
                  "pm.test('Body is {\"success\": true}', () => pm.expect(pm.response.json().success).to.eql(true));",
                  "pm.test('No Authorization header was sent', () => pm.expect(pm.request.headers.has('Authorization')).to.be.false);"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{api_url}}/{{api_prefix}}/liveness",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "{{api_prefix}}",
                "liveness"
              ]
            },
            "description": "Safe. Read-only liveness probe, the only endpoint that needs no API key. Public docs: api/overview.md."
          },
          "response": [
            {
              "name": "200 OK",
              "originalRequest": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{api_url}}/{{api_prefix}}/liveness",
                  "host": [
                    "{{api_url}}"
                  ],
                  "path": [
                    "{{api_prefix}}",
                    "liveness"
                  ]
                },
                "description": "Safe. Read-only liveness probe, the only endpoint that needs no API key. Public docs: api/overview.md."
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"success\": true\n}"
            }
          ]
        },
        {
          "name": "Test (GET, authenticated)",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = pm.response.json();",
                  "pm.test('Status is 200', () => pm.response.to.have.status(200));",
                  "pm.test('Echoes the message and test_param', () => {",
                  "    pm.expect(j.message).to.eql('It works!');",
                  "    pm.expect(j.test_param).to.eql('postman');",
                  "});",
                  "pm.test('Names the enterprise and the key stage', () => {",
                  "    pm.expect(j.enterprise_name).to.be.a('string').and.not.empty;",
                  "    pm.expect(j.environment).to.be.oneOf(['sandbox', 'live']);",
                  "});",
                  "pm.test('request_id is present', () => pm.expect(j.request_id).to.be.a('string').and.not.empty);"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "{{api_key}}",
                "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
              }
            ],
            "url": {
              "raw": "{{api_url}}/{{api_prefix}}/test?test_param=postman",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "{{api_prefix}}",
                "test"
              ],
              "query": [
                {
                  "key": "test_param",
                  "value": "postman"
                }
              ]
            },
            "description": "Safe. Verifies the API key and the base URL. `environment` is the stage of the key (sandbox or live), not of the host. Public docs: getting-started/authentication.md."
          },
          "response": [
            {
              "name": "200 OK",
              "originalRequest": {
                "method": "GET",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "{{api_key}}",
                    "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
                  }
                ],
                "url": {
                  "raw": "{{api_url}}/{{api_prefix}}/test?test_param=postman",
                  "host": [
                    "{{api_url}}"
                  ],
                  "path": [
                    "{{api_prefix}}",
                    "test"
                  ],
                  "query": [
                    {
                      "key": "test_param",
                      "value": "postman"
                    }
                  ]
                },
                "description": "Safe. Verifies the API key and the base URL. `environment` is the stage of the key (sandbox or live), not of the host. Public docs: getting-started/authentication.md."
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"message\": \"It works!\",\n  \"enterprise_name\": \"Example Enterprise\",\n  \"environment\": \"sandbox\",\n  \"test_param\": \"postman\",\n  \"request_id\": \"00000000-0000-4000-8000-0000000000aa\"\n}"
            }
          ]
        },
        {
          "name": "Test (POST, authenticated)",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = pm.response.json();",
                  "pm.test('Status is 200', () => pm.response.to.have.status(200));",
                  "pm.test('Reads test_param from the body', () => pm.expect(j.test_param).to.eql('postman-post'));",
                  "pm.test('request_id is present', () => pm.expect(j.request_id).to.be.a('string').and.not.empty);"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "{{api_key}}",
                "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
              }
            ],
            "url": {
              "raw": "{{api_url}}/{{api_prefix}}/test",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "{{api_prefix}}",
                "test"
              ]
            },
            "description": "Safe. Same check as the GET variant, using a form-data body. Public docs: getting-started/authentication.md.",
            "body": {
              "mode": "formdata",
              "formdata": [
                {
                  "key": "test_param",
                  "value": "postman-post",
                  "type": "text"
                }
              ]
            }
          },
          "response": [
            {
              "name": "200 OK",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "{{api_key}}",
                    "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
                  }
                ],
                "url": {
                  "raw": "{{api_url}}/{{api_prefix}}/test",
                  "host": [
                    "{{api_url}}"
                  ],
                  "path": [
                    "{{api_prefix}}",
                    "test"
                  ]
                },
                "description": "Safe. Same check as the GET variant, using a form-data body. Public docs: getting-started/authentication.md.",
                "body": {
                  "mode": "formdata",
                  "formdata": [
                    {
                      "key": "test_param",
                      "value": "postman-post",
                      "type": "text"
                    }
                  ]
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"message\": \"It works!\",\n  \"enterprise_name\": \"Example Enterprise\",\n  \"environment\": \"sandbox\",\n  \"test_param\": \"postman-post\",\n  \"request_id\": \"00000000-0000-4000-8000-0000000000aa\"\n}"
            }
          ]
        }
      ]
    },
    {
      "name": "1. SAFE - Draft envelopes (unsent, fictional)",
      "description": "Safe. Creates, reads and updates unsent drafts with fictional data. Nothing is emailed. Run in order: later requests use the ids saved by the creates. Drafts are not deleted by the API (there is no delete endpoint).",
      "item": [
        {
          "name": "Auth denial - no Authorization header",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = pm.response.json();",
                  "pm.test('Status is 401', () => pm.response.to.have.status(401));",
                  "pm.test('Error says the header is missing', () => pm.expect(j.error).to.eql('Missing Authorization Header'));",
                  "pm.test('No Authorization header was sent', () => pm.expect(pm.request.headers.has('Authorization')).to.be.false);"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{api_url}}/{{api_prefix}}/test",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "{{api_prefix}}",
                "test"
              ]
            },
            "description": "Safe. Expects 401 because no Authorization header is sent. Authentication errors carry no request_id. Public docs: api/errors.md."
          },
          "response": [
            {
              "name": "401 Missing Authorization Header",
              "originalRequest": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{api_url}}/{{api_prefix}}/test",
                  "host": [
                    "{{api_url}}"
                  ],
                  "path": [
                    "{{api_prefix}}",
                    "test"
                  ]
                },
                "description": "Safe. Expects 401 because no Authorization header is sent. Authentication errors carry no request_id. Public docs: api/errors.md."
              },
              "status": "Unauthorized",
              "code": 401,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"error\": \"Missing Authorization Header\"\n}"
            }
          ]
        },
        {
          "name": "Auth denial - invalid API key",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = pm.response.json();",
                  "pm.test('Status is 401', () => pm.response.to.have.status(401));",
                  "pm.test('Error says the key was not found', () => pm.expect(j.error).to.eql('Invalid Api Key (key not found)'));"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "invalid-key-for-denial-check"
              }
            ],
            "url": {
              "raw": "{{api_url}}/{{api_prefix}}/test",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "{{api_prefix}}",
                "test"
              ]
            },
            "description": "Safe. Expects 401 because the key is not a real key. Public docs: api/errors.md."
          },
          "response": [
            {
              "name": "401 Invalid Api Key",
              "originalRequest": {
                "method": "GET",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "invalid-key-for-denial-check"
                  }
                ],
                "url": {
                  "raw": "{{api_url}}/{{api_prefix}}/test",
                  "host": [
                    "{{api_url}}"
                  ],
                  "path": [
                    "{{api_prefix}}",
                    "test"
                  ]
                },
                "description": "Safe. Expects 401 because the key is not a real key. Public docs: api/errors.md."
              },
              "status": "Unauthorized",
              "code": 401,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"error\": \"Invalid Api Key (key not found)\"\n}"
            }
          ]
        },
        {
          "name": "Create draft - multipart, 2 documents + attachment, 3 recipients",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = pm.response.json();",
                  "pm.test('Status is 200 (a 422 with status ERROR on a sandbox key usually means a recipient email is not a team address)', () => pm.response.to.have.status(200));",
                  "pm.test('Envelope is a CREATED draft', () => {",
                  "    pm.expect(j.envelope).to.be.an('object');",
                  "    pm.expect(j.envelope.status, JSON.stringify(j.envelope.errors)).to.eql('CREATED');",
                  "});",
                  "pm.test('request_id is present', () => pm.expect(j.request_id).to.be.a('string').and.not.empty);",
                  "",
                  "pm.test('Two signable documents and one attachment', () => {",
                  "    const kinds = j.envelope.documents.map((d) => d.file_type).sort();",
                  "    pm.expect(kinds).to.eql(['ATTACHMENT', 'ORIGINAL', 'ORIGINAL']);",
                  "});",
                  "pm.test('Signer, approver and witness recipients', () => {",
                  "    pm.expect(j.envelope.recipients.map((r) => r.custom_key).sort()).to.eql(['approver', 'signer', 'witness']);",
                  "});",
                  "pm.test('SIGNATURE, APPROVER and WITNESS placements', () => {",
                  "    const kinds = j.envelope.placements.map((p) => p.placement_type);",
                  "    ['SIGNATURE', 'APPROVER', 'WITNESS'].forEach((k) => pm.expect(kinds).to.include(k));",
                  "    const signature = j.envelope.placements.find((p) => p.placement_type === 'SIGNATURE');",
                  "    pm.expect(signature.coordinates).to.include.keys('page', 'top', 'left');",
                  "});",
                  "const byKey = (key) => (j.envelope.recipients.find((r) => r.custom_key === key) || {}).id;",
                  "pm.collectionVariables.set('envelope_id', j.envelope.id);",
                  "pm.collectionVariables.set('signer_id', byKey('signer'));",
                  "pm.collectionVariables.set('approver_id', byKey('approver'));",
                  "pm.collectionVariables.set('witness_id', byKey('witness'));"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "{{api_key}}",
                "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
              }
            ],
            "url": {
              "raw": "{{api_url}}/{{api_prefix}}/envelopes",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "{{api_prefix}}",
                "envelopes"
              ]
            },
            "description": "Safe. Creates an unsent draft envelope (nothing is emailed until it is sent) with two signable documents, one attachment, three recipients (signer, approver, witness) and one placement per kind. Only SIGNATURE placements take coordinates; APPROVER and WITNESS placements must not have them. Documents are base64 (max 5 MB decoded). With a sandbox key every recipient email must be a team address, so set signer_email, approver_email and witness_email accordingly. Saves envelope_id, signer_id, approver_id and witness_id. Public docs: api/envelopes.md.",
            "body": {
              "mode": "formdata",
              "formdata": [
                {
                  "key": "name",
                  "value": "Postman multi-document draft (fictional)",
                  "type": "text"
                },
                {
                  "key": "documents[0][base64]",
                  "value": "{{sample_pdf_base64}}",
                  "type": "text"
                },
                {
                  "key": "documents[0][name]",
                  "value": "contract-main.pdf",
                  "type": "text"
                },
                {
                  "key": "documents[0][type]",
                  "value": "SIGNABLE",
                  "type": "text"
                },
                {
                  "key": "documents[0][order]",
                  "value": "0",
                  "type": "text"
                },
                {
                  "key": "documents[1][base64]",
                  "value": "{{sample_pdf_base64}}",
                  "type": "text"
                },
                {
                  "key": "documents[1][name]",
                  "value": "contract-annex.pdf",
                  "type": "text"
                },
                {
                  "key": "documents[1][type]",
                  "value": "SIGNABLE",
                  "type": "text"
                },
                {
                  "key": "documents[1][order]",
                  "value": "1",
                  "type": "text"
                },
                {
                  "key": "documents[2][base64]",
                  "value": "{{sample_pdf_base64}}",
                  "type": "text"
                },
                {
                  "key": "documents[2][name]",
                  "value": "supporting-attachment.pdf",
                  "type": "text"
                },
                {
                  "key": "documents[2][type]",
                  "value": "ATTACHMENT",
                  "type": "text"
                },
                {
                  "key": "documents[2][order]",
                  "value": "2",
                  "type": "text"
                },
                {
                  "key": "recipients[signer][name]",
                  "value": "Ana Signer",
                  "type": "text"
                },
                {
                  "key": "recipients[signer][email]",
                  "value": "{{fixture_signer_email}}",
                  "type": "text"
                },
                {
                  "key": "recipients[signer][order]",
                  "value": "1",
                  "type": "text"
                },
                {
                  "key": "recipients[approver][name]",
                  "value": "Beto Approver",
                  "type": "text"
                },
                {
                  "key": "recipients[approver][email]",
                  "value": "{{fixture_approver_email}}",
                  "type": "text"
                },
                {
                  "key": "recipients[approver][order]",
                  "value": "2",
                  "type": "text"
                },
                {
                  "key": "recipients[witness][name]",
                  "value": "Carla Witness",
                  "type": "text"
                },
                {
                  "key": "recipients[witness][email]",
                  "value": "{{fixture_witness_email}}",
                  "type": "text"
                },
                {
                  "key": "recipients[witness][order]",
                  "value": "3",
                  "type": "text"
                },
                {
                  "key": "placements[p1][document_key]",
                  "value": "0",
                  "type": "text"
                },
                {
                  "key": "placements[p1][recipient_key]",
                  "value": "signer",
                  "type": "text"
                },
                {
                  "key": "placements[p1][type]",
                  "value": "SIGNATURE",
                  "type": "text"
                },
                {
                  "key": "placements[p1][coordinates][page]",
                  "value": "0",
                  "type": "text"
                },
                {
                  "key": "placements[p1][coordinates][top]",
                  "value": "650",
                  "type": "text"
                },
                {
                  "key": "placements[p1][coordinates][left]",
                  "value": "100",
                  "type": "text"
                },
                {
                  "key": "placements[p2][document_key]",
                  "value": "0",
                  "type": "text"
                },
                {
                  "key": "placements[p2][recipient_key]",
                  "value": "approver",
                  "type": "text"
                },
                {
                  "key": "placements[p2][type]",
                  "value": "APPROVER",
                  "type": "text"
                },
                {
                  "key": "placements[p3][document_key]",
                  "value": "1",
                  "type": "text"
                },
                {
                  "key": "placements[p3][recipient_key]",
                  "value": "witness",
                  "type": "text"
                },
                {
                  "key": "placements[p3][type]",
                  "value": "WITNESS",
                  "type": "text"
                },
                {
                  "key": "placements[p4][document_key]",
                  "value": "1",
                  "type": "text"
                },
                {
                  "key": "placements[p4][recipient_key]",
                  "value": "signer",
                  "type": "text"
                },
                {
                  "key": "placements[p4][type]",
                  "value": "SIGNATURE",
                  "type": "text"
                },
                {
                  "key": "placements[p4][coordinates][page]",
                  "value": "0",
                  "type": "text"
                },
                {
                  "key": "placements[p4][coordinates][top]",
                  "value": "650",
                  "type": "text"
                },
                {
                  "key": "placements[p4][coordinates][left]",
                  "value": "100",
                  "type": "text"
                }
              ]
            }
          },
          "response": [
            {
              "name": "200 OK - draft created",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "{{api_key}}",
                    "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
                  }
                ],
                "url": {
                  "raw": "{{api_url}}/{{api_prefix}}/envelopes",
                  "host": [
                    "{{api_url}}"
                  ],
                  "path": [
                    "{{api_prefix}}",
                    "envelopes"
                  ]
                },
                "description": "Safe. Creates an unsent draft envelope (nothing is emailed until it is sent) with two signable documents, one attachment, three recipients (signer, approver, witness) and one placement per kind. Only SIGNATURE placements take coordinates; APPROVER and WITNESS placements must not have them. Documents are base64 (max 5 MB decoded). With a sandbox key every recipient email must be a team address, so set signer_email, approver_email and witness_email accordingly. Saves envelope_id, signer_id, approver_id and witness_id. Public docs: api/envelopes.md.",
                "body": {
                  "mode": "formdata",
                  "formdata": [
                    {
                      "key": "name",
                      "value": "Postman multi-document draft (fictional)",
                      "type": "text"
                    },
                    {
                      "key": "documents[0][base64]",
                      "value": "{{sample_pdf_base64}}",
                      "type": "text"
                    },
                    {
                      "key": "documents[0][name]",
                      "value": "contract-main.pdf",
                      "type": "text"
                    },
                    {
                      "key": "documents[0][type]",
                      "value": "SIGNABLE",
                      "type": "text"
                    },
                    {
                      "key": "documents[0][order]",
                      "value": "0",
                      "type": "text"
                    },
                    {
                      "key": "documents[1][base64]",
                      "value": "{{sample_pdf_base64}}",
                      "type": "text"
                    },
                    {
                      "key": "documents[1][name]",
                      "value": "contract-annex.pdf",
                      "type": "text"
                    },
                    {
                      "key": "documents[1][type]",
                      "value": "SIGNABLE",
                      "type": "text"
                    },
                    {
                      "key": "documents[1][order]",
                      "value": "1",
                      "type": "text"
                    },
                    {
                      "key": "documents[2][base64]",
                      "value": "{{sample_pdf_base64}}",
                      "type": "text"
                    },
                    {
                      "key": "documents[2][name]",
                      "value": "supporting-attachment.pdf",
                      "type": "text"
                    },
                    {
                      "key": "documents[2][type]",
                      "value": "ATTACHMENT",
                      "type": "text"
                    },
                    {
                      "key": "documents[2][order]",
                      "value": "2",
                      "type": "text"
                    },
                    {
                      "key": "recipients[signer][name]",
                      "value": "Ana Signer",
                      "type": "text"
                    },
                    {
                      "key": "recipients[signer][email]",
                      "value": "{{fixture_signer_email}}",
                      "type": "text"
                    },
                    {
                      "key": "recipients[signer][order]",
                      "value": "1",
                      "type": "text"
                    },
                    {
                      "key": "recipients[approver][name]",
                      "value": "Beto Approver",
                      "type": "text"
                    },
                    {
                      "key": "recipients[approver][email]",
                      "value": "{{fixture_approver_email}}",
                      "type": "text"
                    },
                    {
                      "key": "recipients[approver][order]",
                      "value": "2",
                      "type": "text"
                    },
                    {
                      "key": "recipients[witness][name]",
                      "value": "Carla Witness",
                      "type": "text"
                    },
                    {
                      "key": "recipients[witness][email]",
                      "value": "{{fixture_witness_email}}",
                      "type": "text"
                    },
                    {
                      "key": "recipients[witness][order]",
                      "value": "3",
                      "type": "text"
                    },
                    {
                      "key": "placements[p1][document_key]",
                      "value": "0",
                      "type": "text"
                    },
                    {
                      "key": "placements[p1][recipient_key]",
                      "value": "signer",
                      "type": "text"
                    },
                    {
                      "key": "placements[p1][type]",
                      "value": "SIGNATURE",
                      "type": "text"
                    },
                    {
                      "key": "placements[p1][coordinates][page]",
                      "value": "0",
                      "type": "text"
                    },
                    {
                      "key": "placements[p1][coordinates][top]",
                      "value": "650",
                      "type": "text"
                    },
                    {
                      "key": "placements[p1][coordinates][left]",
                      "value": "100",
                      "type": "text"
                    },
                    {
                      "key": "placements[p2][document_key]",
                      "value": "0",
                      "type": "text"
                    },
                    {
                      "key": "placements[p2][recipient_key]",
                      "value": "approver",
                      "type": "text"
                    },
                    {
                      "key": "placements[p2][type]",
                      "value": "APPROVER",
                      "type": "text"
                    },
                    {
                      "key": "placements[p3][document_key]",
                      "value": "1",
                      "type": "text"
                    },
                    {
                      "key": "placements[p3][recipient_key]",
                      "value": "witness",
                      "type": "text"
                    },
                    {
                      "key": "placements[p3][type]",
                      "value": "WITNESS",
                      "type": "text"
                    },
                    {
                      "key": "placements[p4][document_key]",
                      "value": "1",
                      "type": "text"
                    },
                    {
                      "key": "placements[p4][recipient_key]",
                      "value": "signer",
                      "type": "text"
                    },
                    {
                      "key": "placements[p4][type]",
                      "value": "SIGNATURE",
                      "type": "text"
                    },
                    {
                      "key": "placements[p4][coordinates][page]",
                      "value": "0",
                      "type": "text"
                    },
                    {
                      "key": "placements[p4][coordinates][top]",
                      "value": "650",
                      "type": "text"
                    },
                    {
                      "key": "placements[p4][coordinates][left]",
                      "value": "100",
                      "type": "text"
                    }
                  ]
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"envelope\": {\n    \"id\": \"00000000-0000-4000-8000-000000000001\",\n    \"name\": \"Postman multi-document draft (fictional)\",\n    \"status\": \"CREATED\",\n    \"errors\": [],\n    \"warnings\": [],\n    \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n    \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n    \"evidence_document_url\": null,\n    \"error_reason\": null,\n    \"evidence_generated_at\": null,\n    \"documents\": [\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000011\",\n        \"custom_key\": \"0\",\n        \"file_type\": \"ORIGINAL\",\n        \"order\": 0,\n        \"status\": \"CREATED\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"file_name\": \"contract-main.pdf\",\n        \"content_type\": \"application/pdf\",\n        \"file_size\": 1150,\n        \"page_count\": 1,\n        \"url\": \"https://storage.example.invalid/sample/contract-main.pdf?signature=redacted\"\n      },\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000012\",\n        \"custom_key\": \"1\",\n        \"file_type\": \"ORIGINAL\",\n        \"order\": 1,\n        \"status\": \"CREATED\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"file_name\": \"contract-annex.pdf\",\n        \"content_type\": \"application/pdf\",\n        \"file_size\": 1150,\n        \"page_count\": 1,\n        \"url\": \"https://storage.example.invalid/sample/contract-annex.pdf?signature=redacted\"\n      },\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000013\",\n        \"custom_key\": \"2\",\n        \"file_type\": \"ATTACHMENT\",\n        \"order\": 2,\n        \"status\": \"CREATED\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"file_name\": \"supporting-attachment.pdf\",\n        \"content_type\": \"application/pdf\",\n        \"file_size\": 1150,\n        \"page_count\": 1,\n        \"url\": \"https://storage.example.invalid/sample/supporting-attachment.pdf?signature=redacted\"\n      }\n    ],\n    \"recipients\": [\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000002\",\n        \"custom_key\": \"signer\",\n        \"order\": 1,\n        \"status\": \"CREATED\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"name\": \"Ana Signer\",\n        \"name_label\": \"Name:\",\n        \"email\": \"signer@example.com\",\n        \"email_label\": \"Email:\"\n      },\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000003\",\n        \"custom_key\": \"approver\",\n        \"order\": 2,\n        \"status\": \"CREATED\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"name\": \"Beto Approver\",\n        \"name_label\": \"Name:\",\n        \"email\": \"approver@example.com\",\n        \"email_label\": \"Email:\"\n      },\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000004\",\n        \"custom_key\": \"witness\",\n        \"order\": 3,\n        \"status\": \"CREATED\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"name\": \"Carla Witness\",\n        \"name_label\": \"Name:\",\n        \"email\": \"witness@example.com\",\n        \"email_label\": \"Email:\"\n      }\n    ],\n    \"placements\": [\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000041\",\n        \"custom_key\": \"p1\",\n        \"placement_type\": \"SIGNATURE\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"recipient_id\": \"00000000-0000-4000-8000-000000000002\",\n        \"recipient_key\": \"signer\",\n        \"document_id\": \"00000000-0000-4000-8000-000000000011\",\n        \"document_key\": \"0\",\n        \"order\": 0,\n        \"coordinates\": {\n          \"id\": \"Lexgo-Sign-0\",\n          \"top\": 650,\n          \"left\": 100,\n          \"page\": 0\n        },\n        \"token\": null\n      },\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000042\",\n        \"custom_key\": \"p2\",\n        \"placement_type\": \"APPROVER\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"recipient_id\": \"00000000-0000-4000-8000-000000000003\",\n        \"recipient_key\": \"approver\",\n        \"document_id\": \"00000000-0000-4000-8000-000000000011\",\n        \"document_key\": \"0\",\n        \"order\": 1,\n        \"coordinates\": {},\n        \"token\": null\n      },\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000043\",\n        \"custom_key\": \"p3\",\n        \"placement_type\": \"WITNESS\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"recipient_id\": \"00000000-0000-4000-8000-000000000004\",\n        \"recipient_key\": \"witness\",\n        \"document_id\": \"00000000-0000-4000-8000-000000000012\",\n        \"document_key\": \"1\",\n        \"order\": 2,\n        \"coordinates\": {},\n        \"token\": null\n      },\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000044\",\n        \"custom_key\": \"p4\",\n        \"placement_type\": \"SIGNATURE\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"recipient_id\": \"00000000-0000-4000-8000-000000000002\",\n        \"recipient_key\": \"signer\",\n        \"document_id\": \"00000000-0000-4000-8000-000000000012\",\n        \"document_key\": \"1\",\n        \"order\": 3,\n        \"coordinates\": {\n          \"id\": \"Lexgo-Sign-3\",\n          \"top\": 650,\n          \"left\": 100,\n          \"page\": 0\n        },\n        \"token\": null\n      }\n    ],\n    \"settings\": {\n      \"emails\": {\n        \"envelope_invitation\": \"TRUE\",\n        \"envelope_voided\": \"TRUE\",\n        \"envelope_rejected\": \"TRUE\",\n        \"envelope_signed\": \"TRUE\"\n      },\n      \"documents\": {\n        \"include_page_id\": \"TRUE\",\n        \"custom_page_id\": \"Lexgo Sign ID:\",\n        \"signatures_per_page\": 4,\n        \"signatures_per_row\": 1\n      },\n      \"signature_flow\": {\n        \"language\": \"EN\",\n        \"signature_order\": \"PARALLEL\",\n        \"signature_types\": \"WRITTEN, DRAWN, UPLOADED\",\n        \"signature_color\": \"#000000\",\n        \"sender_name\": \"Lexgo\",\n        \"sender_enterprise\": null\n      },\n      \"signature\": {\n        \"style\": \"SIMPLE\",\n        \"type\": \"INTERNATIONAL\",\n        \"image\": \"DEFAULT\",\n        \"text\": \"DEFAULT\",\n        \"bg_image\": \"DEFAULT\",\n        \"bg_image_scope\": \"QUALIFIED_CHILE\"\n      },\n      \"validations\": {\n        \"email\": {\n          \"order\": 0,\n          \"enabled\": \"FALSE\"\n        },\n        \"phone\": {\n          \"order\": 1,\n          \"enabled\": \"FALSE\",\n          \"methods\": \"SMS\"\n        },\n        \"id_check\": {\n          \"order\": 2,\n          \"enabled\": \"FALSE\"\n        },\n        \"biometric\": {\n          \"order\": 3,\n          \"enabled\": \"FALSE\"\n        }\n      }\n    },\n    \"metadata\": {}\n  },\n  \"request_id\": \"00000000-0000-4000-8000-0000000000aa\"\n}"
            },
            {
              "name": "422 - sandbox key, recipient is not a team address",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "{{api_key}}",
                    "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
                  }
                ],
                "url": {
                  "raw": "{{api_url}}/{{api_prefix}}/envelopes",
                  "host": [
                    "{{api_url}}"
                  ],
                  "path": [
                    "{{api_prefix}}",
                    "envelopes"
                  ]
                },
                "description": "Safe. Creates an unsent draft envelope (nothing is emailed until it is sent) with two signable documents, one attachment, three recipients (signer, approver, witness) and one placement per kind. Only SIGNATURE placements take coordinates; APPROVER and WITNESS placements must not have them. Documents are base64 (max 5 MB decoded). With a sandbox key every recipient email must be a team address, so set signer_email, approver_email and witness_email accordingly. Saves envelope_id, signer_id, approver_id and witness_id. Public docs: api/envelopes.md.",
                "body": {
                  "mode": "formdata",
                  "formdata": [
                    {
                      "key": "name",
                      "value": "Postman multi-document draft (fictional)",
                      "type": "text"
                    },
                    {
                      "key": "documents[0][base64]",
                      "value": "{{sample_pdf_base64}}",
                      "type": "text"
                    },
                    {
                      "key": "documents[0][name]",
                      "value": "contract-main.pdf",
                      "type": "text"
                    },
                    {
                      "key": "documents[0][type]",
                      "value": "SIGNABLE",
                      "type": "text"
                    },
                    {
                      "key": "documents[0][order]",
                      "value": "0",
                      "type": "text"
                    },
                    {
                      "key": "documents[1][base64]",
                      "value": "{{sample_pdf_base64}}",
                      "type": "text"
                    },
                    {
                      "key": "documents[1][name]",
                      "value": "contract-annex.pdf",
                      "type": "text"
                    },
                    {
                      "key": "documents[1][type]",
                      "value": "SIGNABLE",
                      "type": "text"
                    },
                    {
                      "key": "documents[1][order]",
                      "value": "1",
                      "type": "text"
                    },
                    {
                      "key": "documents[2][base64]",
                      "value": "{{sample_pdf_base64}}",
                      "type": "text"
                    },
                    {
                      "key": "documents[2][name]",
                      "value": "supporting-attachment.pdf",
                      "type": "text"
                    },
                    {
                      "key": "documents[2][type]",
                      "value": "ATTACHMENT",
                      "type": "text"
                    },
                    {
                      "key": "documents[2][order]",
                      "value": "2",
                      "type": "text"
                    },
                    {
                      "key": "recipients[signer][name]",
                      "value": "Ana Signer",
                      "type": "text"
                    },
                    {
                      "key": "recipients[signer][email]",
                      "value": "{{fixture_signer_email}}",
                      "type": "text"
                    },
                    {
                      "key": "recipients[signer][order]",
                      "value": "1",
                      "type": "text"
                    },
                    {
                      "key": "recipients[approver][name]",
                      "value": "Beto Approver",
                      "type": "text"
                    },
                    {
                      "key": "recipients[approver][email]",
                      "value": "{{fixture_approver_email}}",
                      "type": "text"
                    },
                    {
                      "key": "recipients[approver][order]",
                      "value": "2",
                      "type": "text"
                    },
                    {
                      "key": "recipients[witness][name]",
                      "value": "Carla Witness",
                      "type": "text"
                    },
                    {
                      "key": "recipients[witness][email]",
                      "value": "{{fixture_witness_email}}",
                      "type": "text"
                    },
                    {
                      "key": "recipients[witness][order]",
                      "value": "3",
                      "type": "text"
                    },
                    {
                      "key": "placements[p1][document_key]",
                      "value": "0",
                      "type": "text"
                    },
                    {
                      "key": "placements[p1][recipient_key]",
                      "value": "signer",
                      "type": "text"
                    },
                    {
                      "key": "placements[p1][type]",
                      "value": "SIGNATURE",
                      "type": "text"
                    },
                    {
                      "key": "placements[p1][coordinates][page]",
                      "value": "0",
                      "type": "text"
                    },
                    {
                      "key": "placements[p1][coordinates][top]",
                      "value": "650",
                      "type": "text"
                    },
                    {
                      "key": "placements[p1][coordinates][left]",
                      "value": "100",
                      "type": "text"
                    },
                    {
                      "key": "placements[p2][document_key]",
                      "value": "0",
                      "type": "text"
                    },
                    {
                      "key": "placements[p2][recipient_key]",
                      "value": "approver",
                      "type": "text"
                    },
                    {
                      "key": "placements[p2][type]",
                      "value": "APPROVER",
                      "type": "text"
                    },
                    {
                      "key": "placements[p3][document_key]",
                      "value": "1",
                      "type": "text"
                    },
                    {
                      "key": "placements[p3][recipient_key]",
                      "value": "witness",
                      "type": "text"
                    },
                    {
                      "key": "placements[p3][type]",
                      "value": "WITNESS",
                      "type": "text"
                    },
                    {
                      "key": "placements[p4][document_key]",
                      "value": "1",
                      "type": "text"
                    },
                    {
                      "key": "placements[p4][recipient_key]",
                      "value": "signer",
                      "type": "text"
                    },
                    {
                      "key": "placements[p4][type]",
                      "value": "SIGNATURE",
                      "type": "text"
                    },
                    {
                      "key": "placements[p4][coordinates][page]",
                      "value": "0",
                      "type": "text"
                    },
                    {
                      "key": "placements[p4][coordinates][top]",
                      "value": "650",
                      "type": "text"
                    },
                    {
                      "key": "placements[p4][coordinates][left]",
                      "value": "100",
                      "type": "text"
                    }
                  ]
                }
              },
              "status": "Unprocessable Content",
              "code": 422,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"envelope\": {\n    \"id\": \"00000000-0000-4000-8000-000000000001\",\n    \"name\": \"Postman multi-document draft (fictional)\",\n    \"status\": \"ERROR\",\n    \"errors\": [\n      \"The email of the recipient '00000000-0000-4000-8000-000000000002' is not in the sandbox allowed email list: team1@example.com, team2@example.com.\"\n    ],\n    \"warnings\": [],\n    \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n    \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n    \"evidence_document_url\": null,\n    \"error_reason\": null,\n    \"evidence_generated_at\": null,\n    \"documents\": [\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000011\",\n        \"custom_key\": \"0\",\n        \"file_type\": \"ORIGINAL\",\n        \"order\": 0,\n        \"status\": \"CREATED\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"file_name\": \"contract-main.pdf\",\n        \"content_type\": \"application/pdf\",\n        \"file_size\": 1150,\n        \"page_count\": 1,\n        \"url\": \"https://storage.example.invalid/sample/contract-main.pdf?signature=redacted\"\n      },\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000012\",\n        \"custom_key\": \"1\",\n        \"file_type\": \"ORIGINAL\",\n        \"order\": 1,\n        \"status\": \"CREATED\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"file_name\": \"contract-annex.pdf\",\n        \"content_type\": \"application/pdf\",\n        \"file_size\": 1150,\n        \"page_count\": 1,\n        \"url\": \"https://storage.example.invalid/sample/contract-annex.pdf?signature=redacted\"\n      },\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000013\",\n        \"custom_key\": \"2\",\n        \"file_type\": \"ATTACHMENT\",\n        \"order\": 2,\n        \"status\": \"CREATED\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"file_name\": \"supporting-attachment.pdf\",\n        \"content_type\": \"application/pdf\",\n        \"file_size\": 1150,\n        \"page_count\": 1,\n        \"url\": \"https://storage.example.invalid/sample/supporting-attachment.pdf?signature=redacted\"\n      }\n    ],\n    \"recipients\": [\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000002\",\n        \"custom_key\": \"signer\",\n        \"order\": 1,\n        \"status\": \"CREATED\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"name\": \"Ana Signer\",\n        \"name_label\": \"Name:\",\n        \"email\": \"signer@example.com\",\n        \"email_label\": \"Email:\"\n      },\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000003\",\n        \"custom_key\": \"approver\",\n        \"order\": 2,\n        \"status\": \"CREATED\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"name\": \"Beto Approver\",\n        \"name_label\": \"Name:\",\n        \"email\": \"approver@example.com\",\n        \"email_label\": \"Email:\"\n      },\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000004\",\n        \"custom_key\": \"witness\",\n        \"order\": 3,\n        \"status\": \"CREATED\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"name\": \"Carla Witness\",\n        \"name_label\": \"Name:\",\n        \"email\": \"witness@example.com\",\n        \"email_label\": \"Email:\"\n      }\n    ],\n    \"placements\": [\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000041\",\n        \"custom_key\": \"p1\",\n        \"placement_type\": \"SIGNATURE\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"recipient_id\": \"00000000-0000-4000-8000-000000000002\",\n        \"recipient_key\": \"signer\",\n        \"document_id\": \"00000000-0000-4000-8000-000000000011\",\n        \"document_key\": \"0\",\n        \"order\": 0,\n        \"coordinates\": {\n          \"id\": \"Lexgo-Sign-0\",\n          \"top\": 650,\n          \"left\": 100,\n          \"page\": 0\n        },\n        \"token\": null\n      },\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000042\",\n        \"custom_key\": \"p2\",\n        \"placement_type\": \"APPROVER\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"recipient_id\": \"00000000-0000-4000-8000-000000000003\",\n        \"recipient_key\": \"approver\",\n        \"document_id\": \"00000000-0000-4000-8000-000000000011\",\n        \"document_key\": \"0\",\n        \"order\": 1,\n        \"coordinates\": {},\n        \"token\": null\n      },\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000043\",\n        \"custom_key\": \"p3\",\n        \"placement_type\": \"WITNESS\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"recipient_id\": \"00000000-0000-4000-8000-000000000004\",\n        \"recipient_key\": \"witness\",\n        \"document_id\": \"00000000-0000-4000-8000-000000000012\",\n        \"document_key\": \"1\",\n        \"order\": 2,\n        \"coordinates\": {},\n        \"token\": null\n      },\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000044\",\n        \"custom_key\": \"p4\",\n        \"placement_type\": \"SIGNATURE\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"recipient_id\": \"00000000-0000-4000-8000-000000000002\",\n        \"recipient_key\": \"signer\",\n        \"document_id\": \"00000000-0000-4000-8000-000000000012\",\n        \"document_key\": \"1\",\n        \"order\": 3,\n        \"coordinates\": {\n          \"id\": \"Lexgo-Sign-3\",\n          \"top\": 650,\n          \"left\": 100,\n          \"page\": 0\n        },\n        \"token\": null\n      }\n    ],\n    \"settings\": {\n      \"emails\": {\n        \"envelope_invitation\": \"TRUE\",\n        \"envelope_voided\": \"TRUE\",\n        \"envelope_rejected\": \"TRUE\",\n        \"envelope_signed\": \"TRUE\"\n      },\n      \"documents\": {\n        \"include_page_id\": \"TRUE\",\n        \"custom_page_id\": \"Lexgo Sign ID:\",\n        \"signatures_per_page\": 4,\n        \"signatures_per_row\": 1\n      },\n      \"signature_flow\": {\n        \"language\": \"EN\",\n        \"signature_order\": \"PARALLEL\",\n        \"signature_types\": \"WRITTEN, DRAWN, UPLOADED\",\n        \"signature_color\": \"#000000\",\n        \"sender_name\": \"Lexgo\",\n        \"sender_enterprise\": null\n      },\n      \"signature\": {\n        \"style\": \"SIMPLE\",\n        \"type\": \"INTERNATIONAL\",\n        \"image\": \"DEFAULT\",\n        \"text\": \"DEFAULT\",\n        \"bg_image\": \"DEFAULT\",\n        \"bg_image_scope\": \"QUALIFIED_CHILE\"\n      },\n      \"validations\": {\n        \"email\": {\n          \"order\": 0,\n          \"enabled\": \"FALSE\"\n        },\n        \"phone\": {\n          \"order\": 1,\n          \"enabled\": \"FALSE\",\n          \"methods\": \"SMS\"\n        },\n        \"id_check\": {\n          \"order\": 2,\n          \"enabled\": \"FALSE\"\n        },\n        \"biometric\": {\n          \"order\": 3,\n          \"enabled\": \"FALSE\"\n        }\n      }\n    },\n    \"metadata\": {}\n  },\n  \"request_id\": \"00000000-0000-4000-8000-0000000000aa\"\n}"
            }
          ]
        },
        {
          "name": "Create draft - JSON body with nested Unicode metadata",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = pm.response.json();",
                  "pm.test('Status is 200 (a 422 with status ERROR on a sandbox key usually means a recipient email is not a team address)', () => pm.response.to.have.status(200));",
                  "pm.test('Envelope is a CREATED draft', () => {",
                  "    pm.expect(j.envelope).to.be.an('object');",
                  "    pm.expect(j.envelope.status, JSON.stringify(j.envelope.errors)).to.eql('CREATED');",
                  "});",
                  "pm.test('request_id is present', () => pm.expect(j.request_id).to.be.a('string').and.not.empty);",
                  "",
                  "const sent = JSON.parse(pm.request.body.raw).metadata;",
                  "pm.test('Response metadata equals the metadata that was sent (Unicode, nested, null kept)', () => {",
                  "    pm.expect(j.envelope.metadata).to.deep.equal(sent);",
                  "});",
                  "pm.collectionVariables.set('metadata_sent', JSON.stringify(sent));",
                  "pm.collectionVariables.set('json_envelope_id', j.envelope.id);",
                  "pm.collectionVariables.set('json_signer_id', j.envelope.recipients[0].id);"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "{{api_key}}",
                "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{api_url}}/{{api_prefix}}/envelopes",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "{{api_prefix}}",
                "envelopes"
              ]
            },
            "description": "Safe. Creates an unsent draft from a JSON body, with caller-defined metadata (max 8192 bytes serialized, depth 5, 100 keys). Saves json_envelope_id and metadata_sent. Public docs: api/envelopes.md#envelope-metadata.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Postman JSON draft with Unicode metadata (fictional)\",\n  \"documents\": {\n    \"0\": {\n      \"base64\": \"{{sample_pdf_base64}}\",\n      \"name\": \"contract-main.pdf\",\n      \"type\": \"SIGNABLE\"\n    }\n  },\n  \"recipients\": {\n    \"signer\": {\n      \"name\": \"Ana Signer\",\n      \"email\": \"{{fixture_signer_email}}\",\n      \"order\": 1\n    }\n  },\n  \"placements\": {\n    \"p1\": {\n      \"document_key\": \"0\",\n      \"recipient_key\": \"signer\",\n      \"type\": \"SIGNATURE\",\n      \"coordinates\": {\n        \"page\": 0,\n        \"top\": 650,\n        \"left\": 100\n      }\n    }\n  },\n  \"metadata\": {\n    \"reference\": \"Contrato-Ñandú-2026\",\n    \"customer\": {\n      \"name\": \"José Pérez 山田\",\n      \"tags\": [\n        \"fírma\",\n        \"日本語\",\n        \"emoji 🙂\"\n      ],\n      \"contacts\": [\n        {\n          \"labels\": [\n            \"primary\",\n            \"legal\"\n          ]\n        }\n      ]\n    },\n    \"count\": 3,\n    \"active\": true,\n    \"note\": null\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [
            {
              "name": "200 OK - draft created",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "{{api_key}}",
                    "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": {
                  "raw": "{{api_url}}/{{api_prefix}}/envelopes",
                  "host": [
                    "{{api_url}}"
                  ],
                  "path": [
                    "{{api_prefix}}",
                    "envelopes"
                  ]
                },
                "description": "Safe. Creates an unsent draft from a JSON body, with caller-defined metadata (max 8192 bytes serialized, depth 5, 100 keys). Saves json_envelope_id and metadata_sent. Public docs: api/envelopes.md#envelope-metadata.",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"name\": \"Postman JSON draft with Unicode metadata (fictional)\",\n  \"documents\": {\n    \"0\": {\n      \"base64\": \"{{sample_pdf_base64}}\",\n      \"name\": \"contract-main.pdf\",\n      \"type\": \"SIGNABLE\"\n    }\n  },\n  \"recipients\": {\n    \"signer\": {\n      \"name\": \"Ana Signer\",\n      \"email\": \"{{fixture_signer_email}}\",\n      \"order\": 1\n    }\n  },\n  \"placements\": {\n    \"p1\": {\n      \"document_key\": \"0\",\n      \"recipient_key\": \"signer\",\n      \"type\": \"SIGNATURE\",\n      \"coordinates\": {\n        \"page\": 0,\n        \"top\": 650,\n        \"left\": 100\n      }\n    }\n  },\n  \"metadata\": {\n    \"reference\": \"Contrato-Ñandú-2026\",\n    \"customer\": {\n      \"name\": \"José Pérez 山田\",\n      \"tags\": [\n        \"fírma\",\n        \"日本語\",\n        \"emoji 🙂\"\n      ],\n      \"contacts\": [\n        {\n          \"labels\": [\n            \"primary\",\n            \"legal\"\n          ]\n        }\n      ]\n    },\n    \"count\": 3,\n    \"active\": true,\n    \"note\": null\n  }\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"envelope\": {\n    \"id\": \"00000000-0000-4000-8000-000000000006\",\n    \"name\": \"Postman JSON draft with Unicode metadata (fictional)\",\n    \"status\": \"CREATED\",\n    \"errors\": [],\n    \"warnings\": [],\n    \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n    \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n    \"evidence_document_url\": null,\n    \"error_reason\": null,\n    \"evidence_generated_at\": null,\n    \"documents\": [\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000011\",\n        \"custom_key\": \"0\",\n        \"file_type\": \"ORIGINAL\",\n        \"order\": 0,\n        \"status\": \"CREATED\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"file_name\": \"contract-main.pdf\",\n        \"content_type\": \"application/pdf\",\n        \"file_size\": 1150,\n        \"page_count\": 1,\n        \"url\": \"https://storage.example.invalid/sample/contract-main.pdf?signature=redacted\"\n      }\n    ],\n    \"recipients\": [\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000002\",\n        \"custom_key\": \"signer\",\n        \"order\": 1,\n        \"status\": \"CREATED\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"name\": \"Ana Signer\",\n        \"name_label\": \"Name:\",\n        \"email\": \"signer@example.com\",\n        \"email_label\": \"Email:\"\n      }\n    ],\n    \"placements\": [\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000041\",\n        \"custom_key\": \"p1\",\n        \"placement_type\": \"SIGNATURE\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"recipient_id\": \"00000000-0000-4000-8000-000000000002\",\n        \"recipient_key\": \"signer\",\n        \"document_id\": \"00000000-0000-4000-8000-000000000011\",\n        \"document_key\": \"0\",\n        \"order\": 0,\n        \"coordinates\": {\n          \"id\": \"Lexgo-Sign-0\",\n          \"top\": 650,\n          \"left\": 100,\n          \"page\": 0\n        },\n        \"token\": null\n      }\n    ],\n    \"settings\": {\n      \"emails\": {\n        \"envelope_invitation\": \"TRUE\",\n        \"envelope_voided\": \"TRUE\",\n        \"envelope_rejected\": \"TRUE\",\n        \"envelope_signed\": \"TRUE\"\n      },\n      \"documents\": {\n        \"include_page_id\": \"TRUE\",\n        \"custom_page_id\": \"Lexgo Sign ID:\",\n        \"signatures_per_page\": 4,\n        \"signatures_per_row\": 1\n      },\n      \"signature_flow\": {\n        \"language\": \"EN\",\n        \"signature_order\": \"PARALLEL\",\n        \"signature_types\": \"WRITTEN, DRAWN, UPLOADED\",\n        \"signature_color\": \"#000000\",\n        \"sender_name\": \"Lexgo\",\n        \"sender_enterprise\": null\n      },\n      \"signature\": {\n        \"style\": \"SIMPLE\",\n        \"type\": \"INTERNATIONAL\",\n        \"image\": \"DEFAULT\",\n        \"text\": \"DEFAULT\",\n        \"bg_image\": \"DEFAULT\",\n        \"bg_image_scope\": \"QUALIFIED_CHILE\"\n      },\n      \"validations\": {\n        \"email\": {\n          \"order\": 0,\n          \"enabled\": \"FALSE\"\n        },\n        \"phone\": {\n          \"order\": 1,\n          \"enabled\": \"FALSE\",\n          \"methods\": \"SMS\"\n        },\n        \"id_check\": {\n          \"order\": 2,\n          \"enabled\": \"FALSE\"\n        },\n        \"biometric\": {\n          \"order\": 3,\n          \"enabled\": \"FALSE\"\n        }\n      }\n    },\n    \"metadata\": {\n      \"reference\": \"Contrato-Ñandú-2026\",\n      \"customer\": {\n        \"name\": \"José Pérez 山田\",\n        \"tags\": [\n          \"fírma\",\n          \"日本語\",\n          \"emoji 🙂\"\n        ],\n        \"contacts\": [\n          {\n            \"labels\": [\n              \"primary\",\n              \"legal\"\n            ]\n          }\n        ]\n      },\n      \"count\": 3,\n      \"active\": true,\n      \"note\": null\n    }\n  },\n  \"request_id\": \"00000000-0000-4000-8000-0000000000aa\"\n}"
            }
          ]
        },
        {
          "name": "Get draft",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = pm.response.json();",
                  "pm.test('Status is 200', () => pm.response.to.have.status(200));",
                  "pm.test('Returns the multipart draft', () => {",
                  "    pm.expect(j.envelope.id).to.eql(pm.variables.get('envelope_id'));",
                  "    pm.expect(j.envelope.status).to.eql('CREATED');",
                  "    pm.expect(j.envelope.documents).to.have.lengthOf(3);",
                  "    pm.expect(j.envelope.recipients).to.have.lengthOf(3);",
                  "});",
                  "pm.test('Envelope has the documented fields', () => {",
                  "    pm.expect(j.envelope).to.include.keys('id', 'name', 'status', 'errors', 'documents', 'recipients', 'placements', 'settings', 'metadata');",
                  "});",
                  "pm.test('request_id is present', () => pm.expect(j.request_id).to.be.a('string').and.not.empty);"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "{{api_key}}",
                "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
              }
            ],
            "url": {
              "raw": "{{api_url}}/{{api_prefix}}/envelopes/{{envelope_id}}",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "{{api_prefix}}",
                "envelopes",
                "{{envelope_id}}"
              ]
            },
            "description": "Safe. Reads the draft created by the multipart request. Public docs: api/envelopes.md."
          },
          "response": [
            {
              "name": "200 OK",
              "originalRequest": {
                "method": "GET",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "{{api_key}}",
                    "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
                  }
                ],
                "url": {
                  "raw": "{{api_url}}/{{api_prefix}}/envelopes/{{envelope_id}}",
                  "host": [
                    "{{api_url}}"
                  ],
                  "path": [
                    "{{api_prefix}}",
                    "envelopes",
                    "{{envelope_id}}"
                  ]
                },
                "description": "Safe. Reads the draft created by the multipart request. Public docs: api/envelopes.md."
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"envelope\": {\n    \"id\": \"00000000-0000-4000-8000-000000000001\",\n    \"name\": \"Postman multi-document draft (fictional)\",\n    \"status\": \"CREATED\",\n    \"errors\": [],\n    \"warnings\": [],\n    \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n    \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n    \"evidence_document_url\": null,\n    \"error_reason\": null,\n    \"evidence_generated_at\": null,\n    \"documents\": [\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000011\",\n        \"custom_key\": \"0\",\n        \"file_type\": \"ORIGINAL\",\n        \"order\": 0,\n        \"status\": \"CREATED\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"file_name\": \"contract-main.pdf\",\n        \"content_type\": \"application/pdf\",\n        \"file_size\": 1150,\n        \"page_count\": 1,\n        \"url\": \"https://storage.example.invalid/sample/contract-main.pdf?signature=redacted\"\n      },\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000012\",\n        \"custom_key\": \"1\",\n        \"file_type\": \"ORIGINAL\",\n        \"order\": 1,\n        \"status\": \"CREATED\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"file_name\": \"contract-annex.pdf\",\n        \"content_type\": \"application/pdf\",\n        \"file_size\": 1150,\n        \"page_count\": 1,\n        \"url\": \"https://storage.example.invalid/sample/contract-annex.pdf?signature=redacted\"\n      },\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000013\",\n        \"custom_key\": \"2\",\n        \"file_type\": \"ATTACHMENT\",\n        \"order\": 2,\n        \"status\": \"CREATED\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"file_name\": \"supporting-attachment.pdf\",\n        \"content_type\": \"application/pdf\",\n        \"file_size\": 1150,\n        \"page_count\": 1,\n        \"url\": \"https://storage.example.invalid/sample/supporting-attachment.pdf?signature=redacted\"\n      }\n    ],\n    \"recipients\": [\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000002\",\n        \"custom_key\": \"signer\",\n        \"order\": 1,\n        \"status\": \"CREATED\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"name\": \"Ana Signer\",\n        \"name_label\": \"Name:\",\n        \"email\": \"signer@example.com\",\n        \"email_label\": \"Email:\"\n      },\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000003\",\n        \"custom_key\": \"approver\",\n        \"order\": 2,\n        \"status\": \"CREATED\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"name\": \"Beto Approver\",\n        \"name_label\": \"Name:\",\n        \"email\": \"approver@example.com\",\n        \"email_label\": \"Email:\"\n      },\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000004\",\n        \"custom_key\": \"witness\",\n        \"order\": 3,\n        \"status\": \"CREATED\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"name\": \"Carla Witness\",\n        \"name_label\": \"Name:\",\n        \"email\": \"witness@example.com\",\n        \"email_label\": \"Email:\"\n      }\n    ],\n    \"placements\": [\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000041\",\n        \"custom_key\": \"p1\",\n        \"placement_type\": \"SIGNATURE\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"recipient_id\": \"00000000-0000-4000-8000-000000000002\",\n        \"recipient_key\": \"signer\",\n        \"document_id\": \"00000000-0000-4000-8000-000000000011\",\n        \"document_key\": \"0\",\n        \"order\": 0,\n        \"coordinates\": {\n          \"id\": \"Lexgo-Sign-0\",\n          \"top\": 650,\n          \"left\": 100,\n          \"page\": 0\n        },\n        \"token\": null\n      },\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000042\",\n        \"custom_key\": \"p2\",\n        \"placement_type\": \"APPROVER\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"recipient_id\": \"00000000-0000-4000-8000-000000000003\",\n        \"recipient_key\": \"approver\",\n        \"document_id\": \"00000000-0000-4000-8000-000000000011\",\n        \"document_key\": \"0\",\n        \"order\": 1,\n        \"coordinates\": {},\n        \"token\": null\n      },\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000043\",\n        \"custom_key\": \"p3\",\n        \"placement_type\": \"WITNESS\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"recipient_id\": \"00000000-0000-4000-8000-000000000004\",\n        \"recipient_key\": \"witness\",\n        \"document_id\": \"00000000-0000-4000-8000-000000000012\",\n        \"document_key\": \"1\",\n        \"order\": 2,\n        \"coordinates\": {},\n        \"token\": null\n      },\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000044\",\n        \"custom_key\": \"p4\",\n        \"placement_type\": \"SIGNATURE\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"recipient_id\": \"00000000-0000-4000-8000-000000000002\",\n        \"recipient_key\": \"signer\",\n        \"document_id\": \"00000000-0000-4000-8000-000000000012\",\n        \"document_key\": \"1\",\n        \"order\": 3,\n        \"coordinates\": {\n          \"id\": \"Lexgo-Sign-3\",\n          \"top\": 650,\n          \"left\": 100,\n          \"page\": 0\n        },\n        \"token\": null\n      }\n    ],\n    \"settings\": {\n      \"emails\": {\n        \"envelope_invitation\": \"TRUE\",\n        \"envelope_voided\": \"TRUE\",\n        \"envelope_rejected\": \"TRUE\",\n        \"envelope_signed\": \"TRUE\"\n      },\n      \"documents\": {\n        \"include_page_id\": \"TRUE\",\n        \"custom_page_id\": \"Lexgo Sign ID:\",\n        \"signatures_per_page\": 4,\n        \"signatures_per_row\": 1\n      },\n      \"signature_flow\": {\n        \"language\": \"EN\",\n        \"signature_order\": \"PARALLEL\",\n        \"signature_types\": \"WRITTEN, DRAWN, UPLOADED\",\n        \"signature_color\": \"#000000\",\n        \"sender_name\": \"Lexgo\",\n        \"sender_enterprise\": null\n      },\n      \"signature\": {\n        \"style\": \"SIMPLE\",\n        \"type\": \"INTERNATIONAL\",\n        \"image\": \"DEFAULT\",\n        \"text\": \"DEFAULT\",\n        \"bg_image\": \"DEFAULT\",\n        \"bg_image_scope\": \"QUALIFIED_CHILE\"\n      },\n      \"validations\": {\n        \"email\": {\n          \"order\": 0,\n          \"enabled\": \"FALSE\"\n        },\n        \"phone\": {\n          \"order\": 1,\n          \"enabled\": \"FALSE\",\n          \"methods\": \"SMS\"\n        },\n        \"id_check\": {\n          \"order\": 2,\n          \"enabled\": \"FALSE\"\n        },\n        \"biometric\": {\n          \"order\": 3,\n          \"enabled\": \"FALSE\"\n        }\n      }\n    },\n    \"metadata\": {}\n  },\n  \"request_id\": \"00000000-0000-4000-8000-0000000000aa\"\n}"
            },
            {
              "name": "404 Not Found",
              "originalRequest": {
                "method": "GET",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "{{api_key}}",
                    "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
                  }
                ],
                "url": {
                  "raw": "{{api_url}}/{{api_prefix}}/envelopes/{{envelope_id}}",
                  "host": [
                    "{{api_url}}"
                  ],
                  "path": [
                    "{{api_prefix}}",
                    "envelopes",
                    "{{envelope_id}}"
                  ]
                },
                "description": "Safe. Reads the draft created by the multipart request. Public docs: api/envelopes.md."
              },
              "status": "Not Found",
              "code": 404,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"error\": \"Envelope not found\",\n  \"request_id\": \"00000000-0000-4000-8000-0000000000aa\"\n}"
            }
          ]
        },
        {
          "name": "Get draft - metadata round trip",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = pm.response.json();",
                  "pm.test('Status is 200', () => pm.response.to.have.status(200));",
                  "pm.test('Stored metadata deep-equals the full object that was sent', () => {",
                  "    pm.expect(j.envelope.metadata).to.deep.equal(JSON.parse(pm.variables.get('metadata_sent')));",
                  "});",
                  "pm.test('Unicode survived', () => {",
                  "    pm.expect(j.envelope.metadata.customer.name).to.eql('José Pérez 山田');",
                  "    pm.expect(j.envelope.metadata.customer.tags).to.include('emoji 🙂');",
                  "});",
                  "pm.test('request_id is present', () => pm.expect(j.request_id).to.be.a('string').and.not.empty);"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "{{api_key}}",
                "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
              }
            ],
            "url": {
              "raw": "{{api_url}}/{{api_prefix}}/envelopes/{{json_envelope_id}}",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "{{api_prefix}}",
                "envelopes",
                "{{json_envelope_id}}"
              ]
            },
            "description": "Safe. Reads the JSON draft back and compares the stored metadata with the object that was sent. Public docs: api/envelopes.md#envelope-metadata."
          },
          "response": [
            {
              "name": "200 OK",
              "originalRequest": {
                "method": "GET",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "{{api_key}}",
                    "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
                  }
                ],
                "url": {
                  "raw": "{{api_url}}/{{api_prefix}}/envelopes/{{json_envelope_id}}",
                  "host": [
                    "{{api_url}}"
                  ],
                  "path": [
                    "{{api_prefix}}",
                    "envelopes",
                    "{{json_envelope_id}}"
                  ]
                },
                "description": "Safe. Reads the JSON draft back and compares the stored metadata with the object that was sent. Public docs: api/envelopes.md#envelope-metadata."
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"envelope\": {\n    \"id\": \"00000000-0000-4000-8000-000000000006\",\n    \"name\": \"Postman JSON draft with Unicode metadata (fictional)\",\n    \"status\": \"CREATED\",\n    \"errors\": [],\n    \"warnings\": [],\n    \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n    \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n    \"evidence_document_url\": null,\n    \"error_reason\": null,\n    \"evidence_generated_at\": null,\n    \"documents\": [\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000011\",\n        \"custom_key\": \"0\",\n        \"file_type\": \"ORIGINAL\",\n        \"order\": 0,\n        \"status\": \"CREATED\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"file_name\": \"contract-main.pdf\",\n        \"content_type\": \"application/pdf\",\n        \"file_size\": 1150,\n        \"page_count\": 1,\n        \"url\": \"https://storage.example.invalid/sample/contract-main.pdf?signature=redacted\"\n      }\n    ],\n    \"recipients\": [\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000002\",\n        \"custom_key\": \"signer\",\n        \"order\": 1,\n        \"status\": \"CREATED\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"name\": \"Ana Signer\",\n        \"name_label\": \"Name:\",\n        \"email\": \"signer@example.com\",\n        \"email_label\": \"Email:\"\n      }\n    ],\n    \"placements\": [\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000041\",\n        \"custom_key\": \"p1\",\n        \"placement_type\": \"SIGNATURE\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"recipient_id\": \"00000000-0000-4000-8000-000000000002\",\n        \"recipient_key\": \"signer\",\n        \"document_id\": \"00000000-0000-4000-8000-000000000011\",\n        \"document_key\": \"0\",\n        \"order\": 0,\n        \"coordinates\": {\n          \"id\": \"Lexgo-Sign-0\",\n          \"top\": 650,\n          \"left\": 100,\n          \"page\": 0\n        },\n        \"token\": null\n      }\n    ],\n    \"settings\": {\n      \"emails\": {\n        \"envelope_invitation\": \"TRUE\",\n        \"envelope_voided\": \"TRUE\",\n        \"envelope_rejected\": \"TRUE\",\n        \"envelope_signed\": \"TRUE\"\n      },\n      \"documents\": {\n        \"include_page_id\": \"TRUE\",\n        \"custom_page_id\": \"Lexgo Sign ID:\",\n        \"signatures_per_page\": 4,\n        \"signatures_per_row\": 1\n      },\n      \"signature_flow\": {\n        \"language\": \"EN\",\n        \"signature_order\": \"PARALLEL\",\n        \"signature_types\": \"WRITTEN, DRAWN, UPLOADED\",\n        \"signature_color\": \"#000000\",\n        \"sender_name\": \"Lexgo\",\n        \"sender_enterprise\": null\n      },\n      \"signature\": {\n        \"style\": \"SIMPLE\",\n        \"type\": \"INTERNATIONAL\",\n        \"image\": \"DEFAULT\",\n        \"text\": \"DEFAULT\",\n        \"bg_image\": \"DEFAULT\",\n        \"bg_image_scope\": \"QUALIFIED_CHILE\"\n      },\n      \"validations\": {\n        \"email\": {\n          \"order\": 0,\n          \"enabled\": \"FALSE\"\n        },\n        \"phone\": {\n          \"order\": 1,\n          \"enabled\": \"FALSE\",\n          \"methods\": \"SMS\"\n        },\n        \"id_check\": {\n          \"order\": 2,\n          \"enabled\": \"FALSE\"\n        },\n        \"biometric\": {\n          \"order\": 3,\n          \"enabled\": \"FALSE\"\n        }\n      }\n    },\n    \"metadata\": {\n      \"reference\": \"Contrato-Ñandú-2026\",\n      \"customer\": {\n        \"name\": \"José Pérez 山田\",\n        \"tags\": [\n          \"fírma\",\n          \"日本語\",\n          \"emoji 🙂\"\n        ],\n        \"contacts\": [\n          {\n            \"labels\": [\n              \"primary\",\n              \"legal\"\n            ]\n          }\n        ]\n      },\n      \"count\": 3,\n      \"active\": true,\n      \"note\": null\n    }\n  },\n  \"request_id\": \"00000000-0000-4000-8000-0000000000aa\"\n}"
            }
          ]
        },
        {
          "name": "Update draft - rename, replace recipients and placements",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = pm.response.json();",
                  "pm.test('Status is 200', () => pm.response.to.have.status(200));",
                  "pm.test('Name and recipient were replaced', () => {",
                  "    pm.expect(j.envelope.name).to.eql('Postman JSON draft (renamed)');",
                  "    pm.expect(j.envelope.recipients).to.have.lengthOf(1);",
                  "    pm.expect(j.envelope.recipients[0].name).to.eql('Ana Signer (updated)');",
                  "});",
                  "pm.test('Documents were left untouched because they were omitted', () => pm.expect(j.envelope.documents).to.have.lengthOf(1));",
                  "pm.test('metadata in the update body is ignored', () => {",
                  "    pm.expect(j.envelope.metadata).to.deep.equal(JSON.parse(pm.variables.get('metadata_sent')));",
                  "});",
                  "pm.test('request_id is present', () => pm.expect(j.request_id).to.be.a('string').and.not.empty);",
                  "pm.collectionVariables.set('json_signer_id', j.envelope.recipients[0].id);"
                ]
              }
            }
          ],
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Authorization",
                "value": "{{api_key}}",
                "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{api_url}}/{{api_prefix}}/envelopes/{{json_envelope_id}}",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "{{api_prefix}}",
                "envelopes",
                "{{json_envelope_id}}"
              ]
            },
            "description": "Safe. Updates a draft (CREATED or ERROR only). Each of documents, recipients and placements REPLACES all existing items of that kind (recipients get new ids); omit a kind to keep it. `metadata` is ignored on update. Any other status returns 405. Public docs: api/envelopes.md.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Postman JSON draft (renamed)\",\n  \"recipients\": {\n    \"signer\": {\n      \"name\": \"Ana Signer (updated)\",\n      \"email\": \"{{fixture_signer_email}}\",\n      \"order\": 1\n    }\n  },\n  \"placements\": {\n    \"p1\": {\n      \"document_key\": \"0\",\n      \"recipient_key\": \"signer\",\n      \"type\": \"SIGNATURE\",\n      \"coordinates\": {\n        \"page\": 0,\n        \"top\": 600,\n        \"left\": 120\n      }\n    }\n  },\n  \"metadata\": {\n    \"ignored\": \"metadata is not updatable\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [
            {
              "name": "200 OK",
              "originalRequest": {
                "method": "PUT",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "{{api_key}}",
                    "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": {
                  "raw": "{{api_url}}/{{api_prefix}}/envelopes/{{json_envelope_id}}",
                  "host": [
                    "{{api_url}}"
                  ],
                  "path": [
                    "{{api_prefix}}",
                    "envelopes",
                    "{{json_envelope_id}}"
                  ]
                },
                "description": "Safe. Updates a draft (CREATED or ERROR only). Each of documents, recipients and placements REPLACES all existing items of that kind (recipients get new ids); omit a kind to keep it. `metadata` is ignored on update. Any other status returns 405. Public docs: api/envelopes.md.",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"name\": \"Postman JSON draft (renamed)\",\n  \"recipients\": {\n    \"signer\": {\n      \"name\": \"Ana Signer (updated)\",\n      \"email\": \"{{fixture_signer_email}}\",\n      \"order\": 1\n    }\n  },\n  \"placements\": {\n    \"p1\": {\n      \"document_key\": \"0\",\n      \"recipient_key\": \"signer\",\n      \"type\": \"SIGNATURE\",\n      \"coordinates\": {\n        \"page\": 0,\n        \"top\": 600,\n        \"left\": 120\n      }\n    }\n  },\n  \"metadata\": {\n    \"ignored\": \"metadata is not updatable\"\n  }\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"envelope\": {\n    \"id\": \"00000000-0000-4000-8000-000000000006\",\n    \"name\": \"Postman JSON draft (renamed)\",\n    \"status\": \"CREATED\",\n    \"errors\": [],\n    \"warnings\": [],\n    \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n    \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n    \"evidence_document_url\": null,\n    \"error_reason\": null,\n    \"evidence_generated_at\": null,\n    \"documents\": [\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000011\",\n        \"custom_key\": \"0\",\n        \"file_type\": \"ORIGINAL\",\n        \"order\": 0,\n        \"status\": \"CREATED\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"file_name\": \"contract-main.pdf\",\n        \"content_type\": \"application/pdf\",\n        \"file_size\": 1150,\n        \"page_count\": 1,\n        \"url\": \"https://storage.example.invalid/sample/contract-main.pdf?signature=redacted\"\n      }\n    ],\n    \"recipients\": [\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000002\",\n        \"custom_key\": \"signer\",\n        \"order\": 1,\n        \"status\": \"CREATED\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"name\": \"Ana Signer (updated)\",\n        \"name_label\": \"Name:\",\n        \"email\": \"signer@example.com\",\n        \"email_label\": \"Email:\"\n      }\n    ],\n    \"placements\": [\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000041\",\n        \"custom_key\": \"p1\",\n        \"placement_type\": \"SIGNATURE\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"recipient_id\": \"00000000-0000-4000-8000-000000000002\",\n        \"recipient_key\": \"signer\",\n        \"document_id\": \"00000000-0000-4000-8000-000000000011\",\n        \"document_key\": \"0\",\n        \"order\": 0,\n        \"coordinates\": {\n          \"id\": \"Lexgo-Sign-0\",\n          \"page\": 0,\n          \"top\": 600,\n          \"left\": 120\n        },\n        \"token\": null\n      }\n    ],\n    \"settings\": {\n      \"emails\": {\n        \"envelope_invitation\": \"TRUE\",\n        \"envelope_voided\": \"TRUE\",\n        \"envelope_rejected\": \"TRUE\",\n        \"envelope_signed\": \"TRUE\"\n      },\n      \"documents\": {\n        \"include_page_id\": \"TRUE\",\n        \"custom_page_id\": \"Lexgo Sign ID:\",\n        \"signatures_per_page\": 4,\n        \"signatures_per_row\": 1\n      },\n      \"signature_flow\": {\n        \"language\": \"EN\",\n        \"signature_order\": \"PARALLEL\",\n        \"signature_types\": \"WRITTEN, DRAWN, UPLOADED\",\n        \"signature_color\": \"#000000\",\n        \"sender_name\": \"Lexgo\",\n        \"sender_enterprise\": null\n      },\n      \"signature\": {\n        \"style\": \"SIMPLE\",\n        \"type\": \"INTERNATIONAL\",\n        \"image\": \"DEFAULT\",\n        \"text\": \"DEFAULT\",\n        \"bg_image\": \"DEFAULT\",\n        \"bg_image_scope\": \"QUALIFIED_CHILE\"\n      },\n      \"validations\": {\n        \"email\": {\n          \"order\": 0,\n          \"enabled\": \"FALSE\"\n        },\n        \"phone\": {\n          \"order\": 1,\n          \"enabled\": \"FALSE\",\n          \"methods\": \"SMS\"\n        },\n        \"id_check\": {\n          \"order\": 2,\n          \"enabled\": \"FALSE\"\n        },\n        \"biometric\": {\n          \"order\": 3,\n          \"enabled\": \"FALSE\"\n        }\n      }\n    },\n    \"metadata\": {\n      \"reference\": \"Contrato-Ñandú-2026\",\n      \"customer\": {\n        \"name\": \"José Pérez 山田\",\n        \"tags\": [\n          \"fírma\",\n          \"日本語\",\n          \"emoji 🙂\"\n        ],\n        \"contacts\": [\n          {\n            \"labels\": [\n              \"primary\",\n              \"legal\"\n            ]\n          }\n        ]\n      },\n      \"count\": 3,\n      \"active\": true,\n      \"note\": null\n    }\n  },\n  \"request_id\": \"00000000-0000-4000-8000-0000000000aa\"\n}"
            },
            {
              "name": "404 Not Found",
              "originalRequest": {
                "method": "PUT",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "{{api_key}}",
                    "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": {
                  "raw": "{{api_url}}/{{api_prefix}}/envelopes/{{json_envelope_id}}",
                  "host": [
                    "{{api_url}}"
                  ],
                  "path": [
                    "{{api_prefix}}",
                    "envelopes",
                    "{{json_envelope_id}}"
                  ]
                },
                "description": "Safe. Updates a draft (CREATED or ERROR only). Each of documents, recipients and placements REPLACES all existing items of that kind (recipients get new ids); omit a kind to keep it. `metadata` is ignored on update. Any other status returns 405. Public docs: api/envelopes.md.",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"name\": \"Postman JSON draft (renamed)\",\n  \"recipients\": {\n    \"signer\": {\n      \"name\": \"Ana Signer (updated)\",\n      \"email\": \"{{fixture_signer_email}}\",\n      \"order\": 1\n    }\n  },\n  \"placements\": {\n    \"p1\": {\n      \"document_key\": \"0\",\n      \"recipient_key\": \"signer\",\n      \"type\": \"SIGNATURE\",\n      \"coordinates\": {\n        \"page\": 0,\n        \"top\": 600,\n        \"left\": 120\n      }\n    }\n  },\n  \"metadata\": {\n    \"ignored\": \"metadata is not updatable\"\n  }\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "Not Found",
              "code": 404,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"error\": \"Envelope not found\",\n  \"request_id\": \"00000000-0000-4000-8000-0000000000aa\"\n}"
            },
            {
              "name": "405 Not updatable (status is not CREATED or ERROR)",
              "originalRequest": {
                "method": "PUT",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "{{api_key}}",
                    "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": {
                  "raw": "{{api_url}}/{{api_prefix}}/envelopes/{{json_envelope_id}}",
                  "host": [
                    "{{api_url}}"
                  ],
                  "path": [
                    "{{api_prefix}}",
                    "envelopes",
                    "{{json_envelope_id}}"
                  ]
                },
                "description": "Safe. Updates a draft (CREATED or ERROR only). Each of documents, recipients and placements REPLACES all existing items of that kind (recipients get new ids); omit a kind to keep it. `metadata` is ignored on update. Any other status returns 405. Public docs: api/envelopes.md.",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"name\": \"Postman JSON draft (renamed)\",\n  \"recipients\": {\n    \"signer\": {\n      \"name\": \"Ana Signer (updated)\",\n      \"email\": \"{{fixture_signer_email}}\",\n      \"order\": 1\n    }\n  },\n  \"placements\": {\n    \"p1\": {\n      \"document_key\": \"0\",\n      \"recipient_key\": \"signer\",\n      \"type\": \"SIGNATURE\",\n      \"coordinates\": {\n        \"page\": 0,\n        \"top\": 600,\n        \"left\": 120\n      }\n    }\n  },\n  \"metadata\": {\n    \"ignored\": \"metadata is not updatable\"\n  }\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "Method Not Allowed",
              "code": 405,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"error\": \"Envelope can only be updated when in CREATED status\",\n  \"request_id\": \"00000000-0000-4000-8000-0000000000aa\"\n}"
            }
          ]
        },
        {
          "name": "Update draft - replace documents and placements",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = pm.response.json();",
                  "pm.test('Status is 200', () => pm.response.to.have.status(200));",
                  "pm.test('The document and the placement were replaced', () => {",
                  "    pm.expect(j.envelope.documents.map((d) => d.file_name)).to.eql(['contract-replaced.pdf']);",
                  "    pm.expect(j.envelope.placements).to.have.lengthOf(1);",
                  "    pm.expect(j.envelope.placements[0].token).to.eql('[[SIGN-HERE-1]]');",
                  "});",
                  "pm.test('Recipients were kept because they were omitted, and metadata is unchanged', () => {",
                  "    pm.expect(j.envelope.recipients).to.have.lengthOf(1);",
                  "    pm.expect(j.envelope.metadata).to.deep.equal(JSON.parse(pm.variables.get('metadata_sent')));",
                  "});",
                  "pm.test('request_id is present', () => pm.expect(j.request_id).to.be.a('string').and.not.empty);"
                ]
              }
            }
          ],
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Authorization",
                "value": "{{api_key}}",
                "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{api_url}}/{{api_prefix}}/envelopes/{{json_envelope_id}}",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "{{api_prefix}}",
                "envelopes",
                "{{json_envelope_id}}"
              ]
            },
            "description": "Safe. Replaces the document and the placements of the JSON draft in one update; recipients are omitted and therefore kept. The placement points at the recipient by its custom key and at the document by key `0`. Public docs: api/envelopes.md.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"documents\": {\n    \"0\": {\n      \"base64\": \"{{sample_pdf_base64}}\",\n      \"name\": \"contract-replaced.pdf\",\n      \"type\": \"SIGNABLE\"\n    }\n  },\n  \"placements\": {\n    \"p1\": {\n      \"document_key\": \"0\",\n      \"recipient_key\": \"signer\",\n      \"type\": \"SIGNATURE\",\n      \"token\": \"[[SIGN-HERE-1]]\"\n    }\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [
            {
              "name": "200 OK",
              "originalRequest": {
                "method": "PUT",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "{{api_key}}",
                    "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": {
                  "raw": "{{api_url}}/{{api_prefix}}/envelopes/{{json_envelope_id}}",
                  "host": [
                    "{{api_url}}"
                  ],
                  "path": [
                    "{{api_prefix}}",
                    "envelopes",
                    "{{json_envelope_id}}"
                  ]
                },
                "description": "Safe. Replaces the document and the placements of the JSON draft in one update; recipients are omitted and therefore kept. The placement points at the recipient by its custom key and at the document by key `0`. Public docs: api/envelopes.md.",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"documents\": {\n    \"0\": {\n      \"base64\": \"{{sample_pdf_base64}}\",\n      \"name\": \"contract-replaced.pdf\",\n      \"type\": \"SIGNABLE\"\n    }\n  },\n  \"placements\": {\n    \"p1\": {\n      \"document_key\": \"0\",\n      \"recipient_key\": \"signer\",\n      \"type\": \"SIGNATURE\",\n      \"token\": \"[[SIGN-HERE-1]]\"\n    }\n  }\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"envelope\": {\n    \"id\": \"00000000-0000-4000-8000-000000000006\",\n    \"name\": \"Postman JSON draft (renamed)\",\n    \"status\": \"CREATED\",\n    \"errors\": [],\n    \"warnings\": [],\n    \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n    \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n    \"evidence_document_url\": null,\n    \"error_reason\": null,\n    \"evidence_generated_at\": null,\n    \"documents\": [\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000011\",\n        \"custom_key\": \"0\",\n        \"file_type\": \"ORIGINAL\",\n        \"order\": 0,\n        \"status\": \"CREATED\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"file_name\": \"contract-replaced.pdf\",\n        \"content_type\": \"application/pdf\",\n        \"file_size\": 1150,\n        \"page_count\": 1,\n        \"url\": \"https://storage.example.invalid/sample/contract-main.pdf?signature=redacted\"\n      }\n    ],\n    \"recipients\": [\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000002\",\n        \"custom_key\": \"signer\",\n        \"order\": 1,\n        \"status\": \"CREATED\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"name\": \"Ana Signer (updated)\",\n        \"name_label\": \"Name:\",\n        \"email\": \"signer@example.com\",\n        \"email_label\": \"Email:\"\n      }\n    ],\n    \"placements\": [\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000041\",\n        \"custom_key\": \"p1\",\n        \"placement_type\": \"SIGNATURE\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"recipient_id\": \"00000000-0000-4000-8000-000000000002\",\n        \"recipient_key\": \"signer\",\n        \"document_id\": \"00000000-0000-4000-8000-000000000011\",\n        \"document_key\": \"0\",\n        \"order\": 0,\n        \"coordinates\": {\n          \"id\": \"Lexgo-Sign-0\",\n          \"page\": 0,\n          \"top\": 91.76,\n          \"left\": 72.0\n        },\n        \"token\": \"[[SIGN-HERE-1]]\"\n      }\n    ],\n    \"settings\": {\n      \"emails\": {\n        \"envelope_invitation\": \"TRUE\",\n        \"envelope_voided\": \"TRUE\",\n        \"envelope_rejected\": \"TRUE\",\n        \"envelope_signed\": \"TRUE\"\n      },\n      \"documents\": {\n        \"include_page_id\": \"TRUE\",\n        \"custom_page_id\": \"Lexgo Sign ID:\",\n        \"signatures_per_page\": 4,\n        \"signatures_per_row\": 1\n      },\n      \"signature_flow\": {\n        \"language\": \"EN\",\n        \"signature_order\": \"PARALLEL\",\n        \"signature_types\": \"WRITTEN, DRAWN, UPLOADED\",\n        \"signature_color\": \"#000000\",\n        \"sender_name\": \"Lexgo\",\n        \"sender_enterprise\": null\n      },\n      \"signature\": {\n        \"style\": \"SIMPLE\",\n        \"type\": \"INTERNATIONAL\",\n        \"image\": \"DEFAULT\",\n        \"text\": \"DEFAULT\",\n        \"bg_image\": \"DEFAULT\",\n        \"bg_image_scope\": \"QUALIFIED_CHILE\"\n      },\n      \"validations\": {\n        \"email\": {\n          \"order\": 0,\n          \"enabled\": \"FALSE\"\n        },\n        \"phone\": {\n          \"order\": 1,\n          \"enabled\": \"FALSE\",\n          \"methods\": \"SMS\"\n        },\n        \"id_check\": {\n          \"order\": 2,\n          \"enabled\": \"FALSE\"\n        },\n        \"biometric\": {\n          \"order\": 3,\n          \"enabled\": \"FALSE\"\n        }\n      }\n    },\n    \"metadata\": {\n      \"reference\": \"Contrato-Ñandú-2026\",\n      \"customer\": {\n        \"name\": \"José Pérez 山田\",\n        \"tags\": [\n          \"fírma\",\n          \"日本語\",\n          \"emoji 🙂\"\n        ],\n        \"contacts\": [\n          {\n            \"labels\": [\n              \"primary\",\n              \"legal\"\n            ]\n          }\n        ]\n      },\n      \"count\": 3,\n      \"active\": true,\n      \"note\": null\n    }\n  },\n  \"request_id\": \"00000000-0000-4000-8000-0000000000aa\"\n}"
            }
          ]
        },
        {
          "name": "Create draft - 1 signer, 1 file (optional recipient fields, settings overrides)",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = pm.response.json();",
                  "pm.test('Status is 200 (a 422 with status ERROR on a sandbox key usually means a recipient email is not a team address)', () => pm.response.to.have.status(200));",
                  "pm.test('Envelope is a CREATED draft', () => {",
                  "    pm.expect(j.envelope).to.be.an('object');",
                  "    pm.expect(j.envelope.status, JSON.stringify(j.envelope.errors)).to.eql('CREATED');",
                  "});",
                  "pm.test('request_id is present', () => pm.expect(j.request_id).to.be.a('string').and.not.empty);",
                  "",
                  "pm.test('Documents: ORIGINAL', () => pm.expect(j.envelope.documents.map((d) => d.file_type).sort()).to.eql([\"ORIGINAL\"]));",
                  "pm.test('Recipient keys: custom_key', () => pm.expect(j.envelope.recipients.map((r) => r.custom_key).sort()).to.eql([\"custom_key\"]));",
                  "pm.test('Placement types: SIGNATURE', () => pm.expect(j.envelope.placements.map((p) => p.placement_type).sort()).to.eql([\"SIGNATURE\"]));",
                  "",
                  "pm.test('Optional recipient fields and the settings override are echoed', () => {",
                  "    const r = j.envelope.recipients[0];",
                  "    pm.expect(r.tax_id).to.eql('11111111-1');",
                  "    pm.expect(r.rep_id).to.eql('22222222-2');",
                  "    pm.expect(j.envelope.settings.signature_flow.sender_name).to.eql('Fixture Sender');",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "{{api_key}}",
                "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
              }
            ],
            "url": {
              "raw": "{{api_url}}/{{api_prefix}}/envelopes",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "{{api_prefix}}",
                "envelopes"
              ]
            },
            "description": "Safe. One signer with every optional recipient field (phone_id, phone_label, tax_id, tax_label, rep_id, rep_label) and per-envelope settings overrides (sender name, invitation and signed emails, signature type). Settings sent here override the account settings for this envelope only. Note that the API reads the phone from phone_id and echoes only phone_label. Public docs: api/envelopes.md.",
            "body": {
              "mode": "formdata",
              "formdata": [
                {
                  "key": "name",
                  "value": "Create draft - 1 signer, 1 file (optional recipient fields, settings overrides)",
                  "type": "text"
                },
                {
                  "key": "documents[0][base64]",
                  "value": "{{sample_pdf_base64}}",
                  "type": "text"
                },
                {
                  "key": "documents[0][name]",
                  "value": "contract-main.pdf",
                  "type": "text"
                },
                {
                  "key": "documents[0][type]",
                  "value": "SIGNABLE",
                  "type": "text"
                },
                {
                  "key": "documents[0][order]",
                  "value": "0",
                  "type": "text"
                },
                {
                  "key": "recipients[custom_key][name]",
                  "value": "Ana Signer",
                  "type": "text"
                },
                {
                  "key": "recipients[custom_key][email]",
                  "value": "{{fixture_signer_email}}",
                  "type": "text"
                },
                {
                  "key": "recipients[custom_key][order]",
                  "value": "1",
                  "type": "text"
                },
                {
                  "key": "recipients[custom_key][phone_id]",
                  "value": "987654321",
                  "type": "text"
                },
                {
                  "key": "recipients[custom_key][phone_label]",
                  "value": "Phone:",
                  "type": "text"
                },
                {
                  "key": "recipients[custom_key][tax_id]",
                  "value": "11111111-1",
                  "type": "text"
                },
                {
                  "key": "recipients[custom_key][tax_label]",
                  "value": "Tax ID:",
                  "type": "text"
                },
                {
                  "key": "recipients[custom_key][rep_id]",
                  "value": "22222222-2",
                  "type": "text"
                },
                {
                  "key": "recipients[custom_key][rep_label]",
                  "value": "Representative ID:",
                  "type": "text"
                },
                {
                  "key": "placements[0][type]",
                  "value": "SIGNATURE",
                  "type": "text"
                },
                {
                  "key": "placements[0][recipient_key]",
                  "value": "custom_key",
                  "type": "text"
                },
                {
                  "key": "placements[0][document_key]",
                  "value": "0",
                  "type": "text"
                },
                {
                  "key": "placements[0][order]",
                  "value": "0",
                  "type": "text"
                },
                {
                  "key": "placements[0][coordinates][top]",
                  "value": "103.5",
                  "type": "text"
                },
                {
                  "key": "placements[0][coordinates][left]",
                  "value": "40.5",
                  "type": "text"
                },
                {
                  "key": "placements[0][coordinates][page]",
                  "value": "0",
                  "type": "text"
                },
                {
                  "key": "settings[signature_flow][sender_name]",
                  "value": "Fixture Sender",
                  "type": "text"
                },
                {
                  "key": "settings[emails][envelope_invitation]",
                  "value": "TRUE",
                  "type": "text"
                },
                {
                  "key": "settings[emails][envelope_signed]",
                  "value": "TRUE",
                  "type": "text"
                },
                {
                  "key": "settings[signature][type]",
                  "value": "INTERNATIONAL",
                  "type": "text"
                }
              ]
            }
          },
          "response": [
            {
              "name": "200 OK - draft created",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "{{api_key}}",
                    "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
                  }
                ],
                "url": {
                  "raw": "{{api_url}}/{{api_prefix}}/envelopes",
                  "host": [
                    "{{api_url}}"
                  ],
                  "path": [
                    "{{api_prefix}}",
                    "envelopes"
                  ]
                },
                "description": "Safe. One signer with every optional recipient field (phone_id, phone_label, tax_id, tax_label, rep_id, rep_label) and per-envelope settings overrides (sender name, invitation and signed emails, signature type). Settings sent here override the account settings for this envelope only. Note that the API reads the phone from phone_id and echoes only phone_label. Public docs: api/envelopes.md.",
                "body": {
                  "mode": "formdata",
                  "formdata": [
                    {
                      "key": "name",
                      "value": "Create draft - 1 signer, 1 file (optional recipient fields, settings overrides)",
                      "type": "text"
                    },
                    {
                      "key": "documents[0][base64]",
                      "value": "{{sample_pdf_base64}}",
                      "type": "text"
                    },
                    {
                      "key": "documents[0][name]",
                      "value": "contract-main.pdf",
                      "type": "text"
                    },
                    {
                      "key": "documents[0][type]",
                      "value": "SIGNABLE",
                      "type": "text"
                    },
                    {
                      "key": "documents[0][order]",
                      "value": "0",
                      "type": "text"
                    },
                    {
                      "key": "recipients[custom_key][name]",
                      "value": "Ana Signer",
                      "type": "text"
                    },
                    {
                      "key": "recipients[custom_key][email]",
                      "value": "{{fixture_signer_email}}",
                      "type": "text"
                    },
                    {
                      "key": "recipients[custom_key][order]",
                      "value": "1",
                      "type": "text"
                    },
                    {
                      "key": "recipients[custom_key][phone_id]",
                      "value": "987654321",
                      "type": "text"
                    },
                    {
                      "key": "recipients[custom_key][phone_label]",
                      "value": "Phone:",
                      "type": "text"
                    },
                    {
                      "key": "recipients[custom_key][tax_id]",
                      "value": "11111111-1",
                      "type": "text"
                    },
                    {
                      "key": "recipients[custom_key][tax_label]",
                      "value": "Tax ID:",
                      "type": "text"
                    },
                    {
                      "key": "recipients[custom_key][rep_id]",
                      "value": "22222222-2",
                      "type": "text"
                    },
                    {
                      "key": "recipients[custom_key][rep_label]",
                      "value": "Representative ID:",
                      "type": "text"
                    },
                    {
                      "key": "placements[0][type]",
                      "value": "SIGNATURE",
                      "type": "text"
                    },
                    {
                      "key": "placements[0][recipient_key]",
                      "value": "custom_key",
                      "type": "text"
                    },
                    {
                      "key": "placements[0][document_key]",
                      "value": "0",
                      "type": "text"
                    },
                    {
                      "key": "placements[0][order]",
                      "value": "0",
                      "type": "text"
                    },
                    {
                      "key": "placements[0][coordinates][top]",
                      "value": "103.5",
                      "type": "text"
                    },
                    {
                      "key": "placements[0][coordinates][left]",
                      "value": "40.5",
                      "type": "text"
                    },
                    {
                      "key": "placements[0][coordinates][page]",
                      "value": "0",
                      "type": "text"
                    },
                    {
                      "key": "settings[signature_flow][sender_name]",
                      "value": "Fixture Sender",
                      "type": "text"
                    },
                    {
                      "key": "settings[emails][envelope_invitation]",
                      "value": "TRUE",
                      "type": "text"
                    },
                    {
                      "key": "settings[emails][envelope_signed]",
                      "value": "TRUE",
                      "type": "text"
                    },
                    {
                      "key": "settings[signature][type]",
                      "value": "INTERNATIONAL",
                      "type": "text"
                    }
                  ]
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"envelope\": {\n    \"id\": \"00000000-0000-4000-8000-000000000022\",\n    \"name\": \"Create draft - 1 signer, 1 file (optional recipient fields, settings overrides)\",\n    \"status\": \"CREATED\",\n    \"errors\": [],\n    \"warnings\": [],\n    \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n    \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n    \"evidence_document_url\": null,\n    \"error_reason\": null,\n    \"evidence_generated_at\": null,\n    \"documents\": [\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000011\",\n        \"custom_key\": \"0\",\n        \"file_type\": \"ORIGINAL\",\n        \"order\": 0,\n        \"status\": \"CREATED\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"file_name\": \"contract-main.pdf\",\n        \"content_type\": \"application/pdf\",\n        \"file_size\": 1150,\n        \"page_count\": 1,\n        \"url\": \"https://storage.example.invalid/sample/contract-main.pdf?signature=redacted\"\n      }\n    ],\n    \"recipients\": [\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000002\",\n        \"custom_key\": \"custom_key\",\n        \"order\": 1,\n        \"status\": \"CREATED\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"name\": \"Ana Signer\",\n        \"name_label\": \"Name:\",\n        \"email\": \"signer@example.com\",\n        \"email_label\": \"Email:\",\n        \"phone_label\": \"Phone:\",\n        \"tax_id\": \"11111111-1\",\n        \"tax_label\": \"Tax ID:\",\n        \"rep_id\": \"22222222-2\",\n        \"rep_label\": \"Representative ID:\"\n      }\n    ],\n    \"placements\": [\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000041\",\n        \"custom_key\": \"0\",\n        \"placement_type\": \"SIGNATURE\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"recipient_id\": \"00000000-0000-4000-8000-000000000002\",\n        \"recipient_key\": \"custom_key\",\n        \"document_id\": \"00000000-0000-4000-8000-000000000011\",\n        \"document_key\": \"0\",\n        \"order\": 0,\n        \"coordinates\": {\n          \"id\": \"Lexgo-Sign-0\",\n          \"top\": 103.5,\n          \"left\": 40.5,\n          \"page\": 0\n        },\n        \"token\": null\n      }\n    ],\n    \"settings\": {\n      \"emails\": {\n        \"envelope_invitation\": \"TRUE\",\n        \"envelope_voided\": \"TRUE\",\n        \"envelope_rejected\": \"TRUE\",\n        \"envelope_signed\": \"TRUE\"\n      },\n      \"documents\": {\n        \"include_page_id\": \"TRUE\",\n        \"custom_page_id\": \"Lexgo Sign ID:\",\n        \"signatures_per_page\": 4,\n        \"signatures_per_row\": 1\n      },\n      \"signature_flow\": {\n        \"language\": \"EN\",\n        \"signature_order\": \"PARALLEL\",\n        \"signature_types\": \"WRITTEN, DRAWN, UPLOADED\",\n        \"signature_color\": \"#000000\",\n        \"sender_name\": \"Fixture Sender\",\n        \"sender_enterprise\": null\n      },\n      \"signature\": {\n        \"style\": \"SIMPLE\",\n        \"type\": \"INTERNATIONAL\",\n        \"image\": \"DEFAULT\",\n        \"text\": \"DEFAULT\",\n        \"bg_image\": \"DEFAULT\",\n        \"bg_image_scope\": \"QUALIFIED_CHILE\"\n      },\n      \"validations\": {\n        \"email\": {\n          \"order\": 0,\n          \"enabled\": \"FALSE\"\n        },\n        \"phone\": {\n          \"order\": 1,\n          \"enabled\": \"FALSE\",\n          \"methods\": \"SMS\"\n        },\n        \"id_check\": {\n          \"order\": 2,\n          \"enabled\": \"FALSE\"\n        },\n        \"biometric\": {\n          \"order\": 3,\n          \"enabled\": \"FALSE\"\n        }\n      }\n    },\n    \"metadata\": {}\n  },\n  \"request_id\": \"00000000-0000-4000-8000-0000000000aa\"\n}"
            }
          ]
        },
        {
          "name": "Create draft - 1 signer, 2 files (token placement)",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = pm.response.json();",
                  "pm.test('Status is 200 (a 422 with status ERROR on a sandbox key usually means a recipient email is not a team address)', () => pm.response.to.have.status(200));",
                  "pm.test('Envelope is a CREATED draft', () => {",
                  "    pm.expect(j.envelope).to.be.an('object');",
                  "    pm.expect(j.envelope.status, JSON.stringify(j.envelope.errors)).to.eql('CREATED');",
                  "});",
                  "pm.test('request_id is present', () => pm.expect(j.request_id).to.be.a('string').and.not.empty);",
                  "",
                  "pm.test('Documents: ORIGINAL, ORIGINAL', () => pm.expect(j.envelope.documents.map((d) => d.file_type).sort()).to.eql([\"ORIGINAL\", \"ORIGINAL\"]));",
                  "pm.test('Recipient keys: custom_key', () => pm.expect(j.envelope.recipients.map((r) => r.custom_key).sort()).to.eql([\"custom_key\"]));",
                  "pm.test('Placement types: SIGNATURE, SIGNATURE', () => pm.expect(j.envelope.placements.map((p) => p.placement_type).sort()).to.eql([\"SIGNATURE\", \"SIGNATURE\"]));",
                  "",
                  "pm.test('The token placement was resolved to coordinates', () => {",
                  "    const p = j.envelope.placements.find((x) => x.token === '[[SIGN-HERE-1]]');",
                  "    pm.expect(p.coordinates).to.include.keys('page', 'top', 'left');",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "{{api_key}}",
                "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
              }
            ],
            "url": {
              "raw": "{{api_url}}/{{api_prefix}}/envelopes",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "{{api_prefix}}",
                "envelopes"
              ]
            },
            "description": "Safe. Two signable documents for one signer. The second placement has no coordinates: `token` is searched as text in the document (fixtures contain [[SIGN-HERE-1]]) and the signature box is placed there. Public docs: api/envelopes.md.",
            "body": {
              "mode": "formdata",
              "formdata": [
                {
                  "key": "name",
                  "value": "Create draft - 1 signer, 2 files (token placement)",
                  "type": "text"
                },
                {
                  "key": "documents[0][base64]",
                  "value": "{{sample_pdf_base64}}",
                  "type": "text"
                },
                {
                  "key": "documents[0][name]",
                  "value": "contract-main.pdf",
                  "type": "text"
                },
                {
                  "key": "documents[0][type]",
                  "value": "SIGNABLE",
                  "type": "text"
                },
                {
                  "key": "documents[0][order]",
                  "value": "0",
                  "type": "text"
                },
                {
                  "key": "documents[1][base64]",
                  "value": "{{sample_pdf_base64}}",
                  "type": "text"
                },
                {
                  "key": "documents[1][name]",
                  "value": "contract-annex.pdf",
                  "type": "text"
                },
                {
                  "key": "documents[1][type]",
                  "value": "SIGNABLE",
                  "type": "text"
                },
                {
                  "key": "documents[1][order]",
                  "value": "1",
                  "type": "text"
                },
                {
                  "key": "recipients[custom_key][name]",
                  "value": "Ana Signer",
                  "type": "text"
                },
                {
                  "key": "recipients[custom_key][email]",
                  "value": "{{fixture_signer_email}}",
                  "type": "text"
                },
                {
                  "key": "recipients[custom_key][order]",
                  "value": "1",
                  "type": "text"
                },
                {
                  "key": "placements[0][type]",
                  "value": "SIGNATURE",
                  "type": "text"
                },
                {
                  "key": "placements[0][recipient_key]",
                  "value": "custom_key",
                  "type": "text"
                },
                {
                  "key": "placements[0][document_key]",
                  "value": "0",
                  "type": "text"
                },
                {
                  "key": "placements[0][order]",
                  "value": "0",
                  "type": "text"
                },
                {
                  "key": "placements[0][coordinates][top]",
                  "value": "103.5",
                  "type": "text"
                },
                {
                  "key": "placements[0][coordinates][left]",
                  "value": "40.5",
                  "type": "text"
                },
                {
                  "key": "placements[0][coordinates][page]",
                  "value": "0",
                  "type": "text"
                },
                {
                  "key": "placements[1][type]",
                  "value": "SIGNATURE",
                  "type": "text"
                },
                {
                  "key": "placements[1][recipient_key]",
                  "value": "custom_key",
                  "type": "text"
                },
                {
                  "key": "placements[1][document_key]",
                  "value": "1",
                  "type": "text"
                },
                {
                  "key": "placements[1][order]",
                  "value": "1",
                  "type": "text"
                },
                {
                  "key": "placements[1][token]",
                  "value": "[[SIGN-HERE-1]]",
                  "type": "text"
                }
              ]
            }
          },
          "response": [
            {
              "name": "200 OK - draft created",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "{{api_key}}",
                    "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
                  }
                ],
                "url": {
                  "raw": "{{api_url}}/{{api_prefix}}/envelopes",
                  "host": [
                    "{{api_url}}"
                  ],
                  "path": [
                    "{{api_prefix}}",
                    "envelopes"
                  ]
                },
                "description": "Safe. Two signable documents for one signer. The second placement has no coordinates: `token` is searched as text in the document (fixtures contain [[SIGN-HERE-1]]) and the signature box is placed there. Public docs: api/envelopes.md.",
                "body": {
                  "mode": "formdata",
                  "formdata": [
                    {
                      "key": "name",
                      "value": "Create draft - 1 signer, 2 files (token placement)",
                      "type": "text"
                    },
                    {
                      "key": "documents[0][base64]",
                      "value": "{{sample_pdf_base64}}",
                      "type": "text"
                    },
                    {
                      "key": "documents[0][name]",
                      "value": "contract-main.pdf",
                      "type": "text"
                    },
                    {
                      "key": "documents[0][type]",
                      "value": "SIGNABLE",
                      "type": "text"
                    },
                    {
                      "key": "documents[0][order]",
                      "value": "0",
                      "type": "text"
                    },
                    {
                      "key": "documents[1][base64]",
                      "value": "{{sample_pdf_base64}}",
                      "type": "text"
                    },
                    {
                      "key": "documents[1][name]",
                      "value": "contract-annex.pdf",
                      "type": "text"
                    },
                    {
                      "key": "documents[1][type]",
                      "value": "SIGNABLE",
                      "type": "text"
                    },
                    {
                      "key": "documents[1][order]",
                      "value": "1",
                      "type": "text"
                    },
                    {
                      "key": "recipients[custom_key][name]",
                      "value": "Ana Signer",
                      "type": "text"
                    },
                    {
                      "key": "recipients[custom_key][email]",
                      "value": "{{fixture_signer_email}}",
                      "type": "text"
                    },
                    {
                      "key": "recipients[custom_key][order]",
                      "value": "1",
                      "type": "text"
                    },
                    {
                      "key": "placements[0][type]",
                      "value": "SIGNATURE",
                      "type": "text"
                    },
                    {
                      "key": "placements[0][recipient_key]",
                      "value": "custom_key",
                      "type": "text"
                    },
                    {
                      "key": "placements[0][document_key]",
                      "value": "0",
                      "type": "text"
                    },
                    {
                      "key": "placements[0][order]",
                      "value": "0",
                      "type": "text"
                    },
                    {
                      "key": "placements[0][coordinates][top]",
                      "value": "103.5",
                      "type": "text"
                    },
                    {
                      "key": "placements[0][coordinates][left]",
                      "value": "40.5",
                      "type": "text"
                    },
                    {
                      "key": "placements[0][coordinates][page]",
                      "value": "0",
                      "type": "text"
                    },
                    {
                      "key": "placements[1][type]",
                      "value": "SIGNATURE",
                      "type": "text"
                    },
                    {
                      "key": "placements[1][recipient_key]",
                      "value": "custom_key",
                      "type": "text"
                    },
                    {
                      "key": "placements[1][document_key]",
                      "value": "1",
                      "type": "text"
                    },
                    {
                      "key": "placements[1][order]",
                      "value": "1",
                      "type": "text"
                    },
                    {
                      "key": "placements[1][token]",
                      "value": "[[SIGN-HERE-1]]",
                      "type": "text"
                    }
                  ]
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"envelope\": {\n    \"id\": \"00000000-0000-4000-8000-000000000021\",\n    \"name\": \"Create draft - 1 signer, 2 files (token placement)\",\n    \"status\": \"CREATED\",\n    \"errors\": [],\n    \"warnings\": [],\n    \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n    \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n    \"evidence_document_url\": null,\n    \"error_reason\": null,\n    \"evidence_generated_at\": null,\n    \"documents\": [\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000011\",\n        \"custom_key\": \"0\",\n        \"file_type\": \"ORIGINAL\",\n        \"order\": 0,\n        \"status\": \"CREATED\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"file_name\": \"contract-main.pdf\",\n        \"content_type\": \"application/pdf\",\n        \"file_size\": 1150,\n        \"page_count\": 1,\n        \"url\": \"https://storage.example.invalid/sample/contract-main.pdf?signature=redacted\"\n      },\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000012\",\n        \"custom_key\": \"1\",\n        \"file_type\": \"ORIGINAL\",\n        \"order\": 1,\n        \"status\": \"CREATED\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"file_name\": \"contract-annex.pdf\",\n        \"content_type\": \"application/pdf\",\n        \"file_size\": 1150,\n        \"page_count\": 1,\n        \"url\": \"https://storage.example.invalid/sample/contract-annex.pdf?signature=redacted\"\n      }\n    ],\n    \"recipients\": [\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000002\",\n        \"custom_key\": \"custom_key\",\n        \"order\": 1,\n        \"status\": \"CREATED\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"name\": \"Ana Signer\",\n        \"name_label\": \"Name:\",\n        \"email\": \"signer@example.com\",\n        \"email_label\": \"Email:\"\n      }\n    ],\n    \"placements\": [\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000041\",\n        \"custom_key\": \"0\",\n        \"placement_type\": \"SIGNATURE\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"recipient_id\": \"00000000-0000-4000-8000-000000000002\",\n        \"recipient_key\": \"custom_key\",\n        \"document_id\": \"00000000-0000-4000-8000-000000000011\",\n        \"document_key\": \"0\",\n        \"order\": 0,\n        \"coordinates\": {\n          \"id\": \"Lexgo-Sign-0\",\n          \"top\": 103.5,\n          \"left\": 40.5,\n          \"page\": 0\n        },\n        \"token\": null\n      },\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000042\",\n        \"custom_key\": \"1\",\n        \"placement_type\": \"SIGNATURE\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"recipient_id\": \"00000000-0000-4000-8000-000000000002\",\n        \"recipient_key\": \"custom_key\",\n        \"document_id\": \"00000000-0000-4000-8000-000000000012\",\n        \"document_key\": \"1\",\n        \"order\": 1,\n        \"coordinates\": {\n          \"id\": \"Lexgo-Sign-1\",\n          \"top\": 91.76,\n          \"left\": 72.0,\n          \"page\": 0\n        },\n        \"token\": \"[[SIGN-HERE-1]]\"\n      }\n    ],\n    \"settings\": {\n      \"emails\": {\n        \"envelope_invitation\": \"TRUE\",\n        \"envelope_voided\": \"TRUE\",\n        \"envelope_rejected\": \"TRUE\",\n        \"envelope_signed\": \"TRUE\"\n      },\n      \"documents\": {\n        \"include_page_id\": \"TRUE\",\n        \"custom_page_id\": \"Lexgo Sign ID:\",\n        \"signatures_per_page\": 4,\n        \"signatures_per_row\": 1\n      },\n      \"signature_flow\": {\n        \"language\": \"EN\",\n        \"signature_order\": \"PARALLEL\",\n        \"signature_types\": \"WRITTEN, DRAWN, UPLOADED\",\n        \"signature_color\": \"#000000\",\n        \"sender_name\": \"Fixture Sender\",\n        \"sender_enterprise\": null\n      },\n      \"signature\": {\n        \"style\": \"SIMPLE\",\n        \"type\": \"INTERNATIONAL\",\n        \"image\": \"DEFAULT\",\n        \"text\": \"DEFAULT\",\n        \"bg_image\": \"DEFAULT\",\n        \"bg_image_scope\": \"QUALIFIED_CHILE\"\n      },\n      \"validations\": {\n        \"email\": {\n          \"order\": 0,\n          \"enabled\": \"FALSE\"\n        },\n        \"phone\": {\n          \"order\": 1,\n          \"enabled\": \"FALSE\",\n          \"methods\": \"SMS\"\n        },\n        \"id_check\": {\n          \"order\": 2,\n          \"enabled\": \"FALSE\"\n        },\n        \"biometric\": {\n          \"order\": 3,\n          \"enabled\": \"FALSE\"\n        }\n      }\n    },\n    \"metadata\": {}\n  },\n  \"request_id\": \"00000000-0000-4000-8000-0000000000aa\"\n}"
            }
          ]
        },
        {
          "name": "Create draft - 2 signers, 2 files (numeric and custom recipient keys)",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = pm.response.json();",
                  "pm.test('Status is 200 (a 422 with status ERROR on a sandbox key usually means a recipient email is not a team address)', () => pm.response.to.have.status(200));",
                  "pm.test('Envelope is a CREATED draft', () => {",
                  "    pm.expect(j.envelope).to.be.an('object');",
                  "    pm.expect(j.envelope.status, JSON.stringify(j.envelope.errors)).to.eql('CREATED');",
                  "});",
                  "pm.test('request_id is present', () => pm.expect(j.request_id).to.be.a('string').and.not.empty);",
                  "",
                  "pm.test('Documents: ORIGINAL, ORIGINAL', () => pm.expect(j.envelope.documents.map((d) => d.file_type).sort()).to.eql([\"ORIGINAL\", \"ORIGINAL\"]));",
                  "pm.test('Recipient keys: 1, custom_key', () => pm.expect(j.envelope.recipients.map((r) => r.custom_key).sort()).to.eql([\"1\", \"custom_key\"]));",
                  "pm.test('Placement types: SIGNATURE, SIGNATURE, SIGNATURE, SIGNATURE', () => pm.expect(j.envelope.placements.map((p) => p.placement_type).sort()).to.eql([\"SIGNATURE\", \"SIGNATURE\", \"SIGNATURE\", \"SIGNATURE\"]));"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "{{api_key}}",
                "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
              }
            ],
            "url": {
              "raw": "{{api_url}}/{{api_prefix}}/envelopes",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "{{api_prefix}}",
                "envelopes"
              ]
            },
            "description": "Safe. Two signers, one keyed `custom_key` and one keyed `1` (recipient keys can be any string, numeric or custom). Each signer signs both documents (the second signer via a token). The second signer uses the fixture_approver_email address. Public docs: api/envelopes.md.",
            "body": {
              "mode": "formdata",
              "formdata": [
                {
                  "key": "name",
                  "value": "Create draft - 2 signers, 2 files (numeric and custom recipient keys)",
                  "type": "text"
                },
                {
                  "key": "documents[0][base64]",
                  "value": "{{sample_pdf_base64}}",
                  "type": "text"
                },
                {
                  "key": "documents[0][name]",
                  "value": "contract-main.pdf",
                  "type": "text"
                },
                {
                  "key": "documents[0][type]",
                  "value": "SIGNABLE",
                  "type": "text"
                },
                {
                  "key": "documents[0][order]",
                  "value": "0",
                  "type": "text"
                },
                {
                  "key": "documents[1][base64]",
                  "value": "{{sample_pdf_base64}}",
                  "type": "text"
                },
                {
                  "key": "documents[1][name]",
                  "value": "contract-annex.pdf",
                  "type": "text"
                },
                {
                  "key": "documents[1][type]",
                  "value": "SIGNABLE",
                  "type": "text"
                },
                {
                  "key": "documents[1][order]",
                  "value": "1",
                  "type": "text"
                },
                {
                  "key": "recipients[custom_key][name]",
                  "value": "Ana Signer",
                  "type": "text"
                },
                {
                  "key": "recipients[custom_key][email]",
                  "value": "{{fixture_signer_email}}",
                  "type": "text"
                },
                {
                  "key": "recipients[custom_key][order]",
                  "value": "1",
                  "type": "text"
                },
                {
                  "key": "recipients[1][name]",
                  "value": "Beto Signer",
                  "type": "text"
                },
                {
                  "key": "recipients[1][email]",
                  "value": "{{fixture_approver_email}}",
                  "type": "text"
                },
                {
                  "key": "recipients[1][order]",
                  "value": "2",
                  "type": "text"
                },
                {
                  "key": "placements[0][type]",
                  "value": "SIGNATURE",
                  "type": "text"
                },
                {
                  "key": "placements[0][recipient_key]",
                  "value": "custom_key",
                  "type": "text"
                },
                {
                  "key": "placements[0][document_key]",
                  "value": "0",
                  "type": "text"
                },
                {
                  "key": "placements[0][order]",
                  "value": "0",
                  "type": "text"
                },
                {
                  "key": "placements[0][coordinates][top]",
                  "value": "103.5",
                  "type": "text"
                },
                {
                  "key": "placements[0][coordinates][left]",
                  "value": "40.5",
                  "type": "text"
                },
                {
                  "key": "placements[0][coordinates][page]",
                  "value": "0",
                  "type": "text"
                },
                {
                  "key": "placements[1][type]",
                  "value": "SIGNATURE",
                  "type": "text"
                },
                {
                  "key": "placements[1][recipient_key]",
                  "value": "custom_key",
                  "type": "text"
                },
                {
                  "key": "placements[1][document_key]",
                  "value": "1",
                  "type": "text"
                },
                {
                  "key": "placements[1][order]",
                  "value": "1",
                  "type": "text"
                },
                {
                  "key": "placements[1][token]",
                  "value": "[[SIGN-HERE-1]]",
                  "type": "text"
                },
                {
                  "key": "placements[2][type]",
                  "value": "SIGNATURE",
                  "type": "text"
                },
                {
                  "key": "placements[2][recipient_key]",
                  "value": "1",
                  "type": "text"
                },
                {
                  "key": "placements[2][document_key]",
                  "value": "0",
                  "type": "text"
                },
                {
                  "key": "placements[2][order]",
                  "value": "2",
                  "type": "text"
                },
                {
                  "key": "placements[2][coordinates][top]",
                  "value": "203.5",
                  "type": "text"
                },
                {
                  "key": "placements[2][coordinates][left]",
                  "value": "40.5",
                  "type": "text"
                },
                {
                  "key": "placements[2][coordinates][page]",
                  "value": "0",
                  "type": "text"
                },
                {
                  "key": "placements[3][type]",
                  "value": "SIGNATURE",
                  "type": "text"
                },
                {
                  "key": "placements[3][recipient_key]",
                  "value": "1",
                  "type": "text"
                },
                {
                  "key": "placements[3][document_key]",
                  "value": "1",
                  "type": "text"
                },
                {
                  "key": "placements[3][order]",
                  "value": "3",
                  "type": "text"
                },
                {
                  "key": "placements[3][token]",
                  "value": "[[SIGN-HERE-2]]",
                  "type": "text"
                }
              ]
            }
          },
          "response": [
            {
              "name": "200 OK - draft created",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "{{api_key}}",
                    "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
                  }
                ],
                "url": {
                  "raw": "{{api_url}}/{{api_prefix}}/envelopes",
                  "host": [
                    "{{api_url}}"
                  ],
                  "path": [
                    "{{api_prefix}}",
                    "envelopes"
                  ]
                },
                "description": "Safe. Two signers, one keyed `custom_key` and one keyed `1` (recipient keys can be any string, numeric or custom). Each signer signs both documents (the second signer via a token). The second signer uses the fixture_approver_email address. Public docs: api/envelopes.md.",
                "body": {
                  "mode": "formdata",
                  "formdata": [
                    {
                      "key": "name",
                      "value": "Create draft - 2 signers, 2 files (numeric and custom recipient keys)",
                      "type": "text"
                    },
                    {
                      "key": "documents[0][base64]",
                      "value": "{{sample_pdf_base64}}",
                      "type": "text"
                    },
                    {
                      "key": "documents[0][name]",
                      "value": "contract-main.pdf",
                      "type": "text"
                    },
                    {
                      "key": "documents[0][type]",
                      "value": "SIGNABLE",
                      "type": "text"
                    },
                    {
                      "key": "documents[0][order]",
                      "value": "0",
                      "type": "text"
                    },
                    {
                      "key": "documents[1][base64]",
                      "value": "{{sample_pdf_base64}}",
                      "type": "text"
                    },
                    {
                      "key": "documents[1][name]",
                      "value": "contract-annex.pdf",
                      "type": "text"
                    },
                    {
                      "key": "documents[1][type]",
                      "value": "SIGNABLE",
                      "type": "text"
                    },
                    {
                      "key": "documents[1][order]",
                      "value": "1",
                      "type": "text"
                    },
                    {
                      "key": "recipients[custom_key][name]",
                      "value": "Ana Signer",
                      "type": "text"
                    },
                    {
                      "key": "recipients[custom_key][email]",
                      "value": "{{fixture_signer_email}}",
                      "type": "text"
                    },
                    {
                      "key": "recipients[custom_key][order]",
                      "value": "1",
                      "type": "text"
                    },
                    {
                      "key": "recipients[1][name]",
                      "value": "Beto Signer",
                      "type": "text"
                    },
                    {
                      "key": "recipients[1][email]",
                      "value": "{{fixture_approver_email}}",
                      "type": "text"
                    },
                    {
                      "key": "recipients[1][order]",
                      "value": "2",
                      "type": "text"
                    },
                    {
                      "key": "placements[0][type]",
                      "value": "SIGNATURE",
                      "type": "text"
                    },
                    {
                      "key": "placements[0][recipient_key]",
                      "value": "custom_key",
                      "type": "text"
                    },
                    {
                      "key": "placements[0][document_key]",
                      "value": "0",
                      "type": "text"
                    },
                    {
                      "key": "placements[0][order]",
                      "value": "0",
                      "type": "text"
                    },
                    {
                      "key": "placements[0][coordinates][top]",
                      "value": "103.5",
                      "type": "text"
                    },
                    {
                      "key": "placements[0][coordinates][left]",
                      "value": "40.5",
                      "type": "text"
                    },
                    {
                      "key": "placements[0][coordinates][page]",
                      "value": "0",
                      "type": "text"
                    },
                    {
                      "key": "placements[1][type]",
                      "value": "SIGNATURE",
                      "type": "text"
                    },
                    {
                      "key": "placements[1][recipient_key]",
                      "value": "custom_key",
                      "type": "text"
                    },
                    {
                      "key": "placements[1][document_key]",
                      "value": "1",
                      "type": "text"
                    },
                    {
                      "key": "placements[1][order]",
                      "value": "1",
                      "type": "text"
                    },
                    {
                      "key": "placements[1][token]",
                      "value": "[[SIGN-HERE-1]]",
                      "type": "text"
                    },
                    {
                      "key": "placements[2][type]",
                      "value": "SIGNATURE",
                      "type": "text"
                    },
                    {
                      "key": "placements[2][recipient_key]",
                      "value": "1",
                      "type": "text"
                    },
                    {
                      "key": "placements[2][document_key]",
                      "value": "0",
                      "type": "text"
                    },
                    {
                      "key": "placements[2][order]",
                      "value": "2",
                      "type": "text"
                    },
                    {
                      "key": "placements[2][coordinates][top]",
                      "value": "203.5",
                      "type": "text"
                    },
                    {
                      "key": "placements[2][coordinates][left]",
                      "value": "40.5",
                      "type": "text"
                    },
                    {
                      "key": "placements[2][coordinates][page]",
                      "value": "0",
                      "type": "text"
                    },
                    {
                      "key": "placements[3][type]",
                      "value": "SIGNATURE",
                      "type": "text"
                    },
                    {
                      "key": "placements[3][recipient_key]",
                      "value": "1",
                      "type": "text"
                    },
                    {
                      "key": "placements[3][document_key]",
                      "value": "1",
                      "type": "text"
                    },
                    {
                      "key": "placements[3][order]",
                      "value": "3",
                      "type": "text"
                    },
                    {
                      "key": "placements[3][token]",
                      "value": "[[SIGN-HERE-2]]",
                      "type": "text"
                    }
                  ]
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"envelope\": {\n    \"id\": \"00000000-0000-4000-8000-000000000026\",\n    \"name\": \"Create draft - 2 signers, 2 files (numeric and custom recipient keys)\",\n    \"status\": \"CREATED\",\n    \"errors\": [],\n    \"warnings\": [],\n    \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n    \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n    \"evidence_document_url\": null,\n    \"error_reason\": null,\n    \"evidence_generated_at\": null,\n    \"documents\": [\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000011\",\n        \"custom_key\": \"0\",\n        \"file_type\": \"ORIGINAL\",\n        \"order\": 0,\n        \"status\": \"CREATED\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"file_name\": \"contract-main.pdf\",\n        \"content_type\": \"application/pdf\",\n        \"file_size\": 1150,\n        \"page_count\": 1,\n        \"url\": \"https://storage.example.invalid/sample/contract-main.pdf?signature=redacted\"\n      },\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000012\",\n        \"custom_key\": \"1\",\n        \"file_type\": \"ORIGINAL\",\n        \"order\": 1,\n        \"status\": \"CREATED\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"file_name\": \"contract-annex.pdf\",\n        \"content_type\": \"application/pdf\",\n        \"file_size\": 1150,\n        \"page_count\": 1,\n        \"url\": \"https://storage.example.invalid/sample/contract-annex.pdf?signature=redacted\"\n      }\n    ],\n    \"recipients\": [\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000002\",\n        \"custom_key\": \"custom_key\",\n        \"order\": 1,\n        \"status\": \"CREATED\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"name\": \"Ana Signer\",\n        \"name_label\": \"Name:\",\n        \"email\": \"signer@example.com\",\n        \"email_label\": \"Email:\"\n      },\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000003\",\n        \"custom_key\": \"1\",\n        \"order\": 2,\n        \"status\": \"CREATED\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"name\": \"Beto Signer\",\n        \"name_label\": \"Name:\",\n        \"email\": \"approver@example.com\",\n        \"email_label\": \"Email:\"\n      }\n    ],\n    \"placements\": [\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000041\",\n        \"custom_key\": \"0\",\n        \"placement_type\": \"SIGNATURE\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"recipient_id\": \"00000000-0000-4000-8000-000000000002\",\n        \"recipient_key\": \"custom_key\",\n        \"document_id\": \"00000000-0000-4000-8000-000000000011\",\n        \"document_key\": \"0\",\n        \"order\": 0,\n        \"coordinates\": {\n          \"id\": \"Lexgo-Sign-0\",\n          \"top\": 103.5,\n          \"left\": 40.5,\n          \"page\": 0\n        },\n        \"token\": null\n      },\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000042\",\n        \"custom_key\": \"1\",\n        \"placement_type\": \"SIGNATURE\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"recipient_id\": \"00000000-0000-4000-8000-000000000002\",\n        \"recipient_key\": \"custom_key\",\n        \"document_id\": \"00000000-0000-4000-8000-000000000012\",\n        \"document_key\": \"1\",\n        \"order\": 1,\n        \"coordinates\": {\n          \"id\": \"Lexgo-Sign-1\",\n          \"top\": 91.76,\n          \"left\": 72.0,\n          \"page\": 0\n        },\n        \"token\": \"[[SIGN-HERE-1]]\"\n      },\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000043\",\n        \"custom_key\": \"2\",\n        \"placement_type\": \"SIGNATURE\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"recipient_id\": \"00000000-0000-4000-8000-000000000003\",\n        \"recipient_key\": \"1\",\n        \"document_id\": \"00000000-0000-4000-8000-000000000011\",\n        \"document_key\": \"0\",\n        \"order\": 2,\n        \"coordinates\": {\n          \"id\": \"Lexgo-Sign-2\",\n          \"top\": 203.5,\n          \"left\": 40.5,\n          \"page\": 0\n        },\n        \"token\": null\n      },\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000044\",\n        \"custom_key\": \"3\",\n        \"placement_type\": \"SIGNATURE\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"recipient_id\": \"00000000-0000-4000-8000-000000000003\",\n        \"recipient_key\": \"1\",\n        \"document_id\": \"00000000-0000-4000-8000-000000000012\",\n        \"document_key\": \"1\",\n        \"order\": 3,\n        \"coordinates\": {\n          \"id\": \"Lexgo-Sign-3\",\n          \"top\": 91.76,\n          \"left\": 72.0,\n          \"page\": 0\n        },\n        \"token\": \"[[SIGN-HERE-2]]\"\n      }\n    ],\n    \"settings\": {\n      \"emails\": {\n        \"envelope_invitation\": \"TRUE\",\n        \"envelope_voided\": \"TRUE\",\n        \"envelope_rejected\": \"TRUE\",\n        \"envelope_signed\": \"TRUE\"\n      },\n      \"documents\": {\n        \"include_page_id\": \"TRUE\",\n        \"custom_page_id\": \"Lexgo Sign ID:\",\n        \"signatures_per_page\": 4,\n        \"signatures_per_row\": 1\n      },\n      \"signature_flow\": {\n        \"language\": \"EN\",\n        \"signature_order\": \"PARALLEL\",\n        \"signature_types\": \"WRITTEN, DRAWN, UPLOADED\",\n        \"signature_color\": \"#000000\",\n        \"sender_name\": \"Fixture Sender\",\n        \"sender_enterprise\": null\n      },\n      \"signature\": {\n        \"style\": \"SIMPLE\",\n        \"type\": \"INTERNATIONAL\",\n        \"image\": \"DEFAULT\",\n        \"text\": \"DEFAULT\",\n        \"bg_image\": \"DEFAULT\",\n        \"bg_image_scope\": \"QUALIFIED_CHILE\"\n      },\n      \"validations\": {\n        \"email\": {\n          \"order\": 0,\n          \"enabled\": \"FALSE\"\n        },\n        \"phone\": {\n          \"order\": 1,\n          \"enabled\": \"FALSE\",\n          \"methods\": \"SMS\"\n        },\n        \"id_check\": {\n          \"order\": 2,\n          \"enabled\": \"FALSE\"\n        },\n        \"biometric\": {\n          \"order\": 3,\n          \"enabled\": \"FALSE\"\n        }\n      }\n    },\n    \"metadata\": {}\n  },\n  \"request_id\": \"00000000-0000-4000-8000-0000000000aa\"\n}"
            }
          ]
        },
        {
          "name": "Create draft - 2 signers, 2 files, 1 attachment",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = pm.response.json();",
                  "pm.test('Status is 200 (a 422 with status ERROR on a sandbox key usually means a recipient email is not a team address)', () => pm.response.to.have.status(200));",
                  "pm.test('Envelope is a CREATED draft', () => {",
                  "    pm.expect(j.envelope).to.be.an('object');",
                  "    pm.expect(j.envelope.status, JSON.stringify(j.envelope.errors)).to.eql('CREATED');",
                  "});",
                  "pm.test('request_id is present', () => pm.expect(j.request_id).to.be.a('string').and.not.empty);",
                  "",
                  "pm.test('Documents: ATTACHMENT, ORIGINAL, ORIGINAL', () => pm.expect(j.envelope.documents.map((d) => d.file_type).sort()).to.eql([\"ATTACHMENT\", \"ORIGINAL\", \"ORIGINAL\"]));",
                  "pm.test('Recipient keys: 1, custom_key', () => pm.expect(j.envelope.recipients.map((r) => r.custom_key).sort()).to.eql([\"1\", \"custom_key\"]));",
                  "pm.test('Placement types: APPROVER, SIGNATURE, SIGNATURE, SIGNATURE, WITNESS', () => pm.expect(j.envelope.placements.map((p) => p.placement_type).sort()).to.eql([\"APPROVER\", \"SIGNATURE\", \"SIGNATURE\", \"SIGNATURE\", \"WITNESS\"]));"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "{{api_key}}",
                "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
              }
            ],
            "url": {
              "raw": "{{api_url}}/{{api_prefix}}/envelopes",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "{{api_prefix}}",
                "envelopes"
              ]
            },
            "description": "Safe. Two signers, two signable documents and one attachment; the attachment carries an APPROVER and a WITNESS placement (no coordinates). Public docs: api/envelopes.md.",
            "body": {
              "mode": "formdata",
              "formdata": [
                {
                  "key": "name",
                  "value": "Create draft - 2 signers, 2 files, 1 attachment",
                  "type": "text"
                },
                {
                  "key": "documents[0][base64]",
                  "value": "{{sample_pdf_base64}}",
                  "type": "text"
                },
                {
                  "key": "documents[0][name]",
                  "value": "contract-main.pdf",
                  "type": "text"
                },
                {
                  "key": "documents[0][type]",
                  "value": "SIGNABLE",
                  "type": "text"
                },
                {
                  "key": "documents[0][order]",
                  "value": "0",
                  "type": "text"
                },
                {
                  "key": "documents[1][base64]",
                  "value": "{{sample_pdf_base64}}",
                  "type": "text"
                },
                {
                  "key": "documents[1][name]",
                  "value": "contract-annex.pdf",
                  "type": "text"
                },
                {
                  "key": "documents[1][type]",
                  "value": "SIGNABLE",
                  "type": "text"
                },
                {
                  "key": "documents[1][order]",
                  "value": "1",
                  "type": "text"
                },
                {
                  "key": "documents[2][base64]",
                  "value": "{{sample_pdf_base64}}",
                  "type": "text"
                },
                {
                  "key": "documents[2][name]",
                  "value": "supporting-attachment.pdf",
                  "type": "text"
                },
                {
                  "key": "documents[2][type]",
                  "value": "ATTACHMENT",
                  "type": "text"
                },
                {
                  "key": "documents[2][order]",
                  "value": "2",
                  "type": "text"
                },
                {
                  "key": "recipients[custom_key][name]",
                  "value": "Ana Signer",
                  "type": "text"
                },
                {
                  "key": "recipients[custom_key][email]",
                  "value": "{{fixture_signer_email}}",
                  "type": "text"
                },
                {
                  "key": "recipients[custom_key][order]",
                  "value": "1",
                  "type": "text"
                },
                {
                  "key": "recipients[1][name]",
                  "value": "Beto Signer",
                  "type": "text"
                },
                {
                  "key": "recipients[1][email]",
                  "value": "{{fixture_approver_email}}",
                  "type": "text"
                },
                {
                  "key": "recipients[1][order]",
                  "value": "2",
                  "type": "text"
                },
                {
                  "key": "placements[0][type]",
                  "value": "SIGNATURE",
                  "type": "text"
                },
                {
                  "key": "placements[0][recipient_key]",
                  "value": "custom_key",
                  "type": "text"
                },
                {
                  "key": "placements[0][document_key]",
                  "value": "0",
                  "type": "text"
                },
                {
                  "key": "placements[0][order]",
                  "value": "0",
                  "type": "text"
                },
                {
                  "key": "placements[0][coordinates][top]",
                  "value": "103.5",
                  "type": "text"
                },
                {
                  "key": "placements[0][coordinates][left]",
                  "value": "40.5",
                  "type": "text"
                },
                {
                  "key": "placements[0][coordinates][page]",
                  "value": "0",
                  "type": "text"
                },
                {
                  "key": "placements[1][type]",
                  "value": "SIGNATURE",
                  "type": "text"
                },
                {
                  "key": "placements[1][recipient_key]",
                  "value": "custom_key",
                  "type": "text"
                },
                {
                  "key": "placements[1][document_key]",
                  "value": "1",
                  "type": "text"
                },
                {
                  "key": "placements[1][order]",
                  "value": "1",
                  "type": "text"
                },
                {
                  "key": "placements[1][token]",
                  "value": "[[SIGN-HERE-1]]",
                  "type": "text"
                },
                {
                  "key": "placements[2][type]",
                  "value": "SIGNATURE",
                  "type": "text"
                },
                {
                  "key": "placements[2][recipient_key]",
                  "value": "1",
                  "type": "text"
                },
                {
                  "key": "placements[2][document_key]",
                  "value": "0",
                  "type": "text"
                },
                {
                  "key": "placements[2][order]",
                  "value": "2",
                  "type": "text"
                },
                {
                  "key": "placements[2][coordinates][top]",
                  "value": "203.5",
                  "type": "text"
                },
                {
                  "key": "placements[2][coordinates][left]",
                  "value": "40.5",
                  "type": "text"
                },
                {
                  "key": "placements[2][coordinates][page]",
                  "value": "0",
                  "type": "text"
                },
                {
                  "key": "placements[3][type]",
                  "value": "APPROVER",
                  "type": "text"
                },
                {
                  "key": "placements[3][recipient_key]",
                  "value": "custom_key",
                  "type": "text"
                },
                {
                  "key": "placements[3][document_key]",
                  "value": "2",
                  "type": "text"
                },
                {
                  "key": "placements[3][order]",
                  "value": "3",
                  "type": "text"
                },
                {
                  "key": "placements[4][type]",
                  "value": "WITNESS",
                  "type": "text"
                },
                {
                  "key": "placements[4][recipient_key]",
                  "value": "1",
                  "type": "text"
                },
                {
                  "key": "placements[4][document_key]",
                  "value": "2",
                  "type": "text"
                },
                {
                  "key": "placements[4][order]",
                  "value": "4",
                  "type": "text"
                }
              ]
            }
          },
          "response": [
            {
              "name": "200 OK - draft created",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "{{api_key}}",
                    "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
                  }
                ],
                "url": {
                  "raw": "{{api_url}}/{{api_prefix}}/envelopes",
                  "host": [
                    "{{api_url}}"
                  ],
                  "path": [
                    "{{api_prefix}}",
                    "envelopes"
                  ]
                },
                "description": "Safe. Two signers, two signable documents and one attachment; the attachment carries an APPROVER and a WITNESS placement (no coordinates). Public docs: api/envelopes.md.",
                "body": {
                  "mode": "formdata",
                  "formdata": [
                    {
                      "key": "name",
                      "value": "Create draft - 2 signers, 2 files, 1 attachment",
                      "type": "text"
                    },
                    {
                      "key": "documents[0][base64]",
                      "value": "{{sample_pdf_base64}}",
                      "type": "text"
                    },
                    {
                      "key": "documents[0][name]",
                      "value": "contract-main.pdf",
                      "type": "text"
                    },
                    {
                      "key": "documents[0][type]",
                      "value": "SIGNABLE",
                      "type": "text"
                    },
                    {
                      "key": "documents[0][order]",
                      "value": "0",
                      "type": "text"
                    },
                    {
                      "key": "documents[1][base64]",
                      "value": "{{sample_pdf_base64}}",
                      "type": "text"
                    },
                    {
                      "key": "documents[1][name]",
                      "value": "contract-annex.pdf",
                      "type": "text"
                    },
                    {
                      "key": "documents[1][type]",
                      "value": "SIGNABLE",
                      "type": "text"
                    },
                    {
                      "key": "documents[1][order]",
                      "value": "1",
                      "type": "text"
                    },
                    {
                      "key": "documents[2][base64]",
                      "value": "{{sample_pdf_base64}}",
                      "type": "text"
                    },
                    {
                      "key": "documents[2][name]",
                      "value": "supporting-attachment.pdf",
                      "type": "text"
                    },
                    {
                      "key": "documents[2][type]",
                      "value": "ATTACHMENT",
                      "type": "text"
                    },
                    {
                      "key": "documents[2][order]",
                      "value": "2",
                      "type": "text"
                    },
                    {
                      "key": "recipients[custom_key][name]",
                      "value": "Ana Signer",
                      "type": "text"
                    },
                    {
                      "key": "recipients[custom_key][email]",
                      "value": "{{fixture_signer_email}}",
                      "type": "text"
                    },
                    {
                      "key": "recipients[custom_key][order]",
                      "value": "1",
                      "type": "text"
                    },
                    {
                      "key": "recipients[1][name]",
                      "value": "Beto Signer",
                      "type": "text"
                    },
                    {
                      "key": "recipients[1][email]",
                      "value": "{{fixture_approver_email}}",
                      "type": "text"
                    },
                    {
                      "key": "recipients[1][order]",
                      "value": "2",
                      "type": "text"
                    },
                    {
                      "key": "placements[0][type]",
                      "value": "SIGNATURE",
                      "type": "text"
                    },
                    {
                      "key": "placements[0][recipient_key]",
                      "value": "custom_key",
                      "type": "text"
                    },
                    {
                      "key": "placements[0][document_key]",
                      "value": "0",
                      "type": "text"
                    },
                    {
                      "key": "placements[0][order]",
                      "value": "0",
                      "type": "text"
                    },
                    {
                      "key": "placements[0][coordinates][top]",
                      "value": "103.5",
                      "type": "text"
                    },
                    {
                      "key": "placements[0][coordinates][left]",
                      "value": "40.5",
                      "type": "text"
                    },
                    {
                      "key": "placements[0][coordinates][page]",
                      "value": "0",
                      "type": "text"
                    },
                    {
                      "key": "placements[1][type]",
                      "value": "SIGNATURE",
                      "type": "text"
                    },
                    {
                      "key": "placements[1][recipient_key]",
                      "value": "custom_key",
                      "type": "text"
                    },
                    {
                      "key": "placements[1][document_key]",
                      "value": "1",
                      "type": "text"
                    },
                    {
                      "key": "placements[1][order]",
                      "value": "1",
                      "type": "text"
                    },
                    {
                      "key": "placements[1][token]",
                      "value": "[[SIGN-HERE-1]]",
                      "type": "text"
                    },
                    {
                      "key": "placements[2][type]",
                      "value": "SIGNATURE",
                      "type": "text"
                    },
                    {
                      "key": "placements[2][recipient_key]",
                      "value": "1",
                      "type": "text"
                    },
                    {
                      "key": "placements[2][document_key]",
                      "value": "0",
                      "type": "text"
                    },
                    {
                      "key": "placements[2][order]",
                      "value": "2",
                      "type": "text"
                    },
                    {
                      "key": "placements[2][coordinates][top]",
                      "value": "203.5",
                      "type": "text"
                    },
                    {
                      "key": "placements[2][coordinates][left]",
                      "value": "40.5",
                      "type": "text"
                    },
                    {
                      "key": "placements[2][coordinates][page]",
                      "value": "0",
                      "type": "text"
                    },
                    {
                      "key": "placements[3][type]",
                      "value": "APPROVER",
                      "type": "text"
                    },
                    {
                      "key": "placements[3][recipient_key]",
                      "value": "custom_key",
                      "type": "text"
                    },
                    {
                      "key": "placements[3][document_key]",
                      "value": "2",
                      "type": "text"
                    },
                    {
                      "key": "placements[3][order]",
                      "value": "3",
                      "type": "text"
                    },
                    {
                      "key": "placements[4][type]",
                      "value": "WITNESS",
                      "type": "text"
                    },
                    {
                      "key": "placements[4][recipient_key]",
                      "value": "1",
                      "type": "text"
                    },
                    {
                      "key": "placements[4][document_key]",
                      "value": "2",
                      "type": "text"
                    },
                    {
                      "key": "placements[4][order]",
                      "value": "4",
                      "type": "text"
                    }
                  ]
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"envelope\": {\n    \"id\": \"00000000-0000-4000-8000-000000000025\",\n    \"name\": \"Create draft - 2 signers, 2 files, 1 attachment\",\n    \"status\": \"CREATED\",\n    \"errors\": [],\n    \"warnings\": [],\n    \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n    \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n    \"evidence_document_url\": null,\n    \"error_reason\": null,\n    \"evidence_generated_at\": null,\n    \"documents\": [\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000011\",\n        \"custom_key\": \"0\",\n        \"file_type\": \"ORIGINAL\",\n        \"order\": 0,\n        \"status\": \"CREATED\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"file_name\": \"contract-main.pdf\",\n        \"content_type\": \"application/pdf\",\n        \"file_size\": 1150,\n        \"page_count\": 1,\n        \"url\": \"https://storage.example.invalid/sample/contract-main.pdf?signature=redacted\"\n      },\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000012\",\n        \"custom_key\": \"1\",\n        \"file_type\": \"ORIGINAL\",\n        \"order\": 1,\n        \"status\": \"CREATED\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"file_name\": \"contract-annex.pdf\",\n        \"content_type\": \"application/pdf\",\n        \"file_size\": 1150,\n        \"page_count\": 1,\n        \"url\": \"https://storage.example.invalid/sample/contract-annex.pdf?signature=redacted\"\n      },\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000013\",\n        \"custom_key\": \"2\",\n        \"file_type\": \"ATTACHMENT\",\n        \"order\": 2,\n        \"status\": \"CREATED\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"file_name\": \"supporting-attachment.pdf\",\n        \"content_type\": \"application/pdf\",\n        \"file_size\": 1150,\n        \"page_count\": 1,\n        \"url\": \"https://storage.example.invalid/sample/supporting-attachment.pdf?signature=redacted\"\n      }\n    ],\n    \"recipients\": [\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000002\",\n        \"custom_key\": \"custom_key\",\n        \"order\": 1,\n        \"status\": \"CREATED\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"name\": \"Ana Signer\",\n        \"name_label\": \"Name:\",\n        \"email\": \"signer@example.com\",\n        \"email_label\": \"Email:\"\n      },\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000003\",\n        \"custom_key\": \"1\",\n        \"order\": 2,\n        \"status\": \"CREATED\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"name\": \"Beto Signer\",\n        \"name_label\": \"Name:\",\n        \"email\": \"approver@example.com\",\n        \"email_label\": \"Email:\"\n      }\n    ],\n    \"placements\": [\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000041\",\n        \"custom_key\": \"0\",\n        \"placement_type\": \"SIGNATURE\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"recipient_id\": \"00000000-0000-4000-8000-000000000002\",\n        \"recipient_key\": \"custom_key\",\n        \"document_id\": \"00000000-0000-4000-8000-000000000011\",\n        \"document_key\": \"0\",\n        \"order\": 0,\n        \"coordinates\": {\n          \"id\": \"Lexgo-Sign-0\",\n          \"top\": 103.5,\n          \"left\": 40.5,\n          \"page\": 0\n        },\n        \"token\": null\n      },\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000042\",\n        \"custom_key\": \"1\",\n        \"placement_type\": \"SIGNATURE\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"recipient_id\": \"00000000-0000-4000-8000-000000000002\",\n        \"recipient_key\": \"custom_key\",\n        \"document_id\": \"00000000-0000-4000-8000-000000000012\",\n        \"document_key\": \"1\",\n        \"order\": 1,\n        \"coordinates\": {\n          \"id\": \"Lexgo-Sign-1\",\n          \"top\": 91.76,\n          \"left\": 72.0,\n          \"page\": 0\n        },\n        \"token\": \"[[SIGN-HERE-1]]\"\n      },\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000043\",\n        \"custom_key\": \"2\",\n        \"placement_type\": \"SIGNATURE\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"recipient_id\": \"00000000-0000-4000-8000-000000000003\",\n        \"recipient_key\": \"1\",\n        \"document_id\": \"00000000-0000-4000-8000-000000000011\",\n        \"document_key\": \"0\",\n        \"order\": 2,\n        \"coordinates\": {\n          \"id\": \"Lexgo-Sign-2\",\n          \"top\": 203.5,\n          \"left\": 40.5,\n          \"page\": 0\n        },\n        \"token\": null\n      },\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000044\",\n        \"custom_key\": \"3\",\n        \"placement_type\": \"APPROVER\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"recipient_id\": \"00000000-0000-4000-8000-000000000002\",\n        \"recipient_key\": \"custom_key\",\n        \"document_id\": \"00000000-0000-4000-8000-000000000013\",\n        \"document_key\": \"2\",\n        \"order\": 3,\n        \"coordinates\": {},\n        \"token\": null\n      },\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000045\",\n        \"custom_key\": \"4\",\n        \"placement_type\": \"WITNESS\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"recipient_id\": \"00000000-0000-4000-8000-000000000003\",\n        \"recipient_key\": \"1\",\n        \"document_id\": \"00000000-0000-4000-8000-000000000013\",\n        \"document_key\": \"2\",\n        \"order\": 4,\n        \"coordinates\": {},\n        \"token\": null\n      }\n    ],\n    \"settings\": {\n      \"emails\": {\n        \"envelope_invitation\": \"TRUE\",\n        \"envelope_voided\": \"TRUE\",\n        \"envelope_rejected\": \"TRUE\",\n        \"envelope_signed\": \"TRUE\"\n      },\n      \"documents\": {\n        \"include_page_id\": \"TRUE\",\n        \"custom_page_id\": \"Lexgo Sign ID:\",\n        \"signatures_per_page\": 4,\n        \"signatures_per_row\": 1\n      },\n      \"signature_flow\": {\n        \"language\": \"EN\",\n        \"signature_order\": \"PARALLEL\",\n        \"signature_types\": \"WRITTEN, DRAWN, UPLOADED\",\n        \"signature_color\": \"#000000\",\n        \"sender_name\": \"Fixture Sender\",\n        \"sender_enterprise\": null\n      },\n      \"signature\": {\n        \"style\": \"SIMPLE\",\n        \"type\": \"INTERNATIONAL\",\n        \"image\": \"DEFAULT\",\n        \"text\": \"DEFAULT\",\n        \"bg_image\": \"DEFAULT\",\n        \"bg_image_scope\": \"QUALIFIED_CHILE\"\n      },\n      \"validations\": {\n        \"email\": {\n          \"order\": 0,\n          \"enabled\": \"FALSE\"\n        },\n        \"phone\": {\n          \"order\": 1,\n          \"enabled\": \"FALSE\",\n          \"methods\": \"SMS\"\n        },\n        \"id_check\": {\n          \"order\": 2,\n          \"enabled\": \"FALSE\"\n        },\n        \"biometric\": {\n          \"order\": 3,\n          \"enabled\": \"FALSE\"\n        }\n      }\n    },\n    \"metadata\": {}\n  },\n  \"request_id\": \"00000000-0000-4000-8000-0000000000aa\"\n}"
            }
          ]
        },
        {
          "name": "Create draft - approver + signer, 1 file (sequential)",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = pm.response.json();",
                  "pm.test('Status is 200 (a 422 with status ERROR on a sandbox key usually means a recipient email is not a team address)', () => pm.response.to.have.status(200));",
                  "pm.test('Envelope is a CREATED draft', () => {",
                  "    pm.expect(j.envelope).to.be.an('object');",
                  "    pm.expect(j.envelope.status, JSON.stringify(j.envelope.errors)).to.eql('CREATED');",
                  "});",
                  "pm.test('request_id is present', () => pm.expect(j.request_id).to.be.a('string').and.not.empty);",
                  "",
                  "pm.test('Documents: ORIGINAL', () => pm.expect(j.envelope.documents.map((d) => d.file_type).sort()).to.eql([\"ORIGINAL\"]));",
                  "pm.test('Recipient keys: 1, custom_key', () => pm.expect(j.envelope.recipients.map((r) => r.custom_key).sort()).to.eql([\"1\", \"custom_key\"]));",
                  "pm.test('Placement types: APPROVER, SIGNATURE', () => pm.expect(j.envelope.placements.map((p) => p.placement_type).sort()).to.eql([\"APPROVER\", \"SIGNATURE\"]));",
                  "",
                  "pm.test('Signature order is SEQUENTIAL', () => pm.expect(j.envelope.settings.signature_flow.signature_order).to.eql('SEQUENTIAL'));"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "{{api_key}}",
                "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
              }
            ],
            "url": {
              "raw": "{{api_url}}/{{api_prefix}}/envelopes",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "{{api_prefix}}",
                "envelopes"
              ]
            },
            "description": "Safe. An approver and a signer on one document with signature_order SEQUENTIAL. The approver placement has no coordinates. Public docs: api/envelopes.md.",
            "body": {
              "mode": "formdata",
              "formdata": [
                {
                  "key": "name",
                  "value": "Create draft - approver + signer, 1 file (sequential)",
                  "type": "text"
                },
                {
                  "key": "documents[0][base64]",
                  "value": "{{sample_pdf_base64}}",
                  "type": "text"
                },
                {
                  "key": "documents[0][name]",
                  "value": "contract-main.pdf",
                  "type": "text"
                },
                {
                  "key": "documents[0][type]",
                  "value": "SIGNABLE",
                  "type": "text"
                },
                {
                  "key": "documents[0][order]",
                  "value": "0",
                  "type": "text"
                },
                {
                  "key": "recipients[custom_key][name]",
                  "value": "Ana Approver",
                  "type": "text"
                },
                {
                  "key": "recipients[custom_key][email]",
                  "value": "{{fixture_signer_email}}",
                  "type": "text"
                },
                {
                  "key": "recipients[custom_key][order]",
                  "value": "1",
                  "type": "text"
                },
                {
                  "key": "recipients[1][name]",
                  "value": "Beto Signer",
                  "type": "text"
                },
                {
                  "key": "recipients[1][email]",
                  "value": "{{fixture_approver_email}}",
                  "type": "text"
                },
                {
                  "key": "recipients[1][order]",
                  "value": "2",
                  "type": "text"
                },
                {
                  "key": "placements[0][type]",
                  "value": "APPROVER",
                  "type": "text"
                },
                {
                  "key": "placements[0][recipient_key]",
                  "value": "custom_key",
                  "type": "text"
                },
                {
                  "key": "placements[0][document_key]",
                  "value": "0",
                  "type": "text"
                },
                {
                  "key": "placements[0][order]",
                  "value": "0",
                  "type": "text"
                },
                {
                  "key": "placements[1][type]",
                  "value": "SIGNATURE",
                  "type": "text"
                },
                {
                  "key": "placements[1][recipient_key]",
                  "value": "1",
                  "type": "text"
                },
                {
                  "key": "placements[1][document_key]",
                  "value": "0",
                  "type": "text"
                },
                {
                  "key": "placements[1][order]",
                  "value": "1",
                  "type": "text"
                },
                {
                  "key": "placements[1][coordinates][top]",
                  "value": "103.5",
                  "type": "text"
                },
                {
                  "key": "placements[1][coordinates][left]",
                  "value": "40.5",
                  "type": "text"
                },
                {
                  "key": "placements[1][coordinates][page]",
                  "value": "0",
                  "type": "text"
                },
                {
                  "key": "settings[signature_flow][signature_order]",
                  "value": "SEQUENTIAL",
                  "type": "text"
                }
              ]
            }
          },
          "response": [
            {
              "name": "200 OK - draft created",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "{{api_key}}",
                    "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
                  }
                ],
                "url": {
                  "raw": "{{api_url}}/{{api_prefix}}/envelopes",
                  "host": [
                    "{{api_url}}"
                  ],
                  "path": [
                    "{{api_prefix}}",
                    "envelopes"
                  ]
                },
                "description": "Safe. An approver and a signer on one document with signature_order SEQUENTIAL. The approver placement has no coordinates. Public docs: api/envelopes.md.",
                "body": {
                  "mode": "formdata",
                  "formdata": [
                    {
                      "key": "name",
                      "value": "Create draft - approver + signer, 1 file (sequential)",
                      "type": "text"
                    },
                    {
                      "key": "documents[0][base64]",
                      "value": "{{sample_pdf_base64}}",
                      "type": "text"
                    },
                    {
                      "key": "documents[0][name]",
                      "value": "contract-main.pdf",
                      "type": "text"
                    },
                    {
                      "key": "documents[0][type]",
                      "value": "SIGNABLE",
                      "type": "text"
                    },
                    {
                      "key": "documents[0][order]",
                      "value": "0",
                      "type": "text"
                    },
                    {
                      "key": "recipients[custom_key][name]",
                      "value": "Ana Approver",
                      "type": "text"
                    },
                    {
                      "key": "recipients[custom_key][email]",
                      "value": "{{fixture_signer_email}}",
                      "type": "text"
                    },
                    {
                      "key": "recipients[custom_key][order]",
                      "value": "1",
                      "type": "text"
                    },
                    {
                      "key": "recipients[1][name]",
                      "value": "Beto Signer",
                      "type": "text"
                    },
                    {
                      "key": "recipients[1][email]",
                      "value": "{{fixture_approver_email}}",
                      "type": "text"
                    },
                    {
                      "key": "recipients[1][order]",
                      "value": "2",
                      "type": "text"
                    },
                    {
                      "key": "placements[0][type]",
                      "value": "APPROVER",
                      "type": "text"
                    },
                    {
                      "key": "placements[0][recipient_key]",
                      "value": "custom_key",
                      "type": "text"
                    },
                    {
                      "key": "placements[0][document_key]",
                      "value": "0",
                      "type": "text"
                    },
                    {
                      "key": "placements[0][order]",
                      "value": "0",
                      "type": "text"
                    },
                    {
                      "key": "placements[1][type]",
                      "value": "SIGNATURE",
                      "type": "text"
                    },
                    {
                      "key": "placements[1][recipient_key]",
                      "value": "1",
                      "type": "text"
                    },
                    {
                      "key": "placements[1][document_key]",
                      "value": "0",
                      "type": "text"
                    },
                    {
                      "key": "placements[1][order]",
                      "value": "1",
                      "type": "text"
                    },
                    {
                      "key": "placements[1][coordinates][top]",
                      "value": "103.5",
                      "type": "text"
                    },
                    {
                      "key": "placements[1][coordinates][left]",
                      "value": "40.5",
                      "type": "text"
                    },
                    {
                      "key": "placements[1][coordinates][page]",
                      "value": "0",
                      "type": "text"
                    },
                    {
                      "key": "settings[signature_flow][signature_order]",
                      "value": "SEQUENTIAL",
                      "type": "text"
                    }
                  ]
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"envelope\": {\n    \"id\": \"00000000-0000-4000-8000-000000000024\",\n    \"name\": \"Create draft - approver + signer, 1 file (sequential)\",\n    \"status\": \"CREATED\",\n    \"errors\": [],\n    \"warnings\": [],\n    \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n    \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n    \"evidence_document_url\": null,\n    \"error_reason\": null,\n    \"evidence_generated_at\": null,\n    \"documents\": [\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000011\",\n        \"custom_key\": \"0\",\n        \"file_type\": \"ORIGINAL\",\n        \"order\": 0,\n        \"status\": \"CREATED\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"file_name\": \"contract-main.pdf\",\n        \"content_type\": \"application/pdf\",\n        \"file_size\": 1150,\n        \"page_count\": 1,\n        \"url\": \"https://storage.example.invalid/sample/contract-main.pdf?signature=redacted\"\n      }\n    ],\n    \"recipients\": [\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000002\",\n        \"custom_key\": \"custom_key\",\n        \"order\": 1,\n        \"status\": \"CREATED\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"name\": \"Ana Approver\",\n        \"name_label\": \"Name:\",\n        \"email\": \"signer@example.com\",\n        \"email_label\": \"Email:\"\n      },\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000003\",\n        \"custom_key\": \"1\",\n        \"order\": 2,\n        \"status\": \"CREATED\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"name\": \"Beto Signer\",\n        \"name_label\": \"Name:\",\n        \"email\": \"approver@example.com\",\n        \"email_label\": \"Email:\"\n      }\n    ],\n    \"placements\": [\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000041\",\n        \"custom_key\": \"0\",\n        \"placement_type\": \"APPROVER\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"recipient_id\": \"00000000-0000-4000-8000-000000000002\",\n        \"recipient_key\": \"custom_key\",\n        \"document_id\": \"00000000-0000-4000-8000-000000000011\",\n        \"document_key\": \"0\",\n        \"order\": 0,\n        \"coordinates\": {},\n        \"token\": null\n      },\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000042\",\n        \"custom_key\": \"1\",\n        \"placement_type\": \"SIGNATURE\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"recipient_id\": \"00000000-0000-4000-8000-000000000003\",\n        \"recipient_key\": \"1\",\n        \"document_id\": \"00000000-0000-4000-8000-000000000011\",\n        \"document_key\": \"0\",\n        \"order\": 1,\n        \"coordinates\": {\n          \"id\": \"Lexgo-Sign-1\",\n          \"top\": 103.5,\n          \"left\": 40.5,\n          \"page\": 0\n        },\n        \"token\": null\n      }\n    ],\n    \"settings\": {\n      \"emails\": {\n        \"envelope_invitation\": \"TRUE\",\n        \"envelope_voided\": \"TRUE\",\n        \"envelope_rejected\": \"TRUE\",\n        \"envelope_signed\": \"TRUE\"\n      },\n      \"documents\": {\n        \"include_page_id\": \"TRUE\",\n        \"custom_page_id\": \"Lexgo Sign ID:\",\n        \"signatures_per_page\": 4,\n        \"signatures_per_row\": 1\n      },\n      \"signature_flow\": {\n        \"language\": \"EN\",\n        \"signature_order\": \"SEQUENTIAL\",\n        \"signature_types\": \"WRITTEN, DRAWN, UPLOADED\",\n        \"signature_color\": \"#000000\",\n        \"sender_name\": \"Fixture Sender\",\n        \"sender_enterprise\": null\n      },\n      \"signature\": {\n        \"style\": \"SIMPLE\",\n        \"type\": \"INTERNATIONAL\",\n        \"image\": \"DEFAULT\",\n        \"text\": \"DEFAULT\",\n        \"bg_image\": \"DEFAULT\",\n        \"bg_image_scope\": \"QUALIFIED_CHILE\"\n      },\n      \"validations\": {\n        \"email\": {\n          \"order\": 0,\n          \"enabled\": \"FALSE\"\n        },\n        \"phone\": {\n          \"order\": 1,\n          \"enabled\": \"FALSE\",\n          \"methods\": \"SMS\"\n        },\n        \"id_check\": {\n          \"order\": 2,\n          \"enabled\": \"FALSE\"\n        },\n        \"biometric\": {\n          \"order\": 3,\n          \"enabled\": \"FALSE\"\n        }\n      }\n    },\n    \"metadata\": {}\n  },\n  \"request_id\": \"00000000-0000-4000-8000-0000000000aa\"\n}"
            }
          ]
        },
        {
          "name": "Create draft - witness + signer, 1 file",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = pm.response.json();",
                  "pm.test('Status is 200 (a 422 with status ERROR on a sandbox key usually means a recipient email is not a team address)', () => pm.response.to.have.status(200));",
                  "pm.test('Envelope is a CREATED draft', () => {",
                  "    pm.expect(j.envelope).to.be.an('object');",
                  "    pm.expect(j.envelope.status, JSON.stringify(j.envelope.errors)).to.eql('CREATED');",
                  "});",
                  "pm.test('request_id is present', () => pm.expect(j.request_id).to.be.a('string').and.not.empty);",
                  "",
                  "pm.test('Documents: ORIGINAL', () => pm.expect(j.envelope.documents.map((d) => d.file_type).sort()).to.eql([\"ORIGINAL\"]));",
                  "pm.test('Recipient keys: 1, custom_key', () => pm.expect(j.envelope.recipients.map((r) => r.custom_key).sort()).to.eql([\"1\", \"custom_key\"]));",
                  "pm.test('Placement types: SIGNATURE, WITNESS', () => pm.expect(j.envelope.placements.map((p) => p.placement_type).sort()).to.eql([\"SIGNATURE\", \"WITNESS\"]));"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "{{api_key}}",
                "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
              }
            ],
            "url": {
              "raw": "{{api_url}}/{{api_prefix}}/envelopes",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "{{api_prefix}}",
                "envelopes"
              ]
            },
            "description": "Safe. A witness and a signer on one document; the signer placement uses a token. Public docs: api/envelopes.md.",
            "body": {
              "mode": "formdata",
              "formdata": [
                {
                  "key": "name",
                  "value": "Create draft - witness + signer, 1 file",
                  "type": "text"
                },
                {
                  "key": "documents[0][base64]",
                  "value": "{{sample_pdf_base64}}",
                  "type": "text"
                },
                {
                  "key": "documents[0][name]",
                  "value": "contract-main.pdf",
                  "type": "text"
                },
                {
                  "key": "documents[0][type]",
                  "value": "SIGNABLE",
                  "type": "text"
                },
                {
                  "key": "documents[0][order]",
                  "value": "0",
                  "type": "text"
                },
                {
                  "key": "recipients[custom_key][name]",
                  "value": "Ana Witness",
                  "type": "text"
                },
                {
                  "key": "recipients[custom_key][email]",
                  "value": "{{fixture_signer_email}}",
                  "type": "text"
                },
                {
                  "key": "recipients[custom_key][order]",
                  "value": "1",
                  "type": "text"
                },
                {
                  "key": "recipients[1][name]",
                  "value": "Beto Signer",
                  "type": "text"
                },
                {
                  "key": "recipients[1][email]",
                  "value": "{{fixture_approver_email}}",
                  "type": "text"
                },
                {
                  "key": "recipients[1][order]",
                  "value": "2",
                  "type": "text"
                },
                {
                  "key": "placements[0][type]",
                  "value": "WITNESS",
                  "type": "text"
                },
                {
                  "key": "placements[0][recipient_key]",
                  "value": "custom_key",
                  "type": "text"
                },
                {
                  "key": "placements[0][document_key]",
                  "value": "0",
                  "type": "text"
                },
                {
                  "key": "placements[0][order]",
                  "value": "0",
                  "type": "text"
                },
                {
                  "key": "placements[1][type]",
                  "value": "SIGNATURE",
                  "type": "text"
                },
                {
                  "key": "placements[1][recipient_key]",
                  "value": "1",
                  "type": "text"
                },
                {
                  "key": "placements[1][document_key]",
                  "value": "0",
                  "type": "text"
                },
                {
                  "key": "placements[1][order]",
                  "value": "1",
                  "type": "text"
                },
                {
                  "key": "placements[1][token]",
                  "value": "[[SIGN-HERE-1]]",
                  "type": "text"
                }
              ]
            }
          },
          "response": [
            {
              "name": "200 OK - draft created",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "{{api_key}}",
                    "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
                  }
                ],
                "url": {
                  "raw": "{{api_url}}/{{api_prefix}}/envelopes",
                  "host": [
                    "{{api_url}}"
                  ],
                  "path": [
                    "{{api_prefix}}",
                    "envelopes"
                  ]
                },
                "description": "Safe. A witness and a signer on one document; the signer placement uses a token. Public docs: api/envelopes.md.",
                "body": {
                  "mode": "formdata",
                  "formdata": [
                    {
                      "key": "name",
                      "value": "Create draft - witness + signer, 1 file",
                      "type": "text"
                    },
                    {
                      "key": "documents[0][base64]",
                      "value": "{{sample_pdf_base64}}",
                      "type": "text"
                    },
                    {
                      "key": "documents[0][name]",
                      "value": "contract-main.pdf",
                      "type": "text"
                    },
                    {
                      "key": "documents[0][type]",
                      "value": "SIGNABLE",
                      "type": "text"
                    },
                    {
                      "key": "documents[0][order]",
                      "value": "0",
                      "type": "text"
                    },
                    {
                      "key": "recipients[custom_key][name]",
                      "value": "Ana Witness",
                      "type": "text"
                    },
                    {
                      "key": "recipients[custom_key][email]",
                      "value": "{{fixture_signer_email}}",
                      "type": "text"
                    },
                    {
                      "key": "recipients[custom_key][order]",
                      "value": "1",
                      "type": "text"
                    },
                    {
                      "key": "recipients[1][name]",
                      "value": "Beto Signer",
                      "type": "text"
                    },
                    {
                      "key": "recipients[1][email]",
                      "value": "{{fixture_approver_email}}",
                      "type": "text"
                    },
                    {
                      "key": "recipients[1][order]",
                      "value": "2",
                      "type": "text"
                    },
                    {
                      "key": "placements[0][type]",
                      "value": "WITNESS",
                      "type": "text"
                    },
                    {
                      "key": "placements[0][recipient_key]",
                      "value": "custom_key",
                      "type": "text"
                    },
                    {
                      "key": "placements[0][document_key]",
                      "value": "0",
                      "type": "text"
                    },
                    {
                      "key": "placements[0][order]",
                      "value": "0",
                      "type": "text"
                    },
                    {
                      "key": "placements[1][type]",
                      "value": "SIGNATURE",
                      "type": "text"
                    },
                    {
                      "key": "placements[1][recipient_key]",
                      "value": "1",
                      "type": "text"
                    },
                    {
                      "key": "placements[1][document_key]",
                      "value": "0",
                      "type": "text"
                    },
                    {
                      "key": "placements[1][order]",
                      "value": "1",
                      "type": "text"
                    },
                    {
                      "key": "placements[1][token]",
                      "value": "[[SIGN-HERE-1]]",
                      "type": "text"
                    }
                  ]
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"envelope\": {\n    \"id\": \"00000000-0000-4000-8000-000000000024\",\n    \"name\": \"Create draft - witness + signer, 1 file\",\n    \"status\": \"CREATED\",\n    \"errors\": [],\n    \"warnings\": [],\n    \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n    \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n    \"evidence_document_url\": null,\n    \"error_reason\": null,\n    \"evidence_generated_at\": null,\n    \"documents\": [\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000011\",\n        \"custom_key\": \"0\",\n        \"file_type\": \"ORIGINAL\",\n        \"order\": 0,\n        \"status\": \"CREATED\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"file_name\": \"contract-main.pdf\",\n        \"content_type\": \"application/pdf\",\n        \"file_size\": 1150,\n        \"page_count\": 1,\n        \"url\": \"https://storage.example.invalid/sample/contract-main.pdf?signature=redacted\"\n      }\n    ],\n    \"recipients\": [\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000002\",\n        \"custom_key\": \"custom_key\",\n        \"order\": 1,\n        \"status\": \"CREATED\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"name\": \"Ana Witness\",\n        \"name_label\": \"Name:\",\n        \"email\": \"signer@example.com\",\n        \"email_label\": \"Email:\"\n      },\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000003\",\n        \"custom_key\": \"1\",\n        \"order\": 2,\n        \"status\": \"CREATED\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"name\": \"Beto Signer\",\n        \"name_label\": \"Name:\",\n        \"email\": \"approver@example.com\",\n        \"email_label\": \"Email:\"\n      }\n    ],\n    \"placements\": [\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000041\",\n        \"custom_key\": \"0\",\n        \"placement_type\": \"WITNESS\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"recipient_id\": \"00000000-0000-4000-8000-000000000002\",\n        \"recipient_key\": \"custom_key\",\n        \"document_id\": \"00000000-0000-4000-8000-000000000011\",\n        \"document_key\": \"0\",\n        \"order\": 0,\n        \"coordinates\": {},\n        \"token\": null\n      },\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000042\",\n        \"custom_key\": \"1\",\n        \"placement_type\": \"SIGNATURE\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"recipient_id\": \"00000000-0000-4000-8000-000000000003\",\n        \"recipient_key\": \"1\",\n        \"document_id\": \"00000000-0000-4000-8000-000000000011\",\n        \"document_key\": \"0\",\n        \"order\": 1,\n        \"coordinates\": {\n          \"id\": \"Lexgo-Sign-1\",\n          \"top\": 91.76,\n          \"left\": 72.0,\n          \"page\": 0\n        },\n        \"token\": \"[[SIGN-HERE-1]]\"\n      }\n    ],\n    \"settings\": {\n      \"emails\": {\n        \"envelope_invitation\": \"TRUE\",\n        \"envelope_voided\": \"TRUE\",\n        \"envelope_rejected\": \"TRUE\",\n        \"envelope_signed\": \"TRUE\"\n      },\n      \"documents\": {\n        \"include_page_id\": \"TRUE\",\n        \"custom_page_id\": \"Lexgo Sign ID:\",\n        \"signatures_per_page\": 4,\n        \"signatures_per_row\": 1\n      },\n      \"signature_flow\": {\n        \"language\": \"EN\",\n        \"signature_order\": \"SEQUENTIAL\",\n        \"signature_types\": \"WRITTEN, DRAWN, UPLOADED\",\n        \"signature_color\": \"#000000\",\n        \"sender_name\": \"Fixture Sender\",\n        \"sender_enterprise\": null\n      },\n      \"signature\": {\n        \"style\": \"SIMPLE\",\n        \"type\": \"INTERNATIONAL\",\n        \"image\": \"DEFAULT\",\n        \"text\": \"DEFAULT\",\n        \"bg_image\": \"DEFAULT\",\n        \"bg_image_scope\": \"QUALIFIED_CHILE\"\n      },\n      \"validations\": {\n        \"email\": {\n          \"order\": 0,\n          \"enabled\": \"FALSE\"\n        },\n        \"phone\": {\n          \"order\": 1,\n          \"enabled\": \"FALSE\",\n          \"methods\": \"SMS\"\n        },\n        \"id_check\": {\n          \"order\": 2,\n          \"enabled\": \"FALSE\"\n        },\n        \"biometric\": {\n          \"order\": 3,\n          \"enabled\": \"FALSE\"\n        }\n      }\n    },\n    \"metadata\": {}\n  },\n  \"request_id\": \"00000000-0000-4000-8000-0000000000aa\"\n}"
            }
          ]
        },
        {
          "name": "Settings - scoped (emails, signature_flow)",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = pm.response.json();",
                  "pm.test('Status is 200', () => pm.response.to.have.status(200));",
                  "pm.test('Only the requested scopes are returned', () => pm.expect(Object.keys(j.settings).sort()).to.eql(['emails', 'signature_flow']));",
                  "pm.test('Stage and request_id are present', () => {",
                  "    pm.expect(j.environment).to.be.oneOf(['sandbox', 'live']);",
                  "    pm.expect(j.request_id).to.be.a('string').and.not.empty;",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "{{api_key}}",
                "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
              }
            ],
            "url": {
              "raw": "{{api_url}}/{{api_prefix}}/settings?scope=emails,signature_flow",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "{{api_prefix}}",
                "settings"
              ],
              "query": [
                {
                  "key": "scope",
                  "value": "emails,signature_flow"
                }
              ]
            },
            "description": "Safe, read-only. Scopes: branding, documents, emails, localization, signature, signature_flow, validations (comma separated). Public docs: api/settings.md."
          },
          "response": [
            {
              "name": "200 OK",
              "originalRequest": {
                "method": "GET",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "{{api_key}}",
                    "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
                  }
                ],
                "url": {
                  "raw": "{{api_url}}/{{api_prefix}}/settings?scope=emails,signature_flow",
                  "host": [
                    "{{api_url}}"
                  ],
                  "path": [
                    "{{api_prefix}}",
                    "settings"
                  ],
                  "query": [
                    {
                      "key": "scope",
                      "value": "emails,signature_flow"
                    }
                  ]
                },
                "description": "Safe, read-only. Scopes: branding, documents, emails, localization, signature, signature_flow, validations (comma separated). Public docs: api/settings.md."
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"settings\": {\n    \"emails\": {\n      \"envelope_invitation\": \"TRUE\",\n      \"envelope_voided\": \"TRUE\",\n      \"envelope_rejected\": \"TRUE\",\n      \"envelope_signed\": \"TRUE\"\n    },\n    \"signature_flow\": {\n      \"language\": \"EN\",\n      \"signature_order\": \"PARALLEL\",\n      \"signature_types\": \"WRITTEN, DRAWN, UPLOADED\",\n      \"signature_color\": \"#000000\",\n      \"sender_name\": \"Lexgo\",\n      \"sender_enterprise\": null\n    }\n  },\n  \"environment\": \"sandbox\",\n  \"request_id\": \"00000000-0000-4000-8000-0000000000aa\"\n}"
            }
          ]
        },
        {
          "name": "Settings - full",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = pm.response.json();",
                  "pm.test('Status is 200', () => pm.response.to.have.status(200));",
                  "pm.test('Every settings group is present', () => {",
                  "    pm.expect(j.settings).to.include.keys('branding', 'documents', 'emails', 'localization', 'signature', 'signature_flow', 'validations');",
                  "});",
                  "pm.test('Defaults have the documented shape', () => {",
                  "    pm.expect(j.settings.signature_flow.signature_order).to.be.oneOf(['PARALLEL', 'SEQUENTIAL']);",
                  "    pm.expect(j.settings.validations.email).to.include.keys('enabled');",
                  "});",
                  "pm.test('Stage and request_id are present', () => {",
                  "    pm.expect(j.environment).to.be.oneOf(['sandbox', 'live']);",
                  "    pm.expect(j.request_id).to.be.a('string').and.not.empty;",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "{{api_key}}",
                "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
              }
            ],
            "url": {
              "raw": "{{api_url}}/{{api_prefix}}/settings",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "{{api_prefix}}",
                "settings"
              ]
            },
            "description": "Safe, read-only. Returns all settings groups with defaults applied (localization text is long and abbreviated in the saved example). Public docs: api/settings.md."
          },
          "response": [
            {
              "name": "200 OK (localization abbreviated)",
              "originalRequest": {
                "method": "GET",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "{{api_key}}",
                    "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
                  }
                ],
                "url": {
                  "raw": "{{api_url}}/{{api_prefix}}/settings",
                  "host": [
                    "{{api_url}}"
                  ],
                  "path": [
                    "{{api_prefix}}",
                    "settings"
                  ]
                },
                "description": "Safe, read-only. Returns all settings groups with defaults applied (localization text is long and abbreviated in the saved example). Public docs: api/settings.md."
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"settings\": {\n    \"emails\": {\n      \"envelope_invitation\": \"TRUE\",\n      \"envelope_voided\": \"TRUE\",\n      \"envelope_rejected\": \"TRUE\",\n      \"envelope_signed\": \"TRUE\"\n    },\n    \"documents\": {\n      \"include_page_id\": \"TRUE\",\n      \"custom_page_id\": \"Lexgo Sign ID:\",\n      \"signatures_per_page\": 4,\n      \"signatures_per_row\": 1\n    },\n    \"signature_flow\": {\n      \"language\": \"EN\",\n      \"signature_order\": \"PARALLEL\",\n      \"signature_types\": \"WRITTEN, DRAWN, UPLOADED\",\n      \"signature_color\": \"#000000\",\n      \"sender_name\": \"Lexgo\",\n      \"sender_enterprise\": null\n    },\n    \"signature\": {\n      \"style\": \"SIMPLE\",\n      \"type\": \"INTERNATIONAL\",\n      \"image\": \"DEFAULT\",\n      \"text\": \"DEFAULT\",\n      \"bg_image\": \"DEFAULT\",\n      \"bg_image_scope\": \"QUALIFIED_CHILE\"\n    },\n    \"validations\": {\n      \"email\": {\n        \"order\": 0,\n        \"enabled\": \"FALSE\"\n      },\n      \"phone\": {\n        \"order\": 1,\n        \"enabled\": \"FALSE\",\n        \"methods\": \"SMS\"\n      },\n      \"id_check\": {\n        \"order\": 2,\n        \"enabled\": \"FALSE\"\n      },\n      \"biometric\": {\n        \"order\": 3,\n        \"enabled\": \"FALSE\"\n      }\n    },\n    \"branding\": {\n      \"logo\": \"DEFAULT\",\n      \"favicon\": \"DEFAULT\",\n      \"name\": \"DEFAULT\",\n      \"url_homepage\": \"DEFAULT\",\n      \"url_signature_flow\": \"DEFAULT\",\n      \"reply_to\": \"DEFAULT\",\n      \"sender_email\": \"DEFAULT\"\n    },\n    \"localization\": {\n      \"en\": {\n        \"documents\": {\n          \"extra_page_intro\": \"(abbreviated in this example)\"\n        }\n      },\n      \"es\": {\n        \"documents\": {\n          \"extra_page_intro\": \"(abreviado en este ejemplo)\"\n        }\n      }\n    }\n  },\n  \"environment\": \"sandbox\",\n  \"request_id\": \"00000000-0000-4000-8000-0000000000aa\"\n}"
            }
          ]
        },
        {
          "name": "Tenant denial - another key cannot read this envelope",
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!pm.variables.get('api_key_other_tenant')) {",
                  "    console.warn('Skipped tenant denial: api_key_other_tenant is empty.');",
                  "    pm.execution.skipRequest();",
                  "}"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = pm.response.json();",
                  "pm.test('Status is 404 for a different API key', () => pm.response.to.have.status(404));",
                  "pm.test('Error is Envelope not found', () => pm.expect(j.error).to.eql('Envelope not found'));",
                  "pm.test('The other key was used, not the main one', () => {",
                  "    pm.expect(pm.request.headers.get('Authorization')).to.not.eql('');",
                  "    pm.expect(pm.variables.get('api_key_other_tenant')).to.not.eql(pm.variables.get('api_key'));",
                  "});",
                  "pm.test('request_id is present', () => pm.expect(j.request_id).to.be.a('string').and.not.empty);"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "{{api_key_other_tenant}}",
                "description": "A different API key (optional variable)."
              }
            ],
            "url": {
              "raw": "{{api_url}}/{{api_prefix}}/envelopes/{{envelope_id}}",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "{{api_prefix}}",
                "envelopes",
                "{{envelope_id}}"
              ]
            },
            "description": "Safe. Envelopes belong to the API key that created them. Reading the draft with api_key_other_tenant (a different key, ideally of another enterprise) must return 404. Skipped when api_key_other_tenant is empty. Public docs: api/errors.md."
          },
          "response": [
            {
              "name": "404 Not Found",
              "originalRequest": {
                "method": "GET",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "{{api_key_other_tenant}}",
                    "description": "A different API key (optional variable)."
                  }
                ],
                "url": {
                  "raw": "{{api_url}}/{{api_prefix}}/envelopes/{{envelope_id}}",
                  "host": [
                    "{{api_url}}"
                  ],
                  "path": [
                    "{{api_prefix}}",
                    "envelopes",
                    "{{envelope_id}}"
                  ]
                },
                "description": "Safe. Envelopes belong to the API key that created them. Reading the draft with api_key_other_tenant (a different key, ideally of another enterprise) must return 404. Skipped when api_key_other_tenant is empty. Public docs: api/errors.md."
              },
              "status": "Not Found",
              "code": 404,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"error\": \"Envelope not found\",\n  \"request_id\": \"00000000-0000-4000-8000-0000000000aa\"\n}"
            }
          ]
        },
        {
          "name": "Invalid metadata - array",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = pm.response.json();",
                  "pm.test('Status is 422', () => pm.response.to.have.status(422));",
                  "pm.test('Error is Invalid metadata', () => pm.expect(j.error).to.eql('Invalid metadata'));",
                  "pm.test('Message explains the problem', () => pm.expect(j.message).to.eql(\"metadata must be a JSON object\"));",
                  "pm.test('No envelope is returned', () => pm.expect(j).to.not.have.property('envelope'));",
                  "pm.test('request_id is present', () => pm.expect(j.request_id).to.be.a('string').and.not.empty);"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "{{api_key}}",
                "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{api_url}}/{{api_prefix}}/envelopes",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "{{api_prefix}}",
                "envelopes"
              ]
            },
            "description": "Safe. Metadata must be an object; an array is rejected. Metadata is validated before anything is created, so the response has no envelope. That no database row is left behind is proved separately by a database count in the local proof, not by this request. Public docs: api/envelopes.md#envelope-metadata.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Invalid metadata check\",\n  \"metadata\": [\n    1,\n    2\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [
            {
              "name": "422 Invalid metadata",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "{{api_key}}",
                    "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": {
                  "raw": "{{api_url}}/{{api_prefix}}/envelopes",
                  "host": [
                    "{{api_url}}"
                  ],
                  "path": [
                    "{{api_prefix}}",
                    "envelopes"
                  ]
                },
                "description": "Safe. Metadata must be an object; an array is rejected. Metadata is validated before anything is created, so the response has no envelope. That no database row is left behind is proved separately by a database count in the local proof, not by this request. Public docs: api/envelopes.md#envelope-metadata.",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"name\": \"Invalid metadata check\",\n  \"metadata\": [\n    1,\n    2\n  ]\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "Unprocessable Content",
              "code": 422,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"error\": \"Invalid metadata\",\n  \"message\": \"metadata must be a JSON object\",\n  \"request_id\": \"00000000-0000-4000-8000-0000000000aa\"\n}"
            }
          ]
        },
        {
          "name": "Invalid metadata - string",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = pm.response.json();",
                  "pm.test('Status is 422', () => pm.response.to.have.status(422));",
                  "pm.test('Error is Invalid metadata', () => pm.expect(j.error).to.eql('Invalid metadata'));",
                  "pm.test('Message explains the problem', () => pm.expect(j.message).to.eql(\"metadata must be a JSON object\"));",
                  "pm.test('No envelope is returned', () => pm.expect(j).to.not.have.property('envelope'));",
                  "pm.test('request_id is present', () => pm.expect(j.request_id).to.be.a('string').and.not.empty);"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "{{api_key}}",
                "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{api_url}}/{{api_prefix}}/envelopes",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "{{api_prefix}}",
                "envelopes"
              ]
            },
            "description": "Safe. Metadata must be an object; a string is rejected. Metadata is validated before anything is created, so the response has no envelope. That no database row is left behind is proved separately by a database count in the local proof, not by this request. Public docs: api/envelopes.md#envelope-metadata.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Invalid metadata check\",\n  \"metadata\": \"not an object\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [
            {
              "name": "422 Invalid metadata",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "{{api_key}}",
                    "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": {
                  "raw": "{{api_url}}/{{api_prefix}}/envelopes",
                  "host": [
                    "{{api_url}}"
                  ],
                  "path": [
                    "{{api_prefix}}",
                    "envelopes"
                  ]
                },
                "description": "Safe. Metadata must be an object; a string is rejected. Metadata is validated before anything is created, so the response has no envelope. That no database row is left behind is proved separately by a database count in the local proof, not by this request. Public docs: api/envelopes.md#envelope-metadata.",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"name\": \"Invalid metadata check\",\n  \"metadata\": \"not an object\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "Unprocessable Content",
              "code": 422,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"error\": \"Invalid metadata\",\n  \"message\": \"metadata must be a JSON object\",\n  \"request_id\": \"00000000-0000-4000-8000-0000000000aa\"\n}"
            }
          ]
        },
        {
          "name": "Invalid metadata - depth 6",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = pm.response.json();",
                  "pm.test('Status is 422', () => pm.response.to.have.status(422));",
                  "pm.test('Error is Invalid metadata', () => pm.expect(j.error).to.eql('Invalid metadata'));",
                  "pm.test('Message explains the problem', () => pm.expect(j.message).to.eql(\"metadata is nested 6 levels deep; the maximum is 5\"));",
                  "pm.test('No envelope is returned', () => pm.expect(j).to.not.have.property('envelope'));",
                  "pm.test('request_id is present', () => pm.expect(j.request_id).to.be.a('string').and.not.empty);"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "{{api_key}}",
                "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{api_url}}/{{api_prefix}}/envelopes",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "{{api_prefix}}",
                "envelopes"
              ]
            },
            "description": "Safe. Nesting of 6 levels is rejected; 5 levels (objects and arrays each count, root is level 1) is the maximum and is accepted. Metadata is validated before anything is created, so the response has no envelope. That no database row is left behind is proved separately by a database count in the local proof, not by this request. Public docs: api/envelopes.md#envelope-metadata.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Invalid metadata check\",\n  \"metadata\": {\n    \"a\": {\n      \"b\": {\n        \"c\": {\n          \"d\": {\n            \"e\": [\n              1\n            ]\n          }\n        }\n      }\n    }\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [
            {
              "name": "422 Invalid metadata",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "{{api_key}}",
                    "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": {
                  "raw": "{{api_url}}/{{api_prefix}}/envelopes",
                  "host": [
                    "{{api_url}}"
                  ],
                  "path": [
                    "{{api_prefix}}",
                    "envelopes"
                  ]
                },
                "description": "Safe. Nesting of 6 levels is rejected; 5 levels (objects and arrays each count, root is level 1) is the maximum and is accepted. Metadata is validated before anything is created, so the response has no envelope. That no database row is left behind is proved separately by a database count in the local proof, not by this request. Public docs: api/envelopes.md#envelope-metadata.",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"name\": \"Invalid metadata check\",\n  \"metadata\": {\n    \"a\": {\n      \"b\": {\n        \"c\": {\n          \"d\": {\n            \"e\": [\n              1\n            ]\n          }\n        }\n      }\n    }\n  }\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "Unprocessable Content",
              "code": 422,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"error\": \"Invalid metadata\",\n  \"message\": \"metadata is nested 6 levels deep; the maximum is 5\",\n  \"request_id\": \"00000000-0000-4000-8000-0000000000aa\"\n}"
            }
          ]
        }
      ]
    },
    {
      "name": "2. SAFE - Uploads (draft only)",
      "description": "Safe. The supported upload flow: presigned storage uploads (up to 50 MB) for an unsent draft, with small, medium and large fictional PDFs, then a bounded wait until the worker has linked them. The PUT requests are outbound calls to the storage host and are skipped on localhost.",
      "item": [
        {
          "name": "Create draft for the upload walkthrough (placements wait for the uploads)",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = pm.response.json();",
                  "pm.test('Status is 422: placements for files that are not uploaded yet make the draft ERROR until they arrive', () => pm.response.to.have.status(422));",
                  "pm.test('Only the three pending upload placements are reported', () => {",
                  "    pm.expect(j.envelope.status).to.eql('ERROR');",
                  "    pm.expect(j.envelope.errors).to.have.lengthOf(3);",
                  "    j.envelope.errors.forEach((e) => pm.expect(e).to.include('does not point to a valid document'));",
                  "});",
                  "pm.test('Placements keep the document keys that the presigned custom_keys will match', () => {",
                  "    const keys = j.envelope.placements.map((p) => p.document_key).sort();",
                  "    pm.expect(keys).to.eql(['0', 'fixture-large', 'fixture-medium', 'fixture-small']);",
                  "    j.envelope.placements.filter((p) => p.document_key !== '0').forEach((p) => pm.expect(p.document_id).to.eql(null));",
                  "});",
                  "pm.test('request_id is present', () => pm.expect(j.request_id).to.be.a('string').and.not.empty);",
                  "pm.collectionVariables.set('upload_envelope_id', j.envelope.id);",
                  "// A new walkthrough starts: forget earlier poll counters and skip flags.",
                  "pm.collectionVariables.set('upload_poll_attempts', '0');",
                  "pm.collectionVariables.set('storage_skipped', '');"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "{{api_key}}",
                "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{api_url}}/{{api_prefix}}/envelopes",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "{{api_prefix}}",
                "envelopes"
              ]
            },
            "description": "Safe. Creates the draft that the upload requests attach files to. Besides the base document it has one SIGNATURE placement per file that will be uploaded: `document_key` is `fixture-small`, `fixture-medium` and `fixture-large`, the same values as the `custom_key` of the presigned uploads below. When an upload completes, the worker links the placements whose `document_key` equals the file's custom_key (or its id, or its numeric position). Until then the API answers 422 with status ERROR (\"does not point to a valid document\"); the draft still accepts uploads. Saves upload_envelope_id and resets the poll counter. Public docs: api/uploads.md.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Postman uploads draft (fictional)\",\n  \"documents\": {\n    \"0\": {\n      \"base64\": \"{{sample_pdf_base64}}\",\n      \"name\": \"base-document.pdf\",\n      \"type\": \"SIGNABLE\"\n    }\n  },\n  \"recipients\": {\n    \"signer\": {\n      \"name\": \"Ana Signer\",\n      \"email\": \"{{fixture_signer_email}}\",\n      \"order\": 1\n    }\n  },\n  \"placements\": {\n    \"p0\": {\n      \"document_key\": \"0\",\n      \"recipient_key\": \"signer\",\n      \"type\": \"SIGNATURE\",\n      \"order\": 0,\n      \"coordinates\": {\n        \"page\": 0,\n        \"top\": 650,\n        \"left\": 100\n      }\n    },\n    \"p1\": {\n      \"document_key\": \"fixture-small\",\n      \"recipient_key\": \"signer\",\n      \"type\": \"SIGNATURE\",\n      \"order\": 1,\n      \"coordinates\": {\n        \"page\": 0,\n        \"top\": 550,\n        \"left\": 100\n      }\n    },\n    \"p2\": {\n      \"document_key\": \"fixture-medium\",\n      \"recipient_key\": \"signer\",\n      \"type\": \"SIGNATURE\",\n      \"order\": 2,\n      \"coordinates\": {\n        \"page\": 0,\n        \"top\": 500,\n        \"left\": 100\n      }\n    },\n    \"p3\": {\n      \"document_key\": \"fixture-large\",\n      \"recipient_key\": \"signer\",\n      \"type\": \"SIGNATURE\",\n      \"order\": 3,\n      \"coordinates\": {\n        \"page\": 0,\n        \"top\": 450,\n        \"left\": 100\n      }\n    }\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [
            {
              "name": "422 - draft stored with status ERROR until the uploads complete",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "{{api_key}}",
                    "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": {
                  "raw": "{{api_url}}/{{api_prefix}}/envelopes",
                  "host": [
                    "{{api_url}}"
                  ],
                  "path": [
                    "{{api_prefix}}",
                    "envelopes"
                  ]
                },
                "description": "Safe. Creates the draft that the upload requests attach files to. Besides the base document it has one SIGNATURE placement per file that will be uploaded: `document_key` is `fixture-small`, `fixture-medium` and `fixture-large`, the same values as the `custom_key` of the presigned uploads below. When an upload completes, the worker links the placements whose `document_key` equals the file's custom_key (or its id, or its numeric position). Until then the API answers 422 with status ERROR (\"does not point to a valid document\"); the draft still accepts uploads. Saves upload_envelope_id and resets the poll counter. Public docs: api/uploads.md.",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"name\": \"Postman uploads draft (fictional)\",\n  \"documents\": {\n    \"0\": {\n      \"base64\": \"{{sample_pdf_base64}}\",\n      \"name\": \"base-document.pdf\",\n      \"type\": \"SIGNABLE\"\n    }\n  },\n  \"recipients\": {\n    \"signer\": {\n      \"name\": \"Ana Signer\",\n      \"email\": \"{{fixture_signer_email}}\",\n      \"order\": 1\n    }\n  },\n  \"placements\": {\n    \"p0\": {\n      \"document_key\": \"0\",\n      \"recipient_key\": \"signer\",\n      \"type\": \"SIGNATURE\",\n      \"order\": 0,\n      \"coordinates\": {\n        \"page\": 0,\n        \"top\": 650,\n        \"left\": 100\n      }\n    },\n    \"p1\": {\n      \"document_key\": \"fixture-small\",\n      \"recipient_key\": \"signer\",\n      \"type\": \"SIGNATURE\",\n      \"order\": 1,\n      \"coordinates\": {\n        \"page\": 0,\n        \"top\": 550,\n        \"left\": 100\n      }\n    },\n    \"p2\": {\n      \"document_key\": \"fixture-medium\",\n      \"recipient_key\": \"signer\",\n      \"type\": \"SIGNATURE\",\n      \"order\": 2,\n      \"coordinates\": {\n        \"page\": 0,\n        \"top\": 500,\n        \"left\": 100\n      }\n    },\n    \"p3\": {\n      \"document_key\": \"fixture-large\",\n      \"recipient_key\": \"signer\",\n      \"type\": \"SIGNATURE\",\n      \"order\": 3,\n      \"coordinates\": {\n        \"page\": 0,\n        \"top\": 450,\n        \"left\": 100\n      }\n    }\n  }\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "Unprocessable Content",
              "code": 422,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"envelope\": {\n    \"id\": \"00000000-0000-4000-8000-000000000005\",\n    \"name\": \"Postman uploads draft (fictional)\",\n    \"status\": \"ERROR\",\n    \"errors\": [\n      \"The placement '00000000-0000-4000-8000-000000000042' does not point to a valid document.\",\n      \"The placement '00000000-0000-4000-8000-000000000043' does not point to a valid document.\",\n      \"The placement '00000000-0000-4000-8000-000000000044' does not point to a valid document.\"\n    ],\n    \"warnings\": [],\n    \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n    \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n    \"evidence_document_url\": null,\n    \"error_reason\": null,\n    \"evidence_generated_at\": null,\n    \"documents\": [\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000011\",\n        \"custom_key\": \"0\",\n        \"file_type\": \"ORIGINAL\",\n        \"order\": 0,\n        \"status\": \"CREATED\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"file_name\": \"base-document.pdf\",\n        \"content_type\": \"application/pdf\",\n        \"file_size\": 1150,\n        \"page_count\": 1,\n        \"url\": \"https://storage.example.invalid/sample/contract-main.pdf?signature=redacted\"\n      }\n    ],\n    \"recipients\": [\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000002\",\n        \"custom_key\": \"signer\",\n        \"order\": 1,\n        \"status\": \"CREATED\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"name\": \"Ana Signer\",\n        \"name_label\": \"Name:\",\n        \"email\": \"signer@example.com\",\n        \"email_label\": \"Email:\"\n      }\n    ],\n    \"placements\": [\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000041\",\n        \"custom_key\": \"p0\",\n        \"placement_type\": \"SIGNATURE\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"recipient_id\": \"00000000-0000-4000-8000-000000000002\",\n        \"recipient_key\": \"signer\",\n        \"document_id\": \"00000000-0000-4000-8000-000000000011\",\n        \"document_key\": \"0\",\n        \"order\": 0,\n        \"coordinates\": {\n          \"id\": \"Lexgo-Sign-0\",\n          \"top\": 650,\n          \"left\": 100,\n          \"page\": 0\n        },\n        \"token\": null\n      },\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000042\",\n        \"custom_key\": \"p1\",\n        \"placement_type\": \"SIGNATURE\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"recipient_id\": \"00000000-0000-4000-8000-000000000002\",\n        \"recipient_key\": \"signer\",\n        \"document_id\": null,\n        \"document_key\": \"fixture-small\",\n        \"order\": 1,\n        \"coordinates\": {\n          \"id\": \"Lexgo-Sign-1\",\n          \"page\": 0,\n          \"top\": 550,\n          \"left\": 100\n        },\n        \"token\": null\n      },\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000043\",\n        \"custom_key\": \"p2\",\n        \"placement_type\": \"SIGNATURE\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"recipient_id\": \"00000000-0000-4000-8000-000000000002\",\n        \"recipient_key\": \"signer\",\n        \"document_id\": null,\n        \"document_key\": \"fixture-medium\",\n        \"order\": 2,\n        \"coordinates\": {\n          \"id\": \"Lexgo-Sign-2\",\n          \"page\": 0,\n          \"top\": 500,\n          \"left\": 100\n        },\n        \"token\": null\n      },\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000044\",\n        \"custom_key\": \"p3\",\n        \"placement_type\": \"SIGNATURE\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"recipient_id\": \"00000000-0000-4000-8000-000000000002\",\n        \"recipient_key\": \"signer\",\n        \"document_id\": null,\n        \"document_key\": \"fixture-large\",\n        \"order\": 3,\n        \"coordinates\": {\n          \"id\": \"Lexgo-Sign-3\",\n          \"page\": 0,\n          \"top\": 450,\n          \"left\": 100\n        },\n        \"token\": null\n      }\n    ],\n    \"settings\": {\n      \"emails\": {\n        \"envelope_invitation\": \"TRUE\",\n        \"envelope_voided\": \"TRUE\",\n        \"envelope_rejected\": \"TRUE\",\n        \"envelope_signed\": \"TRUE\"\n      },\n      \"documents\": {\n        \"include_page_id\": \"TRUE\",\n        \"custom_page_id\": \"Lexgo Sign ID:\",\n        \"signatures_per_page\": 4,\n        \"signatures_per_row\": 1\n      },\n      \"signature_flow\": {\n        \"language\": \"EN\",\n        \"signature_order\": \"SEQUENTIAL\",\n        \"signature_types\": \"WRITTEN, DRAWN, UPLOADED\",\n        \"signature_color\": \"#000000\",\n        \"sender_name\": \"Fixture Sender\",\n        \"sender_enterprise\": null\n      },\n      \"signature\": {\n        \"style\": \"SIMPLE\",\n        \"type\": \"INTERNATIONAL\",\n        \"image\": \"DEFAULT\",\n        \"text\": \"DEFAULT\",\n        \"bg_image\": \"DEFAULT\",\n        \"bg_image_scope\": \"QUALIFIED_CHILE\"\n      },\n      \"validations\": {\n        \"email\": {\n          \"order\": 0,\n          \"enabled\": \"FALSE\"\n        },\n        \"phone\": {\n          \"order\": 1,\n          \"enabled\": \"FALSE\",\n          \"methods\": \"SMS\"\n        },\n        \"id_check\": {\n          \"order\": 2,\n          \"enabled\": \"FALSE\"\n        },\n        \"biometric\": {\n          \"order\": 3,\n          \"enabled\": \"FALSE\"\n        }\n      }\n    },\n    \"metadata\": {}\n  },\n  \"request_id\": \"00000000-0000-4000-8000-0000000000aa\"\n}"
            }
          ]
        },
        {
          "name": "Presigned small - 1. create (small.pdf)",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = pm.response.json();",
                  "pm.test('Status is 200', () => pm.response.to.have.status(200));",
                  "pm.test('Presigned upload is PENDING with a 50 MB limit', () => {",
                  "    pm.expect(j.success).to.eql(true);",
                  "    pm.expect(j.presigned_upload.status).to.eql('PENDING');",
                  "    pm.expect(j.presigned_upload.max_file_size).to.eql(52428800);",
                  "    pm.expect(j.presigned_upload.file_name).to.eql(\"small.pdf\");",
                  "});",
                  "pm.test('presigned_url is https (plain http only on loopback) and instructions say PUT application/pdf', () => {",
                  "    pm.expect(j.presigned_upload.presigned_url).to.match(/^(https:\\/\\/|http:\\/\\/(localhost|127\\.[0-9.]+)[:\\/])/);",
                  "    pm.expect(j.presigned_upload.instructions.method).to.eql('PUT');",
                  "    pm.expect(j.presigned_upload.instructions.headers['Content-Type']).to.eql('application/pdf');",
                  "});",
                  "pm.test('request_id is present', () => pm.expect(j.request_id).to.be.a('string').and.not.empty);",
                  "pm.collectionVariables.set('presigned_url_id', j.presigned_upload.id);",
                  "pm.collectionVariables.set('presigned_url', j.presigned_upload.presigned_url);"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "{{api_key}}",
                "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{api_url}}/{{api_prefix}}/envelopes/{{upload_envelope_id}}/presigned_uploads",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "{{api_prefix}}",
                "envelopes",
                "{{upload_envelope_id}}",
                "presigned_uploads"
              ]
            },
            "description": "Safe. Reserves a presigned storage URL for small.pdf (about 1 KB, order 2). The URL is valid for 1 hour and the limit is 50 MB. Saves presigned_url_id and presigned_url (the next request clears presigned_url after use). Public docs: api/uploads.md.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"file_name\": \"small.pdf\",\n  \"order\": 2,\n  \"custom_key\": \"fixture-small\",\n  \"content_type\": \"application/pdf\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [
            {
              "name": "200 OK",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "{{api_key}}",
                    "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": {
                  "raw": "{{api_url}}/{{api_prefix}}/envelopes/{{upload_envelope_id}}/presigned_uploads",
                  "host": [
                    "{{api_url}}"
                  ],
                  "path": [
                    "{{api_prefix}}",
                    "envelopes",
                    "{{upload_envelope_id}}",
                    "presigned_uploads"
                  ]
                },
                "description": "Safe. Reserves a presigned storage URL for small.pdf (about 1 KB, order 2). The URL is valid for 1 hour and the limit is 50 MB. Saves presigned_url_id and presigned_url (the next request clears presigned_url after use). Public docs: api/uploads.md.",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"file_name\": \"small.pdf\",\n  \"order\": 2,\n  \"custom_key\": \"fixture-small\",\n  \"content_type\": \"application/pdf\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"success\": true,\n  \"presigned_upload\": {\n    \"id\": \"00000000-0000-4000-8000-000000000062\",\n    \"presigned_url\": \"https://storage.example.invalid/sample/small.pdf?signature=redacted\",\n    \"file_name\": \"small.pdf\",\n    \"order\": 2,\n    \"custom_key\": \"fixture-small\",\n    \"content_type\": \"application/pdf\",\n    \"expires_at\": \"2026-01-15T13:00:00-03:00\",\n    \"max_file_size\": 52428800,\n    \"envelope_id\": \"00000000-0000-4000-8000-000000000005\",\n    \"status\": \"PENDING\",\n    \"instructions\": {\n      \"method\": \"PUT\",\n      \"headers\": {\n        \"Content-Type\": \"application/pdf\"\n      },\n      \"note\": \"Upload file directly to presigned_url using PUT method with Content-Type header\"\n    }\n  },\n  \"request_id\": \"00000000-0000-4000-8000-0000000000aa\"\n}"
            },
            {
              "name": "400 Only PDF files are supported",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "{{api_key}}",
                    "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": {
                  "raw": "{{api_url}}/{{api_prefix}}/envelopes/{{upload_envelope_id}}/presigned_uploads",
                  "host": [
                    "{{api_url}}"
                  ],
                  "path": [
                    "{{api_prefix}}",
                    "envelopes",
                    "{{upload_envelope_id}}",
                    "presigned_uploads"
                  ]
                },
                "description": "Safe. Reserves a presigned storage URL for small.pdf (about 1 KB, order 2). The URL is valid for 1 hour and the limit is 50 MB. Saves presigned_url_id and presigned_url (the next request clears presigned_url after use). Public docs: api/uploads.md.",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"file_name\": \"small.pdf\",\n  \"order\": 2,\n  \"custom_key\": \"fixture-small\",\n  \"content_type\": \"application/pdf\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "Bad Request",
              "code": 400,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"error\": \"Only PDF files are supported for signature envelopes\",\n  \"request_id\": \"00000000-0000-4000-8000-0000000000aa\"\n}"
            },
            {
              "name": "422 Duplicate active order",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "{{api_key}}",
                    "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": {
                  "raw": "{{api_url}}/{{api_prefix}}/envelopes/{{upload_envelope_id}}/presigned_uploads",
                  "host": [
                    "{{api_url}}"
                  ],
                  "path": [
                    "{{api_prefix}}",
                    "envelopes",
                    "{{upload_envelope_id}}",
                    "presigned_uploads"
                  ]
                },
                "description": "Safe. Reserves a presigned storage URL for small.pdf (about 1 KB, order 2). The URL is valid for 1 hour and the limit is 50 MB. Saves presigned_url_id and presigned_url (the next request clears presigned_url after use). Public docs: api/uploads.md.",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"file_name\": \"small.pdf\",\n  \"order\": 2,\n  \"custom_key\": \"fixture-small\",\n  \"content_type\": \"application/pdf\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "Unprocessable Content",
              "code": 422,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"error\": \"Order already has an active upload request. Previous upload must complete, fail, or expire before generating new URL.\",\n  \"request_id\": \"00000000-0000-4000-8000-0000000000aa\"\n}"
            }
          ]
        },
        {
          "name": "Presigned small - 2. PUT small.pdf to storage (outbound, no API key)",
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const apiUrl = String(pm.variables.get('api_url') || '');",
                  "if (/^https?:\\/\\/(localhost|127\\.0\\.0\\.1)([:\\/]|$)/i.test(apiUrl)) {",
                  "    console.warn('Skipped storage PUT: the local dev server cannot complete a real storage upload.');",
                  "    pm.collectionVariables.set('storage_skipped', 'yes');",
                  "    pm.execution.skipRequest();",
                  "} else if (!pm.variables.get('presigned_url')) {",
                  "    console.warn('Skipped storage PUT: presigned_url is empty. Run the create request first.');",
                  "    pm.execution.skipRequest();",
                  "}"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Storage accepted the upload (200)', () => pm.response.to.have.status(200));",
                  "pm.test('No Authorization header was sent to the storage host', () => {",
                  "    pm.expect(pm.request.headers.has('Authorization')).to.be.false;",
                  "});",
                  "pm.test('Request auth is noauth', () => {",
                  "    pm.expect(!pm.request.auth || pm.request.auth.type === 'noauth').to.be.true;",
                  "});",
                  "pm.collectionVariables.unset('presigned_url');"
                ]
              }
            }
          ],
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/pdf"
              }
            ],
            "url": {
              "raw": "{{presigned_url}}",
              "host": [
                "{{presigned_url}}"
              ]
            },
            "description": "Safe for Lexgo data (draft only) but this is an OUTBOUND call to the storage host in presigned_url, not to the Sign API. It sends small.pdf (about 1 KB) as the raw body with Content-Type: application/pdf and deliberately NO Authorization header (the URL itself is the credential). Skipped when api_url points to localhost: the local dev server cannot complete a real storage upload. Requires the Postman working directory to contain fixtures/ (see README). Public docs: api/uploads.md.",
            "body": {
              "mode": "file",
              "file": {
                "src": "fixtures/small.pdf"
              }
            },
            "auth": {
              "type": "noauth"
            }
          },
          "response": [
            {
              "name": "200 OK (storage replies with an empty body)",
              "originalRequest": {
                "method": "PUT",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/pdf"
                  }
                ],
                "url": {
                  "raw": "{{presigned_url}}",
                  "host": [
                    "{{presigned_url}}"
                  ]
                },
                "description": "Safe for Lexgo data (draft only) but this is an OUTBOUND call to the storage host in presigned_url, not to the Sign API. It sends small.pdf (about 1 KB) as the raw body with Content-Type: application/pdf and deliberately NO Authorization header (the URL itself is the credential). Skipped when api_url points to localhost: the local dev server cannot complete a real storage upload. Requires the Postman working directory to contain fixtures/ (see README). Public docs: api/uploads.md.",
                "body": {
                  "mode": "file",
                  "file": {
                    "src": "fixtures/small.pdf"
                  }
                },
                "auth": {
                  "type": "noauth"
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "text",
              "header": [],
              "cookie": [],
              "body": ""
            }
          ]
        },
        {
          "name": "Presigned small - 3. get upload status",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = pm.response.json();",
                  "pm.test('Status is 200', () => pm.response.to.have.status(200));",
                  "pm.test('Presigned upload matches the saved id and has a valid status', () => {",
                  "    pm.expect(j.presigned_upload.id).to.eql(pm.variables.get('presigned_url_id'));",
                  "    pm.expect(j.presigned_upload.status).to.be.oneOf(['PENDING', 'UPLOADED', 'PROCESSING', 'COMPLETED', 'FAILED', 'EXPIRED']);",
                  "    pm.expect(j.presigned_upload.file_name).to.eql(\"small.pdf\");",
                  "});",
                  "pm.test('request_id is present', () => pm.expect(j.request_id).to.be.a('string').and.not.empty);"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "{{api_key}}",
                "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
              }
            ],
            "url": {
              "raw": "{{api_url}}/{{api_prefix}}/envelopes/{{upload_envelope_id}}/presigned_uploads/{{presigned_url_id}}",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "{{api_prefix}}",
                "envelopes",
                "{{upload_envelope_id}}",
                "presigned_uploads",
                "{{presigned_url_id}}"
              ]
            },
            "description": "Safe, read-only. PENDING until storage receives the file, then UPLOADED, PROCESSING and COMPLETED (file_id is set when COMPLETED). It stays PENDING if the storage PUT was skipped. Public docs: api/uploads.md."
          },
          "response": [
            {
              "name": "200 OK - pending",
              "originalRequest": {
                "method": "GET",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "{{api_key}}",
                    "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
                  }
                ],
                "url": {
                  "raw": "{{api_url}}/{{api_prefix}}/envelopes/{{upload_envelope_id}}/presigned_uploads/{{presigned_url_id}}",
                  "host": [
                    "{{api_url}}"
                  ],
                  "path": [
                    "{{api_prefix}}",
                    "envelopes",
                    "{{upload_envelope_id}}",
                    "presigned_uploads",
                    "{{presigned_url_id}}"
                  ]
                },
                "description": "Safe, read-only. PENDING until storage receives the file, then UPLOADED, PROCESSING and COMPLETED (file_id is set when COMPLETED). It stays PENDING if the storage PUT was skipped. Public docs: api/uploads.md."
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"presigned_upload\": {\n    \"id\": \"00000000-0000-4000-8000-000000000062\",\n    \"envelope_id\": \"00000000-0000-4000-8000-000000000005\",\n    \"status\": \"PENDING\",\n    \"order\": 2,\n    \"file_name\": \"small.pdf\",\n    \"content_type\": \"application/pdf\",\n    \"upload_url\": \"https://api.lexgo.cl/v1/uploads/00000000-0000-4000-8000-000000000062/stream\",\n    \"expires_at\": \"2026-01-15T13:00:00-03:00\",\n    \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n    \"updated_at\": \"2026-01-15T12:00:00.000-03:00\"\n  },\n  \"request_id\": \"00000000-0000-4000-8000-0000000000aa\"\n}"
            },
            {
              "name": "200 OK - completed",
              "originalRequest": {
                "method": "GET",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "{{api_key}}",
                    "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
                  }
                ],
                "url": {
                  "raw": "{{api_url}}/{{api_prefix}}/envelopes/{{upload_envelope_id}}/presigned_uploads/{{presigned_url_id}}",
                  "host": [
                    "{{api_url}}"
                  ],
                  "path": [
                    "{{api_prefix}}",
                    "envelopes",
                    "{{upload_envelope_id}}",
                    "presigned_uploads",
                    "{{presigned_url_id}}"
                  ]
                },
                "description": "Safe, read-only. PENDING until storage receives the file, then UPLOADED, PROCESSING and COMPLETED (file_id is set when COMPLETED). It stays PENDING if the storage PUT was skipped. Public docs: api/uploads.md."
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"presigned_upload\": {\n    \"id\": \"00000000-0000-4000-8000-000000000062\",\n    \"envelope_id\": \"00000000-0000-4000-8000-000000000005\",\n    \"status\": \"COMPLETED\",\n    \"order\": 2,\n    \"file_name\": \"small.pdf\",\n    \"content_type\": \"application/pdf\",\n    \"upload_url\": \"https://api.lexgo.cl/v1/uploads/00000000-0000-4000-8000-000000000062/stream\",\n    \"expires_at\": \"2026-01-15T13:00:00-03:00\",\n    \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n    \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n    \"file_id\": \"00000000-0000-4000-8000-000000000032\",\n    \"uploaded_at\": \"2026-01-15T12:00:00.000-03:00\",\n    \"processed_at\": \"2026-01-15T12:00:00.000-03:00\"\n  },\n  \"request_id\": \"00000000-0000-4000-8000-0000000000aa\"\n}"
            },
            {
              "name": "404 Presigned upload not found",
              "originalRequest": {
                "method": "GET",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "{{api_key}}",
                    "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
                  }
                ],
                "url": {
                  "raw": "{{api_url}}/{{api_prefix}}/envelopes/{{upload_envelope_id}}/presigned_uploads/{{presigned_url_id}}",
                  "host": [
                    "{{api_url}}"
                  ],
                  "path": [
                    "{{api_prefix}}",
                    "envelopes",
                    "{{upload_envelope_id}}",
                    "presigned_uploads",
                    "{{presigned_url_id}}"
                  ]
                },
                "description": "Safe, read-only. PENDING until storage receives the file, then UPLOADED, PROCESSING and COMPLETED (file_id is set when COMPLETED). It stays PENDING if the storage PUT was skipped. Public docs: api/uploads.md."
              },
              "status": "Not Found",
              "code": 404,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"error\": \"Presigned upload not found\",\n  \"request_id\": \"00000000-0000-4000-8000-0000000000aa\"\n}"
            }
          ]
        },
        {
          "name": "Presigned medium - 1. create (medium.pdf)",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = pm.response.json();",
                  "pm.test('Status is 200', () => pm.response.to.have.status(200));",
                  "pm.test('Presigned upload is PENDING with a 50 MB limit', () => {",
                  "    pm.expect(j.success).to.eql(true);",
                  "    pm.expect(j.presigned_upload.status).to.eql('PENDING');",
                  "    pm.expect(j.presigned_upload.max_file_size).to.eql(52428800);",
                  "    pm.expect(j.presigned_upload.file_name).to.eql(\"medium.pdf\");",
                  "});",
                  "pm.test('presigned_url is https (plain http only on loopback) and instructions say PUT application/pdf', () => {",
                  "    pm.expect(j.presigned_upload.presigned_url).to.match(/^(https:\\/\\/|http:\\/\\/(localhost|127\\.[0-9.]+)[:\\/])/);",
                  "    pm.expect(j.presigned_upload.instructions.method).to.eql('PUT');",
                  "    pm.expect(j.presigned_upload.instructions.headers['Content-Type']).to.eql('application/pdf');",
                  "});",
                  "pm.test('request_id is present', () => pm.expect(j.request_id).to.be.a('string').and.not.empty);",
                  "pm.collectionVariables.set('presigned_url_id', j.presigned_upload.id);",
                  "pm.collectionVariables.set('presigned_url', j.presigned_upload.presigned_url);"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "{{api_key}}",
                "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{api_url}}/{{api_prefix}}/envelopes/{{upload_envelope_id}}/presigned_uploads",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "{{api_prefix}}",
                "envelopes",
                "{{upload_envelope_id}}",
                "presigned_uploads"
              ]
            },
            "description": "Safe. Reserves a presigned storage URL for medium.pdf (about 200 KB, order 3). The URL is valid for 1 hour and the limit is 50 MB. Saves presigned_url_id and presigned_url (the next request clears presigned_url after use). Public docs: api/uploads.md.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"file_name\": \"medium.pdf\",\n  \"order\": 3,\n  \"custom_key\": \"fixture-medium\",\n  \"content_type\": \"application/pdf\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [
            {
              "name": "200 OK",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "{{api_key}}",
                    "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": {
                  "raw": "{{api_url}}/{{api_prefix}}/envelopes/{{upload_envelope_id}}/presigned_uploads",
                  "host": [
                    "{{api_url}}"
                  ],
                  "path": [
                    "{{api_prefix}}",
                    "envelopes",
                    "{{upload_envelope_id}}",
                    "presigned_uploads"
                  ]
                },
                "description": "Safe. Reserves a presigned storage URL for medium.pdf (about 200 KB, order 3). The URL is valid for 1 hour and the limit is 50 MB. Saves presigned_url_id and presigned_url (the next request clears presigned_url after use). Public docs: api/uploads.md.",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"file_name\": \"medium.pdf\",\n  \"order\": 3,\n  \"custom_key\": \"fixture-medium\",\n  \"content_type\": \"application/pdf\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"success\": true,\n  \"presigned_upload\": {\n    \"id\": \"00000000-0000-4000-8000-000000000063\",\n    \"presigned_url\": \"https://storage.example.invalid/sample/medium.pdf?signature=redacted\",\n    \"file_name\": \"medium.pdf\",\n    \"order\": 3,\n    \"custom_key\": \"fixture-medium\",\n    \"content_type\": \"application/pdf\",\n    \"expires_at\": \"2026-01-15T13:00:00-03:00\",\n    \"max_file_size\": 52428800,\n    \"envelope_id\": \"00000000-0000-4000-8000-000000000005\",\n    \"status\": \"PENDING\",\n    \"instructions\": {\n      \"method\": \"PUT\",\n      \"headers\": {\n        \"Content-Type\": \"application/pdf\"\n      },\n      \"note\": \"Upload file directly to presigned_url using PUT method with Content-Type header\"\n    }\n  },\n  \"request_id\": \"00000000-0000-4000-8000-0000000000aa\"\n}"
            }
          ]
        },
        {
          "name": "Presigned medium - 2. PUT medium.pdf to storage (outbound, no API key)",
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const apiUrl = String(pm.variables.get('api_url') || '');",
                  "if (/^https?:\\/\\/(localhost|127\\.0\\.0\\.1)([:\\/]|$)/i.test(apiUrl)) {",
                  "    console.warn('Skipped storage PUT: the local dev server cannot complete a real storage upload.');",
                  "    pm.collectionVariables.set('storage_skipped', 'yes');",
                  "    pm.execution.skipRequest();",
                  "} else if (!pm.variables.get('presigned_url')) {",
                  "    console.warn('Skipped storage PUT: presigned_url is empty. Run the create request first.');",
                  "    pm.execution.skipRequest();",
                  "}"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Storage accepted the upload (200)', () => pm.response.to.have.status(200));",
                  "pm.test('No Authorization header was sent to the storage host', () => {",
                  "    pm.expect(pm.request.headers.has('Authorization')).to.be.false;",
                  "});",
                  "pm.test('Request auth is noauth', () => {",
                  "    pm.expect(!pm.request.auth || pm.request.auth.type === 'noauth').to.be.true;",
                  "});",
                  "pm.collectionVariables.unset('presigned_url');"
                ]
              }
            }
          ],
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/pdf"
              }
            ],
            "url": {
              "raw": "{{presigned_url}}",
              "host": [
                "{{presigned_url}}"
              ]
            },
            "description": "Safe for Lexgo data (draft only) but this is an OUTBOUND call to the storage host in presigned_url, not to the Sign API. It sends medium.pdf (about 200 KB) as the raw body with Content-Type: application/pdf and deliberately NO Authorization header (the URL itself is the credential). Skipped when api_url points to localhost: the local dev server cannot complete a real storage upload. Requires the Postman working directory to contain fixtures/ (see README). Public docs: api/uploads.md.",
            "body": {
              "mode": "file",
              "file": {
                "src": "fixtures/medium.pdf"
              }
            },
            "auth": {
              "type": "noauth"
            }
          },
          "response": [
            {
              "name": "200 OK (storage replies with an empty body)",
              "originalRequest": {
                "method": "PUT",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/pdf"
                  }
                ],
                "url": {
                  "raw": "{{presigned_url}}",
                  "host": [
                    "{{presigned_url}}"
                  ]
                },
                "description": "Safe for Lexgo data (draft only) but this is an OUTBOUND call to the storage host in presigned_url, not to the Sign API. It sends medium.pdf (about 200 KB) as the raw body with Content-Type: application/pdf and deliberately NO Authorization header (the URL itself is the credential). Skipped when api_url points to localhost: the local dev server cannot complete a real storage upload. Requires the Postman working directory to contain fixtures/ (see README). Public docs: api/uploads.md.",
                "body": {
                  "mode": "file",
                  "file": {
                    "src": "fixtures/medium.pdf"
                  }
                },
                "auth": {
                  "type": "noauth"
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "text",
              "header": [],
              "cookie": [],
              "body": ""
            }
          ]
        },
        {
          "name": "Presigned medium - 3. get upload status",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = pm.response.json();",
                  "pm.test('Status is 200', () => pm.response.to.have.status(200));",
                  "pm.test('Presigned upload matches the saved id and has a valid status', () => {",
                  "    pm.expect(j.presigned_upload.id).to.eql(pm.variables.get('presigned_url_id'));",
                  "    pm.expect(j.presigned_upload.status).to.be.oneOf(['PENDING', 'UPLOADED', 'PROCESSING', 'COMPLETED', 'FAILED', 'EXPIRED']);",
                  "    pm.expect(j.presigned_upload.file_name).to.eql(\"medium.pdf\");",
                  "});",
                  "pm.test('request_id is present', () => pm.expect(j.request_id).to.be.a('string').and.not.empty);"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "{{api_key}}",
                "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
              }
            ],
            "url": {
              "raw": "{{api_url}}/{{api_prefix}}/envelopes/{{upload_envelope_id}}/presigned_uploads/{{presigned_url_id}}",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "{{api_prefix}}",
                "envelopes",
                "{{upload_envelope_id}}",
                "presigned_uploads",
                "{{presigned_url_id}}"
              ]
            },
            "description": "Safe, read-only. PENDING until storage receives the file, then UPLOADED, PROCESSING and COMPLETED (file_id is set when COMPLETED). It stays PENDING if the storage PUT was skipped. Public docs: api/uploads.md."
          },
          "response": [
            {
              "name": "200 OK - pending",
              "originalRequest": {
                "method": "GET",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "{{api_key}}",
                    "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
                  }
                ],
                "url": {
                  "raw": "{{api_url}}/{{api_prefix}}/envelopes/{{upload_envelope_id}}/presigned_uploads/{{presigned_url_id}}",
                  "host": [
                    "{{api_url}}"
                  ],
                  "path": [
                    "{{api_prefix}}",
                    "envelopes",
                    "{{upload_envelope_id}}",
                    "presigned_uploads",
                    "{{presigned_url_id}}"
                  ]
                },
                "description": "Safe, read-only. PENDING until storage receives the file, then UPLOADED, PROCESSING and COMPLETED (file_id is set when COMPLETED). It stays PENDING if the storage PUT was skipped. Public docs: api/uploads.md."
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"presigned_upload\": {\n    \"id\": \"00000000-0000-4000-8000-000000000063\",\n    \"envelope_id\": \"00000000-0000-4000-8000-000000000005\",\n    \"status\": \"PENDING\",\n    \"order\": 3,\n    \"file_name\": \"medium.pdf\",\n    \"content_type\": \"application/pdf\",\n    \"upload_url\": \"https://api.lexgo.cl/v1/uploads/00000000-0000-4000-8000-000000000063/stream\",\n    \"expires_at\": \"2026-01-15T13:00:00-03:00\",\n    \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n    \"updated_at\": \"2026-01-15T12:00:00.000-03:00\"\n  },\n  \"request_id\": \"00000000-0000-4000-8000-0000000000aa\"\n}"
            }
          ]
        },
        {
          "name": "Presigned large - 1. create (large.pdf)",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = pm.response.json();",
                  "pm.test('Status is 200', () => pm.response.to.have.status(200));",
                  "pm.test('Presigned upload is PENDING with a 50 MB limit', () => {",
                  "    pm.expect(j.success).to.eql(true);",
                  "    pm.expect(j.presigned_upload.status).to.eql('PENDING');",
                  "    pm.expect(j.presigned_upload.max_file_size).to.eql(52428800);",
                  "    pm.expect(j.presigned_upload.file_name).to.eql(\"large.pdf\");",
                  "});",
                  "pm.test('presigned_url is https (plain http only on loopback) and instructions say PUT application/pdf', () => {",
                  "    pm.expect(j.presigned_upload.presigned_url).to.match(/^(https:\\/\\/|http:\\/\\/(localhost|127\\.[0-9.]+)[:\\/])/);",
                  "    pm.expect(j.presigned_upload.instructions.method).to.eql('PUT');",
                  "    pm.expect(j.presigned_upload.instructions.headers['Content-Type']).to.eql('application/pdf');",
                  "});",
                  "pm.test('request_id is present', () => pm.expect(j.request_id).to.be.a('string').and.not.empty);",
                  "pm.collectionVariables.set('presigned_url_id', j.presigned_upload.id);",
                  "pm.collectionVariables.set('presigned_url', j.presigned_upload.presigned_url);"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "{{api_key}}",
                "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{api_url}}/{{api_prefix}}/envelopes/{{upload_envelope_id}}/presigned_uploads",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "{{api_prefix}}",
                "envelopes",
                "{{upload_envelope_id}}",
                "presigned_uploads"
              ]
            },
            "description": "Safe. Reserves a presigned storage URL for large.pdf (about 1 MB, order 4). The URL is valid for 1 hour and the limit is 50 MB. Saves presigned_url_id and presigned_url (the next request clears presigned_url after use). Public docs: api/uploads.md.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"file_name\": \"large.pdf\",\n  \"order\": 4,\n  \"custom_key\": \"fixture-large\",\n  \"content_type\": \"application/pdf\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [
            {
              "name": "200 OK",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "{{api_key}}",
                    "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": {
                  "raw": "{{api_url}}/{{api_prefix}}/envelopes/{{upload_envelope_id}}/presigned_uploads",
                  "host": [
                    "{{api_url}}"
                  ],
                  "path": [
                    "{{api_prefix}}",
                    "envelopes",
                    "{{upload_envelope_id}}",
                    "presigned_uploads"
                  ]
                },
                "description": "Safe. Reserves a presigned storage URL for large.pdf (about 1 MB, order 4). The URL is valid for 1 hour and the limit is 50 MB. Saves presigned_url_id and presigned_url (the next request clears presigned_url after use). Public docs: api/uploads.md.",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"file_name\": \"large.pdf\",\n  \"order\": 4,\n  \"custom_key\": \"fixture-large\",\n  \"content_type\": \"application/pdf\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"success\": true,\n  \"presigned_upload\": {\n    \"id\": \"00000000-0000-4000-8000-000000000064\",\n    \"presigned_url\": \"https://storage.example.invalid/sample/large.pdf?signature=redacted\",\n    \"file_name\": \"large.pdf\",\n    \"order\": 4,\n    \"custom_key\": \"fixture-large\",\n    \"content_type\": \"application/pdf\",\n    \"expires_at\": \"2026-01-15T13:00:00-03:00\",\n    \"max_file_size\": 52428800,\n    \"envelope_id\": \"00000000-0000-4000-8000-000000000005\",\n    \"status\": \"PENDING\",\n    \"instructions\": {\n      \"method\": \"PUT\",\n      \"headers\": {\n        \"Content-Type\": \"application/pdf\"\n      },\n      \"note\": \"Upload file directly to presigned_url using PUT method with Content-Type header\"\n    }\n  },\n  \"request_id\": \"00000000-0000-4000-8000-0000000000aa\"\n}"
            }
          ]
        },
        {
          "name": "Presigned large - 2. PUT large.pdf to storage (outbound, no API key)",
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const apiUrl = String(pm.variables.get('api_url') || '');",
                  "if (/^https?:\\/\\/(localhost|127\\.0\\.0\\.1)([:\\/]|$)/i.test(apiUrl)) {",
                  "    console.warn('Skipped storage PUT: the local dev server cannot complete a real storage upload.');",
                  "    pm.collectionVariables.set('storage_skipped', 'yes');",
                  "    pm.execution.skipRequest();",
                  "} else if (!pm.variables.get('presigned_url')) {",
                  "    console.warn('Skipped storage PUT: presigned_url is empty. Run the create request first.');",
                  "    pm.execution.skipRequest();",
                  "}"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Storage accepted the upload (200)', () => pm.response.to.have.status(200));",
                  "pm.test('No Authorization header was sent to the storage host', () => {",
                  "    pm.expect(pm.request.headers.has('Authorization')).to.be.false;",
                  "});",
                  "pm.test('Request auth is noauth', () => {",
                  "    pm.expect(!pm.request.auth || pm.request.auth.type === 'noauth').to.be.true;",
                  "});",
                  "pm.collectionVariables.unset('presigned_url');"
                ]
              }
            }
          ],
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/pdf"
              }
            ],
            "url": {
              "raw": "{{presigned_url}}",
              "host": [
                "{{presigned_url}}"
              ]
            },
            "description": "Safe for Lexgo data (draft only) but this is an OUTBOUND call to the storage host in presigned_url, not to the Sign API. It sends large.pdf (about 1 MB) as the raw body with Content-Type: application/pdf and deliberately NO Authorization header (the URL itself is the credential). Skipped when api_url points to localhost: the local dev server cannot complete a real storage upload. Requires the Postman working directory to contain fixtures/ (see README). Public docs: api/uploads.md.",
            "body": {
              "mode": "file",
              "file": {
                "src": "fixtures/large.pdf"
              }
            },
            "auth": {
              "type": "noauth"
            }
          },
          "response": [
            {
              "name": "200 OK (storage replies with an empty body)",
              "originalRequest": {
                "method": "PUT",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/pdf"
                  }
                ],
                "url": {
                  "raw": "{{presigned_url}}",
                  "host": [
                    "{{presigned_url}}"
                  ]
                },
                "description": "Safe for Lexgo data (draft only) but this is an OUTBOUND call to the storage host in presigned_url, not to the Sign API. It sends large.pdf (about 1 MB) as the raw body with Content-Type: application/pdf and deliberately NO Authorization header (the URL itself is the credential). Skipped when api_url points to localhost: the local dev server cannot complete a real storage upload. Requires the Postman working directory to contain fixtures/ (see README). Public docs: api/uploads.md.",
                "body": {
                  "mode": "file",
                  "file": {
                    "src": "fixtures/large.pdf"
                  }
                },
                "auth": {
                  "type": "noauth"
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "text",
              "header": [],
              "cookie": [],
              "body": ""
            }
          ]
        },
        {
          "name": "Presigned large - 3. get upload status",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = pm.response.json();",
                  "pm.test('Status is 200', () => pm.response.to.have.status(200));",
                  "pm.test('Presigned upload matches the saved id and has a valid status', () => {",
                  "    pm.expect(j.presigned_upload.id).to.eql(pm.variables.get('presigned_url_id'));",
                  "    pm.expect(j.presigned_upload.status).to.be.oneOf(['PENDING', 'UPLOADED', 'PROCESSING', 'COMPLETED', 'FAILED', 'EXPIRED']);",
                  "    pm.expect(j.presigned_upload.file_name).to.eql(\"large.pdf\");",
                  "});",
                  "pm.test('request_id is present', () => pm.expect(j.request_id).to.be.a('string').and.not.empty);"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "{{api_key}}",
                "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
              }
            ],
            "url": {
              "raw": "{{api_url}}/{{api_prefix}}/envelopes/{{upload_envelope_id}}/presigned_uploads/{{presigned_url_id}}",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "{{api_prefix}}",
                "envelopes",
                "{{upload_envelope_id}}",
                "presigned_uploads",
                "{{presigned_url_id}}"
              ]
            },
            "description": "Safe, read-only. PENDING until storage receives the file, then UPLOADED, PROCESSING and COMPLETED (file_id is set when COMPLETED). It stays PENDING if the storage PUT was skipped. Public docs: api/uploads.md."
          },
          "response": [
            {
              "name": "200 OK - pending",
              "originalRequest": {
                "method": "GET",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "{{api_key}}",
                    "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
                  }
                ],
                "url": {
                  "raw": "{{api_url}}/{{api_prefix}}/envelopes/{{upload_envelope_id}}/presigned_uploads/{{presigned_url_id}}",
                  "host": [
                    "{{api_url}}"
                  ],
                  "path": [
                    "{{api_prefix}}",
                    "envelopes",
                    "{{upload_envelope_id}}",
                    "presigned_uploads",
                    "{{presigned_url_id}}"
                  ]
                },
                "description": "Safe, read-only. PENDING until storage receives the file, then UPLOADED, PROCESSING and COMPLETED (file_id is set when COMPLETED). It stays PENDING if the storage PUT was skipped. Public docs: api/uploads.md."
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"presigned_upload\": {\n    \"id\": \"00000000-0000-4000-8000-000000000064\",\n    \"envelope_id\": \"00000000-0000-4000-8000-000000000005\",\n    \"status\": \"PENDING\",\n    \"order\": 4,\n    \"file_name\": \"large.pdf\",\n    \"content_type\": \"application/pdf\",\n    \"upload_url\": \"https://api.lexgo.cl/v1/uploads/00000000-0000-4000-8000-000000000064/stream\",\n    \"expires_at\": \"2026-01-15T13:00:00-03:00\",\n    \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n    \"updated_at\": \"2026-01-15T12:00:00.000-03:00\"\n  },\n  \"request_id\": \"00000000-0000-4000-8000-0000000000aa\"\n}"
            }
          ]
        },
        {
          "name": "List presigned uploads",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = pm.response.json();",
                  "pm.test('Status is 200', () => pm.response.to.have.status(200));",
                  "pm.test('Lists the small, medium and large uploads', () => {",
                  "    pm.expect(j.presigned_uploads).to.be.an('array');",
                  "    pm.expect(j.total).to.eql(j.presigned_uploads.length);",
                  "    const names = j.presigned_uploads.map((u) => u.file_name);",
                  "    ['small.pdf', 'medium.pdf', 'large.pdf'].forEach((n) => pm.expect(names).to.include(n));",
                  "});",
                  "pm.test('request_id is present', () => pm.expect(j.request_id).to.be.a('string').and.not.empty);"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "{{api_key}}",
                "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
              }
            ],
            "url": {
              "raw": "{{api_url}}/{{api_prefix}}/envelopes/{{upload_envelope_id}}/presigned_uploads",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "{{api_prefix}}",
                "envelopes",
                "{{upload_envelope_id}}",
                "presigned_uploads"
              ]
            },
            "description": "Safe, read-only. The list includes every upload record of the envelope. Optional `status` filter. Public docs: api/uploads.md."
          },
          "response": [
            {
              "name": "200 OK",
              "originalRequest": {
                "method": "GET",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "{{api_key}}",
                    "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
                  }
                ],
                "url": {
                  "raw": "{{api_url}}/{{api_prefix}}/envelopes/{{upload_envelope_id}}/presigned_uploads",
                  "host": [
                    "{{api_url}}"
                  ],
                  "path": [
                    "{{api_prefix}}",
                    "envelopes",
                    "{{upload_envelope_id}}",
                    "presigned_uploads"
                  ]
                },
                "description": "Safe, read-only. The list includes every upload record of the envelope. Optional `status` filter. Public docs: api/uploads.md."
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"presigned_uploads\": [\n    {\n      \"id\": \"00000000-0000-4000-8000-000000000064\",\n      \"envelope_id\": \"00000000-0000-4000-8000-000000000005\",\n      \"status\": \"PENDING\",\n      \"order\": 4,\n      \"file_name\": \"large.pdf\",\n      \"content_type\": \"application/pdf\",\n      \"upload_url\": \"https://api.lexgo.cl/v1/uploads/00000000-0000-4000-8000-000000000064/stream\",\n      \"expires_at\": \"2026-01-15T13:00:00-03:00\",\n      \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n      \"updated_at\": \"2026-01-15T12:00:00.000-03:00\"\n    },\n    {\n      \"id\": \"00000000-0000-4000-8000-000000000063\",\n      \"envelope_id\": \"00000000-0000-4000-8000-000000000005\",\n      \"status\": \"PENDING\",\n      \"order\": 3,\n      \"file_name\": \"medium.pdf\",\n      \"content_type\": \"application/pdf\",\n      \"upload_url\": \"https://api.lexgo.cl/v1/uploads/00000000-0000-4000-8000-000000000063/stream\",\n      \"expires_at\": \"2026-01-15T13:00:00-03:00\",\n      \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n      \"updated_at\": \"2026-01-15T12:00:00.000-03:00\"\n    },\n    {\n      \"id\": \"00000000-0000-4000-8000-000000000062\",\n      \"envelope_id\": \"00000000-0000-4000-8000-000000000005\",\n      \"status\": \"PENDING\",\n      \"order\": 2,\n      \"file_name\": \"small.pdf\",\n      \"content_type\": \"application/pdf\",\n      \"upload_url\": \"https://api.lexgo.cl/v1/uploads/00000000-0000-4000-8000-000000000062/stream\",\n      \"expires_at\": \"2026-01-15T13:00:00-03:00\",\n      \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n      \"updated_at\": \"2026-01-15T12:00:00.000-03:00\"\n    },\n    {\n      \"id\": \"00000000-0000-4000-8000-000000000061\",\n      \"envelope_id\": \"00000000-0000-4000-8000-000000000005\",\n      \"status\": \"PENDING\",\n      \"order\": 1,\n      \"file_name\": \"small.pdf\",\n      \"content_type\": \"application/pdf\",\n      \"upload_url\": \"https://api.lexgo.cl/v1/uploads/00000000-0000-4000-8000-000000000061/stream\",\n      \"expires_at\": \"2026-01-15T13:00:00-03:00\",\n      \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n      \"updated_at\": \"2026-01-15T12:00:00.000-03:00\"\n    }\n  ],\n  \"total\": 4,\n  \"request_id\": \"00000000-0000-4000-8000-0000000000aa\"\n}"
            }
          ]
        },
        {
          "name": "Wait for uploads to complete",
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (pm.variables.get('storage_skipped') === 'yes') {",
                  "    console.warn('Skipped upload completion poll: the PUTs were skipped (storage_skipped is yes).');",
                  "    pm.collectionVariables.set('upload_poll_attempts', '');",
                  "    pm.execution.skipRequest();",
                  "} else if ((Number(pm.variables.get('upload_poll_attempts')) || 0) > 0) {",
                  "    // Short pause between attempts; never longer than 3 seconds.",
                  "    const delay = Math.min(Number(pm.variables.get('upload_poll_delay_ms')) || 3000, 3000);",
                  "    setTimeout(() => {}, delay);",
                  "}"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "// Bounded polling: this request repeats itself (Collection Runner and newman only) until the asynchronous worker has",
                  "// processed every upload, or until the attempt cap is reached. In a manual single Send, press Send again.",
                  "const EXPECTED_DOCUMENTS = 4;      // base document + one per upload",
                  "const EXPECTED_PLACEMENTS = 4;     // one per document",
                  "const EXPECTED_UPLOADS = 3;        // one per uploaded file",
                  "const UPLOAD_POLL_MAX = Math.min(Number(pm.variables.get('upload_poll_max')) || 40, 100);",
                  "const attempt = (Number(pm.variables.get('upload_poll_attempts')) || 0) + 1;",
                  "pm.collectionVariables.set('upload_poll_attempts', String(attempt));",
                  "let j = {};",
                  "try { j = pm.response.json(); } catch (e) { j = {}; }",
                  "const envelope = j.envelope || {};",
                  "const documents = Array.isArray(envelope.documents) ? envelope.documents : [];",
                  "const placements = Array.isArray(envelope.placements) ? envelope.placements : [];",
                  "const finish = () => { pm.collectionVariables.set('upload_poll_attempts', ''); };",
                  "",
                  "pm.test('Envelope was read (200)', () => pm.response.to.have.status(200));",
                  "",
                  "const evaluate = (listError, uploads) => {",
                  "    const bad = uploads.filter((u) => u.status === 'FAILED' || u.status === 'EXPIRED');",
                  "    const unfinished = uploads.filter((u) => ['PENDING', 'UPLOADED', 'PROCESSING'].indexOf(u.status) !== -1);",
                  "    // Every collection is checked for its LENGTH first; every() is only used on a collection of the expected size.",
                  "    const documentsOk = documents.length === EXPECTED_DOCUMENTS;",
                  "    const placementsOk = placements.length === EXPECTED_PLACEMENTS && placements.every((p) => !!p.document_id);",
                  "    const uploadsOk = uploads.length === EXPECTED_UPLOADS && uploads.every((u) => u.status === 'COMPLETED');",
                  "    const envelopeOk = envelope.status === 'CREATED' && Array.isArray(envelope.errors) && envelope.errors.length === 0;",
                  "",
                  "    if (bad.length > 0) {",
                  "        finish();",
                  "        pm.test('No upload FAILED or EXPIRED', () => pm.expect.fail('Upload failed or expired: ' + bad.map((u) => (u.custom_key || u.file_name) + '=' + u.status + (u.error_message ? ' (' + u.error_message + ')' : '')).join(', ')));",
                  "        return;",
                  "    }",
                  "    if (documentsOk && placementsOk && uploadsOk && envelopeOk) {",
                  "        finish();",
                  "        pm.test('Envelope is CREATED without errors', () => {",
                  "            pm.expect(envelope.status).to.eql('CREATED');",
                  "            pm.expect(envelope.errors).to.have.lengthOf(0);",
                  "        });",
                  "        pm.test('4 documents', () => pm.expect(documents).to.have.lengthOf(EXPECTED_DOCUMENTS));",
                  "        pm.test('4 placements, each linked to a document', () => {",
                  "            pm.expect(placements).to.have.lengthOf(EXPECTED_PLACEMENTS);",
                  "            placements.forEach((p) => pm.expect(p.document_id, 'placement ' + p.custom_key).to.be.a('string').and.not.empty);",
                  "        });",
                  "        pm.test('Each uploaded file is linked to the placement with the same key', () => {",
                  "            ['fixture-small', 'fixture-medium', 'fixture-large'].forEach((key) => {",
                  "                const doc = documents.find((d) => d.custom_key === key);",
                  "                const placement = placements.find((p) => p.document_key === key);",
                  "                pm.expect(doc, 'document ' + key).to.be.an('object');",
                  "                pm.expect(placement.document_id, 'placement ' + key).to.eql(doc.id);",
                  "            });",
                  "        });",
                  "        pm.test('3 uploads COMPLETED', () => {",
                  "            pm.expect(uploads).to.have.lengthOf(EXPECTED_UPLOADS);",
                  "            uploads.forEach((u) => pm.expect(u.status, u.custom_key || u.file_name).to.eql('COMPLETED'));",
                  "        });",
                  "        return;",
                  "    }",
                  "    if (attempt < UPLOAD_POLL_MAX) {",
                  "        console.log('Uploads not complete yet (attempt ' + attempt + ' of ' + UPLOAD_POLL_MAX + '): documents ' + documents.length + '/' + EXPECTED_DOCUMENTS +",
                  "            ', placements ' + placements.length + '/' + EXPECTED_PLACEMENTS + ', uploads ' + uploads.length + '/' + EXPECTED_UPLOADS);",
                  "        pm.execution.setNextRequest(pm.info.requestName);",
                  "        return;",
                  "    }",
                  "    finish();",
                  "    const counts = 'documents ' + documents.length + '/' + EXPECTED_DOCUMENTS + ', placements ' + placements.length + '/' + EXPECTED_PLACEMENTS +",
                  "        ' (unlinked ' + placements.filter((p) => !p.document_id).length + '), uploads ' + uploads.length + '/' + EXPECTED_UPLOADS;",
                  "    let reason;",
                  "    if (listError) {",
                  "        reason = 'Could not read the presigned uploads list: ' + listError;",
                  "    } else if (unfinished.length > 0) {",
                  "        reason = 'Timeout after ' + attempt + ' attempts: uploads still ' + unfinished.map((u) => (u.custom_key || u.file_name) + '=' + u.status).join(', ') +",
                  "            ' (a PUT did not happen or the worker is not done)';",
                  "    } else {",
                  "        reason = 'Uploads are done or absent but the relationships are missing after ' + attempt + ' attempts: ' + counts;",
                  "    }",
                  "    pm.test('Uploads completed and linked to their placements', () => pm.expect.fail(reason + '. Counts: ' + counts));",
                  "};",
                  "",
                  "pm.sendRequest({",
                  "    url: pm.variables.get('api_url') + '/' + pm.variables.get('api_prefix') + '/envelopes/' + pm.variables.get('upload_envelope_id') + '/presigned_uploads',",
                  "    method: 'GET',",
                  "    header: { Authorization: pm.variables.get('api_key') }",
                  "}, (error, response) => {",
                  "    let uploads = [];",
                  "    let listError = error ? String(error.message || error) : null;",
                  "    if (!error) {",
                  "        try { uploads = response.json().presigned_uploads; } catch (e) { listError = 'presigned uploads list is not JSON'; }",
                  "        if (!Array.isArray(uploads)) { uploads = []; }",
                  "    }",
                  "    evaluate(listError, uploads);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "{{api_key}}",
                "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
              }
            ],
            "url": {
              "raw": "{{api_url}}/{{api_prefix}}/envelopes/{{upload_envelope_id}}",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "{{api_prefix}}",
                "envelopes",
                "{{upload_envelope_id}}"
              ]
            },
            "description": "Safe, read-only. Waits for the asynchronous worker: it reads the draft and its presigned uploads (GET .../presigned_uploads), and repeats itself (up to upload_poll_max attempts, 40 by default, about 3 seconds apart) until the draft is CREATED without errors, has 4 documents and 4 placements that are all linked, and all 3 uploads (small, medium, large) are COMPLETED. It fails at once if an upload is FAILED or EXPIRED, and on the last attempt it says whether uploads are still PENDING or UPLOADED (a PUT or the worker did not finish) or relationships are missing. Skipped when the PUTs were skipped (storage_skipped is yes). The repeat only happens in the Collection Runner and newman; in a manual Send, press Send again. Public docs: api/uploads.md."
          },
          "response": [
            {
              "name": "200 OK - draft complete (the presigned uploads list is read with a second request)",
              "originalRequest": {
                "method": "GET",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "{{api_key}}",
                    "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
                  }
                ],
                "url": {
                  "raw": "{{api_url}}/{{api_prefix}}/envelopes/{{upload_envelope_id}}",
                  "host": [
                    "{{api_url}}"
                  ],
                  "path": [
                    "{{api_prefix}}",
                    "envelopes",
                    "{{upload_envelope_id}}"
                  ]
                },
                "description": "Safe, read-only. Waits for the asynchronous worker: it reads the draft and its presigned uploads (GET .../presigned_uploads), and repeats itself (up to upload_poll_max attempts, 40 by default, about 3 seconds apart) until the draft is CREATED without errors, has 4 documents and 4 placements that are all linked, and all 3 uploads (small, medium, large) are COMPLETED. It fails at once if an upload is FAILED or EXPIRED, and on the last attempt it says whether uploads are still PENDING or UPLOADED (a PUT or the worker did not finish) or relationships are missing. Skipped when the PUTs were skipped (storage_skipped is yes). The repeat only happens in the Collection Runner and newman; in a manual Send, press Send again. Public docs: api/uploads.md."
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"envelope\": {\n    \"id\": \"00000000-0000-4000-8000-000000000005\",\n    \"name\": \"Postman uploads draft (fictional)\",\n    \"status\": \"CREATED\",\n    \"errors\": [],\n    \"warnings\": [],\n    \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n    \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n    \"evidence_document_url\": null,\n    \"error_reason\": null,\n    \"evidence_generated_at\": null,\n    \"documents\": [\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000011\",\n        \"custom_key\": \"0\",\n        \"file_type\": \"ORIGINAL\",\n        \"order\": 0,\n        \"status\": \"CREATED\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"file_name\": \"base-document.pdf\",\n        \"content_type\": \"application/pdf\",\n        \"file_size\": 1150,\n        \"page_count\": 1,\n        \"url\": \"https://storage.example.invalid/sample/contract-main.pdf?signature=redacted\"\n      },\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000030\",\n        \"custom_key\": \"fixture-small\",\n        \"file_type\": \"ORIGINAL\",\n        \"order\": 1,\n        \"status\": \"CREATED\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"file_name\": \"small.pdf\",\n        \"content_type\": \"application/pdf\",\n        \"file_size\": 1150,\n        \"page_count\": 1,\n        \"url\": \"https://storage.example.invalid/sample/small.pdf?signature=redacted\"\n      },\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000031\",\n        \"custom_key\": \"fixture-medium\",\n        \"file_type\": \"ORIGINAL\",\n        \"order\": 2,\n        \"status\": \"CREATED\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"file_name\": \"medium.pdf\",\n        \"content_type\": \"application/pdf\",\n        \"file_size\": 1150,\n        \"page_count\": 1,\n        \"url\": \"https://storage.example.invalid/sample/medium.pdf?signature=redacted\"\n      },\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000032\",\n        \"custom_key\": \"fixture-large\",\n        \"file_type\": \"ORIGINAL\",\n        \"order\": 3,\n        \"status\": \"CREATED\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"file_name\": \"large.pdf\",\n        \"content_type\": \"application/pdf\",\n        \"file_size\": 1150,\n        \"page_count\": 1,\n        \"url\": \"https://storage.example.invalid/sample/large.pdf?signature=redacted\"\n      }\n    ],\n    \"recipients\": [\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000002\",\n        \"custom_key\": \"signer\",\n        \"order\": 1,\n        \"status\": \"CREATED\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"name\": \"Ana Signer\",\n        \"name_label\": \"Name:\",\n        \"email\": \"signer@example.com\",\n        \"email_label\": \"Email:\"\n      }\n    ],\n    \"placements\": [\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000041\",\n        \"custom_key\": \"p0\",\n        \"placement_type\": \"SIGNATURE\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"recipient_id\": \"00000000-0000-4000-8000-000000000002\",\n        \"recipient_key\": \"signer\",\n        \"document_id\": \"00000000-0000-4000-8000-000000000011\",\n        \"document_key\": \"0\",\n        \"order\": 0,\n        \"coordinates\": {\n          \"id\": \"Lexgo-Sign-0\",\n          \"top\": 650,\n          \"left\": 100,\n          \"page\": 0\n        },\n        \"token\": null\n      },\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000042\",\n        \"custom_key\": \"p1\",\n        \"placement_type\": \"SIGNATURE\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"recipient_id\": \"00000000-0000-4000-8000-000000000002\",\n        \"recipient_key\": \"signer\",\n        \"document_id\": \"00000000-0000-4000-8000-000000000030\",\n        \"document_key\": \"fixture-small\",\n        \"order\": 1,\n        \"coordinates\": {\n          \"id\": \"Lexgo-Sign-1\",\n          \"page\": 0,\n          \"top\": 550,\n          \"left\": 100\n        },\n        \"token\": null\n      },\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000043\",\n        \"custom_key\": \"p2\",\n        \"placement_type\": \"SIGNATURE\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"recipient_id\": \"00000000-0000-4000-8000-000000000002\",\n        \"recipient_key\": \"signer\",\n        \"document_id\": \"00000000-0000-4000-8000-000000000031\",\n        \"document_key\": \"fixture-medium\",\n        \"order\": 2,\n        \"coordinates\": {\n          \"id\": \"Lexgo-Sign-2\",\n          \"page\": 0,\n          \"top\": 500,\n          \"left\": 100\n        },\n        \"token\": null\n      },\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000044\",\n        \"custom_key\": \"p3\",\n        \"placement_type\": \"SIGNATURE\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"recipient_id\": \"00000000-0000-4000-8000-000000000002\",\n        \"recipient_key\": \"signer\",\n        \"document_id\": \"00000000-0000-4000-8000-000000000032\",\n        \"document_key\": \"fixture-large\",\n        \"order\": 3,\n        \"coordinates\": {\n          \"id\": \"Lexgo-Sign-3\",\n          \"page\": 0,\n          \"top\": 450,\n          \"left\": 100\n        },\n        \"token\": null\n      }\n    ],\n    \"settings\": {\n      \"emails\": {\n        \"envelope_invitation\": \"TRUE\",\n        \"envelope_voided\": \"TRUE\",\n        \"envelope_rejected\": \"TRUE\",\n        \"envelope_signed\": \"TRUE\"\n      },\n      \"documents\": {\n        \"include_page_id\": \"TRUE\",\n        \"custom_page_id\": \"Lexgo Sign ID:\",\n        \"signatures_per_page\": 4,\n        \"signatures_per_row\": 1\n      },\n      \"signature_flow\": {\n        \"language\": \"EN\",\n        \"signature_order\": \"SEQUENTIAL\",\n        \"signature_types\": \"WRITTEN, DRAWN, UPLOADED\",\n        \"signature_color\": \"#000000\",\n        \"sender_name\": \"Fixture Sender\",\n        \"sender_enterprise\": null\n      },\n      \"signature\": {\n        \"style\": \"SIMPLE\",\n        \"type\": \"INTERNATIONAL\",\n        \"image\": \"DEFAULT\",\n        \"text\": \"DEFAULT\",\n        \"bg_image\": \"DEFAULT\",\n        \"bg_image_scope\": \"QUALIFIED_CHILE\"\n      },\n      \"validations\": {\n        \"email\": {\n          \"order\": 0,\n          \"enabled\": \"FALSE\"\n        },\n        \"phone\": {\n          \"order\": 1,\n          \"enabled\": \"FALSE\",\n          \"methods\": \"SMS\"\n        },\n        \"id_check\": {\n          \"order\": 2,\n          \"enabled\": \"FALSE\"\n        },\n        \"biometric\": {\n          \"order\": 3,\n          \"enabled\": \"FALSE\"\n        }\n      }\n    },\n    \"metadata\": {}\n  },\n  \"request_id\": \"00000000-0000-4000-8000-0000000000aa\"\n}"
            },
            {
              "name": "200 OK - uploads still pending (the request repeats)",
              "originalRequest": {
                "method": "GET",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "{{api_key}}",
                    "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
                  }
                ],
                "url": {
                  "raw": "{{api_url}}/{{api_prefix}}/envelopes/{{upload_envelope_id}}",
                  "host": [
                    "{{api_url}}"
                  ],
                  "path": [
                    "{{api_prefix}}",
                    "envelopes",
                    "{{upload_envelope_id}}"
                  ]
                },
                "description": "Safe, read-only. Waits for the asynchronous worker: it reads the draft and its presigned uploads (GET .../presigned_uploads), and repeats itself (up to upload_poll_max attempts, 40 by default, about 3 seconds apart) until the draft is CREATED without errors, has 4 documents and 4 placements that are all linked, and all 3 uploads (small, medium, large) are COMPLETED. It fails at once if an upload is FAILED or EXPIRED, and on the last attempt it says whether uploads are still PENDING or UPLOADED (a PUT or the worker did not finish) or relationships are missing. Skipped when the PUTs were skipped (storage_skipped is yes). The repeat only happens in the Collection Runner and newman; in a manual Send, press Send again. Public docs: api/uploads.md."
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"envelope\": {\n    \"id\": \"00000000-0000-4000-8000-000000000005\",\n    \"name\": \"Postman uploads draft (fictional)\",\n    \"status\": \"ERROR\",\n    \"errors\": [\n      \"The placement '00000000-0000-4000-8000-000000000042' does not point to a valid document.\",\n      \"The placement '00000000-0000-4000-8000-000000000043' does not point to a valid document.\",\n      \"The placement '00000000-0000-4000-8000-000000000044' does not point to a valid document.\"\n    ],\n    \"warnings\": [],\n    \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n    \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n    \"evidence_document_url\": null,\n    \"error_reason\": null,\n    \"evidence_generated_at\": null,\n    \"documents\": [\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000011\",\n        \"custom_key\": \"0\",\n        \"file_type\": \"ORIGINAL\",\n        \"order\": 0,\n        \"status\": \"CREATED\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"file_name\": \"base-document.pdf\",\n        \"content_type\": \"application/pdf\",\n        \"file_size\": 1150,\n        \"page_count\": 1,\n        \"url\": \"https://storage.example.invalid/sample/contract-main.pdf?signature=redacted\"\n      }\n    ],\n    \"recipients\": [\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000002\",\n        \"custom_key\": \"signer\",\n        \"order\": 1,\n        \"status\": \"CREATED\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"name\": \"Ana Signer\",\n        \"name_label\": \"Name:\",\n        \"email\": \"signer@example.com\",\n        \"email_label\": \"Email:\"\n      }\n    ],\n    \"placements\": [\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000041\",\n        \"custom_key\": \"p0\",\n        \"placement_type\": \"SIGNATURE\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"recipient_id\": \"00000000-0000-4000-8000-000000000002\",\n        \"recipient_key\": \"signer\",\n        \"document_id\": \"00000000-0000-4000-8000-000000000011\",\n        \"document_key\": \"0\",\n        \"order\": 0,\n        \"coordinates\": {\n          \"id\": \"Lexgo-Sign-0\",\n          \"top\": 650,\n          \"left\": 100,\n          \"page\": 0\n        },\n        \"token\": null\n      },\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000042\",\n        \"custom_key\": \"p1\",\n        \"placement_type\": \"SIGNATURE\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"recipient_id\": \"00000000-0000-4000-8000-000000000002\",\n        \"recipient_key\": \"signer\",\n        \"document_id\": null,\n        \"document_key\": \"fixture-small\",\n        \"order\": 1,\n        \"coordinates\": {\n          \"id\": \"Lexgo-Sign-1\",\n          \"page\": 0,\n          \"top\": 550,\n          \"left\": 100\n        },\n        \"token\": null\n      },\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000043\",\n        \"custom_key\": \"p2\",\n        \"placement_type\": \"SIGNATURE\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"recipient_id\": \"00000000-0000-4000-8000-000000000002\",\n        \"recipient_key\": \"signer\",\n        \"document_id\": null,\n        \"document_key\": \"fixture-medium\",\n        \"order\": 2,\n        \"coordinates\": {\n          \"id\": \"Lexgo-Sign-2\",\n          \"page\": 0,\n          \"top\": 500,\n          \"left\": 100\n        },\n        \"token\": null\n      },\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000044\",\n        \"custom_key\": \"p3\",\n        \"placement_type\": \"SIGNATURE\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"recipient_id\": \"00000000-0000-4000-8000-000000000002\",\n        \"recipient_key\": \"signer\",\n        \"document_id\": null,\n        \"document_key\": \"fixture-large\",\n        \"order\": 3,\n        \"coordinates\": {\n          \"id\": \"Lexgo-Sign-3\",\n          \"page\": 0,\n          \"top\": 450,\n          \"left\": 100\n        },\n        \"token\": null\n      }\n    ],\n    \"settings\": {\n      \"emails\": {\n        \"envelope_invitation\": \"TRUE\",\n        \"envelope_voided\": \"TRUE\",\n        \"envelope_rejected\": \"TRUE\",\n        \"envelope_signed\": \"TRUE\"\n      },\n      \"documents\": {\n        \"include_page_id\": \"TRUE\",\n        \"custom_page_id\": \"Lexgo Sign ID:\",\n        \"signatures_per_page\": 4,\n        \"signatures_per_row\": 1\n      },\n      \"signature_flow\": {\n        \"language\": \"EN\",\n        \"signature_order\": \"SEQUENTIAL\",\n        \"signature_types\": \"WRITTEN, DRAWN, UPLOADED\",\n        \"signature_color\": \"#000000\",\n        \"sender_name\": \"Fixture Sender\",\n        \"sender_enterprise\": null\n      },\n      \"signature\": {\n        \"style\": \"SIMPLE\",\n        \"type\": \"INTERNATIONAL\",\n        \"image\": \"DEFAULT\",\n        \"text\": \"DEFAULT\",\n        \"bg_image\": \"DEFAULT\",\n        \"bg_image_scope\": \"QUALIFIED_CHILE\"\n      },\n      \"validations\": {\n        \"email\": {\n          \"order\": 0,\n          \"enabled\": \"FALSE\"\n        },\n        \"phone\": {\n          \"order\": 1,\n          \"enabled\": \"FALSE\",\n          \"methods\": \"SMS\"\n        },\n        \"id_check\": {\n          \"order\": 2,\n          \"enabled\": \"FALSE\"\n        },\n        \"biometric\": {\n          \"order\": 3,\n          \"enabled\": \"FALSE\"\n        }\n      }\n    },\n    \"metadata\": {}\n  },\n  \"request_id\": \"00000000-0000-4000-8000-0000000000aa\"\n}"
            }
          ]
        },
        {
          "name": "Create draft with no files (1 signer, 0 files)",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = pm.response.json();",
                  "pm.test('Status is 422: a draft without files is stored with status ERROR until files arrive', () => pm.response.to.have.status(422));",
                  "pm.test('Envelope has no documents and explains why', () => {",
                  "    pm.expect(j.envelope.status).to.eql('ERROR');",
                  "    pm.expect(j.envelope.documents).to.have.lengthOf(0);",
                  "    pm.expect(j.envelope.errors.join(' ')).to.include('no PDF files');",
                  "});",
                  "pm.test('Recipient and placement were stored', () => {",
                  "    pm.expect(j.envelope.recipients).to.have.lengthOf(1);",
                  "    pm.expect(j.envelope.placements).to.have.lengthOf(1);",
                  "});",
                  "pm.test('request_id is present', () => pm.expect(j.request_id).to.be.a('string').and.not.empty);",
                  "pm.collectionVariables.set('zero_envelope_id', j.envelope.id);"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "{{api_key}}",
                "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{api_url}}/{{api_prefix}}/envelopes",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "{{api_prefix}}",
                "envelopes"
              ]
            },
            "description": "Safe. Creates a draft with a recipient and a placement but no documents, to be filled by presigned uploads. The API answers 422 with status ERROR (no PDF files yet), yet the draft accepts presigned upload slots. Saves zero_envelope_id. Public docs: api/uploads.md.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Postman draft without files (fictional)\",\n  \"recipients\": {\n    \"signer\": {\n      \"name\": \"Ana Signer\",\n      \"email\": \"{{fixture_signer_email}}\",\n      \"order\": 1\n    }\n  },\n  \"placements\": {\n    \"0\": {\n      \"type\": \"SIGNATURE\",\n      \"recipient_key\": \"signer\",\n      \"document_key\": \"fixture-later\",\n      \"order\": 0,\n      \"coordinates\": {\n        \"page\": 0,\n        \"top\": 100,\n        \"left\": 40\n      }\n    }\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [
            {
              "name": "422 - draft stored with status ERROR (no files yet)",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "{{api_key}}",
                    "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": {
                  "raw": "{{api_url}}/{{api_prefix}}/envelopes",
                  "host": [
                    "{{api_url}}"
                  ],
                  "path": [
                    "{{api_prefix}}",
                    "envelopes"
                  ]
                },
                "description": "Safe. Creates a draft with a recipient and a placement but no documents, to be filled by presigned uploads. The API answers 422 with status ERROR (no PDF files yet), yet the draft accepts presigned upload slots. Saves zero_envelope_id. Public docs: api/uploads.md.",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"name\": \"Postman draft without files (fictional)\",\n  \"recipients\": {\n    \"signer\": {\n      \"name\": \"Ana Signer\",\n      \"email\": \"{{fixture_signer_email}}\",\n      \"order\": 1\n    }\n  },\n  \"placements\": {\n    \"0\": {\n      \"type\": \"SIGNATURE\",\n      \"recipient_key\": \"signer\",\n      \"document_key\": \"fixture-later\",\n      \"order\": 0,\n      \"coordinates\": {\n        \"page\": 0,\n        \"top\": 100,\n        \"left\": 40\n      }\n    }\n  }\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "Unprocessable Content",
              "code": 422,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"envelope\": {\n    \"id\": \"00000000-0000-4000-8000-000000000007\",\n    \"name\": \"Postman draft without files (fictional)\",\n    \"status\": \"ERROR\",\n    \"errors\": [\n      \"There are no PDF files present to sign. Please include documents, recipients and placements in order to sign.\",\n      \"The placement '00000000-0000-4000-8000-000000000041' does not point to a valid document.\"\n    ],\n    \"warnings\": [],\n    \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n    \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n    \"evidence_document_url\": null,\n    \"error_reason\": null,\n    \"evidence_generated_at\": null,\n    \"documents\": [],\n    \"recipients\": [\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000002\",\n        \"custom_key\": \"signer\",\n        \"order\": 1,\n        \"status\": \"CREATED\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"name\": \"Ana Signer\",\n        \"name_label\": \"Name:\",\n        \"email\": \"signer@example.com\",\n        \"email_label\": \"Email:\"\n      }\n    ],\n    \"placements\": [\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000041\",\n        \"custom_key\": \"0\",\n        \"placement_type\": \"SIGNATURE\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"recipient_id\": \"00000000-0000-4000-8000-000000000002\",\n        \"recipient_key\": \"signer\",\n        \"document_id\": null,\n        \"document_key\": \"fixture-later\",\n        \"order\": 0,\n        \"coordinates\": {\n          \"id\": \"Lexgo-Sign-0\",\n          \"page\": 0,\n          \"top\": 100,\n          \"left\": 40\n        },\n        \"token\": null\n      }\n    ],\n    \"settings\": {\n      \"emails\": {\n        \"envelope_invitation\": \"TRUE\",\n        \"envelope_voided\": \"TRUE\",\n        \"envelope_rejected\": \"TRUE\",\n        \"envelope_signed\": \"TRUE\"\n      },\n      \"documents\": {\n        \"include_page_id\": \"TRUE\",\n        \"custom_page_id\": \"Lexgo Sign ID:\",\n        \"signatures_per_page\": 4,\n        \"signatures_per_row\": 1\n      },\n      \"signature_flow\": {\n        \"language\": \"EN\",\n        \"signature_order\": \"SEQUENTIAL\",\n        \"signature_types\": \"WRITTEN, DRAWN, UPLOADED\",\n        \"signature_color\": \"#000000\",\n        \"sender_name\": \"Fixture Sender\",\n        \"sender_enterprise\": null\n      },\n      \"signature\": {\n        \"style\": \"SIMPLE\",\n        \"type\": \"INTERNATIONAL\",\n        \"image\": \"DEFAULT\",\n        \"text\": \"DEFAULT\",\n        \"bg_image\": \"DEFAULT\",\n        \"bg_image_scope\": \"QUALIFIED_CHILE\"\n      },\n      \"validations\": {\n        \"email\": {\n          \"order\": 0,\n          \"enabled\": \"FALSE\"\n        },\n        \"phone\": {\n          \"order\": 1,\n          \"enabled\": \"FALSE\",\n          \"methods\": \"SMS\"\n        },\n        \"id_check\": {\n          \"order\": 2,\n          \"enabled\": \"FALSE\"\n        },\n        \"biometric\": {\n          \"order\": 3,\n          \"enabled\": \"FALSE\"\n        }\n      }\n    },\n    \"metadata\": {}\n  },\n  \"request_id\": \"00000000-0000-4000-8000-0000000000aa\"\n}"
            }
          ]
        },
        {
          "name": "Presigned (no-file draft) - 1. create with custom_key",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = pm.response.json();",
                  "pm.test('Status is 200', () => pm.response.to.have.status(200));",
                  "pm.test('Slot keeps file_name, order and custom_key', () => {",
                  "    pm.expect(j.success).to.eql(true);",
                  "    pm.expect(j.presigned_upload.file_name).to.eql('uploaded-later.pdf');",
                  "    pm.expect(j.presigned_upload.order).to.eql(0);",
                  "    pm.expect(j.presigned_upload.custom_key).to.eql('fixture-later');",
                  "    pm.expect(j.presigned_upload.status).to.eql('PENDING');",
                  "});",
                  "pm.test('request_id is present', () => pm.expect(j.request_id).to.be.a('string').and.not.empty);",
                  "pm.collectionVariables.set('presigned_url_id', j.presigned_upload.id);",
                  "pm.collectionVariables.set('presigned_url', j.presigned_upload.presigned_url);"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "{{api_key}}",
                "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{api_url}}/{{api_prefix}}/envelopes/{{zero_envelope_id}}/presigned_uploads",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "{{api_prefix}}",
                "envelopes",
                "{{zero_envelope_id}}",
                "presigned_uploads"
              ]
            },
            "description": "Safe. Reserves a presigned slot with file_name, order and custom_key `fixture-later` (the placement's document_key) on the draft that has no files. The storage PUT is the same as in the walkthrough above and is not repeated here. Public docs: api/uploads.md.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"file_name\": \"uploaded-later.pdf\",\n  \"order\": 0,\n  \"custom_key\": \"fixture-later\",\n  \"content_type\": \"application/pdf\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [
            {
              "name": "200 OK",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "{{api_key}}",
                    "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": {
                  "raw": "{{api_url}}/{{api_prefix}}/envelopes/{{zero_envelope_id}}/presigned_uploads",
                  "host": [
                    "{{api_url}}"
                  ],
                  "path": [
                    "{{api_prefix}}",
                    "envelopes",
                    "{{zero_envelope_id}}",
                    "presigned_uploads"
                  ]
                },
                "description": "Safe. Reserves a presigned slot with file_name, order and custom_key `fixture-later` (the placement's document_key) on the draft that has no files. The storage PUT is the same as in the walkthrough above and is not repeated here. Public docs: api/uploads.md.",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"file_name\": \"uploaded-later.pdf\",\n  \"order\": 0,\n  \"custom_key\": \"fixture-later\",\n  \"content_type\": \"application/pdf\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"success\": true,\n  \"presigned_upload\": {\n    \"id\": \"00000000-0000-4000-8000-000000000067\",\n    \"presigned_url\": \"https://storage.example.invalid/sample/uploaded-later.pdf?signature=redacted\",\n    \"file_name\": \"uploaded-later.pdf\",\n    \"order\": 0,\n    \"custom_key\": \"fixture-later\",\n    \"content_type\": \"application/pdf\",\n    \"expires_at\": \"2026-01-15T13:00:00-03:00\",\n    \"max_file_size\": 52428800,\n    \"envelope_id\": \"00000000-0000-4000-8000-000000000005\",\n    \"status\": \"PENDING\",\n    \"instructions\": {\n      \"method\": \"PUT\",\n      \"headers\": {\n        \"Content-Type\": \"application/pdf\"\n      },\n      \"note\": \"Upload file directly to presigned_url using PUT method with Content-Type header\"\n    }\n  },\n  \"request_id\": \"00000000-0000-4000-8000-0000000000aa\"\n}"
            }
          ]
        },
        {
          "name": "Presigned (no-file draft) - 2. get upload status",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = pm.response.json();",
                  "pm.test('Status is 200', () => pm.response.to.have.status(200));",
                  "pm.test('Slot is pending and keeps its custom_key', () => {",
                  "    pm.expect(j.presigned_upload.id).to.eql(pm.variables.get('presigned_url_id'));",
                  "    pm.expect(j.presigned_upload.status).to.eql('PENDING');",
                  "    pm.expect(j.presigned_upload.custom_key).to.eql('fixture-later');",
                  "});",
                  "pm.test('request_id is present', () => pm.expect(j.request_id).to.be.a('string').and.not.empty);",
                  "pm.collectionVariables.unset('presigned_url');"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "{{api_key}}",
                "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
              }
            ],
            "url": {
              "raw": "{{api_url}}/{{api_prefix}}/envelopes/{{zero_envelope_id}}/presigned_uploads/{{presigned_url_id}}",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "{{api_prefix}}",
                "envelopes",
                "{{zero_envelope_id}}",
                "presigned_uploads",
                "{{presigned_url_id}}"
              ]
            },
            "description": "Safe, read-only. Clears presigned_url because the URL was not used. Public docs: api/uploads.md."
          },
          "response": [
            {
              "name": "200 OK",
              "originalRequest": {
                "method": "GET",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "{{api_key}}",
                    "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
                  }
                ],
                "url": {
                  "raw": "{{api_url}}/{{api_prefix}}/envelopes/{{zero_envelope_id}}/presigned_uploads/{{presigned_url_id}}",
                  "host": [
                    "{{api_url}}"
                  ],
                  "path": [
                    "{{api_prefix}}",
                    "envelopes",
                    "{{zero_envelope_id}}",
                    "presigned_uploads",
                    "{{presigned_url_id}}"
                  ]
                },
                "description": "Safe, read-only. Clears presigned_url because the URL was not used. Public docs: api/uploads.md."
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"presigned_upload\": {\n    \"id\": \"00000000-0000-4000-8000-000000000067\",\n    \"envelope_id\": \"00000000-0000-4000-8000-000000000005\",\n    \"status\": \"PENDING\",\n    \"order\": 0,\n    \"file_name\": \"uploaded-later.pdf\",\n    \"content_type\": \"application/pdf\",\n    \"upload_url\": \"https://api.lexgo.cl/v1/uploads/00000000-0000-4000-8000-000000000067/stream\",\n    \"expires_at\": \"2026-01-15T13:00:00-03:00\",\n    \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n    \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n    \"custom_key\": \"fixture-later\"\n  },\n  \"request_id\": \"00000000-0000-4000-8000-0000000000aa\"\n}"
            }
          ]
        }
      ]
    },
    {
      "name": "3. EFFECT - Send and void (real emails/state)",
      "description": "EFFECT. Sends real invitation emails and changes envelope state. Skipped unless effects_confirmed is yes. Uses the draft created in folder 1.",
      "item": [
        {
          "name": "Send envelope for signature",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = pm.response.json();",
                  "pm.test('Status is 202 (a 405 means the envelope is not CREATED or has validation errors)', () => pm.response.to.have.status(202));",
                  "pm.test('Envelope moved to SENDING', () => {",
                  "    pm.expect(j.success).to.eql(true);",
                  "    pm.expect(j.envelope.status).to.eql('SENDING');",
                  "    pm.expect(j.message).to.be.a('string');",
                  "});",
                  "pm.test('request_id is present', () => pm.expect(j.request_id).to.be.a('string').and.not.empty);"
                ]
              }
            }
          ],
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Authorization",
                "value": "{{api_key}}",
                "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
              }
            ],
            "url": {
              "raw": "{{api_url}}/{{api_prefix}}/envelopes/{{envelope_id}}/send",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "{{api_prefix}}",
                "envelopes",
                "{{envelope_id}}",
                "send"
              ]
            },
            "description": "EFFECT. Queues the invitation emails to every recipient of the draft and moves it to SENDING (then IN_PROGRESS). Emails are real. Use only your own inboxes; on staging use approved beta team aliases (see README). Requires a CREATED envelope without validation errors. Public docs: api/envelopes.md."
          },
          "response": [
            {
              "name": "202 Accepted",
              "originalRequest": {
                "method": "PUT",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "{{api_key}}",
                    "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
                  }
                ],
                "url": {
                  "raw": "{{api_url}}/{{api_prefix}}/envelopes/{{envelope_id}}/send",
                  "host": [
                    "{{api_url}}"
                  ],
                  "path": [
                    "{{api_prefix}}",
                    "envelopes",
                    "{{envelope_id}}",
                    "send"
                  ]
                },
                "description": "EFFECT. Queues the invitation emails to every recipient of the draft and moves it to SENDING (then IN_PROGRESS). Emails are real. Use only your own inboxes; on staging use approved beta team aliases (see README). Requires a CREATED envelope without validation errors. Public docs: api/envelopes.md."
              },
              "status": "Accepted",
              "code": 202,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"success\": true,\n  \"envelope\": {\n    \"id\": \"00000000-0000-4000-8000-000000000001\",\n    \"name\": \"Postman multi-document draft (fictional)\",\n    \"status\": \"SENDING\",\n    \"errors\": [],\n    \"warnings\": [],\n    \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n    \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n    \"evidence_document_url\": null,\n    \"error_reason\": null,\n    \"evidence_generated_at\": null,\n    \"documents\": [\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000011\",\n        \"custom_key\": \"0\",\n        \"file_type\": \"ORIGINAL\",\n        \"order\": 0,\n        \"status\": \"CREATED\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"file_name\": \"contract-main.pdf\",\n        \"content_type\": \"application/pdf\",\n        \"file_size\": 1150,\n        \"page_count\": 1,\n        \"url\": \"https://storage.example.invalid/sample/contract-main.pdf?signature=redacted\"\n      },\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000012\",\n        \"custom_key\": \"1\",\n        \"file_type\": \"ORIGINAL\",\n        \"order\": 1,\n        \"status\": \"CREATED\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"file_name\": \"contract-annex.pdf\",\n        \"content_type\": \"application/pdf\",\n        \"file_size\": 1150,\n        \"page_count\": 1,\n        \"url\": \"https://storage.example.invalid/sample/contract-annex.pdf?signature=redacted\"\n      },\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000013\",\n        \"custom_key\": \"2\",\n        \"file_type\": \"ATTACHMENT\",\n        \"order\": 2,\n        \"status\": \"CREATED\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"file_name\": \"supporting-attachment.pdf\",\n        \"content_type\": \"application/pdf\",\n        \"file_size\": 1150,\n        \"page_count\": 1,\n        \"url\": \"https://storage.example.invalid/sample/supporting-attachment.pdf?signature=redacted\"\n      }\n    ],\n    \"recipients\": [\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000002\",\n        \"custom_key\": \"signer\",\n        \"order\": 1,\n        \"status\": \"CREATED\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"name\": \"Ana Signer\",\n        \"name_label\": \"Name:\",\n        \"email\": \"signer@example.com\",\n        \"email_label\": \"Email:\"\n      },\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000003\",\n        \"custom_key\": \"approver\",\n        \"order\": 2,\n        \"status\": \"CREATED\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"name\": \"Beto Approver\",\n        \"name_label\": \"Name:\",\n        \"email\": \"approver@example.com\",\n        \"email_label\": \"Email:\"\n      },\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000004\",\n        \"custom_key\": \"witness\",\n        \"order\": 3,\n        \"status\": \"CREATED\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"name\": \"Carla Witness\",\n        \"name_label\": \"Name:\",\n        \"email\": \"witness@example.com\",\n        \"email_label\": \"Email:\"\n      }\n    ],\n    \"placements\": [\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000041\",\n        \"custom_key\": \"p1\",\n        \"placement_type\": \"SIGNATURE\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"recipient_id\": \"00000000-0000-4000-8000-000000000002\",\n        \"recipient_key\": \"signer\",\n        \"document_id\": \"00000000-0000-4000-8000-000000000011\",\n        \"document_key\": \"0\",\n        \"order\": 0,\n        \"coordinates\": {\n          \"id\": \"Lexgo-Sign-0\",\n          \"top\": 650,\n          \"left\": 100,\n          \"page\": 0\n        },\n        \"token\": null\n      },\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000042\",\n        \"custom_key\": \"p2\",\n        \"placement_type\": \"APPROVER\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"recipient_id\": \"00000000-0000-4000-8000-000000000003\",\n        \"recipient_key\": \"approver\",\n        \"document_id\": \"00000000-0000-4000-8000-000000000011\",\n        \"document_key\": \"0\",\n        \"order\": 1,\n        \"coordinates\": {},\n        \"token\": null\n      },\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000043\",\n        \"custom_key\": \"p3\",\n        \"placement_type\": \"WITNESS\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"recipient_id\": \"00000000-0000-4000-8000-000000000004\",\n        \"recipient_key\": \"witness\",\n        \"document_id\": \"00000000-0000-4000-8000-000000000012\",\n        \"document_key\": \"1\",\n        \"order\": 2,\n        \"coordinates\": {},\n        \"token\": null\n      },\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000044\",\n        \"custom_key\": \"p4\",\n        \"placement_type\": \"SIGNATURE\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"recipient_id\": \"00000000-0000-4000-8000-000000000002\",\n        \"recipient_key\": \"signer\",\n        \"document_id\": \"00000000-0000-4000-8000-000000000012\",\n        \"document_key\": \"1\",\n        \"order\": 3,\n        \"coordinates\": {\n          \"id\": \"Lexgo-Sign-3\",\n          \"top\": 650,\n          \"left\": 100,\n          \"page\": 0\n        },\n        \"token\": null\n      }\n    ],\n    \"settings\": {\n      \"emails\": {\n        \"envelope_invitation\": \"TRUE\",\n        \"envelope_voided\": \"TRUE\",\n        \"envelope_rejected\": \"TRUE\",\n        \"envelope_signed\": \"TRUE\"\n      },\n      \"documents\": {\n        \"include_page_id\": \"TRUE\",\n        \"custom_page_id\": \"Lexgo Sign ID:\",\n        \"signatures_per_page\": 4,\n        \"signatures_per_row\": 1\n      },\n      \"signature_flow\": {\n        \"language\": \"EN\",\n        \"signature_order\": \"SEQUENTIAL\",\n        \"signature_types\": \"WRITTEN, DRAWN, UPLOADED\",\n        \"signature_color\": \"#000000\",\n        \"sender_name\": \"Fixture Sender\",\n        \"sender_enterprise\": null\n      },\n      \"signature\": {\n        \"style\": \"SIMPLE\",\n        \"type\": \"INTERNATIONAL\",\n        \"image\": \"DEFAULT\",\n        \"text\": \"DEFAULT\",\n        \"bg_image\": \"DEFAULT\",\n        \"bg_image_scope\": \"QUALIFIED_CHILE\"\n      },\n      \"validations\": {\n        \"email\": {\n          \"order\": 0,\n          \"enabled\": \"FALSE\"\n        },\n        \"phone\": {\n          \"order\": 1,\n          \"enabled\": \"FALSE\",\n          \"methods\": \"SMS\"\n        },\n        \"id_check\": {\n          \"order\": 2,\n          \"enabled\": \"FALSE\"\n        },\n        \"biometric\": {\n          \"order\": 3,\n          \"enabled\": \"FALSE\"\n        }\n      }\n    },\n    \"metadata\": {}\n  },\n  \"message\": \"Envelope is being processed. Use webhooks or poll for status updates.\",\n  \"request_id\": \"00000000-0000-4000-8000-0000000000aa\"\n}"
            },
            {
              "name": "405 Envelope not in CREATED status",
              "originalRequest": {
                "method": "PUT",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "{{api_key}}",
                    "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
                  }
                ],
                "url": {
                  "raw": "{{api_url}}/{{api_prefix}}/envelopes/{{envelope_id}}/send",
                  "host": [
                    "{{api_url}}"
                  ],
                  "path": [
                    "{{api_prefix}}",
                    "envelopes",
                    "{{envelope_id}}",
                    "send"
                  ]
                },
                "description": "EFFECT. Queues the invitation emails to every recipient of the draft and moves it to SENDING (then IN_PROGRESS). Emails are real. Use only your own inboxes; on staging use approved beta team aliases (see README). Requires a CREATED envelope without validation errors. Public docs: api/envelopes.md."
              },
              "status": "Method Not Allowed",
              "code": 405,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"error\": \"Envelope not in CREATED status\",\n  \"request_id\": \"00000000-0000-4000-8000-0000000000aa\"\n}"
            },
            {
              "name": "404 Not Found",
              "originalRequest": {
                "method": "PUT",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "{{api_key}}",
                    "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
                  }
                ],
                "url": {
                  "raw": "{{api_url}}/{{api_prefix}}/envelopes/{{envelope_id}}/send",
                  "host": [
                    "{{api_url}}"
                  ],
                  "path": [
                    "{{api_prefix}}",
                    "envelopes",
                    "{{envelope_id}}",
                    "send"
                  ]
                },
                "description": "EFFECT. Queues the invitation emails to every recipient of the draft and moves it to SENDING (then IN_PROGRESS). Emails are real. Use only your own inboxes; on staging use approved beta team aliases (see README). Requires a CREATED envelope without validation errors. Public docs: api/envelopes.md."
              },
              "status": "Not Found",
              "code": 404,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"error\": \"Envelope not found\",\n  \"request_id\": \"00000000-0000-4000-8000-0000000000aa\"\n}"
            }
          ]
        },
        {
          "name": "Void envelope",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = pm.response.json();",
                  "pm.test('Status is 200 or 405', () => pm.expect(pm.response.code).to.be.oneOf([200, 405]));",
                  "if (pm.response.code === 200) {",
                  "    pm.test('Envelope was voided', () => {",
                  "        pm.expect(j.success).to.eql(true);",
                  "        pm.expect(j.envelope.status).to.eql('VOIDED');",
                  "    });",
                  "} else {",
                  "    pm.test('405 means the envelope is not IN_PROGRESS yet', () => pm.expect(j.error).to.eql('Envelope not in IN_PROGRESS status'));",
                  "}",
                  "pm.test('request_id is present', () => pm.expect(j.request_id).to.be.a('string').and.not.empty);"
                ]
              }
            }
          ],
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Authorization",
                "value": "{{api_key}}",
                "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
              }
            ],
            "url": {
              "raw": "{{api_url}}/{{api_prefix}}/envelopes/{{envelope_id}}/void",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "{{api_prefix}}",
                "envelopes",
                "{{envelope_id}}",
                "void"
              ]
            },
            "description": "EFFECT. Voids an IN_PROGRESS envelope and notifies the recipients by email. Any other status (CREATED, SENDING, SUCCESS, ...) returns 405. Right after Send the envelope is still SENDING, so a 405 is expected until sending finishes. Public docs: api/envelopes.md."
          },
          "response": [
            {
              "name": "200 OK",
              "originalRequest": {
                "method": "PUT",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "{{api_key}}",
                    "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
                  }
                ],
                "url": {
                  "raw": "{{api_url}}/{{api_prefix}}/envelopes/{{envelope_id}}/void",
                  "host": [
                    "{{api_url}}"
                  ],
                  "path": [
                    "{{api_prefix}}",
                    "envelopes",
                    "{{envelope_id}}",
                    "void"
                  ]
                },
                "description": "EFFECT. Voids an IN_PROGRESS envelope and notifies the recipients by email. Any other status (CREATED, SENDING, SUCCESS, ...) returns 405. Right after Send the envelope is still SENDING, so a 405 is expected until sending finishes. Public docs: api/envelopes.md."
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"success\": true,\n  \"envelope\": {\n    \"id\": \"00000000-0000-4000-8000-000000000001\",\n    \"name\": \"Postman multi-document draft (fictional)\",\n    \"status\": \"VOIDED\",\n    \"errors\": [],\n    \"warnings\": [],\n    \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n    \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n    \"evidence_document_url\": null,\n    \"error_reason\": null,\n    \"evidence_generated_at\": null,\n    \"documents\": [\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000011\",\n        \"custom_key\": \"0\",\n        \"file_type\": \"ORIGINAL\",\n        \"order\": 0,\n        \"status\": \"CREATED\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"file_name\": \"contract-main.pdf\",\n        \"content_type\": \"application/pdf\",\n        \"file_size\": 1150,\n        \"page_count\": 1,\n        \"url\": \"https://storage.example.invalid/sample/contract-main.pdf?signature=redacted\"\n      },\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000012\",\n        \"custom_key\": \"1\",\n        \"file_type\": \"ORIGINAL\",\n        \"order\": 1,\n        \"status\": \"CREATED\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"file_name\": \"contract-annex.pdf\",\n        \"content_type\": \"application/pdf\",\n        \"file_size\": 1150,\n        \"page_count\": 1,\n        \"url\": \"https://storage.example.invalid/sample/contract-annex.pdf?signature=redacted\"\n      },\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000013\",\n        \"custom_key\": \"2\",\n        \"file_type\": \"ATTACHMENT\",\n        \"order\": 2,\n        \"status\": \"CREATED\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"file_name\": \"supporting-attachment.pdf\",\n        \"content_type\": \"application/pdf\",\n        \"file_size\": 1150,\n        \"page_count\": 1,\n        \"url\": \"https://storage.example.invalid/sample/supporting-attachment.pdf?signature=redacted\"\n      }\n    ],\n    \"recipients\": [\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000002\",\n        \"custom_key\": \"signer\",\n        \"order\": 1,\n        \"status\": \"CREATED\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"name\": \"Ana Signer\",\n        \"name_label\": \"Name:\",\n        \"email\": \"signer@example.com\",\n        \"email_label\": \"Email:\"\n      },\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000003\",\n        \"custom_key\": \"approver\",\n        \"order\": 2,\n        \"status\": \"CREATED\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"name\": \"Beto Approver\",\n        \"name_label\": \"Name:\",\n        \"email\": \"approver@example.com\",\n        \"email_label\": \"Email:\"\n      },\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000004\",\n        \"custom_key\": \"witness\",\n        \"order\": 3,\n        \"status\": \"CREATED\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"name\": \"Carla Witness\",\n        \"name_label\": \"Name:\",\n        \"email\": \"witness@example.com\",\n        \"email_label\": \"Email:\"\n      }\n    ],\n    \"placements\": [\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000041\",\n        \"custom_key\": \"p1\",\n        \"placement_type\": \"SIGNATURE\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"recipient_id\": \"00000000-0000-4000-8000-000000000002\",\n        \"recipient_key\": \"signer\",\n        \"document_id\": \"00000000-0000-4000-8000-000000000011\",\n        \"document_key\": \"0\",\n        \"order\": 0,\n        \"coordinates\": {\n          \"id\": \"Lexgo-Sign-0\",\n          \"top\": 650,\n          \"left\": 100,\n          \"page\": 0\n        },\n        \"token\": null\n      },\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000042\",\n        \"custom_key\": \"p2\",\n        \"placement_type\": \"APPROVER\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"recipient_id\": \"00000000-0000-4000-8000-000000000003\",\n        \"recipient_key\": \"approver\",\n        \"document_id\": \"00000000-0000-4000-8000-000000000011\",\n        \"document_key\": \"0\",\n        \"order\": 1,\n        \"coordinates\": {},\n        \"token\": null\n      },\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000043\",\n        \"custom_key\": \"p3\",\n        \"placement_type\": \"WITNESS\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"recipient_id\": \"00000000-0000-4000-8000-000000000004\",\n        \"recipient_key\": \"witness\",\n        \"document_id\": \"00000000-0000-4000-8000-000000000012\",\n        \"document_key\": \"1\",\n        \"order\": 2,\n        \"coordinates\": {},\n        \"token\": null\n      },\n      {\n        \"id\": \"00000000-0000-4000-8000-000000000044\",\n        \"custom_key\": \"p4\",\n        \"placement_type\": \"SIGNATURE\",\n        \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"updated_at\": \"2026-01-15T12:00:00.000-03:00\",\n        \"recipient_id\": \"00000000-0000-4000-8000-000000000002\",\n        \"recipient_key\": \"signer\",\n        \"document_id\": \"00000000-0000-4000-8000-000000000012\",\n        \"document_key\": \"1\",\n        \"order\": 3,\n        \"coordinates\": {\n          \"id\": \"Lexgo-Sign-3\",\n          \"top\": 650,\n          \"left\": 100,\n          \"page\": 0\n        },\n        \"token\": null\n      }\n    ],\n    \"settings\": {\n      \"emails\": {\n        \"envelope_invitation\": \"TRUE\",\n        \"envelope_voided\": \"TRUE\",\n        \"envelope_rejected\": \"TRUE\",\n        \"envelope_signed\": \"TRUE\"\n      },\n      \"documents\": {\n        \"include_page_id\": \"TRUE\",\n        \"custom_page_id\": \"Lexgo Sign ID:\",\n        \"signatures_per_page\": 4,\n        \"signatures_per_row\": 1\n      },\n      \"signature_flow\": {\n        \"language\": \"EN\",\n        \"signature_order\": \"SEQUENTIAL\",\n        \"signature_types\": \"WRITTEN, DRAWN, UPLOADED\",\n        \"signature_color\": \"#000000\",\n        \"sender_name\": \"Fixture Sender\",\n        \"sender_enterprise\": null\n      },\n      \"signature\": {\n        \"style\": \"SIMPLE\",\n        \"type\": \"INTERNATIONAL\",\n        \"image\": \"DEFAULT\",\n        \"text\": \"DEFAULT\",\n        \"bg_image\": \"DEFAULT\",\n        \"bg_image_scope\": \"QUALIFIED_CHILE\"\n      },\n      \"validations\": {\n        \"email\": {\n          \"order\": 0,\n          \"enabled\": \"FALSE\"\n        },\n        \"phone\": {\n          \"order\": 1,\n          \"enabled\": \"FALSE\",\n          \"methods\": \"SMS\"\n        },\n        \"id_check\": {\n          \"order\": 2,\n          \"enabled\": \"FALSE\"\n        },\n        \"biometric\": {\n          \"order\": 3,\n          \"enabled\": \"FALSE\"\n        }\n      }\n    },\n    \"metadata\": {}\n  },\n  \"request_id\": \"00000000-0000-4000-8000-0000000000aa\"\n}"
            },
            {
              "name": "405 Envelope not in IN_PROGRESS status",
              "originalRequest": {
                "method": "PUT",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "{{api_key}}",
                    "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
                  }
                ],
                "url": {
                  "raw": "{{api_url}}/{{api_prefix}}/envelopes/{{envelope_id}}/void",
                  "host": [
                    "{{api_url}}"
                  ],
                  "path": [
                    "{{api_prefix}}",
                    "envelopes",
                    "{{envelope_id}}",
                    "void"
                  ]
                },
                "description": "EFFECT. Voids an IN_PROGRESS envelope and notifies the recipients by email. Any other status (CREATED, SENDING, SUCCESS, ...) returns 405. Right after Send the envelope is still SENDING, so a 405 is expected until sending finishes. Public docs: api/envelopes.md."
              },
              "status": "Method Not Allowed",
              "code": 405,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"error\": \"Envelope not in IN_PROGRESS status\",\n  \"request_id\": \"00000000-0000-4000-8000-0000000000aa\"\n}"
            }
          ]
        },
        {
          "name": "Get evidence sheet",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = pm.response.json();",
                  "pm.test('Status is 200, 405, 422 or 500', () => pm.expect(pm.response.code).to.be.oneOf([200, 405, 422, 500]));",
                  "if (pm.response.code === 200) {",
                  "    pm.test('Evidence URL is returned', () => {",
                  "        pm.expect(j.success).to.eql(true);",
                  "        pm.expect(j.evidence_document_url).to.be.a('string').and.not.empty;",
                  "    });",
                  "} else if (pm.response.code === 405) {",
                  "    pm.test('405 means the envelope is not SUCCESS yet', () => pm.expect(j.error).to.eql('Envelope not in SUCCESS status'));",
                  "} else if (pm.response.code === 422) {",
                  "    pm.test('422 means no cryptographic evidence for a simulated sandbox envelope', () => pm.expect(j.error_code).to.eql('hybrid_evidence_unavailable'));",
                  "} else {",
                  "    pm.test('500 means the evidence URL is not available yet', () => pm.expect(j.success).to.eql(false));",
                  "}",
                  "pm.test('request_id is present', () => pm.expect(j.request_id).to.be.a('string').and.not.empty);"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "{{api_key}}",
                "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
              }
            ],
            "url": {
              "raw": "{{api_url}}/{{api_prefix}}/envelopes/{{envelope_id}}/evidence",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "{{api_prefix}}",
                "envelopes",
                "{{envelope_id}}",
                "evidence"
              ]
            },
            "description": "EFFECT (grouped here because it only makes sense after sending). Returns a time-limited URL to the evidence sheet of a completed (SUCCESS) envelope; treat the URL as sensitive. Other statuses return 405. Public docs: guides/evidence-sheet.md."
          },
          "response": [
            {
              "name": "200 OK",
              "originalRequest": {
                "method": "GET",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "{{api_key}}",
                    "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
                  }
                ],
                "url": {
                  "raw": "{{api_url}}/{{api_prefix}}/envelopes/{{envelope_id}}/evidence",
                  "host": [
                    "{{api_url}}"
                  ],
                  "path": [
                    "{{api_prefix}}",
                    "envelopes",
                    "{{envelope_id}}",
                    "evidence"
                  ]
                },
                "description": "EFFECT (grouped here because it only makes sense after sending). Returns a time-limited URL to the evidence sheet of a completed (SUCCESS) envelope; treat the URL as sensitive. Other statuses return 405. Public docs: guides/evidence-sheet.md."
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"success\": true,\n  \"evidence_document_url\": \"https://storage.example.invalid/sample/evidence.pdf?signature=redacted\",\n  \"request_id\": \"00000000-0000-4000-8000-0000000000aa\"\n}"
            },
            {
              "name": "405 Envelope not in SUCCESS status",
              "originalRequest": {
                "method": "GET",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "{{api_key}}",
                    "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
                  }
                ],
                "url": {
                  "raw": "{{api_url}}/{{api_prefix}}/envelopes/{{envelope_id}}/evidence",
                  "host": [
                    "{{api_url}}"
                  ],
                  "path": [
                    "{{api_prefix}}",
                    "envelopes",
                    "{{envelope_id}}",
                    "evidence"
                  ]
                },
                "description": "EFFECT (grouped here because it only makes sense after sending). Returns a time-limited URL to the evidence sheet of a completed (SUCCESS) envelope; treat the URL as sensitive. Other statuses return 405. Public docs: guides/evidence-sheet.md."
              },
              "status": "Method Not Allowed",
              "code": 405,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"error\": \"Envelope not in SUCCESS status\",\n  \"request_id\": \"00000000-0000-4000-8000-0000000000aa\"\n}"
            },
            {
              "name": "422 Evidence unavailable for simulated sandbox output",
              "originalRequest": {
                "method": "GET",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "{{api_key}}",
                    "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
                  }
                ],
                "url": {
                  "raw": "{{api_url}}/{{api_prefix}}/envelopes/{{envelope_id}}/evidence",
                  "host": [
                    "{{api_url}}"
                  ],
                  "path": [
                    "{{api_prefix}}",
                    "envelopes",
                    "{{envelope_id}}",
                    "evidence"
                  ]
                },
                "description": "EFFECT (grouped here because it only makes sense after sending). Returns a time-limited URL to the evidence sheet of a completed (SUCCESS) envelope; treat the URL as sensitive. Other statuses return 405. Public docs: guides/evidence-sheet.md."
              },
              "status": "Unprocessable Content",
              "code": 422,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"success\": false,\n  \"evidence_document_url\": null,\n  \"error_code\": \"hybrid_evidence_unavailable\",\n  \"error\": \"Hybrid sandbox output is simulated; a cryptographic evidence sheet is unavailable.\",\n  \"request_id\": \"00000000-0000-4000-8000-0000000000aa\"\n}"
            },
            {
              "name": "500 Evidence URL not available yet",
              "originalRequest": {
                "method": "GET",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "{{api_key}}",
                    "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
                  }
                ],
                "url": {
                  "raw": "{{api_url}}/{{api_prefix}}/envelopes/{{envelope_id}}/evidence",
                  "host": [
                    "{{api_url}}"
                  ],
                  "path": [
                    "{{api_prefix}}",
                    "envelopes",
                    "{{envelope_id}}",
                    "evidence"
                  ]
                },
                "description": "EFFECT (grouped here because it only makes sense after sending). Returns a time-limited URL to the evidence sheet of a completed (SUCCESS) envelope; treat the URL as sensitive. Other statuses return 405. Public docs: guides/evidence-sheet.md."
              },
              "status": "Internal Server Error",
              "code": 500,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"success\": false,\n  \"evidence_document_url\": null,\n  \"request_id\": \"00000000-0000-4000-8000-0000000000aa\"\n}"
            }
          ]
        }
      ],
      "event": [
        {
          "listen": "prerequest",
          "script": {
            "type": "text/javascript",
            "exec": [
              "// EFFECT folder guard: the requests in this folder have real side effects.",
              "if (pm.variables.get('effects_confirmed') !== 'yes') {",
              "    console.warn('Skipped \"' + pm.info.requestName + '\": set effects_confirmed to yes to run EFFECT requests.');",
              "    pm.execution.skipRequest();",
              "}"
            ]
          }
        }
      ]
    },
    {
      "name": "4. EFFECT - 2FA validation codes (sends a code)",
      "description": "EFFECT. Sends a verification code email to a recipient. Skipped unless effects_confirmed is yes. Needs envelope_id and signer_id from folder 1.",
      "item": [
        {
          "name": "Send validation code",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = pm.response.json();",
                  "pm.test('Status is 200 or 429', () => pm.expect(pm.response.code).to.be.oneOf([200, 429]));",
                  "if (pm.response.code === 200) {",
                  "    pm.test('Code was sent and has an expiry', () => {",
                  "        pm.expect(j.success).to.eql(true);",
                  "        pm.expect(j.expires_at).to.be.a('string').and.not.empty;",
                  "    });",
                  "} else {",
                  "    pm.test('429 explains the rate limit', () => pm.expect(j.error).to.be.a('string').and.not.empty);",
                  "}",
                  "pm.test('request_id is present', () => pm.expect(j.request_id).to.be.a('string').and.not.empty);"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "{{api_key}}",
                "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
              }
            ],
            "url": {
              "raw": "{{api_url}}/{{api_prefix}}/envelopes/{{envelope_id}}/recipients/{{signer_id}}/validations/send_code",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "{{api_prefix}}",
                "envelopes",
                "{{envelope_id}}",
                "recipients",
                "{{signer_id}}",
                "validations",
                "send_code"
              ]
            },
            "description": "EFFECT. Emails a 6-digit code (valid 30 minutes) to the recipient. Limits: 60 seconds between sends, 5 sends per hour. Use a recipient whose inbox you control. Public docs: api/validations.md."
          },
          "response": [
            {
              "name": "200 OK",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "{{api_key}}",
                    "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
                  }
                ],
                "url": {
                  "raw": "{{api_url}}/{{api_prefix}}/envelopes/{{envelope_id}}/recipients/{{signer_id}}/validations/send_code",
                  "host": [
                    "{{api_url}}"
                  ],
                  "path": [
                    "{{api_prefix}}",
                    "envelopes",
                    "{{envelope_id}}",
                    "recipients",
                    "{{signer_id}}",
                    "validations",
                    "send_code"
                  ]
                },
                "description": "EFFECT. Emails a 6-digit code (valid 30 minutes) to the recipient. Limits: 60 seconds between sends, 5 sends per hour. Use a recipient whose inbox you control. Public docs: api/validations.md."
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"success\": true,\n  \"expires_at\": \"2026-01-15T12:00:00.000-03:00\",\n  \"request_id\": \"00000000-0000-4000-8000-0000000000aa\"\n}"
            },
            {
              "name": "404 Recipient not found",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "{{api_key}}",
                    "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
                  }
                ],
                "url": {
                  "raw": "{{api_url}}/{{api_prefix}}/envelopes/{{envelope_id}}/recipients/{{signer_id}}/validations/send_code",
                  "host": [
                    "{{api_url}}"
                  ],
                  "path": [
                    "{{api_prefix}}",
                    "envelopes",
                    "{{envelope_id}}",
                    "recipients",
                    "{{signer_id}}",
                    "validations",
                    "send_code"
                  ]
                },
                "description": "EFFECT. Emails a 6-digit code (valid 30 minutes) to the recipient. Limits: 60 seconds between sends, 5 sends per hour. Use a recipient whose inbox you control. Public docs: api/validations.md."
              },
              "status": "Not Found",
              "code": 404,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"error\": \"Recipient not found\",\n  \"request_id\": \"00000000-0000-4000-8000-0000000000aa\"\n}"
            },
            {
              "name": "429 Too Many Requests",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "{{api_key}}",
                    "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
                  }
                ],
                "url": {
                  "raw": "{{api_url}}/{{api_prefix}}/envelopes/{{envelope_id}}/recipients/{{signer_id}}/validations/send_code",
                  "host": [
                    "{{api_url}}"
                  ],
                  "path": [
                    "{{api_prefix}}",
                    "envelopes",
                    "{{envelope_id}}",
                    "recipients",
                    "{{signer_id}}",
                    "validations",
                    "send_code"
                  ]
                },
                "description": "EFFECT. Emails a 6-digit code (valid 30 minutes) to the recipient. Limits: 60 seconds between sends, 5 sends per hour. Use a recipient whose inbox you control. Public docs: api/validations.md."
              },
              "status": "Too Many Requests",
              "code": 429,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"error\": \"Wait 60 seconds before requesting another code\",\n  \"request_id\": \"00000000-0000-4000-8000-0000000000aa\"\n}"
            }
          ]
        },
        {
          "name": "Verify validation code",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = pm.response.json();",
                  "pm.test('Status is 200, 404 or 422', () => pm.expect(pm.response.code).to.be.oneOf([200, 404, 422]));",
                  "if (pm.response.code === 200) {",
                  "    pm.test('Code accepted', () => pm.expect(j.success).to.eql(true));",
                  "} else if (pm.response.code === 422) {",
                  "    pm.test('422 means invalid, expired or too many attempts', () => pm.expect(j.error).to.be.a('string').and.not.empty);",
                  "} else {",
                  "    pm.test('404 means no pending validation', () => pm.expect(j.error).to.be.a('string').and.not.empty);",
                  "}",
                  "pm.test('request_id is present', () => pm.expect(j.request_id).to.be.a('string').and.not.empty);"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "{{api_key}}",
                "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{api_url}}/{{api_prefix}}/envelopes/{{envelope_id}}/recipients/{{signer_id}}/validations/verify_code",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "{{api_prefix}}",
                "envelopes",
                "{{envelope_id}}",
                "recipients",
                "{{signer_id}}",
                "validations",
                "verify_code"
              ]
            },
            "description": "EFFECT. Submits the code from the email (variable validation_code, default 000000 which is expected to be rejected). Three failed attempts invalidate the validation. Public docs: api/validations.md.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"code\": \"{{validation_code}}\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [
            {
              "name": "200 OK",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "{{api_key}}",
                    "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": {
                  "raw": "{{api_url}}/{{api_prefix}}/envelopes/{{envelope_id}}/recipients/{{signer_id}}/validations/verify_code",
                  "host": [
                    "{{api_url}}"
                  ],
                  "path": [
                    "{{api_prefix}}",
                    "envelopes",
                    "{{envelope_id}}",
                    "recipients",
                    "{{signer_id}}",
                    "validations",
                    "verify_code"
                  ]
                },
                "description": "EFFECT. Submits the code from the email (variable validation_code, default 000000 which is expected to be rejected). Three failed attempts invalidate the validation. Public docs: api/validations.md.",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"code\": \"{{validation_code}}\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"success\": true,\n  \"message\": \"Email validated successfully\",\n  \"request_id\": \"00000000-0000-4000-8000-0000000000aa\"\n}"
            },
            {
              "name": "404 No pending validation",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "{{api_key}}",
                    "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": {
                  "raw": "{{api_url}}/{{api_prefix}}/envelopes/{{envelope_id}}/recipients/{{signer_id}}/validations/verify_code",
                  "host": [
                    "{{api_url}}"
                  ],
                  "path": [
                    "{{api_prefix}}",
                    "envelopes",
                    "{{envelope_id}}",
                    "recipients",
                    "{{signer_id}}",
                    "validations",
                    "verify_code"
                  ]
                },
                "description": "EFFECT. Submits the code from the email (variable validation_code, default 000000 which is expected to be rejected). Three failed attempts invalidate the validation. Public docs: api/validations.md.",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"code\": \"{{validation_code}}\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "Not Found",
              "code": 404,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"error\": \"No pending validation found\",\n  \"request_id\": \"00000000-0000-4000-8000-0000000000aa\"\n}"
            },
            {
              "name": "422 Invalid verification code",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "{{api_key}}",
                    "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": {
                  "raw": "{{api_url}}/{{api_prefix}}/envelopes/{{envelope_id}}/recipients/{{signer_id}}/validations/verify_code",
                  "host": [
                    "{{api_url}}"
                  ],
                  "path": [
                    "{{api_prefix}}",
                    "envelopes",
                    "{{envelope_id}}",
                    "recipients",
                    "{{signer_id}}",
                    "validations",
                    "verify_code"
                  ]
                },
                "description": "EFFECT. Submits the code from the email (variable validation_code, default 000000 which is expected to be rejected). Three failed attempts invalidate the validation. Public docs: api/validations.md.",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"code\": \"{{validation_code}}\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "Unprocessable Content",
              "code": 422,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"error\": \"Invalid verification code\",\n  \"request_id\": \"00000000-0000-4000-8000-0000000000aa\"\n}"
            }
          ]
        }
      ],
      "event": [
        {
          "listen": "prerequest",
          "script": {
            "type": "text/javascript",
            "exec": [
              "// EFFECT folder guard: the requests in this folder have real side effects.",
              "if (pm.variables.get('effects_confirmed') !== 'yes') {",
              "    console.warn('Skipped \"' + pm.info.requestName + '\": set effects_confirmed to yes to run EFFECT requests.');",
              "    pm.execution.skipRequest();",
              "}"
            ]
          }
        }
      ]
    },
    {
      "name": "5. EFFECT - Settings update (tenant-wide)",
      "description": "EFFECT. Updates settings that apply to the whole API key configuration. Skipped unless effects_confirmed is yes. Run read, update and restore in order.",
      "item": [
        {
          "name": "Read current settings (saves a backup)",
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "// No stale backup may survive: it is rebuilt only by a successful read below.",
                  "pm.collectionVariables.unset('settings_backup_json');"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "let j = {};",
                  "try { j = pm.response.json(); } catch (e) { j = {}; }",
                  "pm.test('Status is 200', () => pm.response.to.have.status(200));",
                  "pm.test('All the groups that the update changes are present', () => {",
                  "    pm.expect(j.settings).to.include.keys('branding', 'documents', 'emails', 'localization', 'signature', 'signature_flow');",
                  "    pm.expect(j.settings.localization.en.documents.extra_page_intro).to.be.a('string');",
                  "});",
                  "// Store the backup only after a successful read where every value that the update touches is defined.",
                  "if (pm.response.code === 200 && j.settings) {",
                  "    const s = j.settings;",
                  "    const pick = (obj, keys) => keys.reduce((acc, k) => { acc[k] = (obj || {})[k]; return acc; }, {});",
                  "    const backup = {",
                  "        branding: pick(s.branding, ['logo', 'url_homepage', 'url_signature_flow']),",
                  "        documents: pick(s.documents, ['include_page_id', 'custom_page_id', 'signatures_per_page', 'signatures_per_row']),",
                  "        emails: pick(s.emails, ['envelope_invitation', 'envelope_voided', 'envelope_rejected', 'envelope_signed']),",
                  "        localization: { en: { documents: { extra_page_intro: (((s.localization || {}).en || {}).documents || {}).extra_page_intro } } },",
                  "        signature: pick(s.signature, ['style']),",
                  "        signature_flow: pick(s.signature_flow, ['language', 'signature_order', 'signature_types', 'signature_color', 'sender_name'])",
                  "    };",
                  "    const leaves = [];",
                  "    const collect = (node) => { if (node !== null && typeof node === 'object') { Object.keys(node).forEach((k) => collect(node[k])); } else { leaves.push(node); } };",
                  "    collect(backup);",
                  "    if (leaves.every((v) => v !== undefined && v !== null)) {",
                  "        pm.collectionVariables.set('settings_backup_json', JSON.stringify(backup));",
                  "    }",
                  "}",
                  "pm.test('Backup was saved for the restore request', () => {",
                  "    const saved = pm.collectionVariables.get('settings_backup_json');",
                  "    pm.expect(saved, 'no backup: the Update and Restore requests will be skipped').to.be.a('string').and.not.empty;",
                  "    pm.expect(JSON.parse(saved)).to.have.keys('branding', 'documents', 'emails', 'localization', 'signature', 'signature_flow');",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "{{api_key}}",
                "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
              }
            ],
            "url": {
              "raw": "{{api_url}}/{{api_prefix}}/settings",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "{{api_prefix}}",
                "settings"
              ]
            },
            "description": "Read-only, but part of the settings-update sequence. Clears any earlier backup first, then saves the current values of every field the update changes into settings_backup_json, only when the read succeeded and every value is defined. Update and Restore are skipped without a valid backup. Public docs: api/settings.md."
          },
          "response": [
            {
              "name": "200 OK (localization abbreviated)",
              "originalRequest": {
                "method": "GET",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "{{api_key}}",
                    "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
                  }
                ],
                "url": {
                  "raw": "{{api_url}}/{{api_prefix}}/settings",
                  "host": [
                    "{{api_url}}"
                  ],
                  "path": [
                    "{{api_prefix}}",
                    "settings"
                  ]
                },
                "description": "Read-only, but part of the settings-update sequence. Clears any earlier backup first, then saves the current values of every field the update changes into settings_backup_json, only when the read succeeded and every value is defined. Update and Restore are skipped without a valid backup. Public docs: api/settings.md."
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"settings\": {\n    \"emails\": {\n      \"envelope_invitation\": \"TRUE\",\n      \"envelope_voided\": \"TRUE\",\n      \"envelope_rejected\": \"TRUE\",\n      \"envelope_signed\": \"TRUE\"\n    },\n    \"documents\": {\n      \"include_page_id\": \"TRUE\",\n      \"custom_page_id\": \"Lexgo Sign ID:\",\n      \"signatures_per_page\": 4,\n      \"signatures_per_row\": 1\n    },\n    \"signature_flow\": {\n      \"language\": \"EN\",\n      \"signature_order\": \"SEQUENTIAL\",\n      \"signature_types\": \"WRITTEN, DRAWN, UPLOADED\",\n      \"signature_color\": \"#000000\",\n      \"sender_name\": \"Fixture Sender\",\n      \"sender_enterprise\": null\n    },\n    \"signature\": {\n      \"style\": \"SIMPLE\",\n      \"type\": \"INTERNATIONAL\",\n      \"image\": \"DEFAULT\",\n      \"text\": \"DEFAULT\",\n      \"bg_image\": \"DEFAULT\",\n      \"bg_image_scope\": \"QUALIFIED_CHILE\"\n    },\n    \"validations\": {\n      \"email\": {\n        \"order\": 0,\n        \"enabled\": \"FALSE\"\n      },\n      \"phone\": {\n        \"order\": 1,\n        \"enabled\": \"FALSE\",\n        \"methods\": \"SMS\"\n      },\n      \"id_check\": {\n        \"order\": 2,\n        \"enabled\": \"FALSE\"\n      },\n      \"biometric\": {\n        \"order\": 3,\n        \"enabled\": \"FALSE\"\n      }\n    },\n    \"branding\": {\n      \"logo\": \"DEFAULT\",\n      \"favicon\": \"DEFAULT\",\n      \"name\": \"DEFAULT\",\n      \"url_homepage\": \"DEFAULT\",\n      \"url_signature_flow\": \"DEFAULT\",\n      \"reply_to\": \"DEFAULT\",\n      \"sender_email\": \"DEFAULT\"\n    },\n    \"localization\": {\n      \"en\": {\n        \"documents\": {\n          \"extra_page_intro\": \"(abbreviated in this example)\"\n        }\n      },\n      \"es\": {\n        \"documents\": {\n          \"extra_page_intro\": \"(abreviado en este ejemplo)\"\n        }\n      }\n    }\n  },\n  \"environment\": \"sandbox\",\n  \"request_id\": \"00000000-0000-4000-8000-0000000000aa\"\n}"
            }
          ]
        },
        {
          "name": "Update settings - branding, documents, emails, localization, signature, signature_flow",
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "// Skipped unless a complete backup exists: never change tenant settings without a way back.",
                  "const groups = ['branding', 'documents', 'emails', 'localization', 'signature', 'signature_flow'];",
                  "let backup = null;",
                  "try { backup = JSON.parse(pm.variables.get('settings_backup_json')); } catch (e) { backup = null; }",
                  "if (!backup || typeof backup !== 'object' || !groups.every((g) => backup[g] && typeof backup[g] === 'object')) {",
                  "    console.warn('Skipped \"' + pm.info.requestName + '\": settings_backup_json is missing or incomplete. Run the read request successfully first.');",
                  "    pm.execution.skipRequest();",
                  "}"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = pm.response.json();",
                  "pm.test('Status is 200', () => pm.response.to.have.status(200));",
                  "pm.test('Every sent group is returned and the response has no success key', () => {",
                  "    pm.expect(j.settings).to.include.keys('branding', 'documents', 'emails', 'localization', 'signature', 'signature_flow');",
                  "    pm.expect(j).to.not.have.property('success');",
                  "});",
                  "pm.test('Values were applied', () => {",
                  "    pm.expect(j.settings.documents.custom_page_id).to.eql('Lexgo Sign ID:');",
                  "    pm.expect(j.settings.signature_flow.sender_name).to.eql('Lexgo');",
                  "    pm.expect(j.settings.signature_flow.signature_order).to.eql('PARALLEL');",
                  "    pm.expect(j.settings.localization.en.documents.extra_page_intro).to.eql('IN WITNESS WHEREOF, this is fictional sample text.');",
                  "});",
                  "pm.test('Stage and request_id are present', () => {",
                  "    pm.expect(j.environment).to.be.oneOf(['sandbox', 'live']);",
                  "    pm.expect(j.request_id).to.be.a('string').and.not.empty;",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Authorization",
                "value": "{{api_key}}",
                "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{api_url}}/{{api_prefix}}/settings",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "{{api_prefix}}",
                "settings"
              ]
            },
            "description": "EFFECT. Changes settings for the whole enterprise API configuration (applies to every later envelope created with this key): branding, documents, emails, localization, signature and signature_flow. The values are the documented defaults, so this is idempotent only when nothing was customised. Run the restore request afterwards. Public docs: api/settings.md.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"branding\": {\n    \"logo\": \"DEFAULT\",\n    \"url_homepage\": \"DEFAULT\",\n    \"url_signature_flow\": \"DEFAULT\"\n  },\n  \"documents\": {\n    \"include_page_id\": \"TRUE\",\n    \"custom_page_id\": \"Lexgo Sign ID:\",\n    \"signatures_per_page\": 4,\n    \"signatures_per_row\": 1\n  },\n  \"emails\": {\n    \"envelope_invitation\": \"TRUE\",\n    \"envelope_voided\": \"TRUE\",\n    \"envelope_rejected\": \"TRUE\",\n    \"envelope_signed\": \"TRUE\"\n  },\n  \"localization\": {\n    \"en\": {\n      \"documents\": {\n        \"extra_page_intro\": \"IN WITNESS WHEREOF, this is fictional sample text.\"\n      }\n    }\n  },\n  \"signature\": {\n    \"style\": \"SIMPLE\"\n  },\n  \"signature_flow\": {\n    \"language\": \"EN\",\n    \"signature_order\": \"PARALLEL\",\n    \"signature_types\": \"WRITTEN, DRAWN, UPLOADED\",\n    \"signature_color\": \"#000000\",\n    \"sender_name\": \"Lexgo\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [
            {
              "name": "200 OK (localization abbreviated)",
              "originalRequest": {
                "method": "PUT",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "{{api_key}}",
                    "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": {
                  "raw": "{{api_url}}/{{api_prefix}}/settings",
                  "host": [
                    "{{api_url}}"
                  ],
                  "path": [
                    "{{api_prefix}}",
                    "settings"
                  ]
                },
                "description": "EFFECT. Changes settings for the whole enterprise API configuration (applies to every later envelope created with this key): branding, documents, emails, localization, signature and signature_flow. The values are the documented defaults, so this is idempotent only when nothing was customised. Run the restore request afterwards. Public docs: api/settings.md.",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"branding\": {\n    \"logo\": \"DEFAULT\",\n    \"url_homepage\": \"DEFAULT\",\n    \"url_signature_flow\": \"DEFAULT\"\n  },\n  \"documents\": {\n    \"include_page_id\": \"TRUE\",\n    \"custom_page_id\": \"Lexgo Sign ID:\",\n    \"signatures_per_page\": 4,\n    \"signatures_per_row\": 1\n  },\n  \"emails\": {\n    \"envelope_invitation\": \"TRUE\",\n    \"envelope_voided\": \"TRUE\",\n    \"envelope_rejected\": \"TRUE\",\n    \"envelope_signed\": \"TRUE\"\n  },\n  \"localization\": {\n    \"en\": {\n      \"documents\": {\n        \"extra_page_intro\": \"IN WITNESS WHEREOF, this is fictional sample text.\"\n      }\n    }\n  },\n  \"signature\": {\n    \"style\": \"SIMPLE\"\n  },\n  \"signature_flow\": {\n    \"language\": \"EN\",\n    \"signature_order\": \"PARALLEL\",\n    \"signature_types\": \"WRITTEN, DRAWN, UPLOADED\",\n    \"signature_color\": \"#000000\",\n    \"sender_name\": \"Lexgo\"\n  }\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"settings\": {\n    \"documents\": {\n      \"include_page_id\": \"TRUE\",\n      \"custom_page_id\": \"Lexgo Sign ID:\",\n      \"signatures_per_page\": 4,\n      \"signatures_per_row\": 1\n    },\n    \"emails\": {\n      \"envelope_invitation\": \"TRUE\",\n      \"envelope_voided\": \"TRUE\",\n      \"envelope_rejected\": \"TRUE\",\n      \"envelope_signed\": \"TRUE\"\n    },\n    \"signature\": {\n      \"style\": \"SIMPLE\",\n      \"type\": \"INTERNATIONAL\",\n      \"image\": \"DEFAULT\",\n      \"text\": \"DEFAULT\",\n      \"bg_image\": \"DEFAULT\",\n      \"bg_image_scope\": \"QUALIFIED_CHILE\"\n    },\n    \"signature_flow\": {\n      \"language\": \"EN\",\n      \"signature_order\": \"SEQUENTIAL\",\n      \"signature_types\": \"WRITTEN, DRAWN, UPLOADED\",\n      \"signature_color\": \"#000000\",\n      \"sender_name\": \"Fixture Sender\",\n      \"sender_enterprise\": null\n    },\n    \"branding\": {\n      \"logo\": \"DEFAULT\",\n      \"favicon\": \"DEFAULT\",\n      \"name\": \"DEFAULT\",\n      \"url_homepage\": \"DEFAULT\",\n      \"url_signature_flow\": \"DEFAULT\",\n      \"reply_to\": \"DEFAULT\",\n      \"sender_email\": \"DEFAULT\"\n    },\n    \"localization\": {\n      \"en\": {\n        \"documents\": {\n          \"extra_page_intro\": \"IN WITNESS WHEREOF, this is fictional sample text.\"\n        }\n      },\n      \"es\": {\n        \"documents\": {\n          \"extra_page_intro\": \"(abreviado en este ejemplo)\"\n        }\n      }\n    }\n  },\n  \"environment\": \"sandbox\",\n  \"request_id\": \"00000000-0000-4000-8000-0000000000aa\"\n}"
            }
          ]
        },
        {
          "name": "Restore settings from the backup",
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "// Skipped unless a complete backup exists: never change tenant settings without a way back.",
                  "const groups = ['branding', 'documents', 'emails', 'localization', 'signature', 'signature_flow'];",
                  "let backup = null;",
                  "try { backup = JSON.parse(pm.variables.get('settings_backup_json')); } catch (e) { backup = null; }",
                  "if (!backup || typeof backup !== 'object' || !groups.every((g) => backup[g] && typeof backup[g] === 'object')) {",
                  "    console.warn('Skipped \"' + pm.info.requestName + '\": settings_backup_json is missing or incomplete. Run the read request successfully first.');",
                  "    pm.execution.skipRequest();",
                  "} else {",
                  "    // Build the body here, not in the body template: Postman resolves double-brace text inside stored values.",
                  "    // Open double braces become unicode escapes, so the JSON stays valid and nothing is substituted.",
                  "    pm.request.body.update({ mode: 'raw', raw: JSON.stringify(backup).replace(/\\{\\{/g, '\\\\u007b\\\\u007b') });",
                  "}"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = pm.response.json();",
                  "const backup = JSON.parse(pm.variables.get('settings_backup_json'));",
                  "pm.test('Status is 200', () => pm.response.to.have.status(200));",
                  "pm.test('Every backed-up value was restored', () => {",
                  "    ['branding', 'documents', 'emails', 'signature', 'signature_flow'].forEach((g) => {",
                  "        pm.expect(j.settings[g], g).to.deep.include(backup[g]);",
                  "    });",
                  "    pm.expect(j.settings.localization.en.documents.extra_page_intro).to.eql(backup.localization.en.documents.extra_page_intro);",
                  "});",
                  "pm.test('request_id is present', () => pm.expect(j.request_id).to.be.a('string').and.not.empty);"
                ]
              }
            }
          ],
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Authorization",
                "value": "{{api_key}}",
                "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{api_url}}/{{api_prefix}}/settings",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "{{api_prefix}}",
                "settings"
              ]
            },
            "description": "EFFECT. Writes the values saved by the read request back into the tenant settings. The body is built in the pre-request script from settings_backup_json (so quotes, backslashes, newlines and double-brace text in a value stay valid JSON); the request is skipped without a complete backup. The body shown here is a sample. Public docs: api/settings.md.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"branding\": {\n    \"logo\": \"DEFAULT\",\n    \"url_homepage\": \"DEFAULT\",\n    \"url_signature_flow\": \"DEFAULT\"\n  },\n  \"documents\": {\n    \"include_page_id\": \"TRUE\",\n    \"custom_page_id\": \"Lexgo Sign ID:\",\n    \"signatures_per_page\": 4,\n    \"signatures_per_row\": 1\n  },\n  \"emails\": {\n    \"envelope_invitation\": \"TRUE\",\n    \"envelope_voided\": \"TRUE\",\n    \"envelope_rejected\": \"TRUE\",\n    \"envelope_signed\": \"TRUE\"\n  },\n  \"localization\": {\n    \"en\": {\n      \"documents\": {\n        \"extra_page_intro\": \"IN WITNESS WHEREOF, this is fictional sample text.\"\n      }\n    }\n  },\n  \"signature\": {\n    \"style\": \"SIMPLE\"\n  },\n  \"signature_flow\": {\n    \"language\": \"EN\",\n    \"signature_order\": \"PARALLEL\",\n    \"signature_types\": \"WRITTEN, DRAWN, UPLOADED\",\n    \"signature_color\": \"#000000\",\n    \"sender_name\": \"Lexgo\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [
            {
              "name": "200 OK (localization abbreviated)",
              "originalRequest": {
                "method": "PUT",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "{{api_key}}",
                    "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": {
                  "raw": "{{api_url}}/{{api_prefix}}/settings",
                  "host": [
                    "{{api_url}}"
                  ],
                  "path": [
                    "{{api_prefix}}",
                    "settings"
                  ]
                },
                "description": "EFFECT. Writes the values saved by the read request back into the tenant settings. The body is built in the pre-request script from settings_backup_json (so quotes, backslashes, newlines and double-brace text in a value stay valid JSON); the request is skipped without a complete backup. The body shown here is a sample. Public docs: api/settings.md.",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"branding\": {\n    \"logo\": \"DEFAULT\",\n    \"url_homepage\": \"DEFAULT\",\n    \"url_signature_flow\": \"DEFAULT\"\n  },\n  \"documents\": {\n    \"include_page_id\": \"TRUE\",\n    \"custom_page_id\": \"Lexgo Sign ID:\",\n    \"signatures_per_page\": 4,\n    \"signatures_per_row\": 1\n  },\n  \"emails\": {\n    \"envelope_invitation\": \"TRUE\",\n    \"envelope_voided\": \"TRUE\",\n    \"envelope_rejected\": \"TRUE\",\n    \"envelope_signed\": \"TRUE\"\n  },\n  \"localization\": {\n    \"en\": {\n      \"documents\": {\n        \"extra_page_intro\": \"IN WITNESS WHEREOF, this is fictional sample text.\"\n      }\n    }\n  },\n  \"signature\": {\n    \"style\": \"SIMPLE\"\n  },\n  \"signature_flow\": {\n    \"language\": \"EN\",\n    \"signature_order\": \"PARALLEL\",\n    \"signature_types\": \"WRITTEN, DRAWN, UPLOADED\",\n    \"signature_color\": \"#000000\",\n    \"sender_name\": \"Lexgo\"\n  }\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"settings\": {\n    \"documents\": {\n      \"include_page_id\": \"TRUE\",\n      \"custom_page_id\": \"Lexgo Sign ID:\",\n      \"signatures_per_page\": 4,\n      \"signatures_per_row\": 1\n    },\n    \"emails\": {\n      \"envelope_invitation\": \"TRUE\",\n      \"envelope_voided\": \"TRUE\",\n      \"envelope_rejected\": \"TRUE\",\n      \"envelope_signed\": \"TRUE\"\n    },\n    \"signature\": {\n      \"style\": \"SIMPLE\",\n      \"type\": \"INTERNATIONAL\",\n      \"image\": \"DEFAULT\",\n      \"text\": \"DEFAULT\",\n      \"bg_image\": \"DEFAULT\",\n      \"bg_image_scope\": \"QUALIFIED_CHILE\"\n    },\n    \"signature_flow\": {\n      \"language\": \"EN\",\n      \"signature_order\": \"SEQUENTIAL\",\n      \"signature_types\": \"WRITTEN, DRAWN, UPLOADED\",\n      \"signature_color\": \"#000000\",\n      \"sender_name\": \"Fixture Sender\",\n      \"sender_enterprise\": null\n    },\n    \"branding\": {\n      \"logo\": \"DEFAULT\",\n      \"favicon\": \"DEFAULT\",\n      \"name\": \"DEFAULT\",\n      \"url_homepage\": \"DEFAULT\",\n      \"url_signature_flow\": \"DEFAULT\",\n      \"reply_to\": \"DEFAULT\",\n      \"sender_email\": \"DEFAULT\"\n    },\n    \"localization\": {\n      \"en\": {\n        \"documents\": {\n          \"extra_page_intro\": \"IN WITNESS WHEREOF, this is fictional sample text.\"\n        }\n      },\n      \"es\": {\n        \"documents\": {\n          \"extra_page_intro\": \"(abreviado en este ejemplo)\"\n        }\n      }\n    }\n  },\n  \"environment\": \"sandbox\",\n  \"request_id\": \"00000000-0000-4000-8000-0000000000aa\"\n}"
            }
          ]
        }
      ],
      "event": [
        {
          "listen": "prerequest",
          "script": {
            "type": "text/javascript",
            "exec": [
              "// EFFECT folder guard: the requests in this folder have real side effects.",
              "if (pm.variables.get('effects_confirmed') !== 'yes') {",
              "    console.warn('Skipped \"' + pm.info.requestName + '\": set effects_confirmed to yes to run EFFECT requests.');",
              "    pm.execution.skipRequest();",
              "}"
            ]
          }
        }
      ]
    },
    {
      "name": "6. EFFECT - Webhooks (outbound HTTP to a URL)",
      "description": "EFFECT. Creates and changes webhooks that make outbound HTTP calls to a URL. Skipped unless effects_confirmed is yes. Point webhook_url only at an endpoint you control.",
      "item": [
        {
          "name": "Create webhook",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = pm.response.json();",
                  "",
                  "pm.test('Status is 200 and the webhook was created', () => {",
                  "    pm.expect(pm.response.code).to.eql(200);",
                  "    pm.expect(j.success).to.eql(true);",
                  "    pm.expect(j.webhook).to.include.keys('id', 'url', 'auth_type', 'subscriptions', 'created_at', 'updated_at');",
                  "    pm.expect(j.webhook.auth_type).to.eql('HEADER');",
                  "    pm.expect(j.webhook.subscriptions.split(',')).to.have.members(['envelope.success', 'envelope.voided', 'recipient.signed_all', 'recipient.rejected']);",
                  "});",
                  "pm.collectionVariables.set('webhook_id', j.webhook.id);",
                  "",
                  "pm.test('request_id is present', () => pm.expect(j.request_id).to.be.a('string').and.not.empty);"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "{{api_key}}",
                "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{api_url}}/{{api_prefix}}/webhooks",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "{{api_prefix}}",
                "webhooks"
              ]
            },
            "description": "EFFECT. Registers a webhook; later events of this API key are POSTed to its URL (outbound HTTP). The default URL is non-routable. auth_type is header (then `auth` is sent as the Authorization header of every delivery) or no_auth; unknown subscription names are dropped silently. Invalid input currently raises 500. Saves webhook_id. Public docs: api/webhooks.md.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"url\": \"{{webhook_url}}\",\n  \"auth_type\": \"header\",\n  \"auth\": \"fictional-webhook-header-value\",\n  \"subscriptions\": \"envelope.success,envelope.voided,recipient.signed_all,recipient.rejected\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [
            {
              "name": "200 OK",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "{{api_key}}",
                    "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": {
                  "raw": "{{api_url}}/{{api_prefix}}/webhooks",
                  "host": [
                    "{{api_url}}"
                  ],
                  "path": [
                    "{{api_prefix}}",
                    "webhooks"
                  ]
                },
                "description": "EFFECT. Registers a webhook; later events of this API key are POSTed to its URL (outbound HTTP). The default URL is non-routable. auth_type is header (then `auth` is sent as the Authorization header of every delivery) or no_auth; unknown subscription names are dropped silently. Invalid input currently raises 500. Saves webhook_id. Public docs: api/webhooks.md.",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"url\": \"{{webhook_url}}\",\n  \"auth_type\": \"header\",\n  \"auth\": \"fictional-webhook-header-value\",\n  \"subscriptions\": \"envelope.success,envelope.voided,recipient.signed_all,recipient.rejected\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"success\": true,\n  \"webhook\": {\n    \"id\": \"00000000-0000-4000-8000-000000000080\",\n    \"url\": \"https://example.invalid/lexgo-sign-webhook\",\n    \"auth_type\": \"HEADER\",\n    \"subscriptions\": \"envelope.success,envelope.voided,recipient.signed_all,recipient.rejected\",\n    \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n    \"updated_at\": \"2026-01-15T12:00:00.000-03:00\"\n  },\n  \"request_id\": \"00000000-0000-4000-8000-0000000000aa\"\n}"
            }
          ]
        },
        {
          "name": "List webhooks",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = pm.response.json();",
                  "",
                  "pm.test('Status is 200 and the created webhook is listed', () => {",
                  "    pm.expect(pm.response.code).to.eql(200);",
                  "    pm.expect(j.webhooks).to.be.an('array');",
                  "    pm.expect(j.webhooks.map((w) => w.id)).to.include(pm.variables.get('webhook_id'));",
                  "});",
                  "",
                  "pm.test('request_id is present', () => pm.expect(j.request_id).to.be.a('string').and.not.empty);"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "{{api_key}}",
                "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
              }
            ],
            "url": {
              "raw": "{{api_url}}/{{api_prefix}}/webhooks",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "{{api_prefix}}",
                "webhooks"
              ]
            },
            "description": "EFFECT folder (same sequence). Read-only. Public docs: api/webhooks.md."
          },
          "response": [
            {
              "name": "200 OK",
              "originalRequest": {
                "method": "GET",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "{{api_key}}",
                    "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
                  }
                ],
                "url": {
                  "raw": "{{api_url}}/{{api_prefix}}/webhooks",
                  "host": [
                    "{{api_url}}"
                  ],
                  "path": [
                    "{{api_prefix}}",
                    "webhooks"
                  ]
                },
                "description": "EFFECT folder (same sequence). Read-only. Public docs: api/webhooks.md."
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"webhooks\": [\n    {\n      \"id\": \"00000000-0000-4000-8000-000000000080\",\n      \"url\": \"https://example.invalid/lexgo-sign-webhook\",\n      \"auth_type\": \"HEADER\",\n      \"subscriptions\": \"envelope.success,envelope.voided,recipient.signed_all,recipient.rejected\",\n      \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n      \"updated_at\": \"2026-01-15T12:00:00.000-03:00\"\n    }\n  ],\n  \"request_id\": \"00000000-0000-4000-8000-0000000000aa\"\n}"
            }
          ]
        },
        {
          "name": "Get webhook",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = pm.response.json();",
                  "",
                  "pm.test('Status is 200 and the id matches', () => {",
                  "    pm.expect(pm.response.code).to.eql(200);",
                  "    pm.expect(j.webhook.id).to.eql(pm.variables.get('webhook_id'));",
                  "});",
                  "",
                  "pm.test('request_id is present', () => pm.expect(j.request_id).to.be.a('string').and.not.empty);"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "{{api_key}}",
                "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
              }
            ],
            "url": {
              "raw": "{{api_url}}/{{api_prefix}}/webhooks/{{webhook_id}}",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "{{api_prefix}}",
                "webhooks",
                "{{webhook_id}}"
              ]
            },
            "description": "EFFECT folder (same sequence). Read-only. Public docs: api/webhooks.md."
          },
          "response": [
            {
              "name": "200 OK",
              "originalRequest": {
                "method": "GET",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "{{api_key}}",
                    "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
                  }
                ],
                "url": {
                  "raw": "{{api_url}}/{{api_prefix}}/webhooks/{{webhook_id}}",
                  "host": [
                    "{{api_url}}"
                  ],
                  "path": [
                    "{{api_prefix}}",
                    "webhooks",
                    "{{webhook_id}}"
                  ]
                },
                "description": "EFFECT folder (same sequence). Read-only. Public docs: api/webhooks.md."
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"webhook\": {\n    \"id\": \"00000000-0000-4000-8000-000000000080\",\n    \"url\": \"https://example.invalid/lexgo-sign-webhook\",\n    \"auth_type\": \"HEADER\",\n    \"subscriptions\": \"envelope.success,envelope.voided,recipient.signed_all,recipient.rejected\",\n    \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n    \"updated_at\": \"2026-01-15T12:00:00.000-03:00\"\n  },\n  \"request_id\": \"00000000-0000-4000-8000-0000000000aa\"\n}"
            },
            {
              "name": "404 Webhook not found",
              "originalRequest": {
                "method": "GET",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "{{api_key}}",
                    "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
                  }
                ],
                "url": {
                  "raw": "{{api_url}}/{{api_prefix}}/webhooks/{{webhook_id}}",
                  "host": [
                    "{{api_url}}"
                  ],
                  "path": [
                    "{{api_prefix}}",
                    "webhooks",
                    "{{webhook_id}}"
                  ]
                },
                "description": "EFFECT folder (same sequence). Read-only. Public docs: api/webhooks.md."
              },
              "status": "Not Found",
              "code": 404,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"error\": \"Webhook not found\",\n  \"request_id\": \"00000000-0000-4000-8000-0000000000aa\"\n}"
            }
          ]
        },
        {
          "name": "Update webhook",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = pm.response.json();",
                  "",
                  "pm.test('Status is 200 and subscriptions changed', () => {",
                  "    pm.expect(pm.response.code).to.eql(200);",
                  "    pm.expect(j.success).to.eql(true);",
                  "    pm.expect(j.webhook.subscriptions).to.eql('envelope.voided');",
                  "});",
                  "",
                  "pm.test('request_id is present', () => pm.expect(j.request_id).to.be.a('string').and.not.empty);"
                ]
              }
            }
          ],
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Authorization",
                "value": "{{api_key}}",
                "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{api_url}}/{{api_prefix}}/webhooks/{{webhook_id}}",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "{{api_prefix}}",
                "webhooks",
                "{{webhook_id}}"
              ]
            },
            "description": "EFFECT. Changes which events are delivered to the webhook URL. All fields are optional. Public docs: api/webhooks.md.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"url\": \"{{webhook_url}}\",\n  \"subscriptions\": \"envelope.voided\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [
            {
              "name": "200 OK",
              "originalRequest": {
                "method": "PUT",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "{{api_key}}",
                    "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": {
                  "raw": "{{api_url}}/{{api_prefix}}/webhooks/{{webhook_id}}",
                  "host": [
                    "{{api_url}}"
                  ],
                  "path": [
                    "{{api_prefix}}",
                    "webhooks",
                    "{{webhook_id}}"
                  ]
                },
                "description": "EFFECT. Changes which events are delivered to the webhook URL. All fields are optional. Public docs: api/webhooks.md.",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"url\": \"{{webhook_url}}\",\n  \"subscriptions\": \"envelope.voided\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"success\": true,\n  \"webhook\": {\n    \"id\": \"00000000-0000-4000-8000-000000000080\",\n    \"url\": \"https://example.invalid/lexgo-sign-webhook\",\n    \"auth_type\": \"HEADER\",\n    \"subscriptions\": \"envelope.voided\",\n    \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n    \"updated_at\": \"2026-01-15T12:00:00.000-03:00\"\n  },\n  \"request_id\": \"00000000-0000-4000-8000-0000000000aa\"\n}"
            },
            {
              "name": "404 Webhook not found",
              "originalRequest": {
                "method": "PUT",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "{{api_key}}",
                    "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": {
                  "raw": "{{api_url}}/{{api_prefix}}/webhooks/{{webhook_id}}",
                  "host": [
                    "{{api_url}}"
                  ],
                  "path": [
                    "{{api_prefix}}",
                    "webhooks",
                    "{{webhook_id}}"
                  ]
                },
                "description": "EFFECT. Changes which events are delivered to the webhook URL. All fields are optional. Public docs: api/webhooks.md.",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"url\": \"{{webhook_url}}\",\n  \"subscriptions\": \"envelope.voided\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "Not Found",
              "code": 404,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"error\": \"Webhook not found\",\n  \"request_id\": \"00000000-0000-4000-8000-0000000000aa\"\n}"
            }
          ]
        },
        {
          "name": "Delete webhook",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = pm.response.json();",
                  "",
                  "pm.test('Status is 200 and the webhook is gone', () => {",
                  "    pm.expect(pm.response.code).to.eql(200);",
                  "    pm.expect(j.success).to.eql(true);",
                  "    pm.expect(j.webhook.id).to.eql(pm.variables.get('webhook_id'));",
                  "});",
                  "pm.collectionVariables.set('webhook_id', '');",
                  "",
                  "pm.test('request_id is present', () => pm.expect(j.request_id).to.be.a('string').and.not.empty);"
                ]
              }
            }
          ],
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Authorization",
                "value": "{{api_key}}",
                "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
              }
            ],
            "url": {
              "raw": "{{api_url}}/{{api_prefix}}/webhooks/{{webhook_id}}",
              "host": [
                "{{api_url}}"
              ],
              "path": [
                "{{api_prefix}}",
                "webhooks",
                "{{webhook_id}}"
              ]
            },
            "description": "EFFECT. Deletes the webhook. Clears webhook_id. Public docs: api/webhooks.md."
          },
          "response": [
            {
              "name": "200 OK",
              "originalRequest": {
                "method": "DELETE",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "{{api_key}}",
                    "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
                  }
                ],
                "url": {
                  "raw": "{{api_url}}/{{api_prefix}}/webhooks/{{webhook_id}}",
                  "host": [
                    "{{api_url}}"
                  ],
                  "path": [
                    "{{api_prefix}}",
                    "webhooks",
                    "{{webhook_id}}"
                  ]
                },
                "description": "EFFECT. Deletes the webhook. Clears webhook_id. Public docs: api/webhooks.md."
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"success\": true,\n  \"webhook\": {\n    \"id\": \"00000000-0000-4000-8000-000000000080\",\n    \"url\": \"https://example.invalid/lexgo-sign-webhook\",\n    \"auth_type\": \"HEADER\",\n    \"subscriptions\": \"envelope.success,envelope.voided,recipient.signed_all,recipient.rejected\",\n    \"created_at\": \"2026-01-15T12:00:00.000-03:00\",\n    \"updated_at\": \"2026-01-15T12:00:00.000-03:00\"\n  },\n  \"request_id\": \"00000000-0000-4000-8000-0000000000aa\"\n}"
            },
            {
              "name": "404 Webhook not found",
              "originalRequest": {
                "method": "DELETE",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "{{api_key}}",
                    "description": "Sign API key. Sent as the raw key (a Bearer prefix also works)."
                  }
                ],
                "url": {
                  "raw": "{{api_url}}/{{api_prefix}}/webhooks/{{webhook_id}}",
                  "host": [
                    "{{api_url}}"
                  ],
                  "path": [
                    "{{api_prefix}}",
                    "webhooks",
                    "{{webhook_id}}"
                  ]
                },
                "description": "EFFECT. Deletes the webhook. Clears webhook_id. Public docs: api/webhooks.md."
              },
              "status": "Not Found",
              "code": 404,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"error\": \"Webhook not found\",\n  \"request_id\": \"00000000-0000-4000-8000-0000000000aa\"\n}"
            }
          ]
        }
      ],
      "event": [
        {
          "listen": "prerequest",
          "script": {
            "type": "text/javascript",
            "exec": [
              "// EFFECT folder guard: the requests in this folder have real side effects.",
              "if (pm.variables.get('effects_confirmed') !== 'yes') {",
              "    console.warn('Skipped \"' + pm.info.requestName + '\": set effects_confirmed to yes to run EFFECT requests.');",
              "    pm.execution.skipRequest();",
              "}"
            ]
          }
        }
      ]
    },
    {
      "name": "7. EFFECT - OAuth client reminders (optional, creates a real Alert)",
      "description": "EFFECT, optional. The only request on the web host (app_url) using an OAuth Bearer token. Skipped unless effects_confirmed is yes and the OAuth variables are set.",
      "item": [
        {
          "name": "Create signing reminder (OAuth Client API)",
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const missing = ['oauth_token', 'enterprise_id', 'document_id'].filter((name) => !pm.variables.get(name));",
                  "if (missing.length) {",
                  "    console.warn('Skipped reminder: empty variables: ' + missing.join(', '));",
                  "    pm.execution.skipRequest();",
                  "} else {",
                  "    const d = new Date(Date.now() + 30 * 24 * 60 * 60 * 1000);",
                  "    pm.collectionVariables.set('reminder_alert_date', d.toISOString().slice(0, 10));",
                  "}"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const j = pm.response.json();",
                  "pm.test('Status is 201', () => pm.response.to.have.status(201));",
                  "pm.test('Reminder has the documented fields', () => {",
                  "    pm.expect(j.reminder).to.include.keys('id', 'alert_id', 'document_id', 'alert_date', 'offset_days', 'fire_date', 'channel', 'delivery_status', 'created_at');",
                  "    pm.expect(j.reminder.alert_date).to.eql(pm.variables.get('reminder_alert_date'));",
                  "    pm.expect(j.reminder.offset_days).to.eql(3);",
                  "    pm.expect(j.reminder.channel).to.eql('email');",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{oauth_token}}"
              },
              {
                "key": "X-Enterprise-Id",
                "value": "{{enterprise_id}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{app_url}}/api/client/documents/{{document_id}}/reminders",
              "host": [
                "{{app_url}}"
              ],
              "path": [
                "api",
                "client",
                "documents",
                "{{document_id}}",
                "reminders"
              ]
            },
            "description": "EFFECT, optional and isolated from the Sign API. This is the OAuth Client API on the web host (app_url), not /v1: it needs a Doorkeeper access token (scope client) in oauth_token, the integer enterprise_id in X-Enterprise-Id and an enterprise permission on the document. It creates a REAL Alert and Reminder; the reminder email goes out on fire_date (alert_date minus offset_days). Skipped when oauth_token, enterprise_id or document_id is empty. Reference: docs/api-client.md section 34 in the application repository.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"alert_date\": \"{{reminder_alert_date}}\",\n  \"offset_days\": 3,\n  \"channel\": \"email\",\n  \"custom_message\": \"Fictional reminder created from the Postman collection\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [
            {
              "name": "201 Created",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "Bearer {{oauth_token}}"
                  },
                  {
                    "key": "X-Enterprise-Id",
                    "value": "{{enterprise_id}}"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": {
                  "raw": "{{app_url}}/api/client/documents/{{document_id}}/reminders",
                  "host": [
                    "{{app_url}}"
                  ],
                  "path": [
                    "api",
                    "client",
                    "documents",
                    "{{document_id}}",
                    "reminders"
                  ]
                },
                "description": "EFFECT, optional and isolated from the Sign API. This is the OAuth Client API on the web host (app_url), not /v1: it needs a Doorkeeper access token (scope client) in oauth_token, the integer enterprise_id in X-Enterprise-Id and an enterprise permission on the document. It creates a REAL Alert and Reminder; the reminder email goes out on fire_date (alert_date minus offset_days). Skipped when oauth_token, enterprise_id or document_id is empty. Reference: docs/api-client.md section 34 in the application repository.",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"alert_date\": \"{{reminder_alert_date}}\",\n  \"offset_days\": 3,\n  \"channel\": \"email\",\n  \"custom_message\": \"Fictional reminder created from the Postman collection\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "Created",
              "code": 201,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "cookie": [],
              "body": "{\n  \"reminder\": {\n    \"id\": 1,\n    \"alert_id\": 42,\n    \"document_id\": 1234,\n    \"alert_date\": \"2026-09-01\",\n    \"offset_days\": 3,\n    \"fire_date\": \"2026-08-29\",\n    \"channel\": \"email\",\n    \"delivery_status\": \"pending\",\n    \"created_at\": \"2026-01-15T12:00:00.000-03:00\"\n  }\n}"
            }
          ]
        }
      ],
      "event": [
        {
          "listen": "prerequest",
          "script": {
            "type": "text/javascript",
            "exec": [
              "// EFFECT folder guard: the requests in this folder have real side effects.",
              "if (pm.variables.get('effects_confirmed') !== 'yes') {",
              "    console.warn('Skipped \"' + pm.info.requestName + '\": set effects_confirmed to yes to run EFFECT requests.');",
              "    pm.execution.skipRequest();",
              "}"
            ]
          }
        }
      ]
    }
  ],
  "event": [
    {
      "listen": "prerequest",
      "script": {
        "type": "text/javascript",
        "exec": [
          "// Fail closed on a wrong setup: make the request unsendable (a script error alone would not stop it) and fail the run loudly.",
          "// 1) api_url is the host only; the path prefix is api_prefix.",
          "if (!/^https?:\\/\\/[^\\/?#]+$/i.test(String(pm.variables.get('api_url') || ''))) {",
          "    pm.request.url.update('setup-guard-blocked://not-sent');",
          "    throw new Error('api_url must be the host only (for example https://api.lexgo.cl) with no path, query or trailing slash; the path prefix is api_prefix. See README, section \"Migrating an older environment\".');",
          "}",
          "// 2) Generated state lives in collection variables. An environment, data file or --env-var with the same name",
          "//    would shadow it and requests would use a wrong id.",
          "const stateNames = [\"envelope_id\", \"json_envelope_id\", \"upload_envelope_id\", \"zero_envelope_id\", \"signer_id\", \"approver_id\", \"witness_id\", \"json_signer_id\", \"metadata_sent\", \"presigned_url_id\", \"presigned_url\", \"webhook_id\", \"settings_backup_json\", \"reminder_alert_date\", \"upload_poll_attempts\", \"storage_skipped\"];",
          "stateNames.forEach((name) => {",
          "    if (pm.variables.get(name) !== pm.collectionVariables.get(name)) {",
          "        pm.request.url.update('setup-guard-blocked://not-sent');",
          "        throw new Error('Variable ' + name + ' is shadowed by an environment, data file or local value. Delete it from that environment. See README, section \"Migrating an older environment\".');",
          "    }",
          "});",
          "// Production guard: outside folder 0 (connectivity), skip every request on a production host",
          "// unless production_confirmed is yes. Hosts are read from api_url and app_url.",
          "const hostOf = (value) => {",
          "    const m = String(value || '').match(/^[a-z]+:\\/\\/([^\\/:?#]+)/i);",
          "    return m ? m[1].toLowerCase() : '';",
          "};",
          "const productionHosts = ['api.lexgo.cl', 'app.lexgo.cl'];",
          "const onProduction = ['api_url', 'app_url'].some((name) => productionHosts.includes(hostOf(pm.variables.get(name))));",
          "const location = pm.execution.location || [];",
          "const inConnectivity = String(location[1] || '').indexOf('0. SAFE') === 0;",
          "if (onProduction && !inConnectivity && pm.variables.get('production_confirmed') !== 'yes') {",
          "    console.warn('Skipped \"' + pm.info.requestName + '\": production host. Set production_confirmed to yes to run it.');",
          "    pm.execution.skipRequest();",
          "}"
        ]
      }
    }
  ],
  "variable": [
    {
      "key": "api_prefix",
      "value": "v1",
      "type": "string",
      "description": "Default API path prefix: v1 on gateway hosts. An environment overrides it (api/v1 for a local server)."
    },
    {
      "key": "sample_pdf_base64",
      "value": "JVBERi0xLjQKJeLjz9MKMSAwIG9iago8PCAvVHlwZSAvQ2F0YWxvZyAvUGFnZXMgMiAwIFIgPj4KZW5kb2JqCjIgMCBvYmoKPDwgL1R5cGUgL1BhZ2VzIC9LaWRzIFszIDAgUl0gL0NvdW50IDEgPj4KZW5kb2JqCjMgMCBvYmoKPDwgL1R5cGUgL1BhZ2UgL1BhcmVudCAyIDAgUiAvTWVkaWFCb3ggWzAgMCA1OTUgODQyXSAvUmVzb3VyY2VzIDw8IC9Gb250IDw8IC9GMSA0IDAgUiA+PiA+PiAvQ29udGVudHMgNSAwIFIgPj4KZW5kb2JqCjQgMCBvYmoKPDwgL1R5cGUgL0ZvbnQgL1N1YnR5cGUgL1R5cGUxIC9CYXNlRm9udCAvSGVsdmV0aWNhID4+CmVuZG9iago1IDAgb2JqCjw8IC9MZW5ndGggNDAyID4+CnN0cmVhbQpCVCAvRjEgMTggVGYgNzIgNzYwIFRkIChMZXhnbyBTaWduIHNhbXBsZSAtIGZpY3Rpb25hbCkgVGogRVQKQlQgL0YxIDExIFRmIDcyIDczMCBUZCAoRmljdGlvbmFsIHRlc3QgZG9jdW1lbnQuIE5vdCBhIGNvbnRyYWN0LiBObyByZWFsIHBhcnRpZXMuKSBUaiBFVApCVCAvRjEgMTEgVGYgNzIgNzAwIFRkIChbW1NJR04tSEVSRS0xXV0pIFRqIEVUCkJUIC9GMSAxMSBUZiA3MiA2ODAgVGQgKFtbU0lHTi1IRVJFLTJdXSkgVGogRVQKJSBsZXhnbyBzaWduIGZpY3Rpb25hbCBwYWRkaW5nIDAwMDAwMCAuLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uCiUgbGV4Z28gc2lnbiBmaWN0aW9uYWwgcGFkZGluZyAwMDAwMDEgLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLgplbmRzdHJlYW0KZW5kb2JqCjYgMCBvYmoKPDwgL1RpdGxlIChMZXhnbyBTaWduIHNhbXBsZSAtIGZpY3Rpb25hbCkgL1Byb2R1Y2VyIChMZXhnbyBTaWduIGRvY3MgZml4dHVyZSBnZW5lcmF0b3IpID4+CmVuZG9iagp4cmVmCjAgNwowMDAwMDAwMDAwIDY1NTM1IGYgCjAwMDAwMDAwMTUgMDAwMDAgbiAKMDAwMDAwMDA2NCAwMDAwMCBuIAowMDAwMDAwMTIxIDAwMDAwIG4gCjAwMDAwMDAyNDcgMDAwMDAgbiAKMDAwMDAwMDMxNyAwMDAwMCBuIAowMDAwMDAwNzY5IDAwMDAwIG4gCnRyYWlsZXIKPDwgL1NpemUgNyAvUm9vdCAxIDAgUiAvSW5mbyA2IDAgUiAvSUQgWzw0YzY1Nzg2NzZmNTM2OTY3NmU1MzYxNmQ3MDZjNjUzMT48NGM2NTc4Njc2ZjUzNjk2NzZlNTM2MTZkNzA2YzY1MzE+XSA+PgpzdGFydHhyZWYKODc1CiUlRU9GCg==",
      "type": "string",
      "description": "Fictional one-page PDF (fixtures/small.pdf) as base64, used by the JSON and multipart creates."
    },
    {
      "key": "webhook_url",
      "value": "https://example.invalid/lexgo-sign-webhook",
      "type": "string",
      "description": "Non-routable default webhook target."
    },
    {
      "key": "validation_code",
      "value": "000000",
      "type": "string",
      "description": "Code submitted by Verify validation code. Replace it with the code from the email."
    },
    {
      "key": "envelope_id",
      "value": "",
      "type": "string"
    },
    {
      "key": "json_envelope_id",
      "value": "",
      "type": "string"
    },
    {
      "key": "upload_envelope_id",
      "value": "",
      "type": "string"
    },
    {
      "key": "signer_id",
      "value": "",
      "type": "string"
    },
    {
      "key": "approver_id",
      "value": "",
      "type": "string"
    },
    {
      "key": "witness_id",
      "value": "",
      "type": "string"
    },
    {
      "key": "json_signer_id",
      "value": "",
      "type": "string"
    },
    {
      "key": "metadata_sent",
      "value": "",
      "type": "string"
    },
    {
      "key": "presigned_url_id",
      "value": "",
      "type": "string"
    },
    {
      "key": "presigned_url",
      "value": "",
      "type": "string"
    },
    {
      "key": "webhook_id",
      "value": "",
      "type": "string"
    },
    {
      "key": "settings_backup_json",
      "value": "",
      "type": "string"
    },
    {
      "key": "zero_envelope_id",
      "value": "",
      "type": "string"
    },
    {
      "key": "upload_poll_attempts",
      "value": "",
      "type": "string"
    },
    {
      "key": "storage_skipped",
      "value": "",
      "type": "string"
    },
    {
      "key": "upload_poll_max",
      "value": "40",
      "type": "string",
      "description": "Maximum attempts of the upload completion poll (capped at 100)."
    },
    {
      "key": "upload_poll_delay_ms",
      "value": "3000",
      "type": "string",
      "description": "Pause between poll attempts in milliseconds (capped at 3000)."
    },
    {
      "key": "reminder_alert_date",
      "value": "",
      "type": "string"
    }
  ]
}
