export type CreateApiApiV1LinkedinRecruiterSessionsSignoutArgs = {account_id: string}; export type CreateApiApiV1LinkedinRecruiterSessionsSignoutOptions = {baseUrl?: string | undefined, AccessToken?: string | undefined, fetch?: typeof fetch | undefined}; /** * Sign out of the current Recruiter session * * POST /api/v1/linkedin/recruiter/sessions/signout */ export const createApiApiV1LinkedinRecruiterSessionsSignout = async (args: CreateApiApiV1LinkedinRecruiterSessionsSignoutArgs, options?: CreateApiApiV1LinkedinRecruiterSessionsSignoutOptions) => { const {baseUrl = "https://api1.unipile.com:13111", fetch: fetchFn = fetch, AccessToken} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.account_id != null) query.append("account_id", String(args.account_id)) if (AccessToken !== undefined) headers.set("X-API-KEY", AccessToken) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/linkedin/recruiter/sessions/signout${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };