API & Documentation

Developer area.

Everything your technical team needs to integrate Focus Chat: simple authentication, documented endpoints, real-time webhooks, and ready-to-paste examples.

Authentication

Each channel has its own token.

Authentication is straightforward: every channel connected in the platform generates its own access-token. Pass it in the header of each request and you're set.

  1. 01

    Open the platform and go to the channel you want to integrate.

  2. 02

    Copy the access-token from the channel ("Integrations" tab).

  3. 03

    Send it in the access-token header on every request.

Watch how to copy the channel token
Featured endpoint

The one you'll use the most: send text.

90% of integrations start here — send a text message to a number. Below is the full example with all three possible responses.

POST/core/v2/api/chats/send-text

Sends a text message to a number or contactId. Supports internal whisper (isWhisper), force send, contact verification, delay and link preview.

The "contactId" field is optional — only use it when you are not sending "number".

Request
curl
curl --location 'https://api.focuschat.com.br/core/v2/api/chats/send-text' \
  --header 'access-token: TOKEN_DO_CANAL' \
  --header 'Content-Type: application/json' \
  --data '{
    "number": "5577981338467",
    "message": "Olá! Seu pedido foi confirmado.",
    "isWhisper": false,
    "forceSend": true,
    "verifyContact": false,
    "delayInSeconds": 0,
    "linkPreview": true
  }'
Responses
202 · Accepted & queued
{
  "status": "200",
  "msg": "Sucesso",
  "currentChatId": "string",
  "messageSentId": "string",
  "messagesSentIds": [
    "string"
  ]
}
400 · Validation error
{
  "status": "400",
  "msg": "Campo abc invalido",
  "errorCode": "Campo abc invalido"
}
500 · Internal error
{
  "status": "500",
  "msg": "Ocorreu um erro interno na aplicação",
  "errorCode": "SYSTEM_001"
}
Send template with payment

Meta template with PIX, boleto and link buttons.

Perfect for collections: your customer receives a Meta-approved template and can instantly pay via PIX, copy the boleto barcode or open the invoice — all inside the WhatsApp conversation.

POST/core/v2/api/chats/send-template

Sends a Meta-approved template with an order_details button, bundling a dynamic PIX, boleto and payment link into a single message.

Requires the templateId already approved at Meta. Amounts in cents use offset:100 (50000 = R$ 500.00).

Heads up
  • •The template must be of type Order details (order_details) in Meta's dashboard. Regular templates don't support the payment button.
  • •Only 2 payment methods can be sent per request. We left all 3 in the example for reference — pick 2 inside payment_settings before sending.
Request
curl
curl --location 'https://api.focuschat.com.br/core/v2/api/chats/send-template' \
  --header 'access-token: TOKEN_DO_CANAL' \
  --header 'Content-Type: application/json' \
  --data '{
    "number": "5577981338467",
    "templateId": "ID_DO_TEMPLATE",
    "templateComponents": [
      {
        "type": "body",
        "parameters": [
          { "type": "text", "text": "VARIAVEL 1" },
          { "type": "text", "text": "VARIAVEL 2" },
          { "type": "text", "text": "VARIAVEL 3" },
          { "type": "text", "text": "VARIAVEL 4" }
        ]
      },
      {
        "type": "button",
        "sub_type": "order_details",
        "index": 0,
        "parameters": [
          {
            "type": "action",
            "action": {
              "order_details": {
                "reference_id": "1234",
                "type": "digital-goods",
                "payment_type": "br",
                "payment_settings": [
                  {
                    "type": "pix_dynamic_code",
                    "pix_dynamic_code": {
                      "code": "9999999990br.gov.bcb.pix2548pix.example.com...",
                      "merchant_name": "Nome do Cliente",
                      "key": "99988888888",
                      "key_type": "CPF"
                    }
                  },
                  {
                    "type": "boleto",
                    "boleto": {
                      "digitable_line": "461911100000000000042310..."
                    }
                  },
                  {
                    "type": "payment_link",
                    "payment_link": {
                      "uri": "https://www.asaas.com/b/pdf/fffffff"
                    }
                  }
                ],
                "currency": "BRL",
                "total_amount": { "value": 50000, "offset": 100 },
                "order": {
                  "status": "pending",
                  "tax": { "value": 0, "offset": 100, "description": "optional text" },
                  "items": [
                    {
                      "retailer_id": "1234567",
                      "name": "nomedoitem",
                      "amount": { "value": 50000, "offset": 100 },
                      "quantity": 1
                    }
                  ],
                  "subtotal": { "value": 50000, "offset": 100 }
                }
              }
            }
          }
        ]
      }
    ],
    "forceSend": true,
    "verifyContact": false
  }'
Community

Join our developer Discord.

A channel only for developers integrating with Focus Chat. Ask the team directly, get changelog previews, swap notes with other integrators.

Integration questions?

Talk directly to our technical team. We support everything from architecture planning to debugging edge cases.

Send a message