flowda Developer API
One API key for the four retrieval capabilities (extract, template, search, map) plus change monitoring (watch), all running on flowda's fetch network.
- Base URL — the host this documentation is served from
(production:
https://openapi.flowda.ai). - Response body — every capability endpoint returns the fetch platform's own
response body, projected verbatim into
data. Field names and semantics therefore match the platform contract; the only exception is that internal fields (for examplemeta.snapshot_id, the platform's snapshot storage path) are removed.
Credentials
Three credential forms are accepted, all of them scoped to your account:
| How | Header | Notes |
|---|---|---|
| API key | Authorization: Bearer flw_<env>_<key_id>_<secret> | Created in the console. Per-endpoint scope is enforced. |
| API key | X-API-Key: <key> | Equivalent form; Authorization wins when both are present. |
| Session | Authorization: Bearer <JWT> or the flowda_token cookie | Obtained by signing in to the console. A session is the account owner, so scopes are not enforced. |
Scopes: extract (extract, template, templates), search, map, watch.
A key that lacks a scope gets 403 with code 12015 (not 401) — the credential is
valid, the grant is not; data.required_scope names the scope you need.
GET /v1/account tells you which scopes your key carries.
Response envelope
Success — HTTP 200, code is 0:
{
"code": 0,
"message": "success",
"request_id": "req_6a99053110d62d17",
"data": {
"success": true,
"request_id": "req_01K7XT3B6C9D4M2Q",
"credits_used": 1,
"outputs": { "markdown": "# Example" },
"meta": { "strategy_used": "X1", "cache_hit": true }
}
}
Failure — the HTTP status is the one in the table below and code is a non-zero
application code. Every failure body has code, message and request_id; the
only optional members are details and, for a single code, data:
{
"code": 16002,
"message": "the request was rejected, see details",
"request_id": "req_6a99053110d62d17",
"details": ["The request body is invalid(url)."]
}
details is present only for the codes marked yes in the error table: it carries
the reason the request failed — for 16xxx codes that is the fetch service's own
explanation (usually naming the exact field), for the rest it is ours — and it is
the fastest way to fix a rejected call.
data is present on exactly one failure: a scope denial (403 with code
12015) puts the missing scope in data.required_scope, because that is the one
field the caller needs in order to fix the key:
{
"code": 12015,
"message": "api key scope denied",
"request_id": "req_6a99053110d62d17",
"data": { "required_scope": "map" }
}
Every other failure omits data, so a failure handler must treat it as optional
rather than required or forbidden.
⚠️ Check data.success, not just the status code
The fetch platform reports "the target could not be retrieved" inside a 200
response: HTTP 200, outer code: 0, but data.success: false with a platform
code and message:
{
"code": 0,
"message": "success",
"request_id": "req_a1b2c3d4e5f60718",
"data": {
"success": false,
"code": "TARGET_DNS_ERROR",
"message": "The target host could not be resolved.",
"request_id": "core-req-9f2c1b"
}
}
So a client must treat data.success === false as a failed call even though the
status is 200. (The same rule is applied to your call log: such a call is recorded
as failed, with the platform code and reason attached.)
data.success is always present for capability calls.
What data.code can contain
data.code is an uppercase string owned by the fetch service. The lists below are
the codes that endpoint can currently produce; anything else should be handled like
UNKNOWN_ERROR.
extract — TARGET_TIMEOUT, TARGET_DNS_ERROR (the host, or a redirect target,
could not be resolved), TARGET_SSL_ERROR, TARGET_SITE_ERROR (unreachable,
redirect loop, invalid redirect, non-routable address), TARGET_ALL_ENGINES_FAILED
(every retrieval engine failed, or the page has no readable content — a
JavaScript-only page also lands here: retry with advanced_mode),
TARGET_UNSUPPORTED_FILE_TYPE (the target is a file type we do not deliver),
UNKNOWN_ERROR.
template — TARGET_SITE_ERROR, TARGET_DNS_ERROR, TARGET_TIMEOUT,
TARGET_SSL_ERROR, TARGET_ALL_ENGINES_FAILED, TEMPLATE_MISMATCH (the page no
longer matches the template contract), UNKNOWN_ERROR. A missing product or an
empty listing is not one of these: it comes back as a success with
outputs: null and is still billed.
map — INVALID_REQUEST, INVALID_API_KEY, INSUFFICIENT_CREDITS,
RATE_LIMITED, INTERNAL_ERROR, TARGET_ALL_ENGINES_FAILED, TARGET_TIMEOUT,
UNKNOWN_ERROR.
search — a per-result extraction failure is reported inside
data.outputs[].extract (success: false on that result) and does not fail the call;
a platform-level failure uses this shape like every other capability endpoint.
Two extract rejections use the HTTP status line instead of data.success, and arrive
with 16002: EXTRACTION_SELECTION_EMPTY (your exclude_tags removed all body text)
and EXTRACTION_OUTPUT_TOO_LARGE (the parser output exceeded the resource budget —
reduce formats).
Two request identifiers — quote both in a support request
| Value | Who generated it | Where |
|---|---|---|
request_id (envelope) | flowda | Envelope of every response, success or failure |
request_id inside data | the fetch platform | Platform response body; identical to the X-Upstream-Request-Id response header |
For POST /v1/map the value inside data may be the fetch network's own identifier
instead of the platform's; the X-Upstream-Request-Id header is the authoritative
one when you need to trace a single call.
Replay
GET /v1/replay/{request_id} returns the original response body of an earlier
capability call, byte for byte, without calling the fetch service again.
- The path parameter is the platform request id — the
X-Upstream-Request-Idresponse header of the original call (alsodata.request_idinside its body). flowda's own enveloperequest_idis a different value and is not accepted. - The id format is
req_YYYYMMDD_<hex16>. Older ids (req_<hex16>) were never retained and answer404. - A replay is never billed and does not re-run the call:
data.credits_usedis what the original call was billed, anddata.successis the original outcome —falsemeans the call you replayed had failed. The replay itself succeeded. - Ownership is enforced per account: another account's
request_idanswers404, exactly as if it did not exist. The key must also carry the scope of the original operation (search,extractormap), otherwise the answer is403with code12015. - Results are retained for a limited time. Once a result is gone the endpoint answers
410(code11006) — retrying will not bring it back. A result that is still being archived answers409withRetry-After: 1. - The response carries the original call's metadata as headers:
X-Replay-Of(the replayed id),X-Replay-Operation(search/extract/map),X-Original-StatusandX-Original-Outcome(succeeded/failed).
Error codes
| code | HTTP | Meaning | What to do | details |
|---|---|---|---|---|
| 10000 | 500 | Internal error | Retry later; contact us if it persists | no |
| 11000 | 400 | Invalid request | Fix the request as described in details | yes |
| 11004 | 404 | Not found | Check the path; jobs and checks must belong to your account | no |
| 11005 | 405 | Method not allowed | Use the documented method | no |
| 11006 | 410 | The result is no longer available | Do not retry; the result was not retained | no |
| 12001 | 401 | Authentication required | Send an API key or a session token | no |
| 12002 | 401 | Invalid or expired session token | Sign in again | no |
| 12003 | 403 | Forbidden | Account disabled, or the write request failed its origin check | no |
| 12014 | 401 | API key invalid, revoked or expired | Check the key in the console | no |
| 12015 | 403 | API key lacks this endpoint's scope | Add the scope named in data.required_scope | no |
| 13000 | 429 | Rate limit exceeded | Back off using Retry-After | no |
| 13002 | 402 | Daily quota exhausted | Wait for the next UTC day, or ask us for a higher quota | yes |
| 14000 | 500 | Storage unavailable | Retry later; contact us if it persists | no |
| 16000 | 502 | The fetch service failed | Retry later | no |
| 16001 | 504 | The fetch service did not answer in time | Retry later | no |
| 16002 | 400 | The fetch service rejected the request | Fix the request as described in details | yes |
| 16003 | 429 | The fetch service is rate limiting | Reduce concurrency and retry | no |
| 16004 | 402 | The fetch service has no credits left | Contact us to top up | yes |
| 16005 | 503 | The fetch service is unreachable | Retry later | no |
| 16006 | 400 | webhook_url rejected | Fix the URL as described in details | yes |
| 16007 | 401 | Webhook signature invalid | Only returned on the platform callback endpoint | no |
| 16008 | 409 | Conflicts with the job's current state | Adjust the state; details says which conflict | yes |
| 16009 | 500 | Configuration problem on our side | Contact us — retrying will not help | no |
Codes in the 16xxx range describe the fetch service. 16009 means our platform
credential is broken (a flowda-side configuration fault), never your API key:
it is deliberately not a 401 so that you do not go looking for a problem in your
own credentials.
Form-encoded request bodies
Endpoints that accept both application/json and application/x-www-form-urlencoded
use the same field names for both media types. Form-encoded bodies are converted to
JSON before processing, so all validation and field rules apply identically.
Encoding rules
- Strings: send as a single value. Repeating the same field name for scalar fields
returns
400with code11000. - Booleans: only
trueandfalseare accepted (as literal strings, unquoted). - Integers: decimal notation only; no leading zeros or decimal points (
01,1.0rejected). - Arrays: repeat the field name (
formats=markdown&formats=links), or send a JSON array as a single string value (formats=["markdown","links"]). If the value starts with[but is not valid JSON (for example, the CSS selector[data-kind]), it is treated as a regular string element in a single-item array. - Objects (
headers,extract_options,params): send as a JSON object string (headers={"Accept-Language":"en-US"}). - Empty values: a field sent with an empty value (
include_tags=) means "not provided" — it is dropped before the request is forwarded, exactly as if you had left the field out. Sendinclude_tags=[]if you really need an empty array. - Character encoding: UTF-8 only. A
charsetparameter other thanutf-8or a body that is not valid UTF-8 after percent-decoding returns400with code11000.
Unknown fields are accepted and forwarded — the fetch service will reject them with a specific field message if they are not recognized. This matches the JSON behavior.
Example:
POST /v1/extract HTTP/1.1
Content-Type: application/x-www-form-urlencoded
url=https%3A%2F%2Fdeveloper.mozilla.org%2Fen-US%2Fdocs%2FWeb%2FHTTP%2FGuides%2FCaching&formats=markdown&formats=links&only_main_content=false&max_age_ms=0&headers=%7B%22Accept-Language%22%3A%22en-US%22%7D
is equivalent to:
{
"url": "https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Caching",
"formats": ["markdown", "links"],
"only_main_content": false,
"max_age_ms": 0,
"headers": {"Accept-Language": "en-US"}
}
Billing
- Every call to a capability endpoint is billed once it reaches the fetch service. There is no idempotency key, so a retry after a timeout can be billed twice — confirm the outcome in your call log before retrying.
credits_usedin the response reports what this call cost: extract costs 1 credit on a cache hit and 1 / 3 / 5 by the strategy used on a miss; template execution costs a flat 5 credits (a successful but empty result still costs 5, a failed execution costs 0); search is billed per result.GET /v1/templatesandGET /v1/templates/{template_id}are metadata calls: they cost 0 credits but still appear in your call log.render_jsis an internal troubleshooting switch of the fetch service and is not exposed — useadvanced_modewhen a page needs rendering.- A request that carries your own
headersnever reads the platform's snapshot cache, and the target URL stays marked for 48 hours. Do not sendheadersfor private pages you do not want to be re-fetched.
Availability
The whole /v1/** surface (capabilities, GET /v1/account, this documentation and
everything under /v1/watch) shares a single server-side switch. When the operator
has it off, every /v1 route answers 404 with code 11004 — that is a
deliberate, uniform state, not a routing mistake. GET /api/v1/healthz and
GET /api/v1/readyz stay available either way.
Authentication
- HTTP: Bearer Auth
- API Key: apiKeyHeader
- HTTP: Bearer Auth
- API Key: cookieAuth
An API key created in the console. Per-endpoint scopes are enforced.
Security Scheme Type: | http |
|---|---|
HTTP Authorization Scheme: | bearer |
Bearer format: | flw_<env><key_id><secret> |
The same API key sent as a plain header instead of a bearer token.
Security Scheme Type: | apiKey |
|---|---|
Header parameter name: | X-API-Key |
Session token obtained by signing in to the console. This service only verifies it — it never issues one. A session is the account owner and is not restricted by scopes.
Security Scheme Type: | http |
|---|---|
HTTP Authorization Scheme: | bearer |
Bearer format: | JWT |
The same session token as a cookie. Browsers send it automatically on the shared domain; write requests additionally check the request origin (CSRF protection).
Security Scheme Type: | apiKey |
|---|---|
Cookie parameter name: | flowda_token |