@verdocs/js-sdk 5.0.2 → 5.0.4

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
@@ -1351,8 +1351,8 @@ type TCreateEnvelopeRequest = ICreateEnvelopeFromTemplateRequest | ICreateEnvelo
1351
1351
  * ```
1352
1352
  *
1353
1353
  * @group Envelopes
1354
- * @api POST /v2/envelopes Create Envelope
1355
- * @apiBody string(format:uuid) template_id The template to base the new Envelope from
1354
+ * @api POST /v2/envelopes Create Envelope From Template
1355
+ * @apiBody string(format:uuid) template_id The ID of the template to copy
1356
1356
  * @apiBody array(items:ICreateEnvelopeRecipient) recipients A list of recipients to include in the workflow. Must specify one recipient to match each template Role.
1357
1357
  * @apiBody string name? Override the name of the envelope (defaults to the template name).
1358
1358
  * @apiBody string description? Override the description of the envelope (defaults to the template description).
@@ -1368,7 +1368,7 @@ declare const createEnvelope: (endpoint: VerdocsEndpoint, request: TCreateEnvelo
1368
1368
  * this will return only the **metadata** the caller is allowed to view.
1369
1369
  *
1370
1370
  * @group Envelopes
1371
- * @api GET /v2/envelopes/:id Get Envelope Details
1371
+ * @api GET /v2/envelopes/:id Get envelope details
1372
1372
  * @apiParam string(format: 'uuid') id The ID of the envelope to retrieve.
1373
1373
  * @apiSuccess IEnvelope . The detailed metadata for the envelope requested
1374
1374
  */
@@ -1377,8 +1377,8 @@ declare const getEnvelope: (endpoint: VerdocsEndpoint, envelopeId: string) => Pr
1377
1377
  * Get all metadata for an envelope document. Note that when called by non-creators (e.g. Recipients)
1378
1378
  * this will return only the **metadata** the caller is allowed to view.
1379
1379
  *
1380
- * @group Envelopes
1381
- * @api GET /envelopes/:id Get Envelope Details
1380
+ * @group Envelope Documents
1381
+ * @api GET /envelopes/:id Get envelope document
1382
1382
  * @apiParam string(format: 'uuid') id The ID of the document to retrieve.
1383
1383
  * @apiSuccess IEnvelopeDocument . The detailed metadata for the document requested
1384
1384
  */
@@ -1387,7 +1387,7 @@ declare const getEnvelopeDocument: (endpoint: VerdocsEndpoint, envelopeId: strin
1387
1387
  * Get a pre-signed download link for an Envelope Document. This link expires quickly, so it should
1388
1388
  * be accessed immediately and never shared. Content-Disposition will be set to "download".
1389
1389
  *
1390
- * @group Envelopes
1390
+ * @group Envelope Documents
1391
1391
  * @api GET /envelopes/:envelope_id/envelope_documents/:document_id Preview, Download, or Link to a Document
1392
1392
  * @apiParam string(format: 'uuid') envelope_id The ID of the envelope to retrieve.
1393
1393
  * @apiParam string(format: 'uuid') document_id The ID of the document to retrieve.
@@ -1498,7 +1498,7 @@ declare const getFieldAttachment: (endpoint: VerdocsEndpoint, envelopeId: string
1498
1498
  * for DISPLAY ONLY, are not legally binding documents, and do not contain any encoded metadata from participants.
1499
1499
  *
1500
1500
  * @group Envelopes
1501
- * @api GET /v2/envelope-documnets/page-image/:document_id/:variant/:page Get Document Page Display URI
1501
+ * @api GET /v2/envelope-documnets/page-image/:document_id/:variant/:page Get envelope document page display URI
1502
1502
  * @apiParam string(format: 'uuid') document_id The ID of the document to retrieve.
1503
1503
  * @apiParam string(enum: 'original'|'filled') variant The variant of the document to retrieve.
1504
1504
  * @apiParam integer page The page number to retrieve
@@ -1532,7 +1532,7 @@ interface IListEnvelopesParams {
1532
1532
  * ```
1533
1533
  *
1534
1534
  * @group Envelopes
1535
- * @api GET /v2/envelopes List Envelopes
1535
+ * @api GET /v2/envelopes List envelopes
1536
1536
  * @apiQuery string q? Match envelopes whose name contains this string
1537
1537
  * @apiQuery string(enum: 'inbox' | 'sent' | 'action' | 'waiting' | 'completed') view? Request pre-defined view. `inbox` returns envelopes where action is required by the caller. `sent` returns envelopes created by the caller. `action` returns envelopes where action is required by the caller. `waiting` returns envelopes where action is required by anyone. `completed` returns envelopes where all actions are complete.
1538
1538
  * @apiQuery array(items: 'complete' | 'pending' | 'in progress' | 'declined' | 'canceled') status? Match envelopes in one of the specified states.
