AptlyStar

AgentPhone

Provision numbers, send SMS and iMessage, and place voice calls with AgentPhone

Nutzungsanweisungen

Give your workflow a phone. Provision SMS- and voice-enabled numbers, send messages and tapback reactions, place outbound voice calls, manage conversations and contacts, and track usage — all through a single AgentPhone API key.

Tools

agentphone_create_call

Initiate an outbound voice call from an AgentPhone agent

Eingabe

ParameterTypErforderlichBeschreibung
apiKeystringJaAgentPhone API key
agentIdstringJaAgent that will handle the call
toNumberstringJaPhone number to call in E.164 format (e.g. +14155551234)
fromNumberIdstringNeinPhone number ID to use as caller ID. Must belong to the agent. If omitted, the agent's first assigned number is used.
initialGreetingstringNeinOptional greeting spoken when the recipient answers
voicestringNeinVoice ID override for this call (defaults to the agent's configured voice)
systemPromptstringNeinWhen provided, uses a built-in LLM for the conversation instead of forwarding to your webhook

Ausgabe

ParameterTypBeschreibung
idstringUnique call identifier
agentIdstringAgent handling the call
statusstringInitial call status
toNumberstringDestination phone number
fromNumberstringCaller ID used for the call
phoneNumberIdstringID of the phone number used as caller ID
directionstringCall direction (outbound)
startedAtstringISO 8601 timestamp

agentphone_create_contact

Create a new contact in AgentPhone

Eingabe

ParameterTypErforderlichBeschreibung
apiKeystringJaAgentPhone API key
phoneNumberstringJaPhone number in E.164 format (e.g. +14155551234)
namestringJaContact's full name
emailstringNeinContact's email address
notesstringNeinFreeform notes stored on the contact

Ausgabe

ParameterTypBeschreibung
idstringContact ID
phoneNumberstringPhone number in E.164 format
namestringContact name
emailstringContact email address
notesstringFreeform notes
createdAtstringISO 8601 creation timestamp
updatedAtstringISO 8601 update timestamp

agentphone_create_number

Provision a new SMS- and voice-enabled phone number

Eingabe

ParameterTypErforderlichBeschreibung
apiKeystringJaAgentPhone API key
countrystringNeinTwo-letter country code (e.g. US, CA). Defaults to US.
areaCodestringNeinPreferred area code (US/CA only, e.g. "415"). Best-effort — may be ignored if unavailable.
agentIdstringNeinOptionally attach the number to an agent immediately

Ausgabe

ParameterTypBeschreibung
idstringUnique phone number ID
phoneNumberstringProvisioned phone number in E.164 format
countrystringTwo-letter country code
statusstringNumber status (e.g. active)
typestringNumber type (e.g. sms)
agentIdstringAgent the number is attached to
createdAtstringISO 8601 timestamp when the number was created

agentphone_delete_contact

Delete a contact by ID

Eingabe

ParameterTypErforderlichBeschreibung
apiKeystringJaAgentPhone API key
contactIdstringJaContact ID

Ausgabe

ParameterTypBeschreibung
idstringID of the deleted contact
deletedbooleanWhether the contact was deleted successfully

agentphone_get_call

Fetch a call and its full transcript

Eingabe

ParameterTypErforderlichBeschreibung
apiKeystringJaAgentPhone API key
callIdstringJaID of the call to retrieve

Ausgabe

ParameterTypBeschreibung
idstringCall ID
agentIdstringAgent that handled the call
phoneNumberIdstringPhone number ID
phoneNumberstringPhone number used for the call
fromNumberstringCaller phone number
toNumberstringRecipient phone number
directionstringinbound or outbound
statusstringCall status
startedAtstringISO 8601 timestamp
endedAtstringISO 8601 timestamp
durationSecondsnumberCall duration in seconds
lastTranscriptSnippetstringLast transcript snippet
recordingUrlstringRecording audio URL
recordingAvailablebooleanWhether a recording is available
transcriptsarrayOrdered transcript turns for the call
↳ idstringTranscript turn ID
↳ transcriptstringUser utterance
↳ confidencenumberSpeech recognition confidence
↳ responsestringAgent response (when available)
↳ createdAtstringISO 8601 timestamp

agentphone_get_call_transcript

Get the full ordered transcript for a call

Eingabe

ParameterTypErforderlichBeschreibung
apiKeystringJaAgentPhone API key
callIdstringJaID of the call to retrieve the transcript for

Ausgabe

ParameterTypBeschreibung
callIdstringCall ID
transcriptarrayOrdered transcript turns for the call
↳ rolestringSpeaker role (user or agent)
↳ contentstringTurn content
↳ createdAtstringISO 8601 timestamp

agentphone_get_contact

Fetch a single contact by ID

Eingabe

ParameterTypErforderlichBeschreibung
apiKeystringJaAgentPhone API key
contactIdstringJaContact ID

Ausgabe

ParameterTypBeschreibung
idstringContact ID
phoneNumberstringPhone number in E.164 format
namestringContact name
emailstringContact email address
notesstringFreeform notes
createdAtstringISO 8601 creation timestamp
updatedAtstringISO 8601 update timestamp

agentphone_get_conversation

Get a conversation along with its recent messages

Eingabe

ParameterTypErforderlichBeschreibung
apiKeystringJaAgentPhone API key
conversationIdstringJaConversation ID
messageLimitnumberNeinNumber of recent messages to include (default 50, max 100)

Ausgabe

ParameterTypBeschreibung
idstringConversation ID
agentIdstringAgent ID
phoneNumberIdstringPhone number ID
phoneNumberstringPhone number
participantstringExternal participant phone number
lastMessageAtstringISO 8601 timestamp
messageCountnumberNumber of messages in the conversation
metadatajsonCustom metadata stored on the conversation
createdAtstringISO 8601 timestamp
messagesarrayRecent messages in the conversation
↳ idstringMessage ID
↳ bodystringMessage text
↳ fromNumberstringSender phone number
↳ toNumberstringRecipient phone number
↳ directionstringinbound or outbound
↳ channelstringsms, mms, or imessage
↳ mediaUrlstringAttached media URL
↳ receivedAtstringISO 8601 timestamp

agentphone_get_conversation_messages

Get paginated messages for a conversation

Eingabe

ParameterTypErforderlichBeschreibung
apiKeystringJaAgentPhone API key
conversationIdstringJaConversation ID
limitnumberNeinNumber of messages to return (default 50, max 200)
beforestringNeinReturn messages received before this ISO 8601 timestamp
afterstringNeinReturn messages received after this ISO 8601 timestamp

Ausgabe

ParameterTypBeschreibung
dataarrayMessages in the conversation
↳ idstringMessage ID
↳ bodystringMessage text
↳ fromNumberstringSender phone number
↳ toNumberstringRecipient phone number
↳ directionstringinbound or outbound
↳ channelstringsms, mms, or imessage
↳ mediaUrlstringAttached media URL
↳ receivedAtstringISO 8601 timestamp
hasMorebooleanWhether more messages are available

agentphone_get_number_messages

Fetch messages received on a specific phone number

Eingabe

ParameterTypErforderlichBeschreibung
apiKeystringJaAgentPhone API key
numberIdstringJaID of the phone number
limitnumberNeinNumber of messages to return (default 50, max 200)
beforestringNeinReturn messages received before this ISO 8601 timestamp
afterstringNeinReturn messages received after this ISO 8601 timestamp

Ausgabe

ParameterTypBeschreibung
dataarrayMessages received on the number
↳ idstringMessage ID
↳ from_stringSender phone number (E.164)
↳ tostringRecipient phone number (E.164)
↳ bodystringMessage text
↳ directionstringinbound or outbound
↳ channelstringChannel (sms, mms, etc.)
↳ receivedAtstringISO 8601 timestamp
hasMorebooleanWhether more messages are available

agentphone_get_usage

Retrieve current usage statistics for the AgentPhone account

Eingabe

ParameterTypErforderlichBeschreibung
apiKeystringJaAgentPhone API key

Ausgabe

ParameterTypBeschreibung
planjsonPlan name and limits (name, limits: numbers/messagesPerMonth/voiceMinutesPerMonth/maxCallDurationMinutes/concurrentCalls)
numbersjsonPhone number usage (used, limit, remaining)
statsjsonUsage stats: totalMessages, messagesLast24h/7d/30d, totalCalls, callsLast24h/7d/30d, totalWebhookDeliveries, successfulWebhookDeliveries, failedWebhookDeliveries
periodStartstringBilling period start
periodEndstringBilling period end

agentphone_get_usage_daily

Get a daily breakdown of usage (messages, calls, webhooks) for the last N days

Eingabe

ParameterTypErforderlichBeschreibung
apiKeystringJaAgentPhone API key
daysnumberNeinNumber of days to return (1-365, default 30)

Ausgabe

ParameterTypBeschreibung
dataarrayDaily usage entries
↳ datestringDay (YYYY-MM-DD)
↳ messagesnumberMessages that day
↳ callsnumberCalls that day
↳ webhooksnumberWebhook deliveries that day
daysnumberNumber of days returned

agentphone_get_usage_monthly

Get monthly usage aggregation (messages, calls, webhooks) for the last N months

Eingabe

ParameterTypErforderlichBeschreibung
apiKeystringJaAgentPhone API key
monthsnumberNeinNumber of months to return (1-24, default 6)

Ausgabe

ParameterTypBeschreibung
dataarrayMonthly usage entries
↳ monthstringMonth (YYYY-MM)
↳ messagesnumberMessages that month
↳ callsnumberCalls that month
↳ webhooksnumberWebhook deliveries that month
monthsnumberNumber of months returned

agentphone_list_calls

List voice calls for this AgentPhone account

Eingabe

ParameterTypErforderlichBeschreibung
apiKeystringJaAgentPhone API key
limitnumberNeinNumber of results to return (default 20, max 100)
offsetnumberNeinNumber of results to skip (min 0)
statusstringNeinFilter by status (completed, in-progress, failed)
directionstringNeinFilter by direction (inbound, outbound)
typestringNeinFilter by call type (pstn, web)
searchstringNeinSearch by phone number (matches fromNumber or toNumber)

Ausgabe

ParameterTypBeschreibung
dataarrayCalls
↳ idstringCall ID
↳ agentIdstringAgent that handled the call
↳ phoneNumberIdstringPhone number ID used for the call
↳ phoneNumberstringPhone number used for the call
↳ fromNumberstringCaller phone number
↳ toNumberstringRecipient phone number
↳ directionstringinbound or outbound
↳ statusstringCall status
↳ startedAtstringISO 8601 timestamp
↳ endedAtstringISO 8601 timestamp
↳ durationSecondsnumberCall duration in seconds
↳ lastTranscriptSnippetstringLast transcript snippet
↳ recordingUrlstringRecording audio URL
↳ recordingAvailablebooleanWhether a recording is available
hasMorebooleanWhether more results are available
totalnumberTotal number of matching calls

agentphone_list_contacts

List contacts for this AgentPhone account

Eingabe

ParameterTypErforderlichBeschreibung
apiKeystringJaAgentPhone API key
searchstringNeinFilter by name or phone number (case-insensitive contains)
limitnumberNeinNumber of results to return (default 50)
offsetnumberNeinNumber of results to skip (min 0)

Ausgabe

ParameterTypBeschreibung
dataarrayContacts
↳ idstringContact ID
↳ phoneNumberstringPhone number in E.164 format
↳ namestringContact name
↳ emailstringContact email address
↳ notesstringFreeform notes
↳ createdAtstringISO 8601 creation timestamp
↳ updatedAtstringISO 8601 update timestamp
hasMorebooleanWhether more results are available
totalnumberTotal number of contacts

agentphone_list_conversations

List conversations (message threads) for this AgentPhone account

Eingabe

ParameterTypErforderlichBeschreibung
apiKeystringJaAgentPhone API key
limitnumberNeinNumber of results to return (default 20, max 100)
offsetnumberNeinNumber of results to skip (min 0)

Ausgabe

ParameterTypBeschreibung
dataarrayConversations
↳ idstringConversation ID
↳ agentIdstringAgent ID
↳ phoneNumberIdstringPhone number ID
↳ phoneNumberstringPhone number
↳ participantstringExternal participant phone number
↳ lastMessageAtstringISO 8601 timestamp
↳ lastMessagePreviewstringLast message preview
↳ messageCountnumberNumber of messages in the conversation
↳ metadatajsonCustom metadata stored on the conversation
↳ createdAtstringISO 8601 timestamp
hasMorebooleanWhether more results are available
totalnumberTotal number of conversations

agentphone_list_numbers

List all phone numbers provisioned for this AgentPhone account

Eingabe

ParameterTypErforderlichBeschreibung
apiKeystringJaAgentPhone API key
limitnumberNeinNumber of results to return (default 20, max 100)
offsetnumberNeinNumber of results to skip (min 0)

Ausgabe

ParameterTypBeschreibung
dataarrayPhone numbers
↳ idstringPhone number ID
↳ phoneNumberstringPhone number in E.164 format
↳ countrystringTwo-letter country code
↳ statusstringNumber status
↳ typestringNumber type (e.g. sms)
↳ agentIdstringAttached agent ID
↳ createdAtstringISO 8601 creation timestamp
hasMorebooleanWhether more results are available
totalnumberTotal number of phone numbers

agentphone_react_to_message

Send an iMessage tapback reaction to a message (iMessage only)

Eingabe

ParameterTypErforderlichBeschreibung
apiKeystringJaAgentPhone API key
messageIdstringJaID of the message to react to
reactionstringJaReaction type: love, like, dislike, laugh, emphasize, or question

Ausgabe

ParameterTypBeschreibung
idstringReaction ID
reactionTypestringReaction type applied
messageIdstringID of the message that was reacted to
channelstringChannel (imessage)

agentphone_release_number

Release (delete) a phone number. This action is irreversible.

Eingabe

ParameterTypErforderlichBeschreibung
apiKeystringJaAgentPhone API key
numberIdstringJaID of the phone number to release

Ausgabe

ParameterTypBeschreibung
idstringID of the released phone number
releasedbooleanWhether the number was released successfully

agentphone_send_message

Send an outbound SMS or iMessage from an AgentPhone agent

Eingabe

ParameterTypErforderlichBeschreibung
apiKeystringJaAgentPhone API key
agentIdstringJaAgent sending the message
toNumberstringJaRecipient phone number in E.164 format (e.g. +14155551234)
bodystringJaMessage text to send
mediaUrlstringNeinOptional URL of an image, video, or file to attach
numberIdstringNeinPhone number ID to send from. If omitted, the agent's first assigned number is used.

Ausgabe

ParameterTypBeschreibung
idstringMessage ID
statusstringDelivery status
channelstringsms, mms, or imessage
fromNumberstringSender phone number
toNumberstringRecipient phone number

agentphone_update_contact

Update a contact

Eingabe

ParameterTypErforderlichBeschreibung
apiKeystringJaAgentPhone API key
contactIdstringJaContact ID
phoneNumberstringNeinNew phone number in E.164 format
namestringNeinNew contact name
emailstringNeinNew email address
notesstringNeinNew freeform notes

Ausgabe

ParameterTypBeschreibung
idstringContact ID
phoneNumberstringPhone number in E.164 format
namestringContact name
emailstringContact email address
notesstringFreeform notes
createdAtstringISO 8601 creation timestamp
updatedAtstringISO 8601 update timestamp

agentphone_update_conversation

Update conversation metadata (stored state). Pass null to clear existing metadata.

Eingabe

ParameterTypErforderlichBeschreibung
apiKeystringJaAgentPhone API key
conversationIdstringJaConversation ID
metadatajsonNeinCustom key-value metadata to store on the conversation. Pass null to clear existing metadata.

Ausgabe

ParameterTypBeschreibung
idstringConversation ID
agentIdstringAgent ID
phoneNumberIdstringPhone number ID
phoneNumberstringPhone number
participantstringExternal participant phone number
lastMessageAtstringISO 8601 timestamp
messageCountnumberNumber of messages
metadatajsonCustom metadata stored on the conversation
createdAtstringISO 8601 timestamp
messagesarrayMessages in the conversation
↳ idstringMessage ID
↳ bodystringMessage body
↳ fromNumberstringSender phone number
↳ toNumberstringRecipient phone number
↳ directionstringinbound or outbound
↳ channelstringChannel (sms, mms, etc.)
↳ mediaUrlstringMedia URL if any
↳ receivedAtstringISO 8601 timestamp

On this page