BeaconBox
Esc

Type to search.

Dashboard

Set a phone number

Store a mobile number against a recipient, so later pushes do not have to carry it.

PUT/api/v1/recipients/{email}/phone

Request

curl -X PUT https://api.beaconbox.eu/api/v1/recipients/buyer@example.com/phone \
  -H "Authorization: Bearer $BEACONBOX_API_KEY" \
  -H "Content-Type: application/json"
  -d '{
       "phone": "+37255550134"
     }'

Path parameters

NameTypeDescription
emailemail

Body

FieldTypeDescription
phone
required
stringMobile number, E.164 preferred (e.g. +372 5555 0134).

Response

Returns 200.

FieldTypeDescription
recipient_emailstring
phonestring | nullMasked, e.g. "+372 •••• 0134". None if no number is stored.
sms_status"none" | "active" | "stopped"
sms_status_atdate-time | null
sms_consent_atdate-time | nullWhen a number was first accepted for texting this recipient. Null for a recipient who has never had one, or whose number predates this field.
sms_consent_sourcestring | nullThe surface that first accepted it: "push" (recipient_phone on a push), "api" (PUT /recipients/{email}/phone), "admin" (the recipient page) or "inbox".

Errors

Failures are { "error_code": "..." } with a stable dotted code. See Errors for the codes worth branching on and the three outcomes that look like failures and are not.