> ## Documentation Index
> Fetch the complete documentation index at: https://docs.invoca.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Destinations

## Manage destinations (aka Customer Phone Numbers)

Destinations are an alternate way of managing [RingPools](https://docs.invoca.com/en/latest/api_documentation/network_integration/ringpools/index.md).

[Learn more about RingPools here](https://docs.invoca.com/s/article/ringpool-management.md).

| Property | Type | Value |
| - | - | - |
| id | integer (read-only) | The internal Invoca id of the Destination. |
| country\_code | string | Country code of the phone number. |
| phone\_number | string | Phone number of the Destination. |
| primary\_url | string | Website or page URL on which the destination is applied. |
| requested\_destination\_name | string (read-only) | Alias for the destination. Auto-generated names. |
| advertiser\_campaign | | |
| id\_from\_network | string | The network object\_id for this Advertiser Campaign. Unique within network. Not required when auto-generation is enabled at network level. |
| name | string | Campaign name. |
| status | string | Current campaign state. |
| dynamic\_number\_pool | | |
| id | integer (read-only) | The internal Invoca id of the RingPool. |
| id\_from\_network | string (required) | Network specific id of the RingPool. Unique within network. Not required when auto-generation is enabled at network level. |
| name | string | Arbitrary string. Names the RingPool. |
| object\_url | string (read-only) | URL for reaching the RingPool in the UI. |
| lifetime\_seconds | integer | The guaranteed minimum time that the number will be allocated for this RingPool. |
| max\_pool\_size | integer | The maximum amount of phone numbers to be allotted at one time. |
| preferred | boolean | true or false. Selects this RingPool if the advertiser has multiple RingPools for the campaign and the web integration code does not specify which pool to use. |
| destination\_phone\_number | A phone number to be associated with the RingPool. | When using Destinations UI or the forward to destination IVR node, this number will be used. |
| fill\_immediately | boolean | When true, the ringpool will immediately be filled with phone numbers up to the max\_pool\_size, if numbers are available. When false, the pool will initially fill at 10% capacity to conserve phone number usage. The ringpool will increase phone numbers based on ringpool autoscaling settings and traffic volume. |

Endpoint:

`https://invoca.net/api/2022-08-01/<network_id>/customer_phone_numbers.json`

> [accordion] Get all Destinations
>
> Possible options that can be provided in the API request.
>
> <table><thead><tr><th>Property</th><th>Type</th><th>Value</th></tr></thead><tbody><tr><td>limit</td><td>integer (optional) (Default 100)</td><td>Number of objects to be returned in a single request. If not provided, first 100 objects will be returned.</td></tr><tr><td>start</td><td>integer (optional) (Default 0)</td><td>First `x` number of objects to skip in the response. If not provided, the response will start from the first available object.</td></tr><tr><td>query</td><td>string (optional)</td><td>Search string to search by phone number.If not provided, all objects will be returned given no other filters are included.</td></tr><tr><td>status</td><td>string (optional)</td><td>To filter results by a specific type.If not provided, all objects will be returned given no other filters are included.Possible values include:<ul><li>**ignored**: Fetches only destinations that were ignored.</li><li>**tracked**: Fetches only destinations that have a ringpool associated with them.</li><li>**discovered**: Fetches only destinations that were neither ignored nor have a ringpool associated with them.</li></ul></td></tr><tr><td>sort\_by</td><td>string (optional) (Default id)</td><td>Sort the result by a specific column.</td></tr><tr><td>sort\_dir</td><td>string (optional) (Default asc)</td><td>Sorting direction for the objects being returned. Possible values include `asc` and `desc`.</td></tr></tbody></table>
>
> Examples
>
> Read all Destinations as an array.
>
> Endpoint:
>
> `https://invoca.net/api/2022-08-01/<network_id>/customer_phone_numbers.json`
>
> Response Code: 200
>
> Response Body:
>
> ```json theme={null}
> {
>   "data": [
>     {
>       "id": "value",
>       "country_code": "1",
>       "phone_number": "202-555-0001",
>       "primary_url": "",
>       "requested_destination_name": "",
>       "acknowledged_at": null,
>       "created_at": "2023-10-19 03:34:42 -0700",
>       "updated_at": "2023-10-19 03:34:42 -0700",
>       "advertiser_campaign": {
>         "id_from_network": "83",
>         "name": "My test campaign 1 - New York",
>         "status": "Activated"
>       },
>       "dynamic_number_pool": {
>         "id_from_network": "13",
>         "name": "tag 1.83",
>         "pool_type": "Custom",
>         "destination_type": "Advertiser",
>         "lifetime_seconds": 300,
>         "max_pool_size": 2,
>         "preferred": false,
>         "is_first_preference": true,
>         "use_custom_data": true
>       },
>       "ignored_at": null,
>       "notified_at": null
>     },
>     {
>       "id": "value",
>       "country_code": "1",
>       "phone_number": "202-555-0002",
>       "primary_url": "",
>       "requested_destination_name": "",
>       "acknowledged_at": null,
>       "created_at": "2023-10-19 03:49:21 -0700",
>       "updated_at": "2023-10-19 03:54:56 -0700",
>       "advertiser_campaign": {
>         "id_from_network": "87",
>         "name": "Live campaign New Jersey",
>         "status": "Activated"
>       },
>       "dynamic_number_pool": {
>         "id_from_network": null,
>         "name": null,
>         "pool_type": null,
>         "destination_type": null,
>         "lifetime_seconds": null,
>         "max_pool_size": null,
>         "preferred": null,
>         "is_first_preference": null,
>         "use_custom_data": null
>       },
>       "ignored_at": null,
>       "notified_at": null
>     }
>   ],
>   "requestId": null,
>   "recordsTotal": 2
> }
> ```

> [accordion] Get a Destination
>
> #### Examples
>
> Read a Destination
>
> Endpoint:
>
> `https://invoca.net/api/2022-08-01/<network_id>/customer_phone_numbers/<customer_phone_number_id>.json`
>
> Response Code: 200
>
> Response Body:
>
> ```json theme={null}
> {
>   "id": "value",
>   "country_code": "1",
>   "phone_number": "202-555-0001",
>   "primary_url": "",
>   "requested_destination_name": "",
>   "acknowledged_at": null,
>   "created_at": "2023-10-19 03:49:21 -0700",
>   "updated_at": "2023-10-19 03:54:56 -0700",
>   "advertiser_campaign": {
>       "id_from_network": "87",
>       "name": "test-campaign Arizona",
>       "status": "Activated"
>   },
>   "dynamic_number_pool": {
>     "id_from_network": "13",
>     "name": "tag 12.83",
>     "pool_type": "Custom",
>     "destination_type": "Advertiser",
>     "lifetime_seconds": 300,
>     "max_pool_size": 2,
>     "preferred": false,
>     "is_first_preference": true,
>     "use_custom_data": true
>   },
>   "ignored_at": null,
>   "notified_at": null
> }
> ```

> [accordion] Delete a Destination
>
> #### Examples
>
> Delete a Destination
>
> Endpoint:
>
> `https://invoca.net/api/2022-08-01/<network_id>/customer_phone_numbers/<customer_phone_number_id>.json`
>
> Response Code: 200
>
> Response Body:
>
> ```json theme={null}
> {}
> ```

**NOTE: Creating & Deleting Destinations**\
Creating a Destination via this endpoint isn't possible. A Destination can be made alongside a RingPool that it'll be associated with via the RingPool endpoint ([**Documentation**](https://developers.invoca.net/en/latest/api_documentation/network_integration/ringpools/index.html)).

The Destination can be deleted via this endpoint, but if the associated RingPool is going to be deleted as well, you can save a request by utilizing the delete\_detected\_phone\_number parameter in the RingPool endpoint.


## Related topics

- [Numbers & Destinations Overview](https://docs.invoca.com/s/article/numbers-destinations-overview.md)
- [Destinations Created by the Bulk Destinations Management Tool Not Auto-Scaling](https://docs.invoca.com/s/article/destinations-bulk-tool-not-autoscaling.md)
- [Can Destinations Be Enabled at the Profile Level?](https://docs.invoca.com/s/article/destinations-profile-level.md)
- [Destination Management: Bulk Import and Editing](https://docs.invoca.com/s/article/destination-management-bulk-import-and-editing.md)
- [Manage Phone Numbers via Destinations](https://docs.invoca.com/s/article/manage-phone-numbers-destinations.md)
