# Welcome

API Documentation

Documentation is broken down into different sections based on use.

### WEB REST REQUESTS <a href="#web-rest-requests" id="web-rest-requests"></a>

Web requests are offered using HTTP GET, HTTP POST, or HTTP Json POST, at your preference.&#x20;

To use Json POST, set your header to: Content-Type: application/json

```php
curl https://v1.api19.com/dids/ratecenters/list  \
   -u 'API-Token'

OR

curl https://v1.api19.com/dids/ratecenters/list?key=apitoken

OR

curl https://v1.api19.com/dids/ratecenters/list \
   -d '{key:"mykey", npa:"720"}' \
   -H 'Content-Type: application/json'
```

For instance, the above request would list any areas our phone number pool covers. You can send the API token as a username/password, as a GET variable (token), or as a POST variable.

### NUMBERS / ORDERING <a href="#numbers-ordering" id="numbers-ordering"></a>

This section gives information on listing states / ratecenters, and ordering numbers.

### MY INVENTORY <a href="#my-inventory" id="my-inventory"></a>

Your numbers, listing them and ability to remove them, or reroute them.

### SMS / MMS <a href="#sms-mms" id="sms-mms"></a>

Send and receive SMS / MMS message via our API.

### CALL APIS <a href="#call-apis" id="call-apis"></a>

This section is dedicated to the Call API which allows you to make and receive calls via web REST API calls.

### LOOKUPS <a href="#call-apis" id="call-apis"></a>

Get information about numbers via web REST calls.

### NUMBER PORTABILITY <a href="#call-apis" id="call-apis"></a>

Submit port requests and review port information.

### FAXING <a href="#call-apis" id="call-apis"></a>

Send and receive faxes via the API


# List Areas

List all Ratecenter/Cities and States

## GET Request

{% hint style="info" %}
<https://v1.api19.com/dids/ratecenters/list?key=yourkey>
{% endhint %}

To retrieve rate center information, submit a GET or POST request using your API key. The API key may be provided either as a URL parameter (`key`) or via HTTP Basic Authentication.

The API response includes both the city name and rate center information, allowing you to work with human-readable location data. For example, the rate center code `LSAN DA 01` corresponds to Los Angeles, CA.

To obtain a list of rate centers for a specific state, send a GET or POST request to the endpoint above and include the following parameter:

`state=[state_abbreviation]`

Example:\
`state=CA`

The API will return all available rate centers associated with the specified state.

{% tabs %}
{% tab title="Curl POST" %}

```php
curl -X POST https://v1.api19.com/dids/ratecenters/list \
 -d 'key=your-api-key'
```

{% endtab %}

{% tab title="Curl GET" %}

```
curl "https://v1.api19.com/dids/ratecenters/list?key=yourkey"
```

{% endtab %}

{% tab title="JSON Response" %}

```json
{
    "status": "ok",
    "data": [
        {
            "ratecenter": "DENVER",
            "city": "Denver",
            "state": "CO"
        },
        {
            "ratecenter": "DALLAS",
            "city": "Dallas",
            "state": "TX"
        }
    ]
}
```

{% endtab %}

{% tab title="Error Responses" %}

```json
[
    'status' => 'error', 
    'error' => 'System error', 
    'code' => 'system_error' 
]

[
    'status' => 'error',
    'error' => 'Invalid state. State must be a 2-character abbreviation.' 
    'code' => 'invalid_state'
]
```

{% endtab %}
{% endtabs %}


# List Numbers

List all numbers available for specific ratecenter / state

## GET or POST Request

{% hint style="info" %}
<https://v1.api19.com/dids/available/list?key=yourkey​>
{% endhint %}

Send us a GET/POST request with your key (in the URI as key or as http password)

**Ratecenter / State search**\
You can send ratecenter=\[ratecenter] and state=\[state]

**Area Code Search**\
If you would rather get by area code, you can send npa=\[areacode]

**Toll Free Search**\
To request toll free, send state=tf in your request

