> ## Documentation Index
> Fetch the complete documentation index at: https://docs.shortext.ny-corp.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Tools Configuration & Testing

> Learn how to connect, configure, and test APIs within your Shortext agents to extend their capabilities.

Shortext Agents can interact with external systems through APIs — allowing them to fetch data, trigger workflows, or update other applications automatically.

This section explains how to configure and test these API integrations step by step.

***

## 🔧 Step 1 — Access the API Settings

From your **Agent Configuration** page, open the **“Tools”** tab.

<img src="https://mintcdn.com/n-ycorp/eGZgFSc-EgHohQwS/images/agents/api-tab.png?fit=max&auto=format&n=eGZgFSc-EgHohQwS&q=85&s=5f8d385c3b90a6c6d8e8fb409a57bab6" alt="Agent API configuration tab" width="2440" height="1205" data-path="images/agents/api-tab.png" />

Each agent can have one or more API connections depending on your workflow.

***

## 🧩 Step 2 — Add a New Tool

Click **“New Tool”** to define a new connection.

<img src="https://mintcdn.com/n-ycorp/eGZgFSc-EgHohQwS/images/agents/add-api.png?fit=max&auto=format&n=eGZgFSc-EgHohQwS&q=85&s=82092e88affcfa5e7d7b57e467a3e1c6" alt="Adding a new API configuration" width="1786" height="496" data-path="images/agents/add-api.png" />

You’ll need to provide:

* **Name** — a friendly *unique* name in camelcase (e.g., `payment_confirmation` or `get_orders`)
* **State** — if the tool can be use or not by the agent (e.g `disable when the api is under maintenance`)
* **Description** — note about what the API does to allow agent to understand when to use it

Example of description:

```md theme={null}
This API provides data on the movies and TV shows available on Netflix, a popular streaming service.
```

***

## ⚙️ Step 3 — Define Endpoint and headers

Set the **endpoints** that will be used to consume your service and the required **headers** such as token, api key.

<img src="https://mintcdn.com/n-ycorp/eGZgFSc-EgHohQwS/images/agents/api-endpoints.png?fit=max&auto=format&n=eGZgFSc-EgHohQwS&q=85&s=955f2b606afc2b939c11c75e16d1c3a9" alt="Defining API endpoints" width="1782" height="930" data-path="images/agents/api-endpoints.png" />

<Note type="info">
  Sensitive data such as tokens or API keys are encrypted and stored securely.
</Note>

Each endpoint includes:

* **Method** — `GET`, `POST`, `PUT`, `DELETE`, etc.
* **Url** — the full URL of your service (e.g., `https://acme.com/users/{id}`)
* **Headers** — optional (for content type, authentication)

<Note type="tip">
  You can use **variables** like `{phone}` or `{email}` in your paths.
  These will be replaced dynamically from the user’s conversation context.
</Note>

***

## ⚙️ Step 3 — Define Request Body

**Request Body** — JSON or form data (for POST/PUT requests)

<img src="https://mintcdn.com/n-ycorp/eGZgFSc-EgHohQwS/images/agents/api-body.png?fit=max&auto=format&n=eGZgFSc-EgHohQwS&q=85&s=504dba19c924500af06c1a4bcccf8f3d" alt="Defining API endpoints" width="1704" height="796" data-path="images/agents/api-body.png" />

Each parameter includes:

* **Name** — a friendly *unique* name (e.g., `order_id` or `id`).
* **Type** — the parameter type `STRING`, `INTEGER`, `BOOLEAN`. in case of `STRING`: possible values can be defined
* **Mandatory** — if it should be set always present or not
* **Description** — note about what the parameter does to allow agent to understand how to fill it

**Response Mapping** — always return response that has a clear meaning in JSON or plain text

Example:

```json theme={null}
{
  "success": true,
  "message": "The balance has been refresh successfully",
  "body": {
  "balance": {
    "amount": 634.1987,
    "currency": "EUR"
  },
  "local_balance": {
    "amount": 416618.8856,
    "currency": "XAF"
    }
  }
}
```

***

## 🧠 Step 4 — Usage of the API Inside an Agent

Once your API is configured and enabled, you can make it **callable** from your agent’s workflow or rules.

<img src="https://mintlify.s3.us-west-1.amazonaws.com/n-ycorp/images/api/api-call-example.png" alt="Example of an agent using an API" />

Example:
When a user says *“Check my application status”*, your agent can call:

```json theme={null}
{
  "action": "api.call",
  "api": "RecruitmentService",
  "endpoint": "application_status",
  "params": {
    "phone": "{{user.phone}}"
  }
}
```

<Note type="success">
  You can define conditions so that API calls are triggered only when specific user intents are detected.
</Note>

***

## 🧪 Step 5 — Test the API Connection

Shortext provides a built-in **API Tester** so you can validate your setup before deploying it.

<img src="https://mintcdn.com/n-ycorp/eGZgFSc-EgHohQwS/images/agents/api-tester.png?fit=max&auto=format&n=eGZgFSc-EgHohQwS&q=85&s=59c672d01b864aef27b8bf15ba7469ff" alt="API testing interface" width="2052" height="2338" data-path="images/agents/api-tester.png" />

To test:

1. Click on **Debug** on the endpoint you configured.
2. Provide any **parameters or payload** required.
3. Click **“Run Test”**.
4. View the **response logs** and status code.

<Note type="info">
  All test requests are logged for debugging. You can re-run tests as often as needed without affecting your live agents.
</Note>

***

## 🧭 Step 6 — Monitor API Usage

After deployment, you can track how often your agents call APIs via the **API Usage Log**.

<img src="https://mintcdn.com/n-ycorp/eGZgFSc-EgHohQwS/images/agents/api-logs.png?fit=max&auto=format&n=eGZgFSc-EgHohQwS&q=85&s=1d5afb0d145172b69f6d61eeccf2b23b" alt="API usage logs and monitoring" width="2440" height="2000" data-path="images/agents/api-logs.png" />

You’ll see:

* **Timestamps** of API calls
* **Response time and status**
* **Agent and user** who triggered the call
* **Error messages** (if any)

<Note type="warning">
  Frequent or failed API calls may impact performance. Monitor this section to ensure stability.
</Note>

***

## 🧰 Example Use Cases

Here are a few examples of how API connections can enhance your agents:

| Use Case                 | Description                              | Example API             |
| ------------------------ | ---------------------------------------- | ----------------------- |
| **CRM Lookup**           | Fetch user info based on phone number    | `GET /users/{phone}`    |
| **Order Tracking**       | Retrieve delivery updates                | `GET /orders/{id}`      |
| **Payment Confirmation** | Validate or trigger a transaction        | `POST /payments/verify` |
| **Ticket Creation**      | Send a complaint or issue to your system | `POST /tickets/create`  |

***

## 🚀 Next Steps

Now that you’ve connected your APIs, you can:

* [Build Automations That Use API Data →](/automations/creating-automation)
* [Test Conversations with Live API Calls →](/agents/testing-conversation)
* [View API Analytics and Logs →](/api/logs)

***

<Note type="success">
  Shortext APIs give your agents the power to act — not just respond.
  With proper configuration, your bot can become a true workflow engine for your business.
</Note>
