Provision a number

Method

POST

Path

phone_numbers

Provision a phone number that you can use to receive faxes in your Phaxio account.

Request Parameters

Name Type Description
country_code integer The country code (E.164) of the number you'd like to provision.
area_code integer The area code of the number you'd like to provision.
callback_url URL A callback URL that we'll post to when a fax is received by this number. This will override the global receive callback URL, if you have one specified.
address_id integer The ID of an Address object. Required for countries with regulations which require address registration. Ignored for other countries. If used, address must have already been submitted for verification.

Response

A JSON object with success, message, and data attributes. The data attribute holds a Phone Number Object for the number just provisioned.

Sample Call

curl https://api.phaxio.com/v2.1/phone_numbers \
    -u 'API_KEY:API_SECRET' \
    -F 'country_code=1' \
    -F 'area_code=847'

Sample Response

{
    "success":true,
    "message":"Number provisioned successfully!",
    "data":{
        "phone_number":"+18475551234",
        "city":"Northbrook",
        "state":"Illinois",
        "country":"United States",
        "cost":200,
        "last_billed_at":"2016-06-16T15:45:32.000-06:00",
        "provisioned_at":"2016-06-16T15:45:32.000-06:00",
        "callback_url":null
    }
}