export type DeleteApiSuperAgentSessionsSessionIdArgs = {sessionId: string}; export type DeleteApiSuperAgentSessionsSessionIdOptions = {baseUrl?: string | undefined, APIKeyHeader?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete Super Agent Session * * DELETE /super-agent/sessions/{sessionId} */ export const deleteApiSuperAgentSessionsSessionId = async (args: DeleteApiSuperAgentSessionsSessionIdArgs, options?: DeleteApiSuperAgentSessionsSessionIdOptions) => { const {baseUrl = "https://api.attention.tech/v2", fetch: fetchFn = fetch, APIKeyHeader} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (APIKeyHeader !== undefined) headers.set("Authorization", APIKeyHeader) const url = `${baseUrl.replace(/\/+$/, '')}/super-agent/sessions/${encodeURIComponent(String(args.sessionId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };