3CX API Documentation and examples

GET Methods

Get WebAPI license information
https://{{3CXFQDN}}/webapi/{{AccessKey}}/
{
    "product": "3CX REST API",
    "version": "2.1.9",
    "release": "Webhooks",
    "licenseExpire": "02.05.2031 20:32:11",
    "clientLicensesNum": "50",
    "concurrentCalls": 16,
    "callRecords": true,
    "api": true,
    "quality": false
}
Get 3CX current number of calls
https://{{3CXFQDN}}/webapi/{{AccessKey}}/pbx.calls.get
{
    "result": 5
}
Get 3CX status
https://{{3CXFQDN}}/webapi/{{AccessKey}}/pbx.ac.get
{
    "count": 2,
    "AConnByCallID": [
        {
            "callID": 46874,
            "direction": "Internal",
            "did": "",
            "AConnList": [
                {
                    "dnNum": "1739",
                    "dnType": "extension",
                    "externalParty": "1674",
                    "status": "Connected"
                },
                {
                    "dnNum": "1674",
                    "dnType": "extension",
                    "externalParty": "1739",
                    "status": "Connected"
                }
            ]
        },
        {
            "callID": 46883,
            "direction": "Internal",
            "did": "",
            "AConnList": [
                {
                    "dnNum": "1283",
                    "dnType": "extension",
                    "externalParty": "1126",
                    "status": "Connected"
                },
                {
                    "dnNum": "1126",
                    "dnType": "extension",
                    "externalParty": "1283",
                    "status": "Connected"
                }
            ]
        }
    ]
}
Get an additional 3CX information
https://{{3CXFQDN}}/webapi/{{AccessKey}}/pbx.callsinfo.get
{
    "count": 2,
    "callsInfo": [
        {
            "callID": 46874,
            "state": "Talking",
            "startedAt": "2022-12-29T08:37:16Z",
            "answeredAt": "2022-12-29T08:37:23Z",
            "did": "",
            "owner": {
                "dnNum": "1739",
                "dnType": "extension",
                "externalParty": "1674",
                "status": "Connected"
            },
            "talkTo": [
                {
                    "dnNum": "1674",
                    "dnType": "extension",
                    "externalParty": "1739",
                    "status": "Connected"
                }
            ],
            "routingTo": []
        },
        {
            "callID": 46864,
            "state": "Talking",
            "startedAt": "2022-12-29T08:23:58Z",
            "answeredAt": "2022-12-29T08:24:01Z",
            "did": "",
            "owner": {
                "dnNum": "1126",
                "dnType": "extension",
                "externalParty": "1283",
                "status": "Connected"
            },
            "talkTo": [
                {
                    "dnNum": "1283",
                    "dnType": "extension",
                    "externalParty": "1126",
                    "status": "Connected"
                }
            ],
            "routingTo": []
        }
    ]
}
Get 3CX external lines information
https://{{3CXFQDN}}/webapi/{{AccessKey}}/all.line.get
{
    "nums": [
        "90000",
        "10002",
        "10000",
        "10001"
    ]
}
Get all extensions
https://{{3CXFQDN}}/webapi/{{AccessKey}}/all.ext.get
{
    "nums": [
        "100",
        "101",
        "102",
        "103",
        "104",
        "105",
        "106",
        "520",
        "521",
        "522"
    ]
}
Get all registered extensions
https://{{3CXFQDN}}/webapi/{{AccessKey}}/all.registered.get
{
    "nums": [
        "100",
        "101",
        "102"
    ]
}
Get list of ring groups
https://{{3CXFQDN}}/webapi/{{AccessKey}}/all.group.get
{
    "nums": [
        "945",
        "803"
    ]
}
Get list of IVR's
https://{{3CXFQDN}}/webapi/{{AccessKey}}/all.ivr.get
{
    "nums": [
        "HOL",
        "777",
        "QCB",
        "800",
        "801",
        "805"
    ]
}
Get list of extension group
https://{{3CXFQDN}}/webapi/{{AccessKey}}/all.extgroup.get
{
    "extGroups": [
        "__DEFAULT__",
        "Company0",
        "Sales",
        "___FAVORITES___000"
    ]
}
Get 3CX extension properties
https://{{3CXFQDN}}/webapi/{{AccessKey}}/ext.info.get?num=102
{
    "num": "102",
    "name": "Tom",
    "lastname": "Smith",
    "email": "info@creomate.com",
    "mobile": "",
    "enabled": true,
    "externalCalls": true,
    "recordType": "External"
}
Get 3CX extension status
https://{{3CXFQDN}}/webapi/{{AccessKey}}/ext.state.get?num=102
{
    "num": "102",
    "registered": true,
    "status": "Free",
    "fwdName": "Available",
    "qGlobalStatus": true,
    "qStatus": [
        {
            "num": "802",
            "status": false
        },
        {
            "num": "804",
            "status": true
        }
    ]
}
Get ring group members
https://{{3CXFQDN}}/webapi/{{AccessKey}}/group.members.get?num=803
{
    "count": 3,
    "members": [
        "520",
        "521",
        "522"
    ]
}
Get free ring group members
https://{{3CXFQDN}}/webapi/{{AccessKey}}/group.free.get?num=803
{
    "count": 2,
    "members": [
        "520",
        "521"
    ]
}
Get group members
https://{{3CXFQDN}}/webapi/{{AccessKey}}/extgroup.members.get?name=__DEFAULT__
{
    "count": 3,
    "members": [
        "101",
        "102",
        "520"
    ]
}

