Skip to main content

Call Service

The Call Service allows you to manage outbound calls and retrieve call information. You can initiate calls, get call details, and manage call recordings.

Send Call

Initiate an outbound call to a phone number.
POST /call

Request Body

FieldTypeRequiredDescription
tostringYesThe recipient’s phone number in E.164 format (e.g., +1234567890)
agent_idstringYesID of the agent making the call

Example Request

{
  "to": "+1234567890",
  "agent_id": "agent-123"
}

Response

{
  "status": 200,
  "data": {
    "status": "Queued",
    "call_id": "call-123"
  }
}

List Calls

Retrieve a list of calls with optional filtering and pagination.
GET /call

Query Parameters

ParameterTypeRequiredDescription
skipnumberNoNumber of records to skip (default: 0)
takenumberNoNumber of records to return (default: 10)
whereobjectNoFilter conditions for the query
orderByobjectNoSorting criteria

Response

{
  "calls": [
    {
      "id": "call-123",
      "created_at": "2024-03-20T10:00:00Z",
      "to": "+1234567890",
      "from": "+1987654321",
      "status": "completed",
      "duration": 120,
      "direction": "outbound",
      "metadata": {
        "purpose": "sales",
        "priority": "high"
      },
      "recording_url": "https://storage.brilo.com/recordings/call-123.mp3",
      "workspace_id": "workspace-123"
    }
  ],
  "totalRecords": 100,
  "currentPage": 1
}

Get Call

Retrieve details of a specific call.
GET /call/{id}

Parameters

ParameterTypeRequiredDescription
idstringYesThe ID of the call to retrieve

Response

{
  "id": "call-123",
  "created_at": "2024-03-20T10:00:00Z",
  "to": "+1234567890",
  "from": "+1987654321",
  "status": "completed",
  "duration": 120,
  "direction": "outbound",
  "metadata": {
    "purpose": "sales",
    "priority": "high"
  },
  "recording_url": "https://storage.brilo.com/recordings/call-123.mp3",
  "workspace_id": "workspace-123"
}

Get Call Recording

Stream the audio recording of a call.
GET /call/{id}/recording

Parameters

ParameterTypeRequiredDescription
idstringYesThe ID of the call to retrieve the recording for

Response

The response is an audio stream of the call recording.

Delete Call

Delete a call record.
DELETE /call/{id}

Parameters

ParameterTypeRequiredDescription
idstringYesThe ID of the call to delete

Response

{
  "status": 200,
  "message": "Call deleted successfully"
}