@verdocs/js-sdk 6.4.5 → 6.4.7

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
@@ -212,6 +212,1072 @@ type TSession = IUserSession | ISigningSession | null;
212
212
  * An active authenticated session within Verdocs, either for signing or regular user-based operations.
213
213
  */
214
214
  type TActiveSession = IUserSession | ISigningSession;
215
+ declare namespace BaseTypes {
216
+ type TRequestStatus = "OK" | "ERROR";
217
+ type TTemplateSender = "envelope_creator" | "template_owner";
218
+ type TTemplateAction = "create_personal" | "create_org" | "create_public" | "read" | "write" | "delete" | "change_visibility_personal" | "change_visibility_org" | "change_visibility_public";
219
+ type TRecipientAction = "submit" | "decline" | "prepare" | "update";
220
+ type TEnvelopeStatus = "complete" | "pending" | "in progress" | "declined" | "canceled";
221
+ type TRecipientStatus = "invited" | "opened" | "signed" | "submitted" | "canceled" | "pending" | "declined";
222
+ type TRecipientType = "signer" | "cc" | "approver";
223
+ /**
224
+ * Plans provide access to Verdocs product features.
225
+ */
226
+ // export type TPlan = 'env:essential' | 'org:standard';
227
+ type TSortTemplateBy = "created_at" | "updated_at" | "name" | "last_used_at" | "counter" | "star_counter";
228
+ type TAccessKeyType = "email" | "in_app" | "in_person_link" | "sms";
229
+ type TApiKeyPermission = "personal" | "global_read" | "global_write";
230
+ /** @deprecated. See envelope.created_at, .updated_at, and .canceled_at. */
231
+ type TDeprecatedHistoryEvent = "envelope:created" | "envelope:completed";
232
+ type THistoryEvent = "recipient:signed" | "recipient:opened" | "recipient:submitted" | "recipient:prepared" | "recipient:claimed" | "recipient:agreed" | "recipient:invited" | "recipient:reminder" | "recipient:delegated" | "recipient:updated_info" | "recipient:declined" | "recipient:kba_verified" | "recipient:kba_failed" | "recipient:id_verified" | "recipient:id_failed" | "recipient:pin_verified" | "recipient:pin_failed" | "invitation:resent" | "envelope:cc" | "envelope:canceled" | "envelope:expired" | "owner:updated_recipient_info" | "owner:get_in_person_link" | TDeprecatedHistoryEvent;
233
+ type TEventDetail = "in_app" | "mail" | "signer" | "sms" | "reminder" | "preparer" | "manual" | "in_person_link" | "guest" | "email" | "" | string; // Modification events have a string description
234
+ type TEnvelopeUpdateResult = Omit<IEnvelope, "histories" | "recipients" | "certificate" | "document" | "fields" | "profile">;
235
+ type TFieldType = "signature" | "initial" | "checkbox" | "radio" | "textbox" | "timestamp" | "date" | "dropdown" | "textarea" | "attachment" | "payment";
236
+ type TWebhookEvent = "envelope_created" | "envelope_completed" | "envelope_canceled" | "envelope_updated" | "envelope_expired" | "template_created" | "template_updated" | "template_deleted" | "template_used" | "recipient_submitted" | "recipient_updated" | "recipient_delegated" | "kba_event" | "entitlement_used";
237
+ type TTemplateVisibility = "private" | "shared" | "public";
238
+ type TEntitlement = "envelope" | "kba_auth" | "passcode_auth" | "sms_auth" | "kba_id_auth" | "id_auth" | "custom_disclaimer";
239
+ /**
240
+ * The authentication method(s) required for a recipient to access an envelope. "Passcode" will require a
241
+ * PIN or passcode to be entered, which is intended to be known to the sender and recipient ahead of time
242
+ * and communicated by means of their choosing. "SMS" and "Email" will send a one-time-code via the respective
243
+ * channel for the recipient to enter. "KBA" will require the recipient to confirm personal information such
244
+ * as prior addresses, phone numbers, etc. "ID" will require the recipient to perform full ID-based verification.
245
+ */
246
+ type TRecipientAuthMethod = "kba" | "passcode" | "sms" | "email" | "id";
247
+ type TRecipientAuthStep = TRecipientAuthMethod | null;
248
+ type TUsageType = "envelope" | "envelope_canceled" | "envelope_completed" | "envelope_expired" | "sms_invite" | "template" | "auth_email" | "auth_sms" | "auth_kba" | "auth_id" | "auth_passcode";
249
+ /**
250
+ * Methods for authenticating webhook requests.
251
+ */
252
+ type TWebhookAuthMethod = "none" | "hmac" | "client_credentials";
253
+ /**
254
+ * Create public templates. Public templates are still owned and managed by the creator,
255
+ * but may be searched for and used to create envelopes by other users.
256
+ */
257
+ type TTemplatePermissionCreatePublic = "template:creator:create:public";
258
+ /**
259
+ * Create templates shared with other users of the same organization.
260
+ */
261
+ type TTemplatePermissionCreateOrg = "template:creator:create:org";
262
+ /**
263
+ * Create templates private to the creator.
264
+ */
265
+ type TTemplatePermissionCreatePersonal = "template:creator:create:personal";
266
+ /**
267
+ * Create templates private to the creator.
268
+ */
269
+ type TTemplatePermissionDelete = "template:creator:delete";
270
+ /**
271
+ * Alter the visiiblity settings on a template.
272
+ */
273
+ type TTemplatePermissionVisibility = "template:creator:visibility";
274
+ /**
275
+ * View templates shared by other members of the same organization. Those templates must also
276
+ * have `is_personal` set to false to be visible.
277
+ */
278
+ type TTemplateMemberRead = "template:member:read";
279
+ /**
280
+ * Edit templates shared by other members of the same organization. Those templates must also
281
+ * have `is_personal` set to false to be editable.
282
+ */
283
+ type TTemplateMemberWrite = "template:member:write";
284
+ /**
285
+ * Edit templates shared by other members of the same organization. Those templates must also
286
+ * have `is_personal` set to false to be editable.
287
+ */
288
+ type TTemplateMemberDelete = "template:member:delete";
289
+ /**
290
+ * Edit templates shared by other members of the same organization. Those templates must also
291
+ * have `is_personal` set to false to be editable.
292
+ */
293
+ type TTemplateMemberVisibility = "template:member:visibility";
294
+ type TTemplatePermission = TTemplatePermissionCreatePublic | TTemplatePermissionCreateOrg | TTemplatePermissionCreatePersonal | TTemplatePermissionDelete | TTemplatePermissionVisibility | TTemplateMemberRead | TTemplateMemberWrite | TTemplateMemberDelete | TTemplateMemberVisibility;
295
+ /**
296
+ * Grant the "owner" role to other organization members.
297
+ */
298
+ type TAccountPermissionOwnerAdd = "owner:add";
299
+ /**
300
+ * Remove the "owner" role from other organization members.
301
+ */
302
+ type TAccountPermissionOwnerRemove = "owner:remove";
303
+ /**
304
+ * Grant the "admin" role to other organization members.
305
+ */
306
+ type TAccountPermissionAdminAdd = "admin:add";
307
+ /**
308
+ * Remove the "admin" role from other organization members.
309
+ */
310
+ type TAccountPermissionAdminRemove = "admin:remove";
311
+ /**
312
+ * View the members of an organization.
313
+ */
314
+ type TAccountPermissionMemberView = "member:view";
315
+ /**
316
+ * Grant the "member" role to other organization members.
317
+ */
318
+ type TAccountPermissionMemberAdd = "member:add";
319
+ /**
320
+ * Remove the "member" role from other organization members.
321
+ */
322
+ type TAccountPermissionMemberRemove = "member:remove";
323
+ type TAccountPermission = TAccountPermissionOwnerAdd | TAccountPermissionOwnerRemove | TAccountPermissionAdminAdd | TAccountPermissionAdminRemove | TAccountPermissionMemberAdd | TAccountPermissionMemberRemove | TAccountPermissionMemberView;
324
+ /**
325
+ * Create a new organization.
326
+ * @deprecated This is a system-wide setting and organization owners cannot prevent their
327
+ * members from listing other organizations that they may have separate profiles in.
328
+ */
329
+ type TOrgPermissionCreate = "org:create";
330
+ /**
331
+ * View the organization.
332
+ */
333
+ type TOrgPermissionView = "org:view";
334
+ /**
335
+ * Update the organization.
336
+ */
337
+ type TOrgPermissionUpdate = "org:update";
338
+ /**
339
+ * Delete the organization.
340
+ */
341
+ type TOrgPermissionDelete = "org:delete";
342
+ /**
343
+ * Transfer ownership of the organization. This primarily allows the holder to remove his/her own
344
+ * Owner role or add new Owners even if the holder is not one themselves. This is primarily intended
345
+ * to be used for reseller scenarios.
346
+ */
347
+ type TOrgPermissionTransfer = "org:transfer";
348
+ /**
349
+ * List organizations.
350
+ * @deprecated This is a system-wide setting and organization owners cannot prevent their
351
+ * members from listing other organizations that they may have separate profiles in.
352
+ */
353
+ type TOrgPermissionList = "org:list";
354
+ type TOrgPermission = TOrgPermissionCreate | TOrgPermissionView | TOrgPermissionUpdate | TOrgPermissionDelete | TOrgPermissionTransfer | TOrgPermissionList;
355
+ /**
356
+ * Create envelopes.
357
+ */
358
+ type TEnvelopePermissionCreate = "envelope:create";
359
+ /**
360
+ * Cancel envelopes. This is a default permission for most users, but it may be removed for
361
+ * highly regulated environments where envelope activities must be audited, and should not
362
+ * be canceled.
363
+ */
364
+ type TEnvelopePermissionCancel = "envelope:cancel";
365
+ /**
366
+ * View envelopes. This is a default permission for most users, but it may be removed for
367
+ * highly regulated environments where once sent, envelopes may only be viewed by specific
368
+ * users.
369
+ */
370
+ type TEnvelopePermissionView = "envelope:view";
371
+ /**
372
+ * View envelopes created by other members of the same organization. By default, only templates
373
+ * having sharing settings controlled by their creators. Envelopes are usually private to the
374
+ * callers who created them. In some organizations it may be useful to have users who can see
375
+ * "all activity" by all organization members. This is particularly useful when applied to API
376
+ * keys to develop applications that can access all data across the organization.
377
+ */
378
+ type TEnvelopePermissionOrg = "envelope:org:view";
379
+ type TEnvelopePermission = TEnvelopePermissionCreate | TEnvelopePermissionCancel | TEnvelopePermissionView | TEnvelopePermissionOrg;
380
+ /**
381
+ * Operation within Verdocs that users may perform.
382
+ */
383
+ type TPermission = TTemplatePermission | TOrgPermission | TAccountPermission | TEnvelopePermission;
384
+ /**
385
+ * Roles provide access to groups of permissions. Note that for historical reasons there is some overlap in the
386
+ * use of the term "role". TRole refers to a user type. A "Role" (IRole) is a Template participant placeholder.
387
+ */
388
+ type TRole = "contact" | "basic_user" | "member" | "admin" | "owner";
389
+ /**
390
+ * A map of the permissions each role confers.
391
+ */
392
+ const RolePermissions: Record<TRole, TPermission[]>;
393
+ /**
394
+ * Confirm whether the user has all of the specified permissions.
395
+ */
396
+ const userHasPermissions: (profile: IProfile | null | undefined, permissions: TPermission[]) => boolean;
397
+ /**
398
+ * A Signing Session connects a caller to a role within an envelope, and can be used only for calls related to signing that envelope.
399
+ */
400
+ interface ISigningSession {
401
+ aud: string;
402
+ iss: string;
403
+ sub: string; // Verdocs access key ID
404
+ iat: number;
405
+ exp: number;
406
+ session_type: "signing";
407
+ key_type: TAccessKeyType;
408
+ email: string;
409
+ profile_id: string;
410
+ envelope_id: string;
411
+ role_name: string;
412
+ // @deprecated
413
+ ["https://verdocs.com/session_type"]: "signing";
414
+ // @deprecated
415
+ ["https://verdocs.com/envelope_id"]: string;
416
+ // @deprecated
417
+ ["https://verdocs.com/role_name"]: string;
418
+ }
419
+ /**
420
+ * A User Session connects a caller to a Verdocs profile, and can be used for any operations that profile may perform.
421
+ */
422
+ interface IUserSession {
423
+ jti: string;
424
+ aud: string;
425
+ iss: string;
426
+ sub: string; // Verdocs user_id
427
+ iat: number;
428
+ exp: number;
429
+ session_type: "user";
430
+ email: string;
431
+ profile_id: string;
432
+ organization_id: string;
433
+ global_admin: boolean;
434
+ // @deprecated
435
+ ["https://verdocs.com/session_type"]: "user";
436
+ // @deprecated
437
+ ["https://verdocs.com/profile_id"]: string;
438
+ // @deprecated
439
+ ["https://verdocs.com/organization_id"]: string;
440
+ // @deprecated
441
+ ["https://verdocs.com/global_admin"]: boolean;
442
+ }
443
+ interface IIdToken {
444
+ aud: string;
445
+ iss: string;
446
+ sub: string; // Verdocs user_id
447
+ email: string;
448
+ organization_id: string;
449
+ first_name: string;
450
+ last_name: string;
451
+ phone: string;
452
+ }
453
+ /**
454
+ * Verdocs supports two types of authenticated sessions: User and Signing. Both behave similarly and have similar
455
+ * properties, but signing sessions only have access to a small set of signing-related functions.
456
+ */
457
+ type TSessionType = "user" | "signing";
458
+ /**
459
+ * Represents a possibly-authenticated session within Verdocs, either for signing or regular user-based operations.
460
+ */
461
+ type TSession = IUserSession | ISigningSession | null;
462
+ /**
463
+ * An active authenticated session within Verdocs, either for signing or regular user-based operations.
464
+ */
465
+ type TActiveSession = IUserSession | ISigningSession;
466
+ /////////////////////////////// NOTIFICATIONS /////////////////////////////
467
+ interface IChannel {
468
+ id: string;
469
+ channel_type: string;
470
+ event_name: string;
471
+ disabled_channels?: IDisabledChannel[];
472
+ }
473
+ interface IDisabledChannel {
474
+ channel_id: string;
475
+ profile_id: string;
476
+ profile?: IProfile;
477
+ channel?: IChannel;
478
+ }
479
+ interface INotification {
480
+ id: string;
481
+ profile_id: string;
482
+ event_name: string;
483
+ data: any;
484
+ read: boolean;
485
+ deleted: boolean;
486
+ message: string;
487
+ time: string;
488
+ profile?: IProfile;
489
+ }
490
+ //////////////////////////////////////// IAM //////////////////////////////
491
+ interface IApiKey {
492
+ client_id: string;
493
+ name: string;
494
+ organization_id: string;
495
+ profile_id: string;
496
+ global_admin: boolean;
497
+ client_secret?: string | null;
498
+ permission: TApiKeyPermission;
499
+ profile?: IProfile;
500
+ organization?: IOrganization;
501
+ }
502
+ interface IGroup {
503
+ id: string;
504
+ name: string;
505
+ organization_id: string;
506
+ permissions: TPermission[];
507
+ organization?: IOrganization;
508
+ profiles?: IGroupProfile[];
509
+ }
510
+ interface IGroupProfile {
511
+ group_id: string;
512
+ profile_id: string;
513
+ organization_id: string;
514
+ group?: IGroup;
515
+ profile?: IProfile;
516
+ organization?: IOrganization;
517
+ }
518
+ interface IOAuth2App {
519
+ id: string;
520
+ profile_id: string;
521
+ organization_id: string;
522
+ name: string;
523
+ client_id: string;
524
+ client_secret?: string | null;
525
+ redirect_uris: string;
526
+ origins: string;
527
+ friendly_name: string;
528
+ logo_uri: string;
529
+ public_key: string;
530
+ private_key: string;
531
+ created_at: string;
532
+ updated_at: string;
533
+ organization?: IOrganization;
534
+ profile?: IProfile;
535
+ }
536
+ interface IEntitlement {
537
+ id: string;
538
+ organization_id: string;
539
+ feature: TEntitlement;
540
+ contract_id?: string | null;
541
+ notes?: string | null;
542
+ starts_at: string;
543
+ ends_at: string;
544
+ monthly_max: number;
545
+ yearly_max: number;
546
+ created_at: string;
547
+ organization?: IOrganization;
548
+ }
549
+ interface IOrganization {
550
+ /** The unique ID of the organization */
551
+ id: string;
552
+ /** The organization's name. */
553
+ name: string;
554
+ address: string | null;
555
+ address2: string | null;
556
+ phone: string | null;
557
+ /** If the organization is a business, its name. Note that a business name can be different from an organization name. */
558
+ contact_email: string | null;
559
+ slug?: string | null;
560
+ /** Web site URL */
561
+ url?: string | null;
562
+ full_logo_url?: string | null;
563
+ thumbnail_url?: string | null;
564
+ primary_color?: string | null;
565
+ secondary_color?: string | null;
566
+ parent_id: string | null;
567
+ disclaimer?: string | null;
568
+ terms_use_url?: string | null;
569
+ privacy_policy_url?: string | null;
570
+ powered_by_label?: string | null;
571
+ powered_by_url?: string | null;
572
+ data?: Record<string, any> | null;
573
+ /** Creation date/time. */
574
+ created_at: string;
575
+ /** Last-update date/time. */
576
+ updated_at: string;
577
+ api_keys?: IApiKey[];
578
+ children?: IOrganization[];
579
+ parent?: IOrganization;
580
+ groups?: IGroup[];
581
+ oauth2_apps?: IOAuth2App[];
582
+ entitlements?: IEntitlement[];
583
+ organization_invitations?: IOrganizationInvitation[];
584
+ profiles?: IProfile[];
585
+ webhooks?: IWebhook[];
586
+ envelopes?: IEnvelope[];
587
+ templates?: ITemplate[];
588
+ group_profiles?: IGroupProfile[];
589
+ pending_webhooks?: IPendingWebhook[];
590
+ }
591
+ interface IOrganizationInvitation {
592
+ organization_id: string;
593
+ email: string;
594
+ first_name: string;
595
+ last_name: string;
596
+ status: "pending";
597
+ role: TRole;
598
+ generated_at: string;
599
+ token?: string | null;
600
+ organization?: IOrganization;
601
+ }
602
+ interface IPendingWebhook {
603
+ id: string;
604
+ webhook_id: string;
605
+ organization_id: string;
606
+ url: string;
607
+ body: any;
608
+ created_at: string;
609
+ delivered_at: string | null;
610
+ last_attempt_at: string | null;
611
+ last_status: number | null;
612
+ last_result: string | null;
613
+ webhook?: IWebhook;
614
+ organization?: IOrganization;
615
+ }
616
+ interface IProfile {
617
+ /** The unique ID of the profile */
618
+ id: string;
619
+ /**
620
+ * In Verdocs, a user may have multiple profiles. A user represents a single person. A profile
621
+ * represents that person within an organization. Some profiles may have no user atached, typically
622
+ * Contacts and Signers. This can change if that person registers for a user later.
623
+ */
624
+ user_id: string | null;
625
+ /** The profile's organization ID, or a global "Verdocs" organization that all personal profiles are members of. */
626
+ organization_id: string;
627
+ first_name: string;
628
+ last_name: string;
629
+ email: string;
630
+ phone: string | null;
631
+ picture: string | null;
632
+ /** If true, this is the caller's "currently selected" profile. All operations will performed "as" this profile. */
633
+ current: boolean;
634
+ permissions: TPermission[];
635
+ roles: TRole[];
636
+ // Creation date/time.
637
+ created_at: string;
638
+ // Last-update date/time.
639
+ updated_at: string;
640
+ user?: IUser;
641
+ organization?: IOrganization;
642
+ api_keys?: IApiKey[];
643
+ group_profiles?: IGroupProfile[];
644
+ groups?: IGroup[];
645
+ notifications?: INotification[];
646
+ oauth2_apps?: IOAuth2App[];
647
+ signatures?: ISignature[];
648
+ initials?: IInitial[];
649
+ }
650
+ interface IUser {
651
+ id: string;
652
+ email: string;
653
+ email_verified: boolean;
654
+ pass_hash?: string;
655
+ first_name: string | null;
656
+ last_name: string | null;
657
+ phone: string | null;
658
+ picture: string | null;
659
+ b2cId: string | null;
660
+ googleId: string | null;
661
+ appleId: string | null;
662
+ githubId?: string | null;
663
+ created_at: string;
664
+ updated_at: string;
665
+ }
666
+ // TODO: Combine this with TWebhookEvent in BaseTypes.
667
+ interface IWebhookEvents {
668
+ envelope_created: boolean;
669
+ envelope_completed: boolean;
670
+ envelope_updated: boolean;
671
+ envelope_canceled: boolean;
672
+ envelope_expired: boolean;
673
+ template_created: boolean;
674
+ template_updated: boolean;
675
+ template_deleted: boolean;
676
+ template_used: boolean;
677
+ recipient_submitted: boolean;
678
+ recipient_updated: boolean;
679
+ recipient_delegated: boolean;
680
+ kba_event: boolean;
681
+ entitlement_used: boolean;
682
+ }
683
+ interface IWebhook {
684
+ id: string;
685
+ organization_id: string;
686
+ url: string;
687
+ secret_key?: string;
688
+ client_id?: string;
689
+ client_secret?: string;
690
+ auth_method: BaseTypes.TWebhookAuthMethod;
691
+ active: boolean;
692
+ events: IWebhookEvents;
693
+ status: string | null;
694
+ last_success: string | null;
695
+ last_failure: string | null;
696
+ organization?: IOrganization;
697
+ pending_webhooks?: IPendingWebhook[];
698
+ }
699
+ //////////////////////////////// FORMS ////////////////////////////////////
700
+ interface IInPersonAccessKey {
701
+ id: string;
702
+ type: "in_person_link";
703
+ authentication?: string | null;
704
+ role_name: string;
705
+ envelope_id: string;
706
+ key: string;
707
+ expiration_date: string | null;
708
+ created_at: string;
709
+ first_used: string | null;
710
+ last_used: string | null;
711
+ envelope?: IEnvelope;
712
+ }
713
+ interface IInAppAccessKey {
714
+ id: string;
715
+ type: "in_app";
716
+ authentication?: string | null;
717
+ recipient_name: string;
718
+ envelope_id: string;
719
+ key: string;
720
+ expiration_date: string | null;
721
+ created_at: string;
722
+ first_used: string | null;
723
+ last_used: string | null;
724
+ envelope?: IEnvelope;
725
+ }
726
+ interface IEmailAccessKey {
727
+ id: string;
728
+ type: "email";
729
+ authentication?: string | null;
730
+ recipient_name: string;
731
+ envelope_id: string;
732
+ key: string;
733
+ expiration_date: string | null;
734
+ created_at: string;
735
+ first_used: string | null;
736
+ last_used: string | null;
737
+ envelope?: IEnvelope;
738
+ }
739
+ interface ISMSAccessKey {
740
+ id: string;
741
+ type: "sms";
742
+ authentication?: string | null;
743
+ recipient_name: string;
744
+ envelope_id: string;
745
+ key: string;
746
+ expiration_date: string | null;
747
+ created_at: string;
748
+ first_used: string | null;
749
+ last_used: string | null;
750
+ envelope?: IEnvelope;
751
+ }
752
+ type TAccessKey = IInPersonAccessKey | IInAppAccessKey | IEmailAccessKey | ISMSAccessKey;
753
+ /**
754
+ * An Envelope is a workflow wrapper that shepherds one or more Documents through the various recipients in a signing
755
+ * process.
756
+ */
757
+ interface IEnvelope {
758
+ /** Unique identifier for the envelope (UUID) */
759
+ id: string;
760
+ /** Current status of the envelope. Note that 'complete', 'declined', and 'canceled' are immutable/permanent end states. */
761
+ status: TEnvelopeStatus;
762
+ /** ID of the envelope's creator. */
763
+ profile_id: string;
764
+ /** ID of the template from which the envelope was created. */
765
+ template_id: string | null;
766
+ /** ID of the organization to which the envelope belongs. */
767
+ organization_id: string;
768
+ /** Name of the envelope. By defaut, inherited from the envelope's template, but may be overridden when the envelope is created. */
769
+ name: string;
770
+ /** Override the sender "name" in places like the Certificate. */
771
+ sender_name: string;
772
+ /** Override the sender "email address" in places like the Certificate. */
773
+ sender_email: string;
774
+ /** If set to true, no email or SMS messages will be sent to any of the envelope's recipients. */
775
+ no_contact?: boolean;
776
+ /** Delay (in seconds) before the first reminder is sent (min: 4hrs). Set to 0 or null to disable. */
777
+ initial_reminder: number | null;
778
+ /** Delay (in seconds) before subsequent remidners are sent (min: 12hrs). Set to 0 or null to disable. */
779
+ followup_reminders: number | null;
780
+ /** When the next reminder is scheduled to be sent. */
781
+ next_reminder: string | null;
782
+ /** Date/time when the envelope was created. */
783
+ created_at: string;
784
+ /** Date/time when the envelope was created. */
785
+ updated_at: string;
786
+ /** Date/time when the envelope was canceled, or null. */
787
+ canceled_at: string;
788
+ /** Date/time when the envelope will automatically expire, or null. */
789
+ expires_at?: string;
790
+ /** Defaults to 'private'. If set to 'shared', this envelope will be visible to other users in the same organization. Ignored for personal profiles. */
791
+ visibility: "private" | "shared";
792
+ /** If true, the attachments have been signed with the Verdocs AATL signing certificate. */
793
+ signed: boolean;
794
+ /** If true, the envelope certificate has been generated and signed. */
795
+ certified: boolean;
796
+ /**
797
+ * Storage for arbitrary data that may be used e.g. to track source database/record IDs to relate Envelopes back to
798
+ * internal systems/applications.
799
+ */
800
+ data?: Record<string, any> | null;
801
+ profile?: IProfile;
802
+ template?: ITemplate | null;
803
+ organization?: IOrganization;
804
+ access_keys?: TAccessKey[];
805
+ fields?: IEnvelopeField[];
806
+ history_entries?: IEnvelopeHistory[];
807
+ recipients: IRecipient[];
808
+ /** Documents attached to this envelope */
809
+ documents?: IEnvelopeDocument[] | null;
810
+ }
811
+ /**
812
+ * An EnvelopeDocument is an individual document inside an Envelope package.
813
+ */
814
+ interface IEnvelopeDocument {
815
+ /** Unique identifier for the document (UUID) */
816
+ id: string;
817
+ /** Unique identifier for the envelope (UUID) */
818
+ envelope_id: string;
819
+ /** Unique identifier for the template (UUID). May be null for envelopes created without templates */
820
+ template_document_id: string | null;
821
+ /**
822
+ * The order in which the document appears in the envelope.
823
+ */
824
+ order: number;
825
+ /** Whether the document is a signer-supplied attachment or a Verdocs-generated certificate */
826
+ type: "attachment" | "certificate";
827
+ /** The name of the document */
828
+ name: string;
829
+ /** Page count */
830
+ pages: number;
831
+ /** MIME type */
832
+ mime: string;
833
+ /** File size (bytes) */
834
+ size: number;
835
+ /** Collection of width/height dimensions for each page */
836
+ page_sizes: {
837
+ width: number;
838
+ height: number;
839
+ }[];
840
+ /** Date/time when the document was created. */
841
+ created_at: string;
842
+ /** Date/time when the document was created. */
843
+ updated_at: string;
844
+ }
845
+ interface IDropdownOption {
846
+ id: string;
847
+ label: string;
848
+ }
849
+ interface IEnvelopeField {
850
+ /** The ID of the envelope the field is for. */
851
+ envelope_id: string;
852
+ /** The ID of the document the field is for. */
853
+ document_id: string;
854
+ /** The machine name of the field, e.g. `Buyer-textbox-1` */
855
+ name: string;
856
+ /** The ID of the role in the recipients list, e.g. `Recipient 2` */
857
+ role_name: string;
858
+ /** The type of the field */
859
+ type: TFieldType;
860
+ /** If true, the field will be required */
861
+ required: boolean | null;
862
+ /** If true, the field will be not be editable by the participant(s). NOTE: Fields may not be both required and readonly. */
863
+ readonly: boolean | null;
864
+ /** @deprecated. Use top-level fields instead. */
865
+ settings: IEnvelopeFieldSettings | null;
866
+ validator: string | null;
867
+ /** If set, the placeholder/label for the field. */
868
+ label: string | null;
869
+ /** Not sent by the server. Used in the UI to identify prepared fields. */
870
+ prepared: boolean | null;
871
+ /** The 1-based page number the field is displayed on. "Self-placed" fields that the user must apply will be on page 0. */
872
+ page: number;
873
+ /** The X position of the field. */
874
+ x: number;
875
+ /** The Y position of the field. */
876
+ y: number;
877
+ /** The width of the field. */
878
+ width: number;
879
+ /** The height of the field. */
880
+ height: number;
881
+ /** The default value for the field. */
882
+ default: string | null;
883
+ /** The placeholder to show in the field. */
884
+ placeholder: string | null;
885
+ /** For text boxes, allows more than one line of text to be entered. */
886
+ multiline: boolean;
887
+ /** For fields that support grouping (radio buttons and check boxes) the value selected will be stored under this name. */
888
+ group: string | null;
889
+ /** For dropdowns, the options that are selectable. */
890
+ options: IDropdownOption[] | null;
891
+ value: string | null;
892
+ is_valid: boolean;
893
+ }
894
+ interface IEnvelopeFieldOptions {
895
+ /** The unique ID of the field */
896
+ id: string;
897
+ /** The X position of the field on the page. Self-placed fields will have an X value of 0. */
898
+ x: number;
899
+ /** The Y position of the field on the page. Self-placed fields will have an X value of 0. */
900
+ y: number;
901
+ /** For checkboxes, whether it is currently checked */
902
+ checked: boolean | null;
903
+ /** For radio buttons, whether it is currently selected */
904
+ selected: boolean | null;
905
+ /** The visible label for the field e.g. 'Not Applicable' */
906
+ value: string;
907
+ }
908
+ interface IEnvelopeFieldSettings {
909
+ type?: string;
910
+ x?: number;
911
+ y?: number;
912
+ width?: number;
913
+ height?: number;
914
+ value?: number | string;
915
+ /** If the field has been filled in, this contains the current value */
916
+ result?: any;
917
+ /** Text field settings */
918
+ leading?: number;
919
+ alignment?: number;
920
+ upperCase?: boolean;
921
+ /** Dropdowns, checkboxes, radio groups */
922
+ options?: IEnvelopeFieldOptions[];
923
+ /** Signatures and Initials, result will be "signed" */
924
+ base64?: string;
925
+ hash?: string;
926
+ ip_address?: string;
927
+ browser?: string;
928
+ platform?: string;
929
+ mobile?: boolean;
930
+ signature_id?: string;
931
+ signed_at?: string;
932
+ /** Checkbox settings */
933
+ minimum_checked?: number;
934
+ maximum_checked?: number;
935
+ }
936
+ interface IEnvelopeHistory {
937
+ id: string;
938
+ envelope_id: string;
939
+ role_name: string;
940
+ event: BaseTypes.THistoryEvent;
941
+ event_detail: TEventDetail;
942
+ created_at: string;
943
+ envelope?: IEnvelope;
944
+ }
945
+ interface IInitial {
946
+ id: string | null;
947
+ profile_id: string;
948
+ created_at: string | null;
949
+ updated_at: string | null;
950
+ deleted_at: string | null;
951
+ profile?: IProfile;
952
+ }
953
+ interface IKbaPINRequired {
954
+ type: "pin";
955
+ }
956
+ interface IKBAQuestion {
957
+ type: string;
958
+ answer: string[];
959
+ prompt: string;
960
+ }
961
+ interface IRecipient {
962
+ /** Used only by the Web SDK during builder processes. Not stored in the backend. */
963
+ id?: string | null;
964
+ envelope_id: string;
965
+ role_name: string;
966
+ profile_id?: string | null;
967
+ status: BaseTypes.TRecipientStatus;
968
+ first_name: string;
969
+ last_name: string;
970
+ /** @deprecated. Use first_name/last_name instead. */
971
+ full_name?: string | null;
972
+ email: string;
973
+ /** Phone number for SMS invites */
974
+ phone?: string | null;
975
+ /** Street address. Only used in KBA workflows. Combine two-line addresses into a single string. */
976
+ address?: string | null;
977
+ /** Zip code. Only used in KBA workflows. */
978
+ city?: string | null;
979
+ /** Zip code. Only used in KBA workflows. */
980
+ state?: string | null;
981
+ /** Zip code. Only used in KBA workflows. */
982
+ zip?: string | null;
983
+ /** Last 4 digits of SSN. Only used in KBA workflows. */
984
+ ssn_last_4?: string | null;
985
+ /** The disclosure text the recipient accepted. */
986
+ disclosures?: string | null;
987
+ /** Date/time the recipient agreed to their e-signing disclosures. */
988
+ disclosures_accepted_at?: string | null;
989
+ /** Date of birth. Only used in KBA workflows. */
990
+ dob?: string | null;
991
+ /**
992
+ * The sequence number indicates the order in which Recipients act. Multiple recipients may have the same sequence
993
+ * number, in which case they may act in parallel. (e.g. all Recipients at sequence 2 will receive invites once
994
+ * all Recipients at sequence 1 have signed.)
995
+ */
996
+ sequence: number;
997
+ /**
998
+ * The order indicates the order in which recipients are listed in a single "level" of the workflow. Note that
999
+ * recipients at the same level may act in parallel despite this value. However, it can often be useful to visually
1000
+ * arrange recipients to match related business processes so this field allows for that.
1001
+ */
1002
+ order: number;
1003
+ type: TRecipientType;
1004
+ delegator: boolean;
1005
+ delegated_to: string | null;
1006
+ message: string | null;
1007
+ claimed: boolean;
1008
+ agreed: boolean;
1009
+ key_used_to_conclude?: string;
1010
+ environment?: string;
1011
+ created_at: string;
1012
+ updated_at: string;
1013
+ last_attempt_at?: string;
1014
+ /**
1015
+ * Only returned in creation/getEnvelopeById requests by the creator. May be used for in-person signing. Note that
1016
+ * signing sessions started with this key will be marked as "In App" authenticated. For higher authentication levels,
1017
+ * e.g. email, the signer must follow a link send via the appropriate channel (email).
1018
+ */
1019
+ in_app_key?: string;
1020
+ /**
1021
+ * The next verification step that must be performed.
1022
+ */
1023
+ auth_step?: BaseTypes.TRecipientAuthStep | null;
1024
+ /** The types of authentication/verification required for this recipient. */
1025
+ auth_methods?: BaseTypes.TRecipientAuthMethod[] | null;
1026
+ /** The status of each auth method enabled. */
1027
+ auth_method_states?: Record<BaseTypes.TRecipientAuthMethod, "complete" | "failed" | "challenge" | "questions" | "differentiator" | null> | null;
1028
+ /**
1029
+ * If auth_method is set to "passcode" this is the passcode required. For security reasons, this
1030
+ * field will only be visible to the creator of the envelope.
1031
+ */
1032
+ passcode?: string | null;
1033
+ /**
1034
+ * If a KBA step requires the user to answer a challenge/differentiator question, the
1035
+ * question(s) to ask.
1036
+ */
1037
+ kba_questions?: IKBAQuestion[] | null;
1038
+ envelope?: IEnvelope;
1039
+ profile?: IProfile;
1040
+ }
1041
+ /**
1042
+ * A placeholder for an individual recipient, CC, or other party in a signing flow. Roles may be "known" or "unknown."
1043
+ * "Known" roles will have their email address supplied in the template which will get copied to envelopes created from
1044
+ * it. This is used when a certain party will always be the same, e.g. a leasing agent counter-signing a lease.
1045
+ * "Unknown" roles are dynamic, and will be filled in later when the envelope is created.
1046
+ */
1047
+ interface IRole {
1048
+ /** Used only by the Web SDK during builder processes. Not stored in the backend. */
1049
+ id?: string | null;
1050
+ template_id: string;
1051
+ // The name of the recipient. Note that recipients do not have a separate ID - they are uniquely identified by name.
1052
+ name: string;
1053
+ type: TRecipientType;
1054
+ full_name: string | null;
1055
+ first_name: string | null;
1056
+ last_name: string | null;
1057
+ email: string | null;
1058
+ phone: string | null;
1059
+ message: string | null;
1060
+ /**
1061
+ * The sequence number indicates the order in which Roles act. Multiple roles may have the same sequence
1062
+ * number, in which case they may act in parallel. (e.g. all Roles at sequence 2 will receive invites once
1063
+ * all Recipients at sequence 1 have signed.)
1064
+ */
1065
+ sequence: number;
1066
+ /**
1067
+ * The order indicates the order in which recipients are listed in a single "level" of the workflow. Note that
1068
+ * recipients at the same level may act in parallel despite this value. However, it can often be useful to visually
1069
+ * arrange recipients to match related business processes so this field allows for that.
1070
+ */
1071
+ order: number;
1072
+ delegator: boolean | null;
1073
+ }
1074
+ interface ISignature {
1075
+ id: string;
1076
+ profile_id: string;
1077
+ created_at: string;
1078
+ updated_at: string;
1079
+ deleted_at: string | null;
1080
+ profile?: IProfile;
1081
+ }
1082
+ /**
1083
+ * A reusable template for creating signable instruments. Templates are used to create Envelopes which contain
1084
+ * Documents to sign.
1085
+ */
1086
+ interface ITemplate {
1087
+ /**
1088
+ * The unique ID of the template.
1089
+ */
1090
+ id: string;
1091
+ /**
1092
+ * The template's owner/creator.
1093
+ */
1094
+ profile_id: string;
1095
+ /**
1096
+ * Organization the template lives in.
1097
+ */
1098
+ organization_id: string;
1099
+ /**
1100
+ * Who will "own" envelopes created from this template. Note that while either option is
1101
+ * technically allowed for all visibility settings, "template_owner" only has an effect if
1102
+ * visibility is "shared" or "public".
1103
+ */
1104
+ sender: BaseTypes.TTemplateSender;
1105
+ /*
1106
+ The user-supplied name of the template.
1107
+ */
1108
+ name: string;
1109
+ /**
1110
+ * Optional description for the template.
1111
+ */
1112
+ description?: string;
1113
+ /**
1114
+ * Number of times the template has been used.
1115
+ */
1116
+ counter: number;
1117
+ /**
1118
+ * Number of times the template has been "starred".
1119
+ */
1120
+ star_counter: number;
1121
+ /** Delay (in seconds) before the first reminder is sent (min: 4hrs). Set to 0 or null to disable. */
1122
+ initial_reminder: number | null;
1123
+ /** Delay (in seconds) before subsequent remidners are sent (min: 12hrs). Set to 0 or null to disable. */
1124
+ followup_reminders: number | null;
1125
+ /**
1126
+ * If true, the template is only visible to the creator. If false, the template will also be visible to the user's
1127
+ * organization, if any.
1128
+ * @deprecated. See "visibility".
1129
+ */
1130
+ is_personal: boolean;
1131
+ /**
1132
+ * If true, the template is visible publicly. Note that this does not necessarily mean it is also visible to the
1133
+ * user's organization. It may be desirable to create documents that are public but that do not appear in the
1134
+ * organization's shared templates list. To achieve this, set both `is_personal` and `is_public` to TRUE.
1135
+ * @deprecated. See "visibility".
1136
+ */
1137
+ is_public: boolean;
1138
+ /**
1139
+ * If set, the visibility level for the template.
1140
+ */
1141
+ visibility?: BaseTypes.TTemplateVisibility;
1142
+ /**
1143
+ * If true, the template is considered "sendable" (it has at least one signer, and every signer has at least one field.)
1144
+ */
1145
+ is_sendable: boolean;
1146
+ /**
1147
+ * Creation date/time.
1148
+ */
1149
+ created_at: string;
1150
+ /**
1151
+ * Last-update date/time.
1152
+ */
1153
+ updated_at: string;
1154
+ /**
1155
+ * Last-used date/time (when the template was used to create a document).
1156
+ */
1157
+ last_used_at: string | null;
1158
+ search_key: string;
1159
+ /**
1160
+ * Storage for arbitrary data that may be used e.g. to track source database/record IDs to relate Templates back to
1161
+ * internal systems/applications.
1162
+ */
1163
+ data: Record<string, any> | null;
1164
+ tags?: string[];
1165
+ profile?: IProfile;
1166
+ organization?: IOrganization;
1167
+ roles?: IRole[];
1168
+ documents?: ITemplateDocument[];
1169
+ fields?: ITemplateField[];
1170
+ // @deprecated. Use documents instead.
1171
+ template_documents?: ITemplateDocument[];
1172
+ }
1173
+ /**
1174
+ * A file attached to the template for display/signing.
1175
+ */
1176
+ interface ITemplateDocument {
1177
+ id: string;
1178
+ name: string;
1179
+ template_id: string;
1180
+ order: number;
1181
+ pages: number;
1182
+ mime: string;
1183
+ size: number;
1184
+ page_sizes: {
1185
+ width: number;
1186
+ height: number;
1187
+ }[];
1188
+ created_at: string | null;
1189
+ updated_at: string | null;
1190
+ // @deprecated. Use pages instead.
1191
+ page_numbers?: number;
1192
+ template?: ITemplate;
1193
+ }
1194
+ interface ITemplateField {
1195
+ /** The machine name of the field, e.g. `Buyer-textbox-1` */
1196
+ name: string;
1197
+ /** The ID of the role in the recipients list, e.g. `Recipient 2` */
1198
+ role_name: string;
1199
+ /** The ID of the template the field is for. */
1200
+ template_id: string;
1201
+ /** The ID of the document the field is for. */
1202
+ document_id: string;
1203
+ type: TFieldType;
1204
+ required: boolean;
1205
+ /** If true, the field will be not be editable by the participant(s). NOTE: Fields may not be both required and readonly. */
1206
+ readonly: boolean | null;
1207
+ /** @deprecated. Use top-level fields instead. */
1208
+ settings: ITemplateFieldSetting | null;
1209
+ page: number;
1210
+ validator: string | null;
1211
+ label: string | null;
1212
+ /** The X position of the field. */
1213
+ x: number;
1214
+ /** The Y position of the field. */
1215
+ y: number;
1216
+ /** The width of the field. */
1217
+ width: number;
1218
+ /** The height of the field. */
1219
+ height: number;
1220
+ /** The default value for the field. */
1221
+ default: string | null;
1222
+ /** The placeholder to show in the field. */
1223
+ placeholder: string | null;
1224
+ /** For text boxes, allows more than one line of text to be entered. */
1225
+ multiline: boolean;
1226
+ /** For fields that support grouping (radio buttons and check boxes) the value selected will be stored under this name. */
1227
+ group: string | null;
1228
+ /** For dropdowns, the options that are selectable. */
1229
+ options: IDropdownOption[] | null;
1230
+ value?: string | null;
1231
+ is_valid?: boolean;
1232
+ }
1233
+ interface ITextFieldSetting {
1234
+ x: number;
1235
+ y: number;
1236
+ width: number;
1237
+ height: number;
1238
+ result: string;
1239
+ leading: number;
1240
+ alignment: number;
1241
+ upperCase: boolean;
1242
+ }
1243
+ interface ITemplateFieldSetting {
1244
+ x?: number;
1245
+ y?: number;
1246
+ result?: string;
1247
+ width?: number;
1248
+ height?: number;
1249
+ // Text field settings
1250
+ leading?: number;
1251
+ alignment?: number;
1252
+ upperCase?: boolean;
1253
+ // Dropdowns, checkboxes, radio groups
1254
+ options?: any[];
1255
+ [key: string]: any;
1256
+ }
1257
+ type TOrganizationUsage = Record<string, Record<BaseTypes.TUsageType, number>>;
1258
+ type TRequestStatus = "OK" | "ERROR";
1259
+ type TTemplateSender = "envelope_creator" | "template_owner";
1260
+ type TTemplateAction = "create_personal" | "create_org" | "create_public" | "read" | "write" | "delete" | "change_visibility_personal" | "change_visibility_org" | "change_visibility_public";
1261
+ type TRecipientAction = "submit" | "decline" | "prepare" | "update";
1262
+ type TEnvelopeStatus = "complete" | "pending" | "in progress" | "declined" | "canceled";
1263
+ type TRecipientStatus = "invited" | "opened" | "signed" | "submitted" | "canceled" | "pending" | "declined";
1264
+ type TRecipientType = "signer" | "cc" | "approver";
1265
+ type TSortTemplateBy = "created_at" | "updated_at" | "name" | "last_used_at" | "counter" | "star_counter";
1266
+ type TAccessKeyType = "email" | "in_app" | "in_person_link" | "sms";
1267
+ type TApiKeyPermission = "personal" | "global_read" | "global_write";
1268
+ type TDeprecatedHistoryEvent = "envelope:created" | "envelope:completed";
1269
+ type THistoryEvent = "recipient:signed" | "recipient:opened" | "recipient:submitted" | "recipient:prepared" | "recipient:claimed" | "recipient:agreed" | "recipient:invited" | "recipient:reminder" | "recipient:delegated" | "recipient:updated_info" | "recipient:declined" | "recipient:kba_verified" | "recipient:kba_failed" | "recipient:id_verified" | "recipient:id_failed" | "recipient:pin_verified" | "recipient:pin_failed" | "invitation:resent" | "envelope:cc" | "envelope:canceled" | "envelope:expired" | "owner:updated_recipient_info" | "owner:get_in_person_link" | TDeprecatedHistoryEvent;
1270
+ type TEventDetail = "in_app" | "mail" | "signer" | "sms" | "reminder" | "preparer" | "manual" | "in_person_link" | "guest" | "email" | "" | string;
1271
+ type TEnvelopeUpdateResult = Omit<IEnvelope, "histories" | "recipients" | "certificate" | "document" | "fields" | "profile">;
1272
+ type TFieldType = "signature" | "initial" | "checkbox" | "radio" | "textbox" | "timestamp" | "date" | "dropdown" | "textarea" | "attachment" | "payment";
1273
+ type TWebhookEvent = "envelope_created" | "envelope_completed" | "envelope_canceled" | "envelope_updated" | "envelope_expired" | "template_created" | "template_updated" | "template_deleted" | "template_used" | "recipient_submitted" | "recipient_updated" | "recipient_delegated" | "kba_event" | "entitlement_used";
1274
+ type TTemplateVisibility = "private" | "shared" | "public";
1275
+ type TEntitlement = "envelope" | "kba_auth" | "passcode_auth" | "sms_auth" | "kba_id_auth" | "id_auth" | "custom_disclaimer";
1276
+ type TRecipientAuthMethod = "kba" | "passcode" | "sms" | "email" | "id";
1277
+ type TRecipientAuthStep = TRecipientAuthMethod | null;
1278
+ type TUsageType = "envelope" | "envelope_canceled" | "envelope_completed" | "envelope_expired" | "sms_invite" | "template" | "auth_email" | "auth_sms" | "auth_kba" | "auth_id" | "auth_passcode";
1279
+ type TWebhookAuthMethod = "none" | "hmac" | "client_credentials";
1280
+ }
215
1281
  /////////////////////////////// NOTIFICATIONS /////////////////////////////
