The Request block makes an API call. You can save all or part of the response as a variable so you can serve the content in text blocks, or use the response to populate a list of options in the List Option block.
The Request block also supports triggering custom handoff integrations via the Handoffs API. When configured as a handoff trigger, the block calls your integration’s endpoint and automatically manages the conversation’s handoff state.
The Request block can initiate a handoff to an external live agent platform or internal system. When the handoff options are enabled, the block handles handoff state management automatically:
When using the Request block as a handoff trigger, place it inside a Handoff flow. Do not use it directly in a Playbook or Action. Starting a handoff outside of a Handoff flow can cause unexpected behavior, including the AI Agent responding during an active handoff.
To configure the Request block as a handoff trigger:
Add a Request block to your handoff flow.
Set the Method to the HTTP method your integration expects (for example, POST).
Enter your integration’s endpoint URL in the URL field (for example, https://your-integration.example.com/webhooks/start-handoff).
Under Body Content, pass the data your integration needs to start the handoff. At minimum, include the conversation ID:
You can also pass additional context such as end user ID, custom metadata, or routing information.
Enable the Track as Handoff option. This tells the AI Agent to enter a handoff state when the request succeeds.
Enable the Pause conversation here until handoff ends option. This prevents the AI Agent from responding while the handoff is active.
Set the Handoff integration label to a unique identifier for your integration (for example, my-custom-handoff). This value appears as the handoff_integration field on the conversation and in webhook events. Use it to filter webhook deliveries via Svix Channels so each integration only receives its own events.
For a complete working example, see the ada-handoffs-api-demo repository. For a full end-to-end walkthrough of building a custom handoff integration, see the Creating a custom handoff developer guide.
The Request block has the following constraints when processing API responses:
Set up an API call and save all or part of the response as variables for use in other blocks.
To configure the Request block:
Enter the API address in the URL field.
Select your request type from the Method list.
If required, use the Headers fields to pass metadata, like public access tokens, content type, and language.
Example:
If required, fill out the Body Content fields to pass details or instructions to the API server. Make sure you accurately define the content type (string, number, list, etc.).
Click Test Request to send a sample API call and see the response body that comes back.
Under Error fallback, you can click to edit the AI Agent’s response if an error occurs and it can’t complete the call successfully.
Under Save As Variable, save all or a portion of the response body in one or more variables for use in other blocks.
The easiest way to save a particular attribute is to click a blue tag with a ”+” icon in the response body to automatically save that attribute as a variable. You can select or create a variable to save that value in, and the Data Key field automatically populates.
For more complex use cases, you may have to type in a data key yourself, so you can target a particular attribute or array in the response. For more information, see Data keys.
To add an additional variable, you can either click another tag in the response body, or click the green ”+” icon by the Save As Variable fields.
Data keys are a way to tell your AI Agent to target a portion of the API request so you can save it as a variable. There is a variety of ways to do this, depending on your end goal. If you need any assistance, don’t hesitate to contact your Ada team.
Ada uses different types of notation to target different parts of the response:
To save the entire API response in a variable, use the ada_response_string data key.
To target a specific attribute or array, enter its name exactly as it appears in the API.
Here’s a portion of a response from the Studio Ghibli API, which contains information about Princess Mononoke:
To save the movie title as a variable, use the data key title. Note that the key has to exactly match what’s in the API response, so the data key Title wouldn’t work.
If the API request returns an array, you can save the whole array as a variable as well. For example, here’s a heavily truncated response from the Star Wars API, which contains a list of the Star Wars movies:
In this case, you could use the results data key to save an array containing information about all of the movies in your variable.
You can use dot or bracket notation to target either arrays or attributes nested in other arrays or attributes.
Any of these notations would get your AI Agent to look for an attribute called parent and save either an array or attribute within it called child:
parent.childparent[child]"parent"["child"]
'parent'['child']), the data key won’t work.If you’re looking for something nested inside an array, you can target a particular instance based on its order in the API response. Note that this numbering starts at 0, not at 1, and that these numbers must be in brackets.
For example, with this notation, your AI Agent would look for the first item in the array called parent, find the array within it called child, and save the second item within the child array:
parent[0].child[1][parent][0][child][1]["parent"][0]["child"][1]This method assumes that responses in the API will always be in the same order. Remember to test your API request with a variety of scenarios to ensure your data key correctly selects the attribute you’re looking for. If you find that the order of items in your API response varies between calls, contact your Ada team to find a solution.
Here’s another example from the Star Wars API, this time with a list of species that appear in the movies:
“Human” is the first item in the list of Star Wars species in the results array, so to target a piece of information that pertains to human characters, start the data key with results[0]. From there, target more specific information:
name attribute of the species, use the data key results[0].name.results[0].films.results[0].films[3].