3CX Call Control API Endpoint Specification

/callcontrol

Description: This endpoint retrieves state of the specific entity (DN), including information about the participants and devices.

Endpoint URL:

GET /callcontrol

HTTP Method:

GET

Authentication Required:

Yes

Request Parameters

  • No parameters required for this request.

Response

Success Response:

  • Status Code: 200 OK
  • Content Type: application/json

Response Body Example:

[

  {

    "dn": "string",

    "type": "string",

    "devices": [

      {

        "dn": "string",

        "device_id": "string",

        "user_agent": "string"

      }

    ],

    "participants": [

      {

    "id": 0,

    "status": "string",

    "dn": "string",

    "party_caller_name": "string",

    "party_dn": "string",

    "party_caller_id": "string",

    "party_did": "string",

    "device_id": "string",

    "party_dn_type": "string",

    "direct_control": true,

    "originated_by_dn": "string",

    "originated_by_type": "string",

    "referred_by_dn": "string",

    "referred_by_type": "string",

    "on_behalf_of_dn": "string",

    "on_behalf_of_type": "string",

    "callid": 0,

    "legid": 0

      }

    ]

  }

]

Error Responses:

  • 401 Unauthorized:
  • Content Type: application/json
  • The request requires valid user authentication.
  • 403 Forbidden:
  • Content Type: application/json
  • The server understood the request, but the user does not have the necessary permissions.

Notes

  • Ensure that the authentication token is provided in the header when accessing this endpoint.

/callcontrol/ws

Description: This endpoint provides a WebSocket connection.

Endpoint URL:

GET /callcontrol/ws

HTTP Method:

GET

Authentication Required:

Yes

Request Parameters

  • No parameters are required for this request.

Response

Success Response:

  • Status Code: 200 OK
  • Description: The request was successful, and the WebSocket connection is established.

Error Responses:

  • 401 Unauthorized:
  • The request requires valid user authentication.
  • This error occurs if the API key or authentication token is missing or incorrect.

Notes

  • Ensure that the authentication token is provided in the header when accessing this WebSocket endpoint.
  • WebSocket is useful for real-time communication, in Call Control Applications you probably need to get information about call state updates (eg. participant updated, dtmf string received, etc.) For these purposes the websocket notification channel is the best way to achieve this communication.

By leveraging WebSocket for call control, developers can build responsive and feature-rich applications that provide users with a seamless and up-to-date call management experience.

/callcontrol/{dnnumber}

Description: This endpoint retrieves all connections of the specific entity (DN) based on dnnumber. The response provides details about the devices and participants associated with the call.

Endpoint URL:

GET /callcontrol/{dnnumber}

HTTP Method:

GET

Authentication Required:

Yes

Path Parameters

Parameter Name

Type

Required

Description

dnnumber

String

Yes

The Direct Number (DN) identifier for the call

Response

Success Response:

  • Status Code: 200 OK
  • Content Type: application/json

Response Body Example:

{

  "dn": "string",

  "type": "string",

  "devices": [

    {

      "dn": "string",

      "device_id": "string",

      "user_agent": "string"

    }

  ],

  "participants": [

    {

  "id": 0,

  "status": "string",

  "dn": "string",

  "party_caller_name": "string",

  "party_dn": "string",

  "party_caller_id": "string",

  "party_did": "string",

  "device_id": "string",

  "party_dn_type": "string",

  "direct_control": true,

  "originated_by_dn": "string",

  "originated_by_type": "string",

  "referred_by_dn": "string",

  "referred_by_type": "string",

  "on_behalf_of_dn": "string",

  "on_behalf_of_type": "string",

  "callid": 0,

  "legid": 0   

    }

  ]

}

Error Responses:

  • 401 Unauthorized:
  • The request requires valid user authentication.
  • 403 Forbidden:
  • The server understands the request, but the client does not have the necessary permissions to access this resource.

Notes

  • Make sure to include the dnnumber in the path parameter to access the relevant call control information.
  • Authentication is required for accessing this endpoint.

/callcontrol/{dnnumber}/devices

Description: This endpoint retrieves information about the devices associated with the provided dnnumber. The response includes device details like the Direct Number (DN), device ID, and user agent.

Endpoint URL:

GET /callcontrol/{dnnumber}/devices

HTTP Method:

GET

Authentication Required:

Yes

Path Parameters

Parameter Name

Type

Required

Description

dnnumber

