> ## Documentation Index
> Fetch the complete documentation index at: https://docs.klatt.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Pre-call data fetch

> Fetch a small JSON context object before a call so the opening prompt can use current information.

Fetch a small JSON context object before a call so the opening prompt can use current information.

## Prerequisites

* A service that accepts a POST request and returns JSON.
* A managed credential if the service requires authentication.

## Configure the request

1. Open **Start Call** and enable **Pre-Call Data Fetch**.
2. Enter the service URL and choose optional authentication.
3. Return an `initial_context` object from the service.
4. Reference returned values in the greeting or opening prompt with template variables.
5. Test a success response, an error response, and a timeout before publishing.

## Request and variable mapping

Klatt sends a call-inbound event with the caller and called numbers. The JSON object under `initial_context` is merged into the call context and becomes available to templates.

## Constraints and failure states

The request has a 10-second timeout. URL validation, network errors, non-success responses, invalid JSON, an invalid shape, or unsupported dynamic-variable fields produce no pre-call variables; the call does not receive guessed values.

## Protect your data

Use HTTPS and a credential scoped only to the lookup. Do not return secrets or an entire customer record; return the few fields needed by the opening turn.

## Related

* [Start Call node](/voice-agent/start-call)
* [Template variables](/voice-agent/template-variables)
* [HTTP tool](/voice-agent/tools/http-api)


## Related topics

- [Start Call node](/voice-agent/start-call.md)
- [Template variables](/voice-agent/template-variables.md)
- [Context and variables](/core-concepts/context-and-variables.md)
- [Pre-recorded audio](/voice-agent/pre-recorded-audio.md)
- [Tracing configuration](/configurations/tracing.md)
