← API v2 Overview

Calls

Read and record VOIP call logs. Providers and integration bridges can push calls with POST /calls; re-posting the same provider and provider_id updates the entry. Calls are linked to contacts and leads by phone number.

The Call Object

Generated from the OpenAPI schema. Always matches the live API.

Fields (15)
AttributeTypeRequiredDescriptionExample
idinteger-Call id.
providerenum-VOIP provider the call came from.
directionenum-Call direction.
numberstring-External party phone number (digits only).
contactinteger or null-Linked contact id, or null if unmatched.
leadinteger or null-Linked lead id, or null.
resultenum-Normalised call outcome.
durationinteger-Call duration in seconds.
startedinteger-Unix timestamp the call started.
linestring-Business line/number that handled the call (full view only).
userinteger or null-Staff user who handled the call, or null (full view only).
recording_availableboolean-Whether a recording exists for this call. Playback is not exposed via the API (full view only).
voicemailboolean-Whether the call went to voicemail (full view only).
endedinteger-Unix timestamp the call ended, or 0 (full view only).
createdinteger-Unix timestamp the record was created (full view only).
Example object
{
    "id": 0,
    "provider": "aircall",
    "direction": "inbound",
    "number": "",
    "contact": 0,
    "lead": 0,
    "result": "completed",
    "duration": 0,
    "started": 0,
    "line": "",
    "user": 0,
    "recording_available": false,
    "voicemail": false,
    "ended": 0,
    "created": 0
}

Endpoints

GET List Calls

GET /2.0/calls · scope calls:read

List VOIP call logs with pagination and optional filters: contact, lead, user, provider, direction, result, number, and started/created date ranges.

Parameters (2)
ParameterInTypeRequiredDescriptionExample
cursorquerystring-Keyset pagination cursor from a previous response's meta.pagination.next_cursor. When supplied, page/total are not returned.
fieldsquerystring-Comma-separated dot-paths to return only those fields, e.g. id,data.stock.price_channel.
Responses
StatusDescription
200 OKList Calls

Failures use the standard error responses (4xx/5xx) with the shared error envelope.

{
    "success": true,
    "data": [
        {
            "id": 0,
            "provider": "aircall",
            "direction": "inbound",
            "number": "",
            "contact": 0,
            "lead": 0,
            "result": "completed",
            "duration": 0,
            "started": 0,
            "line": "",
            "user": 0,
            "recording_available": false,
            "voicemail": false,
            "ended": 0,
            "created": 0
        }
    ],
    "meta": {
        "pagination": {
            "page": 0,
            "per_page": 0,
            "total": 0,
            "total_pages": 0,
            "next_cursor": ""
        }
    }
}

POST Create Call

POST /2.0/calls · scope calls:write

Record a call log entry. Intended for VOIP providers and integration bridges to push calls into MotorDesk. Re-posting the same provider and provider_id updates the existing entry (so a call can be created on ring and updated on completion). The contact and lead are resolved from the number when not supplied.

Request body
AttributeTypeRequiredDescriptionExample
providerstringYesShort provider/bridge identifier, e.g. aircall or ringcentral (max 16 chars, alphanumeric).aircall
provider_idstringYesThe provider's own unique id for the call. Used for idempotent upserts.call_8f2c1a
directionenumYesCall direction.inbound
numberstringYesThe external party phone number (international format preferred).447700900123
linestring-The business line/number or name that handled the call.Sales
contactinteger or null-Contact id to link to. Resolved from the number when omitted.25325
leadinteger or null-Lead id to link to. Resolved from the number when omitted.
userinteger-Staff user id who handled the call. See /reference/staff-users.12
resultstring-Call outcome. Provider wording is accepted and normalised to one of: completed, missed, voicemail, no_answer, busy, failed, in_progress.completed
durationinteger-Call duration in seconds.184
recordingstring-Provider recording id, if a recording exists.rec_77a2
recording_availableboolean-Whether a recording exists. Set automatically when recording is supplied.true
voicemailboolean-Whether the call went to voicemail.false
startedinteger-Unix timestamp the call started. Defaults to now when omitted.1788000000
endedinteger-Unix timestamp the call ended.1788000184
{
    "provider": "aircall",
    "provider_id": "call_8f2c1a",
    "direction": "inbound",
    "number": "447700900123",
    "line": "Sales",
    "contact": 25325,
    "lead": 0,
    "user": 12,
    "result": "completed",
    "duration": 184,
    "recording": "rec_77a2",
    "recording_available": true,
    "voicemail": false,
    "started": 1788000000,
    "ended": 1788000184
}
Responses
StatusDescription
200 OKCreate Call

Failures use the standard error responses (4xx/5xx) with the shared error envelope.

{
    "success": true,
    "data": {
        "id": 0,
        "provider": "aircall",
        "direction": "inbound",
        "number": "",
        "contact": 0,
        "lead": 0,
        "result": "completed",
        "duration": 0,
        "started": 0,
        "line": "",
        "user": 0,
        "recording_available": false,
        "voicemail": false,
        "ended": 0,
        "created": 0
    }
}

GET Get Call

GET /2.0/calls/{id} · scope calls:read

Retrieve a single call log entry by id.

Parameters (2)
ParameterInTypeRequiredDescriptionExample
idpathstringYesResource identifier in the path.
fieldsquerystring-Comma-separated dot-paths to return only those fields, e.g. id,data.stock.price_channel.
Responses
StatusDescription
200 OKGet Call

Failures use the standard error responses (4xx/5xx) with the shared error envelope.

{
    "success": true,
    "data": {
        "id": 0,
        "provider": "aircall",
        "direction": "inbound",
        "number": "",
        "contact": 0,
        "lead": 0,
        "result": "completed",
        "duration": 0,
        "started": 0,
        "line": "",
        "user": 0,
        "recording_available": false,
        "voicemail": false,
        "ended": 0,
        "created": 0
    }
}