Skip to main content
API node interface on light mode
API node interface on dark mode
The API node sends an HTTP request to your own system or to a third-party service, so your Pearl can pull data (a customer record, open slots, a price) or push it (a booking, a CRM update). Depending on where you place it, it runs at one of three moments:
  • Pre-Call API: once, before the conversation starts.
  • In-Call API: during the conversation, when the flow reaches the node.
  • Post-Call API: after the conversation ends, as a post-call action.
The form is the same in all three cases. Only the available variables, the response handling, and the transitions differ (see Context Differences). It works on voice and text Pearls alike: on a text Pearl, the tabs are called Pre-Chat, In-Chat, and Post-Chat.

Adding an API Node

In the PearlVibe editor, click Add Node at the bottom of the canvas, then pick the moment the request should run. You can also ask PearlVibe to add one for you in the chat (Build mode).
In the In-Call tab, pick API in the Actions section, then connect it where the request should run.
API in the Actions section of the In-Call tab of the node picker
API in the Actions section of the In-Call tab of the node picker
The Integrations section of the picker lists ready-made services (Google Calendar, HubSpot, Salesforce, and more). Picking one adds an API node with its credential already created.
To configure the node by hand, click it on the canvas and open it with the pencil of its tile in the chat (Manual edit), or hover it and click Edit Manually. Your changes are kept once you click Save Changes.

Configuring the Request

1

Description

Explain what this API does and what data it returns (e.g. “Returns open appointment slots for the requested day”). The description is required, up to 150 characters. Pearl reads it to understand what the request is for.
Description of an API node
Description of an API node
2

URL & Method

In URL, pick the method in the dropdown before the address (GET, POST, PUT, DELETE, or PATCH), then type the endpoint URL. Click Variable to insert a variable, among those available in the node’s context (see Context Differences) and your environment variables, for example {apiBaseUrl}/orders. Variables are inserted as they are, without URL encoding.
URL of an API node with the list of methods open
URL of an API node with the list of methods open
The available fields depend on the method:
  • The Body section is shown only for POST, PUT, and PATCH (hidden for GET and DELETE).
  • The Response Output Schema is available for every method except DELETE.
A request times out after 10 seconds, and only a 2xx status counts as a success. If your API is behind a firewall, allow the NLPearl IP addresses listed in IP Whitelisting. This applies to Pre-Call, In-Call, and Post-Call requests alike.
3

Headers

Add any header required by the API, such as Content-Type or Authorization, as Key / Value pairs. Header values are static: only environment variables are replaced in them, since they are filled in across the whole flow before each call. When you don’t set a Content-Type, application/json is sent.
Headers of an API node with one header
Headers of an API node with one header
For a dynamic authorization token, use a Credential instead of a static header.
4

Body (POST / PUT / PATCH)

Provide Key / Value pairs, sent as JSON. Type in the empty row at the bottom to add one; hover a row to delete it.
Body of an API node with three keys mapped to variables
Body of an API node with three keys mapped to variables
Each Value is either one of your Variables or a Static & Custom value. Static values support these types:
For each row you can tick the Required checkbox:
  • Checked: if the value is missing, the request is not sent. During the conversation, Pearl is told which value is missing and asks the customer for it. In a Pre-Call API, there is no one to ask, so the node takes its Not Success path.
  • Unchecked: the request is sent even if the value is missing; the key is simply left out.
When using a variable in the body, be aware that:
  • Each variable keeps its configured data type (e.g. a Whole Number is sent as a number, a Text as a string). During the conversation, a value that doesn’t match the type stops the request.
  • You can mix static values and variables in the same body.
  • For nested JSON, use dot notation in the Key (customer.address.street) and square brackets for array indices (order.items[0].productId). See Using Nested Objects below.
A body value can also carry its own braces - a GraphQL query or a nested JSON fragment, for example. In an API node, only braces wrapping a valid variable ID are substituted; every other brace is sent as-is:
  • { {agentName} } - the variable is replaced, the outer braces are kept.
  • query { boards(ids: {agentName}) { id } } - the variable is replaced, the rest of the query is left untouched.
  • { agentName } - braces containing spaces around the ID are not recognized as a variable; the text is sent literally.

Using Nested Objects

Many APIs expect a nested JSON structure in their request body. Use dot notation and array indices in the Key column to build nested payloads while keeping them organised and readable.

How to define nested keys

  • Use dot notation for properties (customer.address.street)
  • Use square brackets for array indices (order.items[0].productId)
You can pair nested paths with any variable type: Text, Number, Boolean, etc.
Mapping table:Resulting body:
body.json

Response Output Schema & Variable Assignment

API responses are capped at 10,000 characters, and error responses at 1,000 characters. Anything longer is automatically truncated.
Available for every method except DELETE. The Response Output Schema lets you filter the API response so only the relevant data flows back into the conversation. Without filtering, the entire JSON is returned, which can reduce precision because the AI receives too much unrelated information. Even for small responses, setting a schema is strongly recommended to keep Pearl focused. Each row of the schema has three parts:
Response Output Schema of an API node with one path assigned to a variable
Response Output Schema of an API node with one path assigned to a variable

