export type CreateApiAgentmailV0InboxesArgs = {body: {username?: string | undefined, domain?: string | undefined, display_name?: string | undefined, client_id?: string | undefined}}; export type CreateApiAgentmailV0InboxesOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Create a new email inbox. Inboxes cost $2/month. Inboxes with no API activity for 30+ days are automatically deleted. Any request using the inbox resets the inactivity timer. Returns an inbox_id in email format (e.g., myagent@agentmail.to) used for all subsequent operations. If username is omitted, a random one is generated. * * POST /agentmail/v0/inboxes */ export const createApiAgentmailV0Inboxes = async (args: CreateApiAgentmailV0InboxesArgs, options?: CreateApiAgentmailV0InboxesOptions) => { const {baseUrl = "https://api.orthogonal.com/mpp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/agentmail/v0/inboxes${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 };