export type GetApiV21AccountsAccountIdIdentityVerificationArgs = {accountId: string, identity_verification_workflow_status?: string | undefined}; export type GetApiV21AccountsAccountIdIdentityVerificationOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Retrieves the Identity Verification workflows available to an account. * * GET /v2.1/accounts/{accountId}/identity_verification */ export const getApiV21AccountsAccountIdIdentityVerification = async (args: GetApiV21AccountsAccountIdIdentityVerificationArgs, options?: GetApiV21AccountsAccountIdIdentityVerificationOptions) => { const {baseUrl = "https://www.docusign.net/restapi", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") if (args.identity_verification_workflow_status != null) query.append("identity_verification_workflow_status", String(args.identity_verification_workflow_status)) const url = `${baseUrl.replace(/\/+$/, '')}/v2.1/accounts/${encodeURIComponent(String(args.accountId))}/identity_verification${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return res.blob() };