Use AgentPhone to provision phone numbers, place outbound voice calls, send SMS or iMessage, and manage contacts and conversations from a workflow. Connect with an AgentPhone API key.
Retrieve call transcripts and conversation history for downstream processing, and check usage before starting more calls or messages.
Provision SMS- and voice-enabled numbers, send messages and tapback reactions, place outbound calls, manage conversations and contacts, and inspect usage with an AgentPhone API key.
Initiate an outbound voice call from an AgentPhone agent
Inputs and outputsParameter Type Required Description apiKeystring Yes AgentPhone API key agentIdstring Yes Agent that will handle the call toNumberstring Yes Phone number to call in E.164 format (e.g. +14155551234) fromNumberIdstring No Phone number ID to use as caller ID. Must belong to the agent. If omitted, the agent's first assigned number is used. initialGreetingstring No Optional greeting spoken when the recipient answers voicestring No Voice ID override for this call (defaults to the agent's configured voice) systemPromptstring No When provided, uses a built-in LLM for the conversation instead of forwarding to your webhook
Parameter Type Description idstring Unique call identifier agentIdstring Agent handling the call statusstring Initial call status toNumberstring Destination phone number fromNumberstring Caller ID used for the call phoneNumberIdstring ID of the phone number used as caller ID directionstring Call direction (outbound) startedAtstring ISO 8601 timestamp
Create a new contact in AgentPhone
Inputs and outputsParameter Type Required Description apiKeystring Yes AgentPhone API key phoneNumberstring Yes Phone number in E.164 format (e.g. +14155551234) namestring Yes Contact's full name emailstring No Contact's email address notesstring No Freeform notes stored on the contact
Parameter Type Description idstring Contact ID phoneNumberstring Phone number in E.164 format namestring Contact name emailstring Contact email address notesstring Freeform notes createdAtstring ISO 8601 creation timestamp updatedAtstring ISO 8601 update timestamp
Provision a new SMS- and voice-enabled phone number
Inputs and outputsParameter Type Required Description apiKeystring Yes AgentPhone API key countrystring No Two-letter country code (e.g. US, CA). Defaults to US. areaCodestring No Preferred area code (US/CA only, e.g. "415"). Best-effort — may be ignored if unavailable. agentIdstring No Optionally attach the number to an agent immediately
Parameter Type Description idstring Unique phone number ID phoneNumberstring Provisioned phone number in E.164 format countrystring Two-letter country code statusstring Number status (e.g. active) typestring Number type (e.g. sms) agentIdstring Agent the number is attached to createdAtstring ISO 8601 timestamp when the number was created
Delete a contact by ID
Inputs and outputsParameter Type Required Description apiKeystring Yes AgentPhone API key contactIdstring Yes Contact ID
Parameter Type Description idstring ID of the deleted contact deletedboolean Whether the contact was deleted successfully
Fetch a call and its full transcript
Inputs and outputsParameter Type Required Description apiKeystring Yes AgentPhone API key callIdstring Yes ID of the call to retrieve
Parameter Type Description idstring Call ID agentIdstring Agent that handled the call phoneNumberIdstring Phone number ID phoneNumberstring Phone number used for the call fromNumberstring Caller phone number toNumberstring Recipient phone number directionstring inbound or outbound statusstring Call status startedAtstring ISO 8601 timestamp endedAtstring ISO 8601 timestamp durationSecondsnumber Call duration in seconds lastTranscriptSnippetstring Last transcript snippet recordingUrlstring Recording audio URL recordingAvailableboolean Whether a recording is available transcriptsarray Ordered transcript turns for the call ↳ id string Transcript turn ID ↳ transcript string User utterance ↳ confidence number Speech recognition confidence ↳ response string Agent response (when available) ↳ createdAt string ISO 8601 timestamp
Get the full ordered transcript for a call
Inputs and outputsParameter Type Required Description apiKeystring Yes AgentPhone API key callIdstring Yes ID of the call to retrieve the transcript for
Parameter Type Description callIdstring Call ID transcriptarray Ordered transcript turns for the call ↳ role string Speaker role (user or agent) ↳ content string Turn content ↳ createdAt string ISO 8601 timestamp
Fetch a single contact by ID
Inputs and outputsParameter Type Required Description apiKeystring Yes AgentPhone API key contactIdstring Yes Contact ID
Parameter Type Description idstring Contact ID phoneNumberstring Phone number in E.164 format namestring Contact name emailstring Contact email address notesstring Freeform notes createdAtstring ISO 8601 creation timestamp updatedAtstring ISO 8601 update timestamp
Get a conversation along with its recent messages
Inputs and outputsParameter Type Required Description apiKeystring Yes AgentPhone API key conversationIdstring Yes Conversation ID messageLimitnumber No Number of recent messages to include (default 50, max 100)
Parameter Type Description idstring Conversation ID agentIdstring Agent ID phoneNumberIdstring Phone number ID phoneNumberstring Phone number participantstring External participant phone number lastMessageAtstring ISO 8601 timestamp messageCountnumber Number of messages in the conversation metadatajson Custom metadata stored on the conversation createdAtstring ISO 8601 timestamp messagesarray Recent messages in the conversation ↳ id string Message ID ↳ body string Message text ↳ fromNumber string Sender phone number ↳ toNumber string Recipient phone number ↳ direction string inbound or outbound ↳ channel string sms, mms, or imessage ↳ mediaUrl string Attached media URL ↳ mediaUrls array All attached media URLs ↳ receivedAt string ISO 8601 timestamp
Get paginated messages for a conversation
Inputs and outputsParameter Type Required Description apiKeystring Yes AgentPhone API key conversationIdstring Yes Conversation ID limitnumber No Number of messages to return (default 50, max 200) beforestring No Return messages received before this ISO 8601 timestamp afterstring No Return messages received after this ISO 8601 timestamp
Parameter Type Description dataarray Messages in the conversation ↳ id string Message ID ↳ body string Message text ↳ fromNumber string Sender phone number ↳ toNumber string Recipient phone number ↳ direction string inbound or outbound ↳ channel string sms, mms, or imessage ↳ mediaUrl string Attached media URL ↳ mediaUrls array All attached media URLs ↳ receivedAt string ISO 8601 timestamp hasMoreboolean Whether more messages are available
Fetch messages received on a specific phone number
Inputs and outputsParameter Type Required Description apiKeystring Yes AgentPhone API key numberIdstring Yes ID of the phone number limitnumber No Number of messages to return (default 50, max 200) beforestring No Return messages received before this ISO 8601 timestamp afterstring No Return messages received after this ISO 8601 timestamp
Parameter Type Description dataarray Messages received on the number ↳ id string Message ID ↳ from_ string Sender phone number (E.164) ↳ to string Recipient phone number (E.164) ↳ body string Message text ↳ direction string inbound or outbound ↳ channel string Channel (sms, mms, etc.) ↳ receivedAt string ISO 8601 timestamp hasMoreboolean Whether more messages are available
Retrieve current usage statistics for the AgentPhone account
Inputs and outputsParameter Type Required Description apiKeystring Yes AgentPhone API key
Parameter Type Description planjson Plan name and limits (name, limits: numbers/messagesPerMonth/voiceMinutesPerMonth/maxCallDurationMinutes/concurrentCalls) numbersjson Phone number usage (used, limit, remaining) statsjson Usage stats: totalMessages, messagesLast24h/7d/30d, totalCalls, callsLast24h/7d/30d, totalWebhookDeliveries, successfulWebhookDeliveries, failedWebhookDeliveries periodStartstring Billing period start periodEndstring Billing period end
Get a daily breakdown of usage (messages, calls, webhooks) for the last N days
Inputs and outputsParameter Type Required Description apiKeystring Yes AgentPhone API key daysnumber No Number of days to return (1-365, default 30)
Parameter Type Description dataarray Daily usage entries ↳ date string Day (YYYY-MM-DD) ↳ messages number Messages that day ↳ calls number Calls that day ↳ webhooks number Webhook deliveries that day daysnumber Number of days returned
Get monthly usage aggregation (messages, calls, webhooks) for the last N months
Inputs and outputsParameter Type Required Description apiKeystring Yes AgentPhone API key monthsnumber No Number of months to return (1-24, default 6)
Parameter Type Description dataarray Monthly usage entries ↳ month string Month (YYYY-MM) ↳ messages number Messages that month ↳ calls number Calls that month ↳ webhooks number Webhook deliveries that month monthsnumber Number of months returned
List voice calls for this AgentPhone account
Inputs and outputsParameter Type Required Description apiKeystring Yes AgentPhone API key limitnumber No Number of results to return (default 20, max 100) offsetnumber No Number of results to skip (min 0) statusstring No Filter by status (completed, in-progress, failed) directionstring No Filter by direction (inbound, outbound) typestring No Filter by call type (pstn, web) searchstring No Search by phone number (matches fromNumber or toNumber)
Parameter Type Description dataarray Calls ↳ id string Call ID ↳ agentId string Agent that handled the call ↳ phoneNumberId string Phone number ID used for the call ↳ phoneNumber string Phone number used for the call ↳ fromNumber string Caller phone number ↳ toNumber string Recipient phone number ↳ direction string inbound or outbound ↳ status string Call status ↳ startedAt string ISO 8601 timestamp ↳ endedAt string ISO 8601 timestamp ↳ durationSeconds number Call duration in seconds ↳ lastTranscriptSnippet string Last transcript snippet ↳ recordingUrl string Recording audio URL ↳ recordingAvailable boolean Whether a recording is available hasMoreboolean Whether more results are available totalnumber Total number of matching calls
List contacts for this AgentPhone account
Inputs and outputsParameter Type Required Description apiKeystring Yes AgentPhone API key searchstring No Filter by name or phone number (case-insensitive contains) limitnumber No Number of results to return (default 50, max 200) offsetnumber No Number of results to skip (min 0)
Parameter Type Description dataarray Contacts ↳ id string Contact ID ↳ phoneNumber string Phone number in E.164 format ↳ name string Contact name ↳ email string Contact email address ↳ notes string Freeform notes ↳ createdAt string ISO 8601 creation timestamp ↳ updatedAt string ISO 8601 update timestamp hasMoreboolean Whether more results are available totalnumber Total number of contacts
List conversations (message threads) for this AgentPhone account
Inputs and outputsParameter Type Required Description apiKeystring Yes AgentPhone API key limitnumber No Number of results to return (default 20, max 100) offsetnumber No Number of results to skip (min 0)
Parameter Type Description dataarray Conversations ↳ id string Conversation ID ↳ agentId string Agent ID ↳ phoneNumberId string Phone number ID ↳ phoneNumber string Phone number ↳ participant string External participant phone number ↳ lastMessageAt string ISO 8601 timestamp ↳ lastMessagePreview string Last message preview ↳ messageCount number Number of messages in the conversation ↳ metadata json Custom metadata stored on the conversation ↳ createdAt string ISO 8601 timestamp hasMoreboolean Whether more results are available totalnumber Total number of conversations
List all phone numbers provisioned for this AgentPhone account
Inputs and outputsParameter Type Required Description apiKeystring Yes AgentPhone API key limitnumber No Number of results to return (default 20, max 100) offsetnumber No Number of results to skip (min 0)
Parameter Type Description dataarray Phone numbers ↳ id string Phone number ID ↳ phoneNumber string Phone number in E.164 format ↳ country string Two-letter country code ↳ status string Number status ↳ type string Number type (e.g. sms) ↳ agentId string Attached agent ID ↳ createdAt string ISO 8601 creation timestamp hasMoreboolean Whether more results are available totalnumber Total number of phone numbers
Send an iMessage tapback reaction to a message (iMessage only)
Inputs and outputsParameter Type Required Description apiKeystring Yes AgentPhone API key messageIdstring Yes ID of the message to react to reactionstring Yes Reaction type: love, like, dislike, laugh, emphasize, or question
Parameter Type Description idstring Reaction ID reactionTypestring Reaction type applied messageIdstring ID of the message that was reacted to channelstring Channel (imessage)
Release (delete) a phone number. This action is irreversible.
Inputs and outputsParameter Type Required Description apiKeystring Yes AgentPhone API key numberIdstring Yes ID of the phone number to release
Parameter Type Description idstring ID of the released phone number releasedboolean Whether the number was released successfully
Send an outbound SMS or iMessage from an AgentPhone agent
Inputs and outputsParameter Type Required Description apiKeystring Yes AgentPhone API key agentIdstring Yes Agent sending the message toNumberstring Yes Recipient phone number in E.164 format (e.g. +14155551234) bodystring Yes Message text to send mediaUrlstring No Optional URL of an image, video, or file to attach numberIdstring No Phone number ID to send from. If omitted, the agent's first assigned number is used.
Parameter Type Description idstring Message ID statusstring Delivery status channelstring sms, mms, or imessage fromNumberstring Sender phone number toNumberstring Recipient phone number
Update a contact's fields
Inputs and outputsParameter Type Required Description apiKeystring Yes AgentPhone API key contactIdstring Yes Contact ID phoneNumberstring No New phone number in E.164 format namestring No New contact name emailstring No New email address notesstring No New freeform notes
Parameter Type Description idstring Contact ID phoneNumberstring Phone number in E.164 format namestring Contact name emailstring Contact email address notesstring Freeform notes createdAtstring ISO 8601 creation timestamp updatedAtstring ISO 8601 update timestamp
Update conversation metadata (stored state). Pass null to clear existing metadata.
Inputs and outputsParameter Type Required Description apiKeystring Yes AgentPhone API key conversationIdstring Yes Conversation ID metadatajson No Custom key-value metadata to store on the conversation. Pass null to clear existing metadata.
Parameter Type Description idstring Conversation ID agentIdstring Agent ID phoneNumberIdstring Phone number ID phoneNumberstring Phone number participantstring External participant phone number lastMessageAtstring ISO 8601 timestamp messageCountnumber Number of messages metadatajson Custom metadata stored on the conversation createdAtstring ISO 8601 timestamp messagesarray Messages in the conversation ↳ id string Message ID ↳ body string Message body ↳ fromNumber string Sender phone number ↳ toNumber string Recipient phone number ↳ direction string inbound or outbound ↳ channel string Channel (sms, mms, etc.) ↳ mediaUrl string Media URL if any ↳ mediaUrls array All attached media URLs ↳ receivedAt string ISO 8601 timestamp