Skip to main content

Create Prefix

This request creates a Prefix object.

post /phonenumber/prefixes

Sample

A sample POST request to create a prefix:

curl -X POST \
'https://api.carrierx.com/core/v2/phonenumber/prefixes' \
-H 'Content-Type: application/json' \
--data-binary '{"prefix":"51625"}' \
-H 'Authorization: Bearer 5ebc03d6-8b2b-44ad-bf65-72d4f1491dda'

Response

200 status code with a serialized copy of the Prefix object:

{
"attributes": {},
"callback_url": null,
"lrn_sid": null,
"name": "N/A",
"partner_sid": "e00430c3-a7d0-4666-ab5c-f7202448382f",
"prefix": "51625",
"prefix_sid": "cc367acb-94c8-418f-b247-85dce5806ef4",
"source_trunk_group_sid": null,
"string_key_1": null,
"string_key_2": null,
"transformations": [],
"trunk_group_sid": null
}

Required Scopes

To create a Prefix object, the partner must have one of the following scopes enabled:

  • phonenumber.manage
  • phonenumber.create

Body Arguments

JSON representation of the fields and values of the Prefix object to be created.

A required field to create a prefix is prefix.

Refer to this table to view all fields that appear in the prefix object.