curl --location --globoff 'https://api.weya.live/backend/api/call/batch-details/67def9053495307c718d9dfb?limit=50&sortBy=call_started_at&sortOrder=desc&filter={"call_status":["completed"]}' \
--header 'x-api-key: YOUR_API_KEY'
{
"status": true,
"code": 200,
"message": "Calls fetched successfully",
"errorMessage": null,
"data": {
"batchId": "67def9053495307c718d9dfb",
"batchName": "Marketing Campaign May 2025",
"batchStatus": "in-progress",
"hasCrm": true,
"hasCrmSyncData": true,
"page": 1,
"limit": 50,
"total": 150,
"totalPages": 3,
"nextCursor": "eyJpZCI6IjEyMyIsInNvcnRWYWx1ZSI6IjIwMjUtMDUtMTUifQ==",
"data": [
{
"_id": "2f6c1a3e-6b1d-4c52-9f0a-3a7d2e9b8c11",
"phoneNumber": "+12125551234",
"createdAt": "2025-05-15T14:00:00.000Z",
"updatedAt": "2025-05-15T14:32:00.000Z",
"retry_count": 1,
"attempts": 1,
"followUpAt": null,
"followUpAtRaw": null,
"isExpired": false,
"tool_status": "success",
"tool_counts": { "success": 2, "failure": 0, "total": 2 },
"phoneLogs": {
"call_status": "completed",
"call_duration": 120,
"call_started_at": "2025-05-15T14:30:00.000Z",
"hangup_source": null,
"hangup_reason": null,
"call_outcome": "Interested",
"call_journey": null,
"call_uuid": "a1b2c3d4-0000-0000-0000-000000000000",
"request_uuid": "a1b2c3d4-0000-0000-0000-000000000000",
"webhook_events": []
}
}
]
}
}
Campaign Management
Get Campaign Details
Get a campaign’s status and page through its contacts with the latest call attempt of each.
GET
/
api
/
call
/
batch-details
/
{batchId}
curl --location --globoff 'https://api.weya.live/backend/api/call/batch-details/67def9053495307c718d9dfb?limit=50&sortBy=call_started_at&sortOrder=desc&filter={"call_status":["completed"]}' \
--header 'x-api-key: YOUR_API_KEY'
{
"status": true,
"code": 200,
"message": "Calls fetched successfully",
"errorMessage": null,
"data": {
"batchId": "67def9053495307c718d9dfb",
"batchName": "Marketing Campaign May 2025",
"batchStatus": "in-progress",
"hasCrm": true,
"hasCrmSyncData": true,
"page": 1,
"limit": 50,
"total": 150,
"totalPages": 3,
"nextCursor": "eyJpZCI6IjEyMyIsInNvcnRWYWx1ZSI6IjIwMjUtMDUtMTUifQ==",
"data": [
{
"_id": "2f6c1a3e-6b1d-4c52-9f0a-3a7d2e9b8c11",
"phoneNumber": "+12125551234",
"createdAt": "2025-05-15T14:00:00.000Z",
"updatedAt": "2025-05-15T14:32:00.000Z",
"retry_count": 1,
"attempts": 1,
"followUpAt": null,
"followUpAtRaw": null,
"isExpired": false,
"tool_status": "success",
"tool_counts": { "success": 2, "failure": 0, "total": 2 },
"phoneLogs": {
"call_status": "completed",
"call_duration": 120,
"call_started_at": "2025-05-15T14:30:00.000Z",
"hangup_source": null,
"hangup_reason": null,
"call_outcome": "Interested",
"call_journey": null,
"call_uuid": "a1b2c3d4-0000-0000-0000-000000000000",
"request_uuid": "a1b2c3d4-0000-0000-0000-000000000000",
"webhook_events": []
}
}
]
}
}
Overview
Fetch a single campaign’s name and status, and a paginated list of its contacts. Each contact comes with the result of its latest call attempt. You can filter by call status, outcome, duration and date, search by phone number or call ID, and sort.Prerequisites
- An API key for your workspace
- The campaign’s
batchId: the_idfrom Get Campaigns, the ID returned when you created the campaign, or the last part of the campaign’s URL in the dashboard. The campaign must have been created by the user who owns the API key.
Request
Cursor for the next page. Pass the
data.nextCursor value from the previous response, with the same sortBy, sortOrder, filter and search. Faster than page for large campaigns.Field to sort by:
updatedAt, createdAt, retry_count, call_started_at, call_duration or call_status. Any other value sorts by createdAt.Matches contacts whose phone number contains this text, or whose call has exactly this call ID (
request_uuid, call_uuid or stream ID).URL-encoded JSON object. Applies to each contact’s latest call attempt. Fields:
call_status– array of statuses, for example["completed", "no-answer"]call_outcome– array of call outcomeshangup_source– array of hangup sourcescall_durationMin,call_durationMax– call duration in secondscreatedAtMin,createdAtMax– call start time (ISO 8601)crm_sync_status– array ofsynced,failedornot_synced. Covers webhook and Google Sheet syncs only.
{"call_status":["completed"],"call_durationMin":30}. Unknown fields are ignored, and a value that isn’t valid JSON is ignored, so check the total you get back.curl --location --globoff 'https://api.weya.live/backend/api/call/batch-details/67def9053495307c718d9dfb?limit=50&sortBy=call_started_at&sortOrder=desc&filter={"call_status":["completed"]}' \
--header 'x-api-key: YOUR_API_KEY'
Response
{
"status": true,
"code": 200,
"message": "Calls fetched successfully",
"errorMessage": null,
"data": {
"batchId": "67def9053495307c718d9dfb",
"batchName": "Marketing Campaign May 2025",
"batchStatus": "in-progress",
"hasCrm": true,
"hasCrmSyncData": true,
"page": 1,
"limit": 50,
"total": 150,
"totalPages": 3,
"nextCursor": "eyJpZCI6IjEyMyIsInNvcnRWYWx1ZSI6IjIwMjUtMDUtMTUifQ==",
"data": [
{
"_id": "2f6c1a3e-6b1d-4c52-9f0a-3a7d2e9b8c11",
"phoneNumber": "+12125551234",
"createdAt": "2025-05-15T14:00:00.000Z",
"updatedAt": "2025-05-15T14:32:00.000Z",
"retry_count": 1,
"attempts": 1,
"followUpAt": null,
"followUpAtRaw": null,
"isExpired": false,
"tool_status": "success",
"tool_counts": { "success": 2, "failure": 0, "total": 2 },
"phoneLogs": {
"call_status": "completed",
"call_duration": 120,
"call_started_at": "2025-05-15T14:30:00.000Z",
"hangup_source": null,
"hangup_reason": null,
"call_outcome": "Interested",
"call_journey": null,
"call_uuid": "a1b2c3d4-0000-0000-0000-000000000000",
"request_uuid": "a1b2c3d4-0000-0000-0000-000000000000",
"webhook_events": []
}
}
]
}
}
Campaign status:
pending, in-progress, paused, freezed (outside the calling window), completed or failed.true when the campaign sends call outcomes to a CRM, webhook or Google Sheet, or has done so before.true when webhook or Google Sheet sync records exist for this campaign, so the crm_sync_status filter applies.Result of the tools the agent ran during calls to this contact:
success (all succeeded), warning (some failed), error (all failed), or null (no tools ran). tool_counts gives the success, failure and total counts.The latest call attempt:
call_status, call_duration (seconds), call_started_at, hangup_source, hangup_reason, call_outcome, call_journey, call_uuid, request_uuid, and webhook_events (webhook and Google Sheet sync records for this attempt). Fields are null until the contact has been called.The response doesn’t include the contact’s CSV variables (
lead_data) or call transcripts and recordings.Error Handling
Errors returnstatus: false, with the reason in errorMessage.
- 400 Bad Request –
Invalid Batch ID:batchIdis not a valid ID. - 401 Unauthorized – Missing or invalid API key.
- 404 Not Found –
Batch not found: no campaign with this ID was created by the user who owns the API key, or it was deleted. - 500 Internal Server Error – Unexpected server error.
Was this page helpful?

