Skip to main content
PATCH
Update a DNC entry
Update reason, expires_at, and/or agent_ids on an existing Do-Not-Call entry. The phone_number is immutable — delete the entry and add a new one if the number itself needs to change. To switch a scoped entry to a global block, pass agent_ids: []. To narrow a global block to specific agents, pass a non-empty array. Required scope: do_not_call:manage.

Example request

Example response

Errors

Authorizations

Authorization
string
header
required

Your Yappr API key (e.g. ypr_live_...). Generate one in the dashboard under Settings → API Keys. No key is 401 MISSING_KEY; a key that is not one of ours, or is revoked, is 401 INVALID_KEY; an expired one is 401 EXPIRED_KEY. A valid key without the scope an operation needs is 403 INSUFFICIENT_SCOPE on every operation, and the message names the scope. Every response, a 401 included, carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset: the budget is 60 requests a minute per API key. Every 429, whatever its code, carries Retry-After (whole seconds, never zero): the per-key budget's RATE_LIMIT asks for what is left of the minute, a route's daily cap (RATE_LIMITED) for the time until that cap resets. All four headers are listed in Access-Control-Expose-Headers, so a browser can read them. A path the API does not serve (an unknown sub-path, an id left empty) is 404 ROUTE_NOT_FOUND, and a method a served path does not take is 405 METHOD_NOT_ALLOWED with an Allow header; both are answered before any scope check, and nothing is read or changed. A trailing slash is ignored where it cannot be an id left empty (POST /calls/ is POST /calls) and refused where it can (GET /calls/). A doubled slash inside a path is merged into one before the request reaches the API (GET //calls is GET /calls).

Path Parameters

id
string<uuid>
required

Body

application/json
reason
string | null
expires_at
string<date-time> | null
agent_ids
string<uuid>[]

Empty array = global; non-empty = scoped to listed agents.

Response

Updated entry

A phone number on the company's Do-Not-Call list. Outbound call placement skips numbers on this list — the request returns status: "dnc_blocked" and a call_logs row is recorded for analytics, but no carrier leg is established and no minutes are charged.

DNC entries can be global (block every agent) or agent-scoped (block only specific agents — others can still call the number). Scope is controlled via the agent_ids field.

id
string<uuid>
company_id
string<uuid>
phone_number
string

E.164 form, e.g. +972501234567. Whatever input format you submit gets normalized before storage.

Example:

"+972501234567"

reason
string | null

Optional free-form note. Surfaced in the dashboard, not in outbound API responses.

source
enum<string>

Where this entry came from. manual = added via dashboard, api = added via this API, auto = reserved for future automated additions (e.g. opt-out keyword detection during a call).

Available options:
manual,
api,
auto
expires_at
string<date-time> | null

When the block lapses. null = permanent. Past timestamps are filtered out at outbound-check time.

active
boolean

Whether this entry blocks calls right now: true when expires_at is null or still in the future, false once it has passed. A lapsed entry is not removed - it stays on the list, and a ?phone= lookup still returns it, with active: false - until you delete it or give it a new expires_at.

Example:

true

agents
object[]

Empty array [] (or omitted on insert) = global: every agent in the company is blocked from calling this number.

Non-empty = scoped: only the listed agents are blocked. Agents NOT in the array can still place outbound calls to this number.

On GET responses each item is the full agent object (resolved from the underlying agent_ids column so you don't have to make a second /agents/{id} call). On POST/PATCH inputs the field is named agent_ids and takes a string[] of UUIDs — see those endpoints for the input shape.

created_by
string<uuid> | null

Best-effort attribution to a user; null when added via API.

created_at
string<date-time>