Skip to main content
The HTTP Request tool lets an agent call an external REST API during a conversation and use the response in its answer. Typical uses: looking up an order, checking an account status, or creating a lead in your CRM. Each HTTP Request tool calls one URL with one method. Create one tool per API operation.

Create an HTTP Request tool

1

Create the tool

  1. Go to Agents > Tools and click Create Tool.
  2. Enter a Name (for example get_order_status), a Display Name, and a Description that tells the agent what the tool does and when to use it.
  3. Set Tool Type to ago_http_request.
2

Configure the request

In Technical Configuration, fill in Additional Info (JSON) with the URL, method and headers:
Put your API key or token in Secret Key. See Authentication options.
3

Define the inputs

In Input Schema (JSON), define the parameters the agent fills from the conversation. See Input schema.
4

Save and assign

Click Save, then open the agent in Agents and add the tool under Capabilities > Available Tools.
Test the tool with sample inputs in Agents > Tool Lab before you assign it to an agent in production.

Request configuration

These keys go in Additional Info (JSON):

Authentication options

Put your credential in the Secret Key field and reference it from a header value with the {{secret_key}} placeholder. At request time, every {{secret_key}} in your headers is replaced with the stored secret. This keeps the credential out of the Additional Info JSON, which is not encrypted.
The Secret Key is stored encrypted and is never shown in full. When you reopen a tool that already has a secret, the form shows a masked hint (for example s*********y) so you can confirm which key is saved. Leave the field empty to keep the existing secret, or type a new value to replace it. The {{secret_key}} placeholder only works in header values, not in the URL or the request body.

OAuth Client Credentials

Some APIs require a short-lived access token from an OAuth 2.0 server, obtained with a client ID and client secret. The tool can request this token before each call:
  1. In Technical Configuration, put the client secret in the Secret Key field.
  2. In the Authentication box, set Authentication type to OAuth 2.0 client credentials.
  3. Fill in the Token URL (it must start with https://) and the Client ID. Add a Scope only if your OAuth server requires one.
  4. Click Save. Saving is refused until the token URL, client ID and secret are all set.
The form writes these settings to an auth object in Additional Info (JSON), so you can also edit them there:
The tool sends grant_type=client_credentials with your client ID and secret to the token URL, then calls your API with Authorization: Bearer <access token>. The token is reused until shortly before it expires. A new secret takes effect on the next call. Set Authentication type back to None or custom headers to remove the OAuth settings. If the token request fails, the agent receives an authentication error and your API is not called.

Forward the user’s identity

When your widget or app signs users in with a JWT, turn on Forward User Authentication in the tool’s Advanced tab. The tool then sends the user’s JWT in the Authorization: Bearer header, so your API can identify the user and apply its own permissions. See Widget Authentication.

Input schema

The input schema lists the parameters the agent fills in from the conversation. If you leave Input Schema (JSON) empty, the agent gets two parameters:
  • params: an object sent as query parameters. For example, {"status": "open"} calls https://api.example.com/v1/orders?status=open.
  • body: a JSON string sent as the request body on POST and PUT.
To ask the agent for specific values instead, define them in the input schema. Each parameter has a type and a description that tells the agent what to put in it:
Supported types are str, int, float, bool and lists such as str[]. Add an enum list to restrict a parameter to fixed values. For nested objects, paste a standard JSON Schema that includes a $schema key. Parameters you define are not sent on their own: place them in the body with body_template, or define a params object to send them as query parameters.

Request body

Use body_template to control the exact JSON your API receives. Each <<name>> placeholder is replaced with the matching value:
Available placeholders: When a value is the whole placeholder, such as "<<quantity>>", its type is kept (a number stays a number). Add |string to force text: "<<quantity|string>>". If the agent did not fill in a parameter used by a placeholder, the request is not sent and the agent receives an error naming the missing placeholders, so it can call the tool again with them. A placeholder that AGO fills, such as <<jwt_token>> for a user without a JWT, is sent unchanged when it has no value.

Response

When your API answers with a success status, the agent receives the response body as returned by your API. A response that is not JSON is passed as text. If your API answers with an error status, the agent receives the status, such as The API answered HTTP 403 Forbidden., and the beginning of the response body, so it can correct its input or tell the user it could not complete the action. If the server cannot be reached or does not answer in time, the agent receives The API could not be reached. Redirects are not followed.

Network restrictions

The tool only calls public internet addresses. Requests to private networks, localhost, link-local and cloud metadata addresses are refused, and the agent receives Request blocked: URL targets a restricted address.
If your API is only reachable on your private network, for example through a VPN connection set up with AGO, contact AGO to allow its hostname for your workspace. Only HTTPS on port 443 to the hostnames AGO has registered for your workspace is allowed; every other private address stays blocked.

Examples

Look up customer data

Create a sales lead

Best practices

  • One tool per operation: an agent picks the right tool more reliably when each tool does one thing.
  • Write the description for the agent: say what the tool returns and when to call it. See the Tools Description Guide.
  • Use least-privilege keys: give the tool an API key that can only do what the tool needs.
  • Keep inputs minimal: only ask the agent for values it can get from the conversation.

Troubleshooting

The URL points to a private or reserved address, or its hostname resolves to one. Use a public hostname. If the API is only reachable through a private connection with AGO, contact AGO to allow it.
  1. Check the URL and method in Additional Info (JSON).
  2. Check that the Secret Key is correct and that the header uses {{secret_key}} in the format your API expects.
  3. Check that the API does not answer with a redirect: redirects are not followed.
  4. Run the tool in Tool Lab with the same inputs to see the request result.
Describe the response in the tool’s Description so the agent knows which fields matter. If your API returns a very large payload, expose a narrower endpoint.