Skip to content

Integrations

DocuSign SDK: get started

The complete DocuSign API through typed application or agent clients

Use an ordinary App, or an Agent when the workload needs agent identity. Alter builds provider requests from a reviewed contract and applies the same connection authorization, policy, approvals, and audit records as raw requests.

Terminal window
npm install @alter-ai/sdk @alter-ai/docusign
# Python (installs core automatically)
pip install alter-sdk-docusign

The provider package includes only DocuSign types and response schemas and pins its contract version.

Configure DocuSign, request the scopes the application needs, and retain each customer’s grant ID after Connect consent. Alter supplies the credential; it never belongs in operation input. Use an account ID from authenticated userinfo: consent binds each account to its verified datacenter. Connections created before account-origin capture must reconnect. Admin calls use the fixed Admin host.

import { App } from "@alter-ai/sdk";
import { DocuSignIntegration } from "@alter-ai/docusign";
const app = new App({ apiKey: process.env.ALTER_API_KEY! });
try {
const client = new DocuSignIntegration(app, { grantId: process.env.DOCUSIGN_GRANT_ID! });
const result = await (await client.esignature.esignatureFoldersGetFolders({ path: { accountId: process.env.DOCUSIGN_ACCOUNT_ID! } })).wait();
console.log(result.bodyJson());
} finally {
await app.close();
}
from alter_sdk import App
from alter_sdk_docusign import DocuSignIntegration
async def first_call(api_key: str, grant_id: str):
async with App(api_key=api_key) as app:
client = DocuSignIntegration(app, {"grant_id": grant_id})
call = await client.esignature.esignature_folders_get_folders({"path": {"accountId": "your-docusign-account-id"}})
result = await call.wait()
return result.body_json()

Contract 2026-11-03 publishes 417 methods from the official Admin, Click and eSignature specifications. The policy catalog covers 525 distinct routes; 108 routes are deliberately excluded from SDK publication with written reasons. The API reference links every operation to its complete input fields, response models, TypeScript and Python examples, and policy identity. Browse by resource under this provider’s API reference in the Integrations sidebar, or download the pinned OpenAPI specification. The Developer Portal provider view and alter integrations operations docusign --version 2026-11-03 also expose the schemas.

Generated calls pin the Alter contract version. DocuSign’s own product, role, scope and subscription requirements still apply. There is no silent version fallback and no automatic write retry or pagination.

Terminal window
alter integrations execute docusign docusign.esignature_folders_getfolders \
--version 2026-11-03 --grant "$DOCUSIGN_GRANT_ID" --input '{"path":{"accountId":"your-docusign-account-id"}}' --wait

Arguments use native path, query, headers, and body containers. Array query parameters are sent the way the provider’s document declares them: one delimited value where it declares explode: false (or a pipe- or space-delimited style), repeated keys otherwise. SDK methods preserve provider field names, decimal lexemes and large integers as strings when necessary. HTTP 204 returns null / None from the typed decoder. Binary responses use bodyBytes() / body_bytes(); the CLI can save them with --output-file.

A policy rule can require approval for any operation. The call returns a pending approval; wait() resolves once the approver decides, and resume(approvalId) picks a pending approval up after a restart. Approval cards show the operation, its contract version and the request input the sensitivity review marked safe to display.

Logo, document and signature-image uploads accept a body file object with filename, content_type and base64 content_base64. Brand resources use that file object at body["file.xml"]. Alter sends raw bytes or the documented multipart part; chunk uploads use JSON data. The shared 5 MiB serialized-input ceiling applies. Sensitive file contents are never displayed in approvals; an input that cannot be frozen safely produces an explicit approval error.

Recipient delivery and caller-selected destinations carry send; billing payments carry payment; account configuration and permission administration carry admin. Removing, closing, archiving or disabling a whole resource or relationship carries delete, including via an update argument. Ordinary field replacements remain write. Missing provider state retains the conservative possible effects.

Credential creation, account-security changes and privilege grants are absent from the SDK and refused by default on raw calls. Mixed updates retain request-dependent refusal. Narrow-purpose view links, lock tokens and webhook signing secrets remain available with secret_output, so their responses are never captured.

Capture follows the application setting and masks the reviewed identifiers, email, bank/card data, passwords, private form values and documents. Binary responses are withheld. Raw and SDK calls share these decisions. DocuSign error envelopes and collection-wide 2xx failures are recognized; partial success and asynchronous work in progress remain provider results.

The pinned official source, its hash, the generated methods and the policy mapping are checked together. Scheduled checks save upstream candidates and report additions, removals and schema changes; they never replace a published contract automatically. Existing contract versions remain available for installed SDKs and pending approvals.

Persist call.approvalId (TypeScript) or call.approval_id (Python), then construct a fresh provider client and call resume(savedId), followed by wait(). The stored approval selects the operation; this installed package verifies its provider and contract version before attaching the response validator. Mismatches raise ManagedOperationError, never silently decode using another contract. See persist-and-resume examples.

Policy operation fields also accept the published SDK function IDs listed by alter integrations operations docusign. Use when.operation for a json_match or conditional require_approval rule, or match.operations for content_match (including redaction and step-up). Conditional approval can also use when.match.operations with parameter conditions. alter policy simulate --operation <function-id> tests that exact function.

Managed calls carry a server-verified function identity. Alter still evaluates policy against the actual method, URL and body after building the request from the authorized connection. Existing endpoint, method, host, catalog-operation and family rules continue to apply unchanged. A raw call can share an endpoint with several SDK functions and matches all of them; a function name never grants permission or bypasses existing restrictions.

For example, this rule requires approval for one function:

{
"effect": "require_approval",
"when": { "operation": "docusign.esignature_accountcustomfields_postaccountcustomfields" },
"approval": { "approvers": ["reviewer@example.com"] }
}

Save it with alter policy rules create --app <app-id> --grant <grant-id> --type require_approval --body @rule.json, or select the function in the portal.

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.