String

Yes

The Direct Number (DN) identifier for the call

Response

Success Response:

  • Status Code: 200 OK
  • Content Type: application/json

Response Body Example:

[

  {

    "dn": "string",

    "device_id": "string",

    "user_agent": "string"

  }

]

Error Responses:

  • 401 Unauthorized:
  • The request requires valid user authentication.
  • 403 Forbidden:
  • The server understands the request, but the client does not have the necessary permissions to access this resource.

Notes

  • The dnnumber must be included as a path parameter to retrieve the associated devices.
  • Authentication is required for accessing this endpoint.
  • The response includes detailed information about the devices related to the specified dnnumber.

/callcontrol/{dnnumber}/devices/{deviceid}

Description: This endpoint retrieves details about a specific device associated with the provided dnnumber and deviceid. The response includes the device's Direct Number (DN), device ID, and user agent.

Endpoint URL:

GET /callcontrol/{dnnumber}/devices/{deviceid}

HTTP Method:

GET

Authentication Required:

Yes

Path Parameters

Parameter Name

Type

Required

Description

dnnumber

String

Yes

The Direct Number (DN) identifier for the call

deviceid

String

Yes

The unique identifier for the device

Response

Success Response:

  • Status Code: 200 OK
  • Content Type: application/json

Response Body Example:

{

  "dn": "string",

  "device_id": "string",

  "user_agent": "string"

}

Error Responses:

  • 401 Unauthorized:
  • The request requires valid user authentication.
  • 403 Forbidden:
  • The server understands the request, but the client does not have the necessary permissions to access this resource.
  • 404 Not Found:
  • The requested resource could not be found.

Notes

  • The dnnumber and deviceid must be included as path parameters in the URL.
  • Authentication is required for accessing this endpoint.
  • The response includes detailed information about the specified device associated with the dnnumber.

API Endpoint: /callcontrol/{dnnumber}/participants

Description: This endpoint retrieves information about the participants associated with a specific dnnumber. The response includes details such as the participant’s status, Direct Number (DN), caller information, and call identifiers.

Endpoint URL:

GET /callcontrol/{dnnumber}/participants

HTTP Method:

GET

Authentication Required:

Yes

Path Parameters

Parameter Name

Type

Required

Description

dnnumber

String

Yes

The Direct Number (DN) identifier for the call

Response

Success Response:

  • Status Code: 200 OK
  • Content Type: application/json

Response Body Example:

[

  {

    "id": 0,

    "status": "string",

    "dn": "string",

    "party_caller_name": "string",

    "party_dn": "string",

    "party_caller_id": "string",

    "party_did": "string",

    "device_id": "string",

    "party_dn_type": "string",

    "direct_control": true,

    "originated_by_dn": "string",

    "originated_by_type": "string",

    "referred_by_dn": "string",

    "referred_by_type": "string",

    "on_behalf_of_dn": "string",

    "on_behalf_of_type": "string",

    "callid": 0,

    "legid": 0

  }

]

Error Responses:

  • 401 Unauthorized:
  • The request requires valid user authentication.
  • 403 Forbidden:
  • The server understands the request, but the client does not have the necessary permissions to access this resource.

Notes

  • The dnnumber must be provided as a path parameter to retrieve the associated participants.
  • Authentication is required for accessing this endpoint.
  • The response includes detailed information about the participants involved in the specified calls.

API Endpoint: /callcontrol/{dnnumber}/participants/{id}

Description: This endpoint retrieves information about a specific participant associated with a given dnnumber and id. The response includes details such as the participant’s status, Direct Number (DN), caller information, and call identifiers.

Endpoint URL:

GET /callcontrol/{dnnumber}/participants/{id}

HTTP Method:

GET

Authentication Required:

Yes

Path Parameters

Parameter Name

Type

Required

Description

dnnumber

String

Yes

The Direct Number (DN) identifier for the call

id

Integer(int32)

Yes

The unique identifier of the participant

Response

Success Response:

  • Status Code: 200 OK
  • Content Type: application/json

Response Body Example:

{

  "id": 0,

  "status": "string",

  "dn": "string",

  "party_caller_name": "string",

  "party_dn": "string",

  "party_caller_id": "string",

  "party_did": "string",

  "device_id": "string",

  "party_dn_type": "string",

  "direct_control": true,

  "originated_by_dn": "string",

  "originated_by_type": "string",

  "referred_by_dn": "string",

  "referred_by_type": "string",

  "on_behalf_of_dn": "string",

  "on_behalf_of_type": "string",

  "callid": 0,

  "legid": 0

}

