🌐 API Block
The API Block is one of the most powerful and flexible tools available on the indigo.ai platform. It allows you to connect your virtual assistant with external systems—such as CRMs, ERPs, e-commerce platforms, or internal databases—by sending and receiving real-time data via standard API calls.

This block plays a key role in enabling dynamic, data-driven responses and automating complex business workflows within your assistant.
Here are a few examples of what you can achieve with the API Block:
Fetch product availability from your e-commerce system
Retrieve user information from your CRM
Create a support ticket in your helpdesk platform
Check appointment availability in your calendar system
Validate discount codes or vouchers in real time.
Block Layout and Key Components
Here’s a breakdown of the API Block interface and what each section does:
1. Method and URL
At the top of the block, you can define:
The HTTP method, i.e. the type of action you want to perform:
GET – Retrieves data from an external system. Use this to fetch information like user details, order status, or product availability.
POST – Sends new data to an external system. Use this to create a new record, such as submitting a contact form, placing an order, or opening a support ticket.
PUT – Updates an existing record with new data. Use when you want to replace an entire object or resource (e.g., updating a user profile).
PATCH – Modifies part of an existing record. Ideal for partial updates, such as changing only the user's email or status.
DELETE – Removes a record from an external system. Use when you need to delete items like a user entry, ticket, or product.
COPY – Duplicates an existing resource. Rarely used, but useful in cases where cloning objects is supported by the API.
HEAD – Retrieves headers (metadata) without the response body. Typically used for quick checks, such as verifying if a resource exists.
OPTIONS – Returns allowed methods and CORS settings for an endpoint. Primarily used in API testing and setup.

The URL of the API endpoint. You can insert the url directly, or insert a variable containing the URL endpoint.

2. Headers and Body

This section is where you define the format and structure of your API request. It includes:
Use JSON Editor (Optional)
If your request body is in JSON format, you can activate the "Use JSON editor" checkbox to enter your payload directly in a structured way. Otherwise, you can type it manually into the Body field below.
Body Field
This is where you write the request body (typically required for POST
, PUT
, or PATCH
requests). If you're sending data to an external system—for example, submitting a form or updating a record—this is where you define the content to be sent.
Headers
Use headers to define metadata or authorization info for your request. Common headers include:
Content-Type
: Usually set toapplication/json
to indicate the body format.Authorization
: Used for passing tokens or API keys.
Each header field has two parts: Key (e.g., content-type
, authorization
) and Value (e.g., application/json
, Bearer your-token-here
).
4. Capture Variables
This section allows you to extract and store values from the API response into predefined variables. You simply:
Choose the variable you want to populate
Specify the key from the response JSON (e.g.,
order_status
,user_id
, etc.) This makes the returned data usable in the next steps of your flow.

5. Success and Error Paths
At the bottom, configure what happens next based on the outcome of the API call:
Success: Use the dropdown next to “Success” to choose where to route the conversation when the API request returns a successful response. You can connect this to an agent or workflow in your workspace.
Error: Define fallback actions if the API call fails (e.g., showing an error message, rerouting the conversation). If you don’t specify a connection here, the assistant will automatically show a default error message: “Something went wrong, try again.”
If you don’t define either a success or error path, the flow will simply continue with the next block in the workflow.

"Send request" Button

The Send request button allows you to test the API call directly from the platform while you're configuring the block. This is especially useful for checking whether:
The endpoint URL is correct
The headers and body are properly formatted
The request returns the expected response.

Best Practices
Always test your calls in the preview environment first to make sure data is being retrieved and stored correctly
Use secrets for sensitive keys to keep your configuration secure
Check error paths to ensure users are guided properly in case something goes wrong.
📊 API Integration with a Google Sheet
We provide an internal API that allows you to run SQL queries on a Google Sheet, managing access via Google authorization. This is especially useful when your assistant needs to access structured data stored in spreadsheets, like product lists, contact directories, or configuration tables.
It’s also a common and effective way to connect your Knowledge Base to the platform using real-time data.
You can choose between:
Public Google Sheets (shared via link with anyone)
Private Google Sheets, accessed securely via a Google Service Account

The integration supports parameters such as:
spreadsheet_url
: the full URL of the Google Sheetsheet_name
: the specific sheet tab to querysql_query
: the SQL-style query to run on the spreadsheet dataclient_email
andprivate_key
: credentials for accessing private sheets through a Google Service Account (added securely using the Secret feature).
Last updated
Was this helpful?