Actualizar un número

Sirve para actualizar los datos de un número (alias, color, imagen) o completar sus datos de WhatsApp Business, como WABA y phone number ID, y el consentimiento de Conversions API.

PUT
/devices/{device}

Escritura · requiere el permiso accounts:write.

Autorización

http
headerAuthorizationBearer <clave>

Parámetros de la ruta

device*integer

The device ID

Cuerpo del pedido

application/json
  1. body
alias?string|null
color?string|null
image?|
Formatouri
number?string|null
first_conecction_at?|
Formatodate-time
is_business?boolean
phone_number_id?string
waba_id?string
code?string
whatsApp_business_app?boolean
capi_consent?boolean

Meta Conversions API (CAPI) opt-in consent — capi-meta-connection Inc 3 (design.md D3). Optional: only meaningful on the Meta branch, and even there it is a no-op unless the capi feature flag is enabled for the account (defense in depth, see updateMetaDevice below).

Cuerpo de la respuesta

DeviceResource

application/json
  1. response
id*integer
alias*string
image*string
color*string
number*string
normalized_number*string

coexistence-connection-and-devices-ux, Increment 1 (design.md D1, tasks.md 1.1): purely additive, read-time-computed field used by front/dashboard to group Meta + QR devices sharing the same number into one card (groupDevicesByNumber). Reuses the SAME PhoneNumberNormalizer the backend already uses at write time (DeviceController) — never a second, drifting implementation. null when number is empty/null (device not yet connected).

first_conecction_at*string
user_id*integer
provider*WhatsAppProviderEnum
Valor en1234
waba_id*string
whatsapp_username*string|null
is_business*integer
connected*integer
active*integer|null
health*string

meta-number-health-status, Increment 2 (design.md D4/D5/D6): null for any non-Meta device, WITHOUT exception. NEVER triggers a Meta call — reads only the eager-loaded healthStatus relation (see DeviceController::index()) via DeviceHealthSummaryBuilder, the single source of truth for this shape (also reused by the Increment 4 detail endpoint).

number_key*|

Bolsa unica de numeros (whatsapp-preverified-number-assignment, Inc 9, D15/D29): aditivo. Identidad persistente del numero (sobrevive a la desconexion) y el ultimo numero para mostrar cuando number esta vacio. Las columnas estan en Device::$hidden; aca se exponen explicitamente.

number_key_confirmed*string

Identidad confirmada = clave + number_key_confirmed_at (una clave sin fecha es la "esperada" de una fila hermana todavia sin conectar).

is_coexistence*boolean
slot_state*string

Inc 10 (D29): free / reserved / pending / held, computed only from the row's columns (no event probe, no extra query). A torn-down row without key from before the backfill may look free (see DeviceSlotService::slotState()).

pool_suspended*boolean

Inc 25 (audit 2026-10-15, D29/D36/D41/D42): suspension by the plan, the customer's keep choice, and whether a QR connection of this number is allowed (computed over the titular's rows already loaded by the listing; a single resource reads its number's rows with one query).

pool_suspension_reason*string|null
pool_keep*boolean
qr_allowed*boolean
can_change_to_meta*boolean

D60 (contract with front/dashboard): a QR row of the titular with a confirmed number identity may change to Meta in place (PUT devices/{id} with the Embedded Signup code of the same number, own SIM). Never an extra query.

capabilities*

armar-funnelchat-f1-f2 (contract 1014 C4, design.md D3): what the public API can do with this number, per provider. Additive; shared by the web routes and the /api/v1 alias.

curl -X PUT "https://example.com/devices/0" \  -H "Content-Type: application/json" \  -d '{}'
{  "id": 0,  "alias": "string",  "image": "string",  "color": "string",  "number": "string",  "normalized_number": "string",  "first_conecction_at": "string",  "user_id": 0,  "provider": 1,  "waba_id": "string",  "whatsapp_username": "string",  "is_business": 0,  "connected": 0,  "active": 0,  "health": "string",  "number_key": "string",  "number_key_confirmed": "string",  "is_coexistence": true,  "slot_state": "string",  "pool_suspended": true,  "pool_suspension_reason": "string",  "pool_keep": true,  "qr_allowed": true,  "can_change_to_meta": true,  "capabilities": {    "messages": {      "text": true,      "media": true,      "buttons": true,      "lists": true,      "templates": true,      "location": true,      "voice_note": true,      "polls": true,      "events": true,      "contact_card": true,      "reactions": true    },    "groups": {      "create": true,      "add_participants": true,      "remove_participants": true,      "admins": true,      "photo": true,      "settings": true,      "invite_link": true,      "send": true,      "join_requests": true    },    "statuses": [      "string"    ]  }}