Outcome
Read the immutable completed PDF only after the exact envelope is completed and its retained artifact is ready. The SDK returns contentType, contentLength and contentBase64.
Before you start
- Verify the environment, authenticated identity and specifically approved organization context.
- The published application permission is workspace:read. Resolve and bind the exact canonical Sign workspace. A supplied id or organization membership alone grants no workspace access.
- Session callers require read workspace access. API-key resource binding is verified by Auth; never treat a caller-supplied header as an independent grant.
Discover the target
topolo whoami --json
topolo actions get app_topolo_sign.envelopes.completed_document.get --detail --json
topolo resources topolo-sign --json
topolo workspaces list topolo-sign --json
- Set SIGN_WORKSPACE_ID to the exact granted workspace returned by discovery.
- Resolve envelopeId through envelopes.list/get or retain the exact creation response.
Request
GET /api/envelopes/{envelopeId}/completed-document
Inspect and test this action. Save the reviewed input as payload.json. Supply resource context separately.
Input fields
| Field | Required | Meaning | Constraints |
|---|---|---|---|
envelopeId | Required | Exact envelope.id returned by creation or envelopes.list/get in this workspace. | {"minLength":1} |
Read the complete input schema.
Effects
- Reads retained bytes with existing workspace:read authorization. No agreement, consent or recipient data is changed.
- The server verifies stored object SHA-256 before returning bytes. Artifact download records an existing operational download event.
Interpret the response
Binary transport returns no resource identifier. Retain the authorized input documentId or envelopeId; decoded bytes are the downloaded artifact.
Read envelopes.audit_certificate.get with the retained envelopeId in the same granted workspace. Base64-decode contentBase64 and compare its byte length with contentLength. SHA-256 the decoded bytes and compare with artifacts[].sha256 for kind completed_pdf from the authorized metadata read. Never hash the Base64 string. The SDK binary projection contains bytes and type, not a new document id or filename. Retain the input identifier and choose a local filename deliberately.
Inspect the success schema. CLI/MCP add their transport envelope; --detail requests the full CLI result. HTTP 204 contains no JSON payload.
Worked examples
Captured from the exported Sign Worker with the existing SQLite-backed D1 harness applying all core, envelope and audit migrations to one local database, in-memory R2 and synthetic Auth/workspace/archive/Notify transports. These examples prove local validation, persistence and artifact production. They do not prove separate deployed D1 topology, real recipient consent, provider delivery or a live signed agreement. All identities, signing links and documents are synthetic; replace identifiers through authorized discovery and never execute a fixture against a live organization. Binary download examples use the released SDK binary projection; tests Base64-decode and compare original bytes, lengths and server SHA-256 headers.
Refused request · HTTP 409
Input · payload.json:
{
"envelopeId": "b0db0353-6d5a-4a9b-b3f4-85f439ec4953"
}
CLI:
topolo actions validate app_topolo_sign.envelopes.completed_document.get --data @payload.json --json
topolo actions plan app_topolo_sign.envelopes.completed_document.get --resource-type workspace --resource-id "$SIGN_WORKSPACE_ID" --data @payload.json --json
Captured exported Worker response · HTTP 409:
{
"error": "completed_document_not_ready"
}
HTTP 409. Resolve the exact refusal before retrying. This request is not a successful workflow.
Supported request · Read the immutable completed PDF and verify its SHA-256
Input · payload.json:
{
"envelopeId": "b0db0353-6d5a-4a9b-b3f4-85f439ec4953"
}
CLI:
topolo actions validate app_topolo_sign.envelopes.completed_document.get --data @payload.json --json
topolo actions plan app_topolo_sign.envelopes.completed_document.get --resource-type workspace --resource-id "$SIGN_WORKSPACE_ID" --data @payload.json --json
topolo actions call app_topolo_sign.envelopes.completed_document.get --resource-type workspace --resource-id "$SIGN_WORKSPACE_ID" --data @payload.json --detail --json
MCP tool and arguments:
{
"tool": "topolo_read_action",
"arguments": {
"actionId": "app_topolo_sign.envelopes.completed_document.get",
"input": {
"envelopeId": "b0db0353-6d5a-4a9b-b3f4-85f439ec4953"
},
"resourceType": "workspace",
"resourceId": "<exact granted id from discovery>",
"detail": true
}
}
Captured canonical SDK binary projection of the exported Worker response · HTTP 200:
{
"contentType": "application/pdf",
"contentLength": 4285,
"contentBase64": "JVBERi0xLjcKJYGBgYEKCjEgMCBvYmoKPDwKL1R5cGUgL1BhZ2VzCi9LaWRzIFsgNSAwIFIgMTUgMCBSIF0KL0NvdW50IDIKPj4KZW5kb2JqCgoyIDAgb2JqCjw8Ci9UeXBlIC9DYXRhbG9nCi9QYWdlcyAxIDAgUgovQWNyb0Zvcm0gNyAwIFIKL1ZpZXdlclByZWZlcmVuY2VzIDE3IDAgUgo+PgplbmRvYmoKCjMgMCBvYmoKPDwKL1Byb2R1Y2VyIDxGRUZGMDA1ND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DAwMDAyMzgzIDAwMDAwIG4gCjAwMDAwMDI3MzAgMDAwMDAgbiAKMDAwMDAwMzE3MCAwMDAwMCBuIAowMDAwMDAzODAxIDAwMDAwIG4gCgp0cmFpbGVyCjw8Ci9TaXplIDE4Ci9Sb290IDIgMCBSCi9JbmZvIDMgMCBSCj4+CgpzdGFydHhyZWYKMzg0NgolJUVPRg=="
}
HTTP 200. Read envelopes.audit_certificate.get with the retained envelopeId in the same granted workspace. Base64-decode contentBase64 and compare its byte length with contentLength. SHA-256 the decoded bytes and compare with artifacts[].sha256 for kind completed_pdf from the authorized metadata read. Never hash the Base64 string. The SDK binary projection contains bytes and type, not a new document id or filename. Retain the input identifier and choose a local filename deliberately.
Refused request · HTTP 401
Input · payload.json:
{
"envelopeId": "ed22fca5-d5f0-4392-8e71-96e247bf3875"
}
CLI:
topolo actions validate app_topolo_sign.envelopes.completed_document.get --data @payload.json --json
topolo actions plan app_topolo_sign.envelopes.completed_document.get --resource-type workspace --resource-id "$SIGN_WORKSPACE_ID" --data @payload.json --json
Captured exported Worker response · HTTP 401:
{
"error": "Token validation failed"
}
HTTP 401. Resolve the exact refusal before retrying. This request is not a successful workflow.
Refused request · HTTP 403
Input · payload.json:
{
"envelopeId": "synthetic-unresolved-fixture"
}
CLI:
topolo actions validate app_topolo_sign.envelopes.completed_document.get --data @payload.json --json
topolo actions plan app_topolo_sign.envelopes.completed_document.get --resource-type workspace --resource-id "$SIGN_WORKSPACE_ID" --data @payload.json --json
Captured exported Worker response · HTTP 403:
{
"error": "You do not have access to this workspace",
"code": "workspace_forbidden"
}
HTTP 403. Resolve the exact refusal before retrying. This request is not a successful workflow.
Verify the result
- Read envelopes.audit_certificate.get with the retained envelopeId in the same granted workspace.
- Base64-decode contentBase64 and compare its byte length with contentLength. SHA-256 the decoded bytes and compare with artifacts[].sha256 for kind completed_pdf from the authorized metadata read. Never hash the Base64 string.
- The SDK binary projection contains bytes and type, not a new document id or filename. Retain the input identifier and choose a local filename deliberately.
Errors and recovery
envelope_not_found(HTTP 404): Discover the exact retained identifier in this authorized workspace; do not substitute an identifier from another workspace.artifact_integrity_failed(HTTP 500): Stored artifact bytes do not match the retained SHA-256. Preserve the envelope, expected hash and request id and report the integrity incident; do not substitute a new hash.completed_document_not_ready(HTTP 409): Read the retained envelope and restore the complete intended recipient list through an authorized draft update before attempting send.auth_error(HTTP 401): Reauthenticate in the same approved context before retrying.workspace_forbidden(HTTP 403): Discover the actual workspace grant and obtain the documented required access; do not retry with a guessed workspace or broader organization.
Some existing refusals return a human message as error rather than a stable code; preserve the actual response, status and request id. Platform validation, authentication and resource checks can refuse before the handler.
Recovery boundary
A download changes no agreement. Resolve the actual grant and artifact readiness, then repeat the same read. Never recreate or re-sign an agreement to make a download succeed.
Related actions
- Get Sign audit certificate: Get the immutable audit certificate issued when an envelope completed: signer identities, capacities, consent and evidence hashes, the source and completed document SHA-256 and a hash chain over the audit trail, plus the certificate's own hash.
Evidence
Captured from the exported Sign Worker with the existing SQLite-backed D1 harness applying all core, envelope and audit migrations to one local database, in-memory R2 and synthetic Auth/workspace/archive/Notify transports. These examples prove local validation, persistence and artifact production. They do not prove separate deployed D1 topology, real recipient consent, provider delivery or a live signed agreement. All identities, signing links and documents are synthetic; replace identifiers through authorized discovery and never execute a fixture against a live organization. Binary download examples use the released SDK binary projection; tests Base64-decode and compare original bytes, lengths and server SHA-256 headers.