Custom REST API

Managed auth required

Any HTTP endpoint

BotChap connects your website chat widget to any HTTP endpoint. Configure the method (POST or GET), custom request headers, a body template with message and session tokens, and a dot-notation path to extract the reply from the response.

Use {{message}} and {{sessionId}} as tokens in your body template. These are substituted before the request is sent.
The response path uses dot notation. For example, choices.0.message.content would work for an OpenAI-compatible response.

Why use this integration

Use this integration when you have your own chat platform, in-house assistant, or any SaaS backend that accepts HTTP requests. This is the most flexible integration, it works with any API that can return a chat reply in JSON.

How it works

  1. 1
    Visitor sends a message in the BotChap widget
  2. 2
    BotChap widget sends the message to the BotChap server proxy
  3. 3
    The server sends a request to your endpoint using your configured method and headers
  4. 4
    BotChap replaces {{message}} and {{sessionId}} in your body template before sending
  5. 5
    BotChap reads the reply using your dot-notation response path

Required fields

Endpoint URL
The full URL of your chat endpoint.
Method
POST (default) or GET.
Custom Headers (optional)
Any key/value pairs to include in the request (e.g. Authorization, X-API-Key).
Body Template
A JSON string with {{message}} and {{sessionId}} placeholders. Default: {"message":"{{message}}"}.
Response Path
Dot-notation path to the reply field in your JSON response (e.g. data.reply or choices.0.message.content).

What BotChap sends

BotChap renders your body template with the visitor's message and session ID:

Template:  {"message":"{{message}}","sessionId":"{{sessionId}}"}
Rendered:  {"message":"I need help choosing a plan","sessionId":"bc_7f3a9d"}

Both {{message}} and {{sessionId}} are supported as template tokens.

Sample request

POST https://your-api.com/chat
Authorization: Bearer <your-api-key>
X-Custom-Header: value
Content-Type: application/json

{
  "message": "I need help choosing a plan",
  "sessionId": "bc_7f3a9d"
}

Sample response

{
  "data": {
    "reply": "I can help. Do you want a widget for n8n, OpenAI, or a custom backend?"
  }
}
# Set Response Path to: data.reply

Best use cases

  • Proprietary in-house AI backends
  • SaaS products with a chat API
  • Any backend that doesn't have a dedicated BotChap integration
  • Rapid prototyping with any HTTP service

Frequently asked questions

Can I use GET requests?
Yes. Set method to GET. The body template is not sent for GET requests, pass parameters via the URL itself.
How does the response path work?
It splits on dots and traverses the JSON object. For example, data.reply would read response["data"]["reply"].
Can I add authentication headers?
Yes. Add any header key/value pairs in the Custom Headers section. Common choices are Authorization: Bearer <token> or X-API-Key: <key>.

Related integrations

Ready to connect Custom REST API to BotChap?

Create a free widget, configure the integration, and embed it on your site in minutes.

View all integrations