@@ -1867,6 +1867,10 @@ interface ISetWebhookRequest {
1867
1867
  *
1868
1868
  * const keys = await getApiKeys(ORGID);
1869
1869
  * ```
1870
+ *
1871
+ * @group API Keys
1872
+ * @api GET /v2/api-keys Get API keys
1873
+ * @apiSuccess array(items: IApiKey) . A list of the API keys for the caller's organization. Secrets will not be included.
1870
1874
  */
1871
1875
  declare const getApiKeys: (endpoint: VerdocsEndpoint) => Promise<IApiKey[]>;
1872
1876
  /**
@@ -1877,6 +1881,13 @@ declare const getApiKeys: (endpoint: VerdocsEndpoint) => Promise<IApiKey[]>;
1877
1881
  *
1878
1882
  * await createApiKey(ORGID, {name: NEWNAME});
1879
1883
  * ```
1884
+ *
1885
+ * @group API Keys
1886
+ * @api POST /v2/api-keys Create API key
1887
+ * @apiBody string name A name used to identify the key in the Verdocs Web App
1888
+ * @apiBody string(format:uuid) profile_id The profile ID that calls made using the key will act as
1889
+ * @apiBody array(items:string) permission An array of permissions to assign to the new key. Extends (but does not override) the API key's profile permissions.
1890
+ * @apiSuccess IApiKey . The newly-created API key, including its secret.
1880
1891
  */
1881
1892
  declare const createApiKey: (endpoint: VerdocsEndpoint, params: ICreateApiKeyRequest) => Promise<IApiKey>;
1882
1893
  /**
@@ -1887,6 +1898,11 @@ declare const createApiKey: (endpoint: VerdocsEndpoint, params: ICreateApiKeyReq
1887
1898
  *
1888
1899
  * const {client_secret: newSecret} = await rotateApiKey(ORGID, CLIENTID);
1889
1900
  * ```
1901
+ *
1902
+ * @group API Keys
1903
+ * @api POST /v2/api-keys/:client_id/rotate Rotate API key
1904
+ * @apiParam string(format:uuid) client_id The client ID of the key to rotate
1905
+ * @apiSuccess IApiKey . The updated API key with its new secret.
1890
1906
  */
1891
1907
  declare const rotateApiKey: (endpoint: VerdocsEndpoint, clientId: string) => Promise<IApiKey>;
1892
1908
  /**
@@ -1897,6 +1913,12 @@ declare const rotateApiKey: (endpoint: VerdocsEndpoint, clientId: string) => Pro
1897
1913
  *
1898
1914
  * await updateApiKey(ORGID, CLIENTID, {name: NEWNAME});
1899
1915
  * ```
1916
+ *
1917
+ * @group API Keys
1918
+ * @api PATCH /v2/api-keys/:client_id Update API key
1919
+ * @apiBody string name? New name for the API key
1920
+ * @apiBody array(items:string) permission New array of permissions to assign to the new key. Extends (but does not override) the API key's profile permissions.
1921
+ * @apiSuccess IApiKey . The updated API key. The secret will not be included.
1900
1922
  */
1901
1923
  declare const updateApiKey: (endpoint: VerdocsEndpoint, clientId: string, params: IUpdateApiKeyRequest) => Promise<IApiKey>;
1902
1924
  /**
@@ -1907,6 +1929,10 @@ declare const updateApiKey: (endpoint: VerdocsEndpoint, clientId: string, params
1907
1929
  *
1908
1930
  * await deleteApiKey(ORGID, CLIENTID);
1909
1931
  * ```
1932
+ *
1933
+ * @group API Keys
1934
+ * @api DELETE /v2/api-keys/:client_id Delete API key
1935
+ * @apiSuccess string . Success.
1910
1936
  */
1911
1937
  declare const deleteApiKey: (endpoint: VerdocsEndpoint, clientId: string) => Promise<any>;
1912
1938
  /**
@@ -1923,17 +1949,28 @@ declare const deleteApiKey: (endpoint: VerdocsEndpoint, clientId: string) => Pro
1923
1949
  *
1924
1950
  * const members = await getOrganizationContacts(VerdocsEndpoint.getDefault()});
1925
1951
  * ```
1952
+ *
1953
+ * @group Organization Contacts
1954
+ * @api GET /v2/organization-contacts Get a list of organization contacts
1955
+ * @apiBody string email Email address for the invitee
1956
+ * @apiBody string token Invite token for the invitee
1957
+ * @apiSuccess string . Success. The invitation will be marked declined and the token will be invalidated.
1926
1958
  */
1927
1959
  declare const getOrganizationContacts: (endpoint: VerdocsEndpoint) => Promise<IProfile[]>;
1928
1960
  /**
1929
- * Delete a contact from the caller's organization. Note that the caller must be an admin or owner,
1930
- * may not delete him/herself.
1961
+ * Delete a contact from the caller's organization. Note that the caller must be an admin or owner.
1931
1962
  *
1932
1963
  * ```typescript
1933
1964
  * import {deleteOrganizationContact} from '@verdocs/js-sdk';
1934
1965
  *
1935
1966
  * await deleteOrganizationContact(VerdocsEndpoint.getDefault(), 'PROFILEID'});
1936
1967
  * ```
1968
+ *
1969
+ * @group Organization Contacts
1970
+ * @api POST /v2/organization-invitations/decline GET a list of pending invitations
1971
+ * @apiBody string email Email address for the invitee
1972
+ * @apiBody string token Invite token for the invitee
1973
+ * @apiSuccess string . Success. The invitation will be marked declined and the token will be invalidated.
1937
1974
  */
1938
1975
  declare const deleteOrganizationContact: (endpoint: VerdocsEndpoint, profileId: string) => Promise<any>;
1939
1976
  /**
@@ -2111,7 +2148,13 @@ type TAuthenticationRequest = IROPCRequest | IClientCredentialsRequest | IRefres
2111
2148
  *
2112
2149
  * @group Authentication
2113
2150
  * @api POST /v2/oauth2/token Authenticate
2114
- * @apiBody string(format: 'uuid') id The ID of the envelope to retrieve.
2151
+ * @apiBody string(enum: 'client_credentials'|'refresh_token'|'password') grant_type The type of grant to request. API callers should nearly always use 'client_credentials'.
2152
+ * @apiBody string(format: 'uuid') client_id? If grant_type is client_credentials or refresh_token, the client ID of the API key to use.
2153
+ * @apiBody string(format: 'uuid') client_secret? If grant_type is client_credentials, the secret key of the API key to use.
2154
+ * @apiBody string username? If grant_type is password, the username to authenticate with.
2155
+ * @apiBody string password? If grant_type is password, the password to authenticate with.
2156
+ * @apiBody string password? If grant_type is password, the password to authenticate with.
2157
+ * @apiBody string scope? Optional scope to limit the auth token to. Do not specify this unless you are instructed to by a Verdocs Support rep.
2115
2158
  * @apiSuccess IAuthenticateResponse . The detailed metadata for the envelope requested
2116
2159
  */
2117
2160
  declare const authenticate: (endpoint: VerdocsEndpoint, params: TAuthenticationRequest) => Promise<IAuthenticateResponse>;
@@ -2137,6 +2180,12 @@ declare const refreshToken: (endpoint: VerdocsEndpoint, refreshToken: string) =>
2137
2180
  * window.alert(`Password reset error: ${message}`);
2138
2181
  * }
2139
2182
  * ```
2183
+ *
2184
+ * @group Authentication
2185
+ * @api POST /v2/users/change-password Change the caller's password
2186
+ * @apiBody string old_password Current password for the caller
2187
+ * @apiBody string new_password New password to set for the caller. Must meet strength requirements.
2188
+ * @apiSuccess string . Success
2140
2189
  */
2141
2190
  declare const changePassword: (endpoint: VerdocsEndpoint, params: IChangePasswordRequest) => Promise<IChangePasswordResponse>;
2142
2191
  /**
@@ -2157,6 +2206,13 @@ declare const changePassword: (endpoint: VerdocsEndpoint, params: IChangePasswor
2157
2206
  * window.alert(`Please check your verification code and try again.`);
2158
2207
  * }
2159
2208
  * ```
2209
+ *
2210
+ * @group Authentication
2211
+ * @api POST /v2/users/reset-password Reset a password for a user
2212
+ * @apiBody string email Email address for the user account
2213
+ * @apiBody string code? To initiate a reset request, omit this field. To complete it, provide the emailed code received by the user.
2214
+ * @apiBody string new_password? To initiate a reset request, omit this field. To complete it, provide the new password the user wishes to use.
2215
+ * @apiSuccess string . Success
2160
2216
  */
