⚙️ Custom API
Custom API action allows your AI Assistant to connect directly to external APIs and perform real operations — such as sending data, retrieving information, or updating records.
You can use this action to integrate your assistant with CRMs, databases, dashboards, or any other API-based system.
🧩 Basic Parameters
Each action, including Custom API, has three main parameters:
| Parameter | Description |
|---|---|
| Action Name | The name of your action, shown inside the dashboard. |
| When To Use | A short description that helps the AI decide when to use this action. |
| Enabled | Whether the action is active or disabled. |

🌐 API Configuration
Below the basic parameters, you’ll find additional API-specific fields.
| Parameter | Description |
|---|---|
| Request Method | Choose the HTTP method: GET, POST, PUT, PATCH, or DELETE. |
| Endpoint URL | The full URL of your API endpoint (e.g. https://yourdomain.com/api/v1/data). |

🔐 Authorization
If your API requires authentication, you can configure it inside the Authorization tab.
| Field | Description |
|---|---|
| Authorization Type | Choose between None or Custom. |
| Header Name | Authorization or custom header key used for your token or API key (e.g. X-API-Key). |
| API Key | The value of your API key. It will be securely encrypted in Ainisa. |
You can also remove or update authorization later.

🧾 Headers
Headers can be added manually in the Headers tab.
By default, Ainisa automatically includes these 5 headers in all API requests:
| Header Key | Description |
|---|---|
Origin | The Ainisa app origin (https://ainisa.com/). |
Locale | The visitor’s language code (e.g. az, en, ru, etc.). |
Content-Type | Default: application/json. |
X-Requested-With | Default: XMLHttpRequest. |
X-User-Id, X-User-Hash | Auth headers representing the current visitor session. X-User-Id and X-User-Hash are the ones in your platform, NOT ainisa.com |
You can add more headers manually if needed.

🔍 Query Parameters
In the Query Parameters tab, you can define parameters that will be appended to your URL — usually for GET requests.
Each parameter requires:
- Key
- Value
Example:
https://api.example.com/data?user_id=123&lang=en

🧠 Body Parameters
For POST, PUT, and PATCH requests, you can define request body parameters.
Each body parameter includes:
| Field | Description |
|---|---|
| Input Key | The parameter name (letters, numbers, _, or -). |
| Input Type | Type of the parameter (text, number, boolean, etc.). |
| Description | A short explanation for the AI (helps it fill parameters properly). |
| Is Array | Enable if the parameter is an array (multiple values). |
🧩 Note:
The first 3 body parameters (user_email,user_id,user_hash) are automatically sent in all POST, PUT, PATCH requests by default. They are your users parameters in your platform,NOT ainisa.com

🧪 Testing the API
After you’ve configured all fields, you can test the API before saving.
- Click Test Before Saving to send a sample request.
- Ainisa will display the response (status, body, and headers) to help you confirm everything works.
- If the test is successful, click Save.
✅ Summary
| Step | Action |
|---|---|
| 1 | Add action name, usage, and enable it |
| 2 | Choose API method and endpoint |
| 3 | Configure authorization if needed |
| 4 | Add headers, query, and body parameters |
| 5 | Test API connection |
| 6 | Save and use inside your AI Assistant |
💡 Example Use Cases
- Fetch live data (e.g. weather, crypto prices, or inventory)
- Create leads or send contact form data to CRM
- Update user status or purchase record
- Trigger actions in your internal API