Skip to main content
An objective can tell the agent to make an API call itself, in addition to observing the requests a page makes. Use this to seed data before a flow, call a backend to set up state, or check a service, and then assert on or reuse the response.

Making a call

Write the HTTP request explicitly, and name its response with “save the response as …”:
You can also paste a curl command. The agent keeps it exactly as written, including method, headers, body, and auth:

Using the response

Refer to the response in plain English. The {{name}} syntax is reserved for global variables and secrets (see Variables and Context). Never use it for a value the run produces. When one objective makes several calls, name each response (save the response as order) and say which one you mean, as in assert the order response status is 201. You can assert on a response or use it in later actions. API calls and browser actions can be mixed freely in one objective:

Tokens and secrets

Store every API token or credential in a variable marked secret: true (see Variables and Context). The value is then masked in logs and never stored in plain text:

Make a call vs. observe page traffic

These are two different features:
  • Make a call (this page): you tell the agent to send a request, for example to seed a record, call a backend, or set up state.
  • Network assertions: observe the requests the page makes on its own during a UI flow, such as status codes, bodies, and timing.
They work together: seed state with a direct call, drive the UI, then assert on the page’s own network traffic.