---
title: "Typebot"
description: "Bring APIBrasil into Typebot through HTTP Request blocks and build conversational bots that validate CPF, CNPJ, postcodes and more."
lang: en
canonical: https://doc.apibrasil.io/mcp/chatbots/typebot
markdown: https://doc.apibrasil.io/mcp/chatbots/typebot.md
source: apibrasil-documentation
---

# Typebot

> Bring APIBrasil into Typebot through HTTP Request blocks and build conversational bots that validate CPF, CNPJ, postcodes and more.

- **Category:** Chatbots
- **Difficulty:** Easy
- **Protocol:** calls the REST gateway over HTTP
- **Updated on:** January 14, 2026

## Prerequisites

- A Typebot account (cloud or self-hosted)
- Basic knowledge of Typebot flows
- APIBrasil tokens

## Configuration

- **File:** `HTTP Request Block Config`

```json
{
  "method": "POST",
  "url": "https://gateway.apibrasil.io/api/v2/cep/cep",
  "headers": [
    {
      "key": "Authorization",
      "value": "Bearer {{secrets.APIBRASIL_BEARER}}"
    },
    {
      "key": "DeviceToken",
      "value": "{{secrets.APIBRASIL_DEVICE}}"
    },
    {
      "key": "Content-Type",
      "value": "application/json"
    }
  ],
  "body": {
    "cep": "{{variables.cep}}"
  }
}
```

## Step by step

1. **Create an environment variable** — In Typebot, go to Settings > Environment Variables and add your APIBrasil tokens as secrets
2. **Add an HTTP Request block** — In your flow, drag an 'HTTP Request' block to where the look-up belongs
3. **Set the method and URL** — Set the method to POST and the URL to gateway.apibrasil.io/api/v2/[endpoint]
   ```text
   Method: POST
   URL: https://gateway.apibrasil.io/api/v2/cep/cep
   ```
4. **Add the headers** — Set the authentication headers using the secrets you created
   ```text
   Authorization: Bearer {{secrets.APIBRASIL_BEARER}}
   DeviceToken: {{secrets.APIBRASIL_DEVICE}}
   Content-Type: application/json
   ```
5. **Fill the body** — Pass the parameters the API needs, using Typebot variables
   ```json
   {
     "cep": "{{variables.cep}}"
   }
   ```
6. **Save the response into a variable** — Set the block to save the response into a variable for use later in the flow
7. **Handle the response** — Use text or condition blocks to show the returned data to the person

## Troubleshooting

- **The secrets are not being substituted** — Check the syntax: it is {{secrets.SECRET_NAME}}, not {{variables.name}}
- **401 on the request** — Try the tokens directly in Postman or cURL to confirm they are still valid
- **The body never arrives** — Make sure Content-Type is set to application/json in the headers
- **The variable comes back undefined** — Check that 'Save response in variable' is set on the HTTP Request block

## Related links

- [Official Typebot documentation](https://docs.typebot.io)
- [The APIBrasil REST API](https://doc.apibrasil.io/apis.md)
- [Typebot templates](https://doc.apibrasil.io/mcp/exemplos/typebot.md)
- [Other chatbot platforms](https://doc.apibrasil.io/mcp/chatbots.md)

## See also

- MCP guide: [MCP guide](https://doc.apibrasil.io/mcp.md)
- Documentation index: https://doc.apibrasil.io/llms.txt
- HTML version of this page: https://doc.apibrasil.io/mcp/chatbots/typebot
