numbers.list to find the ID of a number you already own, then pass it as numberId to numbers.listMessages. The direction field identifies inbound messages.
Pass subAccountId to keep calls in the same AgentPhone sub-account. For regular US SMS, wait until outboundSms is enabled before sending. Buying a number and sending messages may consume AgentPhone credits.
For push delivery, point webhooks.upsert or agentWebhooks.upsert at your Corsair webhook URL. Pass the returned signing secret as webhookSecret to the plugin or store it as the account’s webhook signing key. Use X-Webhook-ID to deduplicate deliveries. Test events have test: true.
AgentPhone Verify sends and checks codes for your own application. Read messages sent to your existing AgentPhone number with numbers.listMessages.
What you get:
- 93 typed API operations
- 6 incoming webhook event types
Setup
1
Install
2
Add the plugin
corsair.ts
multiTenancy: true, scope calls with corsair.withTenant(id). See Quick start for KEK + Hub keys, and Multi-tenancy for account isolation.3
Choose authentication
- API Key (Recommended)
Store the AgentPhone API key before the first call: More: API Key
pnpm corsair setup --plugin=agentphone --tenant=acme api_key=<your-key> (leave out --tenant without multiTenancy), or pass it as key in the plugin options. With Hub, each tenant enters their own key on the connect page. See API key auth.4
Connect a tenant
Mint a connect link and send the tenant to it. Hub hosts the page and delivers the result to your app — see Connect / OAuth.
Example API calls
Read messages for an existing numberWebhooks
This plugin registers 6 webhook event types. Configure the provider to POST to your Corsair HTTP handler, then usewebhookHooks on the plugin factory.
See Webhooks for every event path and payload shape, and Webhooks concept for routing.
What’s next
API reference
Every
agentphone.api.* operation with input and output types.Webhooks
Event paths, payloads, and
webhookHooks examples.Connect / OAuth
createLink, Hub delivery, and tenant connect flows.
Use with agents
Expose this plugin’s operations as MCP tools.