@verdocs/js-sdk 5.0.2 → 5.0.5

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,8 +2558,23 @@ declare const getOrganization: (endpoint: VerdocsEndpoint, organizationId: strin
2395
2558
  *
2396
2559
  * const organization = await createOrganization(VerdocsEndpoint.getDefault(), {name: 'NewOrg'});
2397
2560
  * ```
2398
- */
2399
- 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>;
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.
2573
+ */
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 & {
2575
+ profile: IProfile;
2576
+ organization: IOrganization;
2577
+ }>;
2400
2578
  /**
2401
2579
  * Update an organization. This can only be called by an admin or owner.
2402
2580
  *
@@ -2405,6 +2583,17 @@ declare const createOrganization: (endpoint: VerdocsEndpoint, params: Pick<IOrga
2405
2583
  *
2406
2584
  * const organizations = await updateOrganization(VerdocsEndpoint.getDefault(), organizationId, {name:'ORGNAME'});
2407
2585
  * ```
2586
+ *
2587
+ * @group Organizations
2588
+ * @api PATCH /v2/organizations/:organization_id Update organization
2589
+ * @apiBody string name The name of the new organization
2590
+ * @apiBody string contact_email? Contact email for the new organization
2591
+ * @apiBody string url? URL for the new organization
2592
+ * @apiBody string full_logo_url? URL of a large-format PNG logo
2593
+ * @apiBody string thumbnail_url? URL of a small-format (square is recommended) PNG logo
2594
+ * @apiBody string primary_color? URL of a small-format (square is recommended) PNG logo
2595
+ * @apiBody string secondary_color? URL of a small-format (square is recommended) PNG logo
2596
+ * @apiSuccess IOrganization . The details for the updated organization
2408
2597
  */
2409
2598
  declare const updateOrganization: (endpoint: VerdocsEndpoint, organizationId: string, params: Partial<IOrganization>) => Promise<IOrganization>;
2410
2599
  /**
@@ -2416,18 +2605,28 @@ declare const updateOrganization: (endpoint: VerdocsEndpoint, organizationId: st
2416
2605
  *
2417
2606
  * const newSession = await deleteOrganization(VerdocsEndpoint.getDefault(), organizationId);
2418
2607
  * ```
2608
+ *
2609
+ * @group Organizations
2610
+ * @api DELETE /v2/organizations/:organization_id Delete organization
2611
+ * @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
2612
  */
2420
2613
  declare const deleteOrganization: (endpoint: VerdocsEndpoint, organizationId: string) => Promise<IAuthenticateResponse | null>;
2421
2614
  /**
2422
- * Update the organization's logo. This can only be called by an admin or owner.
2615
+ * Update the organization's full or thumbnail logo. This can only be called by an admin or owner.
2423
2616
  *
2424
2617
  * ```typescript
2425
2618
  * import {updateOrganizationLogo} from '@verdocs/js-sdk';
2426
2619
  *
2427
2620
  * await updateOrganizationLogo((VerdocsEndpoint.getDefault(), organizationId, file);
2428
2621
  * ```
2622
+ *
2623
+ * @group Organizations
2624
+ * @api PATCH /v2/organizations/:organization_id Update organization full or thumbnail logo.
2625
+ * @apiBody image/png logo? Form-url-encoded file to upload
2626
+ * @apiBody image/png thumbnail? Form-url-encoded file to upload
2627
+ * @apiSuccess IOrganization . The updated organization.
2429
2628
  */
2430
- declare const updateOrganizationLogo: (endpoint: VerdocsEndpoint, organizationId: string, file: File, onUploadProgress?: (percent: number, loadedBytes: number, totalBytes: number) => void) => Promise<IProfile>;
2629
+ declare const updateOrganizationLogo: (endpoint: VerdocsEndpoint, organizationId: string, file: File, onUploadProgress?: (percent: number, loadedBytes: number, totalBytes: number) => void) => Promise<IOrganization>;
2431
2630
  /**
2432
2631
  * Update the organization's thumbnail. This can only be called by an admin or owner.
2433
2632
  *
@@ -2437,7 +2636,7 @@ declare const updateOrganizationLogo: (endpoint: VerdocsEndpoint, organizationId
2437
2636
  * await updateOrganizationThumbnail((VerdocsEndpoint.getDefault(), organizationId, file);
2438
2637
  * ```
2439
2638
  */
2440
- declare const updateOrganizationThumbnail: (endpoint: VerdocsEndpoint, organizationId: string, file: File, onUploadProgress?: (percent: number, loadedBytes: number, totalBytes: number) => void) => Promise<IProfile>;
2639
+ declare const updateOrganizationThumbnail: (endpoint: VerdocsEndpoint, organizationId: string, file: File, onUploadProgress?: (percent: number, loadedBytes: number, totalBytes: number) => void) => Promise<IOrganization>;
2441
2640
  /**
2442
2641
  * Get the registered Webhook configuration for the caller's organization.
2443
2642
  *
@@ -2446,6 +2645,10 @@ declare const updateOrganizationThumbnail: (endpoint: VerdocsEndpoint, organizat
2446
2645
  *
2447
2646
  * await getWebhooks(ORGID, params);
2448
2647
  * ```
2648
+ *
2649
+ * @group Webhooks
2650
+ * @api GET /v2/webhooks Get organization Webhooks config
2651
+ * @apiSuccess IWebhook . The current Webhooks config for the caller's organization.
2449
2652
  */
2450
2653
  declare const getWebhooks: (endpoint: VerdocsEndpoint) => Promise<IWebhook>;
2451
2654
  /**
@@ -2458,6 +2661,14 @@ declare const getWebhooks: (endpoint: VerdocsEndpoint) => Promise<IWebhook>;
2458
2661
  *
2459
2662
  * await setWebhooks(ORGID, params);
2460
2663
  * ```
2664
+ *
2665
+ * @group Webhooks
2666
+ * @api PATCH /v2/webhooks Update organization Webhooks config
2667
+ * @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.
2668
+ * @apiBody string url URL to send Webhook events to. An empty or invalid URL will disable Webhook calls.
2669
+ * @apiBody boolean active Set to true to enable Webhooks calls.
2670
+ * @apiBody object events Record<TWebhookEvent, boolean> map of events to enable/disable.
2671
+ * @apiSuccess IWebhook . The updated Webhooks config for the caller's organization.
2461
2672
  */
2462
2673
  declare const setWebhooks: (endpoint: VerdocsEndpoint, params: ISetWebhookRequest) => Promise<IWebhook>;
2463
2674
  declare const canPerformTemplateAction: (profile: IProfile | null | undefined, action: TTemplateAction, template?: ITemplate) => {
@@ -2473,6 +2684,25 @@ declare const hasRequiredPermissions: (profile: IProfile | null | undefined, per
2473
2684
  *
2474
2685
  * await createField((VerdocsEndpoint.getDefault(), template_id, { ... });
2475
2686
  * ```
2687
+ *
2688
+ * @group Fields
2689
+ * @api POST /v2/fields/:template_id Add a field to a template
2690
+ * @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.
2691
+ * @apiBody string role_name Role to assign to the field. Role names must be valid, so it is recommended to create roles before fields.
2692
+ * @apiBody string document_id ID of the document upon which to place the field.
2693
+ * @apiBody string(enum: 'signature' | 'initial' | 'checkbox' | 'radio' | 'textbox' | 'timestamp' | 'date' | 'dropdown' | 'textarea' | 'attachment' | 'payment') type Type of field to create
2694
+ * @apiBody boolean(default: false) required Whether the field is required
2695
+ * @apiBody integer(min: 0) page 0-based page number upon which to place the field
2696
+ * @apiBody integer(min: 0) x X position for the field (left to right)
2697
+ * @apiBody integer(min: 0) y Y position for the field (_bottom to top!_)
2698
+ * @apiBody string label? Optional label to display above the field
2699
+ * @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.
2700
+ * @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.
2701
+ * @apiBody string placeholder? Optional placeholder to display in text fields
2702
+ * @apiBody string group? For fields that support grouping (radio buttons and check boxes) the value selected will be stored under this name
2703
+ * @apiBody array(items:IDropdownOption) options? For dropdown fields, the options to display
2704
+ * @apiBody string value? Optional default value to set on the field
2705
+ * @apiSuccess ITemplateField . Template field
2476
2706
  */
2477
2707
  declare const createField: (endpoint: VerdocsEndpoint, templateId: string, params: ITemplateField) => Promise<ITemplateField>;
2478
2708
  /**
@@ -2483,6 +2713,25 @@ declare const createField: (endpoint: VerdocsEndpoint, templateId: string, param
2483
2713
  *
2484
2714
  * await updateField((VerdocsEndpoint.getDefault(), template_id, field_name, { ... });
2485
2715
  * ```
2716
+ *
2717
+ * @group Fields
2718
+ * @api PATCH /v2/fields/:template_id/:field_name Update a field. See createField for additional details on the supported parameters.
2719
+ * @apiBody string name? Rename the field. Note that template field names must be unique within a template.
2720
+ * @apiBody string role_name Role to assign to the field.
2721
+ * @apiBody string document_id ID of the document upon which to place the field.
2722
+ * @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.
2723
+ * @apiBody boolean(default: false) required? Whether the field is required
2724
+ * @apiBody integer(min: 0) page? 0-based page number upon which to place the field
2725
+ * @apiBody integer(min: 0) x? X position for the field (left to right)
2726
+ * @apiBody integer(min: 0) y? Y position for the field (_bottom to top!_)
2727
+ * @apiBody string label? Optional label to display above the field
2728
+ * @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.
2729
+ * @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.
2730
+ * @apiBody string placeholder? Optional placeholder to display in text fields
2731
+ * @apiBody string group? For fields that support grouping (radio buttons and check boxes) the value selected will be stored under this name
2732
+ * @apiBody array(items:IDropdownOption) options? For dropdown fields, the options to display
2733
+ * @apiBody string value? Optional default value to set on the field
2734
+ * @apiSuccess ITemplateField . Updated template field
2486
2735
  */
2487
2736
  declare const updateField: (endpoint: VerdocsEndpoint, templateId: string, name: string, params: Partial<ITemplateField>) => Promise<ITemplateField>;
2488
2737
  /**
@@ -2493,6 +2742,10 @@ declare const updateField: (endpoint: VerdocsEndpoint, templateId: string, name:
2493
2742
  *
2494
2743
  * await deleteField((VerdocsEndpoint.getDefault(), template_id, field_name);
2495
2744
  * ```
2745
+ *
2746
+ * @group Fields
2747
+ * @api DELETE /v2/fields/:template_id/:field_name Delete a field
2748
+ * @apiSuccess string . Success
2496
2749
  */
2497
2750
  declare const deleteField: (endpoint: VerdocsEndpoint, templateId: string, name: string) => Promise<any>;
2498
2751
  /**
@@ -2570,6 +2823,20 @@ declare const userCanPreviewTemplate: (profile: IProfile | null | undefined, tem
2570
2823
  *
2571
2824
  * const role = await createTemplateRole(VerdocsEndpoint.getDefault(), template_id, params...);
2572
2825
  * ```
2826
+ *
2827
+ * @group Roles
2828
+ * @api POST /v2/roles/:template_id Add a role to a template
2829
+ * @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.
2830
+ * @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.
2831
+ * @apiBody string full_name? Default full name for the role. May be completed/overridden later, when envelopes are made from the template.
2832
+ * @apiBody string email? Default email address for the role. May be completed/overridden later, when envelopes are made from the template.
2833
+ * @apiBody string phone? Default (SMS-capable) phone number for the role. May be completed/overridden later, when envelopes are made from the template.
2834
+ * @apiBody string message? Optional message to include in email and SMS signing invitations.
2835
+ * @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.
2836
+ * @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 />`.
2837
+ * @apiBody boolean delegator? If true, the role may delegate their signing responsibility to another party.
2838
+ * @apiBody string(enum:'pin'|'identity'|'') kba_method? Active PIN- or Identity-based KBA for the role. NOTE: Some KBA operations may incur additional fees.
2839
+ * @apiSuccess IRole . The newly-created role
2573
2840
  */
2574
2841
  declare const createTemplateRole: (endpoint: VerdocsEndpoint, template_id: string, params: IRole) => Promise<IRole>;
2575
2842
  /**
@@ -2580,6 +2847,20 @@ declare const createTemplateRole: (endpoint: VerdocsEndpoint, template_id: strin
2580
2847
  *
2581
2848
  * const role = await updateTemplateRole(VerdocsEndpoint.getDefault(), template_id, name, params...);
2582
2849
  * ```
2850
+ *
2851
+ * @group Roles
2852
+ * @api PATCH /v2/roles/:template_id/:role_id Update a role. See createRole for additional details on the parameters available.
2853
+ * @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.
2854
+ * @apiBody string(enum:'signer' | 'cc' | 'approver') type? Type of role.
2855
+ * @apiBody string full_name? Default full name for the role.
2856
+ * @apiBody string email? Default email address for the role.
2857
+ * @apiBody string phone? Default (SMS-capable) phone number for the role.
2858
+ * @apiBody string message? Optional message to include in email and SMS signing invitations.
2859
+ * @apiBody integer(min: 1, default: 1) sequence? Optional 1-based sequence number for the role.
2860
+ * @apiBody integer(min: 1, default: 1) order? Optional 1-based order number for the role.
2861
+ * @apiBody boolean delegator? If true, the role may delegate their signing responsibility to another party.
2862
+ * @apiBody string(enum:'pin'|'identity'|'') kba_method? Active PIN- or Identity-based KBA for the role.
2863
+ * @apiSuccess IRole . The newly-created role
2583
2864
  */
2584
2865
  declare const updateTemplateRole: (endpoint: VerdocsEndpoint, template_id: string, name: string, params: Partial<IRole>) => Promise<IRole>;
2585
2866
  /**
@@ -2590,6 +2871,10 @@ declare const updateTemplateRole: (endpoint: VerdocsEndpoint, template_id: strin
2590
2871
  *
2591
2872
  * const profiles = await deleteTemplateRole(VerdocsEndpoint.getDefault(), template_id, name);
2592
2873
  * ```
2874
+ *
2875
+ * @group Roles
2876
+ * @api DELETE /v2/roles/:template_id/:role_id Delete a role.
2877
+ * @apiSuccess string . Success
2593
2878
  */
2594
2879
  declare const deleteTemplateRole: (endpoint: VerdocsEndpoint, template_id: string, name: string) => Promise<any>;
2595
2880
  interface ITemplateTag {
@@ -2705,6 +2990,10 @@ declare const getTemplates: (endpoint: VerdocsEndpoint, params?: IGetTemplatesPa
2705
2990
  *
2706
2991
  * const template = await getTemplate((VerdocsEndpoint.getDefault(), '83da3d70-7857-4392-b876-c4592a304bc9');
2707
2992
  * ```
2993
+ *
2994
+ * @group Templates
2995
+ * @api GET /v2/templates/:template_id Get a template. Note that the caller must have at least View access to the template.
2996
+ * @apiSuccess ITemplate . The requested template
2708
2997
  */
2709
2998
  declare const getTemplate: (endpoint: VerdocsEndpoint, templateId: string) => Promise<ITemplate>;
2710
2999
  /**
@@ -2779,6 +3068,21 @@ interface ITemplateCreateParams {
2779
3068
  *
2780
3069
  * const newTemplate = await createTemplate((VerdocsEndpoint.getDefault(), {...});
2781
3070
  * ```
3071
+ *
3072
+ * @group Templates
3073
+ * @api POST /v2/templates Create a template
3074
+ * @apiBody string name Template name
3075
+ * @apiBody string description? Optional description
3076
+ * @apiBody TTemplateVisibility visibility? Visibility setting
3077
+ * @apiBody boolean is_personal? Deprecated. If true, the template is personal and can only be seen by the caller. (Use "visibility" for new calls.)
3078
+ * @apiBody boolean is_public? Deprecated. If true, the template is public and can be seen by anybody. (Use "visibility" for new calls.)
3079
+ * @apiBody TTemplateSender sender? Who may send envelopes using this template
3080
+ * @apiBody number initial_reminder? Delay (in seconds) before the first reminder is sent (min: 4hrs). Set to 0 or null to disable.
3081
+ * @apiBody number followup_reminders? Delay (in seconds) before the subsequent reminders are sent (min: 12hrs). Set to 0 or null to disable.
3082
+ * @apiBody array(items:object) documents? Optional list of documents to attach to the template
3083
+ * @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.
3084
+ * @apiBody array(fields:ITemplateField) fields? Optional list of fields to create. Note that if fields that do not match a role will be ignored.
3085
+ * @apiSuccess ITemplate . The newly-created template
2782
3086
  */
2783
3087
  declare const createTemplate: (endpoint: VerdocsEndpoint, params: ITemplateCreateParams, onUploadProgress?: (percent: number, loadedBytes: number, totalBytes: number) => void) => Promise<ITemplate>;
2784
3088
  /**
@@ -2790,6 +3094,12 @@ declare const createTemplate: (endpoint: VerdocsEndpoint, params: ITemplateCreat
2790
3094
  *
2791
3095
  * const newTemplate = await duplicateTemplate((VerdocsEndpoint.getDefault(), originalTemplateId, 'My Template Copy');
2792
3096
  * ```
3097
+ *
3098
+ * @group Templates
3099
+ * @api PUT /v2/templates/:template_id Perform an operation on a template
3100
+ * @apiBody string(enum:'duplicate') action Action to perform
3101
+ * @apiBody string name? If duplicating the template, a name for the new copy
3102
+ * @apiSuccess ITemplate . The newly-copied template
2793
3103
  */
2794
3104
  declare const duplicateTemplate: (endpoint: VerdocsEndpoint, templateId: string, name: string) => Promise<ITemplate>;
2795
3105
  interface ITemplateCreateFromSharepointParams {
@@ -2814,6 +3124,14 @@ interface ITemplateCreateFromSharepointParams {
2814
3124
  *
2815
3125
  * const newTemplate = await createTemplateFromSharepoint((VerdocsEndpoint.getDefault(), {...});
2816
3126
  * ```
3127
+ *
3128
+ * @group Templates
3129
+ * @api POST /v2/templates/from-sharepoint Create a template from an asset in Sharepoint
3130
+ * @apiBody string name Name for the new template
3131
+ * @apiBody string siteId Name for the new template
3132
+ * @apiBody string itemId Name for the new template
3133
+ * @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.
3134
+ * @apiSuccess ITemplate . The newly-created template
2817
3135
  */
2818
3136
  declare const createTemplateFromSharepoint: (endpoint: VerdocsEndpoint, params: ITemplateCreateFromSharepointParams) => Promise<ITemplate>;
2819
3137
  /**
@@ -2824,6 +3142,18 @@ declare const createTemplateFromSharepoint: (endpoint: VerdocsEndpoint, params:
2824
3142
  *
2825
3143
  * const updatedTemplate = await updateTemplate((VerdocsEndpoint.getDefault(), '83da3d70-7857-4392-b876-c4592a304bc9', { name: 'New Name' });
2826
3144
  * ```
3145
+ *
3146
+ * @group Templates
3147
+ * @api PATCH /v2/templates/:template_id Update a template
3148
+ * @apiBody string name? Template name
3149
+ * @apiBody string description? Optional description
3150
+ * @apiBody TTemplateVisibility visibility? Visibility setting
3151
+ * @apiBody boolean is_personal? Deprecated. If true, the template is personal and can only be seen by the caller. (Use "visibility" for new calls.)
3152
+ * @apiBody boolean is_public? Deprecated. If true, the template is public and can be seen by anybody. (Use "visibility" for new calls.)
3153
+ * @apiBody TTemplateSender sender? Who may send envelopes using this template
3154
+ * @apiBody number initial_reminder? Delay (in seconds) before the first reminder is sent (min: 4hrs). Set to 0 or null to disable.
3155
+ * @apiBody number followup_reminders? Delay (in seconds) before the subsequent reminders are sent (min: 12hrs). Set to 0 or null to disable.
3156
+ * @apiSuccess ITemplate . The updated template
2827
3157
  */
2828
3158
  declare const updateTemplate: (endpoint: VerdocsEndpoint, templateId: string, params: Partial<ITemplateCreateParams>) => Promise<ITemplate>;
2829
3159
  /**
@@ -2834,8 +3164,12 @@ declare const updateTemplate: (endpoint: VerdocsEndpoint, templateId: string, pa
2834
3164
  *
2835
3165
  * await deleteTemplate((VerdocsEndpoint.getDefault(), '83da3d70-7857-4392-b876-c4592a304bc9');
2836
3166
  * ```
3167
+ *
3168
+ * @group Templates
3169
+ * @api DELETE /v2/templates/:template_id Delete a template
3170
+ * @apiSuccess string . Success
2837
3171
  */
2838
- declare const deleteTemplate: (endpoint: VerdocsEndpoint, templateId: string) => Promise<any>;
3172
+ declare const deleteTemplate: (endpoint: VerdocsEndpoint, templateId: string) => Promise<string>;
2839
3173
  /**
2840
3174
  * Get all the Template Documents associated to a particular Template.
2841
3175
  *
@@ -2844,6 +3178,10 @@ declare const deleteTemplate: (endpoint: VerdocsEndpoint, templateId: string) =>
2844
3178
  *
2845
3179
  * await TemplateDocument.geTemplateDocuments((VerdocsEndpoint.getDefault(), templateId);
2846
3180
  * ```
3181
+ *
3182
+ * @group Template Documents
3183
+ * @api GET /v2/templates/:template_id/documents List the documents assigned to a template
3184
+ * @apiSuccess array(items: ITemplateDocument) . Template documents
2847
3185
  */
2848
3186
  declare const getTemplateDocuments: (endpoint: VerdocsEndpoint, templateId: string) => Promise<ITemplateDocument[]>;
2849
3187
  /**
@@ -2854,6 +3192,10 @@ declare const getTemplateDocuments: (endpoint: VerdocsEndpoint, templateId: stri
2854
3192
  *
2855
3193
  * await TemplateDocument.geTemplateDocument((VerdocsEndpoint.getDefault(), templateId,documentId);
2856
3194
  * ```
3195
+ *
3196
+ * @group Template Documents
3197
+ * @api GET /v2/templates/:template_id/documents/:document_id Get an individual template document
3198
+ * @apiSuccess ITemplateDocument . Template document
2857
3199
  */
2858
3200
  declare const getTemplateDocument: (endpoint: VerdocsEndpoint, templateId: string, documentId: string) => Promise<ITemplateDocument>;
2859
3201
  /**
@@ -2864,6 +3206,11 @@ declare const getTemplateDocument: (endpoint: VerdocsEndpoint, templateId: strin
2864
3206
  *
2865
3207
  * await TemplateDocument.createDocument((VerdocsEndpoint.getDefault(), templateID, params);
2866
3208
  * ```
3209
+ *
3210
+ * @group Template Documents
3211
+ * @api POST /v2/templates/:template_id/documents Attach a document to a template
3212
+ * @apiBody string(format:binary) file Document file to attach. The file name will automatically be used as the document name.
3213
+ * @apiSuccess ITemplateDocument . Template document
2867
3214
  */
2868
3215
  declare const createTemplateDocument: (endpoint: VerdocsEndpoint, templateId: string, file: File, onUploadProgress?: (percent: number, loadedBytes: number, totalBytes: number) => void) => Promise<ITemplateDocument>;
2869
3216
  /**
@@ -2874,6 +3221,10 @@ declare const createTemplateDocument: (endpoint: VerdocsEndpoint, templateId: st
2874
3221
  *
2875
3222
  * await TemplateDocument.deleteDocument((VerdocsEndpoint.getDefault(), templateID, documentID);
2876
3223
  * ```
3224
+ *
3225
+ * @group Template Documents
3226
+ * @api DELETE /v2/templates/:temlate_id/documents/:document_id Delete a template document
3227
+ * @apiSuccess string . Success
2877
3228
  */
2878
3229
  declare const deleteTemplateDocument: (endpoint: VerdocsEndpoint, templateId: string, documentId: string) => Promise<any>;
2879
3230
  /**