Before you start
You need three things, set up once in the dashboard:- An outbound voice agent. Build one with the dashboard quickstart or Build a voice agent.
- A phone number with that agent assigned as its outbound agent. See Connect a phone number.
- An API key, stored in the
WEYA_API_KEYenvironment variable. See Authentication.
POST requests, to receive call results. For testing, a request inspector such as webhook.site works.
1
Get your user ID
Some campaign endpoints take the ID of the user that owns the key.Save
data._id as USER_ID.2
Find the phone number to call from
List your numbers and pick one whose Save that number’s
outboundAgentName is the agent you want to make the calls.Response (trimmed)
_id as PHONE_ID. The campaign calls from this number, and the outbound agent assigned to it handles every call.3
Register a webhook for call results
data._id as WEBHOOK_ID. If you set bearerToken, weya sends it as Authorization: Bearer <token> with every delivery, so your endpoint can reject anything else.4
Upload your contacts as a campaign
Create a CSV with a Upload it to create the campaign, with the calling schedule and the webhook attached:Save
phoneNumber column plus one column for each variable your agent’s prompt uses:contacts.csv
data.batch[0]._id as BATCH_ID and data.uuid as UPLOAD_ID.If any row is invalid, the whole upload is rejected and the response lists each bad row with its reason. Fix the rows, or add
--form 'type="true"' to skip invalid rows and upload the rest.5
Start calling
6
Receive the results
About five minutes after each call ends, once the recording and the transcript analysis are ready, weya posts the result to your webhook:Respond with any
2xx status. See Call result webhooks for every field and how retries work.You now have a campaign that dials your contacts within its calling window, retries unanswered contacts up to three times, and sends every result to your system.
Add contacts as they arrive
If your contacts come from your own system over time instead of in one file, create the campaign once with Create Campaign and send contacts to it with Add Calls to Campaign. Each object needsphoneNumber, plus the variables your agent uses. Calling starts automatically after the contacts are added, so you don’t call Start Campaign for them.
Create Campaign doesn’t take a webhook. To attach one to a campaign created this way, pause it and set
pushingCrms with Update Campaign. Only calls that end after the update are sent.Control a running campaign
Next steps
Core concepts
What happens to a contact between upload and result.
Call result webhooks
Payload fields, delivery timing and retries.