Error Responses:

  • 401 Unauthorized:
  • The request requires valid user authentication.
  • 403 Forbidden:
  • The server understands the request, but the client does not have the necessary permissions to access this resource.
  • 404 Not Found:
  • The specified participant with the provided id could not be found.

Notes

  • Both the dnnumber and id must be provided as path parameters to retrieve the specific participant's information.
  • Authentication is required for accessing this endpoint.
  • The response includes detailed information about the specific participant involved in the specified call.

/callcontrol/{dnnumber}/makecall

Description: Initiates call from the DN entity. In case if the DN has only a single appearance (only one registered device) the call is initiated from that device (see below). Otherwise, legacy MakeCall service is engaged and call initiation state should be discovered using analysis of the DN participant state. This form exists for backward compatibility and is not recommended for use.

Application should be sure that it will be able to monitor call source DN and be able to detect which of the participants appeared on the DN corresponds to the request.

Endpoint URL:

POST /callcontrol/{dnnumber}/makecall

HTTP Method:

POST

Authentication Required:

Yes

Path Parameters

Parameter Name

Type

Required

Description

dnnumber

String

Yes

The Direct Number (DN) identifier for initiating the call

Request Body

Field

Type

Required

Description

destination

String

Yes

The destination number to call

timeout

Integer

Yes

Call timeout in seconds

attachedData1

String

No

Additional optional attached data 1

additionalProp1

String

No

Additional optional parameter 1

additionalProp2

String

No

Additional optional parameter 2

additionalProp3

String

No

Additional optional parameter 3

Request Body Example:

{

  "destination": "string",

  "timeout": 0,

  "attacheddata": {

    "additionalProp1": "string",

    "additionalProp2": "string",

    "additionalProp3": "string"

  }

}

Response

Success Responses:

  • 200 Accepted
  • Content Type: application/json
  • 202 Accepted
  • Content Type: application/json
  • Description: The request has been accepted for processing, but the processing has not been completed yet.

Response Body Example:

{

  "finalstatus": "string",

  "reason": "string",

  "result": {

    "id": 0,

    "status": "string",

    "dn": "string",

    "party_caller_name": "string",

    "party_dn": "string",

    "party_caller_id": "string",

    "party_did": "string",

    "device_id": "string",

    "party_dn_type": "string",

    "direct_control": true,

    "originated_by_dn": "string",

    "originated_by_type": "string",

    "referred_by_dn": "string",

    "referred_by_type": "string",

    "on_behalf_of_dn": "string",

    "on_behalf_of_type": "string",

    "callid": 0,

    "legid": 0

  },

  "reasontext": "string"

}

Error Responses:

  • 401 Unauthorized:
    The request requires valid user authentication.
  • 403 Forbidden:
    The server understands the request but refuses to authorize it.
  • 422 Unprocessable Content:
    The server understands the request but cannot process it.
  • 424 Failed Dependency:
    The request failed due to a failed dependency.

Notes

  • Ensure that the dnnumber is provided in the path parameter to initiate the call.
  • Authentication is required to use this endpoint.
  • The request body should include the destination number and other relevant details for making the call.

/callcontrol/{dnnumber}/devices/{deviceid}/makecall

Description: Initiates call from the specific device (emulated or using uacsta).This form of call initiation request guarantees that the call initiator will be specified in the response.

Endpoint URL:

POST /callcontrol/{dnnumber}/devices/{deviceid}/makecall

HTTP Method:

POST

Authentication Required:

Yes

Path Parameters

Parameter Name

Type

Required

Description

dnnumber

String

Yes

The Direct Number (DN) identifier for initiating the call

deviceid

String

Yes

The unique identifier for the device associated with the DN

Request Body

Field

Type

Required

Description

destination

String

Yes

The destination number to call

timeoutSec

Integer

Yes

Call timeout in seconds

attachedData1

Object

No

Additional optional attached data, which includes optional properties.

Request Body Example:

{

  "destination": "string",

  "timeout": 0,

  "attacheddata": {

    "additionalProp1": "string",

    "additionalProp2": "string",

    "additionalProp3": "string"

  }

}

Response

Success Responses:

  • 200 Accepted
  • Content Type: application/json
  • 202 Accepted
  • Content Type: application/json
  • Description: The request has been accepted for processing but is not yet completed.

