Retrieve a campaign

Updated

Retrieves a campaign and the current number of contacts in each state.

Preview documentation

You're reading the Conversational AI Platform (Preview) docs. Switch to Main.
GET
https://preview.ai.agora.io/conversational-ai/v1/projects/{appid}/campaigns/{campaign_id}

Path Parameters

appidstring
Required

The App ID of your project.

campaign_idstring
Required

The ID of the campaign, returned in campaign_id when you create the campaign.

Response Body

The request was successful. The response body contains the campaign.

Response Headers

Agora-Request-Idstring

A unique ID for the request. Include it when you contact Agora support.

ETagstring

The current version of the resource. Pass this value in the If-Match header of your next update or delete request for this resource.

campaign_idstring

The ID of the campaign, a UUID.

namestring

The name of the campaign.

statusstring

The status of the campaign:

  • scheduled: The campaign is waiting for its start time.
  • running: The campaign is dialing, or can dial during its schedule.
  • paused: You paused the campaign.
  • completed: The campaign has finished.
  • canceled: You canceled the campaign.
  • failed: The campaign failed. The details are in failure.
agent_idstring

The ID of the agent that makes the calls.

transportobject
lifecycleobject

When each session the campaign starts ends on its own.

scheduleImmediate | Scheduled

When the campaign dials. Pass the fields of one schedule mode only.

countsobject

The number of contacts in each state. Retrieve the campaign to get current counts.

create_tsinteger

The time the campaign was created, as a Unix timestamp in seconds.

start_tsinteger | null

The time the campaign started dialing, as a Unix timestamp in seconds. null before it starts.

complete_tsinteger | null

The time the campaign finished, as a Unix timestamp in seconds. null until it finishes.

failureobject | null

Details of the failure when status is failed. Otherwise null.

Authorization

This endpoint requires authentication.

Request examples

Example Request
curl -X GET 'https://preview.ai.agora.io/conversational-ai/v1/projects/string/campaigns/497f6eca-6276-4993-bfeb-53cbbbba6f08'

Response example

Example Response
{  "campaign_id": "b4f0581e-f138-43a2-851c-a8f8d228bb37",  "name": "q3-renewals",  "status": "running",  "agent_id": "3f6c2a9e-8d1b-4e7a-9c55-0b2f7d1e4a10",  "transport": {    "type": "telephony",    "from": [      "92e68758-3d3a-4f27-8b93-3fd8d834467c"    ]  },  "lifecycle": {    "idle_timeout_ms": 30000,    "max_duration_ms": 300000,    "graceful_stop": {      "enabled": false,      "timeout_ms": 30000    }  },  "schedule": {    "mode": "immediate"  },  "counts": {    "contacts": 120,    "pending": 84,    "calling": 6,    "completed": 27,    "failed": 3,    "canceled": 0  },  "create_ts": 1787673602,  "start_ts": 1787673602,  "complete_ts": null,  "failure": null}