API reference
Add a number to the do-not-call list
POST /v1/do-not-call
From the next dial on, no agent rings it: a single call, a campaign's contact or a reminder to it is refused with do_not_call. Adding a listed number again answers 200 with the entry, taking the new reason if one is sent. Needs do_not_call:write and a live key.
Body
Sent as JSON. A field this operation does not take is refused, so a typo fails loudly.
| Field | Type | Required | Description |
|---|---|---|---|
number |
string | Yes | The number, in international form. Spaces, dashes and brackets are ignored. |
reason |
string | No | Why, in your words. |
Answer
200 with DoNotCallEntry.
201 with DoNotCallEntry.
Errors
Every error is a problem document with a stable code.
| Status | When |
|---|---|
401 |
The key is missing, mistyped, unknown, revoked or expired. |
403 |
A test key, or a key limited to some projects or agents: the list decides which real people are called. |
422 |
Not a phone number, or the list is full. |
429 |
Too many requests for this key or its organization; see Retry-After. |
500 |
Something went wrong on our side. Quote the request_id to support. |
Examples
#!/bin/sh
# Add a number to the do-not-call list. With a live key: the list decides which real people are called.
curl -sS --fail-with-body -X POST "https://api.aigently.ai/v1/do-not-call" \
-H "Authorization: Bearer $AIGENTLY_API_KEY" \
--json '{
"number": "+12025550188",
"reason": "Asked not to be called again"
}'
Try it
Sends this request to the API from your browser, with a test key. Nothing it does rings a phone.