Response Body Example:

{

  "finalstatus": "string",

  "reason": "string",

  "result": {

    "id": 0,

    "status": "string",

    "dn": "string",

    "party_caller_name": "string",

    "party_dn": "string",

    "party_caller_id": "string",

    "party_did": "string",

    "device_id": "string",

    "party_dn_type": "string",

    "direct_control": true,

    "originated_by_dn": "string",

    "originated_by_type": "string",

    "referred_by_dn": "string",

    "referred_by_type": "string",

    "on_behalf_of_dn": "string",

    "on_behalf_of_type": "string",

    "callid": 0,

    "legid": 0

  },

  "reasontext": "string"

}


Error Responses:

  • 401 Unauthorized:
    The request requires valid user authentication.
  • 403 Forbidden:
    The server understands the request but refuses to authorize it.
  • 422 Unprocessable Content:
    The server understands the request but cannot process it.
  • 424 Failed Dependency:
    The request failed due to a failed dependency.

Notes

  • Make sure to include both the dnnumber and deviceid in the path parameters to initiate the call.
  • Authentication is required to access this endpoint.
  • The request body should include the destination number and relevant details for making the call.

/callcontrol/{dnnumber}/participants/{id}/stream

Description: This endpoint retrieves a raw audio stream (PCM 16-bit 8000Hz mono) for a specific participant associated with a given dnnumber and id.

Endpoint URL:

GET /callcontrol/{dnnumber}/participants/{id}/stream

HTTP Method:

GET

Authentication Required:

Yes

Path Parameters

Parameter Name

Type

Required

Description

dnnumber

String

Yes

The Direct Number (DN) identifier for the participant

id

Integer (int32)

Yes

The unique identifier of the participant

Response

Error Responses:

  • 401 Unauthorized:
    The request requires valid user authentication.
  • 403 Forbidden:
    The server understands the request but refuses to authorize it.
  • 404 Not Found:
    The requested resource (the specific participant with the provided id) could not be found.
  • 424 Failed Dependency:
    The request failed due to a failed dependency.

Notes

  • Both the dnnumber and id must be provided as path parameters to retrieve the stream data for the specified participant.
  • Authentication is required for accessing this endpoint.

/callcontrol/{dnnumber}/participants/{id}/stream

Description: This endpoint initiates a stream for a specific participant associated with a given dnnumber and id. Application should post raw audio stream (PCM 16-bit 8000Hz mono) to the server. The content arrived on the server will be delivered to the party.

Endpoint URL:

POST /callcontrol/{dnnumber}/participants/{id}/stream

HTTP Method:

POST

Authentication Required:

Yes

Path Parameters

Parameter Name

Type

Required

Description

dnnumber

String

Yes

The Direct Number (DN) identifier for the participant

id

Integer (int32)

Yes

The unique identifier of the participant

Response

Success Response:

  • 200 OK
  • Description: The stream has been successfully initiated.

Error Responses:

  • 401 Unauthorized:
    The request requires valid user authentication.
  • 403 Forbidden:
    The server understands the request but refuses to authorize it.
  • 404 Not Found:
    The specified participant or resource could not be found.
  • 424 Failed Dependency:
    The request failed due to a failed dependency.

Notes

  • Authentication is required to access this endpoint.
  • Both the dnnumber and id must be provided as path parameters to initiate the stream for the specified participant.
  • Server uploads a party audio stream with 128kbps rate. (almost real time) External applications should also post the stream with an average 128kbps rate and should minimize jitter. Using streaming, the applications can engage any external services to implement voice interactions with the caller.

/callcontrol/{dnnumber}/participants/{id}/{action}

Description: This endpoint performs a specific action on a participant associated with a given dnnumber and id. The type of action is defined by the action parameter in the path.

Endpoint URL:

POST /callcontrol/{dnnumber}/participants/{id}/{action}

HTTP Method:

POST

Authentication Required:

Yes

Path Parameters

Parameter Name

Type

Required

Description

dnnumber

String

Yes

The Direct Number (DN) identifier for the participant

id

Integer (int32)

Yes

The unique identifier of the participant

action

String

Yes

The action to be performed on the participant

Request Body

Field

Type

Required

Description

reason

String

Yes

The reason for performing the action(removed)

Diversion reason: Only applicable to the following Action Types: divert”, “routeto”, “transferto”.


