In this section, we present how to connect any REST API to MindsDB using bearer-token authentication. The REST API handler is a generic integration that lets you forward HTTP requests to any API through MindsDB using stored credentials. Unlike named integrations (HubSpot, Shopify, etc.), it requires no handler-specific knowledge — just a base URL and a bearer token. This is useful for APIs that MindsDB doesn’t have a dedicated handler for, or when you only need direct HTTP access without SQL table mapping.Documentation Index
Fetch the complete documentation index at: https://docs.mindsdb.com/llms.txt
Use this file to discover all available pages before exploring further.
Connection
The required arguments to establish a connection are as follows:base_url: the base URL of the REST API (e.g.https://api.example.com). All request paths are appended to this URL.bearer_token: the token used for authentication. Injected asAuthorization: Bearer <token>on every request.
default_headers: a JSON object of static headers added to every request (e.g.{"Accept": "application/json"}).allowed_hosts: a list of allowed hostnames for requests. Defaults to the hostname ofbase_url. Use["*"]to disable host containment.test_path: the path used by the test endpoint to verify connectivity. Defaults to/.
Example: Connect to HubSpot
Example: Connect with default headers and a custom test path
Example: Multiple allowed hosts
Usage
This handler is passthrough-only — it does not expose SQL tables. All interaction is through the REST passthrough endpoint.Sending requests
Forward HTTP requests to the upstream API:GET, POST, PUT, PATCH, DELETE.
Testing the connection
Verify that the base URL, token, and host allowlist are configured correctly:Security
- Credentials are stored in MindsDB and never exposed to the caller.
- Requests are restricted to hostnames in the allowlist. Private and loopback IP addresses are rejected by default.
- Callers cannot override
Authorization,Host,Cookie, orProxy-*headers. - If the upstream API echoes the token in responses, it is replaced with
[REDACTED_API_KEY]. - Request bodies are capped at 1 MB, response bodies at 10 MB.
For more information about available actions and development plans, visit this page.