# HTTP API in ZazzyAgent | Complete Guide to External API Automation

An HTTP API connection lets ZazzyAgent communicate with another application.

This becomes useful when your chatbot needs information that isn't stored inside ZazzyAgent.

Examples:

*   Product information
    
*   Order information
    
*   Customer records
    
*   Pricing
    
*   Availability
    
*   CRM data
    
*   Booking information
    
*   Internal business systems
    

## Why use an HTTP API?

Imagine a customer asks:

> Do you have the blue version of this product in stock?

If your chatbot only knows the product information stored in its knowledge base, it may not know the current stock.

An API can request live information from your inventory system.

The process becomes:

**Customer asks**

↓

**ZazzyAgent calls API**

↓

**External system returns data**

↓

**ZazzyAgent uses response**

↓

**Customer receives answer**

The current automation system supports external API calls from flows and can use returned JSON data inside the conversation.

## API vs webhook

These are easiest to understand as two directions.

**API**

> ZazzyAgent asks another system for information.

**Webhook**

> Another system sends information to ZazzyAgent.

You may use both in the same automation.

## Create an API request

Open the HTTP API section or HTTP API element available in your ZazzyAgent workflow.

Choose the API request you want to use.

Depending on the configured request, you may work with:

*   GET
    
*   POST
    
*   Headers
    
*   Parameters
    
*   Request data
    
*   Response data
    

## GET requests

A GET request is commonly used when you want to retrieve information.

For example:

> Find product information.

The external system returns data.

## POST requests

A POST request is commonly used when you want to send data to another system.

For example:

> Create a lead.

or:

> Submit a callback request.

The actual behavior depends on the API you're connecting.

## API authentication

Some APIs require authentication.

The API may expect something such as:

*   API key
    
*   Bearer token
    
*   Other authentication mechanism
    

Never expose secret credentials to customers.

Store credentials using the supported secure configuration rather than putting them into customer-facing messages.

## What is an API response?

The external application returns data after receiving the request.

A response may look conceptually like:

```json
{
  "status": "available",
  "price": 1999,
  "message": "Product is in stock"
}
```

Your workflow can then use those returned values.

## Use API data in a message

Suppose the API returns:

```text
status = available
price = 1999
```

Your automation can produce:

> Good news! This product is available for ₹1,999.

The customer sees a natural answer rather than raw JSON.

## Dynamic API data

One powerful use case is retrieving data dynamically.

Example:

Customer:

> Show me today's available products.

↓

API request

↓

Product database

↓

JSON response

↓

ZazzyAgent displays the relevant product options.

The platform supports using external API data to build dynamic interactive content such as product lists.

## API-based product recommendations

You can connect an external product system and retrieve relevant products based on the conversation.

Example:

Customer:

> I need running shoes under ₹5,000.

ZazzyAgent can use the relevant API to retrieve matching products.

The response can then be used to display products or continue the conversation.

## Use APIs with AI Agents

An AI Agent can also call a configured HTTP API action when its System Prompt tells it when to use that action.

Example:

```text
When the customer asks for the status of a support ticket,
use the support-status API.

Do not guess the ticket status.
```

Then configure the relevant HTTP API action.

## API actions can have three response modes

A configured HTTP API action can be instructed to:

### Reply with API response

```text
##call_http_api## : 5 | reply_with_response | status, message
```

The selected response fields can be used to create the customer-facing result.

### Reply with a static response

```text
##call_http_api## : 5 | reply_with_static_reply | Thank you! We received your request.
```

The API performs the operation and the customer receives the fixed confirmation.

### Don't reply

```text
##call_http_api## : 5 | no_reply
```

The API is called silently without an additional customer-facing response.

## Example: Create a callback request

Customer:

> Please have someone call me tomorrow.

AI Agent:

1.  Understands the request.
    
2.  Collects the necessary information.
    
3.  Calls the callback API.
    
4.  Receives the result.
    
5.  Sends a confirmation.
    

The API could create the request in your CRM.

## Example: Check appointment availability

Customer:

> Is Saturday available?

↓

API request

↓

Booking system

↓

Response:

> Saturday has availability at 11 AM and 3 PM.

↓

AI explains the available options.

## API errors

Not every request will succeed.

Possible problems include:

*   Invalid authentication
    
*   Invalid parameters
    
*   Missing fields
    
*   Server errors
    
*   Timeout
    
*   Unexpected response structure
    
*   Rate limits
    

Your automation should handle failures gracefully.

## Never let the AI invent API data

This rule belongs in the System Prompt.

Use:

> If the API fails, tell the customer that the information is temporarily unavailable. Do not guess the result.

Do not allow:

> API failed → AI guesses.

That is especially dangerous for:

*   Prices
    
*   Stock
    
*   Order status
    
*   Payment status
    
*   Booking availability
    

## API troubleshooting

### API request fails

Check:

*   URL
    
*   Method
    
*   Authentication
    
*   Parameters
    
*   Headers
    
*   Request body
    

### API works outside ZazzyAgent but not inside

Compare the exact request being sent.

Check whether the external system requires headers or parameters you haven't configured.

### Response comes back but data is empty

Inspect the returned JSON.

Make sure you're referencing the correct fields.

### Customer sees raw technical information

Transform the API response into a customer-friendly reply.

Don't expose raw JSON unless there is a genuine technical reason.

## When should you use an API?

Use HTTP API when your automation needs information or functionality that isn't available directly inside ZazzyAgent.

If the task can already be handled natively, a native feature may be simpler.

The best integrations often combine:

**AI**

→ understands customer intent

**API**

→ retrieves live information

**ZazzyAgent**

→ manages the conversation

That combination allows you to build much more capable automation.
