API command index
Flowstride's API adapter uses Undici. Relative endpoints use BASE_URL from .env or configured baseUrl. API and browser commands can share the same .flow file and extracted/generated data; see API and UI in one flow.
| Task | Reference |
|---|---|
| Read | flow.get |
| Create | flow.post |
| Replace/update | flow.put, flow.patch |
| Delete | flow.delete |
| GraphQL | flow.graphql |
| Retain response data | flow.extract |
| Check results | flow.expect |
| Send JSON, form data, text, a multipart upload or binary | flow.api.request |
| Isolate API users and cookies | Named API contexts |
| Validate a JSON response shape | flow.api.expectSchema |
| Wait for an API job or state transition | flow.api.poll |
| Capture or mock a page request | Browser network |
flow.post "/api/orders" with reqHeader "Authorization" "Bearer {{env.API_TOKEN}}" with reqBody
"""
{
"sku": "DOCS-001",
"quantity": 1
}
"""
flow.expect status "201";
flow.expect resBody "id" not.empty;
flow.extract resBody "id" as "orderId";Use strict camelCase for reqBody, reqHeader, resBody, resHeader, and responseTime. Triple-quoted docstrings keep JSON readable. Assert a response before relying on data extracted from it.
Browser network routes affect browser traffic, not these direct API calls. API calls and a browser page are separate clients. Do not assume every cookie/token from one is automatically active in the other; use an explicit session workflow and verify the resulting application behavior.
For HTTP methods, chained comparisons, GraphQL variables/mutations and explicit API-cookie browser login, read API testing. For a complete local application and deliberate failing check, use the included examples.