SET Methods

Set extension forwarding status
https://{{3CXFQDN}}/webapi/{{AccessKey}}/ext.fwd.set?num=102&status&message=Custom message
{
    "result": true
}
Set extension global queue status
https://{{3CXFQDN}}/webapi/{{AccessKey}}/ext.queueglobal.set?num=102&log=on
{
    "result": true
}
Set extension queue status
https://{{3CXFQDN}}/webapi/{{AccessKey}}/ext.queue.set?num=102&queue=802&log=off
{
    "result": true
}
Set extension recording options (legacy)
https://{{3CXFQDN}}/webapi/{{AccessKey}}/ext.options.set?num=102&enabled=on&external=on&recording=external
{
    "result": true
}
Set Ring group members
https://{{3CXFQDN}}/webapi/{{AccessKey}}/group.members.set?num=945&members=101,103
{
    "result": true
}

3CX queue management

Get queue members
https://{{3CXFQDN}}/webapi/{{AccessKey}}/queue.members.get?num=802
{
    "count": 2,
    "members": [
        {
            "num": "102",
            "name": "Tom",
            "lastname": "Smith",
            "loggedIn": true
        },
        {
            "num": "104",
            "name": "Alex",
            "lastname": "Mulder",
            "loggedIn": false
        }
    ]
}
Get free queue members
https://{{3CXFQDN}}/webapi/{{AccessKey}}/queue.free.get?num=804
{
    "count": 1,
    "members": [
        {
            "num": "102",
            "name": "Tom",
            "lastname": "Smith",
            "loggedIn": true
        }
    ]
}
Get talking queue members
https://{{3CXFQDN}}/webapi/{{AccessKey}}/queue.talk.get?num=802
{
    "count": 1,
    "members": [
        {
            "num": "102",
            "name": "Tom",
            "lastname": "Smith",
            "loggedIn": true
        }
    ]
}
Get queue availability
https://{{3CXFQDN}}/webapi/{{AccessKey}}/queue.isfree.get?num=802
{
    "result": true
}
Get list of queues
https://{{3CXFQDN}}/webapi/{{AccessKey}}/all.queue.get
{
    "nums": [
        "820",
        "802",
        "804"
    ]
}
Set Queue agents
https://{{3CXFQDN}}/webapi/{{AccessKey}}/queue.agents.set?num=807&members=101,103
{
    "result": true
}
Set Queue managers
https://{{3CXFQDN}}/webapi/{{AccessKey}}/queue.managers.set?num=807&managers=102,105
{
    "result": true
}
Queue New
https://{{3CXFQDN}}/webapi/{{AccessKey}}/queue.new?num=813&name=API Queue&pollingstrategy=3&mastertimeout=300&ringtimeout=30&enableintro=0&introfile=onhold.wav&announcequeueposition=0&announcementinterval=30
{
    "result": "Create queue"
}
Polling strategy (0-13)
0 - Hunt
1 - Ring All
3 - Hunt random start (default)
4 - Next agent
5 - Longest waiting
6 - Least talk time
7 - Fewest answered
8 - Hunt by 3's
9 - First 3 available
10 - Skillbased routing Ring All
11 - Skillbased routing Hunt random start
12 - Skillbased routing Round robin
13 - Skillbased routing Fewest answered
Queue Update
https://{{3CXFQDN}}/webapi/{{AccessKey}}/queue.update?num=813&name=API Queue&pollingstrategy=3&mastertimeout=300&ringtimeout=30&enableintro=0&introfile=onhold.wav&announcequeueposition=0&announcementinterval=30
{
    "result": "Update queue"
}
Queue Delete
https://{{3CXFQDN}}/webapi/{{AccessKey}}/queue.del?num=813
{
    "result": "Delete queue"
}

3CX Call control API Methods