How it works

  • Provide a list of JSON Path strings, one per row.
  • The system extracts only those paths from the API response; everything else is discarded.
  • As soon as one row has a variable, Pearl receives only the assigned variables, not the rest of the response. Rows without a variable then don’t reach Pearl.
  • The same variable can’t be assigned to two paths, and environment variables can’t be assigned.

Path syntax

A path walks down the API response to the value you want. The simplest form is a chain of keys, and it covers most responses: A path can also choose, which is what you need as soon as an API answers with a list and you only want one entry out of it: Filters accept ==, !=, <, <=, >, >=, contains, startswith, and endswith. A path can be up to 2,048 characters, with at most two .. searches and eight nested brackets; beyond that, it selects nothing. A slice or a recursive .. search can match several values at once. Assign one of those to a variable and the variable has to allow multiple values — see Assigning to a variable below.
These are not the same as the paths in the Key column of the request body. There, order.items[0].productId builds a nested payload. Here, the same shape reads a value out of the response.

Using a variable inside a path

A path can carry a {variableId} placeholder — the same syntax used everywhere else (see Flow Variables) — for a variable the request itself sends, in the URL or the body. It is replaced with the value sent in this request before the response is read, so the path can depend on what the conversation has collected:
If the request sends the day the caller asked for as preferredDateIso, that path returns the first slot on that day. If the value is missing, nothing is extracted.
Use a filtered path whenever the API returns a list and you only want one entry from it. A calendar call is the usual case: without a filter, you map slot 1, slot 2 and slot 3 into separate variables and let the agent pick between them. With one filtered path, the platform hands it exactly the first free slot on the day the caller asked for.
Benefits:
  • Keeps the response size small
  • Improves the quality and relevance of AI outputs
  • Prevents hitting the 10,000-character truncation limit
  • Ensures only the necessary fields are carried into the next steps of the conversation

Assigning to a variable

Key things to know:
  • The variable’s type must match the data type returned by the API at that path.
  • If the value returned is a list, make sure the variable is configured to allow multiple values.
  • A variable can store up to 2,000 characters. Any data beyond this limit is truncated.
Outside of Pre-Call APIs, assigning a variable is optional. Without any assigned variable, Pearl receives the filtered JSON for the rest of the conversation, but it isn’t stored for later reuse.

Credentials (Authentication)

If your API requires authentication, use a Credential. In the node’s Options, turn on Credentials and pick one in Token. Add New opens your Pearl’s credentials, and the pencil next to the selected one (Edit) opens its settings. Leave Credentials off if no authentication is needed. Credentials are shared by the whole Pearl.
Credentials turned on in the Options of an API node, with a token selected
Credentials turned on in the Options of an API node, with a token selected
The platform adds the selected credential to each request. A Refresh Token credential is kept for its Lifetime and fetched again when it expires; if the API answers 401, 403, 419, 440, or 498, the token is renewed and the request sent again once.
To add, connect, or manage credentials (connected accounts, API keys, bearer tokens, refresh tokens), see Credentials.
Why use a Credential?
  • Avoid hardcoding tokens manually in every API node
  • Automatically refresh tokens based on their lifetime
  • Centralized management when multiple API nodes reuse the same token
  • No need to parse token responses manually, the platform extracts the token for you

Context Differences

The same API node behaves differently depending on where you place it in the flow. Environment variables are available in all three.
Runs once before the conversation begins. Typical uses:
  • Inbound: look up the caller using the auto-captured phone number and call id.
  • Outbound: preload data from Pre-Call variables already stored on the lead.
Only Pre-Call variables are available (system variables like phone number, call id, first/last name, email, plus your own Pre-Call variables).
  • Assigning response values to variables is required: that’s how pre-call data becomes usable in the conversation. The rows marked Required must come back for the node to take the Success path.
  • Transitions: a Success branch by default. Turn on On Error Transition in the Transitions tab to add a Not Success branch. It is taken when a required input is missing, the API answers with a non-2xx status, the response can’t be read, a required value doesn’t come back, or the request fails.
  • Pre-Call API nodes can’t be renamed or duplicated.
Transitions tab of a Pre-Call API node with On Error Transition turned on
Transitions tab of a Pre-Call API node with On Error Transition turned on

Testing Your API

Use the Test the API block at the bottom of the form. Testing sends a real request to your API.
1

Fill in the test values

Give a sample Value to every variable used in the request.
Test the API block with a test value
Test the API block with a test value
2

Run the test

Click Run test (Run again afterwards). To work with more room, click Expand: the form and the test values sit on the left, the answer on the right, and Send runs the request.
Expanded test view with the form on the left and No response yet on the right
Expanded test view with the form on the left and No response yet on the right
3

Inspect the answer

The result starts with a verdict (Answer received, The API answered with an error, Couldn’t reach the URL, or The test couldn’t run), the status code with the time it took, and the request line. Then switch between Request, Response (Filtered or Unfiltered, if an Output Schema is set), and Assigned Variables.
Expanded test view with an answer received, its filtered response and status
Expanded test view with an answer received, its filtered response and status
Test and perfect your setup before putting the Pearl in production.

Variables

Learn how to create and use variables inside API nodes.