---
title: "Preview Http Step"
method: POST
path: "/workflow/http-steps/preview"
tags: ["http-steps"]
---

# Preview Http Step

`POST /workflow/http-steps/preview`

## Request

- Base URL: `https://api.anyreach.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.anyreach.ai/workflow/http-steps/preview`
- Auth: HTTP bearer

Run a single HTTP step against a provided context (no workflow execution).

Sync handler so the blocking ``requests`` call runs in FastAPI's thread pool
instead of blocking the asyncio event loop.

## Headers

- `x-anyreach-org` string, nullable: Organization ID for user PATs (pat_ prefix tokens)

## Request body

- HttpPreviewRequest
  - `method` 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD' | 'OPTIONS'
  - `url` string
  - `headers` object
  - `query_params` object
  - `body_type` 'json' | 'form' | 'raw'
  - `body` union
    - object
    - string
  - `compress` 'none' | 'gzip' | 'gzip_payload': Whether the request body is gzipped, and whether that is declared. The two gzip modes are not a style choice. ``GZIP`` is the HTTP-correct one: the body is a compressed representation of the payload and ``Content-Encoding: gzip`` tells the server to decompress it before handing it to the application. ``GZIP_PAYLOAD`` sends the same bytes and says nothing. That is what an object store needs: GCS and S3 read ``Content-Encoding`` on an upload as the *stored object's* encoding, so declaring it there produces an object that is transparently decompressed on read — which then fails to load as a ``.jsonl.gz`` in BigQuery. Uploading a gzip file means the gzip bytes are the payload, not a transfer encoding.
  - `context_data` object: Workflow JSONata context (WorkflowContext.data) for preview
  - `step_id` string: Step id used for ctx.current_step_id and recorded outputs

## Response `200`

Successful Response

- HttpPreviewResponse
  - `status` string, required: SUCCESS or FAILURE
  - `error` string, nullable: Step-level error message
  - `status_code` integer, nullable
  - `request` unknown
  - `response` unknown

## Other responses

- `404`: Not found
- `422`: Validation Error

---

[API](https://skmtc.dev/anyreach/apis/anyreach-api.md) - [All operations](https://skmtc.dev/anyreach/apis/anyreach-api/llms.txt) - [OpenAPI document](https://skmtc.dev/anyreach/apis/anyreach-api/revisions/2eddf40c8c93?raw)
