POST /v1/channels/{id}/pair
POST
/v1/channels/{id}/pair
const url = 'https://seu-endereco-da-api/v1/channels/example/pair';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"relinkDevice":true,"importHistory":true,"phoneNumber":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://seu-endereco-da-api/v1/channels/example/pair \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "relinkDevice": true, "importHistory": true, "phoneNumber": "example" }'Permissão que a Chave de acesso precisa: Gerenciar canais (channels:manage).
Authorizations
Seção intitulada “Authorizations”Parameters
Seção intitulada “Parameters”Path Parameters
Seção intitulada “Path Parameters”id
required
string
Request Bodyrequired
Seção intitulada “Request Bodyrequired”Media typeapplication/json
object
relinkDevice
Required with importHistory on a connected channel: the gateway unlinks the phone and pairs it again, because WhatsApp only sends the history to a freshly linked device
boolean
importHistory
required
boolean
phoneNumber
string
Example generated
{ "relinkDevice": true, "importHistory": true, "phoneNumber": "example"}