Contatos

Importar contatos em lote

Changed on

Cria ou atualiza até 5.000 contatos por chamada. O corpo é um array. O telefone é a chave:

  • Telefone novo: cria (created).
  • Telefone existente com dados diferentes: atualiza (updated).
  • Telefone existente com dados iguais: skipped, sem erro.
  • Linha inválida: skipped e entra em errors com o índice e o motivo.

No lote, email e attributes substituem o que está gravado: enviar um contato existente sem email apaga o email dele. Para mudar só um campo, use PATCH /v1/contacts/{phone}.

importId identifica a chamada nos logs; não há rota para consultá-lo.

Permissão: CONTACTS_WRITE.

post/v1/contacts/batch

Request

Headers

X-Waba-Idstring uuid

Restringe o resultado a uma conta WhatsApp Business (WABA) da organização.

Request body

namestring required

Nome do contato. Obrigatório, até 255 caracteres.

phonestring required

Telefone E.164 com +. É a chave do contato.

emailstring nullable

No lote, substitui o email gravado. Omitir apaga o email de um contato existente.

attributesobject nullable

Objeto livre com dados do seu sistema. No lote, substitui o que está gravado.

Example request

[
  {
    "phone": "+5511999999999"
  }
]

Response

Resultado da importação

importIdstring uuid required

Identifica a chamada nos logs. Não há rota para consultá-lo.

createdinteger required
updatedinteger required
skippedinteger required

Example response

{
  "importId": "fa1b2c3d-4567-89ab-cdef-0123456789ab",
  "created": 1,
  "updated": 0,
  "skipped": 1,
  "errors": [
    {
      "index": 1,
      "phone": "5511888888888",
      "reason": "Telefone 5511888888888 fora do formato E.164."
    }
  ]
}

Changes

    • info

      api tag Contatos added

    • info

      api tag contacts removed

    • info

      added the non-success response with the status

    • breaking

      the response property / became nullable for the status

    • breaking

      the response property / became nullable for the status

    • breaking

      the response property became optional for the status

    • breaking

      the response's property type changed from object to string for status

    • breaking

      removed the required property / from the response with the status

    • breaking

      removed the required property / from the response with the status

    • warning

      removed the optional property / from the response with the status

    • info

      added the new optional header request parameter X-Waba-Id

    • info

      the / request property format was generalized from email to no format

    • info

      added the non-success response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      the response property became required for the status

    • info

      the response's property default value was removed for the status