Make call
https://{{3CXFQDN}}/webapi/{{AccessKey}}/makecall?first=102&second=420774852529
NB: For automatic calling, you can use the IVR, queue or CFD number as the first parameter
{
    "first": "102",
    "second": "420774852529"
}
Get devices and contact
https://{{3CXFQDN}}/webapi/{{AccessKey}}/ext.devices.get?num=102
{
    "count": 2,
    "devices": [
        {
            "userAgent": "3CX Mobile Client",
            "contact": "sip:102@127.0.0.1:5483;rinstance=5a6cb7ecb40359bf"
        },
        {
            "userAgent": "3CX WebRTC proxy",
            "contact": "sip:102@127.0.0.1:5063;rinstance=b206569d67c8dd02"
        }
    ]
}
Drop call
https://{{3CXFQDN}}/webapi/{{AccessKey}}/drop?num=102&contact=102&external=787
Num - Extension (mandatory), Contact - Device contact (optional), External - External number (optional)
{
    "result": "Drop"
}
Answer call
https://{{3CXFQDN}}/webapi/{{AccessKey}}/answer?num=102&contact=102
{
    "result": "Answer"
}
Transfer call
https://{{3CXFQDN}}/webapi/{{AccessKey}}/transfer?num=102&contact=102&dest=101
{
    "result": "Transfer"
}
Join call
https://{{3CXFQDN}}/webapi/{{AccessKey}}/join?num=102
{
    "result": "Join"
}

3CX phonebook management

Contact.Find
https://{{3CXFQDN}}/webapi/{{AccessKey}}/contact.find?num=997&min_len=3
search the phonebook with the minimum length exact match or ends with the number
{
    "id": [
        6,
        7
    ]
}
Contact.New
https://{{3CXFQDN}}/webapi/{{AccessKey}}/contact.new?firstname=FirstName&lastname=LastName&company=Company&phone=Mobile&data0=Mobile2&data1=Home&data2=Home2&data3=Business&data4=Business2&data5=Email&data6=Other&data7=Businessfax&data8=Homefax&data9=Pager
{
    "id": 5
}
Contact.Delete
https://{{3CXFQDN}}/webapi/{{AccessKey}}/contact.del?id=5
{
    "result": "Delete contact"
}
Contact.Update
https://{{3CXFQDN}}/webapi/{{AccessKey}}/contact.update?id=4&firstname=FirstName&lastname=LastName&company=Company&phone=Mobile&data0=Mobile2&data1=Home&data2=Home2&data3=Business&data4=Business2&data5=Email&data6=Other&data7=Businessfax&data8=Homefax&data9=Pager
{
    "result": "Update contact"
}
Contact.Get
https://{{3CXFQDN}}/webapi/{{AccessKey}}/contact.get?id=4
{
    "name": "FirstName",
    "lastName": "LastName",
    "company": "Company",
    "crmContactData": "",
    "tag": "",
    "phone": "Mobile",
    "data0": "Mobile2",
    "data1": "Home",
    "data2": "Home2",
    "data3": "Business",
    "data4": "Business2",
    "data5": "Email",
    "data6": "Other",
    "data7": "Businessfax",
    "data8": "Homefax",
    "data9": "Pager"
}

3CX Extension management

Extension.New (Debian only)
https://{{3CXFQDN}}/webapi/{{AccessKey}}/ext.new?num=100
{
    "result": "Create extension"
}
Extension.Delete
https://{{3CXFQDN}}/webapi/{{AccessKey}}/ext.del?num=100
{
    "result": "Delete extension"
}
Extension.Update
https://{{3CXFQDN}}/webapi/{{AccessKey}}/ext.update?num=300&enabled={0/1}&firstname=Firstname&lastname=Lastname&email=api@api.com&mobile={}&authid=300&authpass=300&callerid={}&deliveraudio={0/1}&recordcalls={0/1/2}&sipid={}&reinvite={0/1}&replaces={0/1}&vmemail={0/1/2/3}&vmenabled={0/1}&vmpin={}&vmplaycallerid={0/1}&vmplaydatetime={0/1/2}&internal={0/1}&noanswertimeout={}
{
    "result": "Update extension"
}

3CX Server management

CFD App. Reload
https://{{3CXFQDN}}/webapi/JNJP5UqGDhX89ue2POsb1Kto1/cfd.reset?names=900,901
script1,script2, ... ,scriptN
{
"result":"CFD scripts have been reset"
}
CSV. Reload
https://{{3CXFQDN}}/webapi/{{AccessKey}}/csv.reread
{
"result":"Success"
}
Pay attention. When creating an extension using WebAPI, the password complexity is not checked