export type CreateApiUsersUpdateMeArgs = {'X-Phantombuster-Org'?: string | undefined, body: {firstName?: string | undefined, lastName?: string | undefined, phone?: (string | null) | undefined, company?: (string | null) | undefined, job?: (string | null) | undefined, newsletter?: boolean | undefined, enabledExperiments?: (Array<'hubspotWidget' | 'stepSetup' | 'myPhantoms' | 'navbar' | 'seeBetaPhantoms' | 'showCompatiblePhantomsLink' | 'advancedChat'> | null) | undefined, developerMode?: boolean | undefined, userTeam?: (string | null) | undefined, userCompanySize?: (string | null) | undefined, userGoal?: (string | null) | undefined, userMainPlatform?: (string | null) | undefined, userReferralSource?: (string | null) | undefined, userOutboundSalesTeamSize?: (string | null) | undefined, customPromptUser?: (string | null) | undefined}}; export type CreateApiUsersUpdateMeOptions = {baseUrl?: string | undefined, apiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Updates the current user's info. * * POST /users/update-me */ export const createApiUsersUpdateMe = async (args: CreateApiUsersUpdateMeArgs, options?: CreateApiUsersUpdateMeOptions) => { const {baseUrl = "https://api.phantombuster.com/api/v2", fetch: fetchFn = fetch, apiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args['X-Phantombuster-Org'] != null) headers.set("X-Phantombuster-Org", String(args['X-Phantombuster-Org'])) if (apiKeyAuth !== undefined) headers.set("X-Phantombuster-Key", apiKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/users/update-me${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };