Quickstart
This guide goes from zero to the first message sent through the API: create a key, make the first authenticated call, and send a text message through a channel.
Create the key
Every API call needs a credential. Create an API key at /painel/chaves. The hub_pk_... value is shown exactly once, when the key is created — if you lose it, the only way out is to revoke the key and create another. Store it in a secret manager, never in plain text in the repository.
Every key-authenticated request sends that value in the Authorization header, as Bearer hub_pk_....
First request
With the key in hand, the simplest call to confirm everything works is listing the organization’s channels:
curl https://crprohub.com/api/v1/channels \ -H "Authorization: Bearer hub_pk_EXEMPLO_NAO_REAL"
{
"data": {
"channels": [
{
"id": "9f6a9c1e-2f3d-4a5b-8c7d-1e2f3a4b5c6d",
"name": "Atendimento",
"external_id": null,
"type": "whatsapp",
"status": "active",
"waba_id": "109876543210987",
"phone_number_id": "123456789012345",
"display_phone_number": "+55 21 99999-9999",
"verified_name": "Minha Empresa",
"quality_rating": "GREEN",
"coexistence": false,
"subscribed_ok": true,
"created_at": "2026-08-01T12:00:00.000Z",
"updated_at": "2026-08-20T09:30:00.000Z"
}
]
}
}The response is wrapped in {"data": ...}. If the organization has no channels yet, the channels array comes back empty — create a channel in the dashboard before moving to the next step.
Send the first message
Sending a message requires one extra header: Idempotency-Key, with a fresh value (a UUID works well) for each distinct send.
curl -X POST https://crprohub.com/api/v1/channels/CHANNEL_UUID/messages \
-H "Authorization: Bearer hub_pk_EXEMPLO_NAO_REAL" \
-H "Idempotency-Key: 4a50df76-d6c5-49f3-90a4-13907579d924" \
-H "Content-Type: application/json" \
-d '{"to":"5521999999999","type":"text","text":{"body":"Olá"}}'{
"data": {
"message_id": "wamid.EXEMPLO123",
"status": "accepted"
}
}Repeating the same Idempotency-Key with the same body returns the result of the first call instead of sending the message twice — it is safe to retry the request after a timeout or a network failure without risking a duplicate send. The response is 202: the message was accepted and queued for Meta, not yet delivered.
Receive the reply
The final state of the send — delivered, read, failed — and any message the customer replies with arrive asynchronously, over a webhook. Configure an endpoint to receive them on the webhooks page.
hub_ch_...) also authenticates message sending, as an alternative to the API key. It is valid only for the channel that issued it and never authorizes sending through another channel of the organization.