How to access context variables from the inbound webhook in API calls during and after conversations

Last updated: December 3, 2025

When you need to pass context data (such as call IDs) in API calls made through tools during a conversation, you can access context variables given to fonio in the inbound webhook using a specific syntax.

Accessing Context Variables

If you have data passed through an inbound webhook, you can access it in your API calls and post-call API processing using the following format:

  • Data passed via inbound webhook as {{id}} can be accessed in post-processing with {{context.id}}

Example Use Case

For instance, if you're sending a call ID through your inbound webhook and want to include it in dynamic parameters of an API call during the conversation:

  1. Pass the ID through your inbound webhook using {{id}}

  2. In your API call's dynamic parameters, reference it as {{context.id}}

This allows you to maintain the connection between your system-generated IDs and the API calls made during the conversation, ensuring proper tracking and data flow between systems.