@assinafy/sdk 3.0.2 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,29 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [3.1.0] - 2026-11-24
11
+
12
+ ### Added
13
+
14
+ - Scheduled assignments and envelopes through `client.scheduledSends`, including
15
+ listing, cancellation and immediate dispatch on supported staging deployments.
16
+ - Document watchers, signer capacities, notification delivery/open history and
17
+ envelope reminder cost estimates on staging.
18
+ - Typed PNG/JPEG signature-image upload options.
19
+
20
+ ### Fixed
21
+
22
+ - Preserve and validate assignment `sign_as` on creation and cost estimation.
23
+ - Use current cost estimates for certificate pricing in integration guidance.
24
+ - Require Axios 1.21.1, including its updated redirect dependency minimum.
25
+ - Reject malformed webhook signature entries with extra comma-separated data.
26
+
27
+ ### Changed
28
+
29
+ - GitHub builds and releases use Node.js 26 LTS, retaining Node.js 22/24 support.
30
+ - Keep local maintenance utilities outside version control; CI uses tracked
31
+ contract and packed-consumer tests.
32
+
10
33
  ## [3.0.2] - 2026-11-12
11
34
 
12
35
  ### Fixed
@@ -1039,7 +1062,8 @@ signer fields with `cpf` and `whatsapp_phone_number`.
1039
1062
  - High-level `uploadAndRequestSignatures` helper on `AssinafyClient`.
1040
1063
  - `PaginatedResult<T>` with parsed `X-Pagination-*` header meta.
1041
1064
 
1042
- [Unreleased]: https://github.com/assinafy/typescript-sdk/compare/v3.0.2...HEAD
1065
+ [Unreleased]: https://github.com/assinafy/typescript-sdk/compare/v3.1.0...HEAD
1066
+ [3.1.0]: https://github.com/assinafy/typescript-sdk/releases/tag/v3.1.0
1043
1067
  [3.0.2]: https://github.com/assinafy/typescript-sdk/compare/v3.0.1...v3.0.2
1044
1068
  [3.0.1]: https://github.com/assinafy/typescript-sdk/compare/v3.0.0...v3.0.1
1045
1069
  [3.0.0]: https://github.com/assinafy/typescript-sdk/compare/v2.11.0...v3.0.0
package/README.en.md CHANGED
@@ -10,6 +10,9 @@ session exchange is reserved for Assinafy's embed page), plus compatibility exte
10
10
  maintained by the API. The complete reference, including payloads, responses, errors, and examples
11
11
  for every resource, is in the **[English manual](docs/README.en.md)**.
12
12
 
13
+ Staging also exposes ten additional operations for scheduled sends, watchers, capacities,
14
+ notification history and envelope reminder estimates; see the [coverage map](docs/API_COVERAGE.md).
15
+
13
16
  ## Requirements
14
17
 
15
18
  - Node.js 22+ or Bun 1.4.4
@@ -100,6 +103,8 @@ factories.
100
103
  5. Deliver the signing URL, or show the signing screen inside your app with `client.embed`, and
101
104
  authenticate webhooks before processing events.
102
105
  6. Observe completion and download the signed document or certificate.
106
+ 7. Track contract terms with `client.contracts`; on staging, defer a request with
107
+ `client.scheduledSends` and monitor its `pending`, `sent` or `failed` state.
103
108
 
104
109
  WhatsApp, ID-document and face biometrics, ICP-Brasil digital certificates, and per-account
