export type CreateApiOauth202603TokenRevokeArgs = {body: {client_id?: string | undefined, client_secret?: string | undefined, token?: string | undefined, token_type_hint?: string | undefined}}; export type CreateApiOauth202603TokenRevokeOptions = {baseUrl?: string | undefined, privateApps?: string | undefined, fetch?: typeof fetch | undefined}; /** * Token Revocation endpoint * * POST /oauth/2026-03/token/revoke * * Also accepts auth: developer_hapikey */ export const createApiOauth202603TokenRevoke = async (args: CreateApiOauth202603TokenRevokeArgs, options?: CreateApiOauth202603TokenRevokeOptions) => { const {baseUrl = "https://api.hubapi.com", fetch: fetchFn = fetch, privateApps} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/x-www-form-urlencoded") headers.set('accept', "*/*") if (privateApps !== undefined) headers.set('authorization', `Bearer ${privateApps}`) const url = `${baseUrl.replace(/\/+$/, '')}/oauth/2026-03/token/revoke${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: new URLSearchParams(Object.entries(args.body).flatMap(([key, value]) => (value == null ? [] : [[key, String(value)]])))}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return res.blob() };