@assinafy/sdk 3.0.1 → 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/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,10 @@ 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;
416
+ /** The signer's signing step at creation; each `DigitalCertificate` signer needs its own. */
417
+ step?: number;
403
418
  }
404
419
  /**
405
420
  * Official request body for
@@ -443,6 +458,45 @@ interface INotificationHistoryEntry {
443
458
  sent_at: string | null;
444
459
  failed_at: string | null;
445
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
+ }
446
500
  /** A placed field/item within an assignment (one row per signer × field). */
447
501
  interface IAssignmentItem {
448
502
  id: string;
@@ -679,7 +733,8 @@ interface IDocumentContractInput {
679
733
  currency?: string | null;
680
734
  start_date?: string | null;
681
735
  end_date?: string | null;
682
- auto_renew?: boolean;
736
+ /** Null resets auto-renewal to false, or drops it from a pending amendment's terms. */
737
+ auto_renew?: boolean | null;
683
738
  renewal_term_months?: number | null;
684
739
  notice_period_days?: number | null;
685
740
  owner_id?: string | null;
@@ -1262,13 +1317,15 @@ interface ITemplateSigner {
1262
1317
  step?: number;
1263
1318
  }
1264
1319
  /**
1265
- * Role/channel descriptor used only for template cost estimation. The official
1266
- * schema intentionally omits signer identity and sequential-signing fields.
1320
+ * Role/channel descriptor used only for template cost estimation. It carries no
1321
+ * signer identity; `step` is the role's signing step at creation, which the API
1322
+ * reads to keep each `DigitalCertificate` signer alone in its step.
1267
1323
  */
1268
1324
  interface ITemplateCostSigner {
1269
1325
  role_id: string;
1270
1326
  verification_method?: AssignmentVerificationMethod;
1271
1327
  notification_methods?: AssignmentNotificationMethod[];
1328
+ step?: number;
1272
1329
  }
1273
1330
  /** Options for creating a document from a template. */
1274
1331
  interface ICreateDocumentFromTemplateOptions {
@@ -2843,9 +2900,10 @@ declare class DocumentResource extends BaseResource {
2843
2900
  *
2844
2901
  * @param templateId - The template that would be instantiated.
2845
2902
  * @param signers - One channel descriptor per template role. Cost requests
2846
- * use only `role_id`, `verification_method`, and `notification_methods`;
2847
- * they do not send a signer ID or signing-order step, and editor roles are
2848
- * ignored by the cost calculation.
2903
+ * use `role_id`, `verification_method`, `notification_methods`, and the
2904
+ * role's creation `step`, which the API reads to keep each
2905
+ * `DigitalCertificate` signer alone in its step; they send no signer ID,
2906
+ * and editor roles are ignored by the cost calculation.
2849
2907
  * @param accountId - Override the client's default account ID.
2850
2908
  * @returns An {@link ICostEstimate}: `total_credits`, balances, and a
2851
2909
  * per-line `breakdown` of what the operation would consume:
@@ -3079,6 +3137,51 @@ declare class DocumentResource extends BaseResource {
3079
3137
  * ```
3080
3138
  */
3081
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[]>;
3082
3185
  }
3083
3186
 
3084
3187
  declare class SignerResource extends BaseResource {
@@ -3920,6 +4023,7 @@ declare class AssignmentResource extends BaseResource {
3920
4023
  * This route takes no `Idempotency-Key`: a document takes one assignment,
3921
4024
  * so a retry after a lost response answers `400` and charges nothing —
3922
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`.
3923
4027
  * @returns The created {@link IAssignment}: `signers` (rich, with `step` /
3924
4028
  * `notified` / `verification_method`), `items` (one row per signer × field),
3925
4029
  * a `summary` count block, and per-signer `signing_urls`. Response shape:
@@ -4043,9 +4147,11 @@ declare class AssignmentResource extends BaseResource {
4043
4147
  * ```
4044
4148
  *
4045
4149
  * @param documentId - The document the assignment would be created on.
4046
- * @param payload - `method` plus channel-only signer descriptors and/or
4047
- * `collect`-mode `entries`. Create-only fields and signer IDs are not part
4048
- * of this request schema.
4150
+ * @param payload - `method` plus signer channel descriptors and/or
4151
+ * `collect`-mode `entries`. Signer IDs are not part of this request. Send
4152
+ * each signer's creation `step` too: the API keeps every
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.
4049
4155
  * @returns an {@link ICostEstimate} with `total_credits`, balances, a
4050
4156
  * line-item `breakdown`, and a `has_sufficient_resources` gate.
4051
4157
  * `blocking_reason` may be `PendingPayment`, `InsufficientDocuments`, or
@@ -4067,7 +4173,8 @@ declare class AssignmentResource extends BaseResource {
4067
4173
  * ```
4068
4174
  * @throws {ValidationError} If `documentId` is missing, a `virtual` request
4069
4175
  * has no signer entry, or a `collect` request has no signer entry or no
4070
- * field-placement entry, or combines `DigitalCertificate` with `collect`.
4176
+ * field-placement entry, the signing order is invalid, or the request
4177
+ * combines `DigitalCertificate` with `collect`.
4071
4178
  * The last case has `errors.code ===
4072
4179
  * 'digital_certificate_requires_virtual_method'`.
4073
4180
  * @throws {ApiError} If the API rejects the request.
@@ -4358,6 +4465,47 @@ declare class AssignmentResource extends BaseResource {
4358
4465
  * ```
4359
4466
  */
4360
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[]>;
4361
4509
  private identityVerificationPath;
4362
4510
  }
4363
4511
 
@@ -7318,7 +7466,8 @@ declare class SignerDocumentsResource extends BaseResource {
7318
7466
  * @param signerAccessCode - The signer's access code, from their signing link.
7319
7467
  * @param image - The image bytes as a non-empty `Buffer`.
7320
7468
  * @param options - `imageType` (`'signature'` default, or `'initial'`) and
7321
- * `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`.
7322
7471
  * @param options.imageType - Signature image category; defaults to `signature`.
7323
7472
  * @param options.reuse - Persist the image for future signing requests.
7324
7473
  * @returns Resolves when the API acknowledges the upload. The response
@@ -7341,14 +7490,14 @@ declare class SignerDocumentsResource extends BaseResource {
7341
7490
  /**
7342
7491
  * Upload a signature image using a compatibility content type
7343
7492
  * (`POST /signature?signer-access-code=…&type=…`).
7344
- * @deprecated Compatibility overload for non-PNG media types. The current
7345
- * 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.
7346
7495
  * @param signerAccessCode - Access code sent in the query string.
7347
7496
  * @param image - Non-empty raw image bytes, without a JSON envelope.
7348
7497
  * @param options - Image type, reuse preference and compatibility content type.
7349
7498
  * @param options.imageType - Signature image category; defaults to `signature`.
7350
7499
  * @param options.reuse - Persist the image for future signing requests.
7351
- * @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`.
7352
7501
  * @returns Nothing; the acknowledgement body is discarded.
7353
7502
  * @throws {ValidationError} If the code, image or options are invalid.
7354
7503
  * @throws {ApiError} If the API rejects the upload.
@@ -8168,7 +8317,8 @@ declare class ContractResource extends BaseResource {
8168
8317
  * @param payload.currency - Three-letter currency; null resets as documented.
8169
8318
  * @param payload.start_date - Start date (`YYYY-MM-DD`), or null.
8170
8319
  * @param payload.end_date - End date (`YYYY-MM-DD`), or null.
8171
- * @param payload.auto_renew - Whether the hourly lifecycle starts a new term.
8320
+ * @param payload.auto_renew - Whether the hourly lifecycle starts a new term;
8321
+ * null resets it to false, or drops it from a pending amendment's terms.
8172
8322
  * @param payload.renewal_term_months - 1–600 months, or null for the default.
8173
8323
  * @param payload.notice_period_days - 0–3650 days, or null to disable notice.
8174
8324
  * @param payload.owner_id - Active workspace member ID, or null.
@@ -8597,6 +8747,7 @@ declare class EnvelopeResource extends BaseResource {
8597
8747
  *
8598
8748
  * @param envelopeId - Envelope ID.
8599
8749
  * @param accountId - Override the client's default account ID.
8750
+ * @returns Nothing; the acknowledgement body is discarded.
8600
8751
  * @throws {ValidationError} If an ID is missing or invalid.
8601
8752
  * @throws {ApiError} `403` for a token without `documents:write`, `404` for an
8602
8753
  * unknown envelope, `409` (`EnvelopeOpen`) while a document is still open.
@@ -8766,6 +8917,28 @@ declare class EnvelopeResource extends BaseResource {
8766
8917
  * ```
8767
8918
  */
8768
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>;
8769
8942
  private envelopesPath;
8770
8943
  private envelopePath;
8771
8944
  }
@@ -8846,6 +9019,7 @@ declare class EmbedResource extends BaseResource {
8846
9019
  *
8847
9020
  * @param originId - Embed origin ID.
8848
9021
  * @param accountId - Override the client's default account ID.
9022
+ * @returns Nothing; the acknowledgement body is discarded.
8849
9023
  * @throws {ValidationError} If an ID is missing or invalid.
8850
9024
  * @throws {ApiError} `403`, or `404` for an unknown origin ID.
8851
9025
  *
@@ -8894,6 +9068,160 @@ declare class EmbedResource extends BaseResource {
8894
9068
  private originPath;
8895
9069
  }
8896
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
+
8897
9225
  /** Headers read by {@link WebhookVerifier.verifySignature}. */
8898
9226
  type WebhookHeaders = {
8899
9227
  get(name: string): string | null;
@@ -9067,6 +9395,7 @@ declare class AssinafyClient {
9067
9395
  readonly contracts: ContractResource;
9068
9396
  readonly envelopes: EnvelopeResource;
9069
9397
  readonly embed: EmbedResource;
9398
+ readonly scheduledSends: ScheduledSendResource;
9070
9399
  readonly webhookVerifier: WebhookVerifier;
9071
9400
  /**
9072
9401
  * Create a client. Supply `apiKey` (preferred, sent as `X-Api-Key`) or a
@@ -9573,4 +9902,5 @@ declare const MAX_LIST_PAGE_SIZE = 50;
9573
9902
 
9574
9903
  declare const SDK_USER_AGENT: string;
9575
9904
 
9576
- export { type AccountLogoUploadSource, type AnyString, ApiError, type AssignmentDisplaySettings, type AssignmentMethod, type AssignmentNotificationMethod, AssignmentResource, type AssignmentVerificationMethod, AssinafyClient, type AssinafyClientOptions, AssinafyError, AuthenticationResource, type ClientConfigInput, ContractResource, DEFAULT_WEBHOOK_EVENTS, DIGITAL_CERTIFICATE_REQUIRES_VIRTUAL_METHOD, type DocumentArtifactName, type DocumentContractRelationType, type DocumentContractStatus, DocumentResource, type DocumentStatsGranularity, type DocumentStatus, type DocumentUploadSource, EmbedResource, EnvelopeResource, FieldsResource, type IAcceptTermsResult, type IAccountLimits, type IAccountSigningFeatures, type IAccountTheme, type IAccountUsage, type IAccountUsageBalance, type IAddEnvelopeDocumentPayload, type IApiFieldError, type IApiKeyResponse, type IAssignment, type IAssignmentCostSigner, type IAssignmentEntry, type IAssignmentItem, type IAssignmentListParams, type IAssignmentListResponse, type IAssignmentSigner, type IAuthenticateChallenge, type IAuthenticatedUser, type ICertifiedCopyResendResult, type IConfirmSignerDataPayload, type IConfirmTotpPayload, type ICostEstimate, type ICreateAssignmentPayload, type ICreateAssignmentResponse, type ICreateDocumentFromTemplateOptions, type ICreateEnvelopePayload, type ICreateFieldPayload, type ICreateSignerPayload, type ICreateSignerResponse, type ICreateTagPayload, type ICreateWorkspacePayload, type IDeleteTagResponse, type IDetachDocumentTagResponse, type IDisplaySettings, type IDocumentActivity, type IDocumentContract, type IDocumentContractAmendment, type IDocumentContractExternalReference, type IDocumentContractInput, type IDocumentContractListParams, type IDocumentContractListResponse, type IDocumentDetailsOptions, type IDocumentDetailsResponse, type IDocumentEnvelopeRef, type IDocumentListItem, type IDocumentListParams, type IDocumentListResponse, type IDocumentRenderOptions, type IDocumentSearchParams, type IDocumentStatsParams, type IDocumentStatsRow, type IDocumentStatusInfo, type IDocumentUploadOptions, type IDocumentUploadResponse, type IDocumentVerification, type IEmbedOrigin, type IEmbedSession, type IEnvelope, type IEnvelopeActivity, type IEnvelopeCancelResult, type IEnvelopeDocument, type IEnvelopeDocumentInput, type IEnvelopeDocumentSigner, type IEnvelopeListParams, type IEnvelopeListResponse, type IEnvelopeResendResponse, type IEnvelopeSignerInput, type IEstimateAssignmentCostPayload, type IFieldDefinition, type IFieldType, type IFieldValidateMultipleEntry, type IFieldValidationMultipleResult, type IFieldValidationResponse, type IFieldValidationResult, type IInlineTag, type ILegacyConfirmSignerDataPayload, type ILegacyResendCostEstimate, type ILegacyUploadSignatureOptions, type IListParams, type ILoginResponse, type IMaskedApiKeyResponse, type IMfaMethod, type IMfaReauth, type IMfaRecoveryCodes, type IMfaStatus, type INotificationHistoryEntry, type INotificationPolicy, type INotificationPreferences, type IOAuthAuthorizationCallback, type IOAuthAuthorizationRequest, type IOAuthAuthorizationServerMetadata, type IOAuthProtectedResourceMetadata, type IOAuthTokenResponse, type IOAuthUserInfo, type IPage, type IPaginatedResponse, type IPublicDocumentInfo, type IPushPreferences, type IRateLimitInfo, type IRenameDocumentResponse, type IRenewDocumentContractPayload, type IResendCostEstimate, type IResendEmailResponse, type IReviewIdentityVerificationPayload, type ISendTokenResult, type ISignFieldEntry, type ISigner, type ISignerCertifiedCopyStatus, type ISignerDocumentListParams, type ISignerIdentityReview, type ISignerIdentityVerification, type ISignerIdentityVerificationSession, type ISignerListParams, type ISignerListResponse, type ISignerSelf, type ISigningCurrentSigner, type ISigningDocument, type ISigningProgress, type ISigningReadOptions, type ISigningUrl, type IStartIdentityVerificationPayload, type ITag, type ITemplateCostSigner, type ITemplateDetailsResponse, type ITemplateFieldPlacement, type ITemplateListItem, type ITemplateListParams, type ITemplateListResponse, type ITemplateRole, type ITemplateSigner, type ITerminateDocumentContractPayload, type ITotpEnrollment, type IUpdateEnvelopePayload, type IUpdateFieldPayload, type IUpdateNotificationPolicyPayload, type IUpdateNotificationPreferences, type IUpdatePushPreferences, type IUpdateSignerPayload, type IUpdateTagPayload, type IUpdateTemplatePayload, type IUpdateWorkspacePayload, type IUploadAndRequestSignaturesResult, type IUploadAndRequestSignaturesSigner, type IUploadSignatureOptions, type IWebhookDispatch, type IWebhookDispatchListParams, type IWebhookEndpoint, type IWebhookEndpointCreatePayload, type IWebhookEndpointCreateResponse, type IWebhookEndpointSecret, type IWebhookEndpointSecretRotation, type IWebhookEndpointUpdatePayload, type IWebhookEventTypeInfo, type IWebhookPayload, type IWebhookRegisterPayload, type IWebhookSubscription, type IWhatsAppNotification, type IWorkspaceListItem, type IWorkspaceListResponse, type IWorkspaceResponse, type IdentityVerificationImageName, type IdentityVerificationStatus, type Logger, MAX_LIST_PAGE_SIZE, MAX_UPLOAD_BYTES, NetworkError, type NotificationPolicyEvent, type NotificationSenderType, OAuthError, OAuthResource, type OAuthScope, type PaginatedResult, type PaginationMeta, type PushPreferenceEvent, SDK_USER_AGENT, type SendTokenChannel, type SignatureImageType, SignerDocumentsResource, type SignerReference, SignerResource, TagResource, TemplateResource, UserResource, ValidationError, type WebhookDeliveryEventType, type WebhookEventType, type WebhookHeaders, WebhookResource, WebhookVerifier, WorkspaceResource, buildAssignmentPayload, parseWwwAuthenticate };
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 };