105
110
  `Bypass` verification have specific prerequisites; `workspaces.get(id, { expand:
@@ -115,6 +120,7 @@ in their browser. See the [signing branches](docs/README.en.md#paid-signing-bran
115
120
  | `client.assignments` | Requests, costs, notifications, and identity review |
116
121
  | `client.envelopes` | Several documents to the same signers, one invitation and one charge |
117
122
  | `client.embed` | Embed origins and single-use sessions for in-app signing |
123
+ | `client.scheduledSends` | Deferred assignments and envelopes (staging) |
118
124
  | `client.contracts` | Terms, families, renewals, and contract termination |
119
125
  | `client.templates`, `client.tags`, `client.fields` | Reusable content and fields |
120
126
  | `client.workspaces`, `client.users` | Workspace, branding, usage, notification policy, preferences, and MFA/TOTP |
package/README.md CHANGED
@@ -10,6 +10,10 @@ O SDK mapeia as 147 operações do OpenAPI publicado (146 com métodos; a troca
10
10
  pela API. A referência completa, com payloads, respostas, erros e exemplos de cada recurso, está no
11
11
  **[manual em português](docs/README.md)**.
12
12
 
13
+ Staging também oferece dez operações adicionais para agendamentos, observadores, qualificação
14
+ dos signatários, histórico de notificações e estimativa de lembretes de envelopes; veja o
15
+ [mapa de cobertura](docs/API_COVERAGE.md).
16
+
13
17
  ## Requisitos
14
18
 
15
19
  - Node.js 22+ ou Bun 1.4.4
@@ -100,6 +104,8 @@ O [manual de configuração](docs/README.md#configuração) explica retentativas
100
104
  5. Entregue a URL de assinatura, ou exiba a tela de assinatura dentro do seu app com
101
105
  `client.embed`, e valide os webhooks antes de processar eventos.
102
106
  6. Acompanhe a conclusão e baixe o documento assinado ou o certificado.
107
+ 7. Gerencie termos com `client.contracts`; em staging, agende com
108
+ `client.scheduledSends` e acompanhe o estado `pending`, `sent` ou `failed`.
103
109
 
104
110
  WhatsApp, biometria com documento e face, certificado digital ICP-Brasil e a verificação `Bypass`
105
111
  (habilitada por conta) têm pré-requisitos específicos; `workspaces.get(id, { expand:
@@ -115,6 +121,7 @@ signatário no navegador. Consulte os [ramos de assinatura](docs/README.md#ramos
115
121
  | `client.assignments` | Solicitações, custos, notificações e revisão de identidade |
116
122
  | `client.envelopes` | Vários documentos aos mesmos signatários, um convite e uma cobrança |
117
123
  | `client.embed` | Origens e sessões de uso único para assinar dentro do seu app |
124
+ | `client.scheduledSends` | Assignments e envelopes agendados (staging) |
118
125
  | `client.contracts` | Termos, famílias, renovação e encerramento de contratos |
119
126
  | `client.templates`, `client.tags`, `client.fields` | Conteúdo reutilizável e campos |
120
127
  | `client.workspaces`, `client.users` | Workspace, tema, uso do plano, política de notificações, preferências e MFA/TOTP |
package/SECURITY.md CHANGED
@@ -69,8 +69,10 @@ opportunity to upgrade.
69
69
  JSON only after verification. The default five-minute timestamp tolerance
70
70
  blocks replayed deliveries; keep the receiver clock synchronized. Rotate the
71
71
  secret with `webhooks.rotateEndpointSecret()` when it may have leaked —
72
- rotation is immediate and the secret/rotate routes accept an API key only,
73
- not OAuth tokens. See `docs/COMPATIBILITY.md`.
72
+ rotation is immediate by default. Readback requires an API key; OAuth
73
+ applications with `webhooks:write` can rotate and receive the new secret.
74
+ For planned rotation, `{ keep_previous: true }` signs with both secrets for
75
+ 24 hours; omit it when the previous secret may be compromised. See `docs/COMPATIBILITY.md`.
74
76
  - Dependency changes must keep `bun.lock` synchronized and pass `bun run audit`.
75
77
  GitHub Actions are pinned to immutable commit SHAs and updated through
76
78
  Dependabot review.
package/dist/index.d.mts CHANGED
@@ -29,7 +29,7 @@ type AssignmentMethod = 'virtual' | 'collect';
29
29
  * | --- | --- | --- | --- |
30
30
  * | `Email` | One-time code sent by e-mail (the default). | An `email`. | 0 credits |
31
31
  * | `Whatsapp` | One-time code sent over WhatsApp. | A `whatsapp_phone_number`; paid plan. | 0.45 credits |
32
- * | `DigitalCertificate` | The signer signs with their own ICP-Brasil certificate — **A1** (software, a file on the machine) or **A3** (hardware, a token or smartcard) — through the Web PKI browser extension, producing a qualified PAdES signature. | `method: 'virtual'`; Digital Certificate feature (Standard/Pro); `government_id`; the signer must be alone in their signing step. | 0.5 credits + notification |
32
+ * | `DigitalCertificate` | The signer signs with their own ICP-Brasil certificate — **A1** (software, a file on the machine) or **A3** (hardware, a token or smartcard) — through the Web PKI browser extension, producing a qualified PAdES signature. | `method: 'virtual'`; Digital Certificate feature (Standard/Pro); `government_id`; the signer must be alone in their signing step. | Use the current cost estimate |
33
33
  * | `IdDocumentFaceMatchBasic` | Hosted identity-document and face verification, with explicit biometric consent. | ID Document + Face Match feature; valid CPF in `government_id`; account approval for any `InReview` result before certification. | Use cost estimation for current pricing. |
34
34
  * | `Bypass` | No verification code. Enabled per account by Assinafy (`signing_features.VerificationBypass`); typically for `embedded` signers your app has already authenticated. | The Verification Bypass feature (`403 PlanRestricted` otherwise). | Notification only. |
35
35
  *
@@ -280,17 +280,19 @@ interface IConfirmSignerDataPayload {
280
280
  }
281
281
  /** @deprecated Identical to {@link IConfirmSignerDataPayload}; kept for existing imports. */
282
282
  type ILegacyConfirmSignerDataPayload = IConfirmSignerDataPayload;
283
- /** Official options for uploading the PNG signature image described by OpenAPI. */
283
+ /** Options for uploading a signature image; staging also supports JPEG. */
284
284
  interface IUploadSignatureOptions {
285
285
  imageType?: SignatureImageType;
286
+ /** Raw image media type; defaults to image/png. */
287
+ contentType?: 'image/png' | 'image/jpeg';
286
288
  /** Persist this image so it is reused on future documents. */
287
289
  reuse?: boolean;
288
290
  }
289
291
  /** Source-compatible options for older deployments that accepted other media types. */
290
- interface ILegacyUploadSignatureOptions extends IUploadSignatureOptions {
292
+ interface ILegacyUploadSignatureOptions extends Omit<IUploadSignatureOptions, 'contentType'> {
291
293
  /**
292
- * @deprecated The current API contract accepts only `image/png`. Non-PNG
293
- * values are retained as a compatibility escape hatch.
294
+ * @deprecated Use IUploadSignatureOptions for PNG/JPEG. Other media types
295
+ * remain a compatibility escape hatch for older deployments.
294
296
  */
295
297
  contentType?: string;
296
298
  }
@@ -312,6 +314,13 @@ interface PaginatedResult<T> {
312
314
  type IPaginatedResponse<T> = PaginatedResult<T>;
313
315
  /** Paginated signer-list response. */
314
316
  type ISignerListResponse = PaginatedResult<ISigner>;
317
+ /** Sender-stated capacity printed on the certificate page; available on staging. */
318
+ type SignerCapacity = 'Sign' | 'Approve' | 'Acknowledge' | 'Party' | 'Witness' | 'Intervening' | 'Receipt' | 'IssuerEndorserGuarantor' | 'IssuerEndorserGuarantorSurety' | 'Surety' | 'PartySurety' | 'JointDebtor' | 'PartyJointDebtor' | 'ContractingParty' | 'ContractedParty' | 'Landlord' | 'Tenant' | 'Buyer' | 'Seller' | 'AttorneyInFact' | 'LegalRepresentative' | 'Employer' | 'Employee';
319
+ /** Capacity stated by the sender; returned separately from the assignment. */
320
+ interface ISignerCapacity {
321
+ signer_id: string;
322
+ sign_as: SignerCapacity | AnyString;
323
+ }
315
324
  /** Signer reference accepted by the assignment endpoints. */
316
325
  type SignerReference = string | {
317
326
  id?: string;
@@ -319,6 +328,8 @@ type SignerReference = string | {
319
328
  /** `DigitalCertificate` is valid only when the assignment method is `virtual`. */
320
329
  verification_method?: AssignmentVerificationMethod;
321
330
  notification_methods?: AssignmentNotificationMethod[];
331
+ /** Capacity printed on the certificate; omitted or null means plain signing. */
332
+ sign_as?: SignerCapacity | null;
322
333
  /**
323
334
  * Sign inside your app through `embed.createSession()`: the signer gets
324
335
  * no link in `signing_urls`. Needs the Embed feature and `Email`,
@@ -400,6 +411,8 @@ interface IAssignmentEntry {
400
411
  interface IAssignmentCostSigner {
401
412
  verification_method?: AssignmentVerificationMethod;
402
413
  notification_methods?: AssignmentNotificationMethod[];
414
+ /** Validated as on creation; does not change the price. */
415
+ sign_as?: SignerCapacity | null;
403
416
  /** The signer's signing step at creation; each `DigitalCertificate` signer needs its own. */
404
417
  step?: number;
405
418
  }
@@ -445,6 +458,45 @@ interface INotificationHistoryEntry {
445
458
  sent_at: string | null;
446
459
  failed_at: string | null;
447
460
  }
461
+ /** Delivery timestamps returned by `assignments.getNotificationHistory()`. */
462
+ interface ISignerNotificationHistory {
463
+ signer_id: string;
464
+ notification_history: Array<INotificationHistoryEntry & {
465
+ delivered_at: string | null;
466
+ /** A delivery-provider hint, not proof that a person read the message. */
467
+ opened_at: string | null;
468
+ }>;
469
+ }
470
+ /** A queued assignment or envelope; creation itself sends and charges nothing. */
471
+ interface IScheduledSend {
472
+ resource?: string;
473
+ id: string;
474
+ type: 'assignment' | 'envelope';
475
+ document_ids: string[];
476
+ status: 'pending' | 'processing' | 'sent' | 'cancelled' | 'failed';
477
+ send_at: string;
478
+ assignment_id: string | null;
479
+ envelope_id: string | null;
480
+ failure_reason: string | null;
481
+ created_at: string;
482
+ processed_at: string | null;
483
+ }
484
+ /** An assignment request plus a send time from one hour to 90 days ahead. */
485
+ interface IScheduleAssignmentPayload extends Omit<ICreateAssignmentPayload, 'expires_at'> {
486
+ /** ISO date-time (no offset means UTC) or Unix seconds. */
487
+ send_at: string | number;
488
+ /** Absolute deadline at least two hours after send_at; null means no deadline. */
489
+ expires_at?: string | number | null;
490
+ }
491
+ /** An envelope request plus its deferred send time. No Idempotency-Key is supported. */
492
+ interface IScheduleEnvelopePayload extends ICreateEnvelopePayload {
493
+ /** ISO date-time (no offset means UTC) or Unix seconds, one hour to 90 days ahead. */
494
+ send_at: string | number;
495
+ }
496
+ /** Filters for scheduled sends; listing requires documents:write for OAuth apps. */
497
+ interface IScheduledSendListParams extends Pick<IListParams, 'page' | 'per-page' | 'per_page'> {
498
+ document_id?: string;
499
+ }
448
500
  /** A placed field/item within an assignment (one row per signer × field). */
449
501
  interface IAssignmentItem {
450
502
  id: string;
@@ -3085,6 +3137,51 @@ declare class DocumentResource extends BaseResource {
3085
3137
  * ```
3086
3138
  */
3087
3139
  getSigningProgress(documentId: string): Promise<ISigningProgress>;
3140
+ /**
3141
+ * List contacts watching a document (`GET /documents/{documentId}/watchers`).
3142
+ *
3143
+ * Staging extension. Returns contacts in the order set, omitting deleted
3144
+ * contacts. API key or user token only; OAuth application tokens are refused.
3145
+ * @param documentId - Workspace document ID.
3146
+ * @returns Watcher contacts:
3147
+ * ```jsonc
3148
+ * [{ "resource": "signer", "id": "signer-1", "full_name": "Example Watcher",
3149
+ * "email": "watcher@example.com", "whatsapp_phone_number": null,
3150
+ * "government_id": null, "has_accepted_terms": false }]
3151
+ * ```
3152
+ * @throws {ValidationError} If the document ID is invalid.
3153
+ * @throws {ApiError} `401`, `403`, or `404` for an unknown document or older deployment.
3154
+ * @example
3155
+ * ```ts
3156
+ * const watchers = await client.documents.listWatchers(document.id);
3157
+ * ```
3158
+ */
3159
+ listWatchers(documentId: string): Promise<ISigner[]>;
3160
+ /**
3161
+ * Replace a document's watchers (`PUT /documents/{documentId}/watchers`).
3162
+ *
3163
+ * Staging extension. Each contact must belong to the workspace and have an
3164
+ * email. Watchers get one queued email when the document ends, without a
3165
+ * document link or file. Workspace notification preferences do not suppress
3166
+ * it. Set before sending or while open; `[]` removes every watcher.
3167
+ * API key or user token only; OAuth application tokens are refused.
3168
+ * @param documentId - Workspace document ID.
3169
+ * @param watcherIds - Up to ten contact IDs; duplicate IDs count once.
3170
+ * @returns The stored contacts:
3171
+ * ```jsonc
3172
+ * [{ "resource": "signer", "id": "signer-1", "full_name": "Example Watcher",
3173
+ * "email": "watcher@example.com", "whatsapp_phone_number": null,
3174
+ * "government_id": null, "has_accepted_terms": false }]
3175
+ * ```
3176
+ * @throws {ValidationError} If an ID is invalid or more than ten distinct watchers are supplied.
3177
+ * @throws {ApiError} `400` for a closed document or invalid contact; `401`, `403`, `404`.
3178
+ * @example
3179
+ * ```ts
3180
+ * await client.documents.setWatchers(document.id, [contact.id]);
3181
+ * // body: { watcher_ids: [contact.id] }
3182
+ * ```
3183
+ */
3184
+ setWatchers(documentId: string, watcherIds: string[]): Promise<ISigner[]>;
3088
3185
  }
3089
3186
 
3090
3187
  declare class SignerResource extends BaseResource {
@@ -3926,6 +4023,7 @@ declare class AssignmentResource extends BaseResource {
3926
4023
  * This route takes no `Idempotency-Key`: a document takes one assignment,
3927
4024
  * so a retry after a lost response answers `400` and charges nothing —
3928
4025
  * read the document to see whether the first request went through.
4026
+ * @param payload.signers[].sign_as - Staging capacity printed on the certificate; omitted/null means `Sign`.
3929
4027
  * @returns The created {@link IAssignment}: `signers` (rich, with `step` /
3930
4028
  * `notified` / `verification_method`), `items` (one row per signer × field),
3931
4029
  * a `summary` count block, and per-signer `signing_urls`. Response shape:
@@ -4053,6 +4151,7 @@ declare class AssignmentResource extends BaseResource {
4053
4151
  * `collect`-mode `entries`. Signer IDs are not part of this request. Send
4054
4152
  * each signer's creation `step` too: the API keeps every
4055
4153
  * `DigitalCertificate` signer alone in its step when it estimates.
4154
+ * @param payload.signers[].sign_as - Optional staging capacity, validated as on creation; it does not change the cost.
4056
4155
  * @returns an {@link ICostEstimate} with `total_credits`, balances, a
4057
4156
  * line-item `breakdown`, and a `has_sufficient_resources` gate.
4058
4157
  * `blocking_reason` may be `PendingPayment`, `InsufficientDocuments`, or
@@ -4366,6 +4465,47 @@ declare class AssignmentResource extends BaseResource {
4366
4465
  * ```
4367
4466
  */
4368
4467
  reviewIdentityVerification(documentId: string, assignmentId: string, signerId: string, payload: IReviewIdentityVerificationPayload): Promise<ISignerIdentityReview>;
4468
+ /**
4469
+ * Read the capacity each signer signs in (`GET /documents/{documentId}/signer-capacities`).
4470
+ *
4471
+ * Staging extension. Order matches the assignment's signers; an unsent
4472
+ * document returns an empty list. OAuth applications need `documents:read`.
4473
+ * @param documentId - Workspace document ID.
4474
+ * @returns Sender-stated capacities, defaulting to `Sign`:
4475
+ * ```jsonc
4476
+ * [{ "signer_id": "signer-1", "sign_as": "Witness" }]
4477
+ * ```
4478
+ * @throws {ValidationError} If the document ID is invalid.
4479
+ * @throws {ApiError} `401`, `403`, or `404` for an unknown document or an older deployment.
4480
+ * @example
4481
+ * ```ts
4482
+ * const capacities = await client.assignments.getSignerCapacities(document.id);
4483
+ * ```
4484
+ */
4485
+ getSignerCapacities(documentId: string): Promise<ISignerCapacity[]>;
4486
+ /**
4487
+ * Read delivery and open times (`GET /documents/{documentId}/notification-history`).
4488
+ *
4489
+ * Staging extension. An open can come from a mail scanner; it is not proof
4490
+ * of human reading. An unsent document returns `[]`. Needs `documents:read`.
4491
+ * @param documentId - Workspace document ID.
4492
+ * @returns History in assignment-signer order:
4493
+ * ```jsonc
4494
+ * [{ "signer_id": "signer-1", "notification_history": [{
4495
+ * "event": "signature_request", "status": "delivered",
4496
+ * "error_code": null, "error_message": null,
4497
+ * "sent_at": "2026-11-24T12:00:00Z", "failed_at": null,
4498
+ * "delivered_at": "2026-11-24T12:00:05Z", "opened_at": null
4499
+ * }] }]
4500
+ * ```
4501
+ * @throws {ValidationError} If the document ID is invalid.
4502
+ * @throws {ApiError} `401`, `403`, or `404` for an unknown document or an older deployment.
4503
+ * @example
4504
+ * ```ts
4505
+ * const history = await client.assignments.getNotificationHistory(document.id);
4506
+ * ```
4507
+ */
4508
+ getNotificationHistory(documentId: string): Promise<ISignerNotificationHistory[]>;
4369
4509
  private identityVerificationPath;
4370
4510
  }
4371
4511
 
@@ -7326,7 +7466,8 @@ declare class SignerDocumentsResource extends BaseResource {
7326
7466
  * @param signerAccessCode - The signer's access code, from their signing link.
7327
7467
  * @param image - The image bytes as a non-empty `Buffer`.
7328
7468
  * @param options - `imageType` (`'signature'` default, or `'initial'`) and
7329
- * `reuse` (persist for reuse). The official request content type is PNG.
7469
+ * `reuse` (persist for reuse). PNG is the default; staging also accepts JPEG.
7470
+ * @param options.contentType - Raw media type: `image/png` (default) or `image/jpeg`.
7330
7471
  * @param options.imageType - Signature image category; defaults to `signature`.
7331
7472
  * @param options.reuse - Persist the image for future signing requests.
7332
7473
  * @returns Resolves when the API acknowledges the upload. The response
@@ -7349,14 +7490,14 @@ declare class SignerDocumentsResource extends BaseResource {
7349
7490
  /**
7350
7491
  * Upload a signature image using a compatibility content type
7351
7492
  * (`POST /signature?signer-access-code=…&type=…`).
7352
- * @deprecated Compatibility overload for non-PNG media types. The current
7353
- * OpenAPI contract specifies only `image/png`; other values are not certified.
7493
+ * @deprecated Compatibility overload for media types other than PNG/JPEG.
7494
+ * Their acceptance depends on the deployment.
7354
7495
  * @param signerAccessCode - Access code sent in the query string.
7355
7496
  * @param image - Non-empty raw image bytes, without a JSON envelope.
7356
7497
  * @param options - Image type, reuse preference and compatibility content type.
7357
7498
  * @param options.imageType - Signature image category; defaults to `signature`.
7358
7499
  * @param options.reuse - Persist the image for future signing requests.
7359
- * @param options.contentType - Compatibility media type; the official type is `image/png`.
7500
+ * @param options.contentType - Compatibility media type; prefer `image/png` or `image/jpeg`.
7360
7501
  * @returns Nothing; the acknowledgement body is discarded.
7361
7502
  * @throws {ValidationError} If the code, image or options are invalid.
7362
7503
  * @throws {ApiError} If the API rejects the upload.
@@ -8606,6 +8747,7 @@ declare class EnvelopeResource extends BaseResource {
8606
8747
  *
8607
8748
  * @param envelopeId - Envelope ID.
8608
8749
  * @param accountId - Override the client's default account ID.
8750
+ * @returns Nothing; the acknowledgement body is discarded.
8609
8751
  * @throws {ValidationError} If an ID is missing or invalid.
8610
8752
  * @throws {ApiError} `403` for a token without `documents:write`, `404` for an
8611
8753
  * unknown envelope, `409` (`EnvelopeOpen`) while a document is still open.
@@ -8775,6 +8917,28 @@ declare class EnvelopeResource extends BaseResource {
8775
8917
  * ```
8776
8918
  */
8777
8919
  resendNotification(envelopeId: string, signerId: string, accountId?: string): Promise<IEnvelopeResendResponse>;
8920
+ /**
8921
+ * Price a whole-envelope reminder
8922
+ * (`POST /accounts/{accountId}/envelopes/{envelopeId}/signers/{signerId}/estimate-resend-cost`).
8923
+ *
8924
+ * Staging extension. Sends and charges nothing. Prices one reminder per
8925
+ * channel regardless of document count, without checking reminder cooldown
8926
+ * or whether the envelope is closed. OAuth requires `documents:write`.
8927
+ * @param envelopeId - Envelope ID.
8928
+ * @param signerId - Signer of the envelope.
8929
+ * @param accountId - Override the client's default workspace.
8930
+ * @returns The current reminder price:
8931
+ * ```jsonc
8932
+ * { "total": 0, "breakdown": [], "credit_balance": null, "has_sufficient_credits": true }
8933
+ * ```
8934
+ * @throws {ValidationError} If an ID is missing or invalid.
8935
+ * @throws {ApiError} `401`, `403`, or `404` for an unknown envelope/signer or older deployment.
8936
+ * @example
8937
+ * ```ts
8938
+ * const estimate = await client.envelopes.estimateResendCost(envelope.id, signer.id);
8939
+ * ```
8940
+ */
8941
+ estimateResendCost(envelopeId: string, signerId: string, accountId?: string): Promise<IResendCostEstimate>;
8778
8942
  private envelopesPath;
8779
8943
  private envelopePath;
8780
8944
  }
@@ -8855,6 +9019,7 @@ declare class EmbedResource extends BaseResource {
8855
9019
  *
8856
9020
  * @param originId - Embed origin ID.
8857
9021
  * @param accountId - Override the client's default account ID.
9022
+ * @returns Nothing; the acknowledgement body is discarded.
8858
9023
  * @throws {ValidationError} If an ID is missing or invalid.
8859
9024
  * @throws {ApiError} `403`, or `404` for an unknown origin ID.
8860
9025
  *
@@ -8903,6 +9068,160 @@ declare class EmbedResource extends BaseResource {
8903
9068
  private originPath;
8904
9069
  }
8905
9070
 
9071
+ /**
9072
+ * Deferred assignment/envelope requests, available on staging. All routes,
9073
+ * including listing, need `documents:write` for OAuth applications. Requests
9074
+ * are checked when scheduled, and checked and charged again when sent. The
9075
+ * server checks due sends every five minutes. No mutation is automatically
9076
+ * retried and no Idempotency-Key is supported.
9077
+ */
9078
+ declare class ScheduledSendResource extends BaseResource {
9079
+ /**
9080
+ * Schedule an assignment (`POST /documents/{documentId}/scheduled-sends`).
9081
+ *
9082
+ * Sends and charges nothing now. Each document takes one pending or
9083
+ * processing scheduled send. A failed due send records its reason and
9084
+ * emails the scheduling member (active owners if that member has left).
9085
+ * @param documentId - Unassigned document in the workspace.
9086
+ * @param payload - The same signing request as `assignments.create()` plus its send time.
9087
+ * @param payload.send_at - ISO date-time (no offset means UTC) or Unix seconds, one hour to 90 days ahead.
9088
+ * @param payload.method - `virtual` (default) or `collect`.
9089
+ * @param payload.signers - Contacts and their verification, notification, capacity and ordering options.
9090
+ * @param payload.signer_ids - Compatibility alias for signer IDs.
9091
+ * @param payload.signerIds - Compatibility alias for signer IDs.
9092
+ * @param payload.entries - Required field placements for `collect`.
9093
+ * @param payload.message - Invitation text.
9094
+ * @param payload.copy_receivers - Contacts receiving copies.
9095
+ * @param payload.expires_at - Absolute deadline at least two hours after send_at, or null for none.
9096
+ * @param payload.max_total_credits - Credit ceiling enforced when sending.
9097
+ * @returns The saved request's state:
9098
+ * ```jsonc
9099
+ * { "resource": "scheduled_send", "id": "send-1", "type": "assignment",
9100
+ * "document_ids": ["doc-1"], "status": "pending", "send_at": "2026-12-01T12:00:00Z",
9101
+ * "assignment_id": null, "envelope_id": null, "failure_reason": null,
9102
+ * "created_at": "2026-11-24T12:00:00Z", "processed_at": null }
9103
+ * ```
9104
+ * @throws {ValidationError} If the ID, time or signing request is malformed.
9105
+ * @throws {ApiError} `400` for timing, assignment or pending-send conflicts;
9106
+ * `401`, `403` for plan/scope restrictions, `404` for document/contact/deployment availability.
9107
+ * @example
9108
+ * ```ts
9109
+ * const scheduled = await client.scheduledSends.createAssignment(document.id, {
9110
+ * signers: [{ id: signer.id, verification_method: 'Email', notification_methods: ['Email'] }],
9111
+ * send_at: new Date(Date.now() + 86_400_000).toISOString(),
9112
+ * max_total_credits: 0,
9113
+ * });
9114
+ * ```
9115
+ */
9116
+ createAssignment(documentId: string, payload: IScheduleAssignmentPayload): Promise<IScheduledSend>;
9117
+ /**
9118
+ * Schedule an envelope (`POST /accounts/{accountId}/scheduled-sends`).
9119
+ *
9120
+ * Creates no envelope and charges nothing now. Uses the same plan and
9121
+ * signing rules as envelope estimation; checks balances when sending.
9122
+ * @param payload - Envelope request and send time.
9123
+ * @param payload.send_at - ISO date-time or Unix seconds, one hour to 90 days ahead.
9124
+ * @param payload.name - Envelope name, 1–255 characters without `<`.
9125
+ * @param payload.message - Invitation text or null.
9126
+ * @param payload.signers - 1–20 contacts with shared channel options; no signing steps.
9127
+ * @param payload.documents - 1–20 unassigned documents, signer IDs and optional placements/copy receivers.
9128
+ * Each document's expires_at must be at least two hours after send_at.
9129
+ * @param payload.max_total_credits - Credit ceiling enforced when sending.
9130
+ * @param accountId - Override the client's default workspace.
9131
+ * @returns The saved request's state:
9132
+ * ```jsonc
9133
+ * { "resource": "scheduled_send", "id": "send-2", "type": "envelope",
9134
+ * "document_ids": ["doc-1", "doc-2"], "status": "pending", "send_at": "2026-12-01T12:00:00Z",
9135
+ * "assignment_id": null, "envelope_id": null, "failure_reason": null,
9136
+ * "created_at": "2026-11-24T12:00:00Z", "processed_at": null }
9137
+ * ```
9138
+ * @throws {ValidationError} If the time or envelope request is malformed.
9139
+ * @throws {ApiError} `400` for timing or envelope/pending-send conflicts;
9140
+ * `401`, `403` (`PlanRestricted`, `InsufficientScope`), `404`.
9141
+ * @example
9142
+ * ```ts
9143
+ * const scheduled = await client.scheduledSends.createEnvelope({
9144
+ * name: 'Agreement', signers: [{ id: signer.id }],
9145
+ * documents: [{ id: document.id, signer_ids: [signer.id] }],
9146
+ * send_at: new Date(Date.now() + 86_400_000).toISOString(),
9147
+ * });
9148
+ * ```
9149
+ */
9150
+ createEnvelope(payload: IScheduleEnvelopePayload, accountId?: string): Promise<IScheduledSend>;
9151
+ /**
9152
+ * List scheduled sends (`GET /accounts/{accountId}/scheduled-sends`).
9153
+ *
9154
+ * Newest first, in every state. Requires `documents:write`, because failure
9155
+ * reasons can expose balance and workspace membership information.
9156
+ * @param params - Optional document filter and pagination.
9157
+ * @param params.document_id - Return only sends containing this document.
9158
+ * @param params.page - One-based page number.
9159
+ * @param params.per-page - Page size, default 20 and maximum 50.
9160
+ * @param params.per_page - Compatibility alias for per-page.
9161
+ * @param accountId - Override the client's default workspace.
9162
+ * @returns Requests and header-derived pagination:
9163
+ * ```jsonc
9164
+ * { "data": [{ "id": "send-1", "type": "assignment", "document_ids": ["doc-1"],
9165
+ * "status": "sent", "send_at": "2026-12-01T12:00:00Z", "assignment_id": "assignment-1",
9166
+ * "envelope_id": null, "failure_reason": null, "created_at": "2026-11-24T12:00:00Z",
9167
+ * "processed_at": "2026-12-01T12:00:03Z" }],
9168
+ * "meta": { "current_page": 1, "per_page": 20, "total": 1, "last_page": 1 } }
9169
+ * ```
9170
+ * @throws {ValidationError} If the workspace/filter is invalid.
9171
+ * @throws {ApiError} `400` for an invalid filter, `401`, `403`, `404`.
9172
+ * @example
9173
+ * ```ts
9174
+ * const sends = await client.scheduledSends.list({ document_id: document.id });
9175
+ * ```
9176
+ */
9177
+ list(params?: IScheduledSendListParams, accountId?: string): Promise<PaginatedResult<IScheduledSend>>;
9178
+ /**
9179
+ * Cancel a pending send (`PUT /accounts/{accountId}/scheduled-sends/{scheduledSendId}/cancel`).
9180
+ *
9181
+ * Sends and charges nothing. A second cancellation is a conflict.
9182
+ * @param scheduledSendId - Pending scheduled send ID.
9183
+ * @param accountId - Override the client's default workspace.
9184
+ * @returns The cancelled state:
9185
+ * ```jsonc
9186
+ * { "id": "send-1", "type": "assignment", "document_ids": ["doc-1"],
9187
+ * "status": "cancelled", "send_at": "2026-12-01T12:00:00Z", "assignment_id": null,
9188
+ * "envelope_id": null, "failure_reason": null, "created_at": "2026-11-24T12:00:00Z",
9189
+ * "processed_at": "2026-11-24T12:05:00Z" }
9190
+ * ```
9191
+ * @throws {ValidationError} If an ID is invalid.
9192
+ * @throws {ApiError} `401`, `403`, `404`, `409` if no longer pending.
9193
+ * @example
9194
+ * ```ts
9195
+ * await client.scheduledSends.cancel(scheduled.id);
9196
+ * ```
9197
+ */
9198
+ cancel(scheduledSendId: string, accountId?: string): Promise<IScheduledSend>;
9199
+ /**
9200
+ * Send a pending request now (`PUT /accounts/{accountId}/scheduled-sends/{scheduledSendId}/send`).
9201
+ *
9202
+ * Checks and charges as the scheduling member. A refusal leaves it pending
9203
+ * for its original time; cancel it explicitly to stop that future attempt.
9204
+ * @param scheduledSendId - Pending scheduled send ID.
9205
+ * @param accountId - Override the client's default workspace.
9206
+ * @returns The sent state and created assignment or envelope ID:
9207
+ * ```jsonc
9208
+ * { "id": "send-1", "type": "assignment", "document_ids": ["doc-1"],
9209
+ * "status": "sent", "send_at": "2026-12-01T12:00:00Z", "assignment_id": "assignment-1",
9210
+ * "envelope_id": null, "failure_reason": null, "created_at": "2026-11-24T12:00:00Z",
9211
+ * "processed_at": "2026-11-24T13:00:00Z" }
9212
+ * ```
9213
+ * @throws {ValidationError} If an ID is invalid.
9214
+ * @throws {ApiError} `400` for invalid requests/balances or departed members;
9215
+ * `401`, `403`, `404`, `409` if no longer pending or `CreditCeilingExceeded`.
9216
+ * @example
9217
+ * ```ts
9218
+ * const sent = await client.scheduledSends.sendNow(scheduled.id);
9219
+ * ```
9220
+ */
9221
+ sendNow(scheduledSendId: string, accountId?: string): Promise<IScheduledSend>;
9222
+ private path;
9223
+ }
9224
+
8906
9225
  /** Headers read by {@link WebhookVerifier.verifySignature}. */
8907
9226
  type WebhookHeaders = {
8908
9227
  get(name: string): string | null;
@@ -9076,6 +9395,7 @@ declare class AssinafyClient {
9076
9395
  readonly contracts: ContractResource;
9077
9396
  readonly envelopes: EnvelopeResource;
9078
9397
  readonly embed: EmbedResource;
9398
+ readonly scheduledSends: ScheduledSendResource;
9079
9399
  readonly webhookVerifier: WebhookVerifier;
9080
9400
  /**
9081
9401
  * Create a client. Supply `apiKey` (preferred, sent as `X-Api-Key`) or a
@@ -9582,5 +9902,5 @@ declare const MAX_LIST_PAGE_SIZE = 50;
9582
9902
 
9583
9903
  declare const SDK_USER_AGENT: string;
9584
9904
 
9585
- export { ApiError, AssignmentResource, AssinafyClient, AssinafyError, AuthenticationResource, ContractResource, DEFAULT_WEBHOOK_EVENTS, DIGITAL_CERTIFICATE_REQUIRES_VIRTUAL_METHOD, DocumentResource, EmbedResource, EnvelopeResource, FieldsResource, MAX_LIST_PAGE_SIZE, MAX_UPLOAD_BYTES, NetworkError, OAuthError, OAuthResource, SDK_USER_AGENT, SignerDocumentsResource, SignerResource, TagResource, TemplateResource, UserResource, ValidationError, WebhookResource, WebhookVerifier, WorkspaceResource, buildAssignmentPayload, parseWwwAuthenticate };
9586
- export type { AccountLogoUploadSource, AnyString, AssignmentDisplaySettings, AssignmentMethod, AssignmentNotificationMethod, AssignmentVerificationMethod, AssinafyClientOptions, ClientConfigInput, DocumentArtifactName, DocumentContractRelationType, DocumentContractStatus, DocumentStatsGranularity, DocumentStatus, DocumentUploadSource, IAcceptTermsResult, IAccountLimits, IAccountSigningFeatures, IAccountTheme, IAccountUsage, IAccountUsageBalance, IAddEnvelopeDocumentPayload, IApiFieldError, IApiKeyResponse, IAssignment, IAssignmentCostSigner, IAssignmentEntry, IAssignmentItem, IAssignmentListParams, IAssignmentListResponse, IAssignmentSigner, IAuthenticateChallenge, IAuthenticatedUser, ICertifiedCopyResendResult, IConfirmSignerDataPayload, IConfirmTotpPayload, ICostEstimate, ICreateAssignmentPayload, ICreateAssignmentResponse, ICreateDocumentFromTemplateOptions, ICreateEnvelopePayload, ICreateFieldPayload, ICreateSignerPayload, ICreateSignerResponse, ICreateTagPayload, ICreateWorkspacePayload, IDeleteTagResponse, IDetachDocumentTagResponse, IDisplaySettings, IDocumentActivity, IDocumentContract, IDocumentContractAmendment, IDocumentContractExternalReference, IDocumentContractInput, IDocumentContractListParams, IDocumentContractListResponse, IDocumentDetailsOptions, IDocumentDetailsResponse, IDocumentEnvelopeRef, IDocumentListItem, IDocumentListParams, IDocumentListResponse, IDocumentRenderOptions, IDocumentSearchParams, IDocumentStatsParams, IDocumentStatsRow, IDocumentStatusInfo, IDocumentUploadOptions, IDocumentUploadResponse, IDocumentVerification, IEmbedOrigin, IEmbedSession, IEnvelope, IEnvelopeActivity, IEnvelopeCancelResult, IEnvelopeDocument, IEnvelopeDocumentInput, IEnvelopeDocumentSigner, IEnvelopeListParams, IEnvelopeListResponse, IEnvelopeResendResponse, IEnvelopeSignerInput, IEstimateAssignmentCostPayload, IFieldDefinition, IFieldType, IFieldValidateMultipleEntry, IFieldValidationMultipleResult, IFieldValidationResponse, IFieldValidationResult, IInlineTag, ILegacyConfirmSignerDataPayload, ILegacyResendCostEstimate, ILegacyUploadSignatureOptions, IListParams, ILoginResponse, IMaskedApiKeyResponse, IMfaMethod, IMfaReauth, IMfaRecoveryCodes, IMfaStatus, INotificationHistoryEntry, INotificationPolicy, INotificationPreferences, IOAuthAuthorizationCallback, IOAuthAuthorizationRequest, IOAuthAuthorizationServerMetadata, IOAuthProtectedResourceMetadata, IOAuthTokenResponse, IOAuthUserInfo, IPage, IPaginatedResponse, IPublicDocumentInfo, IPushPreferences, IRateLimitInfo, IRenameDocumentResponse, IRenewDocumentContractPayload, IResendCostEstimate, IResendEmailResponse, IReviewIdentityVerificationPayload, ISendTokenResult, ISignFieldEntry, ISigner, ISignerCertifiedCopyStatus, ISignerDocumentListParams, ISignerIdentityReview, ISignerIdentityVerification, ISignerIdentityVerificationSession, ISignerListParams, ISignerListResponse, ISignerSelf, ISigningCurrentSigner, ISigningDocument, ISigningProgress, ISigningReadOptions, ISigningUrl, IStartIdentityVerificationPayload, ITag, ITemplateCostSigner, ITemplateDetailsResponse, ITemplateFieldPlacement, ITemplateListItem, ITemplateListParams, ITemplateListResponse, ITemplateRole, ITemplateSigner, ITerminateDocumentContractPayload, ITotpEnrollment, IUpdateEnvelopePayload, IUpdateFieldPayload, IUpdateNotificationPolicyPayload, IUpdateNotificationPreferences, IUpdatePushPreferences, IUpdateSignerPayload, IUpdateTagPayload, IUpdateTemplatePayload, IUpdateWorkspacePayload, IUploadAndRequestSignaturesResult, IUploadAndRequestSignaturesSigner, IUploadSignatureOptions, IWebhookDispatch, IWebhookDispatchListParams, IWebhookEndpoint, IWebhookEndpointCreatePayload, IWebhookEndpointCreateResponse, IWebhookEndpointSecret, IWebhookEndpointSecretRotation, IWebhookEndpointUpdatePayload, IWebhookEventTypeInfo, IWebhookPayload, IWebhookRegisterPayload, IWebhookSubscription, IWhatsAppNotification, IWorkspaceListItem, IWorkspaceListResponse, IWorkspaceResponse, IdentityVerificationImageName, IdentityVerificationStatus, Logger, NotificationPolicyEvent, NotificationSenderType, OAuthScope, PaginatedResult, PaginationMeta, PushPreferenceEvent, SendTokenChannel, SignatureImageType, SignerReference, WebhookDeliveryEventType, WebhookEventType, WebhookHeaders };
9905
+ export { ApiError, AssignmentResource, AssinafyClient, AssinafyError, AuthenticationResource, ContractResource, DEFAULT_WEBHOOK_EVENTS, DIGITAL_CERTIFICATE_REQUIRES_VIRTUAL_METHOD, DocumentResource, EmbedResource, EnvelopeResource, FieldsResource, MAX_LIST_PAGE_SIZE, MAX_UPLOAD_BYTES, NetworkError, OAuthError, OAuthResource, SDK_USER_AGENT, ScheduledSendResource, SignerDocumentsResource, SignerResource, TagResource, TemplateResource, UserResource, ValidationError, WebhookResource, WebhookVerifier, WorkspaceResource, buildAssignmentPayload, parseWwwAuthenticate };
9906
+ export type { AccountLogoUploadSource, AnyString, AssignmentDisplaySettings, AssignmentMethod, AssignmentNotificationMethod, AssignmentVerificationMethod, AssinafyClientOptions, ClientConfigInput, DocumentArtifactName, DocumentContractRelationType, DocumentContractStatus, DocumentStatsGranularity, DocumentStatus, DocumentUploadSource, IAcceptTermsResult, IAccountLimits, IAccountSigningFeatures, IAccountTheme, IAccountUsage, IAccountUsageBalance, IAddEnvelopeDocumentPayload, IApiFieldError, IApiKeyResponse, IAssignment, IAssignmentCostSigner, IAssignmentEntry, IAssignmentItem, IAssignmentListParams, IAssignmentListResponse, IAssignmentSigner, IAuthenticateChallenge, IAuthenticatedUser, ICertifiedCopyResendResult, IConfirmSignerDataPayload, IConfirmTotpPayload, ICostEstimate, ICreateAssignmentPayload, ICreateAssignmentResponse, ICreateDocumentFromTemplateOptions, ICreateEnvelopePayload, ICreateFieldPayload, ICreateSignerPayload, ICreateSignerResponse, ICreateTagPayload, ICreateWorkspacePayload, IDeleteTagResponse, IDetachDocumentTagResponse, IDisplaySettings, IDocumentActivity, IDocumentContract, IDocumentContractAmendment, IDocumentContractExternalReference, IDocumentContractInput, IDocumentContractListParams, IDocumentContractListResponse, IDocumentDetailsOptions, IDocumentDetailsResponse, IDocumentEnvelopeRef, IDocumentListItem, IDocumentListParams, IDocumentListResponse, IDocumentRenderOptions, IDocumentSearchParams, IDocumentStatsParams, IDocumentStatsRow, IDocumentStatusInfo, IDocumentUploadOptions, IDocumentUploadResponse, IDocumentVerification, IEmbedOrigin, IEmbedSession, IEnvelope, IEnvelopeActivity, IEnvelopeCancelResult, IEnvelopeDocument, IEnvelopeDocumentInput, IEnvelopeDocumentSigner, IEnvelopeListParams, IEnvelopeListResponse, IEnvelopeResendResponse, IEnvelopeSignerInput, IEstimateAssignmentCostPayload, IFieldDefinition, IFieldType, IFieldValidateMultipleEntry, IFieldValidationMultipleResult, IFieldValidationResponse, IFieldValidationResult, IInlineTag, ILegacyConfirmSignerDataPayload, ILegacyResendCostEstimate, ILegacyUploadSignatureOptions, IListParams, ILoginResponse, IMaskedApiKeyResponse, IMfaMethod, IMfaReauth, IMfaRecoveryCodes, IMfaStatus, INotificationHistoryEntry, INotificationPolicy, INotificationPreferences, IOAuthAuthorizationCallback, IOAuthAuthorizationRequest, IOAuthAuthorizationServerMetadata, IOAuthProtectedResourceMetadata, IOAuthTokenResponse, IOAuthUserInfo, IPage, IPaginatedResponse, IPublicDocumentInfo, IPushPreferences, IRateLimitInfo, IRenameDocumentResponse, IRenewDocumentContractPayload, IResendCostEstimate, IResendEmailResponse, IReviewIdentityVerificationPayload, IScheduleAssignmentPayload, IScheduleEnvelopePayload, IScheduledSend, IScheduledSendListParams, ISendTokenResult, ISignFieldEntry, ISigner, ISignerCapacity, ISignerCertifiedCopyStatus, ISignerDocumentListParams, ISignerIdentityReview, ISignerIdentityVerification, ISignerIdentityVerificationSession, ISignerListParams, ISignerListResponse, ISignerNotificationHistory, ISignerSelf, ISigningCurrentSigner, ISigningDocument, ISigningProgress, ISigningReadOptions, ISigningUrl, IStartIdentityVerificationPayload, ITag, ITemplateCostSigner, ITemplateDetailsResponse, ITemplateFieldPlacement, ITemplateListItem, ITemplateListParams, ITemplateListResponse, ITemplateRole, ITemplateSigner, ITerminateDocumentContractPayload, ITotpEnrollment, IUpdateEnvelopePayload, IUpdateFieldPayload, IUpdateNotificationPolicyPayload, IUpdateNotificationPreferences, IUpdatePushPreferences, IUpdateSignerPayload, IUpdateTagPayload, IUpdateTemplatePayload, IUpdateWorkspacePayload, IUploadAndRequestSignaturesResult, IUploadAndRequestSignaturesSigner, IUploadSignatureOptions, IWebhookDispatch, IWebhookDispatchListParams, IWebhookEndpoint, IWebhookEndpointCreatePayload, IWebhookEndpointCreateResponse, IWebhookEndpointSecret, IWebhookEndpointSecretRotation, IWebhookEndpointUpdatePayload, IWebhookEventTypeInfo, IWebhookPayload, IWebhookRegisterPayload, IWebhookSubscription, IWhatsAppNotification, IWorkspaceListItem, IWorkspaceListResponse, IWorkspaceResponse, IdentityVerificationImageName, IdentityVerificationStatus, Logger, NotificationPolicyEvent, NotificationSenderType, OAuthScope, PaginatedResult, PaginationMeta, PushPreferenceEvent, SendTokenChannel, SignatureImageType, SignerCapacity, SignerReference, WebhookDeliveryEventType, WebhookEventType, WebhookHeaders };