unit U2 — 2 of 4
The HTTP Request Piece
custom API calls, auth, pagination
The HTTP Request Piece is the master key of the FlowLogic Engine: when no native Piece exists for a client’s tool, this one Piece talks to any REST API on earth. Learning to read a provider’s API docs and translate them into an HTTP Request Piece is the single most valuable skill on the platform — it turns “that integration doesn’t exist” into “give me ten minutes.” You configure four things: the method (GET/POST/…), the URL, the headers, and the body.
Authentication is where most people stall. Three patterns cover nearly everything: an API key in a header (`Authorization: Bearer …`), Basic auth (username/password), or OAuth2 — where a Connection handles the token dance for you: you pick the account once and the engine injects a fresh token on every call. Store every secret as a Connection, never inline in the Piece, so it’s encrypted and reusable. For reading data, turn on the Piece’s pagination so it follows the API’s next-page cursor until every page is fetched — not just the first.
Where it breaks: treating one page as the whole dataset, and hardcoding a token that later rotates. Enable pagination, reference a Connection for auth, and set a timeout + retry so a slow or rate-limited API retries instead of failing the run.
worked example
A POST to a provider with no native Piece — Bearer auth from a Connection, body mapped from earlier steps.
{
"method": "POST",
"url": "https://api.vendor.dev/v1/leads",
"headers": {
"Authorization": "Bearer {{ connections.vendor.apiKey }}",
"Content-Type": "application/json"
},
"body": {
"email": "{{ trigger.body.email }}",
"source": "{{ trigger.body.utm.source }}",
"score": "{{ step_2.score }}"
},
"timeout": 15000,
"retryOnFailure": true
}field checklist
- Read the API docs: find the method, URL, auth, and body shape.
- Put auth in a Connection; never inline a key in the Piece.
- Enable pagination and follow the next-page cursor to exhaustion.
- Set a timeout + retry so a slow API retries, not fails.
- Test the Piece to capture the real response shape before mapping.
common failure — Only the first page ever synced
An HTTP Request Piece pulled a paginated endpoint with pagination off, shipping the first 100 of 6,000 records every run. The flow went green; the gap surfaced only at reconciliation. Enable pagination pointed at the API’s next-page field, cap the max pages, and assert the returned count against the API’s reported total before writing downstream.
check your understanding
An HTTP Request Piece pulls a paginated endpoint. The flow runs green every night, but reconciliation shows only 100 of 6,000 records arriving. What is the defect?
next unit opens once this is passed
sandbox validation
The check above confirms you followed the unit. Marking the module COMPLETED takes more: build the automation in your own engine and submit the exported flow and its run evidence, signed, to your unique validation URL. See the module page for that spec.