export interface ApiResponse { status?: number; data: T | null; errors: ApiError[] | null; } export interface ApiError { error: string; message: string; } export interface AccountPlan { name: string | null; display_name: string | null; status: "active" | "past_due" | "canceled" | "none"; phone_number: string | null; concurrency: number | null; max_call_duration_minutes: number | null; allowed_countries: string[] | null; current_period_end: string | null; } export interface AccountInfo { status: string; billing: { current_balance: number; refill_to: number | null; }; total_calls: number; /** * Always an object on servers that have the Agent Phone Plan: `status: "none"` with every * other field null when the org has no plan. Absent on servers that predate it, so treat as optional. */ plan?: AccountPlan; } export interface DeviceAuthStart { device_code: string; user_code: string; verification_url: string; verification_url_complete: string; expires_in: number; interval: number; } /** * Optional sign-up pre-fill sent in the /start body. Values pass through as * the caller gave them: the server validates and silently drops anything * invalid, so pre-fill can never block a sign-up. Servers that predate the * field ignore it entirely. */ export interface DeviceAuthPrefill { name?: string; first_name?: string; last_name?: string; email?: string; phone?: string; } export interface DeviceAuthPollPending { status: "pending"; interval: number; expires_in: number; } export interface DeviceAuthPollApproved { status: "approved"; api_key: string; org_id: string; phone_number: string | null; /** * Same shape GET /v1/me returns as `plan`: an object, never a string. Null when the org has no * active agent phone plan. An org that connected on free credits (no plan) gets * `status: "none"` with every other field null, alongside `phone_number: null`. */ plan: AccountPlan | null; client_name: string | null; } export interface DeviceAuthPollExpired { status: "expired"; } export type DeviceAuthPollResult = DeviceAuthPollPending | DeviceAuthPollApproved | DeviceAuthPollExpired; export interface Call { call_id: string; created_at: string; call_length: number; to: string; from: string; completed: boolean; queue_status: string; error_message: string | null; answered_by: string | null; batch_id: string | null; inbound: boolean; pathway_id?: string; } export interface CallDetail extends Call { transcripts: TranscriptEntry[]; summary: string | null; variables: Record; analysis: Record | null; recording_url: string | null; concatenated_transcript: string; status: string; pathway_logs: PathwayLogEntry[] | null; } export interface TranscriptEntry { id: number; created_at: string; text: string; user: "user" | "assistant"; } export interface PathwayLogEntry { node_id: string; node_name?: string; text?: string; timestamp?: string; } export interface CallListResponse { total_count: number; count: number; calls: Call[]; } export interface SendCallParams { phone_number: string; from?: string; task?: string; pathway_id?: string; voice?: string; first_sentence?: string; model?: "base" | "turbo"; max_duration?: number; webhook?: string; request_data?: Record; record?: boolean; transfer_phone_number?: string; persona_id?: string; } export interface PhoneNumber { phone_number: string; area_code: string; country_code: string; created_at: string; pathway_id?: string; persona_id?: string; webhook?: string; prompt?: string; voice?: string; } export interface BuyNumberParams { area_code?: string; country_code?: string; count?: number; } export interface Pathway { id: string; name: string; description?: string; created_at: string; updated_at: string; published_at?: string; production_version_number?: number; nodes: PathwayNode[]; edges: PathwayEdge[]; is_active?: boolean; } export interface PathwayNode { id: string; data: { name: string; prompt?: string; type?: string; isGlobal?: boolean; globalLabel?: string; tools?: unknown[]; extractVars?: ExtractVariable[]; [key: string]: unknown; }; type: string; position: { x: number; y: number; }; } export interface PathwayEdge { id: string; source: string; target: string; data?: { condition?: string; [key: string]: unknown; }; } export interface ExtractVariable { name: string; type: "string" | "integer" | "boolean"; description: string; } export interface PathwayChatSession { chat_id: string; message: string; variables: Record | null; } export interface PathwayChatMessage { chat_id: string; assistant_responses: string[]; current_node_id?: string; current_node_name?: string; chat_history?: Array<{ role: string; content: string; }>; variables?: Record; completed?: boolean; pathway_logs?: PathwayLogEntry[]; } export interface Persona { id: string; name: string; created_at: string; updated_at: string; deleted_at: string | null; inbound_numbers: { phone_number: string; }[]; current_production_version: PersonaVersion | null; current_draft_version: PersonaVersion | null; } export interface PersonaVersion { id: string; version_type: "PRODUCTION" | "DRAFT"; pathway_id?: string; prompt?: string; voice?: string; model?: string; first_sentence?: string; tools?: unknown[]; } export interface Voice { id?: string; voice_id?: string; name?: string; voice_name?: string; is_custom?: boolean; public?: boolean; reduce_latency?: boolean; language?: string; description?: string; tags?: string[]; ratings?: number; service?: string; } export interface CuratedVoice { id: string; name: string; description: string | null; tags: string[]; } export interface Tool { tool_id: string; name: string; description: string; type: string; label?: string | null; url?: string; method?: string; headers?: Record; body?: Record; query?: Record; input_schema?: Record; response?: Record; speech?: string; timeout?: number; public?: boolean; } export interface KnowledgeBase { id: string; name: string; description?: string; status: "PROCESSING" | "COMPLETED" | "FAILED" | "DELETED"; type: string; created_at: string; updated_at: string; } export interface Batch { batch_id: string; created_at: string; status: string; total_calls: number; completed_calls: number; failed_calls: number; } export interface SmsConversation { conversation_id: string; phone_number: string; created_at: string; messages: SmsMessage[]; } export interface SmsMessage { id: string; text: string; sender: "USER" | "AGENT"; created_at: string; } export interface Agent { agent_id: string; prompt: string; voice?: string; pathway_id?: string; language?: string; model?: string; first_sentence?: string; webhook?: string; tools?: unknown[]; } export interface GuardRail { id: string; type: string; name?: string; description?: string; prompt?: string; config?: Record; attachments: GuardRailAttachment[]; created_at: string; } export interface GuardRailAttachment { source_type: "PERSONA" | "PATHWAY" | "INBOUND"; source_id: string; actions: string[]; } export interface Alarm { id: string; metric_type: "latency" | "api_errors" | "call_length"; threshold: number; enabled: boolean; webhook_config?: { url: string; headers?: Record; }; email_addresses?: string[]; sms_numbers?: string[]; created_at: string; } export interface Secret { name: string; created_at: string; } export interface Release { id: string; pathway_id?: string; version?: string; tag?: string; created_at: string; } export interface Widget { id: string; pathway_id?: string; agent_prompt?: string; allowed_domains: string[]; messages_per_minute: number; webhook_url?: string; created_at: string; } export interface Eval { id: string; pathway_id: string; status: string; results?: unknown; created_at: string; } export interface Simulation { id: string; pathway_id: string; status: string; scenario?: string; results?: unknown; created_at: string; } export interface CitationSchema { id: string; name: string; description?: string; schema?: Record; created_at: string; } //# sourceMappingURL=api.d.ts.map