This field is required for the correct display of calls
 in call history reports.

It can also be used for internal application purposes to implement different scenarios based on the developer's needs.

Note: The "reason" field in the response body indicates the reason for the request failure and is not related to the diversion reason. You will never receive the diversion reason back in the response.

destination

String

Yes

The destination for the action

timeout

Integer

Yes

The timeout value for the action

attacheddata

Object

No

Additional optional attached data

Available Action Types

Action type (String)

Description

drop

No parameters. drop participation in the call

answer

No parameters. Applicable only to participants which are supporting direct_control (uacsta} OR RoutePoint participants. This method allows an external application to control call handling on RoutePoints or remotely control the specific extension device (which supports direct call control)

divert

Tries to replace the specified ringing participant with the new destination.

If the participant is already connected, the request will fail. The result is returned when a new destination is reached.

routeto

Can be used for the connected or ringing participant.

Adds alternative routes for the existing participant.

The participant continues own participation in a call as a ringing or connected until successful delivery to the new destination.

Alternatives will be canceled if the participant will (reject/drop) own participation in the call.

transferto

This request is applicable only for the connected (talking) participant.

The other party will be put on hold for the time of transfer attempt.

The participant will be replaced on success, or will be returned to the call if transfer fails.

The participant may leave the call (drop own participation) during transfer. In such cases, the failed destination will be replaced with a transferrer device and call delivery will continue.

attach_participant_data

Attaches data to the participant connection. The data will be observed by other PBX components.

attach_party_data

Attaches data to the other party connection. This method allows adding data to the caller connection. The data will be observable by other PBX components and services which are tracking call flows.

Applicable Reason Values

Value (string)

Description

None

No specific reason

NoAnswer

Diverted because the destination didn't answer.

PhoneBusy

Diverted because the destination is busy.

PhoneNotRegistered

Diverted because the phone is not registered.

ForwardAll

Diverted by default (divert all calls)

BasedOnCallerID

Diverted because caller ID of incoming call matches some custom data defined by application.

BasedOnDID

Diverted because the DID on an incoming call matches some specified in application DID rule.

OutOfOfficeHours

Diverted because of Out of Office hours

BreakTime

Diverted because of BreakTime

Holiday

Diverted because of Holiday

OfficeHours

Diverted because of Office Time

NoDestinations

Diverted because of No Valid Destination

Polling

You can use this reason to mark the destination for polling requests. It may be helpful when the application implements polling functionality.

CallbackRequested

You can use this reason to mark replaced participants as callback-required participants. It may be helpful when the application is implementing callback functionality.

Callback

You can use this reason to indicate that a callback endpoint has been replaced with a callback destination. It may be helpful when the application is implementing callback functionality.

Request Body Example:

{

  "reason": "string",

  "destination": "string",

  "timeout": 0,

  "attacheddata": {

    "additionalProp1": "string",

    "additionalProp2": "string",

    "additionalProp3": "string"

  }

}

Response

Success Responses:

  • 200 Accepted
  • Content Type: application/json
  • 202 Accepted
  • Content Type: application/json
  • Description: The request has been accepted for processing but has not been completed yet.

{

  "finalstatus": "string",

  "reason": "string",

  "result": {

    "id": 0,

    "status": "string",

    "dn": "string",

    "party_caller_name": "string",

    "party_dn": "string",

    "party_caller_id": "string",

    "party_did": "string",

    "device_id": "string",

    "party_dn_type": "string",

    "direct_control": true,

    "originated_by_dn": "string",

    "originated_by_type": "string",

    "referred_by_dn": "string",

    "referred_by_type": "string",

    "on_behalf_of_dn": "string",

    "on_behalf_of_type": "string",

    "callid": 0,

    "legid": 0

  },

  "reasontext": "string"

Error Responses:

  • 401 Unauthorized:
    The request requires valid user authentication.
  • 403 Forbidden:
    The server understands the request but refuses to authorize it.
  • 404 Not Found:
    The specified participant or resource could not be found.
  • 422 Unprocessable Content:
    The server understands the request but cannot process it.
  • 424 Failed Dependency:
    The request failed due to a failed dependency.

Notes

  • The dnnumber, id, and action must be provided as path parameters to perform the specified action on the participant.
  • Authentication is required to access this endpoint.

Last updated

This document was last updated 19 March 2025

https://www.3cx.com/docs/call-control-api-endpoints/