Skip to main content
The weya API authenticates every request with an API key sent in the x-api-key header. A key acts as the user who created it: requests see that user’s agents, phone numbers and campaigns, and anything you create through the API belongs to that user.

Base URL

All endpoints in the API reference are relative to:
For example, POST /api/call/createBatch is https://api.weya.live/backend/api/call/createBatch.

Create an API key

1

Open API keys

In the weya dashboard, open the profile menu and select API Keys.
2

Create a key

Create a new key and copy it.
3

Store it as a secret

Keep the key in your secret manager or an environment variable, never in source code or in a browser.
An API key has the same access as the user who created it. Use it only from your servers, and delete it from API Keys straight away if it leaks.

Send the key

Add the key to every request in the x-api-key header:

Find your user ID

Some endpoints, such as Upload Campaign CSV and Start Campaign, take a userId. Get it once from your profile, which returns the user that owns the key as data._id:
cURL

Response format

Most endpoints return the same envelope. Check status before you read data:

Authentication errors

Rate limits

Requests are rate limited per client IP address. When you go over a limit, the API returns 429 with a message that says how long to wait, and the standard RateLimit response headers show your remaining requests.
To add many contacts, send them in one request instead of one request per contact. Add Calls to Campaign accepts thousands of contacts per call and splits them into chunks for you.

Next steps

API quickstart

Launch a campaign and receive results with four requests.

API reference

Every endpoint, with request and response examples.