We give you the City and Ratecenter so you can get human readable data (for instance ratecenter LSAN DA 01 is actually Los Angeles: 01 as the City.

<table data-header-hidden><thead><tr><th width="154.63641357421875"></th><th width="145.36358642578125"></th><th></th></tr></thead><tbody><tr><td>Argument</td><td>Required</td><td>Type</td></tr><tr><td>state</td><td>yes</td><td>string</td></tr><tr><td>ratecenter</td><td>no</td><td>string</td></tr><tr><td>quantity</td><td>no</td><td>int</td></tr><tr><td>npa</td><td>no</td><td>int</td></tr><tr><td>nxx</td><td>no</td><td>int</td></tr><tr><td>related</td><td>no</td><td>yes<br>set to yes if you only want the specific area code requested and nothing else </td></tr><tr><td>random</td><td>no</td><td>yes<br>randomize numbers in response</td></tr><tr><td>key</td><td>yes</td><td>your API key</td></tr></tbody></table>

{% tabs %}
{% tab title="Curl Post" %}

```php
curl -X POST https://v1.api19.com/dids/available/list \
 -d 'ratecenter=AUSTIN' \
 -d 'state=TX' \
 -d 'quantity=2' \
 -d 'key=your-api-key'
 
or area code based

curl -X POST https://v1.api19.com/dids/available/list \
 -d 'npa=303' \
 -d 'quantity=2' \
 -d 'key=your-api-key'
 
or toll free request

curl -X POST https://v1.api19.com/dids/available/list \
 -d 'state=tf' \
 -d 'key=your-api-key'
```

{% endtab %}

{% tab title="Curl Get" %}

```php
curl https://v1.api19.com/dids/available/list?ratecenter=AUSTIN&state=TX&key=api_token

or area code based

curl https://v1.api19.com/dids/available/list?npa=720&key=api_token

or a toll free request

curl https://v1.api19.com/dids/available/list?state=tf&key=api_token
```

{% endtab %}

{% tab title="JSON Success" %}

```json
{
    "status": "ok",
    "numbers": {
        "17202224017": {
            "did": "17202224017",
            "number": "(720)&nbsp;222-4017",
            "tier": 1,
            "price_monthly": "1.5",
            "price_setup": "1.5",
            "price_minute": "0.0075",
            "ratecenter": "DENVER",
            "state": "CO"
        },
        "17209922019": {
            "did": "17209922019",
            "number": "(720)&nbsp;992-2019",
            "tier": 1,
            "price_monthly": "1.5",
            "price_setup": "1.5",
            "price_minute": "0.0075",
            "ratecenter": "DENVER",
            "state": "CO"
        }
    },
    "count": 2
} 
```

{% endtab %}

{% tab title="JSON Error Response" %}

```json
{
    "status": "error",
    "error": "no numbers available for search",
    "verbose": "none"
} 


{
    'status' => 'error',
    'code' => 'invalid_npa',
		'message' => 'Npa is not valid'
}

{
    'status' => 'error',
		'code' => 'invalid_state',
		'message' => 'State must be a valid 2-character abbreviation.'
}
```

{% endtab %}
{% endtabs %}


# Order Numbers - No Cart

Order a list of numbers

## GET or POST Request

{% hint style="info" %}
<https://v1.api19.com/dids/order/list>
{% endhint %}

Send us a GET or POST request with your key and the numbers (in the URI as key or as http password)

This will immediately attempt to order numbers. You can send the dids field as either a comma list of the numbers OR a json object of the numbers

<table data-header-hidden><thead><tr><th width="152.81817626953125"></th><th width="164.54547119140625"></th><th></th></tr></thead><tbody><tr><td>Argument</td><td>Required</td><td>Type</td></tr><tr><td>dids</td><td>yes</td><td>int</td></tr><tr><td>callflow</td><td>no</td><td>int</td></tr><tr><td>faxflow</td><td>no</td><td>int</td></tr><tr><td>notes</td><td>no</td><td>your did note</td></tr><tr><td>key</td><td>yes</td><td>api key</td></tr></tbody></table>

{% tabs %}
{% tab title="Curl Post" %}

```php
curl -X POST https://v1.api19.com/dids/order/list \
 -d 'dids=3038821111,3038883333' \
 -d 'callflow=444' \
 -d 'notes=my+personal+numbers' \
 -d 'key=your-api-key'
 
OR

curl -X POST https://v1.api19.com/dids/order/list  \
 -d 'dids=[3038821111,3038883333]' \
 -d 'callflow=444' \
 -d 'key=your-api-key'

```

{% endtab %}
{% endtabs %}

Responses

Your cart\_order number has debugging information, if you have any issues, you can open a ticket with this number.

{% tabs %}
{% tab title="Success" %}

```javascript
{
    "status": "ok",
    "errors": {
        "2133581111": "already owned",
        "7203791111": "already owned"
    },
    "success": {
        "7203791112": "yes"
    },
    "cart_order": "232851"
}
```

{% endtab %}

{% tab title="Invalid" %}

```php
{'status': 'error', 'error':'system error'}
{
    'status' => 'error',
		'code' => 'no_numbers',
    'error' => 'No numbers found in dids'
}
{
    'status' => 'error',
    'code' => 'no_dids',
    'message' => 'Dids are required'
}
{
    'status' => 'error',
		'code' => 'invalid_json',
		'message' => 'Json in dids is invalid'
}
```

{% endtab %}
{% endtabs %}


# Delete Numbers

Delete a specific number from your account  GET or POST Request

## GET or POST Request <a href="#get-or-post-request" id="get-or-post-request"></a>

{% hint style="info" %}
<https://v1.api19.com/dids/delete>
{% endhint %}

Send us a GET or POST request with your key and the number (in the URI as key or as http password)

This deletes your number from your account.

| Argument | Required | Type |
| -------- | -------- | ---- |
| number   | yes      | int  |

{% tabs %}
{% tab title="Curl Post" %}

```php
curl -X POST https://v1.api19.com/dids/delete \
 -d 'number=3038821111' \
 -d 'key=your-key'
```

{% endtab %}

{% tab title="JSON Response Success" %}

```php
{
    "status": "ok"
}
```

{% endtab %}

{% tab title="JSON Response Error" %}

```json
{
    'status' => 'error',
    'error' => 'DID is required',
    'code' => 'missing_did'
}

{
    'status' => 'error',
    'error' => 'Invalid DID',
    'code' => 'invalid_did'
}

{
    'status' => 'error',
    'error' => 'Cannot find did',
    'code' => 'mssing_data'
}

{
    'status' => 'error',
    'error' => 'DID does not exist',
    'code' => 'missing_db'
}

{
    'status' => 'error',
    'error' => 'Number not available',
    'code' => 'no_availability'
}

{
    'status' => 'error',
    'error' => 'Number not available {did}',
    'code' => 'did_not_available'
}




```

{% endtab %}
{% endtabs %}


# Change Call Forward

Change call forward parameter

## GET or POST Request <a href="#get-or-post-request" id="get-or-post-request"></a>

{% hint style="info" %}
<https://v1.api19.com/dids/change/call\\_forward>
{% endhint %}

This changes the call forward for a specific number.

<table data-header-hidden><thead><tr><th width="184.6363525390625"></th><th width="165.09088134765625"></th><th></th></tr></thead><tbody><tr><td>Argument</td><td>Required</td><td>Type</td></tr><tr><td>did</td><td>yes</td><td>your phone number</td></tr><tr><td>call_forward</td><td>yes</td><td>forward number</td></tr><tr><td>key</td><td>yes</td><td>your API key</td></tr></tbody></table>

Set your call\_forward number to 0 to disable call forwarding. Call forwarding only supported to USA destinations.

{% tabs %}
{% tab title="Curl Post" %}

```php
curl -X POST https://v1.api19.com/dids/change/call_forward \
 -d 'did=3038821111' \
 -d 'call_forward=3038842222' \
 -d 'key=your-key'
```

{% endtab %}

{% tab title="JSON Response Success" %}

```json
{"status": "ok"}
```

{% endtab %}

{% tab title="JSON Response Error" %}

```json
{
    'status' => 'error',
    'error' => '{call_forward} is not a 10digit number',
    'code' => 'not_valid'
}
{
   'status' => 'error',
    'error' => 'No did found {did}',
    'code' => 'no_did'
}
{
   'status' => 'error',
    'error' => 'no ownership found {did}',
    'code' => 'no_owner'
}
{
   'status' => 'error',
    'error' => '{did} is a fax number. Convert to normal number first.',
    'code' => 'did_fax'
}
{
   'status' => 'error',
    'error' => 'You can't forward a number to itself',
    'code' => 'same_did'
}



```

{% endtab %}
{% endtabs %}


# Vanity Tollfree - Search

Search the toll free database for specific vanity numbers

## GET or POST Request

{% hint style="info" %}
<https://v1.api19.com/dids/tfvanity/search?key=yourkey​>
{% endhint %}

Send us a GET/POST request with your key (in the URI as key or as http password)

{% hint style="info" %}
Set your timeout for this request higher than normal, the SMS800 database can take 60 seconds to respond
{% endhint %}

**Search**\
Send us search= with your request

**Vanity Requests Allowed**

Here are some example searches, use any area code or combination:

844\*\*\*\*\*\*\*   —  all 844 numbers available\
84433\*\*\*\*\*  —  all 844 numbers starting with 33\
844\*\*\*\*\*22  —  all 844 numbers \
833\*\*\*\*&&& —  all 833 numbers where the last 3 numbers are repeaters\
844\*\*\*help   — all 844 numbers ending in help&#x20;

<table data-header-hidden><thead><tr><th width="185.54541015625"></th><th></th><th></th></tr></thead><tbody><tr><td>Argument</td><td>Required</td><td>Type</td></tr><tr><td>search</td><td>yes</td><td>string</td></tr><tr><td>qty</td><td>no</td><td>1 - 10</td></tr></tbody></table>

{% tabs %}
{% tab title="Curl Post" %}

```php
curl -X POST https://v1.api19.com/dids/tfvanity/search \
  -d 'key=mykey' \
  -d 'search=844*******' \
  -d 'qty=10'
```

{% endtab %}

{% tab title="JSON Success" %}

```json
{
  "status": "ok",
  "data": {
    "numList": [
      "8447530304",
      "8447530305",
      "8447530306",
      "8447530311",
      "8447530313",
      "8447530315",
      "8447530316",
      "8447530317",
      "8447530318",
      "8447530319"
    ]
  }
}
```

{% endtab %}

{% tab title="JSON Error Response" %}

```javascript
{
    "status": "error",
    "error": "no numbers available for search",
    "verbose": "none"
} 

{
   'status' => 'error',
    'error' => 'no search request found',
    'code' => 'no_search'
}

{
   'status' => 'error',
    'error' => 'Somos {error}',
    'code' => 'somos_error'
}

{
   'status' => 'error',
    'error' => 'no valid data received',
    'code' => 'invalid_data'
}

```

{% endtab %}
{% endtabs %}


# Vanity Toll Free - Order

Place a vanity toll free number order

## GET or POST Request

{% hint style="info" %}
<https://v1.api19.com/dids/tfvanity/order>
{% endhint %}

Send us a GET or POST request with your key and the numbers (in the URI as key or as http password)

This will immediately attempt to order numbers. You can send the dids field as either a comma list of the numbers OR a json object of the numbers

| Argument | Required | Type |
| -------- | -------- | ---- |
| dids     | yes      | int  |
| callflow | no       | int  |
| faxflow  | no       | int  |

{% tabs %}
{% tab title="Curl Post" %}

```php
curl -X POST https://v1.api19.com/dids/tfvanity/order \
 -d 'dids=3038821111,3038883333' \
 -d 'callflow=444' \
 -d 'key=your-api-key'
 
OR

curl -X POST https://v1.api19.com/dids/tfvanity/order  \
 -d 'dids=[3038821111,3038883333]' \
 -d 'callflow=444' \
 -d 'key=your-api-key'

```

{% endtab %}
{% endtabs %}

Responses

Your cart\_order number has debugging information, if you have any issues, you can open a ticket with this number.

{% tabs %}
{% tab title="Success" %}

```javascript
{
    "status": "ok",
    "errors": {
        "2133581111": "already owned",
        "7203791111": "already owned"
    },
    "success": {
        "7203791112": "yes"
    },
    "cart_order": "232851"
}
```

{% endtab %}

{% tab title="Invalid" %}

```php
{
    "status": "error",
    "error": "no dids set",
    "verbose": "none",
    "code": "no_dids"
} 
{
    "status": "error",
    "error": "no dids set",
    "verbose": "none",
    "code": "no_dids"
} 
{
    'status' => 'error',
		'code' => 'no_numbers',
    'error' => 'No numbers found in dids'
}
{
    'status' => 'error',
    'code' => 'no_dids',
    'message' => 'Dids are required'
}
{
    'status' => 'error',
		'code' => 'invalid_json',
		'message' => 'Json in dids is invalid'
}
```

{% endtab %}
{% endtabs %}


# Toll Free Offnet

Place a toll free offnet order if you have your own RespOrg

## GET or POST Request

{% hint style="info" %}
<https://v1.api19.com/dids/tfoffnet/order>
{% endhint %}

Send us a GET or POST request with your key and the numbers (in the URI as key or as http password)

This will immediately attempt to order numbers. You can send the dids field as either a comma list of the numbers OR a json object of the numbers

| Argument | Required | Type     |
| -------- | -------- | -------- |
| dids     | yes      | int      |
| callflow | no       | int      |
| faxflow  | no       | int      |
| key      | yes      | api\_key |

{% tabs %}
{% tab title="Curl Post" %}

```php
curl -X POST https://v1.api19.com/dids/tfoffnet/order \
 -d 'dids=3038821111,3038883333' \
 -d 'callflow=444' \
 -d 'key=your-api-key'
 
OR

curl -X POST https://v1.api19.com/dids/tfoffnet/order  \
 -d 'dids=[3038821111,3038883333]' \
 -d 'callflow=444' \
 -d 'key=your-api-key'

```

{% endtab %}
{% endtabs %}

Responses

{% tabs %}
{% tab title="Success" %}

```javascript
{
    "status": "ok",
    "success": {
        "8003332222": "yes"
    },
    "errors": {
        "8883332222": "8883332222 is already in your orders",
        "3334443333": "3334443333 is not a tollfree number"
    }
}
```

{% endtab %}

{% tab title="Invalid" %}

```php
{'status': 'error', 'error':'system error'}
{
    'status' => 'error',
		'code' => 'no_numbers',
    'error' => 'No numbers found in dids'
}
{
    'status' => 'error',
    'code' => 'no_dids',
    'message' => 'Dids are required'
}
{
    'status' => 'error',
		'code' => 'invalid_json',
		'message' => 'Json in dids is invalid'
}
```

{% endtab %}
{% endtabs %}


# Add Number to Cart

Add a specific number to your cart

## GET or POST Request

{% hint style="info" %}
<https://v1.api19.com/dids/cart/add>
{% endhint %}

Send us a GET or POST request with your key and the number (in the URI as key or as http password)

This adds the number to your shopping cart, then you can close our your cart.&#x20;

| Argument | Required | Type |
| -------- | -------- | ---- |
| did      | yes      | int  |

{% tabs %}
{% tab title="Curl Post" %}

```php
curl -X POST https://v1.api19.com/dids/cart/add \
 -d 'did=3038821111' \
 -d 'key=your-api-key'
```

{% endtab %}

{% tab title="Curl Get" %}

```
curl https://v1.api19.com/dids/cart/add?did=3039921111&key=apitoken
```

{% endtab %}

{% tab title="JSON Response" %}

```php
{"status":"ok"}

OR

{"status":"error", "error":"number in cart"}
```

{% endtab %}
{% endtabs %}


# List Numbers in Cart

List all numbers in your cart

## GET Request

{% hint style="info" %}
<https://v1.api19.com/dids/cart/list>
{% endhint %}

Send us a GET  request with your key.

{% tabs %}
{% tab title="Curl Post" %}

```php
curl -X GET https://v1.api19.com/dids/cart/list \
 -d 'key=your-api-key'
```

{% endtab %}

{% tab title="Curl Get" %}

```
curl https://v1.api19.com/dids/cart/list&key=apitoken
```

{% endtab %}

{% tab title="JSON Response" %}

```json
{"status":"ok",
 "numbers":
  {"number":3038822211, "ratecenter":"DENVER", "STATE":"CO"}
 }

```

{% endtab %}
{% endtabs %}


# Delete Number from Cart

Delete a specific number from your cart

## GET or POST Request

{% hint style="info" %}
<https://v1.api19.com/dids/cart/delete>
{% endhint %}

Send us a GET or POST request with your key and the number (in the URI as key or as http password)

This deletes the number from your shopping cart.

| Argument | Required | Type |
| -------- | -------- | ---- |
| number   | yes      | int  |

{% tabs %}
{% tab title="Curl Post" %}

```php
curl -X POST https://v1.api19.com/dids/cart/delete \
 -d 'number=3038821111' \
 -d 'key=your-key'
```

{% endtab %}

{% tab title="Curl Get" %}

```
curl https://v1.api19.com/dids/cart/delete?number=3039921111&key=apitoken
```

{% endtab %}

{% tab title="JSON Response" %}

```php
{"status":"ok"}

OR

{"status":"error", "error":"number not in cart"}
```

{% endtab %}
{% endtabs %}


# Complete Order Cart

Order all numbers in your cart

## GET or POST Request

{% hint style="info" %}
<https://v1.api19.com/dids/cart/complete>
{% endhint %}

This will close out your cart and return success/fails.

The call flow and fax flow options are not required, if you omit it, the system will use your default call flow.

| Argument       | Required | Type     |
| -------------- | -------- | -------- |
| call\_flow\_id | no       | int      |
| fax\_flow\_id  | no       | int      |
| key            | yes      | api\_key |

{% tabs %}
{% tab title="Curl Post" %}

```php
curl -X POST https://v1.api19.com/dids/cart/complete \
 -d 'call_flow_id=call_flow_id' \
 -d 'key=api_key'
```

{% endtab %}

{% tab title="Curl Get" %}

```
curl https://v1.api19.com/dids/cart/complete&callflow=callflowid&key=apitoken
```

{% endtab %}

{% tab title="JSON Response" %}

```php
{
    "status": "ok",
    "data": {
        "success": [
            7208017777
        ],
        "errors": [
            7209998888
        ],
        "verbose_errors": [
            "7209998888 - failed p data check"
        ]
    }
} 
```

{% endtab %}
{% endtabs %}


# List My Numbers

List all of the numbers on your account or lookup a single number

## List All Numbers

## GET or POST Request

{% hint style="info" %}
<https://v1.api19.com/dids/my/list>
{% endhint %}

Get a list of all of your numbers on your account

{% tabs %}
{% tab title="Curl Post" %}

```
curl https://v1.api19.com/dids/my/list \
 -d 'key=api_token'
```

{% endtab %}

{% tab title="Curl Get" %}

```
curl https://v1.api19.com/dids/my/list?key=apikey
```

{% endtab %}

{% tab title="JSON Response" %}

```json
{
    "status": "ok",
    "dids": [
        {
            "did": "7207742222",
            "call_flow": "0",
            "fax_flow": "1",
            "user_id": "177",
            "price_tag": "inbound_usa_fax",
            "number_location": "usa",
            "offnet_carrier": "none",
            "ratecenter": "DENVER",
            "state": "CO",
            "country": "US",
            "e911": "0",
            "voicemail": "0",
            "notes": "none",
            "call_forward": "0"
        },
        {
            "did": "7207921111",
            "call_flow": "3",
            "fax_flow": "0",
            "user_id": "177",
            "price_tag": "inbound_usa",
            "number_location": "usa",
            "offnet_carrier": "none",
            "ratecenter": "DENVER",
            "state": "CO",
            "country": "US",
            "e911": "0",
            "voicemail": "2",
            "notes": "none",
            "call_forward": "0"
        }
    ]
}

```

{% endtab %}
{% endtabs %}

## Single Number Lookup

## GET or POST Request

{% hint style="info" %}
<https://v1.api19.com/dids/my/single>
{% endhint %}

{% tabs %}
{% tab title="Curl Post" %}

```
curl https://v1.api19.com/dids/my/single \
 -d 'key=api_token' \
 -d 'did=3033033333'
```

{% endtab %}

{% tab title="Curl Get" %}

```
curl https://v1.api19.com/dids/my/single?key=apikey&did=3033033333
```

{% endtab %}

{% tab title="JSON Response" %}

```json
{
    "status": "ok",
    "data": [
        {
            "did": "7207742222",
            "call_flow": "0",
            "fax_flow": "1",
            "user_id": "177",
            "price_tag": "inbound_usa_fax",
            "number_location": "usa",
            "offnet_carrier": "none",
            "ratecenter": "DENVER",
            "state": "CO",
            "country": "US",
            "e911": "0",
            "voicemail": "0",
            "notes": "none",
            "call_forward": "0"
        }
    ]
}

OR

{
  "status": "error",
  "error": "did not found"
}
```

{% endtab %}
{% endtabs %}


# List Call Flows

List all call and fax flows on account. Call and fax flows allow you to set routing decisions for your numbers and are required to attach a number to.

## GET Request

{% hint style="info" %}
<https://v1.api19.com/dids/my/callflows>
{% endhint %}

Send us a GET  request with your key.

{% tabs %}
{% tab title="Curl Post" %}

```
curl -X GET https://v1.api19.com/dids/callflows/list \
 -u 'api_token:api_token'
```

{% endtab %}

{% tab title="Curl Get" %}

```
curl https://v1.api19.com/dids/callflows/list&key=apitoken \
```

{% endtab %}

{% tab title="JSON Response" %}

```json
{
    "status": "ok",
    "fax_flows": [
        {
            "id": "1",
            "name": "FaxNums 1",
            "emails_json": null,
            "emails_allowed_in": "[\"josh@gmail.com\"]"
        }
    ]
    "call_flows": [
        {
            "id": "1",
            "name": "Main Route",
            "user_id": "1",
            "json": "{\"dnis\":\"3424\",\"route1\":\"1.1.1.1\",\"sip_port1\":5060,\"route1_wait\":30,\"wait\":30,\"route2\":\"2.2.2.2\",\"sip_port2\":5060,\"route2_wait\":30}",
            "e164": "no"
        },
        {
            "id": "3",
            "name": "LA Servers",
            "user_id": "1",
            "json": "{\"route1\":\"device:694\",\"route1_wait\":13,\"sip_port1\":5060,\"wait\":13,\"dnis\":\"\",\"route2\":\"5.5.5.5\",\"sip_port2\":5060,\"route2_wait\":13,\"route1_simul\":\"device:1\"}",
            "e164": "no"
        }
    ]
}

```

{% endtab %}
{% endtabs %}


# Update Call Flow

Change the routing features of a call flow.

## GET or POST Request

{% hint style="info" %}
<https://v1.api19.com/dids/callflow/update>
{% endhint %}

Send us a GET or POST request with your key and the numbers (in the URI as key or as http password)

This will immediately attempt to order numbers. You can send the dids field as either a comma list of the numbers OR a json object of the numbers

<table data-header-hidden><thead><tr><th width="159"></th><th width="122"></th><th></th></tr></thead><tbody><tr><td>Argument</td><td>Required</td><td>Type</td></tr><tr><td>call_flow_id</td><td>yes</td><td>int</td></tr><tr><td>e164</td><td>yes</td><td>yes or no</td></tr><tr><td>voicemail_box</td><td>no</td><td>voicemail box id</td></tr><tr><td>ip_address_1</td><td>yes</td><td>ip you want to route calls to </td></tr><tr><td>ip_address_2</td><td>no</td><td>second ip address to load balance to</td></tr><tr><td>ip_address_3</td><td>no</td><td>third ip to load balance to</td></tr><tr><td>ip_address_4</td><td>no</td><td>fourth ip to load balance to</td></tr><tr><td>sip_port</td><td>no</td><td>alternative SIP UDP port</td></tr><tr><td>make_default</td><td>no</td><td>yes or no<br>make this the default for the account</td></tr><tr><td>wait_time</td><td>no</td><td>seconds to wait until call connects</td></tr></tbody></table>

{% tabs %}
{% tab title="Curl Post" %}

```php
curl -X POST https://v1.api19.com/dids/callflow/update \
 -d 'call_flow_id=444' \
 -d 'e164=yes' \
 -d 'voicemail_box=12345' \
 -d 'ip_address_1=207.181.189.120' \
 -d 'ip_address_2=192.168.1.100' \
 -d 'ip_address_3=192.168.1.101' \
 -d 'ip_address_4=192.168.1.102' \
 -d 'sip_port=5060' \
 -d 'make_default=no' \
 -d 'key=your-api-key'
```

{% endtab %}
{% endtabs %}

Responses

{% tabs %}
{% tab title="Success" %}

```javascript
{
    "status": "ok",
}
```

{% endtab %}

{% tab title="Invalid" %}

```php
{'status': 'error', 'error':'ip address 1 is invalid'}
```

{% endtab %}
{% endtabs %}


# Create Call Flow

Create a new call flow

## GET or POST Request

{% hint style="info" %}
<https://v1.api19.com/dids/callflow/create>
{% endhint %}

Send us a GET or POST request with your key and the numbers (in the URI as key or as http password)

Create a call flow with a specific call flow name.

| Argument       | Required | Type     |
| -------------- | -------- | -------- |
| callflow\_name | no       | int      |
| key            | yes      | api\_key |

{% tabs %}
{% tab title="Curl Post" %}

```php
curl -X POST https://v1.api19.com/dids/callflow/create\
 -d 'callflow_name=my+call_flow' \
 -d 'key=your-api-key'
```

{% endtab %}
{% endtabs %}

Responses

{% tabs %}
{% tab title="Success" %}

```javascript
{"status":"ok","call_flow_id":"31888"}

Message is your newly created callflow ID
```

{% endtab %}

{% tab title="Invalid" %}

```php
{'status': 'error', 'error':'callflow name exists'}
```

{% endtab %}
{% endtabs %}


# Change Call Flow

Change call flow for a specific number

## GET or POST Request

{% hint style="info" %}
<https://v1.api19.com/dids/callflow/change>
{% endhint %}

| Argument       | Required | Type |
| -------------- | -------- | ---- |
| did            | yes      | int  |
| call\_flow\_id | yes      | int  |
| fax\_flow\_id  | no       | int  |

Send us a POST or GET with the number and either the fax flow id or the call flow id.

{% tabs %}
{% tab title="Curl Post" %}

```javascript
curl -X POST https://v1.api19.com/dids/callflow/change \
 -d 'did=3038821111' \
 -d 'call_flow_id=10' \
 -d 'key=api_token'
```

{% endtab %}

{% tab title="Curl Get" %}

```
curl https://v1.api19.com/dids/callflow/change?number=3039921111&call_flow_id=10&key=apitoken \
```

{% endtab %}

{% tab title="JSON Response" %}

```json
{"status":"ok"}

OR

{"status":"error", "error":"invalid callflow"}
```

{% endtab %}
{% endtabs %}


# Add CNAM

## GET or POST Request

{% hint style="info" %}
<https://v1.api19.com/dids/cnam/add>
{% endhint %}

Add a CNAM (Caller ID Name) request for one of your DIDs

{% tabs %}
{% tab title="Curl Post" %}

```
curl https://v1.api19.com/dids/cnam/add \
 -d 'key=api_token' \
 -d 'did=7207921111' \
 -d 'cnam=COMPANY NAME'
```

{% endtab %}

{% tab title="Curl Get" %}

```
curl https://v1.api19.com/dids/cnam/add?key=apikey&did=7207921111&cnam=COMPANY%20NAME
```

{% endtab %}

{% tab title="JSON Response" %}

```json
{
	"status": "ok",
	"data": "CNAM request added"
}

OR

{
	"status": "error",
	"error": "Invalid DID"
}

OR

{
	"status": "error",
	"error": "CNAM must be 15 characters or less"
}
```

{% endtab %}
{% endtabs %}


# CDR Records

Get all of the CDRs on your account

## GET or POST Request

{% hint style="info" %}
<https://v1.api19.com/cdrs/download/csv>
{% endhint %}

Get a list of all of your numbers on your account

You can either send the startdate and enddate or send progressive=yes to give you all of the new records since the last one you downloaded.

| Argument     | Required               | Type                                                                     |
| ------------ | ---------------------- | ------------------------------------------------------------------------ |
| startdate    | yes unless progressive | 04/04/2024                                                               |
| enddate      | yes unless progressive | 04/06/2024                                                               |
| record\_type | calls / sms            | Send sms to get sms record                                               |
| add\_data    | no                     | add\_data=yes will add additional data                                   |
| progressive  | no                     | <p>progressive=yes<br>makes it so you don't need startdate / enddate</p> |
| limit        | no                     | set a limit of how many records to reply with for progressive            |
| key          | yes                    | your token/key                                                           |

{% tabs %}
{% tab title="Curl Post" %}

```javascript
curl https://v1.api19.com/cdrs/download/csv \
 -d 'startdate=04/04/2024' \
 -d 'enddate=04/06/2024' \
 -d 'record_type=calls' \
 -d 'add_data=yes' \
 -d 'key=api_token'
 
May also use record_type=sms for sms records
```

{% endtab %}

{% tab title="Curl Get" %}

```
curl https://v1.api19.com/cdrs/download/csv?key=apikey&startdate=04/04/2024&enddate=04/05/2024
```

{% endtab %}

{% tab title="Calls Response" %}

```
date,your_cost,your_permin,submaster_id,user_id,submaster_cost,user_cost,submaster_permin,user_permin,billsec,src,dst,did,call_type

with add_data=yes:
date,your_cost,your_permin,submaster_id,user_id,submaster_cost,user_cost,submaster_permin,user_permin,billsec,src,dst,did,call_type,sip_code,sip_reason,call_sid
```

{% endtab %}

{% tab title="SMS Response" %}

```
date,your_cost,surcharge,src,dst,message,direction,alpha,msg_type,uuid
```

{% endtab %}
{% endtabs %}


# Mass update CNAM

Updates the outbound Caller ID Name (CNAM) for multiple phone numbers in a single request.  The submitted phone numbers must belong to the authenticated account or to one of its associated subaccount.

```
https://v1.api19.com/dids/callflows/mass-update-cnam
```

### Request Body

| Parameter | Required | Description                                        |
| --------- | -------- | -------------------------------------------------- |
| `key`     | Yes      | Your API token.                                    |
| `numbers` | Yes      | One or more DIDs separated by commas or new lines. |
| `cnam`    | Yes      | The Caller ID Name to apply to all valid DIDs.     |

#### Phone number formatting

Phone numbers may be submitted using common formatting characters.

The API removes non-numeric characters before validation.

Accepted examples:

```
3035550100
13035550100
(303) 555-0100
303-555-0100
```

The API removes a leading US country code `1`, when present, and validates the remaining number as a 10-digit NANP phone number.

#### CNAM formatting

The `cnam` value may contain:

* Uppercase letters
* Lowercase letters
* Numbers
* Spaces

Special characters are removed before the value is processed.<br>

### JSON Request Example

```
{
  "numbers": "3035550100, 3035550101, 3035550102",
  "cnam": "CNAM"
}
```

You may also separate numbers using new lines:

```
{
  "numbers": "3035550100\n3035550101\n3035550102",
  "cnam": "CNAM"
}
```

### cURL Example

```
curl https://v1.api19.com/dids/callflows/mass-update-cnam \
 -d 'key=api_token' \
 --data-urlencode 'numbers=3035550100
3035550101
3035550102' \
 -d 'cnam=COMPANY NAME'
```

### Successful Response

The endpoint returns one result for every submitted phone number.

```
{
  "status": "ok",
  "data": [
    {
      "number": "3035550100",
      "status": "ok",
      "message": "CNAM updated successfully"
    },
    {
      "number": "3035550101",
      "status": "ok",
      "message": "CNAM updated successfully"
    },
    {
      "number": "3035550102",
      "status": "ok",
      "message": "CNAM updated successfully"
    }
  ]
}
```

#### Response Fields

| Field            | Type   | Description                                                            |
| ---------------- | ------ | ---------------------------------------------------------------------- |
| `status`         | string | Overall request status. A successfully processed request returns `ok`. |
| `data`           | array  | Individual results for each submitted phone number.                    |
| `data[].number`  | string | Normalized 10-digit phone number.                                      |
| `data[].status`  | string | Processing result for the individual phone number.                     |
| `data[].message` | string | Description of the result.                                             |

***

### Partial Success Response

A request may contain both successful and unsuccessful phone numbers.

The overall response may still return `status: ok`, while individual numbers contain an error.

```
{
  "status": "ok",
  "data": [
    {
      "number": "3035550100",
      "status": "ok",
      "message": "CNAM updated successfully"
    },
    {
      "number": "123",
      "status": "error",
      "message": "Invalid number format"
    },
    {
      "number": "3035550199",
      "status": "error",
      "message": "Number not found in your DIDs"
    }
  ]
}
```

\
Always inspect the `status` field of every item in the `data` array. An overall `status` of `ok` does not mean that every submitted number was accepted.<br>

***

### Error Responses

#### Missing required parameter

Returned when `numbers` or `cnam` is not included in the request.

```
{
  "status": "error",
  "error": "Missing required parameter"
}
```

The exact missing-parameter message may depend on the standard API validation response.

***

#### No valid numbers

```
HTTP/1.1 400 Bad Request
```

```
{
  "status": "error",
  "error": "No valid numbers provided"
}
```

***

#### Invalid CNAM

Returned when the CNAM is empty after unsupported characters are removed.

```
HTTP/1.1 400 Bad Request
```

```
{
  "status": "error",
  "error": "Invalid CNAM"
}
```

***

#### Unexpected server error

```
HTTP/1.1 500 Internal Server Error
```

```
{
  "status": "error",
  "error": "Unexpected error"
}
```

***

### Number-Level Errors

Individual phone numbers may return one of the following errors:

| Message                         | Description                                                                                |
| ------------------------------- | ------------------------------------------------------------------------------------------ |
| `Invalid number format`         | The normalized phone number is not 10 digits long.                                         |
| `Number not found in your DIDs` | The phone number does not belong to the authenticated account or an associated subaccount. |

***

### Processing Behaviour

For every valid phone number, the API creates a CNAM request containing:

| Field          | Value                            |
| -------------- | -------------------------------- |
| Account        | Authenticated account            |
| DID            | Normalized 10-digit phone number |
| Caller ID Name | Submitted CNAM value             |
| Initial status | `pending`                        |

A successful API response confirms that the CNAM request was accepted for processing. It does not necessarily confirm that the downstream carrier has already completed the CNAM update.


# Send SMS

Send an SMS Message

## GET or POST Request

{% hint style="info" %}
<https://v1.api19.com/sms/send>
{% endhint %}

| Argument    | Required | Type   |
| ----------- | -------- | ------ |
| source      | yes      | int    |
| destination | yes      | int    |
| message     | yes      | string |
| key         | yes      | string |

Send a GET or POST request with source, destination, message and key to us and we will deliver it to the recipient.

{% tabs %}
{% tab title="Curl Post" %}

```php
curl -X POST https://v1.api19.com/sms/send \
 -d 'source=3038821111' \
 -d 'destination=6038821111' \
 -d 'message=yo' \
 -d 'key=your_api_key'
```

{% endtab %}

{% tab title="Curl Get" %}

```
curl https://v1.api19.com/sms/send?key=yourapikey&source=3038821111&destination=6038821111&message=yo
```

{% endtab %}

{% tab title="JSON Response" %}

```php
{"status":"ok", "uuid":"j932jf-hh8w32-djfh2f"}

OR

{"status":"error", "error":"invalid source number"}
```

{% endtab %}
{% endtabs %}


# Send MMS

Send an MMS Message

## GET or POST Request

{% hint style="info" %}
<https://v1.api19.com/mms/send>
{% endhint %}

| Argument    | Required | Type               |
| ----------- | -------- | ------------------ |
| source      | yes      | int                |
| destination | yes      | int                |
| message     | no       | string             |
| url         | yes      | <http://image/url> |
| key         | yes      | string             |

Send a GET or POST request with source, destination, message and key to us and we will deliver it to the recipient.

Message is so that you have the ability to send a picture and add a text message with it for no extra charge.

{% tabs %}
{% tab title="Curl Post" %}

```php
curl -X POST https://v1.api19.com/mms/send \
 -d 'source=3038821111'
 -d 'destination=6038821111'
 -d 'message=yo'
 -d 'url=http://mypics.com/image33.png'
 -d 'key=api_token'
```

{% endtab %}

{% tab title="Curl Get" %}

```
curl https://v1.api19.com/mms/send?key=yourapikey&url=http://picurl.com/img.png&source=3038821111&destination=6038821111&message=yo
```

{% endtab %}

{% tab title="JSON Response" %}

```php
{"status":"ok"}

OR

{"status":"error", "error":"invalid source number"}
```

{% endtab %}
{% endtabs %}


# Receive SMS/MMS

Receive an SMS / MMS message to your system

## Portal Settings

Inside the portal, in your user settings (at the top right of the screen drop down), you can set the incoming URL. When you receive an MMS or SMS, you will receive the following as POST variables:

| Argument    | Value              | Type       |
| ----------- | ------------------ | ---------- |
| source      | yes                | int        |
| destination | yes                | int        |
| message     | no                 | string     |
| attachments | json array of urls | json       |
| type        | yes                | sms or mms |
| cost        | cost of message    | int        |

Here's an example:

{% tabs %}
{% tab title="Received Post SMS" %}

```php
HTTP Post Variables OR JSON Post

(
    [source] => 3038882222
    [destination] => 7206321111
    [message] => hello
    [type] => sms
    [cost] => 0
)
```

{% endtab %}

{% tab title="Received Post MMS" %}

```php
 HTTP Post Variables OR JSON Post

(
    [source] => 3038882222
    [destination] => 7206321111
    [message] => 
    [attachments] => ["https:\/\/mmsdata.net\/3a95-ea85-4978-b723-4f29b73f96dc.png"]
    [type] => mms
    [cost] => 0
)
```

{% endtab %}
{% endtabs %}


# Receive Delivery Receipts

Receive a SMS message to your system

## Portal Settings

Under User Settings, on the top right of the portal drop down, you can edit your ***Receive SMS/MMS Delivery Messages*** urls.

Here is a list of possible errors we will send you in the error field:\
<https://files.voicelogin.net/files/errors.csv>

The following data will be posted:

<table data-header-hidden><thead><tr><th width="198"></th><th width="308"></th><th></th></tr></thead><tbody><tr><td>Argument</td><td>Value</td><td>Type</td></tr><tr><td>source</td><td>source number</td><td>int</td></tr><tr><td>destination</td><td>destination number</td><td>int</td></tr><tr><td>send_status</td><td>carrier_sent / rejected / delivered</td><td>string</td></tr><tr><td>status</td><td>REJECTED / DELIVRD</td><td>string</td></tr><tr><td>error</td><td>000 / 600</td><td>int</td></tr></tbody></table>

Here's an example:

{% tabs %}
{% tab title="Delivered" %}

```php
HTTP Post Variables OR JSON posted

(
    [uuid] => s-1c3b-946b-306a-a068-489a8b9ce6f6-02252024
    [source] => 3038882222
    [destination] => 7206321111
    [send_status] => carrier_sent
    [status] => sent
    [error] => 000
)

(
    [uuid] => s-1c3b-946b-306a-a068-489a8b9ce6f6-02252024
    [source] => 3038882222
    [destination] => 7206321111
    [send_status] => delivered
    [status] => DELIVRD
    [error] => 000
)

(
    [uuid] => s-1c3b-946b-306a-a068-489a8b9ce6f6-02252024
    [source] => 3038882222
    [destination] => 7206321111
    [send_status] => delivered
    [status] => DELIVERED
    [error] => 000
)
```

{% endtab %}

{% tab title="Rejected" %}

```php
HTTP Post Variables OR JSON posted

(
    [uuid] => s-1c3b-946b-306a-a068-489a8b9ce6f6-02252024
    [source] => 3038882222
    [destination] => 7206321111
    [send_status] => carrier_sent
    [status] => sent
    [error] => 000
)

(
    [uuid] => s-1c3b-946b-306a-a068-489a8b9ce6f6-02252024
    [source] => 3038882222
    [destination] => 7206321111
    [send_status] => rejected
    [status] => REJECTED
    [error] => 600
)

(
    [uuid] => s-1c3b-946b-306a-a068-489a8b9ce6f6-02252024
    [source] => 3038882222
    [destination] => 7206321111
    [send_status] => error
    [status] => error
    [error] => Carrier specific error
)
```

{% endtab %}
{% endtabs %}


# Lookup SMS Message

## GET or POST Request

{% hint style="info" %}
<https://v1.api19.com/sms/lookup>
{% endhint %}

Lookup message details by message UUID

{% tabs %}
{% tab title="Curl Post" %}

```bash
curl https://v1.api19.com/sms/lookup \
 -d 'key=api_token' \
 -d 'uuid=550e8400-e29b-41d4-a716-446655440000'
```

{% endtab %}

{% tab title="Curl Get" %}

```bash
curl https://v1.api19.com/sms/lookup?key=apikey&uuid=550e8400-e29b-41d4-a716-446655440000
```

{% endtab %}

{% tab title="JSON Response" %}

```json
{
    "status": "ok",
    "data": {
        "insert_date": "string",
        "user_id": "string",
        "cost": "string",
        "surcharge": "string",
        "src": "string",
        "dst": "string",
        "message": "string",
        "direction": "string",
        "msg_type": "string",
        "service_type": "string"
    }
}

OR

{
    "status": "error",
    "error": "not found"
}
```

{% endtab %}
{% endtabs %}

## Parameters

* `uuid` (required) - Message UUID


# Get Verticals

## GET or POST Request

{% hint style="info" %}
<https://v1.api19.com/campaigns/verticals>
{% endhint %}

Get the possible verticals for campaigns / brands

{% tabs %}
{% tab title="Curl Post" %}

```bash
curl https://v1.api19.com/campaigns/verticals \
 -d 'key=api_token'
```

{% endtab %}

{% tab title="Curl Get" %}

```bash
curl https://v1.api19.com/campaigns/verticals?key=apikey
```

{% endtab %}

{% tab title="JSON Response" %}

```json
{
  "status": "ok",
  "data": {
    "PROFESSIONAL": {
      "industryId": "professional-services",
      "displayName": "Professional Services",
      "description": "Professional services."
    },
    "REAL_ESTATE": {
      "industryId": "real-estate",
      "displayName": "Real Estate",
      "description": "Buying and Selling of residential and commercial properties."
    },
    "HEALTHCARE": {
      "industryId": "healthcare-and-lifesciences",
      "displayName": "Healthcare and Life Sciences",
      "description": "Healthcare services, including hospital, health insurances."
    },
    "HUMAN_RESOURCES": {
      "industryId": "human-resources-staffing-recruitment",
      "displayName": "HR, Staffing or Recruitment",
      "description": "Human resources, staffing, or recruitment."
    },
    "ENERGY": {
      "industryId": "energy-and-utilities",
      "displayName": "Energy and Utilities",
      "description": "Energy and Utilities."
    },
    "ENTERTAINMENT": {
      "industryId": "entertainment",
      "displayName": "Entertainment",
      "description": "Entertainment, including gaming and dating services."
    },
    "RETAIL": {
      "industryId": "retail-and-consumer-products",
      "displayName": "Retail and Consumer Products",
      "description": "Consumer products and services, including Retails and eTails."
    },
    "TRANSPORTATION": {
      "industryId": "transportation-logistics",
      "displayName": "Transportation or Logistics",
      "description": "Transportation or logistics services."
    },
    "AGRICULTURE": {
      "industryId": "agriculture",
      "displayName": "Agriculture",
      "description": "Agriculture businesses and services."
    },
    "INSURANCE": {
      "industryId": "insurance",
      "displayName": "Insurance",
      "description": "Insurance products and services"
    },
    "POSTAL": {
      "industryId": "postal-delivery",
      "displayName": "Postal and Delivery",
      "description": "Postal and delivery services."
    },
    "EDUCATION": {
      "industryId": "education",
      "displayName": "Education",
      "description": "Educational institutions providing education to students in educational settings."
    },
    "HOSPITALITY": {
      "industryId": "hospitality",
      "displayName": "Hospitality and Travel",
      "description": "Travel, hospitality and transportation."
    },
    "FINANCIAL": {
      "industryId": "financial-services",
      "displayName": "Financial Services",
      "description": "Banking and financial institution."
    },
    "POLITICAL": {
      "industryId": "political",
      "displayName": "Political",
      "description": "Political campaigns and services."
    },
    "GAMBLING": {
      "industryId": "gambling-and-lottery",
      "displayName": "Gambling and Lottery",
      "description": "Gambling and Lotteries."
    },
    "LEGAL": {
      "industryId": "legal",
      "displayName": "Legal",
      "description": "Legal services and law firms."
    },
    "CONSTRUCTION": {
      "industryId": "construction-and-materials",
      "displayName": "Construction, Materials, and Trade Services",
      "description": "Construction, materials, and trade services."
    },
    "NGO": {
      "industryId": "non-profit-organization",
      "displayName": "Non-profit Organization",
      "description": "Non-profit organization with valid tax-exempted status."
    },
    "MANUFACTURING": {
      "industryId": "manufacturing",
      "displayName": "Manufacturing",
      "description": "Goods producing industries."
    },
    "GOVERNMENT": {
      "industryId": "public-sector",
      "displayName": "Government Services and Agencies",
      "description": "Local, state or federal agencies, utilities."
    },
    "TECHNOLOGY": {
      "industryId": "information-technology-services",
      "displayName": "Information Technology Services",
      "description": "Information technology and information services."
    },
    "COMMUNICATION": {
      "industryId": "mass-media-and-communication",
      "displayName": "Media and Communication",
      "description": "Communication and mass media."
    }
  }
}
```

{% endtab %}
{% endtabs %}


# Submit TollFree Campaign

SMS Enable a toll free number by submitting a campaign request for it

## GET or POST Request

{% hint style="info" %}
<https://v1.api19.com/campaigns/tollfree/submit>
{% endhint %}

<table data-header-hidden><thead><tr><th width="224.90911865234375"></th><th width="90.9091796875"></th><th width="418.27276611328125"></th></tr></thead><tbody><tr><td>Argument</td><td>Required</td><td>Type</td></tr><tr><td>did</td><td>yes</td><td>the number you're activating SMS on</td></tr><tr><td>businessname</td><td>yes</td><td>string</td></tr><tr><td>firstname</td><td>yes</td><td>string</td></tr><tr><td>lastname</td><td>yes</td><td>string</td></tr><tr><td>contactemail</td><td>yes</td><td>string</td></tr><tr><td>contactphone</td><td>yes</td><td>string</td></tr><tr><td>website</td><td>yes</td><td>string</td></tr><tr><td>address1</td><td>yes</td><td>string</td></tr><tr><td>address2</td><td>no</td><td>string</td></tr><tr><td>city</td><td>yes</td><td>string</td></tr><tr><td>state</td><td>yes</td><td>string</td></tr><tr><td>zip</td><td>yes</td><td>string</td></tr><tr><td>usecase</td><td>yes</td><td>Summarize the Use Case</td></tr><tr><td>optininfo</td><td>yes</td><td>How will handsets be opting-in to SMS program?<br>(Please provide proof of opt-in. You may provide a screenshot if opt-in is not visible from URL provided. Images may be uploaded at the bottom of the page. NOTE: consent from end user to receive SMS must be explicit.)</td></tr><tr><td>messagecontent</td><td>yes</td><td>Please provide sample message content for this campaign</td></tr><tr><td>wherepublished</td><td>yes</td><td>Tell us where the number will be published (website link, billboard)</td></tr><tr><td>urls_messagecontent</td><td>yes</td><td>List any urls that will be in the message content</td></tr><tr><td>numbers_messagecontent</td><td>yes</td><td>List any phone numbers that will be in the message content</td></tr><tr><td>enable_canada</td><td>no</td><td><p>Allow Canadian traffic</p><p>yes / no</p></td></tr><tr><td>advertising</td><td>no</td><td>This number will have Marketing/Advertising in messages<br>yes / no</td></tr><tr><td>fortune500</td><td>no</td><td>This company is a fortune 100 or fortune 500 company<br>yes / no</td></tr><tr><td>donations</td><td>no</td><td>This number will be asking for Donations / Collections<br>yes / no</td></tr><tr><td>donations_data</td><td>no</td><td>if donations is yes:<br>Please provide the Tax-ID, and non-profit website<br>All other information on this form must match this non-profit</td></tr><tr><td>msgvolume</td><td>yes</td><td>Daily Message Volume</td></tr><tr><td>file1_url</td><td>no</td><td>http url - if you want to attach an image to the campaign</td></tr><tr><td>file2_url</td><td>no</td><td>http url - if you want to attach an image to the campaign</td></tr><tr><td>key</td><td>yes</td><td>your api key</td></tr></tbody></table>

Send a POST with all of the information required from above

{% tabs %}
{% tab title="Curl Post" %}

```php
curl -X POST https://v1.api19.com/campaigns/tollfree/submit \
  -d "key=2h9fh23f23f2" \
  -d "did=8883038888" \
  -d "businessname=Acme Corporation" \
  -d "firstname=John" \
  -d "lastname=Doe" \
  -d "contactemail=john.doe@example.com" \
  -d "contactphone=1234567890" \
  -d "website=https://www.acme-corp.com" \
  -d "address1=123 Main Street" \
  -d "address2=Apt 4B" \
  -d "city=Metropolis" \
  -d "state=NY" \
  -d "zip=10001" \
  -d "usecase=Marketing Campaign" \
  -d "optininfo=customer opt in by calling our 800 number, and ...." \
  -d "messagecontent=Hello, this is a test message for our campaign!" \
  -d "wherepublished=Social Media" \
  -d "urls_messagecontent=https://www.example.com/test-message" \
  -d "numbers_messagecontent=5551234" \
  -d "enable_canada=true" \
  -d "advertising=yes" \
  -d "fortune500=no" \
  -d "donations=yes" \
  -d "donations_data=Charity Drive 2023, TIN 87-1771212" \
  -d "msgvolume=500000" \
  -d "file1_url=http://mypic.com/screenshot.jpg" \
  -d "file2_url=http://mypic.com/screenshot2.jpg" 
```

{% endtab %}

{% tab title="JSON Response" %}

```php
{"status":"ok"}

OR

{"status":"error","error":"Missing required fields: lastname"}

OR

{"status":"error", "error":"you do not own this number"}
```

{% endtab %}
{% endtabs %}


# Campaign Assign Number

Assign a phone number to a campaign

## GET or POST Request <a href="#get-or-post-request" id="get-or-post-request"></a>

{% hint style="info" %}
<https://v1.api19.com/campaigns/assign/did>
{% endhint %}

Set the Campaign ID for a specific phone number.

<table data-header-hidden><thead><tr><th width="184.6363525390625"></th><th width="165.09088134765625"></th><th></th></tr></thead><tbody><tr><td>Argument</td><td>Required</td><td>Type</td></tr><tr><td>did</td><td>yes</td><td>your phone number</td></tr><tr><td>campaign_id</td><td>yes</td><td>campaign ID OR canada</td></tr><tr><td>key</td><td>yes</td><td>your API key</td></tr></tbody></table>

Set the campaign on your phone number to a campaign ID or enable for Canada only.&#x20;

{% tabs %}
{% tab title="Curl Post" %}

```php
curl -X POST https://v1.api19.com/campaigns/assign/did \
 -d 'did=3038821111' \
 -d 'campaign_id=CXMR32R' \
 -d 'key=your-key'
```

{% endtab %}

{% tab title="JSON Response" %}

```json
{"status": "ok"}

OR

{"status": "error", "error":"You do not own 3035551212"}

OR

{"status": "error", "error":"You do not own this campaign_id"}
```

{% endtab %}
{% endtabs %}


# Get 10DLC Brand

## GET or POST Request

{% hint style="info" %}
<https://v1.api19.com/campaigns/brand/get>
{% endhint %}

Get details of a specific 10DLC brand

{% tabs %}
{% tab title="Curl Post" %}

```bash
curl https://v1.api19.com/campaigns/brand/get \
 -d 'key=api_token' \
 -d 'brand_id=B1A2C3D4E5'
```

{% endtab %}

{% tab title="Curl Get" %}

```bash
curl https://v1.api19.com/campaigns/brand/get?key=apikey&brand_id=B1A2C3D4E5
```

{% endtab %}

{% tab title="JSON Response" %}

```json
{
    "System_Status": "string",
    "Registry_Status": "string",
    "Brand_ID": "string",
    "Company_Type": "string",
    "TIN_or_EIN": "string",
    "Alt_Company_ID": "string",
    "Alt_Company_Value": "string",
    "Company_Name": "string",
    "Doing_Business_As": "string",
    "First_Name": "string",
    "Last_Name": "string",
    "Address": "string",
    "Address_2": "string",
    "City": "string",
    "State": "string",
    "Zip": "string",
    "Country": "string",
    "Email_Address": "string",
    "Website": "string",
    "Phone_Number": "string",
    "Mobile_Phone": "string",
    "Date_Created": "string",
    "Brand_Relationship": "string",
    "status": "string",
    "campaigns": [
        {
            "id": "string",
            "crid": "string",
            "local_campaign_id": "string"
        },
        {
            "id": "string",
            "crid": "string",
            "local_campaign_id": "string"
        }
    ]
}
```

{% endtab %}
{% endtabs %}

## Parameters

* `brand_id` (required) - Brand ID


# List 10DLC Brands

## GET or POST Request

{% hint style="info" %}
<https://v1.api19.com/campaigns/brand/list>
{% endhint %}

Get a list of all 10DLC brands on your account

{% tabs %}
{% tab title="Curl Post" %}

```bash
curl https://v1.api19.com/campaigns/brand/list \
 -d 'key=api_token'
```

{% endtab %}

{% tab title="Curl Get" %}

```bash
curl https://v1.api19.com/campaigns/brand/list?key=apikey
```

{% endtab %}

{% tab title="JSON Response" %}

```json
{
	"status": "ok",
	"brands": [
		{
			"brand_id": "string",
			"network": "string",
			"company_name": "string",
			"identity_status": "string",
			"status": "string"
		}
	]
}
```

{% endtab %}
{% endtabs %}


# Create 10DLC Brand

## POST Request

{% hint style="info" %}
<https://v1.api19.com/campaigns/brand/create>
{% endhint %}

Create a new 10DLC brand registration

{% tabs %}
{% tab title="Curl Post" %}

```bash
curl https://v1.api19.com/campaigns/brand/create \
 -d 'key=api_token' \
 -d 'companyType=PRIVATE_PROFIT' \
 -d 'ein=123456789' \
 -d 'inputCountry=US' \
 -d 'vertical=PROFESSIONAL' \
 -d 'businessname1=Company Name' \
 -d 'FirstName=John' \
 -d 'LastName=Doe' \
 -d 'Address1=123 Main St' \
 -d 'City=Denver' \
 -d 'inputState=CO' \
 -d 'Zip=80202' \
 -d 'Email=contact@example.com' \
 -d 'Website=https://example.com' \
 -d 'phonenumber=3035551234'
```

{% endtab %}

{% tab title="JSON Response" %}

```json
{
	"status": "ok"
}
```

{% endtab %}
{% endtabs %}

## Parameters

| Parameter          |   Required  | Description                                                     |
| ------------------ | :---------: | --------------------------------------------------------------- |
| companyType        |     yes     | Type of company                                                 |
| ein                | contitional | Employer Identification Number. Required if not sole proprietor |
| inputCountry       |     yes     | Country code                                                    |
| alt\_company\_info |      no     | Alternative company information                                 |
| alt\_company\_data |      no     | Alternative company data                                        |
| vertical           |     yes     | Business vertical/industry                                      |
| businessname1      | conditional | Primary business name, if not sole proprietor                   |
| businessname2      |      no     | Secondary business name                                         |
| FirstName          |     yes     | First name of contact                                           |
| LastName           |     yes     | Last name of contact                                            |
| Address1           |     yes     | Primary address                                                 |
| Address2           |      no     | Secondary address                                               |
| City               |     yes     | City                                                            |
| inputState         |     yes     | State                                                           |
| Zip                |     yes     | Postal code                                                     |
| Email              |     yes     | Contact email                                                   |
| Website            |     yes     | Company website                                                 |
| phonenumber        |     yes     | Contact phone number                                            |
| mobilenumber       | conditional | Mobile phone number, if sole proprietor                         |
| stockSymbol        |      no     | Stock symbol                                                    |
| stockExchange      |      no     | Stock exchange                                                  |


# Update 10DLC Brand

## POST Request

{% hint style="info" %}
<https://v1.api19.com/campaigns/brand/update>
{% endhint %}

Update an existing 10DLC brand

{% tabs %}
{% tab title="Curl Post" %}
{% code title="curl" %}

```bash
curl https://v1.api19.com/campaigns/brand/update \
 -d 'key=api_token' \
 -d 'brand_id=B1A2C3D4E5' \
 -d 'companyName=Updated Company Name' \
 -d 'website=https://newsite.com' \
 -d 'email=newemail@example.com'
```

{% endcode %}
{% endtab %}

{% tab title="JSON Response" %}
{% code title="response.json" %}

```json
{
	"status": "ok",
	"data": "Brand updated successfully"
}
```

{% endcode %}
{% endtab %}
{% endtabs %}

## Parameters

* `brand_id` (required) - Brand ID
* `companyName` (optional) - Company name
* `ein` (optional) - Employer Identification Number
* `entityType` (optional) - Entity type
* `firstname` (optional) - First name of contact
* `lastname` (optional) - Last name of contact
* `dba` (optional) - Doing Business As name
* `website` (optional) - Company website
* `address1` (optional) - Primary address
* `address2` (optional) - Secondary address
* `city` (optional) - City
* `state` (optional) - State
* `zip` (optional) - Postal code
* `country` (optional) - Country code
* `email` (optional) - Contact email
* `phone` (optional) - Contact phone number
* `vertical` (optional) - Business vertical/industry
* `stockSymbol` (optional) - Stock symbol
* `stockExchange` (optional) - Stock exchange
* `altBusinessId` (optional) - Alternative business ID
* `altBusinessIdType` (optional) - Alternative business ID type


# Remove 10DLC Brand

## POST Request

{% hint style="info" %}
<https://v1.api19.com/campaigns/brands/remove>
{% endhint %}

Delete a 10DLC brand from your account

{% tabs %}
{% tab title="cURL" %}
{% code title="curl" %}

```bash
curl https://v1.api19.com/campaigns/brands/remove \
 -d 'key=api_token' \
 -d 'brand_id=B1A2C3D4E5'
```

{% endcode %}
{% endtab %}

{% tab title="JSON Response" %}
{% code title="success.json" %}

```json
{
    "status": "ok",
    "message": "Brand removed successfully"
}
```

{% endcode %}

{% code title="error.json" %}

```json
{
    "status": "error",
    "error": "Brand not found"
}
```

{% endcode %}
{% endtab %}
{% endtabs %}

## Parameters

* `brand_id` (required) - Brand ID


# List 10DLC Brand Vetting Providers

## GET or POST Request

{% hint style="info" %}
<https://v1.api19.com/campaigns/brand/vetting/providers>
{% endhint %}

Get a list of available external vetting providers for 10DLC brands

{% tabs %}
{% tab title="Curl Post" %}

```bash
curl https://v1.api19.com/campaigns/brand/vetting/providers \
 -d 'key=api_token'
```

{% endtab %}

{% tab title="Curl Get" %}

```bash
curl https://v1.api19.com/campaigns/brand/vetting/providers?key=apikey
```

{% endtab %}

{% tab title="JSON Response" %}

```json
{
    "status": "ok",
    "providers": [
        {
            "evpId": "AEGIS",
            "displayName": "Aegis Mobile",
            "tcrBillable": true,
            "vettingClasses": [
                "STANDARD",
                "POLITICAL",
                "ENHANCED",
                "RCS",
                "AUTHPLUS"
            ],
            "vettingInstruction": "{\r\n  \"importVet\" : {\r\n    \"supported\" : true,\r\n    \"parameters\" : {\r\n      \"vettingId\" : {\r\n        \"label\" : \"Vetting ID\",\r\n        \"show\" : true\r\n      },\r\n      \"vettingToken\" : {\r\n        \"label\" : \"Vetting Token\",\r\n        \"show\" : false\r\n      }\r\n    },\r\n    \"info\" : \"Vetting partner Aegis\"\r\n  },\r\n  \"newVet\" : {\r\n    \"supported\" : true,\r\n    \"price\" : {\r\n      \"STANDARD\" : 40\r\n    },\r\n    \"waitTime\" : \"30 seconds\",\r\n    \"info\" : \"Vetting partner Aegis\"\r\n  }\r\n}"
        },
        ...
    ]
}
```

{% endtab %}
{% endtabs %}


# Get 10DLC Brand Vetting Status

## GET or POST Request

{% hint style="info" %}
<https://v1.api19.com/campaigns/brand/vetting/status>
{% endhint %}

Get the vetting status for a 10DLC brand

{% tabs %}
{% tab title="Curl Post" %}

```bash
curl https://v1.api19.com/campaigns/brand/vetting/status \
 -d 'key=api_token' \
 -d 'brand_id=B1A2C3D4E5'
```

{% endtab %}

{% tab title="Curl Get" %}

```bash
curl https://v1.api19.com/campaigns/brand/vetting/status?key=apikey&brand_id=B1A2C3D4E5
```

{% endtab %}

{% tab title="JSON Response" %}

```json
{
  "status": "ok",
  "data": [
    {
      "evpId": "AEGIS",
      "vettingId": "###",
      "vettingToken": "###",
      "vettingScore": 80,
      "vettingClass": "STANDARD",
      "vettingStatus": "ACTIVE",
      "reasons": [
        "Company size as reported by government or business sources resulted in a score deduction: size range 6-10."
      ],
      "vettingDetails": {},
      "vettedDate": "2024-11-05T16:35:36.000Z",
      "createDate": "2024-11-05T16:35:36.000Z",
      "validUntil": "2025-11-05T16:35:36.000Z",
      "expirationDate": "2025-11-05T16:35:36.000Z"
    }
  ]
}
```

{% endtab %}
{% endtabs %}

## Parameters

* `brand_id` (required) - Brand ID


# Create 10DLC Brand Vetting

Submit a 10DLC brand for external vetting.

{% hint style="info" %}
<https://v1.api19.com/campaigns/brand/vetting/create>
{% endhint %}

{% tabs %}
{% tab title="Curl Post" %}
{% code title="curl" %}

```bash
curl https://v1.api19.com/campaigns/brand/vetting/create \
 -d 'key=api_token' \
 -d 'brand_id=B1A2C3D4E5' \
 -d 'evpId=EVP001' \
 -d 'vettingClass=STANDARD'
```

{% endcode %}
{% endtab %}

{% tab title="JSON Response" %}
{% code title="response.json" %}

```json
{
    "status": "ok",
    "data": {
        "evpId": "AEGIS",
        "vettingId": "###",
        "vettingToken": "###",
        "vettingScore": null,
        "vettingClass": "STANDARD",
        "vettingStatus": "PENDING",
        "reasons": null,
        "vettingDetails": {},
        "vettedDate": null,
        "createDate": "2025-02-07T17:26:11.539Z"
        "validUntil": null,
        "expirationDate": null
    }
}
```

{% endcode %}
{% endtab %}
{% endtabs %}

## Parameters

* `brand_id` (required) - Brand ID
* `evpId` (required) - External vetting provider ID
* `vettingClass` (required) - Vetting class type
* `additionalRequestPayload` (optional) - Additional data required by the vetting provider

## Developer Guide

### External Vets for SOLE\_PROPRIETORS and PUBLIC\_PROFITS

Some brand entity types have restrictions that can prohibit an external vetting request, or require that the brand have a specific identity status before the request is processed.

* **SOLE\_PROPRIETOR**: A brand with this entity type cannot request external vetting.
* **PUBLIC\_PROFIT**: A Public Profit brand must have a `VERIFIED` or `VETTED_VERIFIED` identity status in order to qualify for a new external vet or to import an external vet.

***

### Vetting Providers and Supported Vetting Classes

Some vetting providers only accept requests for specific types of vets (referred to as a vetting class). Additionally, certain vets are limited to a brand's national origin and entity type. The following table provides information on external vetting providers and the types of vets they accept.

#### Aegis Mobile

| EVP ID  | Vetting Class | Description                                                                                                                                                                                                                                                 |
| ------- | ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `AEGIS` | `STANDARD`    | <p>Requests a standard external vet. Allowed for US and non-US brands.<br><br><strong>Eligible Entity Types:</strong><br>• PRIVATE\_PROFIT, PUBLIC\_PROFIT, NON\_PROFIT, GOVERNMENT</p>                                                                     |
| `AEGIS` | `POLITICAL`   | <p>Requests a political external vet. Allowed for US brands only.<br><br><strong>Eligible Entity Types:</strong><br>• NON\_PROFIT</p>                                                                                                                       |
| `AEGIS` | `ENHANCED`    | <p>Requests an enhanced external vet. Allowed for US and non-US brands.<br><br><strong>Eligible Entity Types:</strong><br>• PRIVATE\_PROFIT, PUBLIC\_PROFIT, NON\_PROFIT, GOVERNMENT</p>                                                                    |
| `AEGIS` | `AUTHPLUS`    | <p>Requests an Authentication+ verification. Allowed for US and non-US brands.<br><br><strong>Eligible Entity Types:</strong><br>• PUBLIC\_PROFIT</p>                                                                                                       |
| `AEGIS` | `RBM`         | <p>Requests an RBM verification. Allowed for US and non-US brands. Completing an RBM vet automatically grants Auth+ compliance to a brand.<br><br><strong>Eligible Entity Types:</strong><br>• PRIVATE\_PROFIT, PUBLIC\_PROFIT, NON\_PROFIT, GOVERNMENT</p> |

#### WMC Global

| EVP ID | Vetting Class | Description                                                                                                                                              |
| ------ | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `WMC`  | `STANDARD`    | <p>Requests a standard external vet. Allowed for US brands only.<br><br><strong>Eligible Entity Types:</strong><br>• PRIVATE\_PROFIT, PUBLIC\_PROFIT</p> |
| `WMC`  | `POLITICAL`   | Not supported.                                                                                                                                           |
| `WMC`  | `ENHANCED`    | Not supported.                                                                                                                                           |
| `WMC`  | `AUTHPLUS`    | Not supported.                                                                                                                                           |
| `WMC`  | `RBM`         | Not supported.                                                                                                                                           |

### Requesting an External Vet

All vets are requested by using the `POST /campaigns/brand/vetting/create` endpoint. The JSON request body must contain a valid `evpId`, which is the identity of the external vetting provider (see table above), and a `vettingClass`. Supported vetting classes include `STANDARD`, `ENHANCED`, `POLITICAL`, `AUTHPLUS`, and `RBM`.

***

### Standard Vet

Standard vets can be used to verify a brand or potentially gain access to better throughput levels with network carriers. A Standard vet is an automated review of compliance history, employee count, and other business metrics. Once complete, a score of 0-100 will be provided to determine the brand's throughput level for particular carriers. Scores grant different terms per carrier, and feedback reasons are provided.

Standard vets can be requested through the API without the optional `additionalRequestPayload` parameter.

#### Example Request

```bash
curl -X 'POST' \
'https://v1.api19.com/campaigns/brand/vetting/create' \
-d "evpId=AEGIS" \
-d "vettingClass=STANDARD"
```

#### Example Response

```json
{
"evpId": "AEGIS",
"vettingId": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"vettingToken": null,
"vettingScore": null,
"vettingClass": "STANDARD",
"vettingStatus": "PENDING",
"reasons": null,
"vettingDetails": {},
"vettedDate": null,
"createDate": "2024-10-14T05:35:34.123Z",
"validUntil": null,
"expirationDate": null
}
```

***

### Enhanced Vet

Enhanced vets are typically requested if a user is dissatisfied with their Standard vet score. If a CSP has already submitted a Standard vet appeal and believes a more thorough review would yield a higher score, they can order an Enhanced vet.

Enhanced vets can be requested through the API without the optional `additionalRequestPayload` parameter.

#### Example Request

```bash
curl -X 'POST' \
'https://v1.api19.com/campaigns/brand/vetting/create' \
-d "evpId=AEGIS" \
-d "vettingClass=ENHANCED"
```

#### Example Response

```json
{
"evpId": "AEGIS",
"vettingId": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"vettingToken": null,
"vettingScore": null,
"vettingClass": "ENHANCED",
"vettingStatus": "PENDING",
"reasons": null,
"vettingDetails": {},
"vettedDate": null,
"createDate": "2024-10-14T05:36:30.129Z",
"validUntil": null,
"expirationDate": null
}
```

***

### Political Vet

Political vets allow brands to use the Political special use case. NON\_PROFIT brands that have a 501(c)(3/4/5/6) Tax Exempt Status are already granted access to the Political use case and are not allowed to request or import a Political vet from any vendor.

A request body parameter `additionalRequestPayload` is required when requesting Political vets. It's used to provide additional brand information that's required by vetting providers to successfully process the vetting request. Information on these fields can be found in Appendix A: Additional Payload Request Schema.

#### Example Request

```bash
curl -X 'POST' \
'https://v1.api19.com/campaigns/brand/vetting/create' \
-d "evpId=AEGIS" \
-d "vettingClass=POLITICAL" \
-d 'additionalRequestPayload={"requestorFirstName":"John","requestorLastName":"Doe","locale":"Federal","fecCommitteeTypeCode":"E","committeeId":"12345","candidateType":"PAC","stateLocalCommitteeType":"FEDERAL","localCommitteeState":"NY","localCommitteeMunicipality":"Brooklyn","tribalLocation":"US","filingUrl":"www.filingurl.com","filingRecordUrlInstructions":"sample instructions","filingEmail":"contact@domain.com","electionDate":"2026-12-26","pinPreference":"Regular"}'
```

#### Example Response

```json
{
"evpId": "AEGIS",
"vettingId": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"vettingToken": null,
"vettingScore": null,
"vettingClass": "POLITICAL",
"vettingStatus": "PENDING",
"reasons": null,
"vettingDetails": {},
"vettedDate": null,
"createDate": "2024-10-14T05:38:03.587Z",
"validUntil": "2025-10-14T05:38:03.587Z",
"expirationDate": "2025-10-14T05:38:03.587Z"
}
```

***

### Auth+ Vet

Auth+ vets verify a brand's business contact through a Two-Factor Authentication (2FA) email process. They are only available for PUBLIC\_PROFIT brands and are required for those brands to create new campaigns. For more information, see the Authentication+ 2.0 Feature Overview.

Auth+ vets can be requested through the API without the optional `additionalRequestPayload` parameter.

#### Example Request

```bash
curl -X 'POST' \
'https://v1.api19.com/campaigns/brand/vetting/create' \
-d "evpId=AEGIS" \
-d "vettingClass=AUTHPLUS"
```

#### Example Response

```json
{
"evpId": "AEGIS",
"vettingId": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"vettingToken": null,
"vettingScore": null,
"vettingClass": "AUTHPLUS",
"vettingStatus": "PENDING",
"reasons": null,
"vettingDetails": {},
"vettedDate": null,
"createDate": "2024-10-14T05:38:03.587Z",
"validUntil": "2025-10-14T05:38:03.587Z",
"expirationDate": "2025-10-14T05:38:03.587Z"
}
```

***

### RBM Vet

RBM vets verify a brand's eligibility for RCS Business Messaging (RBM) as well as a business contact through a Two-Factor Authentication (2FA) email process. They are available for all entity types except SOLE\_PROPRIETOR and are not tied to a brand's identity status (i.e., a brand can be VERIFIED or UNVERIFIED). Successfully completing an RBM vet automatically grants Authentication+ compliance without completing an Auth+ vet. For more information, see the RBM Vetting Feature Overview.

RBM vets can be requested through the API without the optional `additionalRequestPayload` parameter.

#### Example Request

```bash
curl -X 'POST' \
'https://v1.api19.com/campaigns/brand/vetting/create' \
-d "evpId=AEGIS" \
-d "vettingClass=RBM"
```

#### Example Response

```json
{
"evpId": "AEGIS",
"vettingId": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"vettingToken": null,
"vettingScore": null,
"vettingClass": "RBM",
"vettingStatus": "PENDING",
"reasons": null,
"vettingDetails": {},
"vettedDate": null,
"createDate": "2024-10-14T05:38:03.587Z",
"validUntil": "2025-10-14T05:38:03.587Z",
"expirationDate": "2025-10-14T05:38:03.587Z"
}
```

***

### Appendix A: Additional Payload Request Schema

| Attribute                     | Data Type | Required        | Description                                                                                                                                                                                       |
| ----------------------------- | --------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `requestorFirstName`          | String    | Yes             | <p>First name of the committee person who initiated the verification request. Must be an exact match with what is filed with the election authority.<br>Max Length: 100</p>                       |
| `requestorLastName`           | String    | Yes             | <p>Last name of the committee person who initiated the verification request. Must be an exact match with what is filed with the election authority.<br>Max Length: 100</p>                        |
| `locale`                      | String    | Yes             | <p>Accepted values: Federal, State, Local, Tribal<br>Max Length: 16</p>                                                                                                                           |
| `fecCommitteeTypeCode`        | String    | See description | <p>Required if Federal. Refer to Appendix C: Committee Type Codes for a list of acceptable values.<br>Max Length: 1</p>                                                                           |
| `committeeId`                 | String    | Yes             | <p>The issued committee/campaign ID from the election authority. If the election authority does not require a committee/campaign ID for the specified locale, enter 00000.<br>Max Length: 32</p>  |
| `candidateType`               | String    | Yes             | <p>Required for candidate campaigns. If the committee is not candidate-specific, enter PAC.<br>Max Length: 64</p>                                                                                 |
| `stateLocalCommitteeType`     | String    | Yes             | <p>Required for State, Local, and Tribal locales. If Federal, enter FEDERAL.<br>Max Length: 64</p>                                                                                                |
| `localCommitteeState`         | String    | Yes             | <p>If Federal Congress, enter the state to be represented. Refer to Appendix B: FEC Jurisdictions for acceptable values. If the election is for the US President, enter US.<br>Max Length: 32</p> |
| `localCommitteeMunicipality`  | String    | Yes             | <p>If Federal Congress, enter the district to be represented. If this is a presidential election, enter US.<br>Max Length: 64</p>                                                                 |
| `tribalLocation`              | String    | Yes             | <p>If the locale is not Tribal, enter US.<br>Max Length: 64</p>                                                                                                                                   |
| `filingUrl`                   | String    | Yes             | <p>The election authority website URL. This website should contain filing information.<br>Max Length: 256</p>                                                                                     |
| `filingRecordUrlInstructions` | String    | No              | <p>Additional instructions that provide information on how to locate the filing record.<br>Max Length: 256</p>                                                                                    |
| `filingEmail`                 | String    | No              | <p>The email address filed with the election authority. Must be an exact match. If not supplied, the Political vet's PIN cannot be sent via email.<br>Max Length: 128</p>                         |
| `electionDate`                | Date      | Yes             | <p>The date of the election in the format yyyy-mm-dd. Must be a future date.<br>Max Length: 10</p>                                                                                                |
| `pinPreference`               | String    | Yes             | <p>Indicates how to deliver the Political vet's PIN. Accepted values are: Regular, Express, Email.<br>Max Length: 16</p>                                                                          |

### Appendix B: FEC Jurisdictions

| Jurisdiction             | Abbreviation |
| ------------------------ | ------------ |
| Alabama                  | AL           |
| Alaska                   | AK           |
| Arizona                  | AZ           |
| Arkansas                 | AR           |
| California               | CA           |
| Colorado                 | CO           |
| Connecticut              | CT           |
| Delaware                 | DE           |
| Florida                  | FL           |
| Georgia                  | GA           |
| Hawaii                   | HI           |
| Idaho                    | ID           |
| Illinois                 | IL           |
| Indiana                  | IN           |
| Iowa                     | IA           |
| Kansas                   | KS           |
| Kentucky                 | KY           |
| Louisiana                | LA           |
| Maine                    | ME           |
| Maryland                 | MD           |
| Massachusetts            | MA           |
| Michigan                 | MI           |
| Minnesota                | MN           |
| Mississippi              | MS           |
| Missouri                 | MO           |
| Montana                  | MT           |
| Nebraska                 | NE           |
| Nevada                   | NV           |
| New Hampshire            | NH           |
| New Jersey               | NJ           |
| New Mexico               | NM           |
| New York                 | NY           |
| North Carolina           | NC           |
| North Dakota             | ND           |
| Ohio                     | OH           |
| Oklahoma                 | OK           |
| Oregon                   | OR           |
| Pennsylvania             | PA           |
| Rhode Island             | RI           |
| South Carolina           | SC           |
| South Dakota             | SD           |
| Tennessee                | TN           |
| Texas                    | TX           |
| Utah                     | UT           |
| Vermont                  | VT           |
| Virginia                 | VA           |
| Washington               | WA           |
| West Virginia            | WV           |
| Wisconsin                | WI           |
| Wyoming                  | WY           |
| District of Columbia     | DC           |
| American Samoa           | AS           |
| Guam                     | GU           |
| Northern Mariana Islands | MP           |
| Puerto Rico              | PR           |
| US Virgin Islands        | VI           |
| United States            | US           |

***

### Appendix C: Committee Type Codes

This information is reprinted from the Federal Election Commission website.

| Code | Committee Type                                            | Description                                                                                                                                                                                                                                                                                       |
| ---- | --------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| C    | Communication cost                                        | Organizations like corporations or unions may prepare communications for their employees or members that advocate the election of specific candidates and they must disclose them under certain circumstances. These are usually paid with direct corporate or union funds rather than from PACs. |
| D    | Delegate committee                                        | Delegate committees are organized for the purpose of influencing the selection of delegates to Presidential nominating conventions. The term includes a group of delegates, a group of individuals seeking to become delegates, and a group of individuals supporting delegates.                  |
| E    | Electioneering communication                              | Groups (other than PACs) making electioneering communications.                                                                                                                                                                                                                                    |
| H    | House                                                     | Campaign committees for candidates for the U.S. House of Representatives.                                                                                                                                                                                                                         |
| I    | Independent expenditor (person or group)                  | Individuals or groups (other than PACs) making independent expenditures over $250 in a year must disclose those expenditures.                                                                                                                                                                     |
| N    | PAC - Nonqualified                                        | PACs that have not yet been in existence for six months and received contributions from 50 people and made contributions to five federal candidates. These committees have lower limits for their contributions to candidates.                                                                    |
| O    | Independent expenditure-only (Super PACs)                 | Political Committee that has filed a statement consistent with AO 2010-09 or AO 2010-11.                                                                                                                                                                                                          |
| P    | Presidential                                              | Campaign committee for candidate for U.S. President.                                                                                                                                                                                                                                              |
| Q    | PAC - Qualified                                           | PACs that have been in existence for six months and received contributions from 50 people and made contributions to five federal candidates.                                                                                                                                                      |
| S    | Senate                                                    | Campaign committee for candidate for Senate.                                                                                                                                                                                                                                                      |
| U    | Single-candidate independent expenditure                  | No description provided.                                                                                                                                                                                                                                                                          |
| V    | Hybrid PAC (with Non-Contribution Account) - Nonqualified | Political committees with non-contribution accounts.                                                                                                                                                                                                                                              |
| W    | Hybrid PAC with Non-Contribution Account - Qualified      | Political committees with non-contribution accounts.                                                                                                                                                                                                                                              |
| X    | Party - Nonqualified                                      | Party committees that have not yet been in existence for six months and received contributions from 50 people, unless they are affiliated with another party committee that has met these requirements.                                                                                           |
| Y    | Party - Qualified                                         | Party committees that have existed for at least six months and received contributions from 50 people or are affiliated with another party committee that meets these requirements.                                                                                                                |
| Z    | National party non-federal account                        | National party non-federal accounts. Not permitted after enactment of Bipartisan Campaign Reform Act of 2002.                                                                                                                                                                                     |


# Get 10DLC Campaign

## GET or POST Request

{% hint style="info" %}
<https://v1.api19.com/campaigns/campaign/get>
{% endhint %}

Get details of a specific 10DLC campaign

{% tabs %}
{% tab title="Curl Post" %}
{% code title="Curl (POST)" %}

```bash
curl https://v1.api19.com/campaigns/campaign/get \
 -d 'key=api_token' \
 -d 'id=12345'
```

{% endcode %}
{% endtab %}

{% tab title="Curl Get" %}
{% code title="Curl (GET)" %}

```bash
curl https://v1.api19.com/campaigns/campaign/get?key=apikey&id=12345
```

{% endcode %}
{% endtab %}

{% tab title="JSON Response" %}
{% code title="Response (application/json)" %}

```json
{
  "status": "ok",
  "data": {
    "id": "123",
    "name": null,
    "user_id": "321",
    "sms_daily_limit": null,
    "crid": "none",
    "mms_url": "",
    "campaign_description": "...",
    "call_to_action": "...",
    "sample_message_1": "...",
    "sample_message_2": "",
    "sample_message_3": "",
    "sample_message_4": "",
    "sample_message_5": "",
    "start_keywords": "START,YES",
    "opted_in_start": "...",
    "stop_keywords": "STOP",
    "opted_in_stop": "...",
    "help_keywords": "HELP",
    "opted_in_help": "...",
    "accepted_link": "",
    "accepted_phone_number": "",
    "accepted_loans": "no",
    "accepted_age_gated": "no",
    "accepted_number_pool": "no",
    "brand_id": "B12345",
    "use_case_type": "MIXED",
    "local_status": "new",
    "carrier_status": "new",
    "local_brand_id": "",
    "local_campaign_id": "...",
    "alt_use_cases": "[\"2FA\",\"ACCOUNT_NOTIFICATION\"]",
    "create_dt": "2026-05-08 10:00:46",
    "submitted": "no",
    "syniverse_status": "new",
    "reject_reason": null,
    "brand": {
      "id": "123",
      "user_id": "321",
      "company_type": "PRIVATE_PROFIT",
      "tin": "456",
      "alt_company": "NONE",
      "alt_company_data": "",
      "company_name": "...",
      "dba": "...",
      "brand_id": "B12345",
      "firstname": "",
      "lastname": "",
      "address1": "...",
      "address2": "",
      "city": "...",
      "state": "CO",
      "zip": "45678",
      "country": "US",
      "email": "...",
      "website": "...",
      "phone": "5555555555",
      "mobilephone": "0",
      "status": "registered",
      "error": null,
      "create_dt": "2025-05-27 11:36:43",
      "updated_dt": "2025-05-27 11:38:02",
      "brandRelationship": "MEDIUM_ACCOUNT",
      "referenceid": "...",
      "identity_status": "VERIFIED",
      "vertical": "PROFESSIONAL"
    }
  }
}
```

{% endcode %}
{% endtab %}
{% endtabs %}

## Parameters

* `id` (required) - Campaign ID


# Get 10DLC Campaign Numbers

## GET or POST Request

{% hint style="info" %}
<https://v1.api19.com/campaigns/campaign/numbers>
{% endhint %}

Get numbers associated with a specific 10DLC campaign

{% tabs %}
{% tab title="Curl Post" %}
{% code title="Curl (POST)" %}

```bash
curl https://v1.api19.com/campaigns/campaign/numbers \
 -d 'key=api_token' \
 -d 'id=12345'
```

{% endcode %}
{% endtab %}

{% tab title="Curl Get" %}
{% code title="Curl (GET)" %}

```bash
curl https://v1.api19.com/campaigns/campaign/numbers?key=apikey&id=12345
```

{% endcode %}
{% endtab %}

{% tab title="JSON Response" %}
{% code title="Response (application/json)" %}

```json
{
	"status": "ok",
	"data": {
		"registryId": [ 
			'5555555555',
			'6666666666',
			'7777777777'
		]
	}
}
```

{% endcode %}
{% endtab %}
{% endtabs %}

## Parameters

* `id` (required) - Campaign ID


# Create 10DLC Campaign

{% hint style="info" %}
<https://v1.api19.com/campaigns/campaign/create>
{% endhint %}

Create a new 10DLC campaign

{% tabs %}
{% tab title="Curl Post" %}
{% code title="curl" %}

```bash
curl https://v1.api19.com/campaigns/campaign/create \
 -d 'key=api_token' \
 -d 'brand_id=B1A2C3D4E5' \
 -d 'campaign_description=Customer notifications and alerts' \
 -d 'call_to_action=Reply YES to confirm' \
 -d 'sample_message_1=Your order #12345 has shipped' \
 -d 'opted_in_start=START' \
 -d 'opted_in_stop=STOP' \
 -d 'opted_in_help=HELP' \
 -d 'use_case_type=2FA'
```

{% endcode %}
{% endtab %}

{% tab title="JSON Response" %}
{% code title="response.json" %}

```json
{
	"status": "ok",
	"campaign_id": "string"
}
```

{% endcode %}
{% endtab %}
{% endtabs %}

## Required Parameters

* `brand_id` (required) - 10DLC Brand ID
* `campaign_description` (required) - Description of the campaign
* `call_to_action` (required) - Call to action for subscribers
* `sample_message_1` (required) - Sample message
* `opted_in_start` (required) - Opt-in start message
* `opted_in_stop` (required) - Opt-in stop message
* `opted_in_help` (required) - Opt-in help message
* `use_case_type` (required) - Campaign use case type
* `mixed_use_cases` - (required when use\_case\_type is MIXED) Select up to 5 sub use cases. Comma separated string (e.g. "2FA, ACCOUNT\_NOTIFICATION, DELIVERY\_NOTIFICATION")

## Optional Parameters

* `mms-upload` - MMS media URL
* `sample_message_2` - Additional sample message
* `sample_message_3` - Additional sample message
* `sample_message_4` - Additional sample message
* `sample_message_5` - Additional sample message
* `keywords_start` - Keywords for start
* `keywords_stop` - Keywords for stop
* `keywords_help` - Keywords for help
* `accept_links` - Whether campaign accepts links
* `email_domain_name` - Email domain name
* `accept_phone_numbers` - Whether campaign accepts phone numbers
* `accept_loans` - Whether campaign involves loans
* `accept_age_gated` - Whether campaign is age-gated

Available Use Case Types:

* MIXED
* 2FA
* ACCOUNT\_NOTIFICATION
* AGENTS\_FRANCHISES
* CARRIER\_EXEMPT
* CHARITY
* CUSTOMER\_CARE
* DELIVERY\_NOTIFICATION
* EMERGENCY
* FRAUD\_ALERT
* HIGHER\_EDUCATION
* K12\_EDUCATION
* LOW\_VOLUME
* M2M
* MARKETING
* POLITICAL
* POLLING\_VOTING
* PROXY
* PUBLIC\_SERVICE\_ANNOUNCEMENT
* SECURITY\_ALERT
* SOCIAL
* SOLE\_PROPRIETOR
* SWEEPSTAKE
* UCAAS\_HIGH
* UCAAS\_LOW


# Update 10DLC Campaign

## POST Request

{% hint style="info" %}
<https://v1.api19.com/campaigns/campaign/update>
{% endhint %}

Update an existing 10DLC campaign

{% tabs %}
{% tab title="Curl Post" %}

```bash
curl https://v1.api19.com/campaigns/campaign/update \
 -d 'key=api_token' \
 -d 'id=C12345' \
 -d 'campaign_description=Updated campaign description' \
 -d 'call_to_action=Reply YES to opt in' \
 -d 'accepted_loans=false' \
 -d 'accepted_age_gated=false' \
 -d 'accepted_number_pool=true'
```

{% endtab %}

{% tab title="JSON Response" %}

```json
{
	"status": "ok",
	"data": "campaign updated"
}
```

{% endtab %}
{% endtabs %}

## Required Parameters

* `id` (required) - Campaign ID
* `mms_url` (required) - MMS media URL
* `campaign_description` (required) - Campaign description
* `call_to_action` (required) - Call to action
* `accepted_loans` (required) - Whether campaign involves loans
* `accepted_age_gated` (required) - Whether campaign is age-gated
* `accepted_number_pool` (required) - Whether using number pool

## Optional Parameters

{% hint style="warning" %}
Warning: Optional fields will be set to default values if omitted. It is HIGHLY suggested to repost all data associated with a campaign.
{% endhint %}

* `sample_message_1` - Sample message
* `sample_message_2` - Additional sample message
* `sample_message_3` - Additional sample message
* `sample_message_4` - Additional sample message
* `sample_message_5` - Additional sample message
* `start_keywords` - Start keywords
* `opted_in_start` - Opt-in start message
* `stop_keywords` - Stop keywords
* `opted_in_stop` - Opt-in stop message
* `help_keywords` - Help keywords
* `opted_in_help` - Opt-in help message
* `accepted_link` - Whether campaign accepts links
* `accepted_phone_number` - Whether campaign accepts phone numbers
* `use_case_type` - Campaign use case type
* `resubmit` - Whether to resubmit the campaign


# Remove 10DLC Campaign

## POST Request

{% hint style="info" %}
<https://v1.api19.com/campaigns/campaign/remove>
{% endhint %}

Remove/Deactivate a 10DLC campaign from your account

Note: This does not delete a campaign, but marks it as inactive (removes billing). It will still remain data retention purposes.

{% tabs %}
{% tab title="Curl Post" %}
{% code title="curl" %}

```bash
curl https://v1.api19.com/campaigns/campaign/remove \
 -d 'key=api_token' \
 -d 'id=C12345'
```

{% endcode %}
{% endtab %}

{% tab title="JSON Response" %}
{% code title="Response (JSON)" %}

```json
{
    "status": "ok",
    "message": "Campaign deactivated"
}

OR

{
    "status": "error",
    "error": "Campaign not found"
}
```

{% endcode %}
{% endtab %}
{% endtabs %}

## Parameters

* `id` (required) - Campaign ID


# Calls

Send and receive calls using RESTFUL connections

{% hint style="info" %}
**API Token Notice**

You will need both your API Token and your Call API SID (ACCOUNT\_SID). Both are available in User Settings at the top right of the portal.

The Call API SID is required in request URL for many commands to differentiate different voice call accounts.

Every request will require you to set the HTTP username and password as the API\_Token (in curl this is: curl -u 'API\_Token:API\_Token')

We only care about the username but many clients require both.
{% endhint %}

{% hint style="info" %}
**Request Replies**

JSON and XML are supported as possible responses to requests. XML is supported as backwards compatibility to competing platforms.

JSON is the default. To force receive JSON replies, .json can be at the end of all URL requests. Most of the documentation has .json at the end of the URL.

To receive XML replies, remove .json from the end of URL requests.
{% endhint %}

### Overview <a href="#overview" id="overview"></a>

Build voice applications for any app, website or voice based communications system with the help of our powerful drag and drop Visual Designer or robust Programmable Voice APIs.

You can [jump to making call examples here.](https://apidocs.api19.com/call-apis/outgoing-calls/making-calls/example-code/outbound-to-tel)

### Programmable Voice features <a href="#programmable_voice_features" id="programmable_voice_features"></a>

**Intelligent Call Control**

Take control over your app call flow including call forwarding and routing, call transfers, collecting input, playing music, recording and storing calls, leaving a voicemail, sending an SMS and email and more.

**Call Conference**

CallAPI provides robust scalable audio conferencing functionality for your collaboration needs. You can create room-based and ad-hoc conferences with personal identification (PIN) codes that offer full conference room controls for a moderator including muting and dropping participants.

**Speech recognition**

CallAPI Speech Recognition API captures your speech in real-time, transcribes it, and returns text. Automatic speech recognition enables you to create applications and services that listen to users in 119 languages without any pre-training and acts on partial recognition results as your customer speaks. Imagine users driving your next app or service by talking to it!

**Audio Playback**

CallAPI enables your apps with a rich calling experience that includes playing customized voice prompts and hold music by uploading your choice of audio file.

**Recording**

CallAPI includes built-in and programmatic media recording. Using Visual Designer or APIs, your team can implement features for recording voicemail and meetings, integrating stored call recordings with your preferred Customer Relationship Management tools or build your own dashboard. CallAPI is compatible with popular external transcription services to transcribe recordings from voice to text.

**IP Interfaces and API’s**

CallAPI allows you to connect your existing SIP or WebRTC infrastructure from PBX to SIP or WebRTC Clients to the cloud and easily create VoIP call experiences.

**Text-to-speech**

Create synthesized audio messages that are delivered in language, accent and gender configured for your users.


# Set Incoming URL

Set the URL for incoming calls

Incoming calls for numbers can be set either:

1. In the Call Flows under Numbers in the portal
2. On an individual DID basis

## By API Call

{% hint style="info" %}
&#x20;URI: <https://v1.api19.com/dids/set/callurl>
{% endhint %}

**Supported Operations**: **HTTP POST**

Sets the URL for a specific phone number to route to when needed.

**Request Parameters**

| Parameter | Description                                                |
| --------- | ---------------------------------------------------------- |
| token     | Your customer API Token                                    |
| did       | The phone number to set the URL for or none to set no url. |
| url       | The HTTP/HTTPS URL to set route the call to.               |

Example CURL call:

{% tabs %}
{% tab title="Curl" %}

```php
curl -X POST https://v1.api19.com/dids/my/callurl
   -d 'key=API_Token' \
   -d 'did=number' \
   -d 'url=http_url'
```

{% endtab %}
{% endtabs %}


# Incoming Calls

## HTTP Post from CallAPI to your web server

Once you have the Incoming Call URL set, the web calls will come in normal HTTP post variables as displayed below.\
**POST Objects - Incoming Post Request - New Incoming Call**<br>

```php
POST fields in readable format:
    [CallSid]       => IDfbf7e812ere32hfhfg6e10-Cd5dacca0c-CA9d3572be-9f7a-11ea-97f4-5ffeb3239325
    [InstanceId]    => ID242258723hHds8fh29G4569b66e10
    [AccountSid]    => AC06bc1hjh293hFH9edjJ23539a9ddb1
    [From]          => 3035550000
    [To]            => 8044731212
    [CallStatus]    => ringing OR completed OR failed OR in-progress OR no-answer
    [ApiVersion]    => 2012-04-24
    [Direction]     => inbound
    [CallerName]    => 3035550000
    [ForwardedFrom] => null
    [CallTimestamp] => 2020-05-26T17:59:16.555Z
    [PostStatus]    => callback OR new
```

**POST Objects - Status Update from an Outbound Call**

```php
    [CallSid]           => ID242253601re32hfhfg6e10-CAceda56a709534034ae7c0e3a304b4d96
    [InstanceId]        => ID242258723hHds8fh29G4569b66e10
    [AccountSid]        => AC06bc1hjh293hFH9edjJ23539a9ddb1
    [From]              => 8044735555
    [To]                => 3035551212
    [CallStatus]        => in-progress
    [ApiVersion]        => 2012-04-24
    [Direction]         => outbound-api
    [CallerName]        => 8044735896
    [ForwardedFrom]     => null
    [CallTimestamp]     => 2020-05-26T17:29:55.125Z
    [VoicemailDetector] => voicemail [or] person_found
```

#### 3.4.1 Post Fields - Incoming Calls <a href="#calls_attributes" id="calls_attributes"></a>

| Attribute         | Description                                                                                                                                                                                                     |
| ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **CallSid**       | A string that uniquely identifies this call.                                                                                                                                                                    |
| **InstanceId**    | Server instance ID that this call came from.                                                                                                                                                                    |
| **AccountSid**    | The date that this call was created.                                                                                                                                                                            |
| **From**          | The party who initiated the call.                                                                                                                                                                               |
| **To**            | The party who received the call.                                                                                                                                                                                |
| **CallStatus**    | <p>A descriptive status for the call. The value is one of these:</p><p>completed, failed, ringing, in-progress, no-answer, queued, wait-for-answer, or initiated</p>                                            |
| **ApiVersion**    | Always set to 2012-04-24.                                                                                                                                                                                       |
| **Direction**     | Always inbound for inbound calls.                                                                                                                                                                               |
| **CallerName**    | <p>If this call was an incoming call, the caller’s name.<br>Empty otherwise.</p>                                                                                                                                |
| **ForwardedFrom** | Where the call was forwarded from (null normally).                                                                                                                                                              |
| **CallTimestamp** | Timestamp when the call began: 2023-06-01T03:15:51.929Z.                                                                                                                                                        |
| **PostStatus**    | <p>Set to new or callback <br><em><strong>new</strong></em> - the call is coming in for the first time. <br><em><strong>callback</strong></em> - this is a callback notification / advancement of the call.</p> |

## Incoming Call Actions

Once a call has been posted to your server, you can use the API Call Markup Language to process requests. A quick example:

```
<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Say voice="woman">Please hold while your call is connceted</Say>
    <Dial>18004444444</Dial>
</Response>
```

[Click here to view the Markup Language documentation.](/call-api-markup/api-call-markup-language)


# Listing Calls

Listing and Searching Call History

A Call represents a connection between a phone or user agent and the platform. This may be inbound or outbound. The Calls list resource represents the set of phone calls originated and terminated from an account. This section will focus on only using HTTP POST functions.

## Section URI

{% hint style="info" %}
List all calls&#x20;

**/call/2012-04-24/Accounts/{AccountSid}/ListCalls**
{% endhint %}

**or**

{% hint style="info" %}
List an individual call&#x20;

**/call/2012-04-24/Accounts/{AccountSid}/ListCalls/{CallSid}**
{% endhint %}

## Standard Request Parameters

<table><thead><tr><th width="154">Parameter</th><th width="129">Required</th><th>Description</th></tr></thead><tbody><tr><td>From</td><td>no</td><td>The source or from phone number</td></tr><tr><td>To</td><td>no</td><td>The destination or to phone number</td></tr></tbody></table>

## Pagination Request Parameters

None of the pagination requests are required

<table><thead><tr><th width="164">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>Page</strong></td><td>The current page number. Zero-indexed, so the first page is 0. 0-20000</td></tr><tr><td><strong>PageSize</strong></td><td>How many items are on each page 0-2000</td></tr><tr><td><strong>StartTime</strong></td><td><p>Only show recordings that were made on this date/time or later EndTime value examples allowed: </p><p>2024-04-01T10:10:10 </p><p>2024-04-01 10:10:10 </p><p>2024-04-01</p></td></tr><tr><td><strong>EndTime</strong></td><td><p>Only show recordings that were made on this date/time or earlier EndTime value examples allowed: </p><p>2024-04-01T10:10:10 </p><p>2024-04-01 10:10:10 </p><p>2024-04-01</p></td></tr><tr><td><strong>CallSid</strong></td><td>Only show recordings that have been started from this CallSid Value: CallSid=h923fh2h32fj23f2</td></tr><tr><td><strong>SortBy</strong></td><td>Sort by the date created instead of the most recent on top Value: DateCreated <strong>or</strong> DateAsc</td></tr></tbody></table>

## POST or GET Requests

Send us a request to list the calls for today or search for specific calls

Searching your calls can include POST or GET variables From, To, Sid or Limit.

{% tabs %}
{% tab title="Search List" %}

```php
curl -X POST https://v1.api19.com/call/2012-04-24/Accounts/AC021d7d7d49d3234r34t3ea3769b9ed7/ListCalls \
   -d 'From=17207741111' \
   -d 'To=13038927627' \
   -d 'PageSize=1000 \
   -u '239h2g-23h9-239f23hf:AC021d7d7d49d3234r34t3ea3769b9ed7'
```

{% endtab %}

{% tab title="List Last" %}

```javascript
curl https://v1.api19.com/call/2012-04-24/Accounts/AC021d7d7d49d3234r34t3ea3769b9ed7/ListCalls \
   -u '239h2g-23h9-239f23hf:AC021d7d7d49d3234r34t3ea3769b9ed7'
```

{% endtab %}

{% tab title="List Individual Call" %}

```javascript
curl https://v1.api19.com/call/2012-04-24/Accounts/AC021d7d7d49d3234r34t3ea3769b9ed7/ListCalls/ID13eeaa83f4c34aa28a9a7210995e1cbd-CA0257edff74b345b1b63076ef12a93b \
   -u '239h2g-23h9-239f23hf:AC021d7d7d49d3234r34t3ea3769b9ed7'
```

{% endtab %}
{% endtabs %}

## Calls Attributes in Response

| Attribute      | Description                                                                                                                                               |
| -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Sid            | A string that uniquely identifies a call.                                                                                                                 |
| ParentCallSid  | A string that uniquely identifies the call that created this leg.                                                                                         |
| DateCreated    | The date that this call was created.                                                                                                                      |
| DateUpdated    | The date that this call was last updated.                                                                                                                 |
| AccountSid     | The unique id of the Account that created this call.                                                                                                      |
| To             | The phone number or identifier that will be the recipient of this call.                                                                                   |
| From           | The phone number or identifier that originated this call.                                                                                                 |
| PhoneNumberSid | If the call was inbound, this is the Sid of the IncomingPhoneNumber that received the call.                                                               |
| Status         | A string representing the status of the call. Possible values are queued, ringing, in-progress, completed, failed, busy and no-answer.                    |
| StartTime      | The start time of the call. Empty if the call has not yet been started.                                                                                   |
| EndTime        | The end time of the call. Empty if the call has not ended.                                                                                                |
| Duration       | The length of the call in seconds.                                                                                                                        |
| Price          | The charge for this call, in the currency associated with the account. Populated after the call is completed.                                             |
| Direction      | A string describing the direction of the call. Possible values are inbound, outbound-api, and outbound-dial                                               |
| AnsweredBy     | If this call was initiated with answering machine detection, either human or machine. Empty otherwise.                                                    |
| ApiVersion     | Displays the current API version                                                                                                                          |
| ForwardFrom    | If this call was an incoming call forwarded from another number, the forwarding phone number (depends on carrier supporting forwarding). Empty otherwise. |
| CallerName     | If this call was an incoming call, the caller’s name. Empty otherwise.                                                                                    |
| Uri            | <p>The URI for this account, relative to<br><https://v1.api19.com/call/2012-04-24/Accounts></p>                                                           |

## Get call details

## Example JSON Responses

Here is what the JSON will look like when there are multiple calls vs a single call

{% tabs %}
{% tab title="Single Call" %}

```
{
  "sid": "IDf0cbf85b95df45deb3cb404235e7c26e-CA9a2229464e2843dd84903313b5680714",
  "InstanceId": "IDf0cbf85b95df45deb3cb404235e7c26e",
  "date_created": "Wed, 4 Sep 2024 00:26:56 +0000",
  "date_updated": "Wed, 4 Sep 2024 00:27:03 +0000",
  "account_sid": "AC025S7d7d49d7f923432552ea3769b9ed7",
  "to": "1303666627",
  "from": "1720444493",
  "status": "in-progress",
  "start_time": "2024-09-04T00:27:03.381Z",
  "duration": 0,
  "price_unit": "USD",
  "direction": "outbound-api",
  "answered_by": "1303666627",
  "api_version": "2012-04-24",
  "caller_name": "1720444493",
  "uri": "/call/2012-04-24/Accounts/AC025S7d7d49d7f923432552ea3769b9ed7/Calls/IDf0cbf85b95df45deb3cb404235e7c26e-CA9a2229464e2843dd84903313b5680714.json",
  "ring_duration": 3,
  "subresource_uris": {
    "notifications": "/call/2012-04-24/Accounts/AC025S7d7d49d7f923432552ea3769b9ed7/Calls/IDf0cbf85b95df45deb3cb404235e7c26e-CA9a2229464e2843dd84903313b5680714/Notifications.json",
    "recordings": "/call/2012-04-24/Accounts/AC025S7d7d49d7f923432552ea3769b9ed7/Calls/IDf0cbf85b95df45deb3cb404235e7c26e-CA9a2229464e2843dd84903313b5680714/Recordings.json"
  }
} 
```

{% endtab %}

{% tab title="Multiple Calls" %}

```
[
    {
        "sid": "IDc473e064b2b34acbb104ea06acee5f42-CA5a6b8264a9c24e97a30fe3721fd9e5b4",
        "InstanceID": "IDc473e064b2b34acbb104ea06acee5f42",
        "date_created": "Wed, 4 Sep 2024 01:26:54 +0000",
        "date_updated": "Wed, 4 Sep 2024 01:26:56 +0000",
        "account_sid": "AC021d7d7d49d7f95749488ea3788wj92s",
        "to": "13038144444",
        "from": "17207747777",
        "status": "canceled",
        "start_time": "Wed, 4 Sep 2024 01:26:54 +0000",
        "duration": "0",
        "price_unit": "USD",
        "direction": "outbound-api",
        "answered_by": "13038144444",
        "api_version": "2012-04-24",
        "caller_name": "17207747777",
        "uri": "/2012-04-24/Accounts/AC021d7d7d49d7f95749488ea3788wj92s/Calls/IDc473e064b2b34acbb104ea06acee5f42-CA5a6b8264a9c24e97a30fe3721fd9e5b4",
        "ring_duration": "0",
        "subresource_uris": {
            "notification": "/call/2012-04-24/Accounts/AC021d7d7d49d7f95749488ea3788wj92s/Calls/IDc473e064b2b34acbb104ea06acee5f42-CA5a6b8264a9c24e97a30fe3721fd9e5b4/Notifications.json",
            "recordings": "/call/2012-04-24/Accounts/AC021d7d7d49d7f95749488ea3788wj92s/Calls/IDc473e064b2b34acbb104ea06acee5f42-CA5a6b8264a9c24e97a30fe3721fd9e5b4/Recordings.json"
        }
    },
    {
        "sid": "IDf0cbf85b95df45deb3cb404235e7c26e-CAc991833d718849af98ac80582e3729fb",
        "InstanceID": "IDf0cbf85b95df45deb3cb404235e7c26e",
        "date_created": "Wed, 4 Sep 2024 01:25:06 +0000",
        "date_updated": "Wed, 4 Sep 2024 01:25:16 +0000",
        "account_sid": "AC021d7d7d49d7f95749488ea3788wj92s",
        "to": "13038144445",
        "from": "17207747772",
        "status": "completed",
        "start_time": "Wed, 4 Sep 2024 01:25:06 +0000",
        "duration": "5",
        "price_unit": "USD",
        "direction": "outbound-api",
        "answered_by": "13038144445",
        "api_version": "2012-04-24",
        "caller_name": "17207747772",
        "uri": "/2012-04-24/Accounts/AC021d7d7d49d7f95749488ea3788wj92s/Calls/IDf0cbf85b95df45deb3cb404235e7c26e-CAc991833d718849af98ac80582e3729fb",
        "ring_duration": "0",
        "subresource_uris": {
            "notification": "/call/2012-04-24/Accounts/AC021d7d7d49d7f95749488ea3788wj92s/Calls/IDf0cbf85b95df45deb3cb404235e7c26e-CAc991833d718849af98ac80582e3729fb/Notifications.json",
            "recordings": "/call/2012-04-24/Accounts/AC021d7d7d49d7f95749488ea3788wj92s/Calls/IDf0cbf85b95df45deb3cb404235e7c26e-CAc991833d718849af98ac80582e3729fb/Recordings.json"
        }
    }
] 
```

{% endtab %}
{% endtabs %}


# Making Calls

The /call/ function serves several purposes. In this section, we will cover the creating new calls utilizing **POST** variables.

{% hint style="info" %}
**API Token Notice**

You will need both your API Token and your Call API SID (ACCOUNT\_SID). Both are available in User Settings at the top right of the portal.
{% endhint %}

## Section URI

{% hint style="info" %}
&#x20;**<https://v1.api19.com/call/2012-04-24/Accounts/ACCOUNT\\_SID/Calls.json>**
{% endhint %}

#### Supported Operations <a href="#supported_operations" id="supported_operations"></a>

**HTTP GET**\
Returns a list representation of all Call resources for this Account, including the properties above.

**HTTP POST**\
&#x20;Makes a new Call and returns a representation of the Call resource, including the properties above

#### Request Parameters <a href="#request_parameters" id="request_parameters"></a>

| Parameter                | Description                                                                                                                                                                          |
| ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **From(Required)**       | The phone number to use as the caller id.                                                                                                                                            |
| **To (Required)**        | The phone number to call.                                                                                                                                                            |
| **Url (Required)**       | The fully qualified URL that should be executed when the call connects.                                                                                                              |
| **Method**               | The HTTP method CallAPI should use when making its request to the above Url. Defaults to POST.                                                                                       |
| **FallbackUrl**          | The URL that CallAPI will request if execution of Url fails for any reason.                                                                                                          |
| **FallbackMethod**       | <p>The HTTP method that CallAPI should use to request the FallbackUrl. Must be either GET or POST. <br>Defaults to POST.</p>                                                         |
| **StatusCallbackEvent**  | <p>A comma separated list of events on which we are interested to get a callback on. Possible values are <em>initiated, ringing, answered, completed</em>. <br>Defaults to none.</p> |
| **StatusCallback**       | URL to receive the callback events at. Defaults to none.                                                                                                                             |
| **StatusCallbackMethod** | Set to GET or POST. Defaults to POST.                                                                                                                                                |
| **Timeout**              | The number of seconds that CallAPI should allow the phone to ring before assuming there is no answer. Defaults to 60 seconds.                                                        |

**StatusCallbackEvent**

When creating a Call using the Calls API, an outbound call is initiated. The call transitions from the initiated state to the ringing state when the phone starts ringing. It transitions to the answered state when the call is picked up, and finally to the completed state when the call is over.\
With **StatusCallbackEvent**, you can subscribe to receive webhooks for the different call progress events: initiated, ringing, answered, or completed for a given call.

The **StatusCallbackEvent** attribute allows you to specify which events CallAPI should webhook on. To specify multiple events separate them with a comma as follows: *initiated,ringing,answered,completed.* If a StatusCallback is provided and no status callback events are specified, the completed event will be sent by default..

| initiated         | The *initiated* event is fired when CallAPI starts dialing the call.                                                                                                                                                                                     |
| ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ringing           | The *ringing* event is fired when the call starts ringing.                                                                                                                                                                                               |
| answered          | The *answered* event is fired when the call is answere&#x64;**.**                                                                                                                                                                                        |
| completed         | <p>The <em>completed</em> event is fired when the call is completed, regardless of the termination status: <em>busy, canceled, completed, failed, or no-answer</em>. <br>If no StatusCallbackEvent is specified, completed will be fired by default.</p> |
| VoicemailDetector | person\_found or voicemail is sent if the original request had DetectVoicemail on it.                                                                                                                                                                    |

**StatusCallback**

The StatusCallback attribute allows you to specify a URL for CallAPI to send webhook requests to on each event specified in the StatusCallbackEvent attribute.

**StatusCallbackMethod**

The StatusCallbackMethod attribute allows you to specify which HTTP method CallAPI should use when requesting the URL in the StatusCallback attribute. The default is POST

**Status Callback HTTP Parameters**

The parameters CallAPI passes to your application in an asynchronous request to the StatusCallback URL include all parameters passed in a synchronous request to retrieve RCML when CallAPI receives a call to one of your CallAPI numbers. The full list of parameters and descriptions of each are in the RCML Voice Request documentation.

When the call progress events are fired, the Status Callback request also passes these additional parameters:

| Parameter          | Description                                                                                                                                                                                          |
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **CallSid**        | A unique identifier for this call generated by CallAPI . You can use CallSid to modify the child call by POSTing to Calls/{CallSid} with a new RCML URL.                                             |
| **CallStatus**     | A descriptive status for the call. The value is one of *queued, initiated, ringing, in-progress, busy, failed, or no-answer*. See CallStatus for more details.                                       |
| **CallDuration**   | The duration of the just-completed call, in seconds. Only present in the *completed* event.                                                                                                          |
| **Timestamp**      | The timestamp when the event was fired, given as UTC in [RFC 2822](http://php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format.                                                   |
| **CallbackSource** | A string that describes the source of the webhook. This is provided to help disambiguate why the webhook was made. On Status Callbacks, this value is always *call-progress-events*.                 |
| **SequenceNumber** | The order in which the events were fired, starting from 0. Although events are fired in order, they are made as separate HTTP requests and there is no guarantee they will arrive in the same order. |

**To redirect or terminate a live call, you make an HTTP POST request to an in¬-progress Call instance resource URI:**

```
/call/2012-04-24/Accounts/{AccountSid}/Calls/{CallSid} 
or
/call/2012-04-24/Accounts/{AccountSid}/Calls.json/{CallSid}
```


# Example Code

{% hint style="info" %}
**API Token Notice**

You will need both your API Token and your Call API SID (ACCOUNT\_SID). Both are available in User Settings at the top right of the portal.
{% endhint %}

### Examples of making calls using the Call API <a href="#making_a_call_to_a_span_class_sps_text_non_sps_link_data_orig_text_teleapi_data_parm_text_applicati" id="making_a_call_to_a_span_class_sps_text_non_sps_link_data_orig_text_teleapi_data_parm_text_applicati"></a>

**Full CallAPI URL:**

```
https://v1.api19.com/call/2012-04-24/Accounts/ACCOUNT_SID/Calls.json
```

This section includes several examples in different languages of how to make calls.

The following table includes the supported **POST** variables that can be sent with your **HTTP** calls.

#### Request Parameters <a href="#request_parameters" id="request_parameters"></a>

| Parameter                | Description                                                                                                                                                            |
| ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **From (Required)**      | The phone number to use as the caller id.                                                                                                                              |
| **To (Required)**        | The phone number to call.                                                                                                                                              |
| **Url (Required)**       | The fully qualified URL that should be executed when the call connects.                                                                                                |
| **Method**               | The HTTP method Platform should use when making its request to the above Url. Defaults to POST.                                                                        |
| **FallbackUrl**          | The URL that Platform will request if execution of Url fails for any reason.                                                                                           |
| **FallbackMethod**       | The HTTP method that Platform should use to request the FallbackUrl. Must be either GET or POST. Defaults to POST.                                                     |
| **StatusCallbackEvent**  | A comma separated list of events on which we are interested in getting a callback on. Possible values are *initiated, ringing, answered, completed*. Defaults to none. |
| **StatusCallback**       | URL to receive the callback events at. Default none.                                                                                                                   |
| **StatusCallbackMethod** | Set to *GET* or *POST*. Defaults to *POST.*                                                                                                                            |
| **Timeout**              | <p>The number of seconds that the Platform should allow the phone to ring before assuming there is no answer.<br> The default is 60 seconds.</p>                       |

You can [view example code here](https://apidocs.api19.com/call-apis/outgoing-calls/making-calls/example-code/outbound-to-tel)


# Outbound to Tel\#

{% hint style="info" %}
**API Token Notice**

You will need both your API Token and your Call API SID (ACCOUNT\_SID). Both are available in User Settings at the top right of the portal.
{% endhint %}

### Making an outbound call to a telephone number <a href="#making_a_call_to_a_sip_account" id="making_a_call_to_a_sip_account"></a>

The CallAPI will make a call to USA or international phone number. After the call is made and answered the fourscore.xml file will be played.

{% tabs %}
{% tab title="Curl" %}

```php
curl -X POST https://v1.api19.com/call/2012-04-24/Accounts/ACCOUNT_SID/Calls.json  \
   -d 'From=18727738823' \
   -d 'To=19392234422' \
   -d 'Url=https://example.api19.com/sample.php' \
   -u 'API_Token:API_Token'
```

{% endtab %}
{% endtabs %}

Example Responses is a menu option under Example Code.

{% hint style="info" %}
**You'll need your CallAPI Account SID and your API Token**
{% endhint %}


# Outbound to SIP Device

### Making a call to a SIP client <a href="#making_a_call_to_a_span_class_sps_text_non_sps_link_data_orig_text_teleapi_data_parm_text_applicati" id="making_a_call_to_a_span_class_sps_text_non_sps_link_data_orig_text_teleapi_data_parm_text_applicati"></a>

You must first create a SIP client in the portal under Connectivity/ SIP Accounts. In the example below, the client created is called Alice. When you make the call, the SIP phone on which Alice is registered will ring and the sample XML will be played.

{% tabs %}
{% tab title="Curl" %}

```php
curl -X POST https://v1.api19.com/call/2012-04-24/Accounts/ACCOUNT_SID/Calls.json  \
   -d 'From=16175551212' \
   -d 'To=client:alice' \
   -d 'Url=https://example.api19.com/sample.php' \
   -u 'API_Token:API_Token'
```

{% endtab %}
{% endtabs %}

> &#x20; **You can add a custom SIP header by passing X-Custom-Header2=423 in the POST variables.**
>
> **In curl simply add: -d 'X-Custom-Header2=432' \\**

A client can be created in the Clients section of the callapi.

Example Responses is a menu option under&#x20;

{% hint style="info" %}
You'll need both keys: CallAPI SID and API Token
{% endhint %}


# Example Responses

Responses are sent in JSON or XML forward, depending on your request type

## Successful Responses

A successful response will give you all information regarding the call

{% tabs %}
{% tab title="JSON" %}
JSON is the preferred way to receive requests

```
{
  "sid": "ID308221e44jfd49b7a7231df9773763d8-CA5439261cd19a45b5b7f925c8f9bd78bd",
  "InstanceId": "ID308221e44jfd49b7a7231df9773763d8",
  "date_created": "Thu, 23 Apr 2020 03:47:38 +0000",
  "date_updated": "Thu, 23 Apr 2020 03:47:38 +0000",
  "account_sid": "AC597c33she92a3aed4f54j58ceb22w6qq",
  "to": "13035551212",
  "from": "8142892271",
  "status": "QUEUED",
  "start_time": "2020-04-23T03:47:38.000Z",
  "duration": 0,
  "price_unit": "USD",
  "direction": "outbound-api",
  "api_version": "2012-04-24",
  "caller_name": "8142892271",
  "uri": "/2012-04-24/Accounts/AC597c33she92a3aed4f54j58ceb22w6qq/Calls/ID308221e44jfd49b7a7231df9773763d8-CA5439261cd19a45b5b7f925c8f9bd78bd.json",
  "subresource_uris": {
    "notifications": "/2012-04-24/Accounts/AC597c33she92a3aed4f54j58ceb22w6qq/Calls/ID308221e44jfd49b7a7231df9773763d8-CA5439261cd19a45b5b7f925c8f9bd78bd/Notifications.json",
    "recordings": "/2012-04-24/Accounts/AC597c33she92a3aed4f54j58ceb22w6qq/Calls/ID308221e44jfd49b7a7231df9773763d8-CA5439261cd19a45b5b7f925c8f9bd78bd/Recordings.json"
  }
}
```

{% endtab %}

{% tab title="XML" %}
XML is offered for backward compatibility for other service providers

```
<CallResponse>
  <Call>
    <Sid>ID308221e44jfd49b7a7231df9773763d8-CA8ccfe7efda354397a0504f47b883cd4e</Sid>
    <InstanceId>ID308221e44jfd49b7a7231df9773763d8</InstanceId>
    <DateCreated>Thu, 23 Apr 2020 03:43:08 +0000</DateCreated>
    <DateUpdated>Thu, 23 Apr 2020 03:43:08 +0000</DateUpdated>
    <ParentCallSid/>
    <AccountSid>AC597c33she92a3aed4f54j58ceb22w6qq</AccountSid>
    <To>13035551212</To>
    <From>4843728023</From>
    <PhoneNumberSid/>
    <Status>QUEUED</Status>
    <StartTime>2020-04-23T03:43:08.000Z</StartTime>
    <EndTime/>
    <Duration>0</Duration>
    <Price>0.00</Price>
    <PriceUnit>USD</PriceUnit>
    <Direction>outbound-api</Direction>
    <AnsweredBy/>
    <ApiVersion>2012-04-24</ApiVersion>
    <ForwardedFrom/>
    <CallerName>4843728023</CallerName>
    <Uri>/2012-04-24/Accounts/AC597c33she92a3aed4f54j58ceb22w6qq/Calls/ID308221e44jfd49b7a7231df9773763d8-CA8ccfe7efda354397a0504f47b883cd4e</Uri>
    <SubresourceUris>
      <Notifications>/2012-04-24/Accounts/AC597c33she92a3aed4f54j58ceb22w6qq/Calls/ID308221e44jfd49b7a7231df9773763d8-CA8ccfe7efda354397a0504f47b883cd4e/Notifications</Notifications>
      <Recordings>/2012-04-24/Accounts/AC597c33she92a3aed4f54j58ceb22w6qq/Calls/ID308221e44jfd49b7a7231df9773763d8-CA8ccfe7efda354397a0504f47b883cd4e/Recordings</Recordings>
    </SubresourceUris>
    <Ring__duration/>
  </Call>
</CallResponse>
```

{% endtab %}
{% endtabs %}

## Unsuccessful Responses

{% tabs %}
{% tab title="JSON Response 1" %}
Error responses:

```
{"status":"error", "error":"user inactive"}
```

or

```
{"status":"error", "error":"Resource unavailable error}
```

\
Some responses will contain debug messages if the error is not recognized.
{% endtab %}

{% tab title="XML Response" %}

```
<?xml version="1.0"?>
<CallResponse>
<status>error</status>
<error>user inactive</error>
</CallResponse>

```

{% endtab %}
{% endtabs %}


# Modifying Live Calls

Real time call modification allows you to interrupt an in-progress call and terminate it or have it begin processing RCML from a new URL. This is useful for any application where use async.

&#x20;Live Call Modification API is supported only for calls created with **Dial** verb using a RCML application.

&#x20;**HTTP POST** **to a Call**

{% hint style="info" %}
To redirect or terminate a live call, you make an **HTTP POST** request to an in­-progress Call instance resource URI:
{% endhint %}

```
/call/2012-04-24/Accounts/{AccountSid}/Calls/{CallSid} 
or
/call/2012-04-24/Accounts/{AccountSid}/Calls.json/{CallSid}
```

{% hint style="info" %}
The following parameters are available for you to **POST** request when modifying a phone call:
{% endhint %}

## Request Parameters

| Parameter  | Description                                                                                                                                                                                                                                                                         |
| ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Url**    | A valid URL that returns RCML. CallAPI will immediately redirect the call to the new RCML.                                                                                                                                                                                          |
| **Method** | <p>The HTTP method CallAPI should use when requesting the above URL. <br>Defaults to POST.</p>                                                                                                                                                                                      |
| **Status** | <p>Either <em>canceled</em> or <em>completed</em>. </p><p>Specifying canceled will attempt to hang up calls that are queued or ringing but will not affect calls already in progress. <br>Specifying completed will attempt to hang up a call even if it’s already in progress.</p> |
| **Mute**   | <p>Either <em>true</em> or <em>false</em>. <br>Setting value of this parameter to true will mute the call. Setting value of this parameter to false will unmute the call.</p>                                                                                                       |

## Call in-Progress

&#x20;Any call that is currently ringing within a Dial verb is in-progress from the point of view of CallAPI, and thus you must use '**Status=completed**' to cancel it.

**Optional Parameters**

{% hint style="info" %}
&#x20;You may **POST** the following parameters:
{% endhint %}

**Request Parameters:**

| Parameter                | Description                                                                                                                  |
| ------------------------ | ---------------------------------------------------------------------------------------------------------------------------- |
| **FallbackUrl**          | A URL that CallAPI will request if an error occurs requesting or executing the RCML at Url.                                  |
| **FallbackMethod**       | <p>The HTTP method that CallAPI should use to request the FallbackUrl. Must be either GET or POST. <br>Defaults to POST.</p> |
| **StatusCallback**       | A URL that CallAPI will request when the call ends to notify your app.                                                       |
| **StatusCallbackMethod** | The **HTTP** method CallAPI should use when requesting the above **URL**. Defaults to **POST**.                              |
| **MoveConnectedCallLeg** | If True, CallAPI will move both call legs to the new URL.                                                                    |

## Description:

&#x20;A prerequisite for the Live Call Modification API is to know the **CallSid** ​of the call. The **CallSid** is generated by CallAPI for every incoming or outgoing call. When we create an outgoing call using the Calls REST API, CallAPI will generate the **CallSid** and the response will contain the **CallSid**. For an Incoming call, CallAPI will generate the **CallSid**, and will include it in the parameters of the **GET** or **POST** request to download the RCML from the application server. So the application server, will get the **CallSid** ​for this incoming call and can store it for later use.

**Steps for an incoming call are the following:**

* A new incoming call to CallAPI&#x20;
* CallAPI generates CallSid and other parameters for this call
* CallAPI prepares GET/POST request and attaches the previously prepared parameters
* CallAPI sends the GET/POST request to the URL assigned to the DID called
* The Application server receives the GET/POST request
* The Application server stores the CallSid along with the rest of the parameters for later use
* The Application server prepares the response with the appropriate RCML for the given DID and send it back to CallAPI to process it

Given that we have the **CallSid** available, the next step to modify a live call is to prepare the new **POST** request to CallAPI with the URL of the new destination application.

Let’s assume that initially the Application server prepared an RCML that will connect the incoming call to Bob and that later Bob wants this call to be transferred to Alice. The Application Server will have to prepare a new RCML that will dial to Alice, and using the Live Call Modification API, will ask CallAPI to process this new RCML for the incoming call and thus will connect it to Alice.

**Here are the steps:**

* Incoming call - CallSid (1234567890)
* Application server - Store CallSid and other parameters, Prepare and send RCML that connects the call to Bob (using Dial verb)
* CallAPI process the given RCML and connects incoming call to Bob
* Bob wants to transfer the call to Alice and sends the request to Controller (application server)
* &#x20;Application server: - Prepares new RCML with a given URL:\
  &#x20;`http://app.server/CallToAlice` that using *Dial* will dial to Alice - Uses Live Call Modification prepares a new POST request: `https://v1.api19.com/call/2012-04-24/Accounts/ACCOUNT_SID/Calls/YOUR_CALL_SID` - in the POST requests adds the following parameters: Url="*<http://app.server/CallToAlice>*"
* CallAPI processes this Live Call Modification request and redirects the incoming call to the new RCML application (to the new URL)
* Eventually the incoming call will be connected to Alice.

Similarly the application server can change an incoming call to Bob to a conference call where more participants can be added later. Given that application server already knows the CallSid for the incoming call to Bob.

* Prepare a new RCML for the Dial Conference
* Prepare new POST Live Call Modification request for the incoming call to be connected to the new url (that will dial to the conference)
* &#x20;Prepare new outgoing call request using the Calls Rest API that will connect Bob to the conference application URL:\
  &#x20;`` https://v1.api19.com/call/2012-04-24/Accounts/ACCOUNT_SID/Calls` `` \
  &#x20;pass the following parameters: From=INCOMING\_CALL\_ID To=client:bob Url=CONFERENCE\_APPLICATION\_URL;
* Later the application server can create more outgoing call requests, similar to the one above, to invite other clients, SIP URLs or PSTN numbers to the conference call.


# Examples

## Redirect Call to a new RCML

{% hint style="info" %}
Live Call Modification **POST** request example:
{% endhint %}

{% tabs %}
{% tab title="CURL" %}

```perl
curl -X POST https://v1.api19.com/call/2012-04-24/Accounts/ACCOUNT_SID/Calls/CALL_SID.json  \
   -d 'Url=http://mycompany.com/api19/demos/dial­alice.xml' \
   -u 'API_Token'
```

{% endtab %}
{% endtabs %}

\
Redirect Call to a new RCML and connect both call legs
------------------------------------------------------

{% tabs %}
{% tab title="CURL" %}

```perl
curl -X POST https://v1.api19.com/call/2012-04-24/Accounts/ACCOUNT_SID/Calls/CALL_SID.json  \
   -d 'Url=http://mycompany.com/tcml/demos/conference.xml' \
   -d 'MoveConnectedCallLeg=true' \
   -u 'API_Token'
```

{% endtab %}
{% endtabs %}

\
Terminate In Progress call
--------------------------

{% tabs %}
{% tab title="CURL" %}

```perl
curl -X POST https://v1.api19.com/call/2012-04-24/Accounts/ACCOUNT_SID/Calls/CALL_SID.json  \
   -d 'Status=completed' \
   -u 'API_Token'
```

{% endtab %}
{% endtabs %}

## Terminate Ringing call

{% tabs %}
{% tab title="CURL" %}

```perl
curl -X POST https://v1.api19.com/call/2012-04-24/Accounts/ACCOUNT_SID/Calls/CALL_SID.json  \
   -d 'Status=canceled' \
   -u 'API_Token'
```

{% endtab %}
{% endtabs %}

\
Modifying Live Calls - Example
------------------------------

* In order to accomplish this, you need to create a client called Alice
* &#x20;Start a **SIP** phone and register Alice
* From the terminal run the following curl command
* &#x20;Make sure Alice is using the port **5061**
* &#x20;The "**From=**" could be any number of your choice
* &#x20;The **Url** is the default sample example provided with CallAPI.

## Modifying a Live Call

{% tabs %}
{% tab title="CURL" %}

```perl
curl -X POST https://v1.api19.com/call/2012-04-24/Accounts/ACCOUNT_SID/Calls.json  \
   -d 'From=+16175551212' \
   -d 'To=sip:alice@mycompany.com' \
   -d 'Url=https://ACCOUNT_SID:AUTH_TOKEN@mycompany.com/callapi/demos/hello-play.xml' \
   -u 'API_Token'
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
**You will see an output similar to the one below:**
{% endhint %}

```
{
  "sid": "CAfa51b104354440b09213d04752f50271",
  "date_created": "2013-11-01T03:41:14.488-06:00",
  "date_updated": "2013-11-01T03:41:14.488-06:00",
  "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "to": "alice",
  "from": "+16175551212",
  "status": "queued",
  "start_time": "2013-11-01T03:41:14.488-06:00",
  "price": "0.0",
  "direction": "outbound-api",
  "api_version": "2012-04-24",
  "uri": "/2012-04-24/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAfa51b104354440b09213d04752f50271.json",
  "subresource_uris": {
    "notifications": "/call/2012-04-24/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAfa51b104354440b09213d04752f50271/Notifications",
    "recordings": "/call/2012-04-24/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAfa51b104354440b09213d04752f50271/Recordings"
  }
}

```

Notice the "sid": "CAfa51b104354440b09213d04752f50271", This Call ID is what you must use to interact with the current call. You can now redirect the current call to another application as shown below Notice that the Call ID is referenced The call will now be redirected to the Url specified(hello-play.xml).

{% tabs %}
{% tab title="CURL" %}

```perl
curl -X POST https://v1.api19.com/call/2012-04-24/Accounts/ACCOUNT_SID/Calls/CALL_SID.json  \
   -d 'From=+16175551212' \
   -d 'To=sip:alice@mycompany.com' \
   -d 'Url=https://ACCOUNT_SID:AUTH_TOKEN@mycompany.com/callapi/demos/hello-play.xml' \
   -u 'API_Token'
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
T**he output showing the same Call ID:**
{% endhint %}

```
<CallResponse>
  <Call>
    <Sid>CAfa51b104354440b09213d04752f50271</Sid>
    <DateCreated>2013-11-01T03:41:14.488-06:00</DateCreated>
    <DateUpdated>2013-11-01T03:41:14.488-06:00</DateUpdated>
    <ParentCallSid/>
    <AccountSid>ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</AccountSid>
    <To>alice</To>
    <From>+16175551212</From>
    <PhoneNumberSid/>
       ..... TRUNCATED
```

### You can still redirect the current call back to the previous application

{% tabs %}
{% tab title="CURL" %}

```perl
curl -X POST https://v1.api19.com/call/2012-04-24/Accounts/ACCOUNT_SID/Calls/CALL_SID.json  \
   -d 'Url=https://ACCOUNT_SID:AUTH_TOKEN@mycompany.com/callapi/demos/hello-play.xml' \
   -u 'API_Token'
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const request = require('request');

// Provide your Account Sid and Auth Token from your Console Account page
const ACCOUNT_SID = 'my_ACCOUNT_SID';
const AUTH_TOKEN = 'my_AUTH_TOKEN';
// Provide additional path parameters if applicable
const CALL_SID = 'my_CALL_SID'

request.({
      method: 'POST',
      url: 'https://v1.api19.com/calls/2012-04-24/Accounts/' + ACCOUNT_SID + '/Calls/' + CALL_SID + '.json',
      auth: { 'user': ACCOUNT_SID, 'pass': AUTH_TOKEN },
      form: {
         'Url': 'https://ACCOUNT_SID:AUTH_TOKEN@mycompany.com/teleapi/demos/hello-play.xml'
      }
   },
   function (error, response, body) {
      // Add your business logic below; status can be found at 'response.statusCode' and response body at 'body'
      ...
});
```

{% endtab %}

{% tab title="Python" %}

```python
from http.client import HTTPSConnection
from base64 import b64encode
from urllib.parse import urlencode

# Provide your Account Sid and Auth Token from your Console Account page
ACCOUNT_SID = 'my_ACCOUNT_SID'
AUTH_TOKEN = 'my_AUTH_TOKEN'
// Provide additional path parameters if applicable
CALL_SID = 'my_CALL_SID'

userAndPass = b64encode(bytes(ACCOUNT_SID + ':' + AUTH_TOKEN, 'utf-8')).decode("ascii")
headers = { 'Authorization' : 'Basic %s' %  userAndPass,
    'Content-type': 'application/x-www-form-urlencoded',
    'Accept': 'text/plain' }

# Update POST parameters accordingly
params = urlencode({
   'Url': 'https://ACCOUNT_SID:AUTH_TOKEN@mycompany.com/teleapi/demos/hello-play.xml'
})

conn = HTTPSConnection('v1.api19.com')
conn.request("POST", '/calls/2012-04-24/Accounts/' + ACCOUNT_SID + '/Calls/' + CALL_SID + '.json',
      params, headers=headers)
res = conn.getresponse()

# Add your business logic below; status can be found at 'res.status', reason at 'res.reason' and response body can be retrieved with res.read()
...
```

{% endtab %}

{% tab title="Java" %}

```java
import java.net.URL;
import javax.net.ssl.HttpsURLConnection;
import java.io.*;
import java.util.Base64;

public class JavaSampleClass {
   // Provide your Account Sid and Auth Token from your Console Account page
   public static final String ACCOUNT_SID = "my_ACCOUNT_SID";
   public static final String AUTH_TOKEN = "my_AUTH_TOKEN";
   // Provide additional path parameters if applicable
   public static final String CALL_SID = "my_CALL_SID"

   public static void main(String[] args) throws Exception {
      String userAndPass = ACCOUNT_SID + ':' + AUTH_TOKEN;
      String encoded = Base64.getEncoder().encodeToString(userAndPass.getBytes());

      URL url = new URL(("https://v1.api19.com/calls/2012-04-24/Accounts/" + ACCOUNT_SID + "/Calls/" + CALL_SID + ".json");
      HttpsURLConnection conn = (HttpsURLConnection)url.openConnection();
      conn.setRequestProperty("Authorization", "Basic " + encoded);
      conn.setRequestMethod("POST");
      conn.setDoOutput(true);
      DataOutputStream os = new DataOutputStream(conn.getOutputStream());

      // Update POST parameters accordingly
      os.writeBytes("Url=https://ACCOUNT_SID:AUTH_TOKEN@mycompany.com/api19/demos/hello-play.xml");
      os.close();

      // Add your business logic below; response code can be obtained from 'conn.getResponseCode()' and input stream from 'conn.getInputStream()'
      ...
  }
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
The output showing the same Call ID
{% endhint %}

```
<CallResponse>
  <Call>
    <Sid>CAfa51b104354440b09213d04752f50271</Sid>
    <DateCreated>2013-11-01T03:41:14.488-06:00</DateCreated>
    <DateUpdated>2013-11-01T03:41:14.488-06:00</DateUpdated>
    <ParentCallSid/>
    <AccountSid>ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</AccountSid>
    <To>alice</To>
    <From>+16175551212</From>
    <PhoneNumberSid/>
   ..... TRUNCATED
```

You can still redirect the current call back to the previous application

{% tabs %}
{% tab title="CURL" %}

```perl
curl -X POST https://v1.api19.com/call/2012-04-24/Accounts/ACCOUNT_SID/Calls/CALL_SID.json  \
   -d 'Status=completed' \
   -u 'API_Token'
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
The output showing the same Call ID
{% endhint %}

```
<CallResponse>
  <Call>
    <Sid>CAfa51b104354440b09213d04752f50271</Sid>
    <DateCreated>2013-11-01T03:41:14.488-06:00</DateCreated>
    <DateUpdated>2013-11-01T03:41:14.488-06:00</DateUpdated>
    <ParentCallSid/>
    <AccountSid>ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</AccountSid>
    <To>alice</To>
    <From>+16175551212</From>
    <PhoneNumberSid/>
   ..... TRUNCATED
```

You can Mute/unMute an in progress call as shown bellow

{% tabs %}
{% tab title="CURL" %}

```perl
curl -X POST https://v1.api19.com/call/2012-04-24/Accounts/ACCOUNT_SID/Conferences/CONFERENCE_SID/Participants/CALL_SID.json  \
   -d 'Mute=true' \
   -u 'API_Token'
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
**Sample Mute Response**
{% endhint %}

```
<CallResponse>
  <Call>
    <Sid>CA02b649d3ffe24408a1e141be089f347b</Sid>
    <ConferenceSid>CFcc373b0637114f088eae954fa73f0f57</ConferenceSid>
    <DateCreated>Wed, 15 Mar 2017 10:10:57 +0000</DateCreated>
    <DateUpdated>Wed, 15 Mar 2017 10:15:33 +0000</DateUpdated>
    <AccountSid>ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</AccountSid>
    <Muted>true</Muted>
    <Hold>false</Hold>
    <StartConferenceOnEnter>true</StartConferenceOnEnter>
    <EndConferenceOnEnter>false</EndConferenceOnEnter>
    <Uri>/2012-04-24/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CA02b649d3ffe24408a1e141be089f347b</Uri>
  </Call>
</CallResponse>
```

{% tabs %}
{% tab title="CURL" %}

```perl
curl -X POST https://v1.api19.com/call/2012-04-24/Accounts/ACCOUNT_SID/Conferences/CONFERENCE_SID/Participants/CALL_SID.json  \
   -d 'Mute=false' \
   -u 'API_Token'
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
&#x20;**Sample unMute Response**
{% endhint %}

```
<CallResponse>
  <Call>
    <Sid>CA02b649d3ffe24408a1e141be089f347b</Sid>
    <ConferenceSid>CFcc373b0637114f088eae954fa73f0f57</ConferenceSid>
    <DateCreated>Wed, 15 Mar 2017 10:10:57 +0000</DateCreated>
    <DateUpdated>Wed, 15 Mar 2017 10:16:44 +0000</DateUpdated>
    <AccountSid>ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</AccountSid>
    <Muted>false</Muted>
    <Hold>false</Hold>
    <StartConferenceOnEnter>true</StartConferenceOnEnter>
    <EndConferenceOnEnter>false</EndConferenceOnEnter>
    <Uri>/2012-04-24/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CA02b649d3ffe24408a1e141be089f347b</Uri>
  </Call>
</CallResponse>
```


# Recordings

Recordings are created when you use the  verb. Recordings are hosted with callapi for you to retrieve. The Recordings list resource represents the set of an account’s recordings.

#### 7.6.1 Recording List Resource URI <a href="#recording_list_resource_uri" id="recording_list_resource_uri"></a>

```php
/call/2012-04-24/Accounts/ACCOUNT_SID/Recordings
OR
/call/2012-04-24/Accounts/{AccountSid}/Recordings/{RecordingSid}
```

{% hint style="warning" %}
Unlike the Recording instance resource described above, the list of recordings IS protected by your account credentials like most parts of this API. You must use HTTP basic auth to access the Recordings list resource.\*
{% endhint %}

**HTTP GET.** Returns a list of all the Recording resources for this Account, including the properties above.\
**HTTP DELETE**  Deletes a recording that belongs to this Account.

The audio file is named using the RecordingSid and a file extension of .wav.

The URLs that contain the actual audio recordings are accessible by everyone without the need to authenticate with callapi. This is per design to allow for your apps to easily access the recordings without revealing your credentials. The same is NOT true for the resource to retrieve the list of recordings. Unauthenticated users cannot access the RecordingSid and hence not able to download the actual recording.

| Warning | Warning: Although Recording Sids in Recording URLs are essentially long random strings that are very difficult to guess, you still need to make sure that they don’t fall in the wrong hands. |
| ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

## Resource Properties

| Property        | Description                                                                                                                 |
| --------------- | --------------------------------------------------------------------------------------------------------------------------- |
| **Sid**         | A string that uniquely identifies a recording.                                                                              |
| **DateCreated** | The date that the recording was created.                                                                                    |
| **DateUpdated** | The date that the recording was last updated.                                                                               |
| **AccountSid**  | The unique id of the Account that created the recording.                                                                    |
| **CallSid**     | The unique id of the call during which the recording was made.                                                              |
| **Duration**    | The length of the recording, in seconds.                                                                                    |
| **ApiVersion**  | The API version in use during the recording.                                                                                |
| **Uri**         | The URI for this account, relative to `https://v1.api19.com/call/2012-04-24/.`                                              |
| **FileUri**     | The File URI for this recording, relative to `https://v1.api19.com/call/2012-04-24/`. It can be used to access the WAV file |

\
Supported Operations
--------------------

&#x20;**HTTP GET.** Returns the representation of a Recording resource, including the properties above.

&#x20;**HTTP DELETE**. Removes the recording from the account.

#### Recording List Resource URI <a href="#recording_list_resource_uri" id="recording_list_resource_uri"></a>

{% hint style="info" %}
There is two types of tokens: Call API SID Token and API Token; both must be used.
{% endhint %}

###


# Get List of Recordings

HTTP GET or POST. The query string parameters allow you to limit the list returned. Note: parameters are case-sensitive

## Request Parameters

None of the request parameters are required.

<table><thead><tr><th width="131.33333333333331">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>Page</strong></td><td>The current page number. Zero-indexed, so the first page is 0.<br>0-20000</td></tr><tr><td><strong>PageSize</strong></td><td>How many items are on each page<br>0-2000</td></tr><tr><td><strong>StartTime</strong></td><td>Only show recordings that were made on this date/time or later<br><br>EndTime value examples allowed:<br>2024-04-01T10:10:10<br>2024-04-01 10:10:10<br>2024-04-01</td></tr><tr><td><strong>EndTime</strong></td><td>Only show recordings that were made on this date/time or earlier<br><br>EndTime value examples allowed:<br>2024-04-01T10:10:10<br>2024-04-01 10:10:10<br>2024-04-01</td></tr><tr><td><strong>CallSid</strong></td><td>Only show recordings that have been started from this CallSid<br>Value: CallSid=h923fh2h32fj23f2</td></tr><tr><td><strong>SortBy</strong></td><td>Sort by the date created instead of the most recent on top<br>Value: DateCreated <strong>or</strong> DateAsc</td></tr></tbody></table>

## Filter using the CallSid parameter.

The following example will only return Recordings that have been started from the given CallSid

{% tabs %}
{% tab title="CURL" %}

```perl
curl -X POST https://v1.api19.com/call/2012-04-24/Accounts/Call_API_Token/Recordings.json
   -d 'CallSid=CAfe9ce46f104f5beeb10c83a5dad2be66' \
   -d 'StartTime=2024-04-02 00:00:00'
   -d 'EndTime=2024-04-02 10:00:00'
   -d 'SortBy=DateCreated'
   -u 'API_Token:account_sid'
```

{% endtab %}
{% endtabs %}

The result will be similar to the one below

```javascript
{"page":0,"num_pages":0,"page_size":50,"total":17,"start":"0","end":"17","uri":"/call/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Recordings.json","first_page_uri":"/call/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Recordings.json?Page=0&PageSize=50","previous_page_uri":"null","next_page_uri":"null","last_page_uri":"/call/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Recordings.json?Page=0&PageSize=50","recordings":
    [
        {
            "sid":"RFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
            "date_created":"Mon, 6 Jan 2024 08:51:07 +0900",
            "date_updated":"Mon, 6 Jan 2024 08:51:07 +0900",
            "date_standard":"2024-01-06 08:51:07",
            "account_sid":"ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
            "call_sid":"CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
            "duration":"14.70275",
            "api_version":"2012-04-24",
            "uri":"/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Recordings/RE50675909d9c94acda36f0e119b6cb431.json",
            "file_uri":"https://v1.api19.com/call/recordings/RE50675909d9c94acda36f0e119b6cb431.wav"
        },
        ...
    ]
}
```


# Delete a Recording

Delete an existing recording

{% hint style="info" %}
HTTP DELETE

**/2012-04-24/Accounts/{AccountSid}/Recordings/{RecordingSid}**

<mark style="color:orange;">or</mark>

HTTP POST

**/2012-04-24/Accounts/{AccountSid}/Recordings**
{% endhint %}

This function allows you to delete a recording on our system using an HTTP POST or an HTTP DELETE.

You can put the recording sid OR just use the file name if it's easier.

{% tabs %}
{% tab title="CURL POST" %}

```
curl https://v1.api19.com/call/2012-04-24/Accounts/ACCOUNT_SID/Recordings \
   -d 'delete_file=recording_sid'
   -u 'API_Token'
```

{% endtab %}

{% tab title="CURL DELETE" %}

```perl
curl -X DELETE https://v1.api19.com/call/2012-04-24/Accounts/ACCOUNT_SID/Recordings/RECORDING_SID  \
   -u 'API_Token:account_sid'
```

{% endtab %}
{% endtabs %}

#### Possible Responses

```javascript
HTTP Status: 200
{"status": "ok"}

OR

HTTP Status: 404
{"status": "error", "error": "file missing"}
```


# API Call Markup Language

Overview

The API Call Markup Language (ACML) represents a set of instructions you can use to tell the Call API what to do when you receive an incoming call.

When someone makes a call to one of your Call API numbers, the service will look up the URL associated with that phone number and make a request to that URL. The  Call API will read the markup instructions at that URL to determine what to do: record the call, play a message for the caller, prompt the caller to press digits on their keypad, etc.

{% hint style="info" %}
An an example, the following will say a short message, and then record the caller’s voice:
{% endhint %}

```markup
<Response>
    <Say voice="woman">Please leave a message after the tone.</Say>
    <Record maxLength="20" />
</Response>
```

For your initial response to a call, the HTTP Post variable PostStatus will be **new**. ACML is similar to HTML. Only one ACML document is rendered to the caller at once, but many documents can be linked together to build complex interactive voice applications.

Calls from a Call API number to an outside number are controlled using ACML in the same manner as incoming calls. The initial URL for the call is provided as a parameter to the Call API request you make to initiate the call.

\
How the Call APIs Interacts with Your Application
-------------------------------------------------

### Call API Request

&#x20;The way the Call API passes data to your application depends on the request method for the given URI. If the request method is GET then the data is passed in the query string (the part after the question mark). If the request method is POST then the data is sent as multi-part form data just like when a browser submits a form.

When the Call API makes a request to your application it will include the following data as request parameters.

### **Request Parameters**

<table data-header-hidden><thead><tr><th width="255.333251953125">Parameter</th><th>Description</th></tr></thead><tbody><tr><td>Parameter</td><td>Description</td></tr><tr><td><strong>CallSid</strong></td><td>The unique identifier for the call.</td></tr><tr><td><strong>AccountSid</strong></td><td>Your account id.</td></tr><tr><td><strong>From</strong></td><td>The phone number of the originator of the call.</td></tr><tr><td><strong>To</strong></td><td>The phone number of the call recipient.</td></tr><tr><td><strong>CallStatus</strong></td><td><p>A descriptive status for the call. The value is one of these:</p><p>completed, failed, ringing, in-progress, no-answer, queued, or initiated</p></td></tr><tr><td><strong>ApiVersion</strong></td><td>The version of the Call API used to handle this call.</td></tr><tr><td><strong>Direction</strong></td><td>The direction of the call. The possible values are inbound and outbound-dial.</td></tr><tr><td><strong>CallerName</strong></td><td>The caller ID for the caller in the case of an inbound call.</td></tr><tr><td><strong>PostStatus</strong></td><td>This will be callback or new<br><strong>new</strong> is when the call is first coming in and is brand new<br><strong>callback</strong> are callbacks letting you know the status of the call</td></tr></tbody></table>

### Post Examples

New Incoming Call to a DID\
**Notice:** The CallStatus is ringing and the PostStatus is new (meaing a new call)

<pre><code><strong>HTTP POST Variables
</strong>(
    [CallSid] => IDe4818a0b8cfc4ca1b3cdad65264e8ba1-CAd183dab7c2174f61bc3baea248bdac64
    [InstanceId] => IDe4818a0b8cfc4ca1b3cdad65264e8ba1
    [AccountSid] => ACd4fb7d0eefaf3c057a8b9c7774433568
    [From] => 13038881111
    [To] => 7209914899
    [CallStatus] => ringing
    [ApiVersion] => 2012-04-24
    [Direction] => inbound
    [CallerName] => null
    [ForwardedFrom] => null
    [CallTimestamp] => 2026-08-05T21:36:11.909Z
    [CallBackSource] => call-progress-events
    [SequenceNumber] => 1
    [SipCode] => 180
    [SipHeader_X-Originating-DNIS] => +17209914899
    [PostStatus] => new
)
</code></pre>

Progress - Answered Call\
**Notice:** The CallStatus is answered and the SipCode is 200

<pre><code><strong>HTTP POST Variables
</strong>(
    [CallSid] => IDe4818a0b8cfc4ca1b3cdad65264e8ba1-CAd183dab7c2174f61bc3baea248bdac64
    [InstanceId] => IDe4818a0b8cfc4ca1b3cdad65264e8ba1
    [AccountSid] => ACd4fb7d0eefaf3c057a8b9c7774433568
    [From] => 13038881111
    [To] => 7209914899
    [CallStatus] => answered
    [ApiVersion] => 2012-04-24
    [Direction] => inbound
    [CallerName] => null
    [ForwardedFrom] => null
    [CallTimestamp] => 2026-08-05T21:34:35.550Z
    [CallBackSource] => call-progress-events
    [SequenceNumber] => 2
    [SipCode] => 200
    [SipHeader_X-Originating-DNIS] => +17209914899
    [PostStatus] => callback
)
</code></pre>

Progress - Caller has hung up\
**Notice**: the CallStatus is completed and the SipCode is BYE

<pre><code><strong>HTTP Post Variables
</strong>(
    [CallSid] => IDe4818a0b8cfc4ca1b3cdad65264e8ba1-CAd183dab7c2174f61bc3baea248bdac64
    [InstanceId] => IDe4818a0b8cfc4ca1b3cdad65264e8ba1
    [AccountSid] => ACd4fb7d0eefaf3c057a8b9c7774433568
    [From] => 13038881111
    [To] => 7209914899
    [CallStatus] => completed
    [ApiVersion] => 2012-04-24
    [Direction] => inbound
    [CallerName] => null
    [ForwardedFrom] => null
    [CallTimestamp] => 2026-08-05T21:36:11.909Z
    [CallBackSource] => call-progress-events
    [SequenceNumber] => 3
    [SipCode] => BYE
    [SipHeader_X-Originating-DNIS] => +17209914899
    [PostStatus] => callback
)
</code></pre>

### Call API Response

In the response to the request from the Call API, you should provide ACML that will instruct our service on how to handle the current call.

&#x20;**MIME Types.** Call API supports the MIME types described in the table below.

### **Supported MIME Types**

| Parameter                     | Description                                                          |
| ----------------------------- | -------------------------------------------------------------------- |
| **text/xml, application/xml** | Call API interprets the returned document as an XML instruction set. |

{% hint style="info" %}
When your application returns the ACML document the root element of the document must always be specified  or the parser will complain.
{% endhint %}

## The Markup Verbs

Using combinations of the verbs below allow you to create all kinds of interactive voice and messaging applications.

* [**Say**](/call-api-markup/api-call-markup-language/say)\
  Say some words with text to speech
* [**Dial**](/call-api-markup/api-call-markup-language/dial)\
  Call someone else, a phone number or other
  * [**SIP**](/call-api-markup/api-call-markup-language/dial/sip)
  * [**Client**](/call-api-markup/api-call-markup-language/dial/client)
  * [**Number**](/call-api-markup/api-call-markup-language/dial/number)
* [**Play**](/call-api-markup/api-call-markup-language/play)\
  Play a wav or mp3 file to the caller
* [**Gather**](/call-api-markup/api-call-markup-language/gather)\
  Gather digits or words and send them back to your server
* [**Record**](/call-api-markup/api-call-markup-language/record)\
  Record the current call
* [**Hangup**](/call-api-markup/api-call-markup-language/hangup)\
  Hangup on the call
* [**Pause**](/call-api-markup/api-call-markup-language/pause)\
  Pause the call for a moment (maybe to wait for digits)
* [**Reject**](/call-api-markup/api-call-markup-language/reject)\
  Reject this call
* [**Redirect**](/call-api-markup/api-call-markup-language/redirect)\
  Redirect this call to another URL

References to ACML, RCML or CML are all the same.


# Say

The \<Say> verb is used to synthesize text to speech and play it back to the remote party.

## Say Attributes

| Name         | Description                                                               | Allowed Values       | Default Value |
| ------------ | ------------------------------------------------------------------------- | -------------------- | ------------- |
| **language** | Voice and Language                                                        | listed at the bottom | kevin         |
| **loop**     | How many times to play the synthesized text. Zero will loop indefinitely. | non-negative integer | 1             |

## Nesting

{% hint style="info" %}
&#x20;The **\<Say>** verb cannot have any other verbs or nouns nested. Only text can be part of the  \<say> verb.
{% endhint %}

## Examples

{% hint style="info" %}
Below is an example of using the \<say> verb.
{% endhint %}

```markup
<Response>
    <Say>Hello World</Say>
</Response>
```

{% hint style="info" %}
Choose your voice and language based on the list at the bottom of this page
{% endhint %}

```markup
<Response>
    <Say language="joanna-en-US-female">Hello World</Say>
</Response>
```

## Voices

To use a specific provider specify it in the language attribute, as shown below. Voices are all from AWS Polly.

```markup
Danish (da-DK)
language="naja-da-DK-female"  - Naja
language="mads-da-DK-male"  - Mads


Dutch (nl-NL)
language="lotte-nl-NL-female"  - Lotte
language="ruben-nl-NL-male"  - Ruben


English (Australian) (en-AU)
language="nicole-en-au-female"  - Nicole
language="olivia-en-au-female"  - Olivia
language="russell-en-au-male"  - Russell


English (British) (en-GB)
language="amy-en-GB-female"  - Amy
language="emma-en-GB-female"  - Emma
language="brian-en-GB-male"  - Brian


English (Indian) (en-IN)
language="aditi-en-IN-female"  - Aditi
language="raveena-en-IN-female"  - Raveena


English (US) (en-US)
language="ivy-en-US-female"  - Ivy
language="joanna-en-US-female"  - Joanna
language="kendra-en-US-female"  - Kendra
language="kimberly-en-US-female"  - Kimberly
language="salli-en-US-female"  - Salli
language="joey-en-US-male"  - Joey
language="justin-en-US-male"  - Justin
language="kevin-en-US-male"  - Kevin
language="matthew-en-US-male"  - Matthew


English (Welsh) (en-GB-WLS)
language="geraint-en-GB-WLS-male"  - Geraint


French (fr-FR)
language="celine-fr-FR-female"  - Celine
language="lea-fr-FR-female"  - Lea
language="mathieu-fr-FR-male"  - Mathieu


French (Canadian) (fr-CA)
language="chantal-fr-CA-female"  - Chantal


German (de-DE)
language="marlene-de-DE-female"  - Marlene
language="vicki-de-DE-female"  - Vicki
language="hans-de-DE-male"  - Hans


Icelandic (is-IS)
language="dora-is-IS-female"  - DÃ³ra/Dora
language="karl-is-IS-male"  - Karl


Italian (it-IT)
language="carla-it-IT-female"  - Carla
language="bianca-it-IT-female"  - Bianca
language="giorgio-it-IT-male"  - Giorgio


Japanese (ja-JP)
language="mizuki-ja-PA-female"  - Mizuki
language="takumi-ja-PA-male"  - Takumi


Norwegian (nb-NO)
language="liv-nb-NO-female"  - Liv


Polish (pl-PL)
language="ewa-pl-PL-female"  - Ewa
language="maja-pl-PL-female"  - Maja
language="jacek-pl-PL-male"  - Jacek
language="jan-pl-PL-male"  - Jan


Portuguese (Brazilian) (pt-BR)
language="camila-bp-BR-female"  - Camila
language="vitoria-bp-BR-female"  - Vitoria
language="ricardo-bp-BR-male"  - Ricardo


Portuguese (European) (pt-PT)
language="ines-pt-PT-female"  - Ines
language="cristiano-pt-PT-male"  - Cristiano


Romanian (ro-RO)
language="carmen-ro-RO-female"  - Carmen


Russian (ru-RU)
language="tatyana-ru-RU-female"  - Tatyana
language="maxim-ru-RU-male"  - Maxim


Spanish (European) (es-ES)
language="conchita-es-ES-female"  - Conchita
language="lucia-es-ES-female"  - Lucia
language="enrique-es-ES-male"  - Enrique


Spanish (Mexican) (es-MX)
language="mia-es-MX-female"  - Mia


US Spanish (es-US)
language="lupe-es-US-female"  - Lupe
language="penelope-es-US-female"  - Penelope
language="miguel-es-US-male"  - Miguel


Swedish (sv-SE)
language="astrid-sv-SE-female"  - Astrid


Turkish (tr-TR)
language="filiz-tr-TR-female"  - Filiz


Welsh (cy-GB)
language="gwyneth-cy-GB-female"  - Gwyneth
```

JSON of all supported languages:

```
{
    "Danish (da-DK)": [
        {
            "language_use": "naja-da-DK-female",
            "name": "Naja"
        },
        {
            "language_use": "mads-da-DK-male",
            "name": "Mads"
        }
    ],
    "Dutch (nl-NL)": [
        {
            "language_use": "lotte-nl-NL-female",
            "name": "Lotte"
        },
        {
            "language_use": "ruben-nl-NL-male",
            "name": "Ruben"
        }
    ],
    "English (Australian) (en-AU)": [
        {
            "language_use": "nicole-en-au-female",
            "name": "Nicole"
        },
        {
            "language_use": "olivia-en-au-female",
            "name": "Olivia"
        },
        {
            "language_use": "russell-en-au-male",
            "name": "Russell"
        }
    ],
    "English (British) (en-GB)": [
        {
            "language_use": "amy-en-GB-female",
            "name": "Amy"
        },
        {
            "language_use": "emma-en-GB-female",
            "name": "Emma"
        },
        {
            "language_use": "brian-en-GB-male",
            "name": "Brian"
        }
    ],
    "English (Indian) (en-IN)": [
        {
            "language_use": "aditi-en-IN-female",
            "name": "Aditi"
        },
        {
            "language_use": "raveena-en-IN-female",
            "name": "Raveena"
        }
    ],
    "English (US) (en-US)": [
        {
            "language_use": "ivy-en-US-female",
            "name": "Ivy"
        },
        {
            "language_use": "joanna-en-US-female",
            "name": "Joanna"
        },
        {
            "language_use": "kendra-en-US-female",
            "name": "Kendra"
        },
        {
            "language_use": "kimberly-en-US-female",
            "name": "Kimberly"
        },
        {
            "language_use": "salli-en-US-female",
            "name": "Salli"
        },
        {
            "language_use": "joey-en-US-male",
            "name": "Joey"
        },
        {
            "language_use": "justin-en-US-male",
            "name": "Justin"
        },
        {
            "language_use": "kevin-en-US-male",
            "name": "Kevin"
        },
        {
            "language_use": "matthew-en-US-male",
            "name": "Matthew"
        }
    ],
    "English (Welsh) (en-GB-WLS)": [
        {
            "language_use": "geraint-en-GB-WLS-male",
            "name": "Geraint"
        }
    ],
    "French (fr-FR)": [
        {
            "language_use": "celine-fr-FR-female",
            "name": "Celine"
        },
        {
            "language_use": "lea-fr-FR-female",
            "name": "Lea"
        },
        {
            "language_use": "mathieu-fr-FR-male",
            "name": "Mathieu"
        }
    ],
    "French (Canadian) (fr-CA)": [
        {
            "language_use": "chantal-fr-CA-female",
            "name": "Chantal"
        }
    ],
    "German (de-DE)": [
        {
            "language_use": "marlene-de-DE-female",
            "name": "Marlene"
        },
        {
            "language_use": "vicki-de-DE-female",
            "name": "Vicki"
        },
        {
            "language_use": "hans-de-DE-male",
            "name": "Hans"
        }
    ],
    "Icelandic (is-IS)": [
        {
            "language_use": "dora-is-IS-female",
            "name": "Dora"
        },
        {
            "language_use": "karl-is-IS-male",
            "name": "Karl"
        }
    ],
    "Italian (it-IT)": [
        {
            "language_use": "carla-it-IT-female",
            "name": "Carla"
        },
        {
            "language_use": "bianca-it-IT-female",
            "name": "Bianca"
        },
        {
            "language_use": "giorgio-it-IT-male",
            "name": "Giorgio"
        }
    ],
    "Japanese (ja-JP)": [
        {
            "language_use": "mizuki-ja-PA-female",
            "name": "Mizuki"
        },
        {
            "language_use": "takumi-ja-PA-male",
            "name": "Takumi"
        }
    ],
    "Norwegian (nb-NO)": [
        {
            "language_use": "liv-nb-NO-female",
            "name": "Liv"
        }
    ],
    "Polish (pl-PL)": [
        {
            "language_use": "ewa-pl-PL-female",
            "name": "Ewa"
        },
        {
            "language_use": "maja-pl-PL-female",
            "name": "Maja"
        },
        {
            "language_use": "jacek-pl-PL-male",
            "name": "Jacek"
        },
        {
            "language_use": "jan-pl-PL-male",
            "name": "Jan"
        }
    ],
    "Portuguese (Brazilian) (pt-BR)": [
        {
            "language_use": "camila-bp-BR-female",
            "name": "Camila"
        },
        {
            "language_use": "vitoria-bp-BR-female",
            "name": "Vitoria"
        },
        {
            "language_use": "ricardo-bp-BR-male",
            "name": "Ricardo"
        }
    ],
    "Portuguese (European) (pt-PT)": [
        {
            "language_use": "ines-pt-PT-female",
            "name": "Ines"
        },
        {
            "language_use": "cristiano-pt-PT-male",
            "name": "Cristiano"
        }
    ],
    "Romanian (ro-RO)": [
        {
            "language_use": "carmen-ro-RO-female",
            "name": "Carmen"
        }
    ],
    "Russian (ru-RU)": [
        {
            "language_use": "tatyana-ru-RU-female",
            "name": "Tatyana"
        },
        {
            "language_use": "maxim-ru-RU-male",
            "name": "Maxim"
        }
    ],
    "Spanish (European) (es-ES)": [
        {
            "language_use": "conchita-es-ES-female",
            "name": "Conchita"
        },
        {
            "language_use": "lucia-es-ES-female",
            "name": "Lucia"
        },
        {
            "language_use": "enrique-es-ES-male",
            "name": "Enrique"
        }
    ],
    "Spanish (Mexican) (es-MX)": [
        {
            "language_use": "mia-es-MX-female",
            "name": "Mia"
        }
    ],
    "US Spanish (es-US)": [
        {
            "language_use": "lupe-es-US-female",
            "name": "Lupe"
        },
        {
            "language_use": "penelope-es-US-female",
            "name": "Penelope"
        },
        {
            "language_use": "miguel-es-US-male",
            "name": "Miguel"
        }
    ],
    "Swedish (sv-SE)": [
        {
            "language_use": "astrid-sv-SE-female",
            "name": "Astrid"
        }
    ],
    "Turkish (tr-TR)": [
        {
            "language_use": "filiz-tr-TR-female",
            "name": "Filiz"
        }
    ],
    "Welsh (cy-GB)": [
        {
            "language_use": "gwyneth-cy-GB-female",
            "name": "Gwyneth"
        }
    ]
}
```


# Dial

The \<Dial> verb connects the current caller to another phone . If the called party picks up, the two parties are connected and can communicate until one hangs up. If the called party does not pick up,

## Examples

{% hint style="info" %}
Examples of using the \<Dial> verb.
{% endhint %}

```markup
<Response>
    <Dial>1-444-555-666</Dial>
</Response>
```

```markup
<Response>
    <Dial record="true">1-444-555-666</Dial>
</Response>
```

```markup
<Response>
    <Dial callerId="1555666777" record="true">1-444-555-666</Dial>
</Response>
```

## Dial Attributes

| Name          | Allowed Values                                                             | Default Value           |
| ------------- | -------------------------------------------------------------------------- | ----------------------- |
| **action**    | relative or absolute URL                                                   | no default for \<Dial>  |
| **method**    | GET, POST                                                                  | POST                    |
| **timeout**   | positive integer in seconds                                                | 30 seconds              |
| **timeLimit** | positive integer (seconds)                                                 | 14400 seconds (4 hours) |
| **callerId**  | a valid phone number, or client identifier if you are dialing a \<Client>. | Caller’s callerId       |
| **record**    | true, false                                                                | false                   |
| **dialMusic** | relative or absolute URL                                                   | no default              |

* &#x20;**action.** The action attribute takes a URL as the argument. When the dialed call ends, CallAPI will make a GET or POST request to this URL using the parameters below. If an action URL is provided, CallAPI will continue the current call after the dialed party has hung up, using the RCML received in your response to the action URL request. Any RCML verbs occurring after a  which specifies an action attribute are unreachable. If no action is provided,  will finish and CallAPI will move on to the next RCML verb in the document. If there is no next verb, CallAPI will end the phone call.
* **method.** The method attribute takes the value of 'GET' or 'POST'. This tells CallAPI whether to request the action URL via an HTTP GET or POST. This attribute is modeled after the HTML form 'method' attribute.
* **timeout** The timeout attribute sets the time (in seconds) that  waits for the called party to answer the call.
* **timelimit** The timeLimit attribute sets the maximum duration of the  in seconds.
* **callerId** The callerId attribute lets you specify the caller ID that will appear to the called party when CallAPI makes the call.\
  By default, when you put a \<Dial>  in your RCML response to CallAPI's inbound call request, the caller ID that the dialed party sees is the inbound caller’s caller ID. If you are dialing a \<Client> , you can set a client identifier as the callerId attribute.\
  For example, if you set up a client for incoming calls and you are dialing it, you could set the callerId attribute to client:thomas.
* **record.** The record attribute lets you specify whether the call will be recorded or not. By default, the call is not recorded. If you set the attribute to 'true' CallAPI will start recording when the two calls are bridged.\
  The current release of CallAPI does not support recordings for Dial Conference. This feature will be available in the next release.
* dialMusic The dialMusic attribute lets you specify a custom RingBack tone to be played. The attribute should be set to a valid URL pointing to WAV file.

### Request Parameters

You can nest the following nouns within the \<Dial>  verb: ,\<Number> , \<Client> and \<Conference> .

| Parameter            | Description                                                                                                                                                                                       |
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **DialCallStatus**   | The outcome of the \<Dial> attempt. See the DialCallStatus section below for details.                                                                                                             |
| **DialCallSid**      | The call sid of the new call leg. This parameter is not sent after dialing a conference.                                                                                                          |
| **DialCallDuration** | The duration in seconds of the dialed call. This parameter is not sent after dialing a conference.                                                                                                |
| **RecordingUrl**     | The URL of the recorded audio. This parameter is only sent if record="true" is set on the `Dial` verb, and does not include recordings from the \<Record> verb or Record=True on REST API calls.. |

**DialCallStatus Values**

| Parameter | Description                                                                                                                                    |
| --------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| completed | The called party answered the call and was connected to the caller.                                                                            |
| busy      | CallAPI received a busy signal when trying to connect to the called party.                                                                     |
| no-answer | The called party did not pick up before the timeout period passed.                                                                             |
| failed    | CallAPI was unable to route to the given phone number. This is frequently caused by dialing a properly formated but non-existent phone number. |
| canceled  | The call was canceled via the REST API before it was answered.                                                                                 |

{% hint style="info" %}
The current release of CallAPI doesn’t support recording for Dial Conference. This feature will be available in the next release
{% endhint %}

&#x20;**Nesting.** You can nest the following nouns within \<Dial>: \<Number>, \<Client>, \<Conference>

## <br>


# Number

The **\<Number>** noun specifies a phone number to dial. You can use multiple **\<Number>** nouns within a **\<Dial>** verb to simultaneously call all of them at once. The first call to pick up is connected to the current call and the rest are hung up.

\
Number Attributes
-----------------

| Name                 | Allowed Values                                  | Default Value |
| -------------------- | ----------------------------------------------- | ------------- |
| url                  | any url                                         | none          |
| method               | `GET`, `POST`                                   | `POST`        |
| statusCallbackEvent  | `initiated`, `ringing`, `answered`, `completed` | none          |
| statusCallback       | any url                                         | none          |
| statusCallbackMethod | `GET`, `POST`                                   | `POST`        |

{% hint style="info" %}
&#x20;**url.** The 'url' attribute allows you to specify a URL for a RCML document that will run on the called party’s end, after he/she answers, but before the parties are connected. You can use this RCML to privately play or say information to the called party, or provide a chance to decline the phone call using \<Gather> and \<Hangup>. The current caller will continue to hear ringing while the RCML document executes on the other end. RCML documents executed in this manner are not allowed to contain the \<Dial> verb
{% endhint %}

### **method**

The 'method' attribute allows you to specify which HTTP method CallAPI should use when requesting the URL in the 'url' attribute. The default is POST.

### **statusCallbackEvent**

When dialing out to a PSTN Number using \<Dial>, an outbound call is initiated. The call transitions from the initiated state to the ringing state when the phone starts ringing. It transitions to the answered state when the call is picked up, and finally to the completed state when the call is over. With **statusCallbackEvent**, you can subscribe to receive webhooks for the different call progress events: initiated, ringing, answered, or completed for a given call.

The **statusCallbackEvent** attribute allows you to specify which events CallAPI should webhook on. To specify multiple events separate them with a comma: `initiated,ringing,answered,completed`. If a statusCallback is provided and no status callback events are specified the completed event will be sent by default.

As opposed to creating an outbound call via the API, outbound calls created using \<Dial> are initiated right away and never queued. The following shows a timeline of possible call events that can be returned and the different call statuses that a \<Dial> leg may experience:

The **\<Number>** noun specifies a PSTN Number to dial. You can use multiple **\<Number>** nouns within a **\<Dial>** verb to simultaneously attempt a connection with many numbers at once. The first number to accept the incoming connection is connected to the call and the other connection attempts are canceled.

<figure><img src="https://1236659340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9DK7ECJ2K9vb8esaMBnY%2Fuploads%2FLt5Fn7q4hSKabIvKmPQA%2Fimage.png?alt=media&amp;token=0bc8a2d3-a6bd-4334-98c4-9c53d7e0e616" alt=""><figcaption></figcaption></figure>

| Event     | Description                                                                                                                                                                                                                                |
| --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| initiated | The `initiated` event is fired when CallAPI starts dialing the call.                                                                                                                                                                       |
| ringing   | The `ringing` event is fired when the call starts ringing.                                                                                                                                                                                 |
| answered  | The `answered` event is fired when the call is answered.                                                                                                                                                                                   |
| completed | The `completed` event is fired when the call is completed regardless of the termination status: `busy`, `canceled`, `completed`, `failed`, or `no-answer`. If no `statusCallbackEvent` is specified, `completed` will be fired by default. |

### **statusCallback**

When dialing out to a PSTN Number using , an outbound call is initiated. The call transitions from the initiated state to the ringing state when the phone starts ringing. It transitions to the answered state when the call is picked up, and finally to the completed state when the call is over. \
With statusCallbackEvent, you can subscribe to receive webhooks for the different call progress events: initiated, ringing, answered, or completed for a given call. The statusCallbackEvent attribute allows you to specify which events CallAPI should webhook on. \
To specify multiple events separate them with a comma: initiated,ringing,answered,completed. If a statusCallback is provided and no status callback events are specified the completed event will be sent by default. Compared to creating an outbound call via the API, outbound calls created using  are initiated right away and never queued. \
The following shows a timeline of possible call events that can be returned and the different call statuses that a  leg may experience:

The \<Number>  noun specifies a PSTN Number to dial. You can use multiple  nouns within a  verb to simultaneously attempt a connection with many numbers at once. The first number to accept the incoming connection is connected to the call and the other connection attempts are canceled.

**statusCallbackMethod**

The **statusCallbackMethod** attribute allows you to specify which HTTP method CallAPI should use when requesting the URL in the statusCallback attribute. The default is POST.

#### **Status Callback HTTP Parameters**

The parameters CallAPI passes to your application in its asynchronous request to the StatusCallback URL include all parameters passed in a synchronous request to retrieve RCML when CallAPI receives a call to one of your CallAPI numbers. The full list of parameters and descriptions of each are in the RCML Voice Request documentation.

{% hint style="info" %}
When the call progress events are fired, the Status Callback request also passes these additional parameters:
{% endhint %}

| Parameter      | Description                                                                                                                                                                                                        |
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| CallSid        | A unique identifier for this call, generated by CallAPI. You can use the `CallSid` to modify the child call by POSTing to Calls/{CallSid} with a new RCML URL.                                                     |
| CallStatus     | A descriptive status for the call. The value is one of **`queued`**, **`initiated`**, **`ringing`**, **`in-progress`**, **`busy`**, **`failed`**, or **`no-answer`**. See the CallStatus section for more details. |
| CallDuration   | The duration in seconds of the just-completed call. Only present in the `completed` event.                                                                                                                         |
| Timestamp      | The timestamp when the event was fired, given as UTC in [RFC 2822](http://php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format.                                                                 |
| CallbackSource | A string that describes the source of the webhook. This is provided to help disambiguate why the webhook was made. On Status Callbacks, this value is always **`call-progress-events`.**                           |
| SequenceNumber | The order in which the events were fired, starting from `0`. Although events are fired in order, they are made as separate HTTP requests and there is no guarantee they will arrive in the same order.             |

## Examples

{% hint style="info" %}
Examples of using the \<Dial> verb.
{% endhint %}

```markup
<Response>
    <Dial>1-444-555-666</Dial>
</Response>
```

```markup
<Response>
    <Dial record="true">1-444-555-666</Dial>
</Response>
```

```markup
<Response>
    <Dial callerId="1555666777" record="true">1-444-555-666</Dial>
</Response>
```


# Client

## Noun Attributes

{% hint style="info" %}
&#x20;The `<Client>` noun supports the following attributes that modify its behavior:
{% endhint %}

| Attribute Name           | Allowed Values                                  | Default Value |
| ------------------------ | ----------------------------------------------- | ------------- |
| **name**                 | String                                          | none          |
| **url**                  | any url                                         | none          |
| **method**               | `GET`, `POST`                                   | `POST`        |
| **statusCallbackEvent**  | `initiated`, `ringing`, `answered`, `completed` | none          |
| **statusCallback**       | any url                                         | none          |
| **statusCallbackMethod** | `GET`, `POST`                                   | `POST`        |

### **name**

&#x20;The 'name' attribute allows you to inform the client who will answer to a video call. This attribute should be used only when `<Video>` noun is nested, otherwise client’s name should be used as the  value of the tag `<Client>`.

&#x20;Client’s name without `<Video>` noun nesting

```markup
<Client>alice</Client>
```

&#x20;Client’s name with `<Video>` noun nesting.

```markup
<Client name="alice">
    <Video enable=”true”></Video>
</Client>
```

This attribute may contain URI params to declare propietary SIP headers to be included in the outgoing INVITE message.

```markup
<Client>alice?X-Custom-Header1=1234&X-Custom-Header2=4321</Client>
```

### **url**

The url attribute allows you to specify a URL for a RCML document that will run on the called party’s end, after the call is answered, but before the parties are connected. You can use this RCML to privately play or say information to the called party, or provide a chance to decline the phone call using . The caller will continue to hear ringing while the RCML document executes on the other end. RCML documents executed in this manner are not allowed to contain the verb’s method.

#### **method**

The 'method' attribute allows you to specify which HTTP method CallAPI should use when requesting the URL in the 'url' attribute. The default value is POST.

#### **statusCallbackEvent**

When dialing out to a Client using \<Dial>, an outbound call is initiated. The call transitions from the initiated state to the ringing state when the phone starts ringing. It transitions to the answered state when the call is picked up, and finally to the completed state when the call is over. With **statusCallbackEvent**, you can subscribe to receive webhooks for the different call progress events: initiated, ringing, answered, or completed for a given call.

The **statusCallbackEvent** attribute allows you to specify which events CallAPI should webhook on. To specify multiple events separate them with a comma: `initiated,ringing,answered,completed`. If a statusCallback is provided and no status callback events are specified the completed event will be sent by default.

Compared  to creating an outbound call via the API, outbound calls created using \<Dial> are initiated right away and never queued. The following shows a timeline of possible call events that can be returned and the different call statuses that a \<Dial> leg may experience:

The \<Client>  noun specifies a client identifier to dial. You can use multiple \<Client>  nouns within a \<Dial>  verb to simultaneously attempt a connection with many clients at once. The first client to accept the incoming connection is connected to the call and the other connection attempts are canceled.

![](broken://files/-M5aSYeQhozwGyGRNSqN)

| Event         | Description                                                                                                                                                                                                                                |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **initiated** | The `initiated` event is fired when CallAPI starts dialing the call.                                                                                                                                                                       |
| **ringing**   | The `ringing` event is fired when the call starts ringing.                                                                                                                                                                                 |
| **answered**  | The `answered` event is fired when the call is answered.                                                                                                                                                                                   |
| **completed** | The `completed` event is fired when the call is completed regardless of the termination status: `busy`, `canceled`, `completed`, `failed`, or `no-answer`. If no `statusCallbackEvent` is specified, `completed` will be fired by default. |

#### **statusCallback**

The **statusCallback** attribute allows you to specify a URL for CallAPI to send webhook requests to on each event specified in the statusCallbackEvent attribute.

#### **statusCallbackMethod**

The **statusCallbackMethod** attribute allows you to specify which HTTP method CallAPI should use when requesting the URL in the statusCallback attribute. The default is POST.

### **9.3.3.2 Status Callback HTTP Parameters**

The parameters CallAPI passes to your application in its asynchronous request to the StatusCallback URL include all parameters passed in a synchronous request to retrieve RCML when CallAPI receives a call to one of your CallAPI numbers. The full list of parameters and descriptions of each are in the RCML Voice Request documentation.

{% hint style="info" %}
When the call progress events are fired, the Status Callback request also passes these additional parameters:
{% endhint %}

| Parameter          | Description                                                                                                                                                                                            |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **CallSid**        | A unique identifier for this call, generated by CallAPI. You can use the `CallSid` to modify the child call by POSTing to Calls/{CallSid} with a new RCML URL.                                         |
| **CallStatus**     | A descriptive status for the call. The value is one of **`queued`**, **`initiated`**, **`ringing`**, **`in-progress`**, **`busy`**, **`failed`**, or **`no-answer`**. See CallStatus for more details. |
| **CallDuration**   | The duration in seconds of the just-completed call. Only present in the `completed` event.                                                                                                             |
| **Timestamp**      | The timestamp when the event was fired, formatted as UTC in [RFC 2822](http://php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format.                                                 |
| **CallbackSource** | A string that describes the source of the webhook. This is provided to help disambiguate why the webhook was made. On Status Callbacks, this value is always **`call-progress-events`.**               |
| **SequenceNumber** | The order in which the events were fired, starting from `0`. Although events are fired in order, they are made as separate HTTP requests and there is no guarantee they will arrive in the same order. |

## Examples

### Example 1: Dialing to a client

&#x20;In this example, we want to connect the current call to a client named `jenny`. To connect the call to `jenny`, use a [`<Dial>`](https://www.twilio.com/docs/api/twiml/dial) verb with a `<Client>` noun nested inside.

```markup
<?xml version="1.0" encoding="UTF-8"?>
<Response>
   <Dial>
     <Client>Alice</Client>
   </Dial>
</Response>
```

### Example 2: Simultaneous Dialing

&#x20;You can use up to a total of ten `<Number>` and `<Client>` nouns within a `<Dial>` verb to dial multiple phone numbers and clients at the same time. The first person to answer the call will be connected to the caller, while the rest of the call attempts are hung up.

```markup
<?xml version="1.0" encoding="UTF-8"?>
<Response>
  <Dial callerId="+19898XXXXXXX">
        <Number>123-321-4321</Number>
       <Client>jenny</Client>
       <Client>tommy</Client>
  </Dial>
</Response>
```

### Example 3: Call Progress Events

&#x20;In this case, we want to receive a webhook for each call progress event when dialing a Client using `<Dial>`.

```markup
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Dial>
        <Client
             statusCallbackEvent='initiated ringing answered completed'
             statusCallback='https://myapp.com/calls/events'
             statusCallbackMethod='POST'>
                                        thomas
         </Client>
</Dial>
</Response>
```

### &#x20;Example 4: Video call to Client

The following RCML dials to alice enabling video.

```markup
<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Dial>
	    <Client name="alice">
	        <Video enable=”true”>
    	    </Video>
	    </Client>
    </Dial>
</Response>
```


# SIP

The **\<Sip>** noun specifies a SIP URI to dial. You can use multiple \<Sip> nouns within a \<Dial> verb to simultaneously attempt a connection with many user agents at once. The first user agent to accept the incoming connection is connected to the call and the other connection attempts are canceled.

The Dial verb’s Sip noun lets you set up VoIP sessions by using SIP — Session Initiation Protocol. With this feature, you can send a call to any SIP endpoint. Set up your RCML to use the Sip noun within the Dial verb.

Currently, only one Sip noun may be specified per Dial, and the INVITE message may be sent to only one SIP endpoint. Also, you cannot add any other nouns (eg Number, Client) in the same Dial as the SIP. If you want to use another noun, set up a callback on the Dial to use alternate methods .

\
Noun Attributes
---------------

{% hint style="info" %}
&#x20;`<Sip>` noun supports the following attributes that modify its behavior:
{% endhint %}

| Attribute Name           | Allowed Values                                    | Default Value |
| ------------------------ | ------------------------------------------------- | ------------- |
| **name**                 | String                                            | none          |
| **url**                  | any url                                           | none          |
| **method**               | *`GET`, `POST`*                                   | `POST`        |
| **statusCallbackEvent**  | *`initiated`, `ringing`, `answered`, `completed`* | none          |
| **statusCallback**       | any url                                           | none          |
| **statusCallbackMethod** | *`GET`, `POST`*                                   | `POST`        |

### **name**

&#x20;The 'name' attribute allows you to inform the SIP URI who will answer to a video call. This attribute should be used only when `<Video>` noun is nested, otherwise the SIP URI should be informed as value of the tag `<Sip>`.

{% hint style="info" %}
&#x20;Sip URI (name) without `<Video>` noun nesting.
{% endhint %}

```markup
<Sip>sip:alice@127.0.0.1:5080</Sip>
```

{% hint style="info" %}
&#x20;Sip URI (name) with `<Video>` noun nesting.
{% endhint %}

```markup
<Sip name="sip:alice@127.0.0.1:5080">
    <Video enable=”true”></Video>
</Sip>
```

### **url**

The 'url' attribute allows you to specify a url for a RCML document that will run on the called party’s end, after she answers, but before the parties are connected. You can use this RCML to privately play or say information to the called party, or provide a chance to decline the phone call using  and . The current caller will continue to hear ringing while the RCML document executes on the other end. RCML documents executed in this manner are not allowed to contain the  verb. method

#### **method**

The 'method' attribute allows you to specify which HTTP method CallAPI should use when requesting the URL in the 'url' attribute. The default is POST.

#### **statusCallbackEvent**

When dialing out to a SIP URI using \<Dial>, an outbound call is initiated. The call transitions from the initiated state to the ringing state when the phone starts ringing. It transitions to the answered state when the call is picked up, and finally to the completed state when the call is over. With **statusCallbackEvent**, you can subscribe to receive webhooks for the different call progress events: initiated, ringing, answered, or completed for a given call.

The **statusCallbackEvent** attribute allows you to specify which events CallAPI should webhook on. To specify multiple events separate them with a comma: `initiated,ringing,answered,completed`. If a statusCallback is provided and no status callback events are specified the completed event will be sent by default.

As opposed to creating an outbound call via the API, outbound calls created using \<Dial> are initiated right away and never queued. The following shows a timeline of possible call events that can be returned and the different call statuses that a \<Dial> leg may experience:

The **\<Sip>** noun specifies a sip URI to dial. You can use multiple **\<Sip>** nouns within a **\<Dial>** verb to simultaneously attempt a connection with many sip URIS at once. The first Sip URI to accept the incoming connection is connected to the call and the other connection attempts are canceled.

<figure><img src="https://1236659340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9DK7ECJ2K9vb8esaMBnY%2Fuploads%2FtMbEkF307o9t5PWXayiw%2Fimage.png?alt=media&amp;token=68d281a9-e457-44db-b2c9-908b0809ac34" alt=""><figcaption></figcaption></figure>

| Event         | Description                                                                                                                                                                                                                                |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **initiated** | The `initiated` event is fired when CallAPI starts dialing the call.                                                                                                                                                                       |
| **ringing**   | The `ringing` event is fired when the call starts ringing.                                                                                                                                                                                 |
| **answered**  | The `answered` event is fired when the call is answered.                                                                                                                                                                                   |
| **completed** | The `completed` event is fired when the call is completed regardless of the termination status: `busy`, `canceled`, `completed`, `failed`, or `no-answer`. If no `statusCallbackEvent` is specified, `completed` will be fired by default. |

#### **statusCallback**

The **statusCallback** attribute allows you to specify a URL for CallAPI to send webhook requests to on each event specified in the statusCallbackEvent attribute.

#### **statusCallbackMethod**

The **statusCallbackMethod** attribute allows you to specify which HTTP method CallAPI should use when requesting the URL in the statusCallback attribute. The default is POST.

#### **Status Callback HTTP Parameters**

The parameters CallAPI passes to your application in its asynchronous request to the StatusCallback URL include all parameters passed in a synchronous request to retrieve RCML when CallAPI receives a call to one of your CallAPI numbers. The full list of parameters and descriptions of each are in the RCML Voice Request documentation.

{% hint style="info" %}
When the call progress events are fired, the Status Callback request also passes these additional parameters:
{% endhint %}

| Parameter      | Description                                                                                                                                                                                                        |
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| CallSid        | A unique identifier for this call, generated by CallAPI. You can use the `CallSid` to modify the child call by POSTing to Calls/{CallSid} with a new RCML URL.                                                     |
| CallStatus     | A descriptive status for the call. The value is one of **`queued`**, **`initiated`**, **`ringing`**, **`in-progress`**, **`busy`**, **`failed`**, or **`no-answer`**. See the CallStatus section for more details. |
| CallDuration   | The duration in seconds of the just-completed call. Only present in the `completed` event.                                                                                                                         |
| Timestamp      | The timestamp when the event was fired, given as UTC in [RFC 2822](http://php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format.                                                                 |
| CallbackSource | A string that describes the source of the webhook. This is provided to help disambiguate why the webhook was made. On Status Callbacks, this value is always **`call-progress-events`.**                           |
| SequenceNumber | The order in which the events were fired, starting from `0`. Although events are fired in order, they are made as separate HTTP requests and there is no guarantee they will arrive in the same order.             |

## **Example**

```markup
<Response>
    <Dial>
    <Sip>sip:alice@127.0.0.1:5080</Sip>
    </Dial>
</Response>
```

## Authentication

Send username and password attributes for authentication to your SIP infrastructure as attributes on the Sip noun.

### **Request Parameters**

| Attribute Name | Values                           |
| -------------- | -------------------------------- |
| **username**   | Username for SIP authentication. |
| **password**   | Password for SIP authentication  |

### **Example**

```markup
<Response>
    <Dial>
    <Sip username="alice" password="secret">sip:alice@example.com</Sip>
    </Dial>
</Response>
```

## Custom headers

{% hint style="info" %}
Send custom headers by appending them to the SIP URI — just as you’d pass headers in a URI over HTTP. For example:
{% endhint %}

```markup
<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Dial>
        <Sip>
        sip:alice@example.com?mycustomheader=tata&myotherheader=toto
        </Sip>
    </Dial>
</Response>
```

## Character Limit

While the SIP URI itself must be under 255 chars, the headers must be under 1024 characters.

## Transport

```markup
<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Dial>
        <Sip>
        sip:alice@example.com;transport=tcp
        </Sip>
    </Dial>
</Response>
```

Set a parameter on your SIP URI to specify what transport protocol you want to use. Currently, this is limited to TCP and UDP. By default, CallAPI sends your SIP INVITE over UDP.

{% hint style="info" %}
Change this by using the transport parameter:
{% endhint %}

### Attributes

#### **Request Parameters**

| Attribute Name | Allowed Values      | Default Value |
| -------------- | ------------------- | ------------- |
| **url**        | call screening url. | none.         |
| **method**     | GET, POST           | POST          |

**url**. The url attribute allows you to specify a URL for a RCML document that runs on the called party’s end, after they answer, but before the two parties are connected. You can use this RCML to privately Play or Say information to the called party, or provide a chance to decline the phone call using Gather and Hangup. The current caller continues to hear ringing while the RCML document executes on the other end. RCML documents executed in this manner cannot contain the \<dial> verb.

**method.** The method attribute allows you to specify which HTTP method CallAPI should use when requesting the URL specified in the url attribute. The default is POST.

#### **Call Screening HTTP parameters**

{% hint style="info" %}
When a call is answered, CallAPI passes the following parameters with its request to your screening URL (in addition to the standard RCML Voice request parameters):
{% endhint %}

#### Request Parameters

| Attribute Name | Values                                                                                  |
| -------------- | --------------------------------------------------------------------------------------- |
| **SipCallId**  | The SIP call ID header of the request made to the remote SIP infrastructure.            |
| **SipHeader**  | The name/value of any X-headers returned in the 200 response to the SIP INVITE request. |

### &#x20;**Dial Action HTTP parameters**

{% hint style="info" %}
Use the action callback parameters to modify your application based on the results of the SIP dial attempt:
{% endhint %}

#### **Request Parameters**

| Attribute Name          | Values                                                                                    |
| ----------------------- | ----------------------------------------------------------------------------------------- |
| **DialSipCallId**       | The SIP call ID header of the request made to the remote SIP infrastructure.              |
| **DialSipResponseCode** | The SIP response code as a result of the INVITE attempt.                                  |
| **DialSipHeader\_**     | The name/value of any X-headers returned in the final response to the SIP INVITE request. |

\
**Dial with Multiple Examples.**
--------------------------------

{% hint style="info" %}
A more complex Dial, specifying custom settings as attributes on Dial, including call screening and setting the protocol to TCP.
{% endhint %}

```markup
<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Dial
        record="true"
        timeout="10"
        hangupOnStar="true"
        callerId="bob"
        method="POST"
        action="/handle_post_dial">
            <Sip
                method="POST"
                url="/handle_screening_on_answer">
                sip:alice@example.com?customheader=foo
            </Sip>
    </Dial>
</Response>
```


# Play

The Play verb is used to play an audio file to the remote party.

## Play Attributes

| Name     | Allowed Values | Default Value |
| -------- | -------------- | ------------- |
| **Loop** | integer > 1    | 1             |

{% hint style="info" %}
&#x20;**loop.** The 'loop' attribute specifies how many times you’d like the audio file to be repeated. Specifying '0' will cause the the \<Play> verb to loop until the call is hung up.
{% endhint %}

## Supported Audio Formats

| MIME type   | Description      |
| ----------- | ---------------- |
| audio/wav   | wav format audio |
| audio/mp3   | mp3 format audio |
| audio/wave  | wav format audio |
| audio/x-wav | wav format audio |

\
Media Server Audio File Format
------------------------------

### Technical Specification and Capacity

#### The callapi Media Server is capable of:

{% hint style="info" %}
Media and Codecs:

* G711 (a-Law, u-Law);
* GSM;
* Linear PCM(L16);
* G729;
* DTMF(RFC 2833, INBAND)

Media Files:

* Wav (Sample rate 8000Hz, bit rate of 16, Mono);
* mp3 (Any sample rate)
* GSM
  {% endhint %}

## How to Convert a Wav File to the Correct Bitrate

{% hint style="info" %}
You can use a software call ffmpeg as follows:
{% endhint %}

```
ffmpeg -i source_file.wav -acodec pcm_s16le -ac 1 -ar 8000 result_file.wav
```

### Nesting

The  verb can not have any other verbs or nouns nested. Only a URL.

## Examples

{% hint style="info" %}
Example of how to use the  verb:
{% endhint %}

```xml
<Response>
    <Play>http://foobar.com/demo.wav</Play>
</Response>
<Response>
    <Play>http://foobar.com/demo.mp4</Play>
</Response>
```


# Gather

&#x20;The **\<Gather>** verb supports touch tones (DTMF) to get digit responses.&#x20;

In DTMF mode it "gathers" digits that a caller enters into his or her telephone keypad. When the caller is done entering digits, callapi submits that digits to the provided 'action' URL in an HTTP GET or POST request.

If no input is received before timeout, **\<Gather>** falls through to the next verb in the callapi document. You may optionally nest **\<Say>**, **\<Play>**, and **\<Pause>** verbs within a **\<Gather>** verb while waiting for input. This allows you to read menu options to the caller while letting her enter a menu selection at any time. After the first digit is received the audio will stop playing.

## Gather Attributes

| Name                      | Allowed Values                                  | Default Value        |
| ------------------------- | ----------------------------------------------- | -------------------- |
| **action**                | relative or absolute URL                        | current document URL |
| **method**                | GET, POST                                       | POST                 |
| **timeout**               | positive integer                                | 5 seconds            |
| **finishOnKey**           | any digit, #, \*                                | #                    |
| **numDigits**             | integer >= 1                                    | unlimited            |
| **input**                 | dtmf                                            | dtmf                 |
| **partialResultCallback** | relative or absolute url                        | none                 |
| **language**              | en-US, en-GB, es-ES, it-IT, fr-FR, pl-PL, pt-PT | en-US                |
| **hints**                 | "words, phrases that have many words"           | none                 |

{% hint style="info" %}
&#x20;A**ction.** The 'action' attribute takes an absolute or relative URL as a value. When the caller has finished entering digits callapi will make a GET or POST request to this URL including the parameters below. If no 'action' is provided, callapi will by default make a POST request to the current document’s URL.
{% endhint %}

## Gather - Example HTTP Post Variables

You will know this is an incoming post based on the **Digits** being sent via POST.

Here is what the HTTP post will look like to your gather url:

<pre><code><strong>HTTP Post Variables
</strong>(
    [CallSid] => IDe4818a0b8cfc4ca1b3cdad65264e8ba1-CA827f4cbfd2864dc28966a1d26cdbd587
    [InstanceId] => IDe4818a0b8cfc4ca1b3cdad65264e8ba1
    [AccountSid] => ACd4fb7d0eefaf3c057a8b9c7774433568
    [From] => 12536599999
    [To] => 7209914899
    [CallStatus] => answered
    [ApiVersion] => 2012-04-24
    [Direction] => inbound
    [CallerName] => null
    [ForwardedFrom] => null
    [CallTimestamp] => 2026-08-05T22:12:29.864Z
    [CallBackSource] => call-progress-events
    [SequenceNumber] => 2
    [SipHeader_X-Originating-DNIS] => +17209914899
    [Digits] => 1
    [SpeechResult] => 
)
</code></pre>

## Request Parameters

| Parameter  | Description                                                     |
| ---------- | --------------------------------------------------------------- |
| **Digits** | The digits the caller pressed, excluding the finishOnKey digit. |

{% hint style="info" %}
&#x20;M**ethod.** The 'method' attribute takes the value 'GET' or 'POST'. This tells callapi whether to request the 'action' URL via HTTP GET or POST.

&#x20;T**imeout.** The 'timeout' attribute sets the limit in seconds that CallAPI will wait for the caller to press another digit before moving on and making a request to the 'action' URL. For example, if 'timeout' is '10', CallAPI  will wait ten seconds for the caller to press another key before submitting the previously entered digits to the 'action' URL. CallAPI waits until completing the execution of all nested verbs before beginning the timeout period.

&#x20;**finishOnKey.** The 'finishOnKey' attribute lets you choose one value that submits the received data when entered. \
For example, if you set 'finishOnKey' to '#' and the user enters '1234#', CallAPI will immediately stop waiting for more input when the '#' is received and will submit "Digits=1234" to the 'action' URL. \
Note that the 'finishOnKey' value is not sent. The allowed values are the digits 0-9, '#', '\*' and the empty string (set 'finishOnKey' to ''). If the empty string is used, \<Gather> captures all input and no key will end the \<Gather> when pressed. \
In this case CallAPI will submit the entered digits to the 'action' URL only after the timeout has been reached. The value can only be a single character.

&#x20;**numDigits.** The 'numDigits' attribute lets you set the number of digits you are expecting, and submits the data to the 'action' URL once the caller enters that number of digits.

&#x20;**input** A list of inputs that CallAPI  should accept for \<Gather>.

&#x20;**partialResultCallback** A relative or fully qualified URL.
{% endhint %}

{% hint style="warning" %}
The Webhooks to partialResultCallback are async and doesn’t accept RCML back. If you want to act based on the partial result, then use the REST API to Live Modify the call.
{% endhint %}

### &#x20;Request Parameters

{% hint style="info" %}
&#x20;**language** The language CallAPI  should recognize. Defaults to en-US

&#x20;**hints** A list of words or phrases that CallAPI  should expect during recognition. These are very useful for improving recognition of single words or phrases. Entries into hints should be separated by a comma.
{% endhint %}

## Nesting

{% hint style="info" %}
You can nest the following verbs within : \<Gather>:\<Say>:\<Play>:,\<Pause>
{% endhint %}

## Example

Example of how to use the  verb:

```php
<Response>
   <Gather action="http://example.com/rest/menu" numDigits="1">
      <Say>Welcome to TPS.</Say>
      <Say>For store hours, press 1.</Say>
      <Say>To speak to an agent, press 2.</Say>
      <Say>To check your account status, press 3.</Say>
    </Gather>
<!-- If customer doesn't input anything, prompt and try again. -->
    <Say>Sorry, I didn't get your response.</Say>
<Redirect>http://example.com/rest/menu/redirect</Redirect>
</Response>
```


# Record

The \<Record> verb records the caller’s audio, returning the URL of a file containing the audio recording.

## Usage

\<Record> is setup as a way to capture a response from the user and do a callback to you. No other commands after Record should be done, as Record will call back to you and allow you to continue call control.

## Record Attributes

| Name            | Allowed Values                                            | Default Value        |
| --------------- | --------------------------------------------------------- | -------------------- |
| **action**      | relative or absolute URL                                  | current document URL |
| **method**      | GET, POST                                                 | POST                 |
| **timeout**     | positive integer                                          | 5                    |
| **finishOnKey** | any digit, #, \* or -1 to disable                         | #                    |
| **maxLength**   | integer greater than 1 with the number of seconds to wait | 3600 (1 hour)        |
| **playBeep**    | true, false                                               | true                 |

{% hint style="info" %}
&#x20;**action.** The 'action' attribute takes an absolute or relative URL as a value. When recording is finished CallAPI will make a GET or POST request to this URL including the parameters below. If no 'action' is provided, \<Record> will default to requesting the current document’s URL. After making this request, CallAPI will continue the current call using the RCML received in your response. Any RCML verbs occuring after a \<Record> are unreachable. \
There is one exception: if CallAPI receives an empty recording, it will not make a request to the 'action' URL. The current call flow will continue with the next verb in the current RCML document.
{% endhint %}

\
Request Parameters
------------------

| Parameter             | Description                                                     |
| --------------------- | --------------------------------------------------------------- |
| **RecordingUrl**      | The URL of the recorded audio.                                  |
| **RecordingDuration** | The time duration of the recorded audio.                        |
| **Digits**            | The digits the caller pressed, excluding the finishOnKey digit. |

{% hint style="info" %}
&#x20;**Method.** The 'method' attribute takes the value 'GET' or 'POST'. This tells CallAPI whether to request the URL via HTTP GET or POST.

&#x20;**Timeout.** The 'timeout' attribute tells CallAPI to end the recording after a number of seconds of silence has passed.

&#x20;**finishOnKey.** The 'finishOnKey' attribute lets you choose a set of digits that end the recording when entered. \
For example, if you set 'finishOnKey' to '#' and the caller presses '#', CallAPI will immediately stop recording and submit 'RecordingUrl', 'RecordingDuration', and the '#' as parameters in a request to the 'action' URL. \
The allowed values are the digits 0-9, '#', '\*' and '-1'. The default value is '1234567890\*#' which means that any key will end the recording. The value '-1' is a special value that can be used to disable finishOnKey and never stop recording on a DTMF. \
Unlike \<Gather>, you may specify more than one character as a 'finishOnKey' value but '-1' must be used alone.

&#x20;**maxLength.** The 'maxLength' attribute lets you set the maximum length for the recording in seconds.

&#x20;**playBeep.** The 'playBeep' attribute allows you to toggle between playing a sound before the start of a recording.

&#x20;**Media.** The 'media' attribute defines the which kind of information will be stored. Choose 'audio\_only' so store a WAV file containing audio; 'video\_only' to store a MP4 file containing vide; 'audio\_video' to store a MP4 file containing audio and video\*.
{% endhint %}

### Nesting

The \<Record> verb cannot have any other verbs or nouns nested.

## Example

{% hint style="info" %}
Example of how to use the \<Record> verb:
{% endhint %}

```markup
<Response>
  <Say>What is your full name</Say>
  <Record maxLength="10" playBeep="false" action="https://example.com/record"/>
</Response>
```

## Legal Factors when Recording with call api

If you choose to record voice calls, you need to comply with various laws and regulations, including those regarding obtaining consent to record (such as California’s Invasion of Privacy Act and similar laws in other jurisdictions). We recommend that you consult with your legal department to make sure you comply with all applicable laws in connection with communications you record or store using call API


# Hangup

In Remote CallAPI Language (RCML) **\<Hangup>** verb ends a call.

## Nesting

&#x20;The **Hangup** verb can not have any other verbs or nouns nested.

## Example

{% hint style="info" %}
Example of how to use the \<Hangup> verb:
{% endhint %}

```markup
<Response>
    <Hangup/>
</Response>
```


# Pause

The **\<Pause>** verb waits silently for a specific number of seconds. If \<Pause> is the first verb in a RCML response, CallAPI will wait the specified number of seconds before picking up the call.

## Pause Attributes

| Name       | Allowed Values | Default Value |
| ---------- | -------------- | ------------- |
| **length** | integer > 0    | 1 second      |

{% hint style="info" %}
&#x20;**Length.** The 'length' attribute specifies how many seconds CallAPI will wait silently before continuing on.
{% endhint %}

### Nesting

The  verb can not have any other verbs or nouns nested.

## Examples

{% hint style="info" %}
&#x20;Example of how to use the \<Pause> verb:
{% endhint %}

```markup
<Response>
    <Pause length="5"/>
</Response>
```

{% hint style="info" %}
**Delayed pickup**

&#x20;This example demonstrates using `<Pause>` to wait between two `<Say>` verbs.
{% endhint %}

```markup
<Response>
    <Say>I will pause 10 seconds starting now!</Say>
    <Pause length="10"/>
    <Say>I just paused 10 seconds</Say>
</Response>
```


# Reject

The  \<Reject > verb rejects an incoming call to your CallAPI endpoint and can be used for blocking unwanted calls. If the first verb in a RCML response is , CallAPI will not pick up the call. The call ends with ‘busy', 'no-answer' or other status, depending on the verb’s 'reason' attribute. Any verbs after  are ignored and will not be executed.<br>

## Reject Attributes

| Name       | Allowed Values     | Default Value |
| ---------- | ------------------ | ------------- |
| **reason** | \<See table below> | rejected      |

### Reason

{% hint style="info" %}
The reason attribute takes the values from a table below.
{% endhint %}

| Reason                    | Internal SIP Error and reason phrase Status | Purpose                                                                                                                                                                    |
| ------------------------- | ------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **rejected**              | 603 DECLINE                                 | Will play a standard not-in-service response                                                                                                                               |
| **busy**                  | 486 BUSY                                    | Will play a busy signal to the caller                                                                                                                                      |
| **forbidden**             | 403 Forbidden                               | Untrusted IP origin/source                                                                                                                                                 |
| **anonymity\_disallowed** | 433 Anonymity Disallowed                    | Calling party is anonymous and destination does not accept those calls                                                                                                     |
| **address\_incomplete**   | 484 Address Incomplete                      | Wrong destination. regex scenario for number not valid (decision made by the external app still in inbound logic)                                                          |
| **no\_route**             | 404 No Route                                | No route to the destination (provider without routing agreement for some countries) if the App makes the decision there is no route to destination dialed (outbound logic) |
| **service\_unavailable**  | 503 Service Unavailable                     | Redirect traffic to other PoP due to many factors (external App behaving bad, low quality, cloud issues faced, etc)                                                        |
| **unwanted**              | 607 Unwanted                                | Calling party in a blacklist                                                                                                                                               |

## Nesting

The \<Reject> verb can not have any other verbs or nouns nested.

## Example

{% hint style="info" %}
Example of how to use the  \<Reject> verb:
{% endhint %}

```markup
<Response> 
    <Reject reason="busy"/> 
</Response>
```


# Redirect

The **\<Redirect>** verb transfers control of a call to the RCML at a different URL. All verbs after **\<Redirect>** are unreachable and ignored.

## Redirect Attributes

| Name       | Allowed Values | Default Value |
| ---------- | -------------- | ------------- |
| **method** | GET, POST      | POST          |

{% hint style="info" %}
&#x20;**Method.** The 'method' attribute takes the value 'GET' or 'POST'. This tells CallAPI whether to request the URL via HTTP GET or POST.
{% endhint %}

### Nesting

Example of how to use the \<Redirect> verb:

## Example

{% hint style="info" %}
For an example of how to use the  verb see below.
{% endhint %}

```markup
<Response>
    <Redirect>http://foobar.com/instructions</Redirect>
</Response>
```


# Carrier and CNAM

Lookup Carrier or CNAM records

## GET or POST Request

{% hint style="info" %}
<https://v1.api19.com/lookup/number>
{% endhint %}

Lookup the CNAM, Carrier or BOTH for a specific number.

You will be billed for 2 transactions if you use both as lookups are billed separately.

| Argument | Required | Type                                       |
| -------- | -------- | ------------------------------------------ |
| type     | yes      | <p>Options:<br>cnam<br>carrier<br>both</p> |
| number   | yes      | phone number                               |
| key      | yes      | your api key                               |

CURL Commands

{% tabs %}
{% tab title="Curl Post" %}

```javascript
curl https://v1.api19.com/lookup/number \
 -d 'type=cnam' \
 -d 'number=3033333333' \
 -d 'key=api_token'
```

{% endtab %}

{% tab title="Curl Get" %}

```javascript
curl https://v1.api19.com/lookup/number?type=both&number=3033033333&key=apikey
```

{% endtab %}
{% endtabs %}

JSON Responses

{% tabs %}
{% tab title="Both - JSON Response" %}

```json
{
  "data": {
    "carrier": {
      "status": "ok",
      "spid": "979E",
      "total_ported_spid": "50345535",
      "port_date": "2020-08-11 20:55:32",
      "fraud_risk": "high",
      "is_textable": "no",
      "lrn": "7207270948",
      "spid_name": "BANDWIDTH.COM-NSR-10X/1|0",
      "ocn_name": "unknown",
      "ocn": "000",
      "ocn_type": "unknown",
      "carrier": "Bandwidth.com",
      "name": "Bandwidth.com",
      "alt-spid": "",
      "id": "",
      "ported": ""
    },
    "carrier_o": {
      "id": "1",
      "name": "Bandwidth.com"
    }
  },
  "invalid": [],
  "missed": [],
  "number": "+13033333333",
  "pricing": {
    "breakdown": {
      "carrier": "-0.0005",
      "carrier_o": "0"
    },
    "total": "-0.0005"
  },
  "status": "ok",
  "type": "unknown",
  "cnam": "MOBILE ADDICTIO"
}

```

{% endtab %}

{% tab title="Cnam - JSON Response" %}

```json
{
  "status": "ok",
  "cnam": "MOBILE ADDICTIO"
}
```

{% endtab %}
{% endtabs %}


# Validate Portability

Validate that numbers are portable to our system

## GET or POST Request <a href="#get-or-post-request" id="get-or-post-request"></a>

{% hint style="info" %}
<https://v1.api19.com/lnp/portability/check>
{% endhint %}

Send us a GET or POST request with your key and the numbers to validate.

We will validate the portability of numbers and reply with all numbers are valid or errors.

<table data-header-hidden><thead><tr><th width="152.09088134765625"></th><th width="136.72723388671875"></th><th></th></tr></thead><tbody><tr><td>Argument</td><td>Required</td><td>Type</td></tr><tr><td>numbers</td><td>yes</td><td>comma list of numbers</td></tr><tr><td>key</td><td>yes</td><td>api key</td></tr></tbody></table>

{% tabs %}
{% tab title="Curl Post" %}

```php
curl -X POST https://v1.api19.com/lnp/portability/check \
 -d "numbers=3038821111,3035551212,3332221111" \
 -d 'key=your-key'
```

{% endtab %}

{% tab title="JSON Response" %}

```php
{
  "status": "ok",
  "data": {
    "message": "3035551111 is unsupported",
    "errors": {
      "3035551111": "3035551111 is unsupported"
    }
  }
}

OR

{
  "status": "ok",
  "data": {
    "message": "All numbers are valid",
    "errors": []
  }
}
```

{% endtab %}
{% endtabs %}


# Lookup Port Request

Lookup a previous port request

## GET or POST Request <a href="#get-or-post-request" id="get-or-post-request"></a>

{% hint style="info" %}
<https://v1.api19.com/lnp/portability/lookup>
{% endhint %}

Send us a GET or POST request with your key and your order id or one of the numbers from your order id.

<table data-header-hidden><thead><tr><th width="152.09088134765625"></th><th width="136.72723388671875"></th><th></th></tr></thead><tbody><tr><td>Argument</td><td>Required</td><td>Type</td></tr><tr><td>order_id</td><td>no</td><td>order_id</td></tr><tr><td>number</td><td>no</td><td>phone number</td></tr><tr><td>key</td><td>yes</td><td>api key</td></tr></tbody></table>

{% tabs %}
{% tab title="Curl Post" %}

```php
curl -X POST https://v1.api19.com/lnp/portability/lookup \
 -d "order_id=7212" \
 -d "number=3033033033" \
 -d 'key=your-key'
```

{% endtab %}

{% tab title="JSON Response" %}

```php
{
  "status": "ok",
  "message": "ok",
  "data": [
    {
      "order_id": "8284",
      "did": "3038821111",
      "user_id": "30067",
      "name": "internal port name",
      "businessname": "businessname",
      "btn": "3033333333",
      "accountnum": "accountnumber",
      "create_date": "2025-04-09 23:25:08",
      "firstname": "firstname",
      "lastname": "lastname",
      "address1": "address1",
      "address2": "address2",
      "city": "city",
      "state": "state",
      "zip": "zip",
      "file": "30067-BH2g1t7g.png",
      "status": "new",
      "call_flow": "0",
      "update_date": "2025-04-09 23:25:08",
      "requested_due": "2024-04-09 04:25:08",
      "pin": "0",
      "foc_date": "0000-00-00 00:00:00"
    },
    {
      "order_id": "8284",
      "did": "3039921122",
      "user_id": "30067",
      "name": "internal port name",
      "businessname": "businessname",
      "btn": "3033333333",
      "accountnum": "accountnumber",
      "create_date": "2025-04-09 23:25:08",
      "firstname": "firstname",
      "lastname": "lastname",
      "address1": "address1",
      "address2": "address2",
      "city": "city",
      "state": "state",
      "zip": "zip",
      "file": "30067-BH2g1t7g.png",
      "status": "new",
      "call_flow": "0",
      "update_date": "2025-04-09 23:25:08",
      "requested_due": "2024-04-09 04:25:08",
      "pin": "0",
      "foc_date": "0000-00-00 00:00:00"
    }
  ]
}

OR

{
  "status": "error",
  "message": "invalid order_id",
  "data": null
}
```

{% endtab %}
{% endtabs %}


# Submit Port Request

Submit new port request

## GET or POST Request <a href="#get-or-post-request" id="get-or-post-request"></a>

{% hint style="info" %}
<https://v1.api19.com/lnp/portability/submit>
{% endhint %}

Send us a GET or POST request with your key and the numbers to validate.

You will need to include signature. We support signature-pad, data available:\
<https://pastebin.com/C44SRf7h>

We will validate the numbers and reply with all numbers are valid or errors, or reply with status ok and the port order id.

<table data-header-hidden><thead><tr><th width="177.54541015625"></th><th width="136.72723388671875"></th><th></th></tr></thead><tbody><tr><td>Argument</td><td>Required</td><td>Type</td></tr><tr><td>numbers</td><td>yes</td><td>comma list of numbers</td></tr><tr><td>key</td><td>yes</td><td>api key</td></tr><tr><td>portname</td><td>yes</td><td>internal port name</td></tr><tr><td>businessname</td><td>no</td><td>name of business</td></tr><tr><td>firstname</td><td>yes</td><td>first name contact information</td></tr><tr><td>lastname</td><td>yes</td><td>last name of contact information</td></tr><tr><td>address1</td><td>yes</td><td>12 s main street</td></tr><tr><td>address2</td><td>no</td><td>na</td></tr><tr><td>city</td><td>yes</td><td>city</td></tr><tr><td>state</td><td>yes</td><td>state</td></tr><tr><td>zip</td><td>yes</td><td>zip code</td></tr><tr><td>call_flow</td><td>no</td><td>call flow id number</td></tr><tr><td>signature</td><td>no</td><td>signature base64 or no</td></tr><tr><td>requested_due_date</td><td>yes</td><td>04/09/24</td></tr><tr><td>btn</td><td>yes</td><td>billing telephone number</td></tr><tr><td>account_number</td><td>yes</td><td>numbers account number</td></tr><tr><td>pin</td><td>no</td><td>porting pin</td></tr></tbody></table>

{% tabs %}
{% tab title="Curl Post" %}

```php
curl -X POST https://v1.api19.com/lnp/portability/submit \
 -d "numbers=3038821111,3035551212,3332221111" \
 -d 'key=your-key' \
 -d 'portname=internal port name' \
 -d 'businessname=businessname' \
 -d 'firstname=firstname' \
 -d 'lastname=lastname' \
 -d 'address1=address1' \
 -d 'address2=address2' \
 -d 'city=city' \
 -d 'state=state' \
 -d 'zip=zip' \
 -d 'call_flow=call_flow_id' \
 -d 'numbers=numbers' \
 -d 'signature=no' \
 -d 'requested_due_date=04/09/2024' \
 -d 'btn=btn' \
 -d 'account_number=account_number' \
 -d 'pin=pin'
```

{% endtab %}

{% tab title="JSON Response" %}

```php
{
  "status": "ok",
  "order_id": 181182
}

OR

{
  "status": "error",
  "error": "companyname is blank, please correct"
}

OR

{
  "status": "error",
  "error": "Signature is blank, try again",
  "verbose": ""
}

OR

{
  "status": "error",
  "error": "ratecenter DIR ASST in state CO is not supported on DID 3035551212",
  "verbose": ""
}

OR

{
  "status": "error",
  "error": "cant create LNP request, error exception",
  "verbose": ""
}
```

{% endtab %}
{% endtabs %}


# Cancel Request

Cancel a previous port request

## GET or POST Request <a href="#get-or-post-request" id="get-or-post-request"></a>

{% hint style="info" %}
<https://v1.api19.com/lnp/portability/cancel>
{% endhint %}

Send us a GET or POST request with your key and your order id or one of the numbers from your order id.

<table data-header-hidden><thead><tr><th width="152.09088134765625"></th><th width="136.72723388671875"></th><th></th></tr></thead><tbody><tr><td>Argument</td><td>Required</td><td>Type</td></tr><tr><td>order_id</td><td>no</td><td>order_id</td></tr><tr><td>number</td><td>no</td><td>phone number</td></tr><tr><td>key</td><td>yes</td><td>api key</td></tr></tbody></table>

{% tabs %}
{% tab title="Curl Post" %}

```php
curl -X POST https://v1.api19.com/lnp/portability/cancel \
 -d "order_id=7212" \
 -d "number=3033033033" \
 -d 'key=your-key'
```

{% endtab %}

{% tab title="JSON Response" %}

```php
{"status": "ok"}

OR

{
  "status": "error",
  "message": "invalid order_id",
  "data": null
}
```

{% endtab %}
{% endtabs %}


# Create Outbound Fax

Create a new Fax request

## GET or POST Request <a href="#get-or-post-request" id="get-or-post-request"></a>

{% hint style="info" %}
<https://v1.api19.com/fax/create>
{% endhint %}

Send us a GET or POST request with your key and the source, destination and files.

We we will deliver your fax and get back to you. We support 3 methods to send fax files to us. You can choose whichever you would prefer.

## Method 1 - HTTP Post of file1=url, file2=url

This method is pretty straight forward, send file1=, file2= with urls and get is supported

```
curl -X POST https://v1.api19.com/fax/create \
 -d "destination=3035551212" \
 -d "file1=http://x.com/file1.jpg" \
 -d "file2=http://x.com/file2.jpg" \
 -d 'key=your-key'
```

## Method 2 - JSON Post of URLs

Send a JSON post to our server with the URLs in an array called files

Example JSON post:

```json
{
    "key": "hfg29hg23fh23",
    "source": 3038883333,
    "destination": 8823321111,
    "files": [
        "http:\/\/example.com\/test1.jpg",
        "http:\/\/example.com\/fax2.jpg"
    ]
}
```

## Method 3 - HTTP Multipart File Post

Send an HTTP Multipart post or use CURL @file to include the file in the multipart. You don't have to name them file1=, we will look for any multipart file attached.

```javascript
curl -X POST https://v1.api19.com/fax/create \
 -F "source=3038821111" \
 -F "destination=3035551212" \
 -F "file1=@/path/to/local/file1.jpg" \
 -F "file2=@/path/to/local/file2.jpg" \
 -F 'key=your-key'
```

## HTTP Post Variables Supported

<table data-header-hidden><thead><tr><th width="152.09088134765625"></th><th width="136.72723388671875"></th><th></th></tr></thead><tbody><tr><td>Argument</td><td>Required</td><td>Type</td></tr><tr><td>key</td><td>yes</td><td>api key</td></tr><tr><td>source</td><td>yes</td><td>fax number with us</td></tr><tr><td>destination</td><td>yes</td><td>destination fax number</td></tr><tr><td>file1</td><td>yes</td><td>URL with supported file type</td></tr><tr><td>file2-10</td><td>no</td><td>add up to 20 files</td></tr><tr><td>ignore_bad_files</td><td>no</td><td><p>yes</p><p>ignore all files you send that are bad and continue sending the rest</p></td></tr><tr><td>@file</td><td>no</td><td>use CURL or http multi post to attach files to your web request</td></tr><tr><td>call_back_url</td><td>no</td><td>URL to call you back when done</td></tr></tbody></table>

{% tabs %}
{% tab title="Curl Post" %}

```php
curl -X POST https://v1.api19.com/fax/create \
 -d "source=3038821111" \
 -d "destination=3035551212" \
 -d "file1=http://x.com/file1.jpg" \
 -d "file2=http://x.com/file2.jpg" \
 -d 'key=your-key'
```

{% endtab %}

{% tab title="JSON Response" %}

```php
{
  "status": "error",
  "error": "invalid fax number"
}

OR

  "status": "error",
  "error": "invalid destination number"
}

OR

{
  "status": "error",
  "error": "invalid file format",
  "file: "http://x.com/file.wav"
}

OR

{
  "status": "ok",
  "fax_id": 32273421
}

OR

{
    "status": "error",
    "error": "no files",
    "not_supported_files": {
        "moo.mov": "unsupported file extension"
    }
}
```

{% endtab %}
{% endtabs %}

## HTTP Call Back

If you request, we will send you an HTTP call back with your fax status with the following parameters using HTTP POST:

```
(
    [fax_id] => 18123772
    [status] => success
    [pages] => 1
    [long_status] => Success
    [seconds] => 200
    [source] => 7209994255
    [destination] => 7208886293
    [direction] => outbound
    [send_time] => 2024-04-10 05:04:31
    [complete_time] => 2024-04-10 06:04:28
)
```


# Lookup Outbound Fax Status

Lookup the status for a previously sent fax

## GET or POST Request <a href="#get-or-post-request" id="get-or-post-request"></a>

{% hint style="info" %}
<https://v1.api19.com/fax/lookup>
{% endhint %}

Send us a GET or POST request with your key and fax id.

This will give you back information about the fax request.

<table data-header-hidden><thead><tr><th width="152.09088134765625"></th><th width="136.72723388671875"></th><th></th></tr></thead><tbody><tr><td>Argument</td><td>Required</td><td>Type</td></tr><tr><td>key</td><td>yes</td><td>api key</td></tr><tr><td>fax_id</td><td>yes</td><td>fax id sent</td></tr></tbody></table>

{% tabs %}
{% tab title="Curl Post" %}

```php
curl -X POST https://v1.api19.com/fax/lookup \
 -d "fax_id=234234" \
 -d 'key=your-key'
```

{% endtab %}

{% tab title="JSON Response" %}

```json
{
  "status": "ok",
  "data": {
    "user_id": "28444",
    "source": "7203334255",
    "destination": "7209996293",
    "direction": "outbound",
    "send_status": "success",
    "long_status": "Success",
    "read_status": "read",
    "pages": "2",
    "seconds": "201",
    "send_time": "2024-04-10 03:31:35",
    "complete_time": "2024-04-10 02:31:32"
  }
}
```

{% endtab %}
{% endtabs %}


# List Faxes

List all outbound faxes

## GET or POST Request <a href="#get-or-post-request" id="get-or-post-request"></a>

{% hint style="info" %}
<https://v1.api19.com/fax/list>
{% endhint %}

Send us a GET or POST request with your key and fax id.

This will list all outbound faxes with status and other information

<table data-header-hidden><thead><tr><th width="152.09088134765625"></th><th width="136.72723388671875"></th><th></th></tr></thead><tbody><tr><td>Argument</td><td>Required</td><td>Type</td></tr><tr><td>key</td><td>yes</td><td>api key</td></tr><tr><td>limit</td><td>no</td><td>int - how many replies</td></tr><tr><td>offset</td><td>no</td><td>int - for pagination</td></tr><tr><td>did</td><td>no</td><td>show only faxes for this number</td></tr><tr><td>date_from</td><td>no</td><td>2024-05-03 00:00:00</td></tr><tr><td>date_to</td><td>no</td><td>2024-05-06 00:00:00</td></tr><tr><td>direction</td><td>no</td><td>inbound or outbound (default both)</td></tr><tr><td>source</td><td>no</td><td>source number</td></tr><tr><td>destination</td><td>no</td><td>destination number</td></tr></tbody></table>

{% tabs %}
{% tab title="Curl Post" %}

```php
curl -X POST https://v1.api19.com/fax/list\
 -d "limit=1000" \
 -d 'key=your-key'
```

{% endtab %}

{% tab title="JSON Response" %}

```php
{
  "status": "ok",
  "data": [
    {
      "fax_id": 1234812123
      "source": "7209274255",
      "destination": "7207746293",
      "direction": "outbound",
      "send_status": "success",
      "long_status": "Success",
      "seconds": "201",
      "pages": "2"
      "send_time": "2024-05-10 04:22:24",
      "complete_time": "2024-05-10 04:22:57"
    },
    {
      "fax_id": 1234812124
      "source": "7209274255",
      "destination": "7207746293",
      "direction": "outbound",
      "send_status": "success",
      "long_status": "Success",
      "seconds": "222",
      "pages": "1"
      "send_time": "2024-05-10 04:22:24",
      "complete_time": "2024-05-10 04:22:57"
    }
  ]
}

OR

{
  "status": "error",
  "error": "invalid information"
}

OR

{
  "status": "ok",
  "data": []
}

```

{% endtab %}
{% endtabs %}


# Download File

Download the file of a specific fax id

## GET or POST Request <a href="#get-or-post-request" id="get-or-post-request"></a>

{% hint style="info" %}
<https://v1.api19.com/fax/download>
{% endhint %}

Send us a GET or POST request with your key and fax id.

This will deliver the fax back to you or if no file can be found, we will return an http code 500 and a json object.&#x20;

<table data-header-hidden><thead><tr><th width="152.09088134765625"></th><th width="136.72723388671875"></th><th></th></tr></thead><tbody><tr><td>Argument</td><td>Required</td><td>Type</td></tr><tr><td>key</td><td>yes</td><td>api key</td></tr><tr><td>fax_id</td><td>yes</td><td>fax id</td></tr></tbody></table>

{% tabs %}
{% tab title="Curl Post" %}

```php
curl -X POST https://v1.api19.com/fax/download\
 -d "fax_id=234234" \
 -d 'key=your-key'
```

{% endtab %}

{% tab title="Response" %}

```
HTTP 200 OK
HTTP File download object

HTTP 500
{"status":"error", "error": "Unable to retrieve fax"}
```

{% endtab %}
{% endtabs %}


# List Companies

List all of the companies on your account

## GET or POST Request

{% hint style="info" %}
<https://v1.api19.com/ra/companies/list>
{% endhint %}

Get a list of all of your companies on your account and show the price you're paying per registered agent company

{% tabs %}
{% tab title="Curl Post" %}

```php
curl https://v1.api19.com/ra/companies/list \
 -d 'key=api_token'
```

{% endtab %}

{% tab title="Curl Get" %}

```php
curl https://v1.api19.com/ra/companies/list?key=apikey
```

{% endtab %}

{% tab title="JSON Response" %}

```json
{
    "status": "ok",
    "data": {
        "8fb10148-jj22-4038-mm22-36fa2f28978f": {
            "uu_id": "8fb10148-jj22-4038-mm22-36fa2f28978f",
            "name": "moo communications llc",
            "home_state": "Florida",
            "jurisdictions": null,
            "create_dt": "2025-05-10 17:07:15",
            "agent_count": "10"
        },
    "price": "85"
}

ERROR:
{
    "status": "error",
    "error": "No companies found - Create one"
}

```

{% endtab %}
{% endtabs %}


# List Registered Agents

List all of the registered agents on your account for a company

## GET or POST Request

{% hint style="info" %}
<https://v1.api19.com/ra/agents/list>
{% endhint %}

Get a list of all of your registered agent addresses on your account for a specific company

| Argument    | Required | Type         |
| ----------- | -------- | ------------ |
| company\_id | yes      | company id   |
| key         | yes      | your api key |

{% tabs %}
{% tab title="Curl Post" %}

```php
curl https://v1.api19.com/ra/agents/list \
 -d 'company_id=h329fh23r' \
 -d 'key=api_token'
```

{% endtab %}

{% tab title="Curl Get" %}

```
curl https://v1.api19.com/ra/agents/list?company_id=32yg23&key=apikey
```

{% endtab %}

{% tab title="JSON Response" %}

```json
DATA:
{
    "status": "ok",
    "data": {
        "94ff01b3-2828-445a-8a99-5932e1234ce6": {
            "uu_id": "94ff01b3-2828-445a-8a99-5932e1234ce6",
            "company_id": "8fb10148-aa09-4038-88f4-26fa2f28978f",
            "ra_name": "Registered Agents Inc",
            "ra_address_1": "212 W. Main St.",
            "ra_address_2": "STE B",
            "ra_city": "Dothan",
            "ra_state": "AL",
            "ra_zip": "36303",
            "status": "active",
            "auto_renew": "no",
            "create_dt": "2025-05-11 16:43:36",
            "filed_date": "2025-05-11 21:00:24"
        },
    "company": "moo communications llc"
}

ERROR:
{
    "status": "error",
    "error": "Cannot locate company",
    "verbose": "none"
}
```

{% endtab %}
{% endtabs %}


# List Documents

List all of the documents on your account for a company

## GET or POST Request

{% hint style="info" %}
<https://v1.api19.com/ra/documents/list>
{% endhint %}

Get a list of all of your documents on your account for a specific company

| Argument    | Required | Type         |
| ----------- | -------- | ------------ |
| company\_id | yes      | company id   |
| key         | yes      | your api key |

{% tabs %}
{% tab title="Curl Post" %}

```php
curl https://v1.api19.com/ra/documents/list \
 -d 'company_id=h329fh23r' \
 -d 'key=api_token'
```

{% endtab %}

{% tab title="Curl Get" %}

```
curl https://v1.api19.com/ra/documents/list?company_id=32yg23&key=apikey
```

{% endtab %}

{% tab title="JSON Response" %}

```json
NO DOCUMENTS:
{
    "status": "error",
    "error": "No registered agent documents found",
    "verbose": "none"
}

BAD COMPANY:
{
    "status": "error",
    "error": "Cannot locate company",
    "verbose": "none"
}

LIST OF DOCUMENTS:
{
    "status": "ok",
    "document_id": "hwew-2gh23hf32-f32hf2",
    "title": "Subpeona for information",
    "pages": 4,
    "downloaded": "yes"
}

```

{% endtab %}
{% endtabs %}


# Download Document

Download a specific document

## GET or POST Request

{% hint style="info" %}
<https://v1.api19.com/ra/documents/download>
{% endhint %}

Download a specific document ID in pdf format

| Argument     | Required | Type         |
| ------------ | -------- | ------------ |
| company\_id  | yes      | company id   |
| document\_id | yes      | document id  |
| key          | yes      | your api key |

{% tabs %}
{% tab title="Curl Post" %}

```php
curl https://v1.api19.com/ra/documents/download \
 -d 'company_id=h329fh23r' \
 -d 'document_id=h29gh2h23t32' \
 -d 'key=api_token'
```

{% endtab %}

{% tab title="Curl Get" %}

```
curl https://v1.api19.com/ra/documents/download?company_id=32yg23&document_id=h23gh23g2&key=apikey
```

{% endtab %}

{% tab title="JSON Response" %}

```json
NO DOCUMENT:
{
   "status": "error",
   "error": "No document found"
}

DOCUMENTS:
{
    "status": "ok",
    "file_type": "pdf",
    "data": "base64_encoded raw data"
}

```

{% endtab %}
{% endtabs %}


# Create Company

Create a new company for registered agent

## GET or POST Request

{% hint style="info" %}
<https://v1.api19.com/ra/companies/create>
{% endhint %}

Create a new company in our system to use for creating registered agents against

<table data-header-hidden><thead><tr><th width="197.727294921875"></th><th width="137.8182373046875"></th><th></th></tr></thead><tbody><tr><td>Argument</td><td>Required</td><td>Type</td></tr><tr><td>company_name</td><td>yes</td><td>my co inc</td></tr><tr><td>entity_type</td><td>yes</td><td>Limited Liability Company<br>Corporation<br>General Partnership<br>Sole Proprietorship</td></tr><tr><td>home_state</td><td>yes</td><td>Colorado</td></tr><tr><td>jurisdictions</td><td>yes</td><td>JSON Array:<br>["Colorado", "Nebraska"]<br>OR<br>PLAIN TEXT:<br>Colorado</td></tr><tr><td>key</td><td>yes</td><td>your API key</td></tr></tbody></table>

{% tabs %}
{% tab title="Curl Post" %}

```php
curl https://v1.api19.com/ra/companies/create \
 -d 'company_name=abc company inc' \
 -d 'entity_type=Limited Liability Company' \
 -d 'home_state=Colorado' \
 -d 'jurisdictions=["Colorado","Nebraska"]' \
 -d 'key=api_token'
```

{% endtab %}

{% tab title="JSON Response" %}

```php
OK:
{
    "status": "ok",
    "company_id": "feh92hf92hf23rh3232" 
}

ERROR:
{
    "status": "error",
    "error": "Company already exists"
}

```

{% endtab %}

{% tab title="Possible Errors" %}

```hack
Jurisdictions must be selected
Tools connectivity issue
Home state must be selected
Company already exists
Invalid entity type. Must be one of: 
Invalid jurisdiction: 
Invalid home state: 
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="States" %}
Supported States

array:

```php
["Alabama", "Alaska", "Arizona", "Arkansas", "California", "Colorado", "Connecticut", "Delaware", "District of Columbia", "Florida", "Georgia", "Hawaii", "Idaho", "Illinois", "Indiana", "Iowa", "Kansas", "Kentucky", "Louisiana", "Maine", "Maryland", "Massachusetts", "Michigan", "Minnesota", "Mississippi", "Missouri", "Montana", "Nebraska", "Nevada", "New Hampshire", "New Jersey", "New Mexico", "New York", "North Carolina", "North Dakota", "Ohio", "Oklahoma", "Oregon", "Pennsylvania", "Rhode Island", "South Carolina", "South Dakota", "Tennessee", "Texas", "Utah", "Vermont", "Virginia", "Washington", "West Virginia", "Wisconsin", "Wyoming", "American Samoa", "Federal", "Guam", "Northern Mariana Islands", "U.S. Virgin Islands", "Puerto Rico"];
```

{% endtab %}

{% tab title="Entity Types" %}
Supported Entity Types

array:

```php
['Limited Liability Company', 'Corporation', 'General Partnership', 'Sole Proprietorship']
```

{% endtab %}
{% endtabs %}


# Delete Company

Delete a specific company with no services

## GET or POST Request

{% hint style="info" %}
<https://v1.api19.com/ra/companies/delete>
{% endhint %}

Delete a specific company

| Argument    | Required | Type         |
| ----------- | -------- | ------------ |
| company\_id | yes      | company id   |
| key         | yes      | your api key |

{% tabs %}
{% tab title="Curl Post" %}

```php
curl https://v1.api19.com/ra/companies/delete \
 -d 'company_id=h329fh23r' \
 -d 'key=api_token'
```

{% endtab %}

{% tab title="Curl Get" %}

```
curl https://v1.api19.com/ra/companies/delete?company_id=32yg23&key=apikey
```

{% endtab %}

{% tab title="JSON Response" %}

```php
OK:
{
    "status": "ok"
}

ERROR:
{
    "status": "error",
    "error": "Company has registered agents" 
}
```

{% endtab %}
{% endtabs %}


# Create Registered Agent

Create a new registered agent address for an existing company

## GET or POST Request

{% hint style="info" %}
<https://v1.api19.com/ra/registered\\_agent/create>
{% endhint %}

Create a new registered agent and get an address for your company

<table data-header-hidden><thead><tr><th width="197.727294921875"></th><th width="137.8182373046875"></th><th></th></tr></thead><tbody><tr><td>Argument</td><td>Required</td><td>Type</td></tr><tr><td>company_id</td><td>yes</td><td>company_id from list companies</td></tr><tr><td>jurisdictions</td><td>yes</td><td><p>JSON Array:</p><p>["Colorado", "Nebraska"]<br>OR</p><p>PLAIN TEXT:<br>Colorado</p></td></tr><tr><td>auto_renew</td><td>yes</td><td>yes or no</td></tr><tr><td>key</td><td>yes</td><td>your API key</td></tr></tbody></table>

{% tabs %}
{% tab title="Curl Post" %}

```php
curl https://v1.api19.com/ra/registered_agent/create \
 -d 'company_id=j203h-hj32fh-32hf923hf' \
 -d 'jurisdictions=["Colorado","Nebraska"]' \
 -d 'auto_renew=yes' \
 -d 'key=api_token'
```

{% endtab %}

{% tab title="JSON Response" %}

```json
OK:
{
  "status": "ok",
  "data": [
    {
      "id": "ad088553-j28q-j1v5-969b-fdcfcf3edea2",
      "type": "registered-agent",
      "status": "active",
      "company_id": "a7c234ff-mmj2-k1j4-aef4-dbd1e3a6b27a",
      "created_at": "2025-05-12T06:56:09.000+00:00",
      "updated_at": "2025-05-12T06:56:09.000+00:00",
      "jurisdiction": "New York",
      "jurisdiction_id": "6267cc34-c663-45ea-886b-9f38fab870d4",
      "company": "moo communications llc",
      "registered_agent": {
        "name": "Registered Agents Inc.",
        "address": {
          "line1": "418 Broadway",
          "line2": "STE R",
          "state_province_region": "NY",
          "city": "Albany",
          "zip_postal_code": "12207"
        }
      },
      "service_info": []
    },
    {
      "id": "f3d4jjh2-2j38-4168-af04-849kk111800",
      "type": "registered-agent",
      "status": "active",
      "company_id": "a7c2jjhh-ea7c-4b24-aef4-db1j3na6b27a",
      "created_at": "2025-05-12T06:56:09.000+00:00",
      "updated_at": "2025-05-12T06:56:09.000+00:00",
      "jurisdiction": "California",
      "jurisdiction_id": "072dccf7-678d-466f-b072-fc2876c6b79c",
      "company": "moo communicaitons llc",
      "registered_agent": {
        "name": "Registered Agents Inc",
        "address": {
          "line1": "1401 21st ST",
          "line2": "STE R",
          "state_province_region": "CA",
          "city": "Sacramento",
          "zip_postal_code": "95811"
        }
      },
      "service_info": []
    }
  ]
}

ERROR:
{
    "status": "error",
    "error": "Company already exists"
}

```

{% endtab %}

{% tab title="Possible Errors" %}

```hack
Jurisdictions must be selected
Tools connectivity issue
Invalid jurisdiction: 
Invalid auto renew value
No company id provided
Cannot locate company
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="States" %}
Supported States

array:

```php
["Alabama", "Alaska", "Arizona", "Arkansas", "California", "Colorado", "Connecticut", "Delaware", "District of Columbia", "Florida", "Georgia", "Hawaii", "Idaho", "Illinois", "Indiana", "Iowa", "Kansas", "Kentucky", "Louisiana", "Maine", "Maryland", "Massachusetts", "Michigan", "Minnesota", "Mississippi", "Missouri", "Montana", "Nebraska", "Nevada", "New Hampshire", "New Jersey", "New Mexico", "New York", "North Carolina", "North Dakota", "Ohio", "Oklahoma", "Oregon", "Pennsylvania", "Rhode Island", "South Carolina", "South Dakota", "Tennessee", "Texas", "Utah", "Vermont", "Virginia", "Washington", "West Virginia", "Wisconsin", "Wyoming", "American Samoa", "Federal", "Guam", "Northern Mariana Islands", "U.S. Virgin Islands", "Puerto Rico"];
```

{% endtab %}
{% endtabs %}


# Modify Registered Agent

Request cancelation or change on a specific registered agent

## GET or POST Request

{% hint style="info" %}
<https://v1.api19.com/ra/registered\\_agent/modify>
{% endhint %}

Delete a specific company

| Argument    | Required | Type                                                      |
| ----------- | -------- | --------------------------------------------------------- |
| reg\_uu\_id | yes      | <p>registered agent id from<br>List Registered Agents</p> |
| status      | yes      | <p>active<br>OR<br>canceling</p>                          |
| auto\_renew | yes      | <p>yes<br>OR<br>no</p>                                    |
| key         | yes      | your api key                                              |

{% tabs %}
{% tab title="Curl Post" %}

```php
curl https://v1.api19.com/ra/registered_agent/modify \
 -d 'reg_uu_id=h329fh23r' \
 -d 'status=active' \
 -d 'auto_renew' \
 -d 'key=api_token'
```

{% endtab %}

{% tab title="JSON Response" %}

```php
OK:
{
    "status": "ok"
}

ERROR:
{
    "status": "error",
    "error": "Cannot locate registered agent" 
}
```

{% endtab %}

{% tab title="Errors" %}

```hack
No registered agent id provided
Tools connectivity issue
Cannot locate registered agent
Registered agent is canceling, please renew to continue or leave to cancel automatically
Invalid status value
Invalid auto renew value
Error updating registered agent
```

{% endtab %}
{% endtabs %}


# List Voicemail Accounts

List all of the numbers on your account

## GET or POST Request

{% hint style="info" %}
<https://v1.api19.com/voicemail/inbox/list>
{% endhint %}

Get a list of all of your numbers on your account

{% tabs %}
{% tab title="Curl Post" %}

```php
curl https://v1.api19.com/voicemail/inbox/list \
 -d 'key=api_token'
```

{% endtab %}

{% tab title="Curl Get" %}

```
curl https://v1.api19.com/voicemail/inbox/list?key=apikey
```

{% endtab %}

{% tab title="JSON Response" %}

```json
{
  "status": "ok",
  "data": [
    {
      "id": "15658",
      "box_id": "33222",
      "user_id": "3030",
      "name": "test",
      "password": "3322",
      "emails": "[\"help@api19.com\"]",
      "texts": "",
      "create_dt": "2025-01-03 03:19:01"
    },
    {
      "id": "15941",
      "box_id": "3023502",
      "user_id": "3030",
      "name": "chris",
      "password": "9933",
      "emails": "[\"support@api19.com\",\"help@api19.com\"]",
      "texts": "",
      "create_dt": "2025-05-29 17:00:41"
    }
  ]
}

```

{% endtab %}
{% endtabs %}


# List all Voicemails

List all of the voicemails on a specific mailbox

## GET or POST Request

{% hint style="info" %}
<https://v1.api19.com/voicemail/vm/list>
{% endhint %}

Get a list of all of your numbers on your account

## HTTP Post Variables Supported

<table data-header-hidden><thead><tr><th width="123.9090576171875"></th><th width="108.54547119140625"></th><th></th></tr></thead><tbody><tr><td>Argument</td><td>Required</td><td>Type</td></tr><tr><td>mbox</td><td>yes</td><td>2-12 digits</td></tr><tr><td>key</td><td>yes</td><td>api key</td></tr></tbody></table>

{% tabs %}
{% tab title="Curl Post" %}

```php
curl https://v1.api19.com/voicemail/inbox/list \
 -d 'key=api_token' \
 -d 'mbox=1111'
```

{% endtab %}

{% tab title="Curl Get" %}

```
curl https://v1.api19.com/voicemail/vm/list?key=apikey&mbox=1111
```

{% endtab %}

{% tab title="JSON Response" %}

```json
{
  "status": "ok",
  "data": [
    {
      "did": "3038882222",
      "time": "Mon Mar 10 10:10:50 AM MDT 2025",
      "duration": "16",
      "callerid": "3035551212",
      "msgid": "msg0001"
    }
  ]
}

```

{% endtab %}
{% endtabs %}


# Create Voicemail Box

Create a voicemail box

## GET or POST Request

{% hint style="info" %}
<https://v1.api19.com/voicemail/inbox/create>
{% endhint %}

Create a new voicemail box to route numbers to

## HTTP Post Variables Supported

<table data-header-hidden><thead><tr><th width="123.9090576171875"></th><th width="108.54547119140625"></th><th></th></tr></thead><tbody><tr><td>Argument</td><td>Required</td><td>Type</td></tr><tr><td>box_id</td><td>yes</td><td>2-12 digits</td></tr><tr><td>name</td><td>yes</td><td>2-100 characters</td></tr><tr><td>password</td><td>yes</td><td>4 digits</td></tr><tr><td>emails</td><td>yes</td><td>emails separated by a comma</td></tr><tr><td>key</td><td>yes</td><td>api key</td></tr></tbody></table>

{% tabs %}
{% tab title="Curl Post" %}

```php
curl https://v1.api19.com/voicemail/inbox/create \
 -d 'key=api_token' \
 -d 'box_id=2233' \
 -d 'name=my+box' \
 -d 'password=8833' \
 -d 'emails=me@example.com,you@example.com'
```

{% endtab %}

{% tab title="Curl Get" %}

```
curl "https://v1.api19.com/voicemail/inbox/create?key=api_token&box_id=2233&name=my+box&password=8833&emails=me@example.com,you@example.com"
```

{% endtab %}

{% tab title="JSON Response" %}

```json
{"status":"ok","message":"ok"}
OR
{"status":"error","error":"Password is not 4 characters"}
OR
{"status":"error","error":"Box id cannot start with 0"}
OR
{"status":"error","error":"Box id is not 2-12 digits"}
OR
{"status":"error","error":"Invalid Email: moo@moo"}
OR
{"status":"error","error":"box id exists, try another"}



```

{% endtab %}
{% endtabs %}


# Download a Voicemail

Download a voicemail wav file

## GET or POST Request

{% hint style="info" %}
<https://v1.api19.com/voicemail/vm/get>
{% endhint %}

Download a specific voicemail box and voicemail id wav file

## HTTP Post Variables Supported

<table data-header-hidden><thead><tr><th width="123.9090576171875"></th><th width="108.54547119140625"></th><th></th></tr></thead><tbody><tr><td>Argument</td><td>Required</td><td>Type</td></tr><tr><td>mbox</td><td>yes</td><td>2-12 digits</td></tr><tr><td>msgid</td><td>yes</td><td>2-100 characters</td></tr><tr><td>key</td><td>yes</td><td>api key</td></tr></tbody></table>

{% tabs %}
{% tab title="Curl Post" %}

```php
curl https://v1.api19.com/voicemail/vm/get \
 -d 'key=api_token' \
 -d 'mbox=2233' \
 -d 'msgid=msg0001'
```

{% endtab %}

{% tab title="Curl Get" %}

<pre><code><strong>curl "https://v1.api19.com/voicemail/vm/get?key=api_token&#x26;mbox=2233&#x26;msgid=msg0001"
</strong></code></pre>

{% endtab %}

{% tab title="JSON Response" %}

```json
{"status":"ok","data":"base64encoded wav file"}
OR
{"status":"error","error":"no data found"}
```

{% endtab %}
{% endtabs %}


# Remove Voicemail

Remove a specific voicemail (wav file)

## GET or POST Request

{% hint style="info" %}
<https://v1.api19.com/voicemail/vm/remove>
{% endhint %}

Remove a voicemail from a mailbox (delete wav file)

## HTTP Post Variables Supported

<table data-header-hidden><thead><tr><th width="123.9090576171875"></th><th width="108.54547119140625"></th><th></th></tr></thead><tbody><tr><td>Argument</td><td>Required</td><td>Type</td></tr><tr><td>mbox</td><td>yes</td><td>2-12 digits</td></tr><tr><td>msgid</td><td>yes</td><td>2-100 characters</td></tr><tr><td>key</td><td>yes</td><td>api key</td></tr></tbody></table>

{% tabs %}
{% tab title="Curl Post" %}

```php
curl https://v1.api19.com/voicemail/vm/remove \
 -d 'key=api_token' \
 -d 'mbox=2233' \
 -d 'msgid=msg0001'
```

{% endtab %}

{% tab title="Curl Get" %}

<pre><code><strong>curl "https://v1.api19.com/voicemail/vm/remove?key=api_token&#x26;mbox=2233&#x26;msgid=msg0001"
</strong></code></pre>

{% endtab %}

{% tab title="JSON Response" %}

```json
{"status":"ok","data":"base64encoded wav file"}
OR
{"status":"error","error":"no data found"}
```

{% endtab %}
{% endtabs %}


# Get Greeting

Download a greeting

## GET or POST Request

{% hint style="info" %}
<https://v1.api19.com/voicemail/greeting/get>
{% endhint %}

Download a greeting from a voicemail box

## HTTP Post Variables Supported

<table data-header-hidden><thead><tr><th width="123.9090576171875"></th><th width="108.54547119140625"></th><th></th></tr></thead><tbody><tr><td>Argument</td><td>Required</td><td>Type</td></tr><tr><td>box_id</td><td>yes</td><td>2-12 digits</td></tr><tr><td>key</td><td>yes</td><td>api key</td></tr></tbody></table>

{% tabs %}
{% tab title="Curl Post" %}

<pre class="language-php"><code class="lang-php"><strong>curl https://v1.api19.com/voicemail/greeting/get \
</strong> -d 'key=api_token' \
 -d 'box_id=2233'
</code></pre>

{% endtab %}

{% tab title="Curl Get" %}

```
curl "https://v1.api19.com/voicemail/greeting/get?key=api_token&box_id=2233"
```

{% endtab %}

{% tab title="JSON Response" %}

```json
{"status":"ok","data":"base64encoded wav file"}
OR
{"status":"error","error":"file not found"}
```

{% endtab %}
{% endtabs %}


# Set Greeting

Set the greeting of a voicemail box

## GET or POST Request

{% hint style="info" %}
<https://v1.api19.com/voicemail/greeting/set>
{% endhint %}

Upload a file or make AI make you a greeting

## HTTP Post Variables Supported

<table data-header-hidden><thead><tr><th width="123.9090576171875"></th><th width="108.54547119140625"></th><th></th></tr></thead><tbody><tr><td>Argument</td><td>Required</td><td>Type</td></tr><tr><td>box_id</td><td>yes</td><td>2-12 digits</td></tr><tr><td>type</td><td>yes</td><td>upload OR generate</td></tr><tr><td>key</td><td>yes</td><td>your api key</td></tr><tr><td><strong>For Upload</strong></td><td><strong>Required</strong></td><td><strong>For type=upload</strong></td></tr><tr><td>wav</td><td>yes</td><td>base64 encoded wav file</td></tr><tr><td>extension</td><td>yes</td><td>wav or mp3</td></tr><tr><td><strong>For Generate</strong></td><td><strong>Required</strong></td><td><strong>For type=generate</strong></td></tr><tr><td>text</td><td>yes</td><td>the text to say</td></tr><tr><td>voice</td><td>yes</td><td>the voice you want to say it<br>choices:<br>alloy, echo, fable, onyx, nova, shimmer</td></tr></tbody></table>

{% tabs %}
{% tab title="Curl Post" %}

<pre class="language-php"><code class="lang-php"><strong>curl https://v1.api19.com/voicemail/greeting/get \
</strong> -d 'key=api_token' \
 -d 'box_id=2233' \
 -d 'type=generate' \
 -d 'text=hey+thanks+for+calling+leave+a+message' \
 -d 'voice=alloy'
  
OR

curl https://v1.api19.com/voicemail/greeting/get \
 -d 'key=api_token' \
 -d 'box_id=2233' \
 -d 'type=upload' \
 -d 'wav=[base64encoded wav file]' \
 -d 'extension=wav'
</code></pre>

{% endtab %}

{% tab title="JSON Response" %}

```json
{"status":"ok"}
OR
{"status":"error","error":"invalid type"}
```

{% endtab %}
{% endtabs %}


# Get E911

Get 911 information

## GET or POST Request

{% hint style="info" %}
<https://v1.api19.com/e911/get>
{% endhint %}

Get the currently set 911 information for a number

## HTTP Post Variables Supported

<table data-header-hidden><thead><tr><th width="123.9090576171875"></th><th width="108.54547119140625"></th><th></th></tr></thead><tbody><tr><td>Argument</td><td>Required</td><td>Type</td></tr><tr><td>did</td><td>yes</td><td>10 digit number</td></tr><tr><td>key</td><td>yes</td><td>api key</td></tr></tbody></table>

{% tabs %}
{% tab title="Curl Post" %}

<pre class="language-php"><code class="lang-php"><strong>curl https://v1.api19.com/e911/get \
</strong> -d 'key=api_token' \
 -d 'did=5555555555'
</code></pre>

{% endtab %}

{% tab title="Curl Get" %}

```
curl "https://v1.api19.com/e911/get?key=api_token&did=5555555555"
```

{% endtab %}

{% tab title="JSON Response" %}

```json
{
  "status": "ok",
  "data": {
    "id": "1",
    "user_id": "123",
    "did": "5555555555",
    "name": null,
    "address1": "123 Some Street",
    "address2": "",
    "city": "Englewood",
    "state": "CO",
    "zip": "80112",
    "carrier": null,
    "create_dt": "2025-07-25 16:33:06"
  }
}
```

{% endtab %}
{% endtabs %}


# Set E911

Set 911 information

## GET or POST Request

{% hint style="info" %}
<https://v1.api19.com/e911/set>
{% endhint %}

Set 911 information for a number

## HTTP Post Variables Supported

<table data-header-hidden><thead><tr><th width="123.9090576171875"></th><th width="108.54547119140625"></th><th></th></tr></thead><tbody><tr><td>Argument</td><td>Required</td><td>Type</td></tr><tr><td>did</td><td>yes</td><td>10 digit number</td></tr><tr><td>key</td><td>yes</td><td>api key</td></tr><tr><td>address1</td><td>yes</td><td>string</td></tr><tr><td>address2</td><td>no</td><td>string</td></tr><tr><td>city</td><td>yes</td><td>string</td></tr><tr><td>state</td><td>yes</td><td>2 character state code</td></tr><tr><td>zip</td><td>yes</td><td>string</td></tr></tbody></table>

{% tabs %}
{% tab title="Curl Post" %}

<pre class="language-php"><code class="lang-php"><strong>curl https://v1.api19.com/e911/get \
</strong> -d 'key=api_token' \
 -d 'did=5555555555' \
 -d 'address1=123 Some Street' \
 -d 'city=Denver' \
 -d 'state=CO' \
 -d 'zip=55555'
</code></pre>

{% endtab %}

{% tab title="JSON Response" %}

```json
{
  "status":"ok",
  "data":"E911 updated"
}
```

{% endtab %}
{% endtabs %}


# Delete E911

Delete 911 information

## GET or POST Request

{% hint style="info" %}
<https://v1.api19.com/e911/delete>
{% endhint %}

Delete the currently set 911 information for a number

## HTTP Post Variables Supported

<table data-header-hidden><thead><tr><th width="123.9090576171875"></th><th width="108.54547119140625"></th><th></th></tr></thead><tbody><tr><td>Argument</td><td>Required</td><td>Type</td></tr><tr><td>did</td><td>yes</td><td>10 digit number</td></tr><tr><td>key</td><td>yes</td><td>api key</td></tr></tbody></table>

{% tabs %}
{% tab title="Curl Post" %}

<pre class="language-php"><code class="lang-php"><strong>curl https://v1.api19.com/e911/delete \
</strong> -d 'key=api_token' \
 -d 'did=5555555555'
</code></pre>

{% endtab %}

{% tab title="Curl Get" %}

```
curl "https://v1.api19.com/e911/delete?key=api_token&did=5555555555"
```

{% endtab %}

{% tab title="JSON Response" %}

```json
{
  "status":"ok",
  "data":"E911 removed"
}
```

{% endtab %}
{% endtabs %}


# Create Customer Account

Create a Customer or Submaster Account

## Account Types

Customer accounts cannot create their own sub users or white labels. They are specifically for customers.

Submasters can create whitelabels, create pricing structures and create complete customer accounts. These are typically used for resellers.

## GET or POST Request

{% hint style="info" %}
<https://v1.api19.com/account/create/customer>
{% endhint %}

Create a new Customer account using /account/create/customer

## GET or POST Request

{% hint style="info" %}
<https://v1.api19.com/account/create/submaster>
{% endhint %}

Create a new Submaster account using /account/create/submaster

## HTTP Post Variables Supported

<table data-header-hidden><thead><tr><th width="149.3636474609375"></th><th width="108.54547119140625"></th><th></th></tr></thead><tbody><tr><td>Argument</td><td>Required</td><td>Type</td></tr><tr><td>login</td><td>yes</td><td>username (a-Z, 1-9)</td></tr><tr><td>email</td><td>yes</td><td>email address</td></tr><tr><td>name</td><td>yes</td><td>customer name</td></tr><tr><td>company</td><td>yes</td><td>company name</td></tr><tr><td>password</td><td>yes</td><td>password</td></tr><tr><td>rate_sheet</td><td>yes</td><td>rate sheet ID #</td></tr><tr><td>whitelabel</td><td>no</td><td>whitelabel ID #</td></tr><tr><td>key</td><td>yes</td><td>your API key</td></tr></tbody></table>

{% tabs %}
{% tab title="Curl Post" %}

```php
curl https://v1.api19.com/account/create/customer \
 -d 'key=api_token' \
 -d 'login=login_name' \
 -d 'name=customer_name' \
 -d 'password=gh29gh3g34rg3' \
 -d 'rate_sheet=3' \
 -d 'whitelabel=3' \
 -d 'email=me@example.com' \
 -d 'company=new+company'
```

{% endtab %}

{% tab title="JSON Response" %}

```json
{"status":"ok", "user_id":330022}
OR
{"status":"error","error":"test_login is already taken"}
OR
{"status":"error","error":"Login tes is not 4 characters long"}
OR
{"status":"error","error":"Account password contains characters not allowed: x"}
```

{% endtab %}
{% endtabs %}

## Get Whitelabel and Rate ID's

{% hint style="info" %}
<https://v1.api19.com/account/list/options>
{% endhint %}

The /account/list/options command will return a json object with your whitelabel and rates ID numbers. You can also get them from the user portal. Prices are your ratesheets.

```
{
  "status": "ok",
  "whitelabels": [
    {
      "id": "282",
      "name": "my portal",
      "url": "myportal.net"
    }
  ],
  "prices": [
    {
      "id": "30002",
      "user_id": "300",
      "old_user_id": "0",
      "description": "Default",
      "outbound_usa": "0.015",
      "outbound_usa_callfwd": "0.015",
      "outbound_intl": "0.01",
      "outbound_intl_markup": "1",
      "inbound_usa": "0.0075",
      "inbound_canada": "0.005",
      "inbound_tollfree": "0.015",
      "inbound_intl": "0.005",
      "inbound_offnet": "0.001",
      "inbound_channels_mrc": "10",
      "outbound_usa_sms": "0.00375",
      "inbound_usa_sms": "0.00375",
      "inbound_tf_sms": "0.005",
      "outbound_tf_sms": "0.005",
      "inbound_tf_mms": "0.01",
      "outbound_tf_mms": "0.01",
      "outbound_usa_mms": "0.01",
      "inbound_usa_mms": "0",
      "inbound_shortcode_mms": "0",
      "inbound_shortcode_sms": "0",
      "outbound_shortcode_mms": "0.01",
      "outbound_shortcode_sms": "0.005",
      "e911_usa": "1.5",
      "outbound_usa_fax": "0.045",
      "inbound_usa_fax": "0.045",
      "inbound_tollfree_fax": "0.03",
      "local_number_mrc": "1.5",
      "local_number_nrc": "1.5",
      "canada_number_mrc": "1",
      "canada_number_nrc": "1",
      "tollfree_number_mrc": "1",
      "tollfree_number_nrc": "1",
      "offnet_number_mrc": "0.01",
      "offnet_number_nrc": "0",
      "offnet_sms_mrc": "0.15",
      "offnet_sms_nrc": "0",
      "onnet_sms_mrc": "0.05",
      "lnp_local_nrc": "0",
      "lnp_tollfree_nrc": "0",
      "shortcode_mrc": "1050",
      "shortcode_random_mrc": "500",
      "shortcode_premium_mrc": "600",
      "shortcode_imported_mrc": "0",
      "shortcode_vanity_mrc": "1000",
      "shortcode_nrc": "2250",
      "fax_local_number_mrc": "3",
      "fax_local_number_nrc": "3",
      "fax_tollfree_number_mrc": "3",
      "fax_tollfree_number_nrc": "3",
      "cnam_lookups": "0.0075",
      "e911_mrc": "1",
      "e911_nrc": "1",
      "e911_ecrc": "90",
      "fax_price_perpage": "0",
      "fax_free_pages": "0",
      "max_usa_cost": "0.04",
      "max_intl_cost": "0.3",
      "cloudsoftphone_mrc": "0.3",
      "allow_termination": "yes",
      "minimum_did_hold": "0",
      "tax_rate": "0",
      "campaign_registry_markup": "0",
      "faxback_device_mrc": "1",
      "faxback_device_refurb_nrc": "49",
      "faxback_device_new_nrc": "139",
      "sms_daily_limit": "10000",
      "lookup_cnam": "0.005",
      "lookup_number": "0.005",
      "lookup_daily_limit": "1000",
      "voicebots": "0.03",
      "registered_agent": "45"
    }
  ]
}
```


# Disable Customer Account

Disable or enable a specific user\_id

## GET or POST Request

{% hint style="info" %}
<https://v1.api19.com/account/customer/change\\_status>
{% endhint %}

Disable or enable a specific customer

## HTTP Post Variables Supported

<table data-header-hidden><thead><tr><th width="123.9090576171875"></th><th width="108.54547119140625"></th><th></th></tr></thead><tbody><tr><td>Argument</td><td>Required</td><td>Type</td></tr><tr><td>user_id</td><td>yes</td><td>5 digits</td></tr><tr><td>status</td><td>yes</td><td>active or inactive</td></tr><tr><td>key</td><td>yes</td><td>api key</td></tr></tbody></table>

{% tabs %}
{% tab title="Curl Post" %}

```php
curl https://v1.api19.com/account/customer/change_status \
 -d 'key=api_token' \
 -d 'user_id=1111' \
 -d 'status=active'
```

{% endtab %}

{% tab title="Curl Get" %}

```
curl https://v1.api19.com/account/customer/change_status?key=apikey&user_id=1111&status=active
```

{% endtab %}

{% tab title="JSON Response" %}

```json
{"status": "ok"}

OR

{"status": "Missing user_id"}

OR

{"status": "You do not own user_id"}
```

{% endtab %}
{% endtabs %}


# Get Billing Data

List all billing data for a user id

## GET or POST Request

{% hint style="info" %}
<https://v1.api19.com/account/billing/data>
{% endhint %}

Get a JSON object of all billing data for a user id

## HTTP Post Variables Supported

<table data-header-hidden><thead><tr><th width="123.9090576171875"></th><th width="108.54547119140625"></th><th></th></tr></thead><tbody><tr><td>Argument</td><td>Required</td><td>Type</td></tr><tr><td>user_id</td><td>yes</td><td>5 digit user_id</td></tr><tr><td>start_date</td><td>yes</td><td>2025-05-03</td></tr><tr><td>end_date</td><td>yes</td><td>2025-05-05</td></tr><tr><td>key</td><td>yes</td><td>api key</td></tr></tbody></table>

{% tabs %}
{% tab title="Curl Post" %}

```php
curl https://v1.api19.com/account/billing/data \
 -d 'key=api_token' \
 -d 'user_id=20000' \
 -d 'start_date=2025-05-03' \
 -d 'end_date=2025-05-04'
```

{% endtab %}

{% tab title="JSON Response" %}

```json
{
  "status": "ok",
  "call_data": [
    {
      "call_type": "did_usa",
      "minutes": "7.6000000",
      "cost": "0.0380000"
    },
    {
      "call_type": "usa_term",
      "minutes": "0.3000000",
      "cost": "0.0030000"
    }
  ],
  "msg_data": [
    {
      "msg_type": "sms",
      "direction": "in",
      "service_type": "longcode",
      "count": "22",
      "cost": "0.0550000"
    },
    {
      "msg_type": "sms",
      "direction": "in",
      "service_type": "tollfree",
      "count": "3",
      "cost": "0.0075000"
    }
  ],
  "service_data": [
    {
      "type": "local_number",
      "model_type": "mrc",
      "count": "101",
      "amount": "-101.000000"
    },
    {
      "type": "local_number",
      "model_type": "nrc",
      "count": "5",
      "amount": "-5.000000"
    },
    {
      "type": "tollfree_number",
      "model_type": "mrc",
      "count": "3",
      "amount": "-3.000000"
    },
    {
      "type": "registered_agent",
      "model_type": "one-time",
      "count": "7",
      "amount": "-315.000000"
    }
  ]
}
```

{% endtab %}
{% endtabs %}


# List Customer Accounts

List all of your customer accounts

## GET or POST Request

{% hint style="info" %}
<https://v1.api19.com/account/list/customers>
{% endhint %}

Get a list of all of your sub accounts and types

## HTTP Post Variables Supported

<table data-header-hidden><thead><tr><th width="123.9090576171875"></th><th width="108.54547119140625"></th><th></th></tr></thead><tbody><tr><td>Argument</td><td>Required</td><td>Type</td></tr><tr><td>key</td><td>yes</td><td>api key</td></tr><tr><td>user_id</td><td>no</td><td>int, the user_id of customer</td></tr></tbody></table>

{% tabs %}
{% tab title="Curl Post" %}

```php
curl https://v1.api19.com/account/list/customers \
 -d 'key=api_token' \
 -d 'user_id=3033333'
```

{% endtab %}

{% tab title="Curl Get" %}

```
curl https://v1.api19.com/account/list/customers?key=apikey&mbox=1111
```

{% endtab %}

{% tab title="JSON Response" %}

```json
{
  "status": "ok",
  "data": [
    {
      "user_id": "333222",
      "login": "test",
      "company": "test",
      "name": "test",
      "phone": "",
      "address": "",
      "city": "",
      "state": "",
      "zip": "",
      "country": "",
      "email": "test",
      "status": "active",
      "rates": "302730",
      "subdomain": "myuid.voicelogin.net",
      "billing_terms": "postpaid",
      "billing_creditline": "0",
      "sms_daily_limit": "10000",
      "sms_incoming_url": "none",
      "sms_delivery_by": "post",
      "sms_e164": "no",
      "usf_exempt": "no"
    }
  ]

```

{% endtab %}
{% endtabs %}




---

[Next Page](/llms-full.txt/1)

