An API connector lets an agent call an external HTTP endpoint. Configure the endpoint once, then use request templates to map values supplied at run time into headers, query parameters, and request bodies.

Before you begin

You need:
  • The external API URL and HTTP method.
  • The required headers, query parameters, and body shape.
  • Authentication credentials if the API is protected.
  • Permission to add tools and assign them to an agent.
Store secrets in the connector authentication configuration. Do not include credentials in prompts or other user-controlled runtime values.

Configure the request

Create an api_connector tool and configure these fields: Templates can be JSON objects or JSON-encoded strings. Objects and arrays are resolved recursively.

Use runtime placeholders

Insert a runtime value with {{variable_name}}. Placeholder names can contain letters, numbers, and underscores. At run time, Pinter builds the placeholder context from the JSON objects passed as params, headers, and body. If the body is plain text instead of JSON, the same value is exposed as prompt, message, body, and text. For example, this body template maps agent input into an external ticket API:
A placeholder that occupies the complete JSON value preserves the runtime value type. For example, "active": "{{is_active}}" can resolve to a Boolean. A placeholder embedded inside a longer string resolves to text.
An unresolved placeholder remains in {{variable_name}} form. Test the tool with representative inputs before assigning it to an agent.

Configure token authentication

Use the authentication fields when the connector must obtain a bearer token before calling the target API: Pinter caches the token for the configured lifetime and sends it to the target API as Authorization: Bearer <token>.

Test and assign the connector

1

Test the request

Run the connector with JSON values that cover every required template field. Check the returned status and response body.
2

Check unresolved values

Confirm that the outgoing request does not contain any remaining {{variable_name}} placeholders.
3

Assign the tool

Open the agent builder and add the API connector tool to the agent.
4

Run an agent evaluation

Verify that the agent supplies the expected headers, parameters, and body values for representative prompts.

Troubleshooting