Get started

Reference Workflows 06 / 06

API call step

Make an HTTP request from inside the page session. A step a recorded Writ workflow can run, with its fields and an example.

Runs on Writ CloudWrit Desktop

Open in Claude Open in ChatGPT

The api_call step performs an HTTP request from inside the live page, so it carries the session's cookies — often faster and more robust than driving the UI, especially against endpoints discovered from the site's own network traffic.

In a workflow, this step is a JSON object with "type": "api_call". Steps run in order, and each step can read the outputs of the steps before it.

Fields

Set these inside the step’s config object.

url string required
The endpoint URL (placeholders supported).
method string
GET, POST, PUT, PATCH, or DELETE.
headers map
Request headers; reference {{vault:name}} secrets, never inline them.
body json
Request body for write methods; {{extracted:key}} values from earlier steps resolve here.

Example

One api_call step, as it appears in the steps list of a workflow.

Step
{
  "type": "api_call",
  "config": {
    "method": "GET",
    "url": "https://example.com/api/products?page={{page}}",
    "headers": { "Authorization": "Bearer {{vault:api_token}}" }
  }
}

How it behaves

  • Runs as an in-page request, so the logged-in session from earlier steps is reused.
  • Response values can be named and chained into later steps as {{extracted:key}}.
  • Only call endpoints on services you are authorized to use.

Where it runs

The step runs wherever its workflow runs. On Writ Desktop, runs are free and can reach systems that only your own network can reach.

On Writ Cloud, each call costs credits: 20 when the run needs a browser, 2 when it does not. A call that fails because of the site or Writ costs nothing.

Next