@assinafy/sdk 2.10.0 → 2.11.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 +33 -1
- package/README.en.md +39 -19
- package/README.md +39 -18
- package/dist/index.d.mts +114 -66
- package/dist/index.d.ts +114 -66
- package/dist/index.js +134 -70
- package/dist/index.mjs +134 -70
- package/docs/COMPATIBILITY.md +31 -27
- package/docs/RELEASING.md +1 -1
- package/package.json +3 -2
package/dist/index.d.ts
CHANGED
|
@@ -956,7 +956,7 @@ interface IWebhookRegisterPayload {
|
|
|
956
956
|
}
|
|
957
957
|
/**
|
|
958
958
|
* The account's oldest webhook endpoint, as returned by the legacy
|
|
959
|
-
* subscription routes: `{ events, is_active, url, email, updated_at }`
|
|
959
|
+
* subscription routes: `{ events, is_active, is_held, held_since, url, email, updated_at }`
|
|
960
960
|
* (no `id` / `created_at`). Use {@link IWebhookEndpoint} for multi-endpoint
|
|
961
961
|
* accounts.
|
|
962
962
|
*/
|
|
@@ -965,6 +965,10 @@ interface IWebhookSubscription {
|
|
|
965
965
|
email: string | null;
|
|
966
966
|
events: string[];
|
|
967
967
|
is_active: boolean;
|
|
968
|
+
/** Whether delivery is paused after repeated failures. */
|
|
969
|
+
is_held?: boolean;
|
|
970
|
+
/** Unix timestamp when delivery was paused; `null` while it is running. */
|
|
971
|
+
held_since?: number | null;
|
|
968
972
|
updated_at?: string | null;
|
|
969
973
|
}
|
|
970
974
|
/** Body for `webhooks.createEndpoint()`. */
|
|
@@ -981,12 +985,17 @@ type IWebhookEndpointUpdatePayload = Partial<IWebhookEndpointCreatePayload>;
|
|
|
981
985
|
* 3 on paid plans; every active endpoint subscribed to an event receives it.
|
|
982
986
|
*/
|
|
983
987
|
interface IWebhookEndpoint {
|
|
988
|
+
resource?: string;
|
|
984
989
|
id: string;
|
|
985
990
|
name: string | null;
|
|
986
991
|
url: string;
|
|
987
992
|
email: string;
|
|
988
993
|
events: (WebhookEventType | AnyString)[];
|
|
989
994
|
is_active: boolean;
|
|
995
|
+
/** Whether delivery is paused after repeated failures. */
|
|
996
|
+
is_held?: boolean;
|
|
997
|
+
/** Unix timestamp when delivery was paused; `null` while it is running. */
|
|
998
|
+
held_since?: number | null;
|
|
990
999
|
/** Whether deliveries carry a `webhook-signature` header. */
|
|
991
1000
|
signing_enabled: boolean;
|
|
992
1001
|
/** ISO-8601 UTC timestamp. */
|
|
@@ -994,9 +1003,9 @@ interface IWebhookEndpoint {
|
|
|
994
1003
|
/** ISO-8601 UTC timestamp. */
|
|
995
1004
|
updated_at: string;
|
|
996
1005
|
}
|
|
997
|
-
/** Endpoint creation also returns
|
|
1006
|
+
/** Endpoint creation/update also returns a newly generated signing secret. */
|
|
998
1007
|
interface IWebhookEndpointCreateResponse extends IWebhookEndpoint {
|
|
999
|
-
/** Store securely
|
|
1008
|
+
/** Store securely when returned; OAuth applications cannot read it later. */
|
|
1000
1009
|
secret?: string;
|
|
1001
1010
|
}
|
|
1002
1011
|
/** An endpoint's Standard Webhooks signing secret. */
|
|
@@ -1021,6 +1030,14 @@ interface IWebhookDispatch {
|
|
|
1021
1030
|
endpoint: string | null;
|
|
1022
1031
|
payload: IWebhookPayload | Record<string, unknown> | null;
|
|
1023
1032
|
delivered: boolean;
|
|
1033
|
+
/** Stable `webhook-id` header across attempts for this event and endpoint. */
|
|
1034
|
+
webhook_id?: string | null;
|
|
1035
|
+
/** Attempt number for this event and endpoint, counted from 1. */
|
|
1036
|
+
attempt?: number | null;
|
|
1037
|
+
/** Whether the entry was scheduled, a recovery probe, or manually retried. */
|
|
1038
|
+
kind?: 'scheduled' | 'probe' | 'manual' | AnyString;
|
|
1039
|
+
/** Whether another automatic attempt follows this entry. */
|
|
1040
|
+
will_retry?: boolean;
|
|
1024
1041
|
http_status: number | null;
|
|
1025
1042
|
/** Receiving endpoint body, truncated by Assinafy to 2,000 characters. */
|
|
1026
1043
|
response_body: string | null;
|
|
@@ -1166,16 +1183,17 @@ interface ITemplateDetailsResponse {
|
|
|
1166
1183
|
updated_at?: string;
|
|
1167
1184
|
[key: string]: unknown;
|
|
1168
1185
|
}
|
|
1169
|
-
/**
|
|
1170
|
-
* Signer assignment for creating a document from a template.
|
|
1171
|
-
*
|
|
1172
|
-
* The SDK temporarily rejects `DigitalCertificate` because the server derives
|
|
1173
|
-
* the method from template fields and can create an unusable `collect`
|
|
1174
|
-
* assignment. Use a direct `virtual` assignment for certificate signers.
|
|
1175
|
-
*/
|
|
1186
|
+
/** Signer assignment for creating a document from a template. */
|
|
1176
1187
|
interface ITemplateSigner {
|
|
1177
1188
|
role_id: string;
|
|
1178
|
-
|
|
1189
|
+
/** Existing signer ID. Takes precedence over the email fields when present. */
|
|
1190
|
+
id?: string;
|
|
1191
|
+
/** Reuses the matching signer or creates one when `id` is omitted. */
|
|
1192
|
+
email?: string;
|
|
1193
|
+
/** Full name used when the email does not match an existing signer. */
|
|
1194
|
+
name?: string;
|
|
1195
|
+
/** E.164 number used when the email does not match an existing signer. */
|
|
1196
|
+
whatsapp_phone_number?: string;
|
|
1179
1197
|
verification_method?: AssignmentVerificationMethod;
|
|
1180
1198
|
notification_methods?: AssignmentNotificationMethod[];
|
|
1181
1199
|
/** Positive integer controlling signing order (see {@link SignerReference}). */
|
|
@@ -1183,9 +1201,7 @@ interface ITemplateSigner {
|
|
|
1183
1201
|
}
|
|
1184
1202
|
/**
|
|
1185
1203
|
* Role/channel descriptor used only for template cost estimation. The official
|
|
1186
|
-
* schema intentionally omits signer
|
|
1187
|
-
* temporarily rejects `DigitalCertificate`; use direct virtual-assignment cost
|
|
1188
|
-
* estimation instead.
|
|
1204
|
+
* schema intentionally omits signer identity and sequential-signing fields.
|
|
1189
1205
|
*/
|
|
1190
1206
|
interface ITemplateCostSigner {
|
|
1191
1207
|
role_id: string;
|
|
@@ -1845,7 +1861,7 @@ declare class DocumentResource extends BaseResource {
|
|
|
1845
1861
|
* a compact representation with no expanded `assignment` or `pages`, so
|
|
1846
1862
|
* prefer it for name lookups and pickers.
|
|
1847
1863
|
*
|
|
1848
|
-
* @param params - `search`, `status`, `page`, `per-page`.
|
|
1864
|
+
* @param params - `search`, `status`, `page`, `per-page`, and `sort`.
|
|
1849
1865
|
* @param accountId - Override the client's default account ID.
|
|
1850
1866
|
* @returns Matching documents, with pagination in `meta`. Each item:
|
|
1851
1867
|
* ```jsonc
|
|
@@ -2346,9 +2362,11 @@ declare class DocumentResource extends BaseResource {
|
|
|
2346
2362
|
*
|
|
2347
2363
|
* Instantiates the template, binding each role to a signer, and returns the
|
|
2348
2364
|
* new document. The request body is `{ signers, ...options }` — `signers`
|
|
2349
|
-
* maps every template `role_id` to an existing
|
|
2350
|
-
*
|
|
2351
|
-
*
|
|
2365
|
+
* maps every template `role_id` to an existing signer `id` or an `email`.
|
|
2366
|
+
* An email reuses the matching account signer or creates one with `name`;
|
|
2367
|
+
* `id` wins when both are present. Options may add `name`, `message`,
|
|
2368
|
+
* `expires_at`, `editor_fields`, and tag names in `tags` (unknown names are
|
|
2369
|
+
* created automatically).
|
|
2352
2370
|
*
|
|
2353
2371
|
* Request body (`application/json`):
|
|
2354
2372
|
* ```jsonc
|
|
@@ -2356,7 +2374,9 @@ declare class DocumentResource extends BaseResource {
|
|
|
2356
2374
|
* "signers": [
|
|
2357
2375
|
* {
|
|
2358
2376
|
* "role_id": "signing_role_example",
|
|
2359
|
-
* "
|
|
2377
|
+
* "email": "signer@example.com",
|
|
2378
|
+
* "name": "Example Signer",
|
|
2379
|
+
* "whatsapp_phone_number": "+15555550100",
|
|
2360
2380
|
* "verification_method": "Email",
|
|
2361
2381
|
* "notification_methods": [
|
|
2362
2382
|
* "Email"
|
|
@@ -2380,27 +2400,33 @@ declare class DocumentResource extends BaseResource {
|
|
|
2380
2400
|
* ```
|
|
2381
2401
|
*
|
|
2382
2402
|
* @param templateId - The template to instantiate.
|
|
2383
|
-
* @param signers - Role-to-signer bindings (each with `role_id` and
|
|
2384
|
-
*
|
|
2403
|
+
* @param signers - Role-to-signer bindings (each with `role_id` and either
|
|
2404
|
+
* an existing `id` or an `email`; email creation also accepts `name` and
|
|
2405
|
+
* `whatsapp_phone_number`). `verification_method`, `notification_methods`,
|
|
2406
|
+
* and `step` are optional.
|
|
2385
2407
|
* Only one notification method is allowed per signer; when only one of the
|
|
2386
2408
|
* verification/notification fields is supplied, the API infers the other.
|
|
2387
2409
|
* `DigitalCertificate` costs 0.5 credits, requires the feature plus a
|
|
2388
2410
|
* signer `government_id`, and that signer must be alone in its step. The
|
|
2389
|
-
* server derives the assignment method from placed template fields
|
|
2390
|
-
*
|
|
2391
|
-
*
|
|
2411
|
+
* server derives the assignment method from placed template fields and
|
|
2412
|
+
* rejects certificate signers when those fields produce a `collect`
|
|
2413
|
+
* assignment. Use a template without placed signer fields for certificate
|
|
2414
|
+
* signing.
|
|
2392
2415
|
* `IdDocumentFaceMatchBasic` needs the ID Document + Face Match feature
|
|
2393
2416
|
* and a valid CPF in `government_id`; estimate the per-signer fee first.
|
|
2394
2417
|
* @param options - Optional `name`, `message`, `expires_at`,
|
|
2395
2418
|
* `editor_fields`, `tags`.
|
|
2396
2419
|
* @param options.name - Generated document display name.
|
|
2397
2420
|
* @param options.message - Signing invitation message.
|
|
2398
|
-
* @param options.expires_at - ISO-8601
|
|
2421
|
+
* @param options.expires_at - ISO-8601 deadline: date-only (ends at 23:59
|
|
2422
|
+
* UTC), date-time without an offset (treated as UTC), or an offset-aware
|
|
2423
|
+
* date-time.
|
|
2399
2424
|
* @param options.editor_fields - Template editor values as `{ field_id, value }` entries.
|
|
2400
2425
|
* @param options.tags - Tag names attached to the generated document.
|
|
2401
2426
|
* @param accountId - Override the client's default account ID.
|
|
2402
|
-
* @returns The
|
|
2403
|
-
* `
|
|
2427
|
+
* @returns The uploaded document. Assignment creation continues in the
|
|
2428
|
+
* background; follow `GET /documents/{documentId}` or webhooks until the
|
|
2429
|
+
* document becomes `pending_signature` or `failed`:
|
|
2404
2430
|
* ```jsonc
|
|
2405
2431
|
* {
|
|
2406
2432
|
* "resource": "document",
|
|
@@ -2408,22 +2434,21 @@ declare class DocumentResource extends BaseResource {
|
|
|
2408
2434
|
* "account_id": "acc_example",
|
|
2409
2435
|
* "template_id": "103a0991a5cde83518e5672aa9aa",
|
|
2410
2436
|
* "name": "Service agreement from template",
|
|
2411
|
-
* "status": "
|
|
2412
|
-
* "artifacts": { "original": "https://…/download/original"
|
|
2437
|
+
* "status": "uploaded",
|
|
2438
|
+
* "artifacts": { "original": "https://…/download/original" },
|
|
2413
2439
|
* "is_closed": false,
|
|
2414
2440
|
* "signing_url": "https://app.assinafy.com.br/sign/19f675b7…",
|
|
2415
2441
|
* "tags": [{ "id": "103a0992…", "name": "agreements", "color": null }],
|
|
2416
|
-
* "assignment":
|
|
2417
|
-
* "pages": [
|
|
2442
|
+
* "assignment": null,
|
|
2443
|
+
* "pages": [],
|
|
2418
2444
|
* "created_at": "2026-07-15T19:57:55Z",
|
|
2419
2445
|
* "updated_at": "2026-07-15T19:59:33Z"
|
|
2420
2446
|
* }
|
|
2421
2447
|
* ```
|
|
2422
|
-
* @throws {ValidationError} If `templateId
|
|
2423
|
-
*
|
|
2424
|
-
*
|
|
2425
|
-
*
|
|
2426
|
-
* is not ready.
|
|
2448
|
+
* @throws {ValidationError} If `templateId`, an account ID, signer identity,
|
|
2449
|
+
* channel, order, deadline, editor field, or tag is invalid.
|
|
2450
|
+
* @throws {ApiError} `400` if the signers/roles are invalid, the template
|
|
2451
|
+
* is not ready, or placed signer fields conflict with `DigitalCertificate`.
|
|
2427
2452
|
*
|
|
2428
2453
|
* @example
|
|
2429
2454
|
* ```ts
|
|
@@ -2439,10 +2464,8 @@ declare class DocumentResource extends BaseResource {
|
|
|
2439
2464
|
*
|
|
2440
2465
|
* A dry run: sends only `{ signers }` and consumes nothing. Use it to check
|
|
2441
2466
|
* balances before calling {@link DocumentResource.createFromTemplate}.
|
|
2442
|
-
* `DigitalCertificate`
|
|
2443
|
-
*
|
|
2444
|
-
* refuses certificate signers instead of returning a price for an
|
|
2445
|
-
* assignment that may charge credits but cannot be completed.
|
|
2467
|
+
* `DigitalCertificate` adds 0.5 credits per signer plus notification cost;
|
|
2468
|
+
* the API returns `400` when the template has placed signer fields.
|
|
2446
2469
|
*
|
|
2447
2470
|
* Request body (`application/json`):
|
|
2448
2471
|
* ```jsonc
|
|
@@ -2484,10 +2507,10 @@ declare class DocumentResource extends BaseResource {
|
|
|
2484
2507
|
* "message": null
|
|
2485
2508
|
* }
|
|
2486
2509
|
* ```
|
|
2487
|
-
* @throws {ValidationError} If `templateId
|
|
2488
|
-
*
|
|
2489
|
-
*
|
|
2490
|
-
*
|
|
2510
|
+
* @throws {ValidationError} If `templateId`, an account ID, role, or
|
|
2511
|
+
* channel is invalid.
|
|
2512
|
+
* @throws {ApiError} `400` if the role is invalid or placed signer fields
|
|
2513
|
+
* conflict with `DigitalCertificate`; `403` when a feature is unavailable.
|
|
2491
2514
|
*
|
|
2492
2515
|
* @example
|
|
2493
2516
|
* ```ts
|
|
@@ -3299,7 +3322,7 @@ declare class AssignmentResource extends BaseResource {
|
|
|
3299
3322
|
* without it. Note the camelCase spelling: `account_id` and an
|
|
3300
3323
|
* `X-Account-Id` header are both rejected.
|
|
3301
3324
|
*
|
|
3302
|
-
* @param params - `page`, `per-page`.
|
|
3325
|
+
* @param params - `page`, `per-page`, and `sort`.
|
|
3303
3326
|
* @param accountId - Override the client's default account ID.
|
|
3304
3327
|
* @returns Assignments, with pagination in `meta`. Each item is a full
|
|
3305
3328
|
* {@link IAssignment} (same shape as {@link AssignmentResource.create}
|
|
@@ -3424,6 +3447,8 @@ declare class AssignmentResource extends BaseResource {
|
|
|
3424
3447
|
* @param payload - Signers plus optional `method` (defaults to `virtual`),
|
|
3425
3448
|
* `message`, `expires_at`, `copy_receivers` (existing signer IDs, not
|
|
3426
3449
|
* addresses), and `collect`-mode `entries` with page-image geometry.
|
|
3450
|
+
* `expires_at` accepts a date (ending at 23:59 UTC), a date-time without
|
|
3451
|
+
* an offset (UTC), or an offset-aware date-time.
|
|
3427
3452
|
* @returns The created {@link IAssignment}: `signers` (rich, with `step` /
|
|
3428
3453
|
* `notified` / `verification_method`), `items` (one row per signer × field),
|
|
3429
3454
|
* a `summary` count block, and per-signer `signing_urls`. Response shape:
|
|
@@ -3587,9 +3612,10 @@ declare class AssignmentResource extends BaseResource {
|
|
|
3587
3612
|
* (`PUT /documents/{documentId}/assignments/{assignmentId}/reset-expiration`).
|
|
3588
3613
|
*
|
|
3589
3614
|
* Sends `{ expires_at }` verbatim; the key itself is required by the
|
|
3590
|
-
* contract. Use an ISO-8601 date
|
|
3591
|
-
*
|
|
3592
|
-
*
|
|
3615
|
+
* contract. Use an ISO-8601 date, a date-time with or without an offset,
|
|
3616
|
+
* or `null` to remove the expiration. Date-only values end at 23:59 UTC;
|
|
3617
|
+
* date-times without offsets are UTC. `null` is intentionally not stripped
|
|
3618
|
+
* from the body.
|
|
3593
3619
|
*
|
|
3594
3620
|
* Request body (`application/json`):
|
|
3595
3621
|
* ```jsonc
|
|
@@ -3600,8 +3626,8 @@ declare class AssignmentResource extends BaseResource {
|
|
|
3600
3626
|
*
|
|
3601
3627
|
* @param documentId - The document the assignment belongs to.
|
|
3602
3628
|
* @param assignmentId - The assignment to update.
|
|
3603
|
-
* @param expiresAt - New expiry as an ISO-8601 date
|
|
3604
|
-
* to remove the expiration.
|
|
3629
|
+
* @param expiresAt - New expiry as an ISO-8601 date or date-time string,
|
|
3630
|
+
* or `null` to remove the expiration.
|
|
3605
3631
|
* @returns The updated {@link IAssignment} — the same full shape
|
|
3606
3632
|
* {@link AssignmentResource.create} returns (`signers`, `items`, `summary`,
|
|
3607
3633
|
* `signing_urls`), with `expires_at` reflecting the new value:
|
|
@@ -3909,6 +3935,8 @@ declare class WebhookResource extends BaseResource {
|
|
|
3909
3935
|
* "document_processing_failed"
|
|
3910
3936
|
* ],
|
|
3911
3937
|
* "is_active": true,
|
|
3938
|
+
* "is_held": false,
|
|
3939
|
+
* "held_since": null,
|
|
3912
3940
|
* "updated_at": "2026-07-18T02:36:02Z" // no `id` / `created_at` are returned
|
|
3913
3941
|
* }
|
|
3914
3942
|
* ```
|
|
@@ -4041,11 +4069,12 @@ declare class WebhookResource extends BaseResource {
|
|
|
4041
4069
|
* (`GET /accounts/{accountId}/webhooks`). Pagination info (if any) is
|
|
4042
4070
|
* attached in `meta`.
|
|
4043
4071
|
*
|
|
4044
|
-
* Assinafy treats any `2xx` response as success.
|
|
4045
|
-
*
|
|
4046
|
-
*
|
|
4047
|
-
*
|
|
4048
|
-
*
|
|
4072
|
+
* Assinafy treats any `2xx` response as success. Retriable failures get up
|
|
4073
|
+
* to six attempts about ten minutes apart. After ten failed deliveries in
|
|
4074
|
+
* a row, the endpoint is paused and probed after 3, 15 and 60 minutes, then
|
|
4075
|
+
* every six hours. A successful delivery or probe resumes the endpoint and
|
|
4076
|
+
* replays missed events oldest first. Response bodies are truncated to
|
|
4077
|
+
* 2,000 characters and delivery entries are retained for seven days.
|
|
4049
4078
|
*
|
|
4050
4079
|
* @param params - Optional filters and pagination:
|
|
4051
4080
|
* - `endpoint_id` — only deliveries to this webhook endpoint.
|
|
@@ -4072,6 +4101,10 @@ declare class WebhookResource extends BaseResource {
|
|
|
4072
4101
|
* // subject: <User>, account_id, created_at }
|
|
4073
4102
|
* },
|
|
4074
4103
|
* "delivered": true,
|
|
4104
|
+
* "webhook_id": "9f86d081884c7d659a2feaa0c55ad015",
|
|
4105
|
+
* "attempt": 1,
|
|
4106
|
+
* "kind": "scheduled",
|
|
4107
|
+
* "will_retry": false,
|
|
4075
4108
|
* "http_status": 200,
|
|
4076
4109
|
* "response_body": "{ ... }", // receiving endpoint body, max 2,000 chars
|
|
4077
4110
|
* "error": null,
|
|
@@ -4147,11 +4180,14 @@ declare class WebhookResource extends BaseResource {
|
|
|
4147
4180
|
* [
|
|
4148
4181
|
* {
|
|
4149
4182
|
* "id": "65f1c2a9b3e4d5f60718293a4b5c6d7e",
|
|
4183
|
+
* "resource": "activity_event_subscription",
|
|
4150
4184
|
* "name": "ERP",
|
|
4151
4185
|
* "url": "https://example.com/webhooks/assinafy",
|
|
4152
4186
|
* "email": "ops@example.com",
|
|
4153
4187
|
* "events": ["document_ready", "signer_signed_document"],
|
|
4154
4188
|
* "is_active": true,
|
|
4189
|
+
* "is_held": false,
|
|
4190
|
+
* "held_since": null,
|
|
4155
4191
|
* "signing_enabled": true, // deliveries carry a `webhook-signature` header
|
|
4156
4192
|
* "created_at": "2026-10-01T12:00:00Z",
|
|
4157
4193
|
* "updated_at": "2026-10-01T12:00:00Z"
|
|
@@ -4177,8 +4213,8 @@ declare class WebhookResource extends BaseResource {
|
|
|
4177
4213
|
* An account can have 1 endpoint, or up to 3 on paid plans. Each endpoint
|
|
4178
4214
|
* of a workspace needs a different `url`. With `signing_enabled: true` the
|
|
4179
4215
|
* API returns a signing `secret` in this creation response. Store it now:
|
|
4180
|
-
* OAuth applications cannot call {@link WebhookResource.getEndpointSecret}
|
|
4181
|
-
*
|
|
4216
|
+
* OAuth applications cannot call {@link WebhookResource.getEndpointSecret},
|
|
4217
|
+
* but they can rotate a lost secret. When `events` is omitted or
|
|
4182
4218
|
* empty, {@link DEFAULT_WEBHOOK_EVENTS} is sent. OAuth tokens need the
|
|
4183
4219
|
* `webhooks:write` scope.
|
|
4184
4220
|
*
|
|
@@ -4194,19 +4230,22 @@ declare class WebhookResource extends BaseResource {
|
|
|
4194
4230
|
* }
|
|
4195
4231
|
* ```
|
|
4196
4232
|
*
|
|
4197
|
-
* @param payload - Endpoint details. `url` (absolute
|
|
4233
|
+
* @param payload - Endpoint details. `url` (absolute HTTPS) and `email`
|
|
4198
4234
|
* are required; `events`, `name`, `is_active` and `signing_enabled` are
|
|
4199
4235
|
* optional.
|
|
4200
4236
|
* @param accountId - Override the client's default account ID.
|
|
4201
4237
|
* @returns The created endpoint:
|
|
4202
4238
|
* ```jsonc
|
|
4203
4239
|
* {
|
|
4240
|
+
* "resource": "activity_event_subscription",
|
|
4204
4241
|
* "id": "65f1c2a9b3e4d5f60718293a4b5c6d7e",
|
|
4205
4242
|
* "name": "ERP",
|
|
4206
4243
|
* "url": "https://example.com/webhooks/assinafy",
|
|
4207
4244
|
* "email": "ops@example.com",
|
|
4208
4245
|
* "events": ["document_ready", "signer_signed_document"],
|
|
4209
4246
|
* "is_active": true,
|
|
4247
|
+
* "is_held": false,
|
|
4248
|
+
* "held_since": null,
|
|
4210
4249
|
* "signing_enabled": true, // deliveries carry a `webhook-signature` header
|
|
4211
4250
|
* "secret": "whsec_c2VjcmV0", // only in this response when signing is enabled
|
|
4212
4251
|
* "created_at": "2026-10-01T12:00:00Z",
|
|
@@ -4242,12 +4281,15 @@ declare class WebhookResource extends BaseResource {
|
|
|
4242
4281
|
* @returns The endpoint:
|
|
4243
4282
|
* ```jsonc
|
|
4244
4283
|
* {
|
|
4284
|
+
* "resource": "activity_event_subscription",
|
|
4245
4285
|
* "id": "65f1c2a9b3e4d5f60718293a4b5c6d7e",
|
|
4246
4286
|
* "name": "ERP",
|
|
4247
4287
|
* "url": "https://example.com/webhooks/assinafy",
|
|
4248
4288
|
* "email": "ops@example.com",
|
|
4249
4289
|
* "events": ["document_ready", "signer_signed_document"],
|
|
4250
4290
|
* "is_active": true,
|
|
4291
|
+
* "is_held": false,
|
|
4292
|
+
* "held_since": null,
|
|
4251
4293
|
* "signing_enabled": true, // deliveries carry a `webhook-signature` header
|
|
4252
4294
|
* "created_at": "2026-10-01T12:00:00Z",
|
|
4253
4295
|
* "updated_at": "2026-10-01T12:00:00Z"
|
|
@@ -4266,12 +4308,13 @@ declare class WebhookResource extends BaseResource {
|
|
|
4266
4308
|
/**
|
|
4267
4309
|
* Change a webhook endpoint
|
|
4268
4310
|
* (`PUT /accounts/{accountId}/webhooks/endpoints/{endpointId}`). Only the
|
|
4269
|
-
* fields sent are updated; `url`
|
|
4270
|
-
*
|
|
4311
|
+
* fields sent are updated; a changed `url` must be HTTPS, publicly
|
|
4312
|
+
* routable, and different from every other endpoint in the workspace.
|
|
4271
4313
|
*
|
|
4272
4314
|
* `signing_enabled: true` generates a secret if the endpoint has none and
|
|
4273
|
-
* keeps the current one otherwise; `false` discards the secret.
|
|
4274
|
-
*
|
|
4315
|
+
* keeps the current one otherwise; `false` discards the secret. When this
|
|
4316
|
+
* request turns signing on, the response includes the new `secret` once.
|
|
4317
|
+
* OAuth tokens need the `webhooks:write` scope.
|
|
4275
4318
|
*
|
|
4276
4319
|
* Request body (`application/json`, every field optional):
|
|
4277
4320
|
* ```jsonc
|
|
@@ -4291,13 +4334,17 @@ declare class WebhookResource extends BaseResource {
|
|
|
4291
4334
|
* @returns The updated endpoint:
|
|
4292
4335
|
* ```jsonc
|
|
4293
4336
|
* {
|
|
4337
|
+
* "resource": "activity_event_subscription",
|
|
4294
4338
|
* "id": "65f1c2a9b3e4d5f60718293a4b5c6d7e",
|
|
4295
4339
|
* "name": "ERP",
|
|
4296
4340
|
* "url": "https://example.com/webhooks/assinafy",
|
|
4297
4341
|
* "email": "ops@example.com",
|
|
4298
4342
|
* "events": ["document_ready", "signer_signed_document"],
|
|
4299
4343
|
* "is_active": true,
|
|
4344
|
+
* "is_held": false,
|
|
4345
|
+
* "held_since": null,
|
|
4300
4346
|
* "signing_enabled": true, // deliveries carry a `webhook-signature` header
|
|
4347
|
+
* "secret": "whsec_c2VjcmV0", // only when this request turned signing on
|
|
4301
4348
|
* "created_at": "2026-10-01T12:00:00Z",
|
|
4302
4349
|
* "updated_at": "2026-10-01T12:00:00Z"
|
|
4303
4350
|
* }
|
|
@@ -4313,7 +4360,7 @@ declare class WebhookResource extends BaseResource {
|
|
|
4313
4360
|
* await client.webhooks.updateEndpoint(endpoint.id, { is_active: false });
|
|
4314
4361
|
* ```
|
|
4315
4362
|
*/
|
|
4316
|
-
updateEndpoint(endpointId: string, payload: IWebhookEndpointUpdatePayload, accountId?: string): Promise<
|
|
4363
|
+
updateEndpoint(endpointId: string, payload: IWebhookEndpointUpdatePayload, accountId?: string): Promise<IWebhookEndpointCreateResponse>;
|
|
4317
4364
|
/**
|
|
4318
4365
|
* Stop delivering events to an endpoint and free its plan slot
|
|
4319
4366
|
* (`DELETE /accounts/{accountId}/webhooks/endpoints/{endpointId}`). Its
|
|
@@ -4382,7 +4429,7 @@ declare class WebhookResource extends BaseResource {
|
|
|
4382
4429
|
* (`POST /accounts/{accountId}/webhooks/endpoints/{endpointId}/secret/rotate`).
|
|
4383
4430
|
* The old secret stops working immediately: deliveries sent after the
|
|
4384
4431
|
* rotation are signed only with the new secret, so update the receiver at
|
|
4385
|
-
* once.
|
|
4432
|
+
* once. OAuth tokens need the `webhooks:write` scope.
|
|
4386
4433
|
*
|
|
4387
4434
|
* @param endpointId - The endpoint ID.
|
|
4388
4435
|
* @param accountId - Override the client's default account ID.
|
|
@@ -7895,8 +7942,9 @@ declare class AssinafyClient {
|
|
|
7895
7942
|
* the API; only `collect` assignments require pre-rendered pages.
|
|
7896
7943
|
* @param options.waitOptions - Optional `maxWaitMs` / `pollIntervalMs`
|
|
7897
7944
|
* forwarded to {@link DocumentResource.waitUntilReady}.
|
|
7898
|
-
* @param options.expiresAt - Optional ISO-8601 assignment expiry
|
|
7899
|
-
*
|
|
7945
|
+
* @param options.expiresAt - Optional ISO-8601 assignment expiry. A date
|
|
7946
|
+
* ends at 23:59 UTC; a date-time without an offset is interpreted as UTC;
|
|
7947
|
+
* an explicit offset is honored.
|
|
7900
7948
|
* @param options.copyReceivers - Optional existing signer IDs (not email
|
|
7901
7949
|
* addresses) that receive a copy. See the caveat on
|
|
7902
7950
|
* {@link ICreateAssignmentPayload.copy_receivers}; some plans silently drop
|