API Tool in AI Agent

Updated 

API Tools enable an AI Agent to interact with external systems by sending input data and receiving structured responses. This allows the AI Agent to fetch real‑time information, automate actions, and deliver personalized responses during customer conversations.

To use an API Tool effectively, you must configure connectivity details, input mappings, and response handling.

Steps to Configure API Tool

Follow the steps below to configure the Update Properties Tool in AI Agent Studio:

1. Access the API Tool

  • Navigate to AI Agent Studio from the Sprinklr Launchpad.

  • Select the AI Agent you want to configure.

  • Expand the Build section and open Tools.

  • Click + Add Tool and select API Tool from the list.

2. Configure Overview

  • Name: Enter a descriptive name for the API Tool. This helps identify the tool when configuring or troubleshooting.

  • Description: Provide a brief description of the tool’s purpose or functionality. For example: “Fetch customer details from CRM.”

3. Configure Setup Function

This section includes additional settings required to configure your API function. It ensures proper integration with the selected API.

  • API Type: Choose the type of API you want to use:

  • Parsed API: For REST APIs or APIs returning structured JSON responses.

  • SOAP API: Use this option for APIs that follow the SOAP protocol.

  • API: Select the API that is already configured in your Sprinklr environment.

    SOAP API Support

    AI Agent Builder supports SOAP‑based API calls, enabling integration with legacy or enterprise systems that rely on SOAP services. This expands the platform’s connectivity options and provides greater flexibility for workflow and task automation.

  • When SOAP API is selected:

    • The API Endpoint field is automatically disabled.

    • Endpoint selection is handled through WSDL definitions, which define the structure and operations of SOAP services.

    This behavior reflects the architectural requirements of SOAP APIs and ensures correct request processing.

4. Configure Setup Input

Configure the input settings for the selected API. These define what data is sent in the API request.

Input Variables

Define variables that will hold the values sent to the API.

  • API Input: Specify the input to send to the API for each input parameter.

  • Select Value: Choose the source of the input value

Inputs from LLM

The AI Agent extracts the value dynamically from the conversation context using the language model.

  • API Input: Specify the input that AI Agent extracts from the conversation.

  • Mandatory: Indicate whether the input parameter is required:

  • Yes: The API call will fail if this input is missing.

  • No: The API call can proceed without this input.

5. Configure Setup Output

Configure how the API response is handled and mapped for use by the AI Agent.

  • Output Variable: Enter the variable name that will store the API response.

  • Error Variable: Define a variable to capture error messages or codes if the API call fails.

  • Adapt response before sending (Toggle): Enable this option if you want to transform or adapt the API response before using it in the conversation.

    • Adapt Response: Write Groovy code to parse, update, or format API responses and store the result in an Adapted Response Variable for later use. The modified output is what gets published. Groovy code should be written inside ${}.

    • Adapted Result Variable: Enter the variable name that will store the adapted response.

  • Click the Save button in the bottom right corner to add the API tool to your AI Agent.

The API Tool makes it easy for your AI Agent to connect with other applications and share information. With this feature, you can:

  • Get real-time data from systems like CRM or ERP so your team always has the latest information.

  • Update order details or customer records during a conversation, saving time and reducing manual work.

  • Check inputs before moving forward to make sure the information is correct and avoid mistakes.

These capabilities help simplify processes, improve customer service, and make everyday tasks faster and more accurate.