216
1282
  interface IChannel {
217
1283
  id: string;
@@ -434,6 +1500,9 @@ interface IWebhook {
434
1500
  organization_id: string;
435
1501
  url: string;
436
1502
  secret_key?: string;
1503
+ client_id?: string;
1504
+ client_secret?: string;
1505
+ auth_method: BaseTypes.TWebhookAuthMethod;
437
1506
  active: boolean;
438
1507
  events: IWebhookEvents;
439
1508
  status: string | null;
@@ -683,7 +1752,7 @@ interface IEnvelopeHistory {
683
1752
  id: string;
684
1753
  envelope_id: string;
685
1754
  role_name: string;
686
- event: THistoryEvent;
1755
+ event: BaseTypes.THistoryEvent;
687
1756
  event_detail: TEventDetail;
688
1757
  created_at: string;
689
1758
  envelope?: IEnvelope;
@@ -710,7 +1779,7 @@ interface IRecipient {
710
1779
  envelope_id: string;
711
1780
  role_name: string;
712
1781
  profile_id?: string | null;
713
- status: TRecipientStatus;
1782
+ status: BaseTypes.TRecipientStatus;
714
1783
  first_name: string;
715
1784
  last_name: string;
716
1785
  /** @deprecated. Use first_name/last_name instead. */
@@ -766,11 +1835,11 @@ interface IRecipient {
766
1835
  /**
767
1836
  * The next verification step that must be performed.
768
1837
  */
769
- auth_step?: TRecipientAuthStep | null;
1838
+ auth_step?: BaseTypes.TRecipientAuthStep | null;
770
1839
  /** The types of authentication/verification required for this recipient. */
771
- auth_methods?: TRecipientAuthMethod[] | null;
1840
+ auth_methods?: BaseTypes.TRecipientAuthMethod[] | null;
772
1841
  /** The status of each auth method enabled. */
773
- auth_method_states?: Record<TRecipientAuthMethod, "complete" | "failed" | "challenge" | "questions" | "differentiator" | null> | null;
1842
+ auth_method_states?: Record<BaseTypes.TRecipientAuthMethod, "complete" | "failed" | "challenge" | "questions" | "differentiator" | null> | null;
774
1843
  /**
775
1844
  * If auth_method is set to "passcode" this is the passcode required. For security reasons, this
776
1845
  * field will only be visible to the creator of the envelope.
@@ -847,7 +1916,7 @@ interface ITemplate {
847
1916
  * technically allowed for all visibility settings, "template_owner" only has an effect if
848
1917
  * visibility is "shared" or "public".
849
1918
  */
850
- sender: TTemplateSender;
1919
+ sender: BaseTypes.TTemplateSender;
851
1920
  /*
852
1921
  The user-supplied name of the template.
853
1922
  */
@@ -884,7 +1953,7 @@ interface ITemplate {
884
1953
  /**
885
1954
  * If set, the visibility level for the template.
886
1955
  */
887
- visibility?: TTemplateVisibility;
1956
+ visibility?: BaseTypes.TTemplateVisibility;
888
1957
  /**
889
1958
  * If true, the template is considered "sendable" (it has at least one signer, and every signer has at least one field.)
890
1959
  */
@@ -1000,7 +2069,7 @@ interface ITemplateFieldSetting {
1000
2069
  options?: any[];
1001
2070
  [key: string]: any;
1002
2071
  }
1003
- type TOrganizationUsage = Record<string, Record<TUsageType, number>>;
2072
+ type TOrganizationUsage = Record<string, Record<BaseTypes.TUsageType, number>>;
1004
2073
  type TRequestStatus = "OK" | "ERROR";
1005
2074
  type TTemplateSender = "envelope_creator" | "template_owner";
1006
2075
  type TTemplateAction = "create_personal" | "create_org" | "create_public" | "read" | "write" | "delete" | "change_visibility_personal" | "change_visibility_org" | "change_visibility_public";
@@ -1035,6 +2104,10 @@ type TEntitlement = "envelope" | "kba_auth" | "passcode_auth" | "sms_auth" | "kb
1035
2104
  type TRecipientAuthMethod = "kba" | "passcode" | "sms" | "email" | "id";
1036
2105
  type TRecipientAuthStep = TRecipientAuthMethod | null;
1037
2106
  type TUsageType = "envelope" | "envelope_canceled" | "envelope_completed" | "envelope_expired" | "sms_invite" | "template" | "auth_email" | "auth_sms" | "auth_kba" | "auth_id" | "auth_passcode";
2107
+ /**
2108
+ * Methods for authenticating webhook requests.
2109
+ */
2110
+ type TWebhookAuthMethod = "none" | "hmac" | "client_credentials";
1038
2111
  declare const FIELD_TYPES: TFieldType[];
1039
2112
  declare const DEFAULT_FIELD_WIDTHS: Record<TFieldType, number>;
1040
2113
  declare const DEFAULT_FIELD_HEIGHTS: Record<TFieldType, number>;
@@ -3886,4 +4959,4 @@ declare const decodeJWTBody: (token: string) => any;
3886
4959
  * the presence of the `document_id` field, which will only be present for signing sessions.
3887
4960
  */
3888
4961
  declare const decodeAccessTokenBody: (token: string) => TSession;
3889
- export { TRequestStatus, TTemplateSender, TTemplateAction, TRecipientAction, TEnvelopeStatus, TRecipientStatus, TRecipientType, TSortTemplateBy, TAccessKeyType, TApiKeyPermission, TDeprecatedHistoryEvent, THistoryEvent, TEventDetail, TEnvelopeUpdateResult, TFieldType, TWebhookEvent, TTemplateVisibility, TEntitlement, TRecipientAuthMethod, TRecipientAuthStep, TUsageType, FIELD_TYPES, DEFAULT_FIELD_WIDTHS, DEFAULT_FIELD_HEIGHTS, WEBHOOK_EVENTS, ALL_PERMISSIONS, IChannel, IDisabledChannel, INotification, IApiKey, IGroup, IGroupProfile, IOAuth2App, IEntitlement, IOrganization, IOrganizationInvitation, IPendingWebhook, IProfile, IUser, IWebhookEvents, IWebhook, IInPersonAccessKey, IInAppAccessKey, IEmailAccessKey, ISMSAccessKey, TAccessKey, IEnvelope, IEnvelopeDocument, IDropdownOption, IEnvelopeField, IEnvelopeFieldOptions, IEnvelopeFieldSettings, IEnvelopeHistory, IInitial, IKbaPINRequired, IKBAQuestion, IRecipient, IRole, ISignature, ITemplate, ITemplateDocument, ITemplateField, ITextFieldSetting, ITemplateFieldSetting, TOrganizationUsage, TEnvironment, TSessionChangedListener, VerdocsEndpointOptions, VerdocsEndpoint, createEnvelope, getEnvelope, getEnvelopeDocument, downloadEnvelopeDocument, getEnvelopeDocumentDownloadLink, getEnvelopeDocumentPreviewLink, cancelEnvelope, getEnvelopeFile, updateEnvelope, updateEnvelopeField, uploadEnvelopeFieldAttachment, deleteEnvelopeFieldAttachment, getEnvelopeDocumentPageDisplayUri, ITimeRange, IListEnvelopesParams, getEnvelopes, getEnvelopesZip, sortFields, sortDocuments, sortRecipients, isFieldFilled, isFieldValid, createInitials, IRecipientKbaStepNone, IRecipientKbaStepComplete, IRecipientKbaStepPin, IRecipientKbaStepIdentity, IRecipientKbaStepChallenge, IRecipientKbaStepFailed, TRecipientKbaStep, getKbaStep, submitKbaPin, IKbaIdentity, submitKbaIdentity, IKbaChallengeResponse, submitKbaChallengeResponse, envelopeRecipientAgree, envelopeRecipientDecline, envelopeRecipientSubmit, startSigningSession, getInPersonLink, verifySigner, delegateRecipient, updateRecipient, remindRecipient, resetRecipient, askQuestion, isEnvelopeOwner, isEnvelopeRecipient, canAccessEnvelope, userIsEnvelopeOwner, userIsEnvelopeRecipient, useCanAccessEnvelope, envelopeIsActive, envelopeIsComplete, userCanCancelEnvelope, userCanFinishEnvelope, recipientHasAction, getRecipientsWithActions, recipientCanAct, userCanAct, userCanSignNow, getNextRecipient, createSignature, IEnvelopesSearchResult, IDocumentSearchOptions, ICreateEnvelopeRecipientFromTemplate, ICreateEnvelopeRecipientDirectly, ISignerTokenResponse, IInPersonLinkResponse, IUpdateRecipientStatus, ICreateEnvelopeReminderRequest, IUpdateRecipientParams, ICreateEnvelopeDocumentFromData, ICreateEnvelopeDocumentFromUri, ICreateEnvelopeDocumentFromFile, ICreateEnvelopeFieldFromTemplate, ICreateEnvelopeFieldDirectly, ICreateEnvelopeFromTemplateRequest, ICreateEnvelopeDirectlyRequest, TCreateEnvelopeRequest, IAuthenticateRecipientViaPasscodeRequest, IAuthenticateRecipientViaEmailRequest, IAuthenticateRecipientViaSMSRequest, IKBAResponse, IAuthenticateRecipientViaKBARequest, TAuthenticateRecipientRequest, DEFAULT_DISCLOSURES, getApiKeys, createApiKey, rotateApiKey, updateApiKey, deleteApiKey, getOrganizationContacts, deleteOrganizationContact, createOrganizationContact, updateOrganizationContact, getGroups, getGroup, createGroup, updateGroup, deleteGroup, addGroupMember, deleteGroupMember, getOrganizationInvitations, createOrganizationInvitation, deleteOrganizationInvitation, updateOrganizationInvitation, resendOrganizationInvitation, getOrganizationInvitation, acceptOrganizationInvitation, declineOrganizationInvitation, getOrganizationMembers, deleteOrganizationMember, updateOrganizationMember, getOrganization, getOrganizationChildren, getOrganizationUsage, createOrganization, updateOrganization, deleteOrganization, updateOrganizationLogo, updateOrganizationThumbnail, getEntitlements, getActiveEntitlements, ICreateApiKeyRequest, IUpdateApiKeyRequest, ICreateInvitationRequest, IAcceptOrganizationInvitationRequest, ISetWebhookRequest, getWebhooks, setWebhooks, rotateWebhookSecret, TTemplatePermissionCreatePublic, TTemplatePermissionCreateOrg, TTemplatePermissionCreatePersonal, TTemplatePermissionDelete, TTemplatePermissionVisibility, TTemplateMemberRead, TTemplateMemberWrite, TTemplateMemberDelete, TTemplateMemberVisibility, TTemplatePermission, TAccountPermissionOwnerAdd, TAccountPermissionOwnerRemove, TAccountPermissionAdminAdd, TAccountPermissionAdminRemove, TAccountPermissionMemberView, TAccountPermissionMemberAdd, TAccountPermissionMemberRemove, TAccountPermission, TOrgPermissionCreate, TOrgPermissionView, TOrgPermissionUpdate, TOrgPermissionDelete, TOrgPermissionTransfer, TOrgPermissionList, TOrgPermission, TEnvelopePermissionCreate, TEnvelopePermissionCancel, TEnvelopePermissionView, TEnvelopePermissionOrg, TEnvelopePermission, TPermission, TRole, RolePermissions, userHasPermissions, ISigningSession, IUserSession, IIdToken, TSessionType, TSession, TActiveSession, canPerformTemplateAction, hasRequiredPermissions, createField, updateField, deleteField, userIsTemplateCreator, userHasSharedTemplate, userCanCreatePersonalTemplate, userCanCreateOrgTemplate, userCanCreatePublicTemplate, userCanReadTemplate, userCanUpdateTemplate, userCanMakeTemplatePrivate, userCanMakeTemplateShared, userCanMakeTemplatePublic, userCanChangeOrgVisibility, userCanDeleteTemplate, userCanSendTemplate, userCanCreateTemplate, userCanBuildTemplate, getFieldsForRole, userCanPreviewTemplate, createTemplateRole, updateTemplateRole, deleteTemplateRole, ITemplateSortBy, TTemplateVisibilityFilter, IGetTemplatesParams, getTemplates, getTemplate, IDocumentFromUri, IDocumentFromData, ITemplateCreateParams, createTemplate, duplicateTemplate, ITemplateCreateFromSharepointParams, createTemplateFromSharepoint, updateTemplate, deleteTemplate, toggleTemplateStar, createTemplateDocument, deleteTemplateDocument, getTemplateDocument, downloadTemplateDocument, getTemplateDocumentDownloadLink, getTemplateDocumentPreviewLink, getTemplateDocumentFile, getTemplateDocumentThumbnail, getTemplateDocumentPageDisplayUri, ITemplateTag, ITag, IStar, ITemplateSearchResult, IValidator, isValidInput, getValidators, isValidEmail, isValidPhone, isValidRoleName, isValidTag, IROPCRequest, IClientCredentialsRequest, IRefreshTokenRequest, TAuthenticationRequest, authenticate, refreshToken, changePassword, resetPassword, resendVerification, verifyEmail, getMyUser, getNotifications, getProfiles, getCurrentProfile, switchProfile, updateProfile, deleteProfile, createProfile, updateProfilePhoto, ICreateProfileRequest, IUpdateProfileRequest, IAuthenticateResponse, IChangePasswordRequest, IChangePasswordResponse, IResetPasswordRequest, IResetPasswordResponse, IVerifyEmailRequest, getRGB, getRGBA, nameToRGBA, getRoleColor, formatShortTimeAgo, collapseEntitlements, getRTop, getRLeft, getRValue, blobToBase64, rescale, fileToDataUrl, downloadBlob, Countries, getCountryByCode, isFrenchGuiana, isGuadeloupe, isMartinique, isMayotte, getPlusOneCountry, isCanada, isAmericanSamoa, isDominicanRepublic, isPuertoRico, getMatchingCountry, integerSequence, formatFullName, formatInitials, fullNameToInitials, capitalize, convertToE164, randomString, AtoB, decodeJWTBody, decodeAccessTokenBody, IFileWithData, ICountry };
4962
+ export { TRequestStatus, TTemplateSender, TTemplateAction, TRecipientAction, TEnvelopeStatus, TRecipientStatus, TRecipientType, TSortTemplateBy, TAccessKeyType, TApiKeyPermission, TDeprecatedHistoryEvent, THistoryEvent, TEventDetail, TEnvelopeUpdateResult, TFieldType, TWebhookEvent, TTemplateVisibility, TEntitlement, TRecipientAuthMethod, TRecipientAuthStep, TUsageType, TWebhookAuthMethod, FIELD_TYPES, DEFAULT_FIELD_WIDTHS, DEFAULT_FIELD_HEIGHTS, WEBHOOK_EVENTS, ALL_PERMISSIONS, IChannel, IDisabledChannel, INotification, IApiKey, IGroup, IGroupProfile, IOAuth2App, IEntitlement, IOrganization, IOrganizationInvitation, IPendingWebhook, IProfile, IUser, IWebhookEvents, IWebhook, IInPersonAccessKey, IInAppAccessKey, IEmailAccessKey, ISMSAccessKey, TAccessKey, IEnvelope, IEnvelopeDocument, IDropdownOption, IEnvelopeField, IEnvelopeFieldOptions, IEnvelopeFieldSettings, IEnvelopeHistory, IInitial, IKbaPINRequired, IKBAQuestion, IRecipient, IRole, ISignature, ITemplate, ITemplateDocument, ITemplateField, ITextFieldSetting, ITemplateFieldSetting, TOrganizationUsage, TEnvironment, TSessionChangedListener, VerdocsEndpointOptions, VerdocsEndpoint, createEnvelope, getEnvelope, getEnvelopeDocument, downloadEnvelopeDocument, getEnvelopeDocumentDownloadLink, getEnvelopeDocumentPreviewLink, cancelEnvelope, getEnvelopeFile, updateEnvelope, updateEnvelopeField, uploadEnvelopeFieldAttachment, deleteEnvelopeFieldAttachment, getEnvelopeDocumentPageDisplayUri, ITimeRange, IListEnvelopesParams, getEnvelopes, getEnvelopesZip, sortFields, sortDocuments, sortRecipients, isFieldFilled, isFieldValid, createInitials, IRecipientKbaStepNone, IRecipientKbaStepComplete, IRecipientKbaStepPin, IRecipientKbaStepIdentity, IRecipientKbaStepChallenge, IRecipientKbaStepFailed, TRecipientKbaStep, getKbaStep, submitKbaPin, IKbaIdentity, submitKbaIdentity, IKbaChallengeResponse, submitKbaChallengeResponse, envelopeRecipientAgree, envelopeRecipientDecline, envelopeRecipientSubmit, startSigningSession, getInPersonLink, verifySigner, delegateRecipient, updateRecipient, remindRecipient, resetRecipient, askQuestion, isEnvelopeOwner, isEnvelopeRecipient, canAccessEnvelope, userIsEnvelopeOwner, userIsEnvelopeRecipient, useCanAccessEnvelope, envelopeIsActive, envelopeIsComplete, userCanCancelEnvelope, userCanFinishEnvelope, recipientHasAction, getRecipientsWithActions, recipientCanAct, userCanAct, userCanSignNow, getNextRecipient, createSignature, IEnvelopesSearchResult, IDocumentSearchOptions, ICreateEnvelopeRecipientFromTemplate, ICreateEnvelopeRecipientDirectly, ISignerTokenResponse, IInPersonLinkResponse, IUpdateRecipientStatus, ICreateEnvelopeReminderRequest, IUpdateRecipientParams, ICreateEnvelopeDocumentFromData, ICreateEnvelopeDocumentFromUri, ICreateEnvelopeDocumentFromFile, ICreateEnvelopeFieldFromTemplate, ICreateEnvelopeFieldDirectly, ICreateEnvelopeFromTemplateRequest, ICreateEnvelopeDirectlyRequest, TCreateEnvelopeRequest, IAuthenticateRecipientViaPasscodeRequest, IAuthenticateRecipientViaEmailRequest, IAuthenticateRecipientViaSMSRequest, IKBAResponse, IAuthenticateRecipientViaKBARequest, TAuthenticateRecipientRequest, DEFAULT_DISCLOSURES, getApiKeys, createApiKey, rotateApiKey, updateApiKey, deleteApiKey, getOrganizationContacts, deleteOrganizationContact, createOrganizationContact, updateOrganizationContact, getGroups, getGroup, createGroup, updateGroup, deleteGroup, addGroupMember, deleteGroupMember, getOrganizationInvitations, createOrganizationInvitation, deleteOrganizationInvitation, updateOrganizationInvitation, resendOrganizationInvitation, getOrganizationInvitation, acceptOrganizationInvitation, declineOrganizationInvitation, getOrganizationMembers, deleteOrganizationMember, updateOrganizationMember, getOrganization, getOrganizationChildren, getOrganizationUsage, createOrganization, updateOrganization, deleteOrganization, updateOrganizationLogo, updateOrganizationThumbnail, getEntitlements, getActiveEntitlements, ICreateApiKeyRequest, IUpdateApiKeyRequest, ICreateInvitationRequest, IAcceptOrganizationInvitationRequest, ISetWebhookRequest, getWebhooks, setWebhooks, rotateWebhookSecret, TTemplatePermissionCreatePublic, TTemplatePermissionCreateOrg, TTemplatePermissionCreatePersonal, TTemplatePermissionDelete, TTemplatePermissionVisibility, TTemplateMemberRead, TTemplateMemberWrite, TTemplateMemberDelete, TTemplateMemberVisibility, TTemplatePermission, TAccountPermissionOwnerAdd, TAccountPermissionOwnerRemove, TAccountPermissionAdminAdd, TAccountPermissionAdminRemove, TAccountPermissionMemberView, TAccountPermissionMemberAdd, TAccountPermissionMemberRemove, TAccountPermission, TOrgPermissionCreate, TOrgPermissionView, TOrgPermissionUpdate, TOrgPermissionDelete, TOrgPermissionTransfer, TOrgPermissionList, TOrgPermission, TEnvelopePermissionCreate, TEnvelopePermissionCancel, TEnvelopePermissionView, TEnvelopePermissionOrg, TEnvelopePermission, TPermission, TRole, RolePermissions, userHasPermissions, ISigningSession, IUserSession, IIdToken, TSessionType, TSession, TActiveSession, canPerformTemplateAction, hasRequiredPermissions, createField, updateField, deleteField, userIsTemplateCreator, userHasSharedTemplate, userCanCreatePersonalTemplate, userCanCreateOrgTemplate, userCanCreatePublicTemplate, userCanReadTemplate, userCanUpdateTemplate, userCanMakeTemplatePrivate, userCanMakeTemplateShared, userCanMakeTemplatePublic, userCanChangeOrgVisibility, userCanDeleteTemplate, userCanSendTemplate, userCanCreateTemplate, userCanBuildTemplate, getFieldsForRole, userCanPreviewTemplate, createTemplateRole, updateTemplateRole, deleteTemplateRole, ITemplateSortBy, TTemplateVisibilityFilter, IGetTemplatesParams, getTemplates, getTemplate, IDocumentFromUri, IDocumentFromData, ITemplateCreateParams, createTemplate, duplicateTemplate, ITemplateCreateFromSharepointParams, createTemplateFromSharepoint, updateTemplate, deleteTemplate, toggleTemplateStar, createTemplateDocument, deleteTemplateDocument, getTemplateDocument, downloadTemplateDocument, getTemplateDocumentDownloadLink, getTemplateDocumentPreviewLink, getTemplateDocumentFile, getTemplateDocumentThumbnail, getTemplateDocumentPageDisplayUri, ITemplateTag, ITag, IStar, ITemplateSearchResult, IValidator, isValidInput, getValidators, isValidEmail, isValidPhone, isValidRoleName, isValidTag, IROPCRequest, IClientCredentialsRequest, IRefreshTokenRequest, TAuthenticationRequest, authenticate, refreshToken, changePassword, resetPassword, resendVerification, verifyEmail, getMyUser, getNotifications, getProfiles, getCurrentProfile, switchProfile, updateProfile, deleteProfile, createProfile, updateProfilePhoto, ICreateProfileRequest, IUpdateProfileRequest, IAuthenticateResponse, IChangePasswordRequest, IChangePasswordResponse, IResetPasswordRequest, IResetPasswordResponse, IVerifyEmailRequest, getRGB, getRGBA, nameToRGBA, getRoleColor, formatShortTimeAgo, collapseEntitlements, getRTop, getRLeft, getRValue, blobToBase64, rescale, fileToDataUrl, downloadBlob, Countries, getCountryByCode, isFrenchGuiana, isGuadeloupe, isMartinique, isMayotte, getPlusOneCountry, isCanada, isAmericanSamoa, isDominicanRepublic, isPuertoRico, getMatchingCountry, integerSequence, formatFullName, formatInitials, fullNameToInitials, capitalize, convertToE164, randomString, AtoB, decodeJWTBody, decodeAccessTokenBody, IFileWithData, ICountry };