Skip to main content

Create Endpoint

This request creates an endpoint.

post /endpoints

Sample 1

A sample POST request to create a Conference endpoint:

curl -X POST \
'https://api.carrierx.com/core/v2/endpoints' \
-H 'Content-Type: application/json' \
--data-binary '{"name":"my_conf", "type":"conference"}' \
-H 'Authorization: Bearer 5ebc03d6-8b2b-44ad-bf65-72d4f1491dda'

Response 1

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

{
"addresses": [],
"attributes": {},
"auth_required": true,
"capacity": 0,
"cps_limit": null,
"endpoint_sid": "358d56f9-1482-4b3d-85a9-efd29afc6ff2",
"name": "my_conf",
"out_sip_password": null,
"out_sip_username": null,
"partner_sid": "ed437757-002d-4ecc-aa5a-efdf5e50dba0",
"properties": {
"account_sid": "6DcA986G-vcBel19O02iIbYUAawVidvB",
"api_url": "https://api.carrierx.com/conference/v1",
"container_sid": "null",
"login": "sample_conference_775",
"password": "YnAa9s8ixJKi"
},
"transformations": [],
"type": "conference",
"voip_token": null
}

Sample 2

The following request creates a Third-party endpoint:

curl -X POST \
'https://api.carrierx.com/core/v2/endpoints' \
-H 'Content-Type: application/json' \
--data-binary '{"name":"EP_Т_1","addresses": ["ip": "1.1.2.13", "port": "5060"], "type":"third_party"}' \
-H 'Authorization: Bearer 5ebc03d6-8b2b-44ad-bf65-72d4f1491dda'

Response 2

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

{
"addresses": [
{
"direction": "any",
"dst_port": 5060,
"ip": "1.1.2.13",
"location_sid": null,
"port": 5060,
"priority": 0,
"sip_password": null,
"sip_username": null,
"srtp": false,
"transport": "udp"
}
],
"attributes": {},
"auth_required": true,
"capacity": 0,
"cps_limit": null,
"endpoint_sid": "473d1623-c615-4b43-ab4f-01cd5491c56b",
"name": "my_third_party",
"out_sip_password": null,
"out_sip_username": null,
"partner_sid": "ed437757-002d-4ecc-aa5a-efdf5e50dba0",
"properties": {},
"transformations": [],
"type": "third_party",
"voip_token": "0cac0ffe-fed4-4ee3-8212-e50659e28088"
}

For the Mediator, Conference, Conference Playback, and FlexML endpoints, only the name and capacity values can be edited after the endpoint has been created. For the Voicemail endpoint, the properties attributes can be also modified.

Errors

Missing Required Scope

If you attempt to create or update an endpoint by setting the auth_required field without the necessary permissions, you will receive the following error:

{
"message": "object validation error",
"errors": [
{
"field": "auth_required",
"message": "partner does not have permissions to set this value",
"reference_sid": null
}
]
}

To resolve this error: Contact CarrierX support at support@carrierx.com to request the required permissions for managing the auth_required field.

Duplicate IP for auth_required=false

If you attempt to create an endpoint with auth_required=false using an IP address and port that is already used by another endpoint (system or partner) with auth_required=false, you will receive the following error:

{
"message": "conflict error",
"errors": [
{
"field": null,
"message": "duplicate ip for auth_required=false",
"reference_sid": null
}
]
}

To resolve this error:

  • Use a different IP address or port, or
  • Set auth_required=true (which allows multiple endpoints on the same IP)

Note: The auth_required field is writable only for partners with the appropriate scope. By default, this field is read-only. Contact CarrierX support to enable write access.

Required Scopes

To create an Endpoint object, the partner must have one of the following scopes enabled:

  • endpoints.manage
  • endpoints.create

Additional scope for auth_required: To set the auth_required field when creating or updating an endpoint, the partner must also have the endpoints.manage_auth_required scope. Without this scope:

  • The auth_required field is read-only
  • Any value submitted in the request will result in the "partner does not have permissions to set this value" error shown above

Contact CarrierX support at support@carrierx.com to request the endpoints.manage_auth_required scope.

Body Arguments

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

A required field to create an endpoint is type, for the third-party endpoint the required fields are ip and type. If no value for port is specified, the value for port will be assigned as 5060.

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