2161
2217
  declare const resetPassword: (endpoint: VerdocsEndpoint, params: {
2162
2218
  email: string;
@@ -2166,49 +2222,64 @@ declare const resetPassword: (endpoint: VerdocsEndpoint, params: {
2166
2222
  success: boolean;
2167
2223
  }>;
2168
2224
  /**
2169
- * Resend the email verification request. Note that to prevent certain forms of abuse, the email address is not
2170
- * a parameter here. Instead, the caller must be authenticated as the (unverified) user. To simplify this process,
2171
- * the access token to be used may be passed directly as a parameter here. This avoids the need to set it as the
2172
- * active token on an endpoint, which may be inconvenient in workflows where it is preferable to keep the user in
2173
- * "anonymous" mode while verification is being performed.
2225
+ * Resend the email verification request if the email or token are unknown. Instead, an accessToken
2226
+ * may be supplied through which the user will be identified. This is intended to be used in post-signup
2227
+ * cases where the user is "partially" authenticated (has a session, but is not yet verified).
2174
2228
  *
2175
2229
  * ```typescript
2176
2230
  * import {resendVerification} from '@verdocs/js-sdk';
2177
2231
  *
2178
2232
  * const result = await resendVerification();
2179
2233
  * ```
2234
+ *
2235
+ * @group Authentication
2236
+ * @api POST /v2/users/verify Resend an email verification request for a "partially" authenticated user (authenticated, but not yet verified)
2237
+ * @apiSuccess string . Success
2180
2238
  */
2181
2239
  declare const resendVerification: (endpoint: VerdocsEndpoint, accessToken?: string) => Promise<{
2182
2240
  result: "done";
2183
2241
  }>;
2184
2242
  /**
2185
- * Resend the email verification request. Note that to prevent certain forms of abuse, the email address is not
2186
- * a parameter here. Instead, the caller must be authenticated as the (unverified) user. To simplify this process,
2187
- * the access token to be used may be passed directly as a parameter here. This avoids the need to set it as the
2188
- * active token on an endpoint, which may be inconvenient in workflows where it is preferable to keep the user in
2189
- * "anonymous" mode while verification is being performed.
2243
+ * Resend the email verification request if the user is unauthenticated, but the email and token are known.
2244
+ * Used if the token is valid but has expired.
2190
2245
  *
2191
2246
  * ```typescript
2192
2247
  * import {resendVerification} from '@verdocs/js-sdk';
2193
2248
  *
2194
2249
  * const result = await resendVerification();
2195
2250
  * ```
2251
+ *
2252
+ * @group Authentication
2253
+ * @api POST /v2/users/verify Resend the email verification request if both the email and token are known. Used if the token is valid but has expired.
2254
+ * @apiSuccess IAuthenticateResponse . Updated authentication details
2196
2255
  */
2197
2256
  declare const verifyEmail: (endpoint: VerdocsEndpoint, params: IVerifyEmailRequest) => Promise<IAuthenticateResponse>;
2257
+ /**
2258
+ * Get the caller's current user record.
2259
+ *
2260
+ * @group Authentication
2261
+ * @api GET /v2/users/me Get the caller's user record.
2262
+ * @apiSuccess IUser . User record
2263
+ */
2198
2264
  declare const getMyUser: (endpoint: VerdocsEndpoint) => Promise<IUser>;
2199
2265
  declare const getNotifications: (endpoint: VerdocsEndpoint) => Promise<any>;
2200
2266
  /**
2201
- * Get the user's available profiles. The current profile will be marked with `current: true`.
2267
+ * Get the caller's available profiles. The current profile will be marked with `current: true`.
2202
2268
  *
2203
2269
  * ```typescript
2204
2270
  * import {getProfiles} from '@verdocs/js-sdk';
2205
2271
  *
2206
2272
  * const profiles = await getProfiles();
2207
2273
  * ```
2274
+ *
2275
+ * @group Profiles
2276
+ * @api GET /v2/profiles Get the caller's profiles
2277
+ * @apiDescription A user may have multiple profiles, one for each organization of which they are a member. Only one profile may be "current" at a time.
2278
+ * @apiSuccess array(items: IProfile) . The caller's profiles
2208
2279
  */
2209
2280
  declare const getProfiles: (endpoint: VerdocsEndpoint) => Promise<IProfile[]>;
2210
2281
  /**
2211
- * Get the user's current profile. This is just a convenience accessor that calls `getProfiles()`
2282
+ * Get the caller's current profile. This is just a convenience accessor that calls `getProfiles()`
2212
2283
  * and returns the first `current: true` entry.
2213
2284
  *
2214
2285
  * ```typescript
@@ -2228,6 +2299,10 @@ declare const getCurrentProfile: (endpoint: VerdocsEndpoint) => Promise<IProfile
2228
2299
  *
2229
2300
  * const newProfile = await switchProfile(VerdocsEndpoint.getDefault(), 'PROFILEID');
2230
2301
  * ```
2302
+ *
2303
+ * @group Profiles
2304
+ * @api POST /v2/profiles/:profile_id/switch Change the "current" profile for the caller
2305
+ * @apiSuccess IAuthenticateResponse . New authentication credentials
2231
2306
  */
2232
2307
  declare const switchProfile: (endpoint: VerdocsEndpoint, profileId: string) => Promise<IAuthenticateResponse>;
2233
2308
  /**
@@ -2239,6 +2314,15 @@ declare const switchProfile: (endpoint: VerdocsEndpoint, profileId: string) => P
2239
2314
  *
2240
2315
  * const newProfile = await updateProfile(VerdocsEndpoint.getDefault(), 'PROFILEID');
2241
2316
  * ```
2317
+ *
2318
+ * @group Profiles
2319
+ * @api PATCH /v2/profiles/:profile_id Update a profile
2320
+ * @apiBody string first_name? First name
2321
+ * @apiBody string last_name? Last name
2322
+ * @apiBody string phone? Phone number
2323
+ * @apiBody array(items:TPermission) permissions? New permissions to directly apply to the profile
2324
+ * @apiBody array(items:TRole) roles? New roles to assign to the profile
2325
+ * @apiSuccess IProfile . The updated profile
2242
2326
  */
2243
2327
  declare const updateProfile: (endpoint: VerdocsEndpoint, profileId: string, params: IUpdateProfileRequest) => Promise<IProfile>;
2244
2328
  /**
@@ -2250,13 +2334,17 @@ declare const updateProfile: (endpoint: VerdocsEndpoint, profileId: string, para
2250
2334
  *
2251
2335
  * await deleteProfile(VerdocsEndpoint.getDefault(), 'PROFILEID');
2252
2336
  * ```
2337
+ *
2338
+ * @group Profiles
2339
+ * @api DELETE /v2/profiles/:profile_id Delete a profile
2340
+ * @apiSuccess IAuthenticateResponse . New session tokens for the next available profile for the caller, or null if none.
2253
2341
  */
2254
2342
  declare const deleteProfile: (endpoint: VerdocsEndpoint, profileId: string) => Promise<IAuthenticateResponse | {
2255
2343
  status: "OK";
2256
2344
  message: "Your last profile has been deleted. You are now logged out.";
2257
2345
  }>;
2258
2346
  /**
2259
- * Create a new user account. Note that there are two registration paths for creation:
2347
+ * Create a new profile. Note that there are two registration paths for creation:
2260
2348
  * - Get invited to an organization, by an admin or owner of that org.
2261
2349
  * - Created a new organization. The caller will become the first owner of the new org.
2262
2350
  *
@@ -2287,6 +2375,11 @@ declare const createProfile: (endpoint: VerdocsEndpoint, params: ICreateProfileR
2287
2375
  *
2288
2376
  * await uploadProfilePhoto((VerdocsEndpoint.getDefault(), profileId, file);
2289
2377
  * ```
2378
+ *
2379
+ * @group Profiles
2380
+ * @api PATCH /v2/templates/:template_id Change a profile's photo
2381
+ * @apiBody string(format:binary) file File to upload
2382
+ * @apiSuccess IProfile . The updated profile
2290
2383
  */
2291
2384
  declare const updateProfilePhoto: (endpoint: VerdocsEndpoint, profileId: string, file: File, onUploadProgress?: (percent: number, loadedBytes: number, totalBytes: number) => void) => Promise<IProfile>;
2292
2385
  /**
@@ -2296,44 +2389,95 @@ declare const updateProfilePhoto: (endpoint: VerdocsEndpoint, profileId: string,
2296
2389
  */
2297
2390
  /**
2298
2391
  * Get a list of invitations pending for the caller's organization. The caller must be an admin or owner.
2392
+ *
2393
+ * @group Organization Invitations
2394
+ * @api GET /v2/organization-invitations Get a list of pending invitations
2395
+ * @apiBody array(items:TRole) roles URL to send Webhook events to. An empty or invalid URL will disable Webhook calls.
2396
+ * @apiBody string first_name First name. The user may override this after accepting the invitation.
2397
+ * @apiBody string last_name Last name. The user may override this after accepting the invitation.
2398
+ * @apiSuccess array(items:IProfile) . List of caller's current organization's members
2299
2399
  */
2300
2400
  declare const getOrganizationInvitations: (endpoint: VerdocsEndpoint) => Promise<IOrganizationInvitation[]>;
2301
2401
  /**
2302
2402
  * Invite a new user to join the organization.
2403
+ *
2404
+ * @group Organization Invitations
2405
+ * @api POST /v2/organization-invitations Invite a new user to join the organization
2406
+ * @apiBody string email Email address to send the invitation to
2407
+ * @apiBody string first_name First name. The user may override this after accepting the invitation.
2408
+ * @apiBody string last_name Last name. The user may override this after accepting the invitation.
2409
+ * @apiBody TRole role Initial role to assign to the user once they accept.
2410
+ * @apiSuccess IOrganizationInvitation . The newly-created invitation.
2303
2411
  */
2304
2412
  declare const createOrganizationInvitation: (endpoint: VerdocsEndpoint, params: ICreateInvitationRequest) => Promise<IOrganizationInvitation>;
2305
2413
  /**
2306
2414
  * Delete an invitation. Note that no cancellation message will be sent. Invitations are also one-time-use.
2307
2415
  * If the invitee attempts to join after the invitation is deleted, accepted, or decline, they will be
2308
2416
  * shown an error.
2417
+ *
2418
+ * @group Organization Invitations
2419
+ * @api DELETE /v2/organization-invitations/:email Delete a pending invitation
2420
+ * @apiSuccess string . Success
2309
2421
  */
2310
2422
  declare const deleteOrganizationInvitation: (endpoint: VerdocsEndpoint, email: string) => Promise<any>;
2311
2423
  /**
2312
2424
  * Update an invitation. Note that email may not be changed after the invite is sent. To change
2313
2425
  * an invitee's email, delete the incorrect entry and create one with the correct value.
2426
+ *
2427
+ * @group Organization Invitations
2428
+ * @api PATCH /v2/organization-invitations/:email Update a pending invitation
2429
+ * @apiBody string first_name First name. The user may override this after accepting the invitation.
2430
+ * @apiBody string last_name Last name. The user may override this after accepting the invitation.
2431
+ * @apiBody TRole role Initial role to assign to the user once they accept.
2432
+ * @apiSuccess IOrganizationInvitation . The updated invitation.
2314
2433
  */
2315
2434
  declare const updateOrganizationInvitation: (endpoint: VerdocsEndpoint, email: string, params: Pick<ICreateInvitationRequest, "role" | "first_name" | "last_name">) => Promise<IOrganizationInvitation>;
2316
2435
  /**
2317
2436
  * Send a reminder to the invitee to join the organization.
2437
+ *
2438
+ * @group Organization Invitations
2439
+ * @api POST /v2/organization-invitations/resend Send a reminder to a pending invitee
2440
+ * @apiBody string email The recipient to send the reminder to
2441
+ * @apiSuccess IOrganizationInvitation . The updated invitation
2318
2442
  */
2319
- declare const resendOrganizationInvitation: (endpoint: VerdocsEndpoint, email: string) => Promise<any>;
2443
+ declare const resendOrganizationInvitation: (endpoint: VerdocsEndpoint, email: string) => Promise<IOrganizationInvitation>;
2320
2444
  /**
2321
2445
  * Get an invitation's details. This is generally used as the first step of accepting the invite.
2322
2446
  * A successful response will indicate that the invite token is still valid, and include some
2323
2447
  * metadata for the organization to style the acceptance screen.
2448
+ *
2449
+ * @group Organization Invitations
2450
+ * @api GET /v2/organization-invitations/:email/:token Get a pending invitation (_Authenticated via invite token, not an active session._). Intended to be called by the invitee to get details about the invitation they are about to accept.
2451
+ * @apiSuccess IOrganizationInvitation . Requested invitation's details. Will always include summary details for the organization, to be used for branding the accept-invite view.
2324
2452
  */
2325
2453
  declare const getOrganizationInvitation: (endpoint: VerdocsEndpoint, email: string, token: string) => Promise<IOrganizationInvitation>;
2326
2454
  /**
2327
- * Accept an invitation. This will automatically create an Auth0 user for the caller as well as a profile
2455
+ * Accept an invitation. This will automatically create a user record for the caller as well as a profile
2328
2456
  * with the appropriate role as specified in the invite. The profile will be set as "current" for the caller,
2329
2457
  * and session tokens will be returned to access the new profile. The profile's email_verified flag will
2330
2458
  * also be set to true.
2459
+ *
2460
+ * @group Organization Invitations
2461
+ * @api POST /v2/organization-invitations/accept Accept an invitation
2462
+ * @apiBody string email Email address for the invitee
2463
+ * @apiBody string token Invite token for the invitee
2464
+ * @apiBody string first_name First name
2465
+ * @apiBody string last_name Last name
2466
+ * @apiBody string password Password
2467
+ * @apiSuccess IAuthenticateResponse . Session credentials for the newly-created user's profile. If the user already had a profile for another organization, the new profile will be made "current" automatically.
2331
2468
  */
2332
2469
  declare const acceptOrganizationInvitation: (endpoint: VerdocsEndpoint, params: IAcceptOrganizationInvitationRequest) => Promise<IAuthenticateResponse>;
2333
2470
  /**
2334
2471
  * Decline an invitation. This will mark the status "declined," providing a visual indication to the
2335
2472
  * organization's admins that the invite was declined, preventing further invites from being created
2336
2473
  * to the same email address, and also preventing the invitee from receiving reminders to join.
2474
+ *
2475
+ * @group Organization Invitations
2476
+ * @api POST /v2/organization-invitations/decline Decline an invitation
2477
+ * @apiDescription Mark the status "declined," providing a visual indication to the organization's admins that the invite was declined, preventing further invites from being created to the same email address, and also preventing the invitee from receiving reminders to join.
2478
+ * @apiBody string email Email address for the invitee
2479
+ * @apiBody string token Invite token for the invitee
2480
+ * @apiSuccess string . Success. The invitation will be marked declined and the token will be invalidated.
2337
2481
  */
2338
2482
  declare const declineOrganizationInvitation: (endpoint: VerdocsEndpoint, email: string, token: string) => Promise<{
2339
2483
  status: "OK";
@@ -2351,6 +2495,10 @@ declare const declineOrganizationInvitation: (endpoint: VerdocsEndpoint, email:
2351
2495
  *
2352
2496
  * const members = await getOrganizationMembers(VerdocsEndpoint.getDefault()});
2353
2497
  * ```
2498
+ *
2499
+ * @group Organization Members
2500
+ * @api GET /v2/organization-members List current organization's members
2501
+ * @apiSuccess array(items:IProfile) . List of caller's current organization's members
2354
2502
  */
2355
2503
  declare const getOrganizationMembers: (endpoint: VerdocsEndpoint) => Promise<IProfile[]>;
2356
2504
  /**
@@ -2362,6 +2510,10 @@ declare const getOrganizationMembers: (endpoint: VerdocsEndpoint) => Promise<IPr
2362
2510
  *
2363
2511
  * await deleteOrganizationMember(VerdocsEndpoint.getDefault(), 'PROFILEID'});
2364
2512
  * ```
2513
+ *
2514
+ * @group Organization Members
2515
+ * @api DELETE /v2/organization-members/:profile_id Delete a member from the organization
2516
+ * @apiSuccess string . Success
2365
2517
  */
2366
2518
  declare const deleteOrganizationMember: (endpoint: VerdocsEndpoint, profileId: string) => Promise<any>;
2367
2519
  /**
@@ -2372,6 +2524,13 @@ declare const deleteOrganizationMember: (endpoint: VerdocsEndpoint, profileId: s
2372
2524
  *
2373
2525
  * const result = await updateOrganizationMember(VerdocsEndpoint.getDefault(), 'PROFILEID', {roles:['member']});
2374
2526
  * ```
2527
+ *
2528
+ * @group Organization Members
2529
+ * @api PATCH /v2/organization-members/:profile_id Update an organization member.
2530
+ * @apiBody array(items:TRole) roles URL to send Webhook events to. An empty or invalid URL will disable Webhook calls.
2531
+ * @apiBody string first_name Set to true to enable Webhooks calls.
2532
+ * @apiBody string last_name Record<TWebhookEvent, boolean> map of events to enable/disable.
2533
+ * @apiSuccess array(items:IProfile) . List of caller's current organization's members
2375
2534
  */
2376
2535
  declare const updateOrganizationMember: (endpoint: VerdocsEndpoint, profileId: string, params: Pick<IProfile, "roles" | "first_name" | "last_name">) => Promise<any>;
2377
2536
  /**
@@ -2383,6 +2542,10 @@ declare const updateOrganizationMember: (endpoint: VerdocsEndpoint, profileId: s
2383
2542
  *
2384
2543
  * const organizations = await getOrganization(VerdocsEndpoint.getDefault(), 'ORGID');
2385
2544
  * ```
2545
+ *
2546
+ * @group Organizations
2547
+ * @api GET /v2/organizations/:organization_id Get organization
2548
+ * @apiSuccess IOrganization . The requested organization. The caller must be a member.
2386
2549
  */
2387
2550
  declare const getOrganization: (endpoint: VerdocsEndpoint, organizationId: string) => Promise<IOrganization>;
2388
2551
  /**
@@ -2395,6 +2558,18 @@ declare const getOrganization: (endpoint: VerdocsEndpoint, organizationId: strin
2395
2558
  *
2396
2559
  * const organization = await createOrganization(VerdocsEndpoint.getDefault(), {name: 'NewOrg'});
2397
2560
  * ```
2561
+ *
2562
+ * @group Organizations
2563
+ * @api POST /v2/organizations Create organization
2564
+ * @apiDescription The caller will be assigned an "Owner" profile in the new organization, and it will be set to "current" automatically. A new set of session tokens will be issued to the caller, and the caller should update their endpoint to use the new tokens.
2565
+ * @apiBody string name The name of the new organization
2566
+ * @apiBody string contact_email? Contact email for the new organization
2567
+ * @apiBody string url? URL for the new organization
2568
+ * @apiBody string full_logo_url? URL of a large-format PNG logo
2569
+ * @apiBody string thumbnail_url? URL of a small-format (square is recommended) PNG logo
2570
+ * @apiBody string primary_color? URL of a small-format (square is recommended) PNG logo
2571
+ * @apiBody string secondary_color? URL of a small-format (square is recommended) PNG logo
2572
+ * @apiSuccess IAuthenticateResponse . Authentication credentials for user in the new organization. The user will be made an Owner automatically.
2398
2573
  */
2399
2574
  declare const createOrganization: (endpoint: VerdocsEndpoint, params: Pick<IOrganization, "name" | "address" | "address2" | "phone" | "contact_email" | "url" | "full_logo_url" | "thumbnail_url" | "primary_color" | "secondary_color">) => Promise<IAuthenticateResponse>;
2400
2575
  /**
@@ -2405,6 +2580,17 @@ declare const createOrganization: (endpoint: VerdocsEndpoint, params: Pick<IOrga
2405
2580
  *
2406
2581
  * const organizations = await updateOrganization(VerdocsEndpoint.getDefault(), organizationId, {name:'ORGNAME'});
2407
2582
  * ```
2583
+ *
2584
+ * @group Organizations
2585
+ * @api PATCH /v2/organizations/:organization_id Update organization
2586
+ * @apiBody string name The name of the new organization
2587
+ * @apiBody string contact_email? Contact email for the new organization
2588
+ * @apiBody string url? URL for the new organization
2589
+ * @apiBody string full_logo_url? URL of a large-format PNG logo
2590
+ * @apiBody string thumbnail_url? URL of a small-format (square is recommended) PNG logo
2591
+ * @apiBody string primary_color? URL of a small-format (square is recommended) PNG logo
2592
+ * @apiBody string secondary_color? URL of a small-format (square is recommended) PNG logo
2593
+ * @apiSuccess IOrganization . The details for the updated organization
2408
2594
  */
2409
2595
  declare const updateOrganization: (endpoint: VerdocsEndpoint, organizationId: string, params: Partial<IOrganization>) => Promise<IOrganization>;
2410
2596
  /**
@@ -2416,18 +2602,28 @@ declare const updateOrganization: (endpoint: VerdocsEndpoint, organizationId: st
2416
2602
  *
2417
2603
  * const newSession = await deleteOrganization(VerdocsEndpoint.getDefault(), organizationId);
2418
2604
  * ```
2605
+ *
2606
+ * @group Organizations
2607
+ * @api DELETE /v2/organizations/:organization_id Delete organization
2608
+ * @apiSuccess IAuthenticateResponse . If the caller is a member of another organization, authentication credentials for the next organization available. If not, this will be null and the caller will be logged out.
2419
2609
  */
2420
2610
  declare const deleteOrganization: (endpoint: VerdocsEndpoint, organizationId: string) => Promise<IAuthenticateResponse | null>;
2421
2611
  /**
2422
- * Update the organization's logo. This can only be called by an admin or owner.
2612
+ * Update the organization's full or thumbnail logo. This can only be called by an admin or owner.
2423
2613
  *
2424
2614
  * ```typescript
2425
2615
  * import {updateOrganizationLogo} from '@verdocs/js-sdk';
2426
2616
  *
2427
2617
  * await updateOrganizationLogo((VerdocsEndpoint.getDefault(), organizationId, file);
2428
2618
  * ```
2619
+ *
2620
+ * @group Organizations
2621
+ * @api PATCH /v2/organizations/:organization_id Update organization full or thumbnail logo.
2622
+ * @apiBody image/png logo? Form-url-encoded file to upload
2623
+ * @apiBody image/png thumbnail? Form-url-encoded file to upload
2624
+ * @apiSuccess IOrganization . The updated organization.
2429
2625
  */
2430
- declare const updateOrganizationLogo: (endpoint: VerdocsEndpoint, organizationId: string, file: File, onUploadProgress?: (percent: number, loadedBytes: number, totalBytes: number) => void) => Promise<IProfile>;
2626
+ declare const updateOrganizationLogo: (endpoint: VerdocsEndpoint, organizationId: string, file: File, onUploadProgress?: (percent: number, loadedBytes: number, totalBytes: number) => void) => Promise<IOrganization>;
2431
2627
  /**
2432
2628
  * Update the organization's thumbnail. This can only be called by an admin or owner.
2433
2629
  *
@@ -2437,7 +2633,7 @@ declare const updateOrganizationLogo: (endpoint: VerdocsEndpoint, organizationId
2437
2633
  * await updateOrganizationThumbnail((VerdocsEndpoint.getDefault(), organizationId, file);
2438
2634
  * ```
2439
2635
  */
2440
- declare const updateOrganizationThumbnail: (endpoint: VerdocsEndpoint, organizationId: string, file: File, onUploadProgress?: (percent: number, loadedBytes: number, totalBytes: number) => void) => Promise<IProfile>;
2636
+ declare const updateOrganizationThumbnail: (endpoint: VerdocsEndpoint, organizationId: string, file: File, onUploadProgress?: (percent: number, loadedBytes: number, totalBytes: number) => void) => Promise<IOrganization>;
2441
2637
  /**
2442
2638
  * Get the registered Webhook configuration for the caller's organization.
2443
2639
  *
@@ -2446,6 +2642,10 @@ declare const updateOrganizationThumbnail: (endpoint: VerdocsEndpoint, organizat
2446
2642
  *
2447
2643
  * await getWebhooks(ORGID, params);
2448
2644
  * ```
2645
+ *
2646
+ * @group Webhooks
2647
+ * @api GET /v2/webhooks Get organization Webhooks config
2648
+ * @apiSuccess IWebhook . The current Webhooks config for the caller's organization.
2449
2649
  */
2450
2650
  declare const getWebhooks: (endpoint: VerdocsEndpoint) => Promise<IWebhook>;
2451
2651
  /**
@@ -2458,6 +2658,14 @@ declare const getWebhooks: (endpoint: VerdocsEndpoint) => Promise<IWebhook>;
2458
2658
  *
2459
2659
  * await setWebhooks(ORGID, params);
2460
2660
  * ```
2661
+ *
2662
+ * @group Webhooks
2663
+ * @api PATCH /v2/webhooks Update organization Webhooks config
2664
+ * @apiDescription Note that Webhooks cannot currently be deleted, but may be easily disabled by setting `active` to `false` and/or setting the `url` to an empty string.
2665
+ * @apiBody string url URL to send Webhook events to. An empty or invalid URL will disable Webhook calls.
2666
+ * @apiBody boolean active Set to true to enable Webhooks calls.
2667
+ * @apiBody object events Record<TWebhookEvent, boolean> map of events to enable/disable.
2668
+ * @apiSuccess IWebhook . The updated Webhooks config for the caller's organization.
2461
2669
  */
2462
2670
  declare const setWebhooks: (endpoint: VerdocsEndpoint, params: ISetWebhookRequest) => Promise<IWebhook>;
2463
2671
  declare const canPerformTemplateAction: (profile: IProfile | null | undefined, action: TTemplateAction, template?: ITemplate) => {
@@ -2473,6 +2681,25 @@ declare const hasRequiredPermissions: (profile: IProfile | null | undefined, per
2473
2681
  *
2474
2682
  * await createField((VerdocsEndpoint.getDefault(), template_id, { ... });
2475
2683
  * ```
2684
+ *
2685
+ * @group Fields
2686
+ * @api POST /v2/fields/:template_id Add a field to a template
2687
+ * @apiBody string name Name for the new field. Field names must be unique within a template. Although special characters are allowed, they must be URL-encoded in subsequent requests, so it is recommended to use only alphanumeric characters and hyphens if possible.
2688
+ * @apiBody string role_name Role to assign to the field. Role names must be valid, so it is recommended to create roles before fields.
2689
+ * @apiBody string document_id ID of the document upon which to place the field.
2690
+ * @apiBody string(enum: 'signature' | 'initial' | 'checkbox' | 'radio' | 'textbox' | 'timestamp' | 'date' | 'dropdown' | 'textarea' | 'attachment' | 'payment') type Type of field to create
2691
+ * @apiBody boolean(default: false) required Whether the field is required
2692
+ * @apiBody integer(min: 0) page 0-based page number upon which to place the field
2693
+ * @apiBody integer(min: 0) x X position for the field (left to right)
2694
+ * @apiBody integer(min: 0) y Y position for the field (_bottom to top!_)
2695
+ * @apiBody string label? Optional label to display above the field
2696
+ * @apiBody integer(min: 50) width? Width of the field. Note that all fields have built-in defaults, and it is recommended that this only be set on text fields.
2697
+ * @apiBody integer(min: 15) height? Height of the field. Note that all fields have built-in defaults, and it is recommended that this only be set on text fields.
2698
+ * @apiBody string placeholder? Optional placeholder to display in text fields
2699
+ * @apiBody string group? For fields that support grouping (radio buttons and check boxes) the value selected will be stored under this name
2700
+ * @apiBody array(items:IDropdownOption) options? For dropdown fields, the options to display
2701
+ * @apiBody string value? Optional default value to set on the field
2702
+ * @apiSuccess ITemplateField . Template field
2476
2703
  */
2477
2704
  declare const createField: (endpoint: VerdocsEndpoint, templateId: string, params: ITemplateField) => Promise<ITemplateField>;
2478
2705
  /**
@@ -2483,6 +2710,25 @@ declare const createField: (endpoint: VerdocsEndpoint, templateId: string, param
2483
2710
  *
2484
2711
  * await updateField((VerdocsEndpoint.getDefault(), template_id, field_name, { ... });
2485
2712
  * ```
2713
+ *
2714
+ * @group Fields
2715
+ * @api PATCH /v2/fields/:template_id/:field_name Update a field. See createField for additional details on the supported parameters.
2716
+ * @apiBody string name? Rename the field. Note that template field names must be unique within a template.
2717
+ * @apiBody string role_name Role to assign to the field.
2718
+ * @apiBody string document_id ID of the document upon which to place the field.
2719
+ * @apiBody string(enum: 'signature' | 'initial' | 'checkbox' | 'radio' | 'textbox' | 'timestamp' | 'date' | 'dropdown' | 'textarea' | 'attachment' | 'payment') type? Change the field type. Note that while this is technically allowed, fields have different behaviors, validators, default sizes, etc. It is usually easier to add a new field and delete the old one.
2720
+ * @apiBody boolean(default: false) required? Whether the field is required
2721
+ * @apiBody integer(min: 0) page? 0-based page number upon which to place the field
2722
+ * @apiBody integer(min: 0) x? X position for the field (left to right)
2723
+ * @apiBody integer(min: 0) y? Y position for the field (_bottom to top!_)
2724
+ * @apiBody string label? Optional label to display above the field
2725
+ * @apiBody integer(min: 50) width? Width of the field. Note that all fields have built-in defaults, and it is recommended that this only be set on text fields.
2726
+ * @apiBody integer(min: 15) height? Height of the field. Note that all fields have built-in defaults, and it is recommended that this only be set on text fields.
2727
+ * @apiBody string placeholder? Optional placeholder to display in text fields
2728
+ * @apiBody string group? For fields that support grouping (radio buttons and check boxes) the value selected will be stored under this name
2729
+ * @apiBody array(items:IDropdownOption) options? For dropdown fields, the options to display
2730
+ * @apiBody string value? Optional default value to set on the field
2731
+ * @apiSuccess ITemplateField . Updated template field
2486
2732
  */
2487
2733
  declare const updateField: (endpoint: VerdocsEndpoint, templateId: string, name: string, params: Partial<ITemplateField>) => Promise<ITemplateField>;
2488
2734
  /**
@@ -2493,6 +2739,10 @@ declare const updateField: (endpoint: VerdocsEndpoint, templateId: string, name:
2493
2739
  *
2494
2740
  * await deleteField((VerdocsEndpoint.getDefault(), template_id, field_name);
2495
2741
  * ```
2742
+ *
2743
+ * @group Fields
2744
+ * @api DELETE /v2/fields/:template_id/:field_name Delete a field
2745
+ * @apiSuccess string . Success
2496
2746
  */
2497
2747
  declare const deleteField: (endpoint: VerdocsEndpoint, templateId: string, name: string) => Promise<any>;
2498
2748
  /**
@@ -2570,6 +2820,20 @@ declare const userCanPreviewTemplate: (profile: IProfile | null | undefined, tem
2570
2820
  *
2571
2821
  * const role = await createTemplateRole(VerdocsEndpoint.getDefault(), template_id, params...);
2572
2822
  * ```
2823
+ *
2824
+ * @group Roles
2825
+ * @api POST /v2/roles/:template_id Add a role to a template
2826
+ * @apiBody string name Name for the new role. Must be unique within the template. May include spaces, but later calls must URL-encode any references to this role, so it is recomended that special characters be avoided.
2827
+ * @apiBody string(enum:'signer' | 'cc' | 'approver') type Type of role to create. Signers act on documents by filling and signing fields. CC recipients receive a copy but do not act on the document. Approvers control the final submission of a document, but do not have fields of their own to fill out.
2828
+ * @apiBody string full_name? Default full name for the role. May be completed/overridden later, when envelopes are made from the template.
2829
+ * @apiBody string email? Default email address for the role. May be completed/overridden later, when envelopes are made from the template.
2830
+ * @apiBody string phone? Default (SMS-capable) phone number for the role. May be completed/overridden later, when envelopes are made from the template.
2831
+ * @apiBody string message? Optional message to include in email and SMS signing invitations.
2832
+ * @apiBody integer(min: 1, default: 1) sequence? Optional 1-based sequence number for the role. Roles that share the same sequence number act in parallel, and will receive invitations at the same time.
2833
+ * @apiBody integer(min: 1, default: 1) order? Optional 1-based order number for the role. Controls the left-to-right display order of roles at the same sequence number in the UI components e.g. `<verdocs-template-roles />`.
2834
+ * @apiBody boolean delegator? If true, the role may delegate their signing responsibility to another party.
2835
+ * @apiBody string(enum:'pin'|'identity'|'') kba_method? Active PIN- or Identity-based KBA for the role. NOTE: Some KBA operations may incur additional fees.
2836
+ * @apiSuccess IRole . The newly-created role
2573
2837
  */
2574
2838
  declare const createTemplateRole: (endpoint: VerdocsEndpoint, template_id: string, params: IRole) => Promise<IRole>;
2575
2839
  /**
@@ -2580,6 +2844,20 @@ declare const createTemplateRole: (endpoint: VerdocsEndpoint, template_id: strin
2580
2844
  *
2581
2845
  * const role = await updateTemplateRole(VerdocsEndpoint.getDefault(), template_id, name, params...);
2582
2846
  * ```
2847
+ *
2848
+ * @group Roles
2849
+ * @api PATCH /v2/roles/:template_id/:role_id Update a role. See createRole for additional details on the parameters available.
2850
+ * @apiBody string name? Rename the role. Note that role names must be unique within a template, so this may fail if the new name is already in use.
2851
+ * @apiBody string(enum:'signer' | 'cc' | 'approver') type? Type of role.
2852
+ * @apiBody string full_name? Default full name for the role.
2853
+ * @apiBody string email? Default email address for the role.
2854
+ * @apiBody string phone? Default (SMS-capable) phone number for the role.
2855
+ * @apiBody string message? Optional message to include in email and SMS signing invitations.
2856
+ * @apiBody integer(min: 1, default: 1) sequence? Optional 1-based sequence number for the role.
2857
+ * @apiBody integer(min: 1, default: 1) order? Optional 1-based order number for the role.
2858
+ * @apiBody boolean delegator? If true, the role may delegate their signing responsibility to another party.
2859
+ * @apiBody string(enum:'pin'|'identity'|'') kba_method? Active PIN- or Identity-based KBA for the role.
2860
+ * @apiSuccess IRole . The newly-created role
2583
2861
  */
2584
2862
  declare const updateTemplateRole: (endpoint: VerdocsEndpoint, template_id: string, name: string, params: Partial<IRole>) => Promise<IRole>;
2585
2863
  /**
@@ -2590,6 +2868,10 @@ declare const updateTemplateRole: (endpoint: VerdocsEndpoint, template_id: strin
2590
2868
  *
2591
2869
  * const profiles = await deleteTemplateRole(VerdocsEndpoint.getDefault(), template_id, name);
2592
2870
  * ```
2871
+ *
2872
+ * @group Roles
2873
+ * @api DELETE /v2/roles/:template_id/:role_id Delete a role.
2874
+ * @apiSuccess string . Success
2593
2875
  */
2594
2876
  declare const deleteTemplateRole: (endpoint: VerdocsEndpoint, template_id: string, name: string) => Promise<any>;
2595
2877
  interface ITemplateTag {
@@ -2705,6 +2987,10 @@ declare const getTemplates: (endpoint: VerdocsEndpoint, params?: IGetTemplatesPa
2705
2987
  *
2706
2988
  * const template = await getTemplate((VerdocsEndpoint.getDefault(), '83da3d70-7857-4392-b876-c4592a304bc9');
2707
2989
  * ```
2990
+ *
2991
+ * @group Templates
2992
+ * @api GET /v2/templates/:template_id Get a template. Note that the caller must have at least View access to the template.
2993
+ * @apiSuccess ITemplate . The requested template
2708
2994
  */
2709
2995
  declare const getTemplate: (endpoint: VerdocsEndpoint, templateId: string) => Promise<ITemplate>;
2710
2996
  /**
@@ -2779,6 +3065,21 @@ interface ITemplateCreateParams {
2779
3065
  *
2780
3066
  * const newTemplate = await createTemplate((VerdocsEndpoint.getDefault(), {...});
2781
3067
  * ```
3068
+ *
3069
+ * @group Templates
3070
+ * @api POST /v2/templates Create a template
3071
+ * @apiBody string name Template name
3072
+ * @apiBody string description? Optional description
3073
+ * @apiBody TTemplateVisibility visibility? Visibility setting
3074
+ * @apiBody boolean is_personal? Deprecated. If true, the template is personal and can only be seen by the caller. (Use "visibility" for new calls.)
3075
+ * @apiBody boolean is_public? Deprecated. If true, the template is public and can be seen by anybody. (Use "visibility" for new calls.)
3076
+ * @apiBody TTemplateSender sender? Who may send envelopes using this template
3077
+ * @apiBody number initial_reminder? Delay (in seconds) before the first reminder is sent (min: 4hrs). Set to 0 or null to disable.
3078
+ * @apiBody number followup_reminders? Delay (in seconds) before the subsequent reminders are sent (min: 12hrs). Set to 0 or null to disable.
3079
+ * @apiBody array(items:object) documents? Optional list of documents to attach to the template
3080
+ * @apiBody array(items:IRole) roles? Optional list of roles to create. Note that if roles are not included in the request, fields will be ignored.
3081
+ * @apiBody array(fields:ITemplateField) fields? Optional list of fields to create. Note that if fields that do not match a role will be ignored.
3082
+ * @apiSuccess ITemplate . The newly-created template
2782
3083
  */
2783
3084
  declare const createTemplate: (endpoint: VerdocsEndpoint, params: ITemplateCreateParams, onUploadProgress?: (percent: number, loadedBytes: number, totalBytes: number) => void) => Promise<ITemplate>;
2784
3085
  /**
@@ -2790,6 +3091,12 @@ declare const createTemplate: (endpoint: VerdocsEndpoint, params: ITemplateCreat
2790
3091
  *
2791
3092
  * const newTemplate = await duplicateTemplate((VerdocsEndpoint.getDefault(), originalTemplateId, 'My Template Copy');
2792
3093
  * ```
3094
+ *
3095
+ * @group Templates
3096
+ * @api PUT /v2/templates/:template_id Perform an operation on a template
3097
+ * @apiBody string(enum:'duplicate') action Action to perform
3098
+ * @apiBody string name? If duplicating the template, a name for the new copy
3099
+ * @apiSuccess ITemplate . The newly-copied template
2793
3100
  */
2794
3101
  declare const duplicateTemplate: (endpoint: VerdocsEndpoint, templateId: string, name: string) => Promise<ITemplate>;
2795
3102
  interface ITemplateCreateFromSharepointParams {
@@ -2814,6 +3121,14 @@ interface ITemplateCreateFromSharepointParams {
2814
3121
  *
2815
3122
  * const newTemplate = await createTemplateFromSharepoint((VerdocsEndpoint.getDefault(), {...});
2816
3123
  * ```
3124
+ *
3125
+ * @group Templates
3126
+ * @api POST /v2/templates/from-sharepoint Create a template from an asset in Sharepoint
3127
+ * @apiBody string name Name for the new template
3128
+ * @apiBody string siteId Name for the new template
3129
+ * @apiBody string itemId Name for the new template
3130
+ * @apiBody string oboToken On-Behalf-Of token for calls to Sharepoint. Should be generated as a short-expiration token with at least Read privileges to the siteId/itemId. This token will be discarded after being used.
3131
+ * @apiSuccess ITemplate . The newly-created template
2817
3132
  */
2818
3133
  declare const createTemplateFromSharepoint: (endpoint: VerdocsEndpoint, params: ITemplateCreateFromSharepointParams) => Promise<ITemplate>;
2819
3134
  /**
@@ -2824,6 +3139,18 @@ declare const createTemplateFromSharepoint: (endpoint: VerdocsEndpoint, params:
2824
3139
  *
2825
3140
  * const updatedTemplate = await updateTemplate((VerdocsEndpoint.getDefault(), '83da3d70-7857-4392-b876-c4592a304bc9', { name: 'New Name' });
2826
3141
  * ```
3142
+ *
3143
+ * @group Templates
3144
+ * @api PATCH /v2/templates/:template_id Update a template
3145
+ * @apiBody string name? Template name
3146
+ * @apiBody string description? Optional description
3147
+ * @apiBody TTemplateVisibility visibility? Visibility setting
3148
+ * @apiBody boolean is_personal? Deprecated. If true, the template is personal and can only be seen by the caller. (Use "visibility" for new calls.)
3149
+ * @apiBody boolean is_public? Deprecated. If true, the template is public and can be seen by anybody. (Use "visibility" for new calls.)
3150
+ * @apiBody TTemplateSender sender? Who may send envelopes using this template
3151
+ * @apiBody number initial_reminder? Delay (in seconds) before the first reminder is sent (min: 4hrs). Set to 0 or null to disable.
3152
+ * @apiBody number followup_reminders? Delay (in seconds) before the subsequent reminders are sent (min: 12hrs). Set to 0 or null to disable.
3153
+ * @apiSuccess ITemplate . The updated template
2827
3154
  */
2828
3155
  declare const updateTemplate: (endpoint: VerdocsEndpoint, templateId: string, params: Partial<ITemplateCreateParams>) => Promise<ITemplate>;
2829
3156
  /**
@@ -2834,8 +3161,12 @@ declare const updateTemplate: (endpoint: VerdocsEndpoint, templateId: string, pa
2834
3161
  *
2835
3162
  * await deleteTemplate((VerdocsEndpoint.getDefault(), '83da3d70-7857-4392-b876-c4592a304bc9');
2836
3163
  * ```
3164
+ *
3165
+ * @group Templates
3166
+ * @api DELETE /v2/templates/:template_id Delete a template
3167
+ * @apiSuccess string . Success
2837
3168
  */
2838
- declare const deleteTemplate: (endpoint: VerdocsEndpoint, templateId: string) => Promise<any>;
3169
+ declare const deleteTemplate: (endpoint: VerdocsEndpoint, templateId: string) => Promise<string>;
2839
3170
  /**
2840
3171
  * Get all the Template Documents associated to a particular Template.
2841
3172
  *
@@ -2844,6 +3175,10 @@ declare const deleteTemplate: (endpoint: VerdocsEndpoint, templateId: string) =>
2844
3175
  *
2845
3176
  * await TemplateDocument.geTemplateDocuments((VerdocsEndpoint.getDefault(), templateId);
2846
3177
  * ```
3178
+ *
3179
+ * @group Template Documents
3180
+ * @api GET /v2/templates/:template_id/documents List the documents assigned to a template
3181
+ * @apiSuccess array(items: ITemplateDocument) . Template documents
2847
3182
  */
2848
3183
  declare const getTemplateDocuments: (endpoint: VerdocsEndpoint, templateId: string) => Promise<ITemplateDocument[]>;
2849
3184
  /**
@@ -2854,6 +3189,10 @@ declare const getTemplateDocuments: (endpoint: VerdocsEndpoint, templateId: stri
2854
3189
  *
2855
3190
  * await TemplateDocument.geTemplateDocument((VerdocsEndpoint.getDefault(), templateId,documentId);
2856
3191
  * ```
3192
+ *
3193
+ * @group Template Documents
3194
+ * @api GET /v2/templates/:template_id/documents/:document_id Get an individual template document
3195
+ * @apiSuccess ITemplateDocument . Template document
2857
3196
  */
2858
3197
  declare const getTemplateDocument: (endpoint: VerdocsEndpoint, templateId: string, documentId: string) => Promise<ITemplateDocument>;
2859
3198
  /**
@@ -2864,6 +3203,11 @@ declare const getTemplateDocument: (endpoint: VerdocsEndpoint, templateId: strin
2864
3203
  *
2865
3204
  * await TemplateDocument.createDocument((VerdocsEndpoint.getDefault(), templateID, params);
2866
3205
  * ```
3206
+ *
3207
+ * @group Template Documents
3208
+ * @api POST /v2/templates/:template_id/documents Attach a document to a template
3209
+ * @apiBody string(format:binary) file Document file to attach. The file name will automatically be used as the document name.
3210
+ * @apiSuccess ITemplateDocument . Template document
2867
3211
  */
2868
3212
  declare const createTemplateDocument: (endpoint: VerdocsEndpoint, templateId: string, file: File, onUploadProgress?: (percent: number, loadedBytes: number, totalBytes: number) => void) => Promise<ITemplateDocument>;
2869
3213
  /**
@@ -2874,6 +3218,10 @@ declare const createTemplateDocument: (endpoint: VerdocsEndpoint, templateId: st
2874
3218
  *
2875
3219
  * await TemplateDocument.deleteDocument((VerdocsEndpoint.getDefault(), templateID, documentID);
2876
3220
  * ```
3221
+ *
3222
+ * @group Template Documents
3223
+ * @api DELETE /v2/templates/:temlate_id/documents/:document_id Delete a template document
3224
+ * @apiSuccess string . Success
2877
3225
  */
2878
3226
  declare const deleteTemplateDocument: (endpoint: VerdocsEndpoint, templateId: string, documentId: string) => Promise<any>;
2879
3227
  /**