Datatape
Sources

HTTP API

Connect an HTTP API as a source for your Datatape tools.

HTTP API source

HTTP sources let you connect REST APIs so your AI agents can fetch data from external services — CRMs, payment platforms, internal APIs, and more.

HTTP source connection form

Connection fields

FieldRequiredDefaultDescription
Base URLYesThe root URL for API requests (e.g., https://api.example.com/v1)
Auth MethodYesNoneAuthentication method (see below)
Default HeadersNoHeaders sent with every request (e.g., Accept: application/json)
TimeoutNo30sRequest timeout in seconds
Base URL:     https://api.example.com/v1
Auth Method:  Bearer Token
Timeout:      30s

Authentication methods

None

No authentication. Use for public APIs or APIs behind a VPN.

API Key

Send an API key in a request header.

FieldDescription
Header NameThe header that carries the key (e.g., X-API-Key, Authorization)
API KeyThe key value
Header Name:  X-API-Key
API Key:      sk_live_abc123...

Bearer Token

Send a static bearer token in the Authorization header.

FieldDescription
TokenThe bearer token value

Datatape sends: Authorization: Bearer <token>

OAuth2 Client Credentials

Datatape obtains an access token automatically using the client credentials grant and refreshes it when it expires.

FieldDescription
Client IDOAuth2 client identifier
Client SecretOAuth2 client secret
Token URLThe authorization server's token endpoint
ScopeSpace-separated list of scopes (optional)
Client ID:      datatape-client
Client Secret:  ••••••••
Token URL:      https://auth.example.com/oauth/token
Scope:          read:data

Datatape caches the access token and refreshes it before expiry. You do not need to handle token rotation manually.

Default headers

Add headers that should be sent with every request. Common uses:

Accept: application/json
X-Api-Version: 2024-01-01

These headers are merged with any per-tool headers. Per-tool headers take precedence if there is a conflict.

Timeout configuration

Set the timeout to match your API's expected response time:

TimeoutUse case
5sFast internal APIs
30sDefault. Suitable for most external APIs.
60sSlow APIs, report generation endpoints

AI clients typically have their own timeout for MCP tool calls (often 30-60 seconds). If your HTTP source timeout is longer than the client timeout, the call may be cancelled before the API responds.

Writing tools for HTTP sources

HTTP source tools use a different template syntax than SQL sources. You define the request path, method, and body:

GET /customers/{{ customer_id }}
POST /reports
Content-Type: application/json

{
  "start_date": "{{ start_date }}",
  "end_date": "{{ end_date }}"
}

Common connection issues

SymptomLikely causeFix
Connection refusedAPI not reachable from DatatapeCheck that the API is publicly accessible or allowlist Datatape IPs
401 UnauthorizedInvalid or expired credentialsVerify API key, token, or OAuth2 client credentials
403 ForbiddenInsufficient permissionsCheck API permissions or scopes
TimeoutAPI too slow or unreachableIncrease the timeout value or check API health
SSL certificate errorSelf-signed or expired certificateUse a valid TLS certificate

Testing the connection

Click Test connection before saving. Datatape sends a GET request to the base URL and verifies a successful response.

Source row showing a green 'Connected' badge after a successful test

Security notes

  • All credentials (API keys, tokens, client secrets) are encrypted at rest with Fernet
  • Credentials are never returned in API responses or exposed to AI agents
  • All HTTP source requests use HTTPS. Plain HTTP URLs are rejected.

On this page