curl --request POST \
--url https://app.phonely.ai/api/import-number \
--header 'Content-Type: application/json' \
--header 'X-Authorization: <api-key>' \
--data '
{
"uid": "<string>",
"agentId": "<string>",
"source": "<string>",
"twilioAccountSid": "<string>",
"twilioAuthToken": "<string>",
"phoneNumber": "<string>",
"countryCode": "<string>"
}
'{
"message": "<string>"
}Import a Twilio phone number to an agent
curl --request POST \
--url https://app.phonely.ai/api/import-number \
--header 'Content-Type: application/json' \
--header 'X-Authorization: <api-key>' \
--data '
{
"uid": "<string>",
"agentId": "<string>",
"source": "<string>",
"twilioAccountSid": "<string>",
"twilioAuthToken": "<string>",
"phoneNumber": "<string>",
"countryCode": "<string>"
}
'{
"message": "<string>"
}POST/api/import-numberX-Authorization: Your API key (required)Content-Type: application/json{
"uid": "string",
"agentId": "string",
"source": "string",
"twilioAccountSid": "string",
"twilioAuthToken": "string",
"phoneNumber": "string",
"countryCode": "string"
}
uid (string, required): Your user IDagentId (string, required): The ID of the agent to assign the phone number tosource (string, required): Must be “twilio” (only Twilio is currently supported)twilioAccountSid (string, required): Your Twilio Account SIDtwilioAuthToken (string, required): Your Twilio Auth TokenphoneNumber (string, required): The phone number to importcountryCode (string, required): The country code for the phone number{
"message": "string"
}
400 Bad Request: Invalid request body, invalid source, or agent already has a phone number401 Unauthorized: Invalid or missing API key, or insufficient permissions500 Internal Server Error: Agent not found, user needs paid plan, or server errorcurl -X POST https://app.phonely.ai/api/import-number \
-H "X-Authorization: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"uid": "user123",
"agentId": "agent456",
"source": "twilio",
"twilioAccountSid": "ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"twilioAuthToken": "your-twilio-auth-token",
"phoneNumber": "+1234567890",
"countryCode": "US"
}'
User ID
Agent ID (agent should not have a phone number assigned yet)
Phone number source (currently only supports 'twilio')
Twilio account SID
Twilio auth token
Phone number to import, includes country code. i.e +10123456789
Country code of the phone number, ISO 3166-1 alpha-2 format
Successful response
Message indicating the result of the operation