API request
Let the agent talk to external systems mid-call over HTTP.
An API request lets your agent pull data from another system during the call, or write it there: a ticket in your helpdesk, a lead in your CRM, an order status from your ERP.

How it works
Every enabled API request is offered to the language model as its own tool with typed parameters. The agent recognises the situation, collects the missing details in conversation, calls the API and works with whatever comes back.
Caller ──▶ Agent recognises the situation
Agent asks for missing details
Agent calls your API ──▶ your system
responds
Agent continues speaking ◀──You create one under Capabilities → Tools → API request → +, in a four-step wizard.
Step 1 — Basics
All three fields are required; the wizard will not advance without them.
| Field | Purpose |
|---|---|
| Tool name | Short name, e.g. Create ticket. This is what you reference in the prompt. |
| What does the tool do? | Its function and what it returns. |
| When should it be used? | The situation in which the agent should call it. |
The last two are concatenated into one description, and that is what the language model reads. It decides whether the tool gets called at all — so be concrete, not lengthy:
What does the tool do?
Creates a ticket for a general request — not an appointment,
not a transfer.
When should it be used?
Call it as soon as name and request have been captured in full.Non-ASCII characters in the name are fine
Internally the tool needs a technical name. ScaleTalk maps umlauts (ä→ae, ö→oe, ü→ue, ß→ss) and replaces any other invalid character with _. Create ticket becomes Create_ticket; Rückruf anfragen becomes Rueckruf_anfragen. In the prompt you use the name as you typed it.
Step 2 — API configuration
When should the API be called?
| Mode | Behaviour |
|---|---|
| Dynamic (default) | The agent decides mid-call when to call. For actions like creating a ticket or fetching data. |
| On call start | Runs once at the start, before the greeting is spoken. For CRM lookups that personalise the call. |
On call start is the same mechanism as caller context, which documents it in full, including the CSV variant that needs no API of your own. For that mode a timeout of 3000 ms is recommended so the caller is not left waiting for the greeting.
Endpoint
| Field | Default | Meaning |
|---|---|---|
| URL | — | Full address including https://. Supports {{variable}} placeholders. |
| HTTP method | POST | See the table below |
| Execution text | empty | What the agent says while the call runs |
| Timeout | 5000 ms | Maximum wait for the response |
| Method | Used for | How parameters travel |
|---|---|---|
GET | Retrieve data | Query string |
POST | Create new records | JSON body |
PUT | Replace data entirely | JSON body |
PATCH | Modify data partially | JSON body |
DELETE | Delete data | Query string |
Execution text decides whether the agent sees the response
This is the most important setting on this page, and the most misunderstood.
Execution text filled → the agent speaks exactly that sentence and never sees your API's response. It cannot read a ticket number back.
Execution text empty → the agent receives the first 500 characters of the response and can carry on with it — read out a confirmation number, quote an order status, confirm an appointment.
Rule of thumb: set an execution text only when a fixed sentence is enough. The moment the agent should relay something from the response, leave it empty.
For longer workflows raise the timeout — 5 to 15 seconds is realistic. Anything beyond that leaves the caller waiting on the line.
Step 3 — Parameters and headers
Headers
Key/value pairs for authentication and content negotiation. Empty rows are dropped on save.
| Header | Example value |
|---|---|
Authorization | Bearer sk-abc123xyz… |
Content-Type | application/json |
Accept | application/json |
Dynamic parameters (JSON Schema)
Here you describe, as a JSON Schema, which values the agent should take from the conversation. The schema defines structure, not values — the agent fills those at call time.
{
"type": "object",
"properties": {
"name": { "type": "string", "description": "The caller's full name" },
"request": { "type": "string", "description": "What it is about, in one or two sentences" },
"priority": {
"type": "string",
"enum": ["low", "medium", "high"],
"description": "How urgent the matter is"
}
},
"required": ["name", "request"]
}| Property | Purpose |
|---|---|
type | string, number, boolean, array or object |
description | Explains the parameter to the agent — important, truncated at 200 characters |
enum | Allowed values |
required | Which parameters the agent must collect |
The dialog offers ready examples (Simple fields, With options, Support ticket), validates your JSON live, and can tidy it via Format JSON.
Don't want to write JSON?
Describe the fields you need to an AI in one sentence and have it produce the schema — "Give me a JSON Schema with name and request, both required, each with a description." Paste the result here and format it.
Fixed parameters
Constant values sent on every call — API keys, tenant IDs, configuration flags:
{
"apiKey": "your-api-key",
"source": "phone"
}What actually gets sent
Three sources are merged, weakest to strongest:
system variables → fixed parameters → parameters extracted by the agent
(weakest) (strongest)On a key collision the value from the conversation always wins. URL placeholders are substituted from the same merged set.
System variables
ScaleTalk supplies these automatically — as parameters and as {{placeholders}} in the URL:
| Variable | Meaning | Example |
|---|---|---|
{{fromNumber}} | The caller's number | +4917612345678 |
{{toNumber}} | The number dialled | +4930123456789 |
{{callId}} | Unique id for this call | RM_abc123xyz |
{{language}} | The agent's language, multi when auto | de |
https://crm.example.com/customers/{{fromNumber}}/ticketsEmpty system variables are stripped before sending.
Step 4 — Review and test
The final step summarises everything and offers a real test call:
- Click Test — the wizard pre-fills sample values from your schema
- Adjust them and click Run test
- Inspect status code, response body and duration
The test runs server-side through ScaleTalk rather than from the browser, so there are no CORS problems and the call matches production. Requests to localhost and other loopback addresses are blocked, and the test timeout is capped at 30 seconds.
You can save once the name, both descriptions and the URL are set.
Limits
| Limit | Value | What happens past it |
|---|---|---|
| API tools per agent | 10 | Only the first 10 enabled are registered; the rest are silently dropped |
| Tool description | 500 chars | Truncated |
| Parameter description | 200 chars | Truncated |
| Response used with no execution text | 500 chars | Truncated |
| Timeout | 5000 ms default | Configurable per tool |
| Test-mode timeout | max 30,000 ms | Clamped |
There is no limit on headers or parameters within a single tool.
What the agent gets on failure
| Case | What reaches the agent |
|---|---|
2xx | With execution text: nothing. Otherwise the first 500 characters of the response. |
4xx / 5xx | "The API request failed: HTTP <status>" |
| Timeout | "The API request timed out." |
| Network error | "Could not connect to the API." |
| Invalid parameters | "Invalid parameters provided: <error>" |
Write into the prompt what should happen in these cases — otherwise the agent improvises.
Integrating with n8n
The most common setup in practice is n8n: the automation platform receives the request, processes it and answers. No server of your own, and almost every common system is already connected there.
The flow
- In n8n add a Webhook node, method
POST— it generates a URL - Enter that URL as the URL in ScaleTalk
- The agent triggers the request; ScaleTalk sends the data to n8n
- n8n processes it — create a ticket, update a CRM, append a row in Google Sheets
- n8n responds, and the agent uses the response in the conversation
Building the workflow
A typical shape:
Webhook → prepare data → create ticket → Respond to WebhookThe last node must be Respond to Webhook, or the agent gets nothing back:
{
"success": true,
"ticket_id": "TK-20260218-042",
"message": "Ticket created successfully"
}With that the agent can say: "I've created ticket TK-20260218-042 for you."
Two n8n traps
Use the production URL, not the test URL — the test URL accepts a single call and only while the editor is open.
Almost always POST. Even when you are only fetching data, the n8n webhook usually expects POST. The method in ScaleTalk has to match the one on the webhook node.
n8n webhooks usually need no authentication — the URL itself is the secret. Treat it accordingly.
Referencing it in the prompt
Configuration alone triggers nothing. The system prompt decides when the tool is called:
### When the caller has a general question or wants a callback
### about a new topic:
1. Capture name and request in full.
2. Call the "Create ticket" tool.
3. Read the returned ticket number back to the caller.
4. If the tool fails: promise to pass the request on manually
and end the call normally.When it does not work
| Symptom | Cause | Fix |
|---|---|---|
| Tool is never called | "When to use" too vague, tool disabled, or more than 10 tools on the agent | Sharpen the description, add trigger phrases, remove tools |
| Parameters arrive empty | Missing or unclear description in the schema | Give every parameter a concrete description |
| Agent does not read the response | Execution text is set | Clear the field |
| Response is cut off | Over 500 characters | Shorten it, put the key value first |
| The call fails | URL, credentials, timeout or reachability | Check it in test mode |
For debugging, a request inspector like webhook.site makes a good temporary endpoint — you see exactly what ScaleTalk sends.