{"openapi":"3.1.0","info":{"title":"Fous API","version":"1.0.0","description":"Build methods for websites (one capability on one site each), all your organization’s own, and run them. Search is free; a run costs 1 credit; failures are free; a plan includes builds and improvements each month at no credit cost (Free: 3 in all, started in Fous Studio). Workflows chain your methods into one process (a trigger, then steps), drafted by AI from a sentence: 1 credit per method, AI and email step; transforms and webhooks are free. The same capabilities are MCP tools at /mcp."},"externalDocs":{"description":"Documentation index for agents","url":"https://docs.fous.com/llms.txt"},"servers":[{"url":"https://api.fous.com"}],"security":[{"bearer":[]}],"tags":[{"name":"Methods","description":"Find your methods, read their contracts, switch versions, delete them."},{"name":"Runs","description":"Run a method with your own input and get the result."},{"name":"Builds","description":"Build a method, steer it with messages, and follow it to the end."},{"name":"Connections","description":"Website logins and API keys that methods run with."},{"name":"Workflows","description":"The schedule, loop, filter and delivery around your methods for websites, written by AI from a sentence: a trigger (by hand, a schedule or a webhook), then steps that run methods, run transforms (JavaScript the AI writes), loop, wait, send email and call webhooks (to reach Slack, Zapier, Make, n8n or an ERP, send to their webhook). A method the workflow needs and your organization lacks becomes a pending step, built when you accept it."},{"name":"Account","description":"The organization behind the key."}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"A Fous API key (fous_sk_…), sent as Authorization: Bearer. Keys work on every plan; on Free a key runs and reads methods, and a build started with one answers 403 plan_limit (limit.kind api)."}},"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["invalid_request","unauthorized","forbidden","insufficient_credits","connection_required","plan_limit","not_found","request_timeout","conflict","invalid_input","request_refused","not_buildable","rate_limited","server_error","upstream_error","upstream_blocked","upstream_geo_blocked","run_traffic_limit","traffic_budget_reached","method_unavailable","method_repairing","upstream_timeout","service_unavailable"],"description":"Stable code to branch on."},"message":{"type":"string","description":"What happened, in one or two plain sentences."},"next_step":{"type":"string","description":"What to do now, in one sentence."},"doc_url":{"type":"string","description":"This code’s entry in the errors guide (a policy refusal: the policy)."},"request_id":{"type":"string","description":"The X-Request-Id of this request: quote it to support."},"reason":{"type":"string","description":"A finer cause when one helps: site_rate_limited, spend_limit, stopped, build_ended, body_too_large, sign_in_busy, step_expired, or (request_refused) the request check’s verdict: explicit, harmful or platform_probe."},"retryable":{"type":"boolean","description":"On a failed run: whether trying again can help (a block, a slow or failing site)."},"may_have_run":{"type":"boolean","description":"A method with side effects failed after its request reached the site: check the site before running it again."},"retry_after":{"type":"integer","description":"Seconds to wait before trying again: the plan’s (rate_limited, with Retry-After), Fous’s (service_unavailable) or the site’s, when it said."},"param":{"type":"string","description":"The parameter at fault: input.<name> for an input, method for a method."},"errors":{"type":"array","description":"invalid_input: every input that does not fit, all at once. A required input that a misspelled name was meant for is listed as missing too; the message counts the two once. invalid_request on a workflow: each problem in its definition or a run’s input, at its path (steps[2].input.query).","items":{"anyOf":[{"type":"object","required":["path","message"],"properties":{"path":{"type":"string","description":"Where the problem is."},"message":{"type":"string"}}},{"type":"object","required":["field","problem","message"],"properties":{"field":{"type":"string"},"problem":{"type":"string","enum":["unknown","missing","type","enum","range","invalid"]},"message":{"type":"string"},"did_you_mean":{"type":"string","description":"unknown: the input it most likely meant."},"expected":{"type":"string","description":"type: the type it takes."},"allowed":{"type":"array","items":{},"description":"enum: the values it takes."}}}]}},"method":{"type":"string","description":"invalid_input: the method whose inputs these are."},"input_schema":{"type":"object","description":"invalid_input: the method’s own input_schema, exactly as stored."},"example":{"description":"invalid_input: a call that fits ({method, input}), from the method’s saved example (a write method’s is built from its schema). not_buildable: a request phrased so it can be built."},"did_you_mean":{"type":"string","description":"not_found: the method slug it most likely meant."},"suggestions":{"type":"array","items":{"type":"object"},"description":"not_found: methods close to the name ({id, slug, name, summary})."},"alternatives":{"type":"array","items":{"type":"object"},"description":"method_repairing: methods that do the same."},"version":{"type":"integer","description":"method_repairing: the version under repair."},"latest_version":{"type":"integer","description":"method_repairing: the method’s newest version; not_found for a version: the newest one there is."},"repair":{"type":"object","description":"method_repairing: when the version is expected back.","properties":{"expected_at":{"type":"string","format":"date-time"},"back_in_minutes":{"type":"integer"}}},"connect":{"type":"object","description":"connection_required: the site and connection type to connect, and connection_id when your organization already has a connection for the site.","properties":{"site":{"type":"string"},"type":{"type":"string","enum":["session","api_key"]},"connection_id":{"type":"string"},"status":{"type":"string","enum":["pending","active","needs_attention"],"description":"The status of your connection, when you have one."}}},"connect_url":{"type":"string","description":"connection_required: the Fous Studio page where a person connects the account (your connection for the site, or a new one). A login also signs in with POST /v1/connections/{id}/sign-in."},"billing_url":{"type":"string","description":"insufficient_credits: where to get more (on Free: buy 200 credits for $12 or choose a plan in Studio, or wait for next month’s free credits; on Starter, Pro and Business: turn on extra credits or raise their monthly limit); plan_limit: where to change plans."},"available_credits":{"type":"number","description":"insufficient_credits: the credits the organization has left."},"required_credits":{"type":"integer","description":"insufficient_credits: what the run costs, in credits."},"spend_limit":{"type":"object","description":"insufficient_credits with reason spend_limit: the monthly limit, what was spent, in credits, and when it resets.","properties":{"limit":{"type":"number"},"spent":{"type":"number"},"resets_at":{"type":"string","format":"date-time"}}},"limit_credits":{"type":"number","description":"insufficient_credits with reason spend_limit: spend_limit.limit."},"spent_credits":{"type":"number","description":"insufficient_credits with reason spend_limit: spend_limit.spent."},"limit":{"type":"object","description":"rate_limited or plan_limit: the plan limit met, and its value when the plan sets one. plan_limit kinds: logins (saved logins), sites (sites with methods), builds (Free’s 3 builds), api (on Free: a build started with a key or MCP, or a webhook trigger), chat_messages (Free’s AI messages: chats, workflows from a prompt, transforms’ code; with plan: the plan to move to). next_step says the one step that raises the limit: an add-on on Pro and Business, else the plan with more. rate_limited kinds: requests_per_minute, concurrent_runs, searches_per_minute, ai_per_minute (AI calls a minute that are not messages, such as the intent of Studio’s prompt box), chat_per_minute (AI messages a minute: chats, workflows from a prompt, transforms’ code), concurrent_builds (builds running at once).","properties":{"kind":{"type":"string","enum":["requests_per_minute","concurrent_runs","searches_per_minute","logins","sites","builds","api","chat_messages","chat_per_minute","email_recipients","concurrent_builds","ai_per_minute"]},"value":{"type":"integer"}}},"run_id":{"type":"string","description":"The failed run (failures are free)."}},"additionalProperties":true}}},"InputSchema":{"type":"object","description":"A flat JSON Schema object: snake_case properties with descriptions; required lists the inputs a call must send.","additionalProperties":true},"Auth":{"type":"object","required":["required"],"properties":{"required":{"type":"boolean","description":"Whether the method runs with a connected account."},"type":{"type":"string","enum":["session","api_key"],"description":"session: a website login; api_key: the site’s own API key."},"connection":{"type":["string","null"],"description":"Your default connection for this site, if any."}}},"MethodRef":{"type":"object","required":["id","slug","name"],"properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"version":{"type":"integer","description":"The version, when one is meant."}}},"MethodStats":{"type":"object","description":"How the method has done so far.","properties":{"success_rate":{"type":["number","null"]},"runs":{"type":"integer"},"last_success_at":{"type":["string","null"]}}},"Method":{"type":"object","required":["id","slug","name","description","returns","site","site_name","input_schema","effect","auth","cost","version","current_version","latest_version"],"properties":{"id":{"type":"string","description":"mth_ followed by 26 characters."},"slug":{"type":"string","description":"<domain>/<snake_case_name>, one method’s own; accepted wherever an id is."},"name":{"type":"string"},"description":{"type":"string"},"returns":{"type":"string","description":"What the output holds, in a few words."},"site":{"type":"string","description":"The site’s domain, like carrier.example.com."},"site_name":{"type":"string","description":"The site’s name, like Example Carrier."},"input_schema":{"$ref":"#/components/schemas/InputSchema"},"auth":{"$ref":"#/components/schemas/Auth"},"effect":{"type":"string","enum":["read","write"],"description":"read: it gets data. write: it does something on the site (submits, posts, books, sends); run it with care."},"cost":{"type":"object","properties":{"credits":{"type":"integer"}}},"version":{"type":"integer","description":"The version shown: the current one, or the one the ref named (@N). A version is a contract: its inputs and outputs never change."},"current_version":{"type":"integer","description":"The version your calls run when they name none. A new version never moves it: switch with PATCH {\"current_version\": N}."},"latest_version":{"type":"integer","description":"The method’s newest version."},"status":{"type":"string","enum":["degraded","repairing"],"description":"On a build’s method, present only when the version is not ready: degraded (failing: its saved examples stopped answering, and no run has answered since; runs are still attempted, and Fous repairs it) or repairing (a repair confirmed the break while runs failed too; runs are refused with 503 method_repairing until it ends, at the latest at repair.expected_at)."},"repair":{"type":"object","description":"Only while repairing: when the version is back at the latest. A repair that has not confirmed a break is never shown.","required":["expected_at","back_in_minutes"],"properties":{"expected_at":{"type":"string","format":"date-time"},"back_in_minutes":{"type":"integer"}}},"last_repair":{"type":"object","description":"While degraded, when a repair ran and could not fix the version: when it ended and why, in its own words. Fous checks the version every hour and repairs it again later.","required":["at","reason"],"properties":{"at":{"type":"string","format":"date-time"},"reason":{"type":"string","example":"Fous could not get the method working again; it stays as it is."}}}}},"MethodDetail":{"type":"object","required":["id","slug","name","description","returns","site","site_name","input_schema","effect","auth","cost","version","current_version","latest_version","revision","status","versions","output_schema","stats"],"properties":{"id":{"type":"string","description":"mth_ followed by 26 characters."},"slug":{"type":"string","description":"<domain>/<snake_case_name>, one method’s own; accepted wherever an id is."},"name":{"type":"string"},"description":{"type":"string"},"returns":{"type":"string","description":"What the output holds, in a few words."},"site":{"type":"string","description":"The site’s domain, like carrier.example.com."},"site_name":{"type":"string","description":"The site’s name, like Example Carrier."},"input_schema":{"$ref":"#/components/schemas/InputSchema"},"auth":{"$ref":"#/components/schemas/Auth"},"effect":{"type":"string","enum":["read","write"],"description":"read: it gets data. write: it does something on the site (submits, posts, books, sends); run it with care."},"cost":{"type":"object","properties":{"credits":{"type":"integer"}}},"version":{"type":"integer","description":"The version shown: the current one, or the one the ref named (@N). A version is a contract: its inputs and outputs never change."},"current_version":{"type":"integer","description":"The version your calls run when they name none. A new version never moves it: switch with PATCH {\"current_version\": N}."},"latest_version":{"type":"integer","description":"The method’s newest version."},"status":{"type":"string","enum":["ready","degraded","repairing"],"description":"How the version shown stands: ready (any answer with data makes it ready at once); degraded (failing: its saved examples stopped answering, and no run has answered since; runs are still attempted, and Fous repairs it); repairing (a repair confirmed the break while runs failed too; runs are refused with 503 method_repairing until it ends, at the latest at repair.expected_at)."},"repair":{"type":"object","description":"Only while repairing: when the version is back at the latest. A repair that has not confirmed a break is never shown.","required":["expected_at","back_in_minutes"],"properties":{"expected_at":{"type":"string","format":"date-time"},"back_in_minutes":{"type":"integer"}}},"last_repair":{"type":"object","description":"While degraded, when a repair ran and could not fix the version: when it ended and why, in its own words. Fous checks the version every hour and repairs it again later.","required":["at","reason"],"properties":{"at":{"type":"string","format":"date-time"},"reason":{"type":"string","example":"Fous could not get the method working again; it stays as it is."}}},"stats":{"$ref":"#/components/schemas/MethodStats"},"revision":{"type":"integer","description":"How many times the version shown was revised in place (a repair or an improvement that kept its contract); the seen parameter carries it."},"latest_changes":{"type":"string","description":"When the version shown is not the latest: what the latest changes against it, in a sentence or two."},"versions":{"type":"array","description":"The method’s versions, newest first (at most 20).","items":{"type":"object","required":["version","revision","status","created_at","changes"],"properties":{"version":{"type":"integer"},"revision":{"type":"integer"},"latest":{"type":"boolean","enum":[true],"description":"The newest version."},"current":{"type":"boolean","enum":[true],"description":"The version your calls run when they name none."},"status":{"type":"string","enum":["ready","degraded","repairing"]},"created_at":{"type":"string"},"revised_at":{"type":"string","description":"When it was last revised in place."},"changes":{"type":"string","description":"What it changes against the version before it; empty for the first."}}}},"output_schema":{"type":"object","description":"The JSON Schema every run’s data follows."},"example":{"type":"object","properties":{"input":{"type":"object"},"output":{}}}}},"MethodListItem":{"type":"object","required":["id","slug","name","description","returns","site","site_name","input_schema","effect","auth","cost","version","current_version","latest_version","status","stats","created_at","updated_at"],"properties":{"id":{"type":"string","description":"mth_ followed by 26 characters."},"slug":{"type":"string","description":"<domain>/<snake_case_name>, one method’s own; accepted wherever an id is."},"name":{"type":"string"},"description":{"type":"string"},"returns":{"type":"string","description":"What the output holds, in a few words."},"site":{"type":"string","description":"The site’s domain, like carrier.example.com."},"site_name":{"type":"string","description":"The site’s name, like Example Carrier."},"input_schema":{"$ref":"#/components/schemas/InputSchema"},"auth":{"$ref":"#/components/schemas/Auth"},"effect":{"type":"string","enum":["read","write"],"description":"read: it gets data. write: it does something on the site (submits, posts, books, sends); run it with care."},"cost":{"type":"object","properties":{"credits":{"type":"integer"}}},"version":{"type":"integer","description":"The version shown: the current one, or the one the ref named (@N). A version is a contract: its inputs and outputs never change."},"current_version":{"type":"integer","description":"The version your calls run when they name none. A new version never moves it: switch with PATCH {\"current_version\": N}."},"latest_version":{"type":"integer","description":"The method’s newest version."},"status":{"type":"string","enum":["ready","degraded","repairing"],"description":"How the version shown stands: ready (any answer with data makes it ready at once); degraded (failing: its saved examples stopped answering, and no run has answered since; runs are still attempted, and Fous repairs it); repairing (a repair confirmed the break while runs failed too; runs are refused with 503 method_repairing until it ends, at the latest at repair.expected_at)."},"repair":{"type":"object","description":"Only while repairing: when the version is back at the latest. A repair that has not confirmed a break is never shown.","required":["expected_at","back_in_minutes"],"properties":{"expected_at":{"type":"string","format":"date-time"},"back_in_minutes":{"type":"integer"}}},"last_repair":{"type":"object","description":"While degraded, when a repair ran and could not fix the version: when it ended and why, in its own words. Fous checks the version every hour and repairs it again later.","required":["at","reason"],"properties":{"at":{"type":"string","format":"date-time"},"reason":{"type":"string","example":"Fous could not get the method working again; it stays as it is."}}},"stats":{"$ref":"#/components/schemas/MethodStats"},"created_at":{"type":"string"},"updated_at":{"type":"string"}}},"Run":{"type":"object","required":["id","status","credits","created_at","completed_at"],"properties":{"id":{"type":"string","description":"run_ followed by 26 characters. Its record stays readable for 30 days on every plan; its input and result expire after the plan’s run_history_hours (Free 24 hours)."},"status":{"type":"string","enum":["running","completed","failed","canceled"],"description":"A failed or canceled run has error and no data. POST /v1/runs and GET /v1/runs/{id} answer a failed or canceled run with the error itself, at its status (403, 409, 422, 503…); the run list and POST /v1/runs/{id}/cancel show it as this object."},"method":{"type":"object","description":"The method and the version that ran.","properties":{"id":{"type":"string"},"slug":{"type":["string","null"]},"version":{"type":"integer"},"latest_version":{"type":"integer","description":"The method’s newest version."}}},"error":{"$ref":"#/components/schemas/Error/properties/error","description":"A failed or canceled run: its error object (code, message, next_step, run_id, and whatever the code carries). A canceled run has code conflict with reason stopped."},"data":{"description":"The result, shaped by the method’s output_schema. null once expired."},"notice":{"type":"string","description":"A completed run that came back empty or incomplete while the version is under repair: it cost nothing, and when the repair is back at the latest."},"empty":{"type":"boolean","description":"The site answered and has nothing for this input (still a success)."},"raw":{"description":"With include_raw: the site’s own response."},"truncated":{"type":"boolean","description":"The answer is not complete: the site had more than the run could read, or the output was over 10 MB and its longest list was cut. missing says what."},"missing":{"type":"array","items":{"type":"string"},"description":"What the answer lacks, in plain words (a source that failed, items that could not be read, pages not read). Only when something is."},"credits":{"type":"integer","description":"What it was charged, in credits."},"cost":{"type":"object","deprecated":true,"description":"Deprecated: read credits. The same figure, as runs reported it before credits; on every run that ended.","properties":{"credits":{"type":"integer"}}},"duration_ms":{"type":["integer","null"]},"expired":{"type":"boolean","description":"The run’s input and result are gone (the plan’s run_history_hours passed): data is null, and its record stays for 30 days."},"created_at":{"type":"string","format":"date-time"},"completed_at":{"type":["string","null"],"format":"date-time"}}},"RunList":{"type":"object","required":["runs","has_more"],"properties":{"runs":{"type":"array","items":{"type":"object","required":["id","status","method","created_at","completed_at","credits"],"properties":{"id":{"type":"string"},"status":{"type":"string","enum":["running","completed","failed","canceled"]},"method":{"type":["object","null"],"description":"The method and version that ran; null when it no longer exists.","properties":{"id":{"type":"string"},"slug":{"type":["string","null"]},"version":{"type":["integer","null"]}}},"created_at":{"type":"string","format":"date-time"},"completed_at":{"type":["string","null"],"format":"date-time"},"credits":{"type":"integer","description":"What it was charged, in credits."},"duration_ms":{"type":["integer","null"]},"expired":{"type":"boolean","description":"Its input and result are gone: both are null."},"input":{"description":"What it was given, until it expires."},"data":{"description":"Its result, until it expires."},"error":{"$ref":"#/components/schemas/Error/properties/error","description":"A failed or canceled run, until its input and result expire."}}}},"has_more":{"type":"boolean","description":"More runs are older: send before with the last run’s id."}}},"Build":{"type":"object","required":["id","status","kind","prompt","events","created_at"],"properties":{"id":{"type":"string","description":"bld_ followed by 26 characters."},"status":{"type":"string","enum":["building","ready","requires_auth","unsupported"],"description":"building: still going. ready: method is what it made. requires_auth: it waits for a connected account on the site and goes on by itself once there is one. unsupported: it ended without a method; reason says why."},"kind":{"type":"string","enum":["new","change","repair"],"description":"new: a new method. change: a change of the method in based_on, which improves its version in place when the contract stays, else makes its next version (your calls run it once you switch). repair: Fous repairing a version of your method."},"effect":{"type":"string","enum":["read","write"],"description":"What the method does: read gets data; write does something on the site, which the build does once for real."},"prompt":{"type":"string","description":"What the person asked for, in their own words."},"images":{"type":"array","items":{"type":"object","required":["url"],"properties":{"url":{"type":"string","format":"uri","description":"GET it with your key."}}},"description":"The images sent with the request."},"site":{"type":"string","description":"The site’s domain, when it is known."},"queue":{"type":"object","description":"A change waiting for the one running on the same method (one change at a time per method, repairs first): how many are ahead of it.","required":["ahead"],"properties":{"ahead":{"type":"integer"}}},"events":{"type":"array","description":"What the build said as it worked, oldest first.","items":{"type":"object","required":["at","kind","message"],"properties":{"at":{"type":"string"},"kind":{"type":"string","enum":["note","status"],"description":"note: what the builder found or decided, in its own words. status: what it is doing (the latest is the live line)."},"message":{"type":"string"}}}},"messages":{"type":"array","description":"What the person sent to the build, oldest first.","items":{"type":"object","required":["at","text","seen"],"properties":{"at":{"type":"string"},"text":{"type":"string"},"images":{"type":"array","items":{"type":"object","required":["url"],"properties":{"url":{"type":"string","format":"uri","description":"GET it with your key."}}}},"seen":{"type":"boolean","description":"The builder took it in. One it did not take in went on to the next build (next), unless the build had done its action on the site."}}}},"follows":{"type":"string","description":"The build of the same thread this one goes on from."},"next":{"type":"string","description":"The next build of the thread: messages this one did not take in went on there."},"reason":{"type":"string","description":"Why it ended as it did, in a plain sentence; for a version your organization is not on, what it changes and how to switch."},"outcome":{"type":"object","description":"Once ended, what the build made: improved (the version revised in place), new_version (your calls run it once you switch with PATCH {\"current_version\": N}), new_method or repaired.","required":["type"],"properties":{"type":{"type":"string","enum":["improved","new_version","new_method","repaired"]},"version":{"type":"integer"}}},"may_have_run":{"type":"boolean","description":"A write build ended unsure whether its action reached the site: check there before asking again."},"based_on":{"$ref":"#/components/schemas/MethodRef","description":"The method and version it changes."},"method":{"$ref":"#/components/schemas/Method"},"performed":{"type":"boolean","description":"A write build did the action once, for real."},"result":{"type":"object","properties":{"data":{}},"description":"performed: what the site answered."},"estimate":{"type":"object","description":"While building: how long recent builds took. low_seconds to high_seconds is the middle half; median_seconds is the middle one.","properties":{"low_seconds":{"type":"integer"},"high_seconds":{"type":"integer"},"median_seconds":{"type":"integer"},"samples":{"type":"integer"}}},"created_at":{"type":"string"},"completed_at":{"type":"string"}}},"Connection":{"type":"object","required":["id","site","site_name","type","status","default"],"properties":{"id":{"type":"string","description":"conn_ followed by 26 characters."},"site":{"type":"string","description":"The site’s domain, like example.com."},"site_name":{"type":"string","description":"The site’s name, like Example."},"type":{"type":"string","enum":["session","api_key"],"description":"session: a website login; api_key: the site’s own API key."},"status":{"type":"string","enum":["pending","active","needs_attention"],"description":"pending: not signed in yet. active: runs use it. needs_attention: the site signed it out, or the key stopped working; sign in again (connect_url, or POST /v1/connections/{id}/sign-in)."},"default":{"type":"boolean","description":"Runs on this site use it unless a call names another. A site’s logins and its API keys each have their own default."},"account_hint":{"type":["string","null"],"description":"What account this is: session, the identifier it signed in with, in full; api_key, the last characters of the saved key."},"label":{"type":["string","null"],"description":"The organization’s name for the account (\"US warehouse\"), to tell several on one site apart; null: none."},"connect_url":{"type":"string","description":"session, until active or while it signs in again: a Fous Studio page where a person signs in to this connection."},"country":{"type":"string","description":"session only: the country the login signs in and every run on it leaves from."},"renewal":{"type":"object","description":"session only: whether the login can sign back in by itself when its session ends. status ready: it can; needs_setup: it needs an authenticator key (PATCH totp) or verification emails forwarded to inbound_email; manual: only a person can (device approval, no saved password, or the site turned the saved details down). message says which, in a sentence for people.","required":["status","factor","message"],"properties":{"status":{"type":"string","enum":["ready","needs_setup","manual"]},"factor":{"type":"string","enum":["none","totp","email","sms","code","device"],"description":"The second factor sign-in saw last: none, an authenticator (totp), an emailed or texted code, code when the screen did not say from where, or approval on a device."},"message":{"type":"string"},"inbound_email":{"type":"string","description":"The address to forward this login’s verification emails to (in_<token>@…). Whoever knows it can deliver codes to its sign-in."},"totp_saved":{"type":"boolean","description":"true when an authenticator key is saved on this login. The key itself is never returned."}}},"waiting_workflows":{"type":"array","items":{"type":"string"},"description":"needs_attention, when this one connection is read: the names of the workflows waiting on it."},"sign_in":{"$ref":"#/components/schemas/SignIn"},"sign_in_ended":{"type":"object","description":"A sign-in the call waited on ended without signing in. An account connected before is unchanged.","required":["reason","message"],"properties":{"reason":{"type":"string","enum":["cancelled"]},"message":{"type":"string"}}},"message":{"type":"string","description":"POST /v1/connections for a site whose login is already connected: states that runs use this connection and how to add another."},"checked_at":{"type":["string","null"]},"created_at":{"type":"string"}}},"SignIn":{"type":"object","description":"A website sign-in, while it runs and for a while after it failed. Answer its step with POST /v1/connections/{id}/sign-in.","required":["status","message","fields","choices"],"properties":{"status":{"type":"string","enum":["working","input","approval","failed"],"description":"working: Fous is on the site, wait (GET /v1/connections/{id}?wait=). input: the site asks for fields or a choice, or Fous asks how to go on (question). approval: the person approves the sign-in on their device or by email, wait. failed: message says why."},"step_id":{"type":"string","description":"input and approval: the step an answer is for."},"message":{"type":"string","description":"What the site asks for, or why it failed, in a sentence for the person."},"code":{"type":"string","description":"approval: the number the site shows, which the person picks on their device."},"factor":{"type":"string","enum":["totp","email","sms","code","device"],"description":"A code or approval step: the second factor it asks for. totp: an authenticator app; email or sms: where the code was sent; code: the screen did not say; device: approval on a device."},"try_country":{"type":"boolean","description":"failed: the site could not be opened or says it does not serve this country; signing in again with country may work."},"rejected":{"type":"boolean","description":"input: true when the website turned down the last answer; message says so and the same fields are asked again."},"question":{"type":"boolean","description":"input: Fous could not tell how to sign in from this page and asks; message says what it sees, choices are the page’s ways forward. Answer with a choice, or with hint (what to do, or the sign-in page’s address). It waits at most 3 idle minutes, then the browser closes."},"screenshot":{"type":"string","description":"question, repeated or check: a picture of the page as Fous sees it (a JPEG data URL), with what is typed in its fields hidden."},"repeated":{"type":"boolean","description":"input: the website came back to the step just answered without saying the answer was wrong. message says why, in the page’s own words when it gave any; the same fields or choices are asked again."},"check":{"type":"boolean","description":"input: the website shows a check that a person is there, which Fous’s browser did not pass by itself. The person completes it in screenshot: send each click as click with step_id. Fous never solves a check itself; a sign-in with no person reports that one is needed."},"started_at":{"type":"string","format":"date-time","description":"When the sign-in started."},"fields":{"type":"array","description":"What the site asks for. Values are never stored or returned.","items":{"$ref":"#/components/schemas/SignInField"}},"choices":{"type":"array","description":"input: ways to go on (send one as choice), such as where to send a code.","items":{"type":"object","required":["id","label"],"properties":{"id":{"type":"string"},"label":{"type":"string"}}}},"expires_at":{"type":"string","description":"When the sign-in ends unless it moves on."}}},"SignInField":{"type":"object","required":["id","label","type","required"],"properties":{"id":{"type":"string","description":"The key of its value in fields."},"label":{"type":"string","description":"What to ask the person for."},"type":{"type":"string","enum":["email","text","password","code","select","checkbox","link"],"description":"checkbox: true or false. select: one of options’ values. link: a sign-in link the person copies from an email without opening it. Every other type: text."},"required":{"type":"boolean"},"options":{"type":"array","description":"select: the values it takes.","items":{"type":"object","required":["value","label"],"properties":{"value":{"type":"string"},"label":{"type":"string"}}}},"length":{"type":"integer","description":"code: how many characters, when known."}}},"WorkflowDefinition":{"type":"object","required":["trigger","steps"],"description":"A trigger, then steps. Text in a method’s input, a loop’s over, an email and a webhook may hold templates: {{trigger.<key>}}, {{steps.<key>.<path>}}, {{loop.item}}, {{loop.index}}, {{run.id}}, {{run.started_at}}, {{now}}, {{previous.steps.<key>.<path>}} (the workflow’s last successful run; null on a first run), with filters ({{steps.search.data.results | length}}). A text that is exactly one template keeps the value’s type; a path that leads nowhere is null. A transform’s code reads the same data as data.trigger, data.steps.<key>, data.loop and data.previous.","properties":{"trigger":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["manual","schedule","webhook"],"description":"Every workflow can also be run by hand with POST /v1/workflows/{id}/runs."},"inputs":{"type":"array","maxItems":20,"description":"What a run takes, read as {{trigger.<key>}}.","items":{"type":"object","required":["key","type"],"properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string"},"type":{"type":"string","enum":["string","number","boolean"]},"required":{"type":"boolean"},"default":{"type":["string","number","boolean","null"]},"description":{"type":"string"}}}},"schedule":{"type":"object","required":["frequency"],"description":"type schedule only.","properties":{"frequency":{"type":"string","enum":["minutes","hourly","daily","weekdays","weekly","monthly"],"description":"minutes: every N minutes; hourly: every N hours; daily, weekly and monthly: at `at`, every N days, weeks or months; weekdays: Monday to Friday at `at`."},"every":{"type":"integer","minimum":1,"description":"N. Not used by weekdays: leave it out or send 1."},"at":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$","description":"HH:MM, daily, weekdays, weekly and monthly."},"day":{"type":"integer","minimum":-1,"maximum":31,"description":"monthly: the day of the month, 1 to 31, or -1 for the last day (default 1). A day a month does not have (31 in April, 30 in February) is its last day."},"weekday":{"type":"integer","minimum":0,"maximum":6,"description":"weekly: 0 is Sunday."},"timezone":{"type":"string","description":"An IANA time zone, like Europe/Prague. Default UTC."},"input":{"type":"object","description":"The input a scheduled run takes."}}}}},"steps":{"type":"array","minItems":1,"description":"Any number of steps, loops nested as deep as needed; the definition is at most 200 KB.","items":{"$ref":"#/components/schemas/WorkflowStep"}}}},"WorkflowStep":{"type":"object","required":["type"],"description":"One step. method runs one of your methods (an ordinary run); ai has a model answer its prompt on every run (summarize, classify, extract, write); transform runs JavaScript the AI wrote from its instruction when the workflow was saved (the same code every run, no AI then) over the data so far: filter by values, dedupe, sort, compare, compute, reshape; filter (\"Only continue if\") ends the run quietly, successful, when its conditions do not hold (inside a loop: skips the rest of that item); loop runs its steps once per item; delay waits; email sends a plain-text email; webhook POSTs JSON to a public https address. method, ai and email cost 1 credit each; the others are free.","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$","description":"Unique in the whole workflow; what templates (steps.<key>) and code (data.steps.<key>) read the step’s output by. Left out, it is made from the name (List invoices: list_invoices)."},"name":{"type":"string","maxLength":120,"description":"Plain words a person reads."},"type":{"type":"string","enum":["method","ai","transform","filter","loop","delay","email","webhook"]},"method":{"type":["string","null"],"description":"method: the method’s slug; null while its method is pending."},"pending":{"type":"object","description":"method: a method your organization does not have yet. The workflow cannot run or be turned on while a step is pending: accept building it with POST /v1/workflows/{id}/steps/{key}/build (status building, then the step runs the new method, its input and the later steps wired to it by AI). failed: reason says why the build did not make it; building again tries again.","required":["need","build_prompt","build_id","status"],"properties":{"need":{"type":"string","description":"What the method does, in plain words."},"build_prompt":{"type":"string","description":"What the builder is asked to make."},"site":{"type":["string","null"],"description":"The website to build on (a domain or sign-in host). Without one the step cannot be built (409 site_required) and is listed in incomplete; send site to POST /v1/workflows/{id}/steps/{key}/build."},"build_id":{"type":["string","null"],"description":"Its build, once accepted."},"status":{"type":"string","enum":["proposed","building","failed"]},"reason":{"type":"string","description":"failed: why."}}},"input":{"description":"method: its input, an object; any value may be a template. A required input left empty makes the workflow incomplete until it is filled in. ai: more data its prompt is about, a template or an object of them, sent with the prompt; null (default): the prompt alone. Writing the data’s templates in the prompt itself does the same."},"connection":{"type":["string","null"],"description":"method: the conn_ id to run with; null for the site’s default."},"on_error":{"type":"string","enum":["stop","continue"],"description":"method: stop (default) fails the run; continue records the failure and goes on."},"instruction":{"type":"string","maxLength":2000,"description":"transform: what the step does, in plain words. Change it and send the code as it was saved (or empty), and the code is written again from it when the workflow is saved; code you changed is kept."},"code":{"type":"string","maxLength":50000,"description":"transform: the body of function (data, stop) that returns the step’s output (JSON). data is {trigger, steps: {<key>: output}, loop?: {item, index}, previous: the workflow’s last successful run before this one as {run_id, finished_at, trigger, steps: {<key>: output}}, or null on its first run, state: the step’s own memory across runs, an object ({} at first) that the next run starts from as this code leaves it once its run completes (top-level transforms; at most 256 KB; the ids already seen, for “only new items”)}; stop(reason) ends the run quietly, successful, like a filter (inside a loop: skips the rest of that item); prefer a filter step for conditions it can test. It runs in an isolated JavaScript sandbox: no network, files or modules, 2 seconds and 64 MB at most. Sent empty with an instruction, Fous writes it with AI when the workflow is saved; code you write is kept as written."},"prompt":{"type":"string","maxLength":10000,"description":"ai: what to write or decide, in plain words; templates read the data (a list, an object or a long text a template writes in is sent as the prompt’s data, so the prompt’s own words are never cut). A model answers on every run: it reads about 10,000 tokens (prompt and data; longer data is shortened, and the model is told) and writes up to about 800 words. Output: {text}, or with fields an object with each field’s text. A failed answer (the model declined, ran out of room, or did not answer) fails the step and costs nothing."},"fields":{"type":"array","maxItems":10,"items":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"description":"ai: answer these fields (short text each) instead of one text, read as {{steps.<key>.<field>}}. Default []."},"conditions":{"type":"array","minItems":1,"maxItems":10,"description":"filter: what must hold for the run to go on. value is a template; op one of exists, not_exists (empty: null, \"\", [] or {}), equals, not_equals, contains, not_contains (text in any case; a list by its items), gt, gte, lt, lte (numbers, a numeric text too; a list by its length); compare is text or a template, for the operators that compare. When the filter does not pass, its record is filtered with output {passed: false, message: \"Stopped: …\", skipped: the action steps it skipped}.","items":{"type":"object","required":["value","op"],"properties":{"value":{"type":"string"},"op":{"type":"string","enum":["exists","not_exists","equals","not_equals","contains","not_contains","gt","gte","lt","lte"]},"compare":{"type":"string"}}}},"match":{"type":"string","enum":["all","any"],"description":"filter: all (default) of its conditions, or any one."},"over":{"type":"string","description":"loop: a template that gives a list (a text is split at commas and new lines)."},"max":{"type":"integer","minimum":1,"description":"loop: at most this many items (the rest are left out): any number, each item’s method, AI and email steps costing credits. Left out: 10, and 5 on Free."},"steps":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowStep"},"description":"loop: its steps."},"seconds":{"type":"integer","minimum":1,"maximum":86400,"description":"delay."},"to":{"type":"string","description":"email: addresses separated by commas; empty: the workflow is saved incomplete until it is filled in. On Free, Starter and Pro, only people in your organization (their sign-in addresses); on Business and Enterprise, anyone. It comes from \"<workflow name> via Fous\" <workflows@fous.com>, and replies go to the person who made the workflow."},"subject":{"type":"string","maxLength":300,"description":"email."},"body":{"description":"email: the plain-text body (line breaks kept). webhook: the JSON to send, a template or an object of them; left out, the previous step’s output."},"url":{"type":"string","description":"webhook: a public https address; empty: the workflow is saved incomplete until it is filled in. Each POST carries X-Fous-Workflow, X-Fous-Run, X-Fous-Signature (t=<unix seconds>,v1=<HMAC-SHA256 in hex of \"<t>.<body>\" with the workflow’s signing_secret>) and an Idempotency-Key that is the same on every attempt of the step (receivers dedupe on it: Fous retries on 5xx, 408, 429 and connection failures, and a run taken up again sends what it recorded under it; one that got no answer in time is not sent again), plus the step’s headers."},"headers":{"type":"array","maxItems":10,"description":"webhook: headers sent with each POST, for a receiver that needs a key or a token (Authorization, X-API-Key). Their values are write-only secrets: sent as value to set one (empty text clears it), left out to keep the saved one; answers and run records never hold them, only a masked hint (null: no value yet, and the workflow is incomplete until it has one). Not Host, Content-Type, Content-Length, Idempotency-Key, Connection, Transfer-Encoding or X-Fous-*.","items":{"type":"object","required":["name"],"properties":{"name":{"type":"string","maxLength":100,"example":"Authorization"},"value":{"type":"string","maxLength":4000,"writeOnly":true,"description":"Sent only: the value to save."},"hint":{"type":["string","null"],"readOnly":true,"description":"The saved value masked (its last 4 characters when long), or null.","example":"••••••••3f9a"}}}}}},"WorkflowQuestion":{"type":"object","required":["text","options","placeholder","allow_other"],"description":"A question the AI asks before it builds: which website or account a step uses, or a choice with no sensible default. options are realistic choices (value: a domain or sign-in host); allow_other: the person may type their own.","properties":{"text":{"type":"string"},"options":{"type":"array","items":{"type":"object","required":["label","value"],"properties":{"label":{"type":"string"},"value":{"type":"string"}}}},"placeholder":{"type":"string"},"allow_other":{"type":"boolean"}}},"WorkflowAi":{"type":"object","required":["summary","missing","reply","question"],"description":"What the AI said of what it did, the same in every answer that comes from it. A change or a new workflow has a summary; when it only answered (a greeting, a question, or a question back to the person), summary is null and reply has its words.","properties":{"summary":{"type":["string","null"],"description":"What it built or changed, in plain words; null when it only answered."},"missing":{"$ref":"#/components/schemas/WorkflowMissing"},"reply":{"type":["string","null"],"description":"Its words, when it has any."},"question":{"anyOf":[{"$ref":"#/components/schemas/WorkflowQuestion"},{"type":"null"}],"description":"A question for the person; send the answer as the next message."}}},"WorkflowIncomplete":{"type":"array","description":"Values the workflow still needs before it can run or be turned on: an empty webhook address (field url), an email with no one to send it to (to), a method’s required input left empty (input.<name>). A workflow is saved with them empty.","items":{"type":"object","required":["key","field","message"],"properties":{"key":{"type":"string","description":"The step."},"field":{"type":"string"},"message":{"type":"string","description":"What to do, in plain words."}}},"example":[{"key":"post","field":"url","message":"Add the webhook address"}]},"WorkflowMissing":{"type":"array","description":"The workflow’s pending steps: methods it needs that your organization does not have yet. Build one with POST /v1/workflows/{id}/steps/{key}/build.","items":{"type":"object","required":["key","name","need","build_prompt","build_id","status"],"properties":{"key":{"type":"string"},"name":{"type":"string"},"need":{"type":"string"},"build_prompt":{"type":"string"},"site":{"type":["string","null"]},"build_id":{"type":["string","null"]},"status":{"type":"string","enum":["proposed","building","failed"]},"reason":{"type":"string"}}}},"WorkflowSummary":{"type":"object","required":["id","name","trigger_type","enabled","step_count","methods","cost","last_run"],"properties":{"id":{"type":"string","description":"wf_ followed by 26 characters."},"name":{"type":"string"},"description":{"type":"string"},"trigger_type":{"type":"string","enum":["manual","schedule","webhook"]},"enabled":{"type":"boolean","description":"Whether its schedule or webhook fires. Every workflow can be run by hand, enabled or not."},"step_count":{"type":"integer","description":"Its steps, those inside loops too."},"methods":{"type":"array","items":{"type":"string"},"description":"The slugs of the methods its steps run."},"last_run":{"type":["object","null"],"properties":{"id":{"type":"string"},"status":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"started_at":{"type":["string","null"],"format":"date-time"},"finished_at":{"type":["string","null"],"format":"date-time"}}},"cost":{"type":"object","required":["credits","per_item"],"description":"The price of one run, in credits: the credits field for the method, AI and email steps outside a For each, and per_item more for each item a For each takes (the most an item costs: a For each inside it counts at its max items). Transforms and webhooks are free. It is the full run: only steps that run and succeed are charged, so a run a filter ends early, or whose steps fail, costs less. per_item is null without a For each.","properties":{"credits":{"type":"integer","minimum":0},"per_item":{"type":["integer","null"],"minimum":0}}},"next_run_at":{"type":["string","null"],"format":"date-time","description":"An enabled schedule: when it runs next."},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"Workflow":{"type":"object","required":["id","name","trigger_type","enabled","definition","webhook_url"],"properties":{"id":{"type":"string","description":"wf_ followed by 26 characters."},"name":{"type":"string"},"description":{"type":"string"},"trigger_type":{"type":"string","enum":["manual","schedule","webhook"]},"enabled":{"type":"boolean","description":"Whether its schedule or webhook fires. Every workflow can be run by hand, enabled or not."},"step_count":{"type":"integer","description":"Its steps, those inside loops too."},"methods":{"type":"array","items":{"type":"string"},"description":"The slugs of the methods its steps run."},"last_run":{"type":["object","null"],"properties":{"id":{"type":"string"},"status":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"started_at":{"type":["string","null"],"format":"date-time"},"finished_at":{"type":["string","null"],"format":"date-time"}}},"cost":{"type":"object","required":["credits","per_item"],"description":"The price of one run, in credits: the credits field for the method, AI and email steps outside a For each, and per_item more for each item a For each takes (the most an item costs: a For each inside it counts at its max items). Transforms and webhooks are free. It is the full run: only steps that run and succeed are charged, so a run a filter ends early, or whose steps fail, costs less. per_item is null without a For each.","properties":{"credits":{"type":"integer","minimum":0},"per_item":{"type":["integer","null"],"minimum":0}}},"next_run_at":{"type":["string","null"],"format":"date-time","description":"An enabled schedule: when it runs next."},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"definition":{"$ref":"#/components/schemas/WorkflowDefinition"},"incomplete":{"$ref":"#/components/schemas/WorkflowIncomplete"},"webhook_url":{"type":["string","null"],"description":"A webhook workflow: where a POST starts a run. The address is the secret; renew it with POST /v1/workflows/{id}/webhook."},"signing_secret":{"type":["string","null"],"description":"A workflow with webhook steps: what they sign their calls with (X-Fous-Signature), so the address can check the call is from Fous. New one with POST /v1/workflows/{id}/signing-secret."}}},"WorkflowRun":{"type":"object","required":["id","workflow_id","status","trigger","credits"],"properties":{"id":{"type":"string","description":"wfr_ followed by 26 characters."},"workflow_id":{"type":"string"},"status":{"type":"string","enum":["queued","running","waiting","completed","failed","canceled","skipped"],"description":"waiting: until resume_at, on a delay, to try a step again, for a method’s repair, or (a scheduled run) for someone to sign an account in again (the step’s waiting says which). A run a filter (or stop()) ended early completed: that step is recorded filtered, saying why. skipped: its schedule came due while the last run had not finished; error says which (code previous_run_open, run_id). canceled: by a person, or the workflow was turned off (its schedule’s and webhook’s runs that had not started, or were waiting to retry a step or for a repair)."},"trigger":{"type":"string","enum":["manual","schedule","webhook","api"]},"input":{"type":"object","description":"What it was given, checked against the trigger’s inputs."},"error":{"type":["object","null"],"description":"A failed run: the failed step’s error, with step and path."},"credits":{"type":"integer","description":"What the run cost, in credits: 1 for each method, AI and email step that ran and completed (those in a For each once per item). Transforms, webhooks, steps a filter skipped, failed attempts and failed steps cost nothing. A step the organization cannot pay for fails with error.code insufficient_credits, and the run stops there."},"created_at":{"type":"string","format":"date-time"},"started_at":{"type":["string","null"],"format":"date-time"},"finished_at":{"type":["string","null"],"format":"date-time"},"resume_at":{"type":["string","null"],"format":"date-time"},"output":{"description":"With steps, once the run completed: what the last step that did something gave (a method’s data, any other step’s output). Null before it completed."},"steps":{"type":"array","description":"Each step as it ran, in the order it started.","items":{"$ref":"#/components/schemas/WorkflowRunStep"}}}},"WorkflowRunStep":{"type":"object","required":["seq","key","path","type","status"],"properties":{"seq":{"type":"integer"},"key":{"type":"string"},"path":{"type":"string","description":"Where it ran: \"send\" at the top, \"loop.send[2]\" in a loop’s third item."},"type":{"type":"string","enum":["method","ai","transform","filter","loop","delay","email","webhook"]},"name":{"type":"string"},"status":{"type":"string","enum":["running","waiting","completed","failed","filtered"],"description":"waiting: to be tried again, for its method’s repair, or for someone to sign its account in again (waiting says which and until when). filtered: a filter that did not pass, or a transform that called stop(); what came after it in its block did not run."},"input":{"description":"What it was given, its templates resolved (dropped with the run’s data when it expires: 24 hours or the plan’s run history; the workflow’s latest completed run keeps it). ai: {prompt (as sent, up to 20,000 characters), shortened?: true when long texts or lists in its data were shortened to fit, left_out?: items of its data not shown (the model is told how many)}; filter: {conditions} with the values compared."},"attempts":{"type":"array","description":"Its failed attempts, in order: {attempt, at, error: {code, message}, run_id? (a method step’s run)}.","items":{"type":"object"}},"waiting":{"type":["object","null"],"description":"While it waits (status waiting): reason retry (until: the next try; attempt and of: \"attempt 2 of 5\"), repair (until: the next look; method; repair_until: when its repair is due, null when not known yet) or connection (a scheduled run whose account needs signing in: it goes on as soon as someone signs in; until: the next look, a day at most; site, connection_id and connect_url say where); since: when it began waiting; message, in plain words."},"output":{"description":"method: {status, data, run_id, error}; ai: {text}, or its fields; transform: what its code returned ({stopped: true, message: \"Stopped: …\", skipped} when it called stop()); filter: {passed: true}, or {passed: false, message: \"Stopped: …\", skipped: how many action steps it skipped, which cost nothing}; loop: {count, items: [{status: done or filtered}]} (each item’s outputs are its steps’ records); delay: {seconds}; email: {sent}; webhook: {status, body} (body up to 64 KB)."},"error":{"type":["object","null"]},"method_run_id":{"type":["string","null"],"description":"method: its run, also in GET /v1/runs."},"started_at":{"type":["string","null"],"format":"date-time"},"finished_at":{"type":["string","null"],"format":"date-time"}}},"Account":{"type":"object","properties":{"organization":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}}},"plan":{"type":"object","description":"The organization’s plan: free, starter, pro, business, or custom (Enterprise); go, plus and scale are retired plans.","properties":{"id":{"type":"string"},"name":{"type":"string"}}},"credits":{"type":"object","properties":{"balance":{"type":"integer","description":"The credits left, whole."},"balance_usd":{"type":"number","description":"The balance in US dollars."},"monthly_included":{"type":["integer","null"],"description":"The credits the plan includes each month (Free: 100); null on Enterprise without a monthly figure, and on a Free organization without Free’s credits."},"resets_at":{"type":["string","null"],"format":"date-time","description":"On Free: when the next month’s free credits come, the 1st at 00:00 UTC; unused ones do not carry over. null on a paid plan and on Enterprise."},"extra_on":{"type":"boolean","description":"Whether extra credits are on: runs go on past the month’s credits, up to their limit."}}},"limits":{"type":"object","description":"The plan’s limits.","properties":{"requests_per_minute":{"type":"integer","description":"Calls a minute, counted apart for runs and queries and for searches, builds and sign-ins."},"concurrent_runs":{"type":"integer","description":"Runs and queries going at once."},"logins":{"type":["integer","null"],"description":"Saved logins the organization may keep, add-ons included; null: unlimited. API keys do not count."},"sites":{"type":["integer","null"],"description":"Sites the organization may have methods on, any number on each, add-ons included; null: unlimited."},"seats":{"type":["integer","null"],"description":"Members and open invitations the organization may have; null: unlimited."},"run_history_hours":{"type":"integer","description":"How long runs stay visible, in hours (Free 24, Starter 168, Pro 336, Business and Enterprise 720)."},"health_check_hours":{"type":["integer","null"],"description":"Hours between a method’s health checks, even when nobody runs it (Starter 168, Pro 24, Business 6, Enterprise 1); null on Free, where a method is checked only while it is in use. On every plan a method run in the past 7 days is checked at least daily, and a failing one every hour. A check that finds a method broken starts its repair."},"monthly_spend_limit_credits":{"type":["number","null"],"description":"The organization’s monthly spend limit, in credits; null: no limit."}}},"usage":{"type":"object","description":"What the organization uses of its limits.","properties":{"sites":{"type":"integer","description":"Sites with methods."},"logins":{"type":"integer","description":"Website logins."}}},"builds":{"type":"object","description":"Builds and improvements the plan includes: a build that changed a method counts; repairs never do.","properties":{"included":{"type":["integer","null"],"description":"Per billing month on a paid plan, ever on Free (3); null on Enterprise, which has no number here."},"used":{"type":"integer","description":"Included builds used in the period."},"period":{"type":"string","enum":["month","lifetime"],"description":"month: each paid month (annual plans too; Enterprise without a plan: each calendar month, UTC); lifetime: Free."},"resets_at":{"type":["string","null"],"format":"date-time","description":"When the next month starts (the next paid month, or Enterprise’s next calendar month); null on Free."},"extra_credits":{"type":["integer","null"],"description":"Set once a paid plan’s monthly builds are used: the credits each further build takes when it succeeds (50). A failed build is free. null otherwise."}}},"prices":{"type":"object","description":"What each call costs, in credits.","properties":{"search":{"type":"integer","description":"A search: free."},"run":{"type":"integer","description":"A run that completes."}}},"workflows":{"type":"object","properties":{"external_email":{"type":"boolean","description":"Whether workflow emails may go to people outside the organization: true on Business and Enterprise; on Free, Starter and Pro they go only to its members."}}},"key":{"type":"object","description":"The key this call was made with.","properties":{"name":{"type":"string","description":"The name it was given in Fous Studio."},"expires_at":{"type":["string","null"],"format":"date-time","description":"When the key stops working; null: never."},"last_used_at":{"type":["string","null"],"format":"date-time"}}}}}}},"paths":{"/v1/methods":{"get":{"operationId":"listMethods","tags":["Methods"],"summary":"List or search your methods","description":"Your organization’s methods, the latest change first, each at its current version. With query, the ones nearest what you describe, best first (none near: an empty list). With ids, some of them, for a live re-read of their status. Searching never builds: when none of your methods fits, build one with POST /v1/builds. Free.","parameters":[{"name":"query","in":"query","schema":{"type":"string","maxLength":500},"description":"What you need, in plain language.","example":"public holidays in Germany next year"},{"name":"site","in":"query","schema":{"type":"string"},"description":"Only the methods on this site (a domain or site name)."},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":500},"description":"How many: 1 to 20 with a query (default 5); else up to 500 (default 500)."},{"name":"ids","in":"query","schema":{"type":"string"},"description":"Method ids, comma-separated, at most 50: only those of your methods."}],"responses":{"200":{"description":"Your methods; empty when none is near the query.","content":{"application/json":{"schema":{"type":"object","required":["methods"],"properties":{"methods":{"type":"array","items":{"$ref":"#/components/schemas/MethodListItem"}}}},"example":{"methods":[{"id":"mth_01m5kvvywdeac8fxs7nh0sw68w","slug":"date.nager.at/list_public_holidays","name":"List public holidays","description":"Lists a country's public holidays for a year from Nager.Date, with local names, regional coverage and holiday types.","returns":"date, weekday, English and local names, regions, type, nationwide flag","site":"nager.at","site_name":"Nager.Date","input_schema":{"type":"object","required":["country"],"properties":{"year":{"type":"integer","minimum":1,"maximum":9999,"description":"Calendar year, for example 2026. Defaults to the current year."},"country":{"type":"string","description":"Country name or two-letter country code, for example Germany or DE."}}},"effect":"read","auth":{"required":false},"cost":{"credits":1},"version":2,"current_version":2,"latest_version":2,"status":"ready","stats":{"success_rate":1,"runs":4,"last_success_at":"2026-10-23T09:02:11.000Z"},"created_at":"2026-10-23T08:41:12.000Z","updated_at":"2026-10-23T08:41:12.000Z"}]}}}},"400":{"description":"limit, query or ids out of range","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"limit is a whole number from 1 to 20.","doc_url":"https://docs.fous.com/guides/errors#invalid_request","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"401":{"description":"No valid key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized","message":"Send Authorization: Bearer <Fous API key>. Create one in Fous Studio under API keys (https://app.fous.com/keys).","next_step":"Send Authorization: Bearer <key>. Create a key in Fous Studio: https://app.fous.com/keys.","reason":"api_key_required","doc_url":"https://docs.fous.com/guides/errors#unauthorized","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"429":{"description":"Too many searches for the plan this minute","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited","message":"Too many searches for your plan this minute.","next_step":"Retry in 8 seconds.","retry_after":8,"limit":{"kind":"searches_per_minute","value":60},"doc_url":"https://docs.fous.com/guides/errors#rate_limited","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}}}}},"/v1/methods/{domain}/{name}":{"get":{"operationId":"getMethod","tags":["Methods"],"summary":"Get a method","description":"One of your organization’s methods, its full contract at the current version (or @N for one version): input and output schema, an example, auth, cost, how it stands (status, repair), its versions and what the latest changes. With wait, the answer is held while the version is under repair; with seen (the status:revision of the last read) while nothing about it has changed. Free.","parameters":[{"name":"domain","in":"path","required":true,"schema":{"type":"string"},"description":"The site of the method’s slug.","example":"date.nager.at"},{"name":"name","in":"path","required":true,"schema":{"type":"string"},"description":"The name of the method’s slug; add @N for one version (GET and runs).","example":"list_public_holidays"},{"name":"wait","in":"query","description":"Seconds to hold the answer while the version is under repair (or, with seen, while nothing has changed), 0 to 60.","schema":{"type":"integer","minimum":0,"maximum":60,"default":0}},{"name":"seen","in":"query","schema":{"type":"string"},"description":"What was last read, as <status>:<revision>; with wait, the answer is held until it differs.","example":"repairing:2"}],"responses":{"200":{"description":"The method.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MethodDetail"},"example":{"id":"mth_01m5kvvywdeac8fxs7nh0sw68w","slug":"date.nager.at/list_public_holidays","name":"List public holidays","description":"Lists a country's public holidays for a year from Nager.Date, with local names, regional coverage and holiday types.","returns":"date, weekday, English and local names, regions, type, nationwide flag","site":"nager.at","site_name":"Nager.Date","input_schema":{"type":"object","required":["country"],"properties":{"year":{"type":"integer","minimum":1,"maximum":9999,"description":"Calendar year, for example 2026. Defaults to the current year."},"country":{"type":"string","description":"Country name or two-letter country code, for example Germany or DE."}}},"effect":"read","auth":{"required":false},"cost":{"credits":1},"version":2,"current_version":2,"latest_version":2,"revision":1,"status":"ready","versions":[{"version":2,"revision":1,"latest":true,"current":true,"status":"ready","created_at":"2026-10-22T16:02:41.000Z","changes":"Adds output holidays[].regions."},{"version":1,"revision":2,"status":"ready","created_at":"2026-10-21T09:12:05.000Z","revised_at":"2026-10-24T03:10:19.000Z","changes":""}],"output_schema":{"type":"object","properties":{"country_name":{"type":"string"},"year":{"type":"integer"},"holidays":{"type":"array","items":{"type":"object"}}}},"example":{"input":{"country":"Germany","year":2027},"output":{"country_name":"Germany","year":2027,"holidays":[{"date":"2027-01-01","weekday":"Friday","english_name":"New Year's Day","local_name":"Neujahr","nationwide":"yes","regions":[],"type":"Public"}]}},"stats":{"success_rate":1,"runs":12,"last_success_at":"2026-10-23T08:24:36.410Z"}}}}},"404":{"description":"No such method, or no such version of it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found","message":"No version 9 of date.nager.at/list_public_holidays. Its versions are 1–2.","next_step":"Name one of them (date.nager.at/list_public_holidays@N), or none for the current version.","param":"method","latest_version":2,"doc_url":"https://docs.fous.com/guides/errors#not_found","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}}}},"patch":{"operationId":"updateMethod","tags":["Methods"],"summary":"Switch a method's current version","description":"{\"current_version\": N} makes version N the one your calls run when they name no version: runs and queries use it from then on. A new version never switches by itself. Owners, admins, members and API keys; readers cannot.","parameters":[{"name":"domain","in":"path","required":true,"schema":{"type":"string"},"description":"The site of the method’s slug.","example":"date.nager.at"},{"name":"name","in":"path","required":true,"schema":{"type":"string"},"description":"The name of the method’s slug; add @N for one version (GET and runs).","example":"list_public_holidays"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["current_version"],"additionalProperties":false,"properties":{"current_version":{"type":"integer","minimum":1,"description":"The version your calls run from now on."}}},"example":{"current_version":1}}}},"responses":{"200":{"description":"The method at its new current version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MethodDetail"},"example":{"id":"mth_01m5kvvywdeac8fxs7nh0sw68w","slug":"date.nager.at/list_public_holidays","name":"List public holidays","description":"Lists a country's public holidays for a year from Nager.Date, with local names, regional coverage and holiday types.","returns":"date, weekday, English and local names, regions, type, nationwide flag","site":"nager.at","site_name":"Nager.Date","input_schema":{"type":"object","required":["country"],"properties":{"year":{"type":"integer","minimum":1,"maximum":9999,"description":"Calendar year, for example 2026. Defaults to the current year."},"country":{"type":"string","description":"Country name or two-letter country code, for example Germany or DE."}}},"effect":"read","auth":{"required":false},"cost":{"credits":1},"version":1,"current_version":1,"latest_version":2,"revision":2,"status":"ready","versions":[{"version":2,"revision":1,"latest":true,"status":"ready","created_at":"2026-10-22T16:02:41.000Z","changes":"Adds output holidays[].regions."},{"version":1,"revision":2,"status":"ready","created_at":"2026-10-21T09:12:05.000Z","revised_at":"2026-10-24T03:10:19.000Z","changes":"","current":true}],"output_schema":{"type":"object","properties":{"country_name":{"type":"string"},"year":{"type":"integer"},"holidays":{"type":"array","items":{"type":"object"}}}},"example":{"input":{"country":"Germany","year":2027},"output":{"country_name":"Germany","year":2027,"holidays":[{"date":"2027-01-01","weekday":"Friday","english_name":"New Year's Day","local_name":"Neujahr","nationwide":"yes","regions":[],"type":"Public"}]}},"stats":{"success_rate":1,"runs":12,"last_success_at":"2026-10-23T08:24:36.410Z"},"latest_changes":"Adds output holidays[].regions."}}}},"400":{"description":"No {\"current_version\": N}","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"Send {\"current_version\": N} to make version N the one your calls run.","doc_url":"https://docs.fous.com/guides/errors#invalid_request","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"403":{"description":"Readers cannot change methods and builds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"forbidden","message":"Readers cannot change methods: ask an admin for the member role.","doc_url":"https://docs.fous.com/guides/errors#forbidden","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"404":{"description":"No such method, or no such version of it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found","message":"No version 9 of date.nager.at/list_public_holidays. Its versions are 1–2.","next_step":"Name one of them (date.nager.at/list_public_holidays@N), or none for the current version.","param":"method","latest_version":2,"doc_url":"https://docs.fous.com/guides/errors#not_found","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}}}},"delete":{"operationId":"deleteMethod","tags":["Methods"],"summary":"Delete a method","description":"Deletes one of your organization’s methods: it no longer runs, and its versions stay for the record. A method that a workflow uses returns 409 with reason used_by_workflow and the workflows. With force=true it is deleted anyway: those workflows are turned off, their queued and waiting runs are canceled, and each step that ran it is marked as needing a method (pending). Readers cannot delete methods.","parameters":[{"name":"domain","in":"path","required":true,"schema":{"type":"string"},"description":"The site of the method’s slug.","example":"hts.usitc.gov"},{"name":"name","in":"path","required":true,"schema":{"type":"string"},"description":"The name of the method’s slug; add @N for one version (GET and runs).","example":"get_import_duty"},{"name":"force","in":"query","schema":{"type":"boolean"},"description":"true: delete the method even when workflows use it."}],"responses":{"200":{"description":"Deleted.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"deleted":{"type":"boolean"}}},"example":{"id":"mth_01m6xz91s8e6bb2gqjtvr2ayy9","deleted":true}}}},"400":{"description":"A single version named: delete the whole method, without @N","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"A single version cannot be deleted; leave out @N to delete the method.","doc_url":"https://docs.fous.com/guides/errors#invalid_request","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"403":{"description":"Readers cannot change methods and builds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"forbidden","message":"Readers cannot change methods: ask an admin for the member role.","doc_url":"https://docs.fous.com/guides/errors#forbidden","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"404":{"description":"No such method","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found","message":"No method \"date.nager.at/list_holidays\". Did you mean \"date.nager.at/list_public_holidays\"?","next_step":"Search with GET /v1/methods?query=date%20nager%20at%20list%20holidays, or build one with POST /v1/builds.","param":"method","did_you_mean":"date.nager.at/list_public_holidays","suggestions":[{"id":"mth_01m5kvvywdeac8fxs7nh0sw68w","slug":"date.nager.at/list_public_holidays","name":"List public holidays","summary":"Lists a country's public holidays for a year from Nager.Date, with local names, regional coverage and holiday types."}],"doc_url":"https://docs.fous.com/guides/errors#not_found","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"409":{"description":"reason used_by_workflow: workflows use this method; force=true deletes it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"conflict","reason":"used_by_workflow","message":"This method is used by 1 workflow: \"Open invoices digest\".","next_step":"Send the DELETE again with ?force=true to delete it anyway: those workflows are turned off and each step that ran it is marked as needing a method.","workflows":[{"id":"wf_01m6vnc9ewe3za9g5kqvd8yrkp","name":"Open invoices digest","enabled":false}],"doc_url":"https://docs.fous.com/guides/errors#conflict","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}}}}},"/v1/methods/{id}":{"get":{"operationId":"getMethodById","tags":["Methods"],"summary":"Get a method by id","description":"One of your organization’s methods, its full contract at the current version (or @N for one version): input and output schema, an example, auth, cost, how it stands (status, repair), its versions and what the latest changes. With wait, the answer is held while the version is under repair; with seen (the status:revision of the last read) while nothing about it has changed. Free.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The method’s id (mth_…); add @N for one version (GET and runs).","example":"mth_01m5kzhyjqfwba4j53e676knrq"},{"name":"wait","in":"query","description":"Seconds to hold the answer while the version is under repair (or, with seen, while nothing has changed), 0 to 60.","schema":{"type":"integer","minimum":0,"maximum":60,"default":0}},{"name":"seen","in":"query","schema":{"type":"string"},"description":"What was last read, as <status>:<revision>; with wait, the answer is held until it differs.","example":"repairing:2"}],"responses":{"200":{"description":"The method.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MethodDetail"},"example":{"id":"mth_01m5kvvywdeac8fxs7nh0sw68w","slug":"date.nager.at/list_public_holidays","name":"List public holidays","description":"Lists a country's public holidays for a year from Nager.Date, with local names, regional coverage and holiday types.","returns":"date, weekday, English and local names, regions, type, nationwide flag","site":"nager.at","site_name":"Nager.Date","input_schema":{"type":"object","required":["country"],"properties":{"year":{"type":"integer","minimum":1,"maximum":9999,"description":"Calendar year, for example 2026. Defaults to the current year."},"country":{"type":"string","description":"Country name or two-letter country code, for example Germany or DE."}}},"effect":"read","auth":{"required":false},"cost":{"credits":1},"version":2,"current_version":2,"latest_version":2,"revision":1,"status":"ready","versions":[{"version":2,"revision":1,"latest":true,"current":true,"status":"ready","created_at":"2026-10-22T16:02:41.000Z","changes":"Adds output holidays[].regions."},{"version":1,"revision":2,"status":"ready","created_at":"2026-10-21T09:12:05.000Z","revised_at":"2026-10-24T03:10:19.000Z","changes":""}],"output_schema":{"type":"object","properties":{"country_name":{"type":"string"},"year":{"type":"integer"},"holidays":{"type":"array","items":{"type":"object"}}}},"example":{"input":{"country":"Germany","year":2027},"output":{"country_name":"Germany","year":2027,"holidays":[{"date":"2027-01-01","weekday":"Friday","english_name":"New Year's Day","local_name":"Neujahr","nationwide":"yes","regions":[],"type":"Public"}]}},"stats":{"success_rate":1,"runs":12,"last_success_at":"2026-10-23T08:24:36.410Z"}}}}},"404":{"description":"No such method, or no such version of it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found","message":"No version 9 of date.nager.at/list_public_holidays. Its versions are 1–2.","next_step":"Name one of them (date.nager.at/list_public_holidays@N), or none for the current version.","param":"method","latest_version":2,"doc_url":"https://docs.fous.com/guides/errors#not_found","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}}}},"patch":{"operationId":"updateMethodById","tags":["Methods"],"summary":"Switch a method's current version by id","description":"{\"current_version\": N} makes version N the one your calls run when they name no version: runs and queries use it from then on. A new version never switches by itself. Owners, admins, members and API keys; readers cannot.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The method’s id (mth_…); add @N for one version (GET and runs).","example":"mth_01m5kzhyjqfwba4j53e676knrq"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["current_version"],"additionalProperties":false,"properties":{"current_version":{"type":"integer","minimum":1,"description":"The version your calls run from now on."}}},"example":{"current_version":1}}}},"responses":{"200":{"description":"The method at its new current version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MethodDetail"},"example":{"id":"mth_01m5kvvywdeac8fxs7nh0sw68w","slug":"date.nager.at/list_public_holidays","name":"List public holidays","description":"Lists a country's public holidays for a year from Nager.Date, with local names, regional coverage and holiday types.","returns":"date, weekday, English and local names, regions, type, nationwide flag","site":"nager.at","site_name":"Nager.Date","input_schema":{"type":"object","required":["country"],"properties":{"year":{"type":"integer","minimum":1,"maximum":9999,"description":"Calendar year, for example 2026. Defaults to the current year."},"country":{"type":"string","description":"Country name or two-letter country code, for example Germany or DE."}}},"effect":"read","auth":{"required":false},"cost":{"credits":1},"version":1,"current_version":1,"latest_version":2,"revision":2,"status":"ready","versions":[{"version":2,"revision":1,"latest":true,"status":"ready","created_at":"2026-10-22T16:02:41.000Z","changes":"Adds output holidays[].regions."},{"version":1,"revision":2,"status":"ready","created_at":"2026-10-21T09:12:05.000Z","revised_at":"2026-10-24T03:10:19.000Z","changes":"","current":true}],"output_schema":{"type":"object","properties":{"country_name":{"type":"string"},"year":{"type":"integer"},"holidays":{"type":"array","items":{"type":"object"}}}},"example":{"input":{"country":"Germany","year":2027},"output":{"country_name":"Germany","year":2027,"holidays":[{"date":"2027-01-01","weekday":"Friday","english_name":"New Year's Day","local_name":"Neujahr","nationwide":"yes","regions":[],"type":"Public"}]}},"stats":{"success_rate":1,"runs":12,"last_success_at":"2026-10-23T08:24:36.410Z"},"latest_changes":"Adds output holidays[].regions."}}}},"400":{"description":"No {\"current_version\": N}","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"Send {\"current_version\": N} to make version N the one your calls run.","doc_url":"https://docs.fous.com/guides/errors#invalid_request","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"403":{"description":"Readers cannot change methods and builds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"forbidden","message":"Readers cannot change methods: ask an admin for the member role.","doc_url":"https://docs.fous.com/guides/errors#forbidden","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"404":{"description":"No such method, or no such version of it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found","message":"No version 9 of date.nager.at/list_public_holidays. Its versions are 1–2.","next_step":"Name one of them (date.nager.at/list_public_holidays@N), or none for the current version.","param":"method","latest_version":2,"doc_url":"https://docs.fous.com/guides/errors#not_found","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}}}},"delete":{"operationId":"deleteMethodById","tags":["Methods"],"summary":"Delete a method by id","description":"Deletes one of your organization’s methods: it no longer runs, and its versions stay for the record. A method that a workflow uses returns 409 with reason used_by_workflow and the workflows. With force=true it is deleted anyway: those workflows are turned off, their queued and waiting runs are canceled, and each step that ran it is marked as needing a method (pending). Readers cannot delete methods.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The method’s id (mth_…); add @N for one version (GET and runs).","example":"mth_01m6xz91s8e6bb2gqjtvr2ayy9"},{"name":"force","in":"query","schema":{"type":"boolean"},"description":"true: delete the method even when workflows use it."}],"responses":{"200":{"description":"Deleted.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"deleted":{"type":"boolean"}}},"example":{"id":"mth_01m6xz91s8e6bb2gqjtvr2ayy9","deleted":true}}}},"400":{"description":"A single version named: delete the whole method, without @N","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"A single version cannot be deleted; leave out @N to delete the method.","doc_url":"https://docs.fous.com/guides/errors#invalid_request","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"403":{"description":"Readers cannot change methods and builds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"forbidden","message":"Readers cannot change methods: ask an admin for the member role.","doc_url":"https://docs.fous.com/guides/errors#forbidden","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"404":{"description":"No such method","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found","message":"No method \"date.nager.at/list_holidays\". Did you mean \"date.nager.at/list_public_holidays\"?","next_step":"Search with GET /v1/methods?query=date%20nager%20at%20list%20holidays, or build one with POST /v1/builds.","param":"method","did_you_mean":"date.nager.at/list_public_holidays","suggestions":[{"id":"mth_01m5kvvywdeac8fxs7nh0sw68w","slug":"date.nager.at/list_public_holidays","name":"List public holidays","summary":"Lists a country's public holidays for a year from Nager.Date, with local names, regional coverage and holiday types."}],"doc_url":"https://docs.fous.com/guides/errors#not_found","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"409":{"description":"reason used_by_workflow: workflows use this method; force=true deletes it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"conflict","reason":"used_by_workflow","message":"This method is used by 1 workflow: \"Open invoices digest\".","next_step":"Send the DELETE again with ?force=true to delete it anyway: those workflows are turned off and each step that ran it is marked as needing a method.","workflows":[{"id":"wf_01m6vnc9ewe3za9g5kqvd8yrkp","name":"Open invoices digest","enabled":false}],"doc_url":"https://docs.fous.com/guides/errors#conflict","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}}}}},"/v1/runs":{"get":{"operationId":"listRuns","tags":["Runs"],"summary":"List runs","description":"Your organization’s runs of the past 30 days, on every plan, newest first; a run still going always shows. Each has its input and result (a failed one its error) until the plan’s run_history_hours pass (Free 24 hours, Starter 7 days, Pro 14 days, Business and Enterprise 30 days); after that it has expired: true and both are null. Free.","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},{"name":"before","in":"query","description":"Only runs older than this: an ISO time, or a run id (the last one of the page before).","schema":{"type":"string"}},{"name":"method","in":"query","description":"Only the runs of this method (its id or slug).","schema":{"type":"string"}},{"name":"status","in":"query","description":"Only the runs in this status.","schema":{"type":"string","enum":["running","completed","failed","canceled"]}}],"responses":{"200":{"description":"The runs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunList"},"example":{"runs":[{"id":"run_01m5m0ere4fzdte37jhhn33ycd","status":"completed","method":{"id":"mth_01m5kvvywdeac8fxs7nh0sw68w","slug":"date.nager.at/list_public_holidays","version":2},"created_at":"2026-10-23T09:11:15.035Z","completed_at":"2026-10-23T09:11:16.786Z","credits":1,"input":{"country":"Germany","year":2027},"data":{"country_name":"Germany","year":2027,"holidays":[{"date":"2027-01-01","weekday":"Friday","english_name":"New Year's Day","local_name":"Neujahr","nationwide":"yes","regions":[],"type":"Public"},{"date":"2027-01-06","weekday":"Wednesday","english_name":"Epiphany","local_name":"Heilige Drei Könige","nationwide":"no","regions":["Baden-Württemberg","Bavaria","Saxony-Anhalt"],"type":"Public"}]}}],"has_more":false}}}},"400":{"description":"limit, before or status is not one","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"limit is a whole number from 1 to 100.","doc_url":"https://docs.fous.com/guides/errors#invalid_request","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}}}},"post":{"operationId":"createRun","tags":["Runs"],"summary":"Run a method","description":"Runs a method with inputs that fit its input_schema (1 credit) and waits up to wait seconds (default 30). A run still going then answers 202 with status \"running\" and goes on: read it with GET /v1/runs/{id}, or stop it with POST /v1/runs/{id}/cancel (nothing is charged). A run that fails while you wait answers with its error, as GET /v1/runs/{id} does. Send an Idempotency-Key header to make the call safe to repeat: the same key with the same request, within 24 hours, answers with the run it first started, and is charged once.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"A string you choose per run. A retry with the same key and the same request (method, input, connection, include_raw) within 24 hours answers with the run the first call started, and is charged once. The same key with another request is a new run, and so is a call after 24 hours. A run refused before it started (a limit, the input, credits) uses no key. Empty: no key.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"method":{"type":"string","minLength":3,"maxLength":200,"description":"The method’s id (mth_…) or slug (<domain>/<name>); add @N to run version N instead of the current one."},"input":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Fits the method’s input_schema; an input sent as null counts as not sent."},"connection":{"type":"string","pattern":"^conn_[0-9a-z]{26}$","description":"A conn_ id, when the method needs an account and you want one other than the default."},"include_raw":{"type":"boolean","description":"Also return the site’s own response as raw."},"wait":{"type":"integer","minimum":0,"maximum":60,"description":"Seconds to wait for the answer, 0 to 60 (default 30); a longer run answers 202 and goes on."}},"required":["method"],"additionalProperties":false},"example":{"method":"date.nager.at/list_public_holidays","input":{"country":"DE","year":2027}}}}},"responses":{"200":{"description":"Completed (data may be empty: true when the site has nothing).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Run"},"example":{"id":"run_01m5m0ere4fzdte37jhhn33ycd","status":"completed","method":{"id":"mth_01m5kvvywdeac8fxs7nh0sw68w","slug":"date.nager.at/list_public_holidays","version":2,"latest_version":2},"data":{"country_name":"Germany","year":2027,"holidays":[{"date":"2027-01-01","weekday":"Friday","english_name":"New Year's Day","local_name":"Neujahr","nationwide":"yes","regions":[],"type":"Public"},{"date":"2027-01-06","weekday":"Wednesday","english_name":"Epiphany","local_name":"Heilige Drei Könige","nationwide":"no","regions":["Baden-Württemberg","Bavaria","Saxony-Anhalt"],"type":"Public"}]},"truncated":false,"credits":1,"cost":{"credits":1},"duration_ms":1751,"created_at":"2026-10-23T09:11:15.035Z","completed_at":"2026-10-23T09:11:16.786Z"}}}},"202":{"description":"Still running.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Run"},"example":{"id":"run_01m5m0ere4fzdte37jhhn33ycd","status":"running","method":{"id":"mth_01m5kvvywdeac8fxs7nh0sw68w","slug":"date.nager.at/list_public_holidays","version":2,"latest_version":2},"created_at":"2026-10-23T09:11:15.035Z","completed_at":null,"credits":0,"duration_ms":null}}}},"400":{"description":"No method, or a body that does not fit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"Send method (the method to run) with its input.","doc_url":"https://docs.fous.com/guides/errors#invalid_request","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"402":{"description":"Not enough credits left","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"insufficient_credits","message":"This run costs 1 credit, and your organization has 0 left.","next_step":"Turn on extra credits or raise their monthly limit in Billing, under Limits (https://app.fous.com/billing). Nothing was charged.","required_credits":1,"available_credits":0,"billing_url":"https://app.fous.com/billing","doc_url":"https://docs.fous.com/guides/errors#insufficient_credits","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"403":{"description":"The method needs a connected account","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"connection_required","message":"This method needs a signed-in portal.example.com account; your login (conn_01m5k2v8c4n6p8r0t2w4y6a8c0) was signed out and needs to sign in again.","next_step":"Sign in at connect_url (a Fous Studio page), or with POST /v1/connections/conn_01m5k2v8c4n6p8r0t2w4y6a8c0/sign-in {\"start\": true}, then run again. Nothing was charged.","connect":{"site":"portal.example.com","type":"session","connection_id":"conn_01m5k2v8c4n6p8r0t2w4y6a8c0","status":"needs_attention"},"connect_url":"https://app.fous.com/org_01M4CD7TVHDBPFQHZD05XMW5PB/connections?connect=conn_01m5k2v8c4n6p8r0t2w4y6a8c0","doc_url":"https://docs.fous.com/guides/errors#connection_required","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"404":{"description":"No such method or version, or (param connection) no such connection on its site","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found","message":"No connection conn_01m5k2v8c4n6p8r0t2w4y6a8c0 on this method's site.","param":"connection","doc_url":"https://docs.fous.com/guides/errors#not_found","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"422":{"description":"The input does not fit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"2 inputs don't fit date.nager.at/list_public_holidays: \"contry\" is not one of its inputs (did you mean \"country\"?), and \"year\" must be an integer from 1 to 9999.","next_step":"Send the inputs below and run it again. Nothing was charged.","param":"input.contry","errors":[{"field":"contry","problem":"unknown","message":"Not an input of this method. Did you mean \"country\"?","did_you_mean":"country"},{"field":"year","problem":"type","message":"Must be an integer from 1 to 9999; got \"next\".","expected":"integer"},{"field":"country","problem":"missing","message":"Required."}],"method":"date.nager.at/list_public_holidays","input_schema":{"type":"object","required":["country"],"properties":{"year":{"type":"integer","minimum":1,"maximum":9999,"description":"Calendar year, for example 2026. Defaults to the current year."},"country":{"type":"string","description":"Country name or two-letter country code, for example Germany or DE."}}},"example":{"method":"date.nager.at/list_public_holidays","input":{"country":"Germany","year":2026}},"doc_url":"https://docs.fous.com/guides/errors#invalid_input","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited","message":"Too many runs at once for your plan.","next_step":"Retry in 2 seconds. Nothing was charged.","retry_after":2,"limit":{"kind":"concurrent_runs","value":5},"doc_url":"https://docs.fous.com/guides/errors#rate_limited","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"503":{"description":"The site failed, refused the request or did not answer in time (upstream_error, upstream_blocked, upstream_timeout), the site does not serve the country the run left from (upstream_geo_blocked), a run moved more data than a run may (run_traffic_limit, not charged), the version is under repair (method_repairing, with Retry-After), or billing is briefly unavailable (service_unavailable)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"method_repairing","message":"date.nager.at/list_public_holidays version 2 is under repair, back in about 4 min. Nothing was charged.","next_step":"Try again later, or find another of your methods with GET /v1/methods?query=.","version":2,"latest_version":2,"repair":{"expected_at":"2026-10-23T09:15:00.000Z","back_in_minutes":4},"retryable":true,"retry_after":240,"alternatives":[],"doc_url":"https://docs.fous.com/guides/errors#method_repairing","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}}}}},"/v1/runs/{id}":{"get":{"operationId":"getRun","tags":["Runs"],"summary":"Get a run","description":"Status and result of a run (a workflow run’s id, wfr_…, answers that WorkflowRun with its steps). Free. Its record (id, method, status, cost, duration_ms, created_at) stays readable for 30 days on every plan; an older run answers 404. Its input and result expire after the plan’s run_history_hours (Free 24 hours, Starter 7 days, Pro 14 days, Business and Enterprise 30 days); after that a completed run answers with expired: true and data: null. 200 with the Run object once it completed, 202 while it runs; a failed or canceled run answers with its error at its status (403, 409, 422, 503…), as POST /v1/runs does. A failed run’s input and failure detail are kept 30 days, to debug it and repair the method, and are not shown past the plan’s run history.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"example":"run_01m5m0ere4fzdte37jhhn33ycd"},{"name":"wait","in":"query","description":"Seconds to hold the answer while it is still running, 0 to 60.","schema":{"type":"integer","minimum":0,"maximum":60,"default":0}}],"responses":{"200":{"description":"Completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Run"},"example":{"id":"run_01m5m0ere4fzdte37jhhn33ycd","status":"completed","method":{"id":"mth_01m5kvvywdeac8fxs7nh0sw68w","slug":"date.nager.at/list_public_holidays","version":2,"latest_version":2},"data":{"country_name":"Germany","year":2027,"holidays":[{"date":"2027-01-01","weekday":"Friday","english_name":"New Year's Day","local_name":"Neujahr","nationwide":"yes","regions":[],"type":"Public"},{"date":"2027-01-06","weekday":"Wednesday","english_name":"Epiphany","local_name":"Heilige Drei Könige","nationwide":"no","regions":["Baden-Württemberg","Bavaria","Saxony-Anhalt"],"type":"Public"}]},"truncated":false,"credits":1,"cost":{"credits":1},"duration_ms":1751,"created_at":"2026-10-23T09:11:15.035Z","completed_at":"2026-10-23T09:11:16.786Z"}}}},"202":{"description":"Still running.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Run"},"example":{"id":"run_01m5m0ere4fzdte37jhhn33ycd","status":"running","method":{"id":"mth_01m5kvvywdeac8fxs7nh0sw68w","slug":"date.nager.at/list_public_holidays","version":2,"latest_version":2},"created_at":"2026-10-23T09:11:15.035Z","completed_at":null,"credits":0,"duration_ms":null}}}},"404":{"description":"No such run, or one older than the 30 days a run stays readable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found","message":"Runs are readable for 30 days; this one is older.","doc_url":"https://docs.fous.com/guides/errors#not_found","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"409":{"description":"The run was canceled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"conflict","message":"The run was stopped. Nothing was charged.","run_id":"run_01m5m0ere4fzdte37jhhn33ycd","doc_url":"https://docs.fous.com/guides/errors#conflict","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"503":{"description":"The site failed, refused the request or did not answer in time (upstream_error, upstream_blocked, upstream_timeout), the site does not serve the country the run left from (upstream_geo_blocked), a run moved more data than a run may (run_traffic_limit, not charged), the version is under repair (method_repairing, with Retry-After), or billing is briefly unavailable (service_unavailable)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"method_repairing","message":"date.nager.at/list_public_holidays version 2 is under repair, back in about 4 min. Nothing was charged.","next_step":"Try again later, or find another of your methods with GET /v1/methods?query=.","version":2,"latest_version":2,"repair":{"expected_at":"2026-10-23T09:15:00.000Z","back_in_minutes":4},"retryable":true,"retry_after":240,"alternatives":[],"doc_url":"https://docs.fous.com/guides/errors#method_repairing","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}}}}},"/v1/runs/{id}/cancel":{"post":{"operationId":"cancelRun","tags":["Runs"],"summary":"Cancel a run","description":"A workflow run’s id (wfr_…) cancels that run. Cancels a run that is still going: nothing is charged, and what the site answers after that is dropped. Answers with the Run object, status canceled. Free.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"example":"run_01m5m0ere4fzdte37jhhn33ycd"}],"responses":{"200":{"description":"Canceled.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Run"},"example":{"id":"run_01m5m0ere4fzdte37jhhn33ycd","status":"canceled","method":{"id":"mth_01m5kvvywdeac8fxs7nh0sw68w","slug":"date.nager.at/list_public_holidays","version":2,"latest_version":2},"created_at":"2026-10-23T09:11:15.035Z","completed_at":"2026-10-23T09:11:17.102Z","credits":0,"duration_ms":2067,"data":null,"error":{"code":"conflict","reason":"stopped","message":"The run was stopped. Nothing was charged.","run_id":"run_01m5m0ere4fzdte37jhhn33ycd"}}}}},"404":{"description":"No such run, or one older than the 30 days a run stays readable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found","message":"Runs are readable for 30 days; this one is older.","doc_url":"https://docs.fous.com/guides/errors#not_found","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"409":{"description":"Already ended","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"conflict","message":"The run has already ended.","doc_url":"https://docs.fous.com/guides/errors#conflict","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}}}}},"/v1/builds":{"post":{"operationId":"createBuild","tags":["Builds"],"summary":"Build a method","description":"Builds a method for one capability, on the site you name (without it, the builder finds the site), usually in about a minute (a site that is harder to read can take a few). A build makes a new method of your organization, which only your organization finds and runs; it starts from the endpoints Fous already mapped on the site, when there are any. With method it changes one of your methods (@N starts from one version, else the latest): a change that keeps its inputs and outputs improves the version in place, only when it still answers the saved inputs at least as well; one that changes them makes the next version, and your calls keep running the current one until you switch (PATCH /v1/methods/{ref} {\"current_version\": N}). One change at a time runs per method (queue says how many are ahead). Steer a running build with POST /v1/builds/{id}/messages; go on from one that ended by sending follows. Each plan includes builds and improvements at no credit cost: Free 3 in all, Starter 10 a month, Pro 30, Business 100, Enterprise by agreement; failed builds never count and repairs are always free. Past a paid plan’s monthly builds a build still starts, and takes 50 credits when it succeeds (GET /v1/account builds.extra_credits; 402 insufficient_credits when the organization cannot pay them). Past Free’s 3 builds answers 403 plan_limit (kind builds). On Free, an API key or MCP client cannot start a build (403 plan_limit, kind api); Fous Studio can. A new method needs a site the plan includes: one with methods already, or a free one (403 plan_limit, kind sites, when none is free).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":2000,"description":"What the method should read or do, in plain words."},"site":{"type":"string","minLength":3,"maxLength":253,"description":"The website (a domain); without it the builder picks the sources."},"input":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Values to build with: the first test input. A write build does the action once for real, with these values or made-up ones."},"input_schema":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The inputs you want the method to take, as a JSON Schema object."},"output_schema":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The fields you want back, as a JSON Schema object."},"method":{"type":"string","minLength":3,"maxLength":200,"description":"One of your methods (id or slug) to change (@N: from that version): improved in place, or its next version."},"images":{"maxItems":4,"type":"array","items":{"anyOf":[{"type":"object","properties":{"media_type":{"type":"string","enum":["image/png","image/jpeg","image/webp","image/gif"]},"data":{"type":"string","minLength":1,"pattern":"^[A-Za-z0-9+/]+=*$"}},"required":["media_type","data"],"additionalProperties":false},{"type":"object","properties":{"url":{"type":"string","maxLength":2000,"format":"uri"}},"required":["url"],"additionalProperties":false}]},"description":"Up to 4 pictures that show what you mean (PNG, JPEG, WebP or GIF), 2.5 MB in all: each {\"url\"} (a public https address Fous reads) or {\"media_type\", \"data\"} (base64)."},"connections":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":64},"description":"The connections (logins or API keys, on any sites) the build may use: on each site it signs in to, the one of that site; an empty list builds without any. Without it, the site’s default login."},"follows":{"type":"string","pattern":"^bld_[0-9a-z]{26}$","description":"A bld_ id: go on from that build, in the same thread, with your words added. It keeps the build’s method, site, contract and images; while it still runs, your words are a message to it (202, the same build). A short prompt is enough here."},"wait":{"type":"integer","minimum":0,"maximum":60,"description":"Seconds to hold the answer while it builds, 0 to 60 (default 0)."}},"required":["prompt"],"additionalProperties":false},"example":{"prompt":"Get the US import duty rates for a product by its HTS code","site":"hts.usitc.gov"}}}},"responses":{"200":{"description":"The same request already waits for a connected account (requires_auth); it goes on by itself once there is one.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Build"},"example":{"id":"bld_01m5kz8x0vb6dp3jq2w4e5r6t7","status":"requires_auth","kind":"new","effect":"read","prompt":"List my open invoices on portal.example.com","site":"portal.example.com","events":[],"created_at":"2026-10-23T08:40:02.000Z","reason":"This needs a signed-in portal.example.com account. Connect one, and the build goes on.","completed_at":"2026-10-23T08:40:31.000Z"}}}},"202":{"description":"Building: a new build, the same request already running (joined), or the change already running on that method, which takes this request as a message. Poll GET /v1/builds/{id}.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Build"},"example":{"id":"bld_01m6xz5j57f8pb672103ahxa07","status":"building","kind":"new","effect":"read","prompt":"Get the US import duty rates for a product by its HTS code","site":"hts.usitc.gov","events":[],"estimate":{"low_seconds":52,"high_seconds":104,"median_seconds":71,"samples":100},"created_at":"2026-11-08T16:16:52.904Z"}}}},"400":{"description":"Invalid body or schema","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"prompt: Too small: expected string to have >=5 characters","doc_url":"https://docs.fous.com/guides/errors#invalid_request","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"403":{"description":"A plan limit (plan_limit): the plan’s sites all have methods (kind sites), or Free’s 3 builds are used (kind builds); or the caller is a reader (forbidden)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"plan_limit","message":"Your plan includes 2 sites, and all 2 are in use: example.com and example.org. Build on one of them, delete a site's methods in Studio, or move to a bigger plan.","next_step":"Delete a site's methods at https://app.fous.com/methods, or move to a bigger plan at https://app.fous.com/billing. Nothing was charged.","limit":{"kind":"sites","value":2},"billing_url":"https://app.fous.com/billing","doc_url":"https://docs.fous.com/guides/errors#plan_limit","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"404":{"description":"No method to start from, or no such version of it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found","message":"No method \"hts.usitc.gov/get_import_duties\" to start from. Did you mean \"hts.usitc.gov/get_import_duty\"?","next_step":"Search with GET /v1/methods?query=hts%20usitc%20gov%20get%20import%20duties, or build one with POST /v1/builds.","param":"method","did_you_mean":"hts.usitc.gov/get_import_duty","suggestions":[{"id":"mth_01m6xz91s8e6bb2gqjtvr2ayy9","slug":"hts.usitc.gov/get_import_duty","name":"Look up US import duty by HTS code","summary":"Looks up an exact 4-, 6-, 8-, or 10-digit HTS code in the current USITC schedule. Returns the description hierarchy and general, special, and column 2 rates, resolving rate-bearing parent entries for "}],"doc_url":"https://docs.fous.com/guides/errors#not_found","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"413":{"description":"The body is over 4 MB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"Request body too large.","reason":"body_too_large","doc_url":"https://docs.fous.com/guides/errors#invalid_request","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"422":{"description":"No website, app, account or API is involved (not_buildable), or the request check turned it away (request_refused, with its verdict as reason)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_buildable","message":"Writing a poem involves no website, app, account or API.","next_step":"Name the website or the data to get, and send it again.","example":"Get the US import duty rates for a product by its HTS code from hts.usitc.gov","doc_url":"https://docs.fous.com/guides/errors#not_buildable","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"429":{"description":"Too many requests for the plan this minute","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited","message":"Too many requests for your plan this minute.","next_step":"Retry in 12 seconds.","retry_after":12,"limit":{"kind":"requests_per_minute","value":10},"doc_url":"https://docs.fous.com/guides/errors#rate_limited","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"503":{"description":"The builder or billing is briefly unavailable; nothing was charged","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"service_unavailable","message":"The builder is briefly unavailable. Nothing was started or charged.","next_step":"Try again in 30 seconds.","retry_after":30,"doc_url":"https://docs.fous.com/guides/errors#service_unavailable","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}}}},"get":{"operationId":"listBuilds","tags":["Builds"],"summary":"List builds","description":"Your organization’s builds of the past 30 days, newest first, with the repairs of its methods; dismissed ones are left out. Free.","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"name":"before","in":"query","description":"Only builds older than this: an ISO time, or a build id (the last one of the page before).","schema":{"type":"string"}}],"responses":{"200":{"description":"The builds.","content":{"application/json":{"schema":{"type":"object","required":["builds","has_more"],"properties":{"builds":{"type":"array","items":{"$ref":"#/components/schemas/Build"}},"has_more":{"type":"boolean","description":"More builds are older: send before with the last build’s id."}}},"example":{"builds":[{"id":"bld_01m6xz5j57f8pb672103ahxa07","status":"ready","kind":"new","effect":"read","prompt":"Get the US import duty rates for a product by its HTS code","site":"hts.usitc.gov","events":[{"at":"2026-11-08T16:16:52.918Z","kind":"status","message":"Searching the site and reading its start page."},{"at":"2026-11-08T16:16:58.147Z","kind":"note","message":"I’ll check the USITC lookup requests and how the schedule links detailed HTS codes to their duty rates."}],"created_at":"2026-11-08T16:16:52.904Z","outcome":{"type":"new_method"},"method":{"id":"mth_01m6xz91s8e6bb2gqjtvr2ayy9","slug":"hts.usitc.gov/get_import_duty","name":"Look up US import duty by HTS code","description":"Looks up an exact 4-, 6-, 8-, or 10-digit HTS code in the current USITC schedule. Returns the description hierarchy and general, special, and column 2 rates, resolving rate-bearing parent entries for statistical codes.","returns":"HTS code, description, general rate, special rates, column 2 rate","site":"usitc.gov","site_name":"usitc.gov","input_schema":{"type":"object","required":["hts_code"],"properties":{"hts_code":{"type":"string","description":"US HTS code of 4, 6, 8, or 10 digits, with optional dots or spaces."}}},"effect":"read","auth":{"required":false},"cost":{"credits":1},"version":1,"current_version":1,"latest_version":1},"completed_at":"2026-11-08T16:18:47.212Z"}],"has_more":false}}}},"400":{"description":"limit or before is not one","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"limit is a whole number from 1 to 100.","doc_url":"https://docs.fous.com/guides/errors#invalid_request","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}}}}},"/v1/builds/{id}":{"get":{"operationId":"getBuild","tags":["Builds"],"summary":"Get a build","description":"The build: its status, what it said as it worked (events), the messages sent to it, and the method once ready. requires_auth means the site needs a connected account first. Free.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"example":"bld_01m6xz5j57f8pb672103ahxa07"},{"name":"wait","in":"query","description":"Seconds to hold the answer while it is still running, 0 to 60.","schema":{"type":"integer","minimum":0,"maximum":60,"default":0}},{"name":"after","in":"query","description":"The number of events you have: a wait ends as soon as there are more.","schema":{"type":"integer","minimum":0}}],"responses":{"200":{"description":"Finished.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Build"},"example":{"id":"bld_01m6xz5j57f8pb672103ahxa07","status":"ready","kind":"new","effect":"read","prompt":"Get the US import duty rates for a product by its HTS code","site":"hts.usitc.gov","events":[{"at":"2026-11-08T16:16:52.918Z","kind":"status","message":"Searching the site and reading its start page."},{"at":"2026-11-08T16:16:58.147Z","kind":"note","message":"I’ll check the USITC lookup requests and how the schedule links detailed HTS codes to their duty rates."}],"created_at":"2026-11-08T16:16:52.904Z","outcome":{"type":"new_method"},"method":{"id":"mth_01m6xz91s8e6bb2gqjtvr2ayy9","slug":"hts.usitc.gov/get_import_duty","name":"Look up US import duty by HTS code","description":"Looks up an exact 4-, 6-, 8-, or 10-digit HTS code in the current USITC schedule. Returns the description hierarchy and general, special, and column 2 rates, resolving rate-bearing parent entries for statistical codes.","returns":"HTS code, description, general rate, special rates, column 2 rate","site":"usitc.gov","site_name":"usitc.gov","input_schema":{"type":"object","required":["hts_code"],"properties":{"hts_code":{"type":"string","description":"US HTS code of 4, 6, 8, or 10 digits, with optional dots or spaces."}}},"effect":"read","auth":{"required":false},"cost":{"credits":1},"version":1,"current_version":1,"latest_version":1},"completed_at":"2026-11-08T16:18:47.212Z"}}}},"202":{"description":"Still building.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Build"},"example":{"id":"bld_01m6xz5j57f8pb672103ahxa07","status":"building","kind":"new","effect":"read","prompt":"Get the US import duty rates for a product by its HTS code","site":"hts.usitc.gov","events":[{"at":"2026-11-08T16:16:52.918Z","kind":"status","message":"Searching the site and reading its start page."},{"at":"2026-11-08T16:16:58.147Z","kind":"note","message":"I’ll check the USITC lookup requests and how the schedule links detailed HTS codes to their duty rates."}],"estimate":{"low_seconds":52,"high_seconds":104,"median_seconds":71,"samples":100},"created_at":"2026-11-08T16:16:52.904Z"}}}},"404":{"description":"No such build","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found","message":"No such build.","doc_url":"https://docs.fous.com/guides/errors#not_found","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}}}},"delete":{"operationId":"deleteBuild","tags":["Builds"],"summary":"Dismiss a build","description":"Takes a finished build off the list; the method it made stays. A build waiting for a connected account ends. Free.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"example":"bld_01m6xz5j57f8pb672103ahxa07"}],"responses":{"200":{"description":"Dismissed.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"dismissed":{"type":"boolean"}}},"example":{"id":"bld_01m6xz5j57f8pb672103ahxa07","dismissed":true}}}},"404":{"description":"No such build","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found","message":"No such build.","doc_url":"https://docs.fous.com/guides/errors#not_found","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"409":{"description":"Still building","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"conflict","message":"Only a finished build can be dismissed.","doc_url":"https://docs.fous.com/guides/errors#conflict","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}}}}},"/v1/builds/{id}/cancel":{"post":{"operationId":"cancelBuild","tags":["Builds"],"summary":"Cancel a build","description":"Cancels a build that is still going: it ends with the reason \"Stopped.\" and nothing is charged for it. A write build that already sent its action says so. Free.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"example":"bld_01m6xz5j57f8pb672103ahxa07"}],"responses":{"200":{"description":"Stopped: the updated build.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Build"}}}},"404":{"description":"No such build","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found","message":"No such build.","doc_url":"https://docs.fous.com/guides/errors#not_found","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"409":{"description":"Already ended","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"conflict","message":"The build has already ended.","doc_url":"https://docs.fous.com/guides/errors#conflict","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}}}}},"/v1/builds/{id}/messages":{"post":{"operationId":"messageBuild","tags":["Builds"],"summary":"Message a build","description":"Sends a message to a running build (or one waiting for a login), checked like a build request: it takes it at its next step (202 with the same build; seen turns true once it has). A build that ended takes no more: 409 with reason build_ended, and next_step says how to go on from it with POST /v1/builds.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"example":"bld_01m6xz5j57f8pb672103ahxa07"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":2000,"description":"Your message, in plain words."},"images":{"maxItems":4,"type":"array","items":{"anyOf":[{"type":"object","properties":{"media_type":{"type":"string","enum":["image/png","image/jpeg","image/webp","image/gif"]},"data":{"type":"string","minLength":1,"pattern":"^[A-Za-z0-9+/]+=*$"}},"required":["media_type","data"],"additionalProperties":false},{"type":"object","properties":{"url":{"type":"string","maxLength":2000,"format":"uri"}},"required":["url"],"additionalProperties":false}]},"description":"Up to 4 pictures that go with it, 2.5 MB in all: each {\"url\"} (a public https address) or {\"media_type\", \"data\"} (base64)."}},"required":["prompt"],"additionalProperties":false},"example":{"prompt":"Also return the units of quantity."}}}},"responses":{"202":{"description":"The running build takes it at its next step.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Build"},"example":{"id":"bld_01m6xz5j57f8pb672103ahxa07","status":"building","kind":"new","effect":"read","prompt":"Get the US import duty rates for a product by its HTS code","site":"hts.usitc.gov","events":[{"at":"2026-11-08T16:16:52.918Z","kind":"status","message":"Searching the site and reading its start page."},{"at":"2026-11-08T16:16:58.147Z","kind":"note","message":"I’ll check the USITC lookup requests and how the schedule links detailed HTS codes to their duty rates."}],"estimate":{"low_seconds":52,"high_seconds":104,"median_seconds":71,"samples":100},"created_at":"2026-11-08T16:16:52.904Z","messages":[{"at":"2026-11-08T16:17:05.000Z","text":"Also return the units of quantity.","seen":false}]}}}},"400":{"description":"Invalid body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"prompt: Too small: expected string to have >=1 characters","doc_url":"https://docs.fous.com/guides/errors#invalid_request","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"403":{"description":"A reader cannot message a build","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"forbidden","message":"Readers cannot change builds: ask an admin for the member role.","doc_url":"https://docs.fous.com/guides/errors#forbidden","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"404":{"description":"No such build","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found","message":"No such build.","doc_url":"https://docs.fous.com/guides/errors#not_found","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"409":{"description":"reason build_ended: the build has ended","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"conflict","reason":"build_ended","message":"This build has ended, so it takes no more messages.","next_step":"Go on from it with POST /v1/builds {\"prompt\": \"…\", \"follows\": \"bld_01m6xz5j57f8pb672103ahxa07\"}, or change hts.usitc.gov/get_import_duty with {\"prompt\": \"…\", \"method\": \"hts.usitc.gov/get_import_duty\"}.","doc_url":"https://docs.fous.com/guides/errors#conflict","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"413":{"description":"The body is over 4 MB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"Request body too large.","reason":"body_too_large","doc_url":"https://docs.fous.com/guides/errors#invalid_request","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"422":{"description":"No website, app, account or API is involved (not_buildable), or the request check turned it away (request_refused, with its verdict as reason)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_buildable","message":"Writing a poem involves no website, app, account or API.","next_step":"Name the website or the data to get, and send it again.","example":"Get the US import duty rates for a product by its HTS code from hts.usitc.gov","doc_url":"https://docs.fous.com/guides/errors#not_buildable","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"429":{"description":"Too many requests for the plan this minute","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited","message":"Too many requests for your plan this minute.","next_step":"Retry in 12 seconds.","retry_after":12,"limit":{"kind":"requests_per_minute","value":10},"doc_url":"https://docs.fous.com/guides/errors#rate_limited","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"503":{"description":"The builder or billing is briefly unavailable; nothing was charged","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"service_unavailable","message":"The builder is briefly unavailable. Nothing was started or charged.","next_step":"Try again in 30 seconds.","retry_after":30,"doc_url":"https://docs.fous.com/guides/errors#service_unavailable","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}}}}},"/v1/builds/{id}/images/{position}":{"get":{"operationId":"getBuildImage","tags":["Builds"],"summary":"Get a build image","description":"An image sent with a build request or a message, by its position (the url in images names it). Free.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"example":"bld_01m6xz5j57f8pb672103ahxa07"},{"name":"position","in":"path","required":true,"schema":{"type":"integer","minimum":0},"example":0}],"responses":{"200":{"description":"The image.","content":{"image/*":{"schema":{"type":"string","format":"binary"}}}},"404":{"description":"No such image","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found","message":"No such image.","doc_url":"https://docs.fous.com/guides/errors#not_found","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}}}}},"/v1/connections":{"post":{"operationId":"createConnection","tags":["Connections"],"summary":"Connect an account","description":"type \"session\": a website login, signed in inside Fous one step at a time. The response carries the first step (sign_in, after up to wait seconds): the fields the site asks for, which you answer with POST /v1/connections/{id}/sign-in, or the person signs in at connect_url, a Fous Studio page. After its first sign-in, a connection is active and becomes the site’s default unless the site already has a working default. If the site already has a login that needs signing in (a sign-in never finished, or the site signed it out), a sign-in starts and the response is 200 with its first step; a working login comes back as it is. To add another account instead, send another: true or a label no connection on the site has; a new website login counts against the plan’s logins. To sign in a different account on the same connection, restart its sign-in. type \"api_key\": the site’s own API key, stored encrypted and never returned. Sending the same key again returns 200 with the existing connection (made the site’s default), unless you send another: true or a different label. API keys do not count against the plan’s logins.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["site","type"],"additionalProperties":false,"properties":{"site":{"type":"string","description":"The site’s domain, like example.com."},"type":{"type":"string","enum":["session","api_key"]},"api_key":{"type":"string","description":"type api_key only."},"login_url":{"type":"string","description":"type session only: the site’s sign-in page (https, on the site), when it is not the obvious one."},"hint":{"type":"string","maxLength":500,"description":"type session only: how the person says to sign in, in their words (\"use SSO, then pick the Acme workspace\"). Fous follows it, and the way it took is remembered for signing in again unattended. Never a password, code or key: those are refused (400)."},"label":{"type":"string","maxLength":60,"description":"A name for the account (\"Client A\"), to tell several on one site apart. A label no connection on the site has creates an additional connection; a label one has returns that connection."},"totp":{"type":"string","description":"type session only: an authenticator setup key (a base32 key, or an otpauth:// or otpauth-migration:// URL), so Fous can answer the site’s authenticator codes. Never returned."},"country":{"type":"string","description":"type session only: the country the login signs in from and every run on it leaves from, as a two-letter code such as us or de. Left out, Fous chooses from the site. Changing it means signing in again, with country on the sign-in."},"another":{"type":"boolean","description":"Create an additional connection on a site that already has one, instead of returning the existing one. The site’s working default stays the default."},"wait":{"type":"integer","minimum":0,"maximum":60,"default":30,"description":"type session: seconds to wait for the sign-in’s first step."}}},"example":{"site":"portal.example.com","type":"session"}}}},"responses":{"200":{"description":"The site’s connection already there: its login (with its sign-in, started when the login needs one), or that API key saved before.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Connection"},"example":{"id":"conn_01m5kyvsdxea78rpr2j3qzzd1z","site":"portal.example.com","site_name":"Example Portal","type":"session","created_at":"2026-10-23T08:43:26.528Z","status":"active","default":true,"label":null,"account_hint":"person@example.com","checked_at":"2026-10-23T08:44:10.000Z","message":"This organization already has a connected portal.example.com account (p…@example.com); runs use it. To add another account, send a new label or another: true. To replace this one, sign in again on this connection or delete it."}}}},"201":{"description":"Created; a login’s sign-in is under way.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Connection"},"example":{"id":"conn_01m5kyvsdxea78rpr2j3qzzd1z","site":"portal.example.com","site_name":"Example Portal","type":"session","created_at":"2026-10-23T08:43:26.528Z","status":"pending","default":false,"label":null,"account_hint":null,"connect_url":"https://app.fous.com/org_01M4CD7TVHDBPFQHZD05XMW5PB/connections?connect=conn_01m5kyvsdxea78rpr2j3qzzd1z","checked_at":null,"sign_in":{"status":"input","step_id":"stp_7h2k9q","message":"Enter your email to continue.","fields":[{"id":"fld_1","label":"Email address","type":"email","required":true}],"choices":[],"expires_at":"2026-10-23T08:53:41.000Z"}}}}},"400":{"description":"Invalid body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"api_key is required when type is api_key.","doc_url":"https://docs.fous.com/guides/errors#invalid_request","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"403":{"description":"The plan’s website logins are all in use","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"plan_limit","message":"Your plan includes 3 website logins, and all 3 are in use.","next_step":"Remove one at https://app.fous.com/connections, or move to a plan with more at https://app.fous.com/billing. Nothing was charged.","limit":{"kind":"logins","value":3},"billing_url":"https://app.fous.com/billing","doc_url":"https://docs.fous.com/guides/errors#plan_limit","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"429":{"description":"Too many requests for the plan this minute","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited","message":"Too many requests for your plan this minute.","next_step":"Retry in 12 seconds.","retry_after":12,"limit":{"kind":"requests_per_minute","value":10},"doc_url":"https://docs.fous.com/guides/errors#rate_limited","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"503":{"description":"Sign-in is temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"service_unavailable","message":"Sign-in isn't available right now. Try again shortly.","doc_url":"https://docs.fous.com/guides/errors#service_unavailable","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}}}},"get":{"operationId":"listConnections","tags":["Connections"],"summary":"List connections","description":"Your organization’s connections, with any sign-in that runs. Free.","responses":{"200":{"description":"The organization’s connections.","content":{"application/json":{"schema":{"type":"object","required":["connections"],"properties":{"connections":{"type":"array","items":{"$ref":"#/components/schemas/Connection"}}}},"example":{"connections":[{"id":"conn_01m5kyvsdxea78rpr2j3qzzd1z","site":"portal.example.com","site_name":"Example Portal","type":"session","created_at":"2026-10-23T08:43:26.528Z","status":"active","default":true,"label":null,"account_hint":"person@example.com","checked_at":"2026-10-23T08:44:10.000Z"}]}}}}}}},"/v1/connections/{id}":{"get":{"operationId":"getConnection","tags":["Connections"],"summary":"Check a connection","description":"The connection and its sign-in, if one runs. With wait, the answer is held while the sign-in works or waits for the person’s approval, until it moves on.","parameters":[{"name":"id","in":"path","required":true,"description":"conn_ followed by 26 characters.","schema":{"type":"string"}},{"name":"wait","in":"query","description":"Seconds to hold the answer while the sign-in works or waits for an approval, 0 to 60.","schema":{"type":"integer","minimum":0,"maximum":60,"default":0}}],"responses":{"200":{"description":"The connection.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Connection"},"example":{"id":"conn_01m5kyvsdxea78rpr2j3qzzd1z","site":"portal.example.com","site_name":"Example Portal","type":"session","created_at":"2026-10-23T08:43:26.528Z","status":"active","default":true,"label":null,"account_hint":"person@example.com","checked_at":"2026-10-23T08:44:10.000Z"}}}},"400":{"description":"wait is not 0 to 60","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"wait must be a whole number of seconds, 0 to 60.","doc_url":"https://docs.fous.com/guides/errors#invalid_request","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"404":{"description":"Unknown connection","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found","message":"No such connection.","doc_url":"https://docs.fous.com/guides/errors#not_found","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}}}},"patch":{"operationId":"updateConnection","tags":["Connections"],"summary":"Update a connection","description":"Makes the connection its site’s default: the account runs and builds on that site use when a call names none (a working connection still comes before a default that does not work); or names it (label).","parameters":[{"name":"id","in":"path","required":true,"description":"conn_ followed by 26 characters.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"minProperties":1,"properties":{"default":{"type":"boolean","enum":[true]},"totp":{"type":["string","null"],"description":"An authenticator setup key to save (a base32 key, or an otpauth:// or otpauth-migration:// URL); null removes the saved one."},"label":{"type":["string","null"],"maxLength":60,"description":"The account’s name; null or \"\" clears it."}}},"example":{"default":true}}}},"responses":{"200":{"description":"The connection, now the default.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Connection"},"example":{"id":"conn_01m5kyvsdxea78rpr2j3qzzd1z","site":"portal.example.com","site_name":"Example Portal","type":"session","created_at":"2026-10-23T08:43:26.528Z","status":"active","default":true,"label":null,"account_hint":"person@example.com","checked_at":"2026-10-23T08:44:10.000Z"}}}},"404":{"description":"Unknown connection","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found","message":"No such connection.","doc_url":"https://docs.fous.com/guides/errors#not_found","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}}}},"delete":{"operationId":"deleteConnection","tags":["Connections"],"summary":"Delete a connection","description":"Disconnects the account, the same as Disconnect in Studio: any running sign-in stops, its browser sessions close, and its saved key or sign-in is wiped. Works with an API key or a Studio session; a session needs the owner, admin or member role.","parameters":[{"name":"id","in":"path","required":true,"description":"conn_ followed by 26 characters.","schema":{"type":"string"}}],"responses":{"200":{"description":"Disconnected.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"deleted":{"type":"boolean"}}},"example":{"id":"conn_01m5kyvsdxea78rpr2j3qzzd1z","deleted":true}}}},"404":{"description":"Unknown connection","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found","message":"No such connection.","doc_url":"https://docs.fous.com/guides/errors#not_found","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}}}}},"/v1/connections/{id}/sign-in":{"post":{"operationId":"signIn","tags":["Connections"],"summary":"Run a sign-in","description":"A website login’s sign-in, run inside Fous. {\"start\": true} starts one (or answers with the one that runs); {\"restart\": true} starts again in its place, for instance to sign in another account; login_url names the sign-in page and starts one too. {\"step_id\", \"fields\"} answers the current step with the person’s details, by field id; {\"step_id\", \"choice\"} picks one of its choices; {\"step_id\", \"hint\"} tells Fous in words what to do (it reads the screen again with it); {\"step_id\", \"click\"} passes the person’s click on a check step’s picture to the page. Reading a sign-in going on is GET /v1/connections/{id}?wait=. Starting a sign-in is your word, under the Terms, that you may use the account; the connection keeps who started it and when. Each call waits up to wait seconds while the sign-in works, then answers with the connection and its next step (sign_in), until it is active. Values are used once to sign in and never returned; Fous keeps them sealed only to sign the account in again by itself when the site signs it out. Starting a sign-in counts against the plan’s requests per minute.","parameters":[{"name":"id","in":"path","required":true,"description":"conn_ followed by 26 characters.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"start":{"type":"boolean","description":"true: start a sign-in, or answer with the one that runs."},"restart":{"type":"boolean","description":"true: start a sign-in in place of the one that runs."},"country":{"type":"string","description":"Sign in from this country (two letters): the login moves there once the sign-in succeeds; until then it stays where it is."},"login_url":{"type":"string","description":"The site’s sign-in page (https, on the site) to start the sign-in at."},"totp":{"type":"string","description":"An authenticator setup key to keep (a base32 key, or an otpauth:// or otpauth-migration:// URL). Sent alone while a code step waits, its current code is typed in."},"step_id":{"type":"string","description":"The step you answer (sign_in.step_id)."},"fields":{"type":"object","additionalProperties":{"type":["string","boolean"]},"description":"With step_id: a value for each of the step’s field ids (required ones filled in)."},"choice":{"type":"string","description":"With step_id: the id of one of the step’s choices."},"click":{"type":"object","additionalProperties":false,"required":["x","y"],"properties":{"x":{"type":"number","minimum":0,"maximum":1},"y":{"type":"number","minimum":0,"maximum":1}},"description":"With step_id, on a check step (sign_in.check): where the person clicked in its screenshot, as fractions of its width and height. Fous clicks the page there, then shows the next step (a new picture while the check is still there)."},"hint":{"type":"string","maxLength":500,"description":"The person’s instruction in their words (\"use SSO\", or the sign-in page’s address). With step_id alone, Fous reads the screen again with it; with start or restart, the sign-in starts with it. Followed until done, then dropped. Never a password, code or key (400); while a step asks for a password or a code, a single word is refused too."},"wait":{"type":"integer","minimum":0,"maximum":60,"default":30,"description":"Seconds to wait for the next step."}}},"example":{"step_id":"stp_7h2k9q","fields":{"fld_1":"person@example.com"}}}}},"responses":{"200":{"description":"The connection and its next step; active, without sign_in, once signed in.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Connection"},"example":{"id":"conn_01m5kyvsdxea78rpr2j3qzzd1z","site":"portal.example.com","site_name":"Example Portal","type":"session","created_at":"2026-10-23T08:43:26.528Z","status":"pending","default":false,"label":null,"account_hint":null,"connect_url":"https://app.fous.com/org_01M4CD7TVHDBPFQHZD05XMW5PB/connections?connect=conn_01m5kyvsdxea78rpr2j3qzzd1z","checked_at":null,"sign_in":{"status":"input","step_id":"stp_4n8w2c","message":"Enter your password to continue.","fields":[{"id":"fld_2","label":"Password","type":"password","required":true}],"choices":[],"expires_at":"2026-10-23T08:54:02.000Z"}}}}},"400":{"description":"Invalid answer, an API key, or nothing to do (no start, restart, login_url or answer)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"Answer with exactly the step’s field ids (required ones filled in), or with one of its choices.","doc_url":"https://docs.fous.com/guides/errors#invalid_request","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"404":{"description":"No such connection, or no sign-in runs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found","message":"No sign-in is running for this connection: start one first.","doc_url":"https://docs.fous.com/guides/errors#not_found","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"409":{"description":"Still working on the last answer, or not the current step","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"conflict","reason":"step_expired","message":"That step is no longer the current one. Answer the current step.","doc_url":"https://docs.fous.com/guides/errors#conflict","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"429":{"description":"Too many requests for the plan this minute","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited","message":"Too many requests for your plan this minute.","next_step":"Retry in 12 seconds.","retry_after":12,"limit":{"kind":"requests_per_minute","value":10},"doc_url":"https://docs.fous.com/guides/errors#rate_limited","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"503":{"description":"Sign-in is temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"service_unavailable","message":"Sign-in isn't available right now. Try again shortly.","doc_url":"https://docs.fous.com/guides/errors#service_unavailable","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}}}},"delete":{"operationId":"cancelSignIn","tags":["Connections"],"summary":"Cancel the sign-in","description":"Stops the sign-in that runs (none: nothing to stop). The connection keeps its status.","parameters":[{"name":"id","in":"path","required":true,"description":"conn_ followed by 26 characters.","schema":{"type":"string"}}],"responses":{"200":{"description":"The connection.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Connection"},"example":{"id":"conn_01m5kyvsdxea78rpr2j3qzzd1z","site":"portal.example.com","site_name":"Example Portal","type":"session","created_at":"2026-10-23T08:43:26.528Z","status":"pending","default":false,"label":null,"account_hint":null,"connect_url":"https://app.fous.com/org_01M4CD7TVHDBPFQHZD05XMW5PB/connections?connect=conn_01m5kyvsdxea78rpr2j3qzzd1z","checked_at":null}}}},"400":{"description":"An API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"Only a website login (type session) signs in; this connection is an API key.","doc_url":"https://docs.fous.com/guides/errors#invalid_request","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"404":{"description":"Unknown connection","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found","message":"No such connection.","doc_url":"https://docs.fous.com/guides/errors#not_found","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}}}}},"/v1/connections/{id}/code":{"post":{"operationId":"deliverConnectionCode","tags":["Connections"],"summary":"Deliver a verification code or link","description":"Hands Fous a verification code or a sign-in link for this login, from anything that can POST: an SMS forwarder, a Power Automate flow, a script reading a mailbox. content is the raw message; Fous finds the code or link in it. A sign-in waiting on one takes it at once; otherwise the next unattended sign-in does. Stale messages are ignored.","parameters":[{"name":"id","in":"path","required":true,"description":"conn_ followed by 26 characters.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["content"],"properties":{"content":{"type":"string","maxLength":65536,"description":"The message, as received."},"wait":{"type":"integer","minimum":0,"maximum":60,"default":0,"description":"Seconds to wait for the sign-in to take it."}}},"example":{"content":"Your verification code is 123456."}}}},"responses":{"200":{"description":"The connection.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Connection"}}}},"404":{"description":"Unknown connection","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found","message":"No such connection.","doc_url":"https://docs.fous.com/guides/errors#not_found","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}}}}},"/v1/workflows":{"get":{"operationId":"listWorkflows","tags":["Workflows"],"summary":"List workflows","description":"Your organization’s workflows, the latest change first, each with its trigger, the methods its steps run and its last run. Free.","responses":{"200":{"description":"The workflows.","content":{"application/json":{"schema":{"type":"object","required":["workflows"],"properties":{"workflows":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowSummary"}}}},"example":{"workflows":[{"id":"wf_01m72hccc2f47t2r9qry60m4cq","name":"Import duty lookup","description":"Looks up the US import duty for an HTS code and emails the rates.","trigger_type":"manual","enabled":false,"step_count":3,"methods":["hts.usitc.gov/get_import_duty"],"cost":{"credits":2,"per_item":null},"last_run":{"id":"wfr_01m72hcccgfzqsgbfn5w7q33sv","status":"completed","created_at":"2026-11-10T10:52:08.464Z","started_at":"2026-11-10T10:52:08.465Z","finished_at":"2026-11-10T10:52:15.650Z"},"next_run_at":null,"created_at":"2026-11-10T10:52:08.451Z","updated_at":"2026-11-10T10:52:08.451Z"}]}}}}}},"post":{"operationId":"createWorkflow","tags":["Workflows"],"summary":"Create a workflow","description":"Saves a workflow, from a prompt or from a definition. With {prompt}, AI reads your methods (their inputs and outputs), picks the ones the request needs, wires their inputs, writes the code of its transforms and saves the workflow turned off; ai.summary says what it built. What the request needs that none of your methods can do becomes a pending method step (method null, pending {need, build_prompt}) and is listed in ai.missing: accept building it with POST /v1/workflows/{id}/steps/{key}/build. A value the AI cannot know (a webhook address, an email address, an ID of your own) is left empty and listed in incomplete; the AI builds with sensible defaults rather than asking, and its summary says what is left to fill in. A prompt that asks for no automation (\"hi\", \"what can you do?\") saves nothing: the answer is 200 {workflow: null, ai} with ai.reply. When a step needs a website or account the AI cannot know (\"our supplier portal\", \"our bank\"), it asks instead: 200 {workflow: null, ai} with ai.question; send the conversation again as messages with the person's answer last. timezone (optional) is the person's, for times like \"9am\". With {name, definition}, the definition is checked against your methods: every problem answers at once in errors, each at its place (steps[2].input.query); a transform with an instruction and empty code gets its code written. Each method step is an ordinary run. A run costs 1 credit for each step that runs (methods, AI and emails; steps inside For each once per item). The number shown before you run (cost) is the full run; a run a filter ends early costs less. Transforms, webhooks, triggers, For each, filters and delays are free; failed steps cost nothing. A step whose failure can pass (the site or Fous failing for a moment, a rate limit) is tried again after 20 s, 2 min, 10 min and 30 min, 5 attempts in all; a method step whose method Fous is repairing waits for the repair. enabled (default false) turns on a schedule or a webhook; a webhook needs a paid plan. With Accept: text/event-stream the answer is Server-Sent Events while the AI writes, each `event: <name>` with `data: <JSON>`: status {text} (a short phase line); reply {text} (the next piece of a reply: append the pieces); question {text, options: [{label, value}], placeholder, allow_other} (the reply asks the person to choose, such as which site; show it as a card, and send the choice as the next message); workflow {name, description}, trigger {trigger} and step {index, step} (emitted as each top-level step is completed, in order; loops are emitted with all nested steps included; keys may still be missing) while it builds or changes the workflow; reset {} (the initial draft failed validation and the AI is restarting: discard earlier streamed events); then done with the same body the JSON answer has (the workflow and ai), or error with the error object. The stream’s HTTP status is 200 like the JSON answer’s.","requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","title":"From a prompt","additionalProperties":false,"description":"prompt, or messages (the conversation so far, newest last, ending with the person’s).","properties":{"prompt":{"type":"string","minLength":1,"maxLength":4000},"messages":{"type":"array","maxItems":50,"items":{"type":"object","required":["role","text"],"properties":{"role":{"type":"string","enum":["user","assistant"]},"text":{"type":"string"}}}},"timezone":{"type":"string","description":"An IANA time zone, like Europe/Prague. Default UTC."}}},{"type":"object","title":"From a definition","required":["name","definition"],"additionalProperties":false,"properties":{"name":{"type":"string","minLength":1,"maxLength":120},"description":{"type":"string","maxLength":1000},"definition":{"$ref":"#/components/schemas/WorkflowDefinition"},"enabled":{"type":"boolean","default":false,"description":"Whether its schedule or webhook fires."}}}]},"example":{"prompt":"Look up the US import duty for an HTS code I enter on hts.usitc.gov and email me the rates"}}}},"responses":{"200":{"description":"From a prompt, JSON or the event stream: the saved workflow with ai (it is saved turned off), or {workflow: null, ai} when it asks for no automation or the AI asks back; nothing was saved then.","content":{"application/json":{"schema":{"oneOf":[{"allOf":[{"$ref":"#/components/schemas/Workflow"},{"type":"object","required":["ai"],"properties":{"ai":{"$ref":"#/components/schemas/WorkflowAi"}}}]},{"type":"object","required":["workflow","ai"],"properties":{"workflow":{"type":"null"},"ai":{"$ref":"#/components/schemas/WorkflowAi"}}}]},"example":{"workflow":null,"ai":{"summary":null,"missing":[],"reply":"I can build this: each day it collects new invoices from your supplier portal, summarizes them and emails finance. Which supplier portal do you use?","question":{"text":"Which supplier portal do you use?","options":[{"label":"SAP Ariba","value":"service.ariba.com"},{"label":"Coupa","value":"supplier.coupahost.com"},{"label":"Basware","value":"portal.basware.com"}],"placeholder":"Portal address, e.g. portal.example.com","allow_other":true}}}},"text/event-stream":{"schema":{"type":"string","description":"With Accept: text/event-stream the answer is Server-Sent Events while the AI writes, each `event: <name>` with `data: <JSON>`: status {text} (a short phase line); reply {text} (the next piece of a reply: append the pieces); question {text, options: [{label, value}], placeholder, allow_other} (the reply asks the person to choose, such as which site; show it as a card, and send the choice as the next message); workflow {name, description}, trigger {trigger} and step {index, step} (emitted as each top-level step is completed, in order; loops are emitted with all nested steps included; keys may still be missing) while it builds or changes the workflow; reset {} (the initial draft failed validation and the AI is restarting: discard earlier streamed events); then done with the same body the JSON answer has (the workflow and ai), or error with the error object. The stream’s HTTP status is 200 like the JSON answer’s."},"example":"event: status\ndata: {\"text\":\"Reading your 6 methods\"}\n\nevent: workflow\ndata: {\"name\":\"Import duty lookup\",\"description\":\"Looks up the US import duty for an HTS code and emails the rates.\"}\n\nevent: trigger\ndata: {\"trigger\":{\"type\":\"manual\",\"inputs\":[{\"key\":\"hts_code\",\"label\":\"HTS code\",\"type\":\"string\",\"required\":true,\"default\":\"6109.10.0012\",\"description\":\"\"}]}}\n\nevent: step\ndata: {\"index\":0,\"step\":{\"key\":\"duty\",\"name\":\"Look up the import duty\",\"type\":\"method\",\"method\":\"hts.usitc.gov/get_import_duty\",\"input\":{\"hts_code\":\"{{trigger.hts_code}}\"}}}\n\nevent: done\ndata: {\"id\":\"wf_01m72hccc2f47t2r9qry60m4cq\",\"name\":\"Import duty lookup\",\"ai\":{\"summary\":\"…\",\"missing\":[],\"reply\":null,\"question\":null}}\n\n"}}},"201":{"description":"Saved from a definition.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Workflow"},"example":{"id":"wf_01m72hccc2f47t2r9qry60m4cq","name":"Import duty lookup","description":"Looks up the US import duty for an HTS code and emails the rates.","trigger_type":"manual","enabled":false,"step_count":3,"methods":["hts.usitc.gov/get_import_duty"],"cost":{"credits":2,"per_item":null},"last_run":{"id":"wfr_01m72hcccgfzqsgbfn5w7q33sv","status":"completed","created_at":"2026-11-10T10:52:08.464Z","started_at":"2026-11-10T10:52:08.465Z","finished_at":"2026-11-10T10:52:15.650Z"},"next_run_at":null,"created_at":"2026-11-10T10:52:08.451Z","updated_at":"2026-11-10T10:52:08.451Z","definition":{"trigger":{"type":"manual","inputs":[{"key":"hts_code","label":"HTS code","type":"string","required":true,"default":"6109.10.0012","description":""}]},"steps":[{"key":"duty","name":"Look up the import duty","type":"method","method":"hts.usitc.gov/get_import_duty","input":{"hts_code":"{{trigger.hts_code}}"},"connection":null,"on_error":"stop"},{"key":"note","name":"Write the rates as a note","type":"transform","instruction":"Write the general, special and column 2 rates as a short plain-text note; stop when the code has no rate.","code":"const duty = data.steps.duty.data;\nif (!duty || !duty.general_rate) stop('This code has no rate.');\nreturn [\n  `HTS ${duty.hts_code} (${duty.release})`,\n  `General rate: ${duty.general_rate}`,\n  `Special rates: ${duty.special_rates || 'none'}`,\n  `Column 2 rate: ${duty.column_2_rate}`,\n  duty.source_url,\n].join('\\n');"},{"key":"send","name":"Email the note","type":"email","to":"ada@example.com","subject":"Import duty for {{trigger.hts_code}}","body":"{{steps.note}}"}]},"webhook_url":null,"signing_secret":null,"incomplete":[]}}}},"400":{"description":"The definition (or the body) does not hold: errors lists each problem at its place","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"2 problems, first steps[0].input.country: Not an input of hts.usitc.gov/get_import_duty. It takes: hts_code.","next_step":"Fix the request as the message says, then send it again.","errors":[{"path":"steps[0].input.country","message":"Not an input of hts.usitc.gov/get_import_duty. It takes: hts_code."},{"path":"steps[1].code","message":"Step 2 (\"Write the rates as a note\") uses the output of \"Email the note\", which runs after it."}],"doc_url":"https://docs.fous.com/guides/errors#invalid_request","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"402":{"description":"No credits left, and no extra credits on (or capped, or failing to charge); nothing starts","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"insufficient_credits","message":"You've used all your credits. Choose a plan (or turn on extra credits) to keep building and running.","next_step":"Choose a plan, or turn on extra credits, at https://app.fous.com/billing. Nothing was charged.","billing_url":"https://app.fous.com/billing","doc_url":"https://docs.fous.com/guides/errors#insufficient_credits","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"403":{"description":"Webhook triggers come with a paid plan (limit.kind api); from a prompt, also the plan’s AI messages used (limit.kind chat_messages)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"plan_limit","message":"Webhook triggers come with a paid plan. This organization is on Free: run the workflow by hand or on a schedule, or choose a plan.","next_step":"Choose a plan at https://app.fous.com/billing, then turn the workflow on.","limit":{"kind":"api"},"billing_url":"https://app.fous.com/billing","doc_url":"https://docs.fous.com/guides/errors#plan_limit","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"409":{"description":"reason workflow_incomplete: a value is still to fill in (incomplete) or a step’s method still to build (steps), so the workflow cannot run or be turned on","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"conflict","reason":"workflow_incomplete","message":"This workflow is not ready: Add the webhook address in \"Send changes to the webhook\"; build the method of \"Get today’s rates\". It cannot run or be turned on until then.","next_step":"Fill in each value in incomplete (PATCH /v1/workflows/{id}); build each pending step’s method (POST /v1/workflows/{id}/steps/{key}/build), or remove the step (DELETE /v1/workflows/{id}/steps/{key}).","steps":[{"key":"rates","name":"Get today’s rates"}],"incomplete":[{"key":"post","field":"url","message":"Add the webhook address"}],"doc_url":"https://docs.fous.com/guides/errors#conflict","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"422":{"description":"reason ai_failed: the AI’s draft did not hold twice","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","reason":"ai_failed","message":"The AI could not make this into a workflow that holds (steps[1].input.query: Required.).","next_step":"Say it another way, or more precisely, then send it again.","errors":[{"path":"steps[1].input.query","message":"Required."}],"doc_url":"https://docs.fous.com/guides/errors#invalid_input","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"429":{"description":"Too many AI messages this minute (limit.kind chat_per_minute)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited","message":"You're sending messages quickly. Try again in a minute.","next_step":"Retry in 12 seconds.","retry_after":12,"limit":{"kind":"chat_per_minute"},"doc_url":"https://docs.fous.com/guides/errors#rate_limited","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"503":{"description":"The AI is unavailable: nothing was saved or changed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"service_unavailable","message":"The AI is briefly unavailable, so nothing was changed. Try again in a moment.","next_step":"Try again in 30 seconds.","retry_after":30,"doc_url":"https://docs.fous.com/guides/errors#service_unavailable","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}}}}},"/v1/workflows/ai-code":{"post":{"operationId":"writeWorkflowCode","tags":["Workflows"],"summary":"Write a transform’s code","description":"AI writes the JavaScript of one transform from its instruction, given the definition it is in (sent as it is, saved or not): it reads the step’s place, the trigger, the steps before it and their methods’ output schemas. Nothing is saved; saving a definition whose transform has an instruction and empty code does the same.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["instruction","definition","step_key"],"additionalProperties":false,"properties":{"instruction":{"type":"string","minLength":1,"maxLength":2000},"definition":{"type":"object","description":"The workflow’s definition."},"step_key":{"type":"string","description":"The transform’s key in it."}}},"example":{"instruction":"Write the general, special and column 2 rates as a short plain-text note","definition":{"trigger":{"type":"manual","inputs":[{"key":"hts_code","label":"HTS code","type":"string","required":true,"default":"6109.10.0012","description":""}]},"steps":[{"key":"duty","name":"Look up the import duty","type":"method","method":"hts.usitc.gov/get_import_duty","input":{"hts_code":"{{trigger.hts_code}}"},"connection":null,"on_error":"stop"},{"key":"note","name":"Write the rates as a note","type":"transform","instruction":"Write the general, special and column 2 rates as a short plain-text note; stop when the code has no rate.","code":"const duty = data.steps.duty.data;\nif (!duty || !duty.general_rate) stop('This code has no rate.');\nreturn [\n  `HTS ${duty.hts_code} (${duty.release})`,\n  `General rate: ${duty.general_rate}`,\n  `Special rates: ${duty.special_rates || 'none'}`,\n  `Column 2 rate: ${duty.column_2_rate}`,\n  duty.source_url,\n].join('\\n');"},{"key":"send","name":"Email the note","type":"email","to":"ada@example.com","subject":"Import duty for {{trigger.hts_code}}","body":"{{steps.note}}"}]},"step_key":"note"}}}},"responses":{"200":{"description":"The code.","content":{"application/json":{"schema":{"type":"object","required":["code"],"properties":{"code":{"type":"string"}}},"example":{"code":"const duty = data.steps.duty.data;\nif (!duty || !duty.general_rate) stop('This code has no rate.');\nreturn [\n  `HTS ${duty.hts_code} (${duty.release})`,\n  `General rate: ${duty.general_rate}`,\n  `Special rates: ${duty.special_rates || 'none'}`,\n  `Column 2 rate: ${duty.column_2_rate}`,\n  duty.source_url,\n].join('\\n');"}}}},"400":{"description":"The body does not hold, or the definition has no such step","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"step_key: The definition has no step \"note\".","errors":[{"path":"step_key","message":"The definition has no step \"note\"."}],"doc_url":"https://docs.fous.com/guides/errors#invalid_request","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"402":{"description":"No credits left, and no extra credits on (or capped, or failing to charge); nothing starts","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"insufficient_credits","message":"You've used all your credits. Choose a plan (or turn on extra credits) to keep building and running.","next_step":"Choose a plan, or turn on extra credits, at https://app.fous.com/billing. Nothing was charged.","billing_url":"https://app.fous.com/billing","doc_url":"https://docs.fous.com/guides/errors#insufficient_credits","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"403":{"description":"Free’s AI messages are used, for good (limit.kind chat_messages; window: period); the paid plans have no message limit, only a burst limit each minute","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"plan_limit","message":"Free includes 300 AI messages, and this organization has used them. Upgrade to Starter to keep chatting.","next_step":"See the plans at https://app.fous.com/billing.","limit":{"kind":"chat_messages","window":"period"},"plan":"starter","billing_url":"https://app.fous.com/billing","doc_url":"https://docs.fous.com/guides/errors#plan_limit","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"422":{"description":"The AI’s code did not hold twice","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","reason":"ai_failed","message":"The AI could not make this into a workflow that holds (note: The AI’s code did not hold: SyntaxError: unexpected token in expression: ')' (line 3)).","next_step":"Say it another way, or more precisely, then send it again.","doc_url":"https://docs.fous.com/guides/errors#invalid_input","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"429":{"description":"Too many AI messages this minute (limit.kind chat_per_minute)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited","message":"You're sending messages quickly. Try again in a minute.","next_step":"Retry in 12 seconds.","retry_after":12,"limit":{"kind":"chat_per_minute"},"doc_url":"https://docs.fous.com/guides/errors#rate_limited","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"503":{"description":"The AI is unavailable: nothing was saved or changed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"service_unavailable","message":"The AI is briefly unavailable, so nothing was changed. Try again in a moment.","next_step":"Try again in 30 seconds.","retry_after":30,"doc_url":"https://docs.fous.com/guides/errors#service_unavailable","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}}}}},"/v1/workflows/{id}":{"get":{"operationId":"getWorkflow","tags":["Workflows"],"summary":"Get a workflow","description":"The workflow with its definition, its webhook’s address, and incomplete: the values still to fill in before it can run. Free. While a step’s method is building (pending.status building), read it again every few seconds: once the build ends, the step runs the new method, or its pending.status is failed with the reason.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"example":"wf_01m72hccc2f47t2r9qry60m4cq"}],"responses":{"200":{"description":"The workflow.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Workflow"},"example":{"id":"wf_01m72hccc2f47t2r9qry60m4cq","name":"Import duty lookup","description":"Looks up the US import duty for an HTS code and emails the rates.","trigger_type":"manual","enabled":false,"step_count":3,"methods":["hts.usitc.gov/get_import_duty"],"cost":{"credits":2,"per_item":null},"last_run":{"id":"wfr_01m72hcccgfzqsgbfn5w7q33sv","status":"completed","created_at":"2026-11-10T10:52:08.464Z","started_at":"2026-11-10T10:52:08.465Z","finished_at":"2026-11-10T10:52:15.650Z"},"next_run_at":null,"created_at":"2026-11-10T10:52:08.451Z","updated_at":"2026-11-10T10:52:08.451Z","definition":{"trigger":{"type":"manual","inputs":[{"key":"hts_code","label":"HTS code","type":"string","required":true,"default":"6109.10.0012","description":""}]},"steps":[{"key":"duty","name":"Look up the import duty","type":"method","method":"hts.usitc.gov/get_import_duty","input":{"hts_code":"{{trigger.hts_code}}"},"connection":null,"on_error":"stop"},{"key":"note","name":"Write the rates as a note","type":"transform","instruction":"Write the general, special and column 2 rates as a short plain-text note; stop when the code has no rate.","code":"const duty = data.steps.duty.data;\nif (!duty || !duty.general_rate) stop('This code has no rate.');\nreturn [\n  `HTS ${duty.hts_code} (${duty.release})`,\n  `General rate: ${duty.general_rate}`,\n  `Special rates: ${duty.special_rates || 'none'}`,\n  `Column 2 rate: ${duty.column_2_rate}`,\n  duty.source_url,\n].join('\\n');"},{"key":"send","name":"Email the note","type":"email","to":"ada@example.com","subject":"Import duty for {{trigger.hts_code}}","body":"{{steps.note}}"}]},"webhook_url":null,"signing_secret":null,"incomplete":[]}}}},"404":{"description":"No such workflow","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found","message":"No such workflow.","doc_url":"https://docs.fous.com/guides/errors#not_found","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}}}},"patch":{"operationId":"updateWorkflow","tags":["Workflows"],"summary":"Update a workflow","description":"Changes any of name, description, definition and enabled, or asks the AI to change it: send {prompt} or {messages} (the conversation so far, newest last), with timezone if the workflow names a time. A new definition is checked as on create, and a transform with an instruction and empty code gets its code written, as does one whose instruction changed while its code is still the saved one; a run already going keeps the definition it started with. The AI’s change is saved the same way. With preview: true it is answered but not saved (a name and definition sent with it are the draft it reads); the AI that only answers (a question, or asking one back) changes nothing, and its words are in ai. With Accept: text/event-stream the answer streams while the AI writes (same 200, same body in done).","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"example":"wf_01m72hccc2f47t2r9qry60m4cq"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"minProperties":1,"properties":{"name":{"type":"string","minLength":1,"maxLength":120},"description":{"type":"string","maxLength":1000},"definition":{"$ref":"#/components/schemas/WorkflowDefinition"},"enabled":{"type":"boolean"},"prompt":{"type":"string","minLength":1,"maxLength":4000,"description":"A change in plain words, for the AI."},"messages":{"type":"array","maxItems":50,"description":"The conversation so far, newest last, ending with the person’s.","items":{"type":"object","required":["role","text"],"additionalProperties":false,"properties":{"role":{"type":"string","enum":["user","assistant"]},"text":{"type":"string","minLength":1,"maxLength":8000}}}},"timezone":{"type":"string","description":"An IANA time zone. Default UTC."},"preview":{"type":"boolean","description":"With a message to the AI: answer the change without saving it."}}},"example":{"enabled":true}}}},"responses":{"200":{"description":"Saved; a change the AI made is the saved workflow with ai (with preview, the workflow as it would be; when the AI only answered, the workflow as it is).","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Workflow"},{"type":"object","properties":{"ai":{"$ref":"#/components/schemas/WorkflowAi"}}}]},"example":{"id":"wf_01m72hccc2f47t2r9qry60m4cq","name":"Import duty lookup","description":"Looks up the US import duty for an HTS code and emails the rates.","trigger_type":"manual","enabled":false,"step_count":3,"methods":["hts.usitc.gov/get_import_duty"],"cost":{"credits":2,"per_item":null},"last_run":{"id":"wfr_01m72hcccgfzqsgbfn5w7q33sv","status":"completed","created_at":"2026-11-10T10:52:08.464Z","started_at":"2026-11-10T10:52:08.465Z","finished_at":"2026-11-10T10:52:15.650Z"},"next_run_at":null,"created_at":"2026-11-10T10:52:08.451Z","updated_at":"2026-11-10T10:52:08.451Z","definition":{"trigger":{"type":"manual","inputs":[{"key":"hts_code","label":"HTS code","type":"string","required":true,"default":"6109.10.0012","description":""}]},"steps":[{"key":"duty","name":"Look up the import duty","type":"method","method":"hts.usitc.gov/get_import_duty","input":{"hts_code":"{{trigger.hts_code}}"},"connection":null,"on_error":"stop"},{"key":"note","name":"Write the rates as a note","type":"transform","instruction":"Write the general, special and column 2 rates as a short plain-text note; stop when the code has no rate.","code":"const duty = data.steps.duty.data;\nif (!duty || !duty.general_rate) stop('This code has no rate.');\nreturn [\n  `HTS ${duty.hts_code} (${duty.release})`,\n  `General rate: ${duty.general_rate}`,\n  `Special rates: ${duty.special_rates || 'none'}`,\n  `Column 2 rate: ${duty.column_2_rate}`,\n  duty.source_url,\n].join('\\n');"},{"key":"send","name":"Email the note","type":"email","to":"ada@example.com","subject":"Import duty for {{trigger.hts_code}}","body":"{{steps.note}}"}]},"webhook_url":null,"signing_secret":null,"incomplete":[],"ai":{"summary":"The note now also lists the units of quantity, after the column 2 rate.","missing":[],"reply":null,"question":null}}},"text/event-stream":{"schema":{"type":"string","description":"With Accept: text/event-stream the answer is Server-Sent Events while the AI writes, each `event: <name>` with `data: <JSON>`: status {text} (a short phase line); reply {text} (the next piece of a reply: append the pieces); question {text, options: [{label, value}], placeholder, allow_other} (the reply asks the person to choose, such as which site; show it as a card, and send the choice as the next message); workflow {name, description}, trigger {trigger} and step {index, step} (emitted as each top-level step is completed, in order; loops are emitted with all nested steps included; keys may still be missing) while it builds or changes the workflow; reset {} (the initial draft failed validation and the AI is restarting: discard earlier streamed events); then done with the same body the JSON answer has (the workflow and ai), or error with the error object. The stream’s HTTP status is 200 like the JSON answer’s."}}}},"400":{"description":"The definition (or the body) does not hold: errors lists each problem at its place","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"2 problems, first steps[0].input.country: Not an input of hts.usitc.gov/get_import_duty. It takes: hts_code.","next_step":"Fix the request as the message says, then send it again.","errors":[{"path":"steps[0].input.country","message":"Not an input of hts.usitc.gov/get_import_duty. It takes: hts_code."},{"path":"steps[1].code","message":"Step 2 (\"Write the rates as a note\") uses the output of \"Email the note\", which runs after it."}],"doc_url":"https://docs.fous.com/guides/errors#invalid_request","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"402":{"description":"No credits left, and no extra credits on (or capped, or failing to charge); nothing starts","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"insufficient_credits","message":"You've used all your credits. Choose a plan (or turn on extra credits) to keep building and running.","next_step":"Choose a plan, or turn on extra credits, at https://app.fous.com/billing. Nothing was charged.","billing_url":"https://app.fous.com/billing","doc_url":"https://docs.fous.com/guides/errors#insufficient_credits","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"403":{"description":"Webhook triggers come with a paid plan (limit.kind api)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"plan_limit","message":"Webhook triggers come with a paid plan. This organization is on Free: run the workflow by hand or on a schedule, or choose a plan.","next_step":"Choose a plan at https://app.fous.com/billing, then turn the workflow on.","limit":{"kind":"api"},"billing_url":"https://app.fous.com/billing","doc_url":"https://docs.fous.com/guides/errors#plan_limit","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"404":{"description":"No such workflow","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found","message":"No such workflow.","doc_url":"https://docs.fous.com/guides/errors#not_found","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"409":{"description":"reason workflow_incomplete: a value is still to fill in (incomplete) or a step’s method still to build (steps), so the workflow cannot run or be turned on","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"conflict","reason":"workflow_incomplete","message":"This workflow is not ready: Add the webhook address in \"Send changes to the webhook\"; build the method of \"Get today’s rates\". It cannot run or be turned on until then.","next_step":"Fill in each value in incomplete (PATCH /v1/workflows/{id}); build each pending step’s method (POST /v1/workflows/{id}/steps/{key}/build), or remove the step (DELETE /v1/workflows/{id}/steps/{key}).","steps":[{"key":"rates","name":"Get today’s rates"}],"incomplete":[{"key":"post","field":"url","message":"Add the webhook address"}],"doc_url":"https://docs.fous.com/guides/errors#conflict","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"422":{"description":"reason ai_failed: the AI’s draft did not hold twice","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","reason":"ai_failed","message":"The AI could not make this into a workflow that holds (steps[1].input.query: Required.).","next_step":"Say it another way, or more precisely, then send it again.","errors":[{"path":"steps[1].input.query","message":"Required."}],"doc_url":"https://docs.fous.com/guides/errors#invalid_input","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"429":{"description":"Too many AI messages this minute (limit.kind chat_per_minute)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited","message":"You're sending messages quickly. Try again in a minute.","next_step":"Retry in 12 seconds.","retry_after":12,"limit":{"kind":"chat_per_minute"},"doc_url":"https://docs.fous.com/guides/errors#rate_limited","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"503":{"description":"The AI is unavailable: nothing was saved or changed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"service_unavailable","message":"The AI is briefly unavailable, so nothing was changed. Try again in a moment.","next_step":"Try again in 30 seconds.","retry_after":30,"doc_url":"https://docs.fous.com/guides/errors#service_unavailable","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}}}},"delete":{"operationId":"deleteWorkflow","tags":["Workflows"],"summary":"Delete a workflow","description":"Deletes the workflow: its schedule and webhook stop, and runs still going are canceled. Its runs stay readable.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"example":"wf_01m72hccc2f47t2r9qry60m4cq"}],"responses":{"200":{"description":"Deleted.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"deleted":{"type":"boolean"}}},"example":{"id":"wf_01m72hccc2f47t2r9qry60m4cq","deleted":true}}}},"404":{"description":"No such workflow","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found","message":"No such workflow.","doc_url":"https://docs.fous.com/guides/errors#not_found","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}}}}},"/v1/workflows/{id}/steps/{key}/build":{"post":{"operationId":"buildWorkflowStep","tags":["Workflows"],"summary":"Build a pending step’s method","description":"Starts a build of the method a pending step needs, from the step’s build_prompt, as POST /v1/builds starts one (same plan rules and errors). The step’s pending becomes {build_id, status: building}. When the build ends, the step runs the new method with its input and later steps’ references wired by AI, or pending.status is failed with the reason; calling this again retries. Poll GET /v1/workflows/{id} to follow it. site (optional) sets the step’s site and starts the build in one call, saved only when the build starts. A step already building returns its build; sending a different site for it returns 409.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"example":"wf_01m72hccc2f47t2r9qry60m4cq"},{"name":"key","in":"path","required":true,"schema":{"type":"string"},"example":"rates"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"site":{"type":"string","description":"Optional: the website to build on, like portal.example.com. Replaces the step’s site when the build starts. Required when the step has none (reason site_required)."},"connections":{"type":"array","items":{"type":"string"},"maxItems":20,"description":"Optional: the connected accounts (conn_…) the build may use, as in POST /v1/builds."}}},"example":{"site":"portal.example.com","connections":["conn_01m5kyvsdxea78rpr2j3qzzd1z"]}}}},"responses":{"202":{"description":"Building.","content":{"application/json":{"schema":{"type":"object","required":["build_id"],"properties":{"build_id":{"type":"string","description":"Also in GET /v1/builds/{id}."}}},"example":{"build_id":"bld_01m6vqpmggfbbv1166jvvvmsp7"}}}},"400":{"description":"The definition (or the body) does not hold: errors lists each problem at its place","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"2 problems, first steps[0].input.country: Not an input of hts.usitc.gov/get_import_duty. It takes: hts_code.","next_step":"Fix the request as the message says, then send it again.","errors":[{"path":"steps[0].input.country","message":"Not an input of hts.usitc.gov/get_import_duty. It takes: hts_code."},{"path":"steps[1].code","message":"Step 2 (\"Write the rates as a note\") uses the output of \"Email the note\", which runs after it."}],"doc_url":"https://docs.fous.com/guides/errors#invalid_request","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"403":{"description":"A plan limit (plan_limit): the plan’s sites all have methods (kind sites), or Free’s 3 builds are used (kind builds); or the caller is a reader (forbidden)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"plan_limit","message":"Your plan includes 2 sites, and all 2 are in use: example.com and example.org. Build on one of them, delete a site's methods in Studio, or move to a bigger plan.","next_step":"Delete a site's methods at https://app.fous.com/methods, or move to a bigger plan at https://app.fous.com/billing. Nothing was charged.","limit":{"kind":"sites","value":2},"billing_url":"https://app.fous.com/billing","doc_url":"https://docs.fous.com/guides/errors#plan_limit","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"404":{"description":"No such workflow, or no step with that key waiting for a method","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found","message":"The workflow has no step \"rates\" waiting for a method.","doc_url":"https://docs.fous.com/guides/errors#not_found","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"409":{"description":"reason site_required: no site was sent and the step has none. Or code conflict: the step is already building on a different site","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"conflict","reason":"site_required","message":"Tell us which site this step uses.","next_step":"Send it with this call: POST /v1/workflows/{id}/steps/{key}/build {\"site\": \"portal.example.com\"}.","doc_url":"https://docs.fous.com/guides/errors#conflict","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"422":{"description":"No website, app, account or API is involved (not_buildable), or the request check turned it away (request_refused, with its verdict as reason)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_buildable","message":"Writing a poem involves no website, app, account or API.","next_step":"Name the website or the data to get, and send it again.","example":"Get the US import duty rates for a product by its HTS code from hts.usitc.gov","doc_url":"https://docs.fous.com/guides/errors#not_buildable","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"429":{"description":"Another build of the organization is running (limit.kind concurrent_builds)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited","message":"A build is already running; it can start when that one ends.","next_step":"Retry in 30 seconds.","retry_after":30,"limit":{"kind":"concurrent_builds","value":1},"doc_url":"https://docs.fous.com/guides/errors#rate_limited","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}}}}},"/v1/workflows/{id}/steps/{key}":{"delete":{"operationId":"deleteWorkflowStep","tags":["Workflows"],"summary":"Remove a step","description":"Removes a step, a pending one included, and what is inside it. Whatever read its output reads nothing: templates are emptied, an emptied required text is left to fill in (incomplete), a filter drops conditions about it, and a transform whose code read it gets new code (a transform with code and no instruction is left as it is and the removal answers 400 naming it: change its code first). Saved like any change: an enabled workflow left with a value to fill in is refused (reason workflow_incomplete).","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"example":"wf_01m72hccc2f47t2r9qry60m4cq"},{"name":"key","in":"path","required":true,"schema":{"type":"string"},"example":"rates"}],"responses":{"200":{"description":"Removed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Workflow"},"example":{"id":"wf_01m72hccc2f47t2r9qry60m4cq","name":"Import duty lookup","description":"Looks up the US import duty for an HTS code and emails the rates.","trigger_type":"manual","enabled":false,"step_count":3,"methods":["hts.usitc.gov/get_import_duty"],"cost":{"credits":2,"per_item":null},"last_run":{"id":"wfr_01m72hcccgfzqsgbfn5w7q33sv","status":"completed","created_at":"2026-11-10T10:52:08.464Z","started_at":"2026-11-10T10:52:08.465Z","finished_at":"2026-11-10T10:52:15.650Z"},"next_run_at":null,"created_at":"2026-11-10T10:52:08.451Z","updated_at":"2026-11-10T10:52:08.451Z","definition":{"trigger":{"type":"manual","inputs":[{"key":"hts_code","label":"HTS code","type":"string","required":true,"default":"6109.10.0012","description":""}]},"steps":[{"key":"duty","name":"Look up the import duty","type":"method","method":"hts.usitc.gov/get_import_duty","input":{"hts_code":"{{trigger.hts_code}}"},"connection":null,"on_error":"stop"},{"key":"note","name":"Write the rates as a note","type":"transform","instruction":"Write the general, special and column 2 rates as a short plain-text note; stop when the code has no rate.","code":"const duty = data.steps.duty.data;\nif (!duty || !duty.general_rate) stop('This code has no rate.');\nreturn [\n  `HTS ${duty.hts_code} (${duty.release})`,\n  `General rate: ${duty.general_rate}`,\n  `Special rates: ${duty.special_rates || 'none'}`,\n  `Column 2 rate: ${duty.column_2_rate}`,\n  duty.source_url,\n].join('\\n');"},{"key":"send","name":"Email the note","type":"email","to":"ada@example.com","subject":"Import duty for {{trigger.hts_code}}","body":"{{steps.note}}"}]},"webhook_url":null,"signing_secret":null,"incomplete":[]}}}},"400":{"description":"The definition (or the body) does not hold: errors lists each problem at its place","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"2 problems, first steps[0].input.country: Not an input of hts.usitc.gov/get_import_duty. It takes: hts_code.","next_step":"Fix the request as the message says, then send it again.","errors":[{"path":"steps[0].input.country","message":"Not an input of hts.usitc.gov/get_import_duty. It takes: hts_code."},{"path":"steps[1].code","message":"Step 2 (\"Write the rates as a note\") uses the output of \"Email the note\", which runs after it."}],"doc_url":"https://docs.fous.com/guides/errors#invalid_request","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"404":{"description":"No such workflow or step","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found","message":"The workflow has no step \"rates\".","doc_url":"https://docs.fous.com/guides/errors#not_found","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"409":{"description":"reason workflow_incomplete: a value is still to fill in (incomplete) or a step’s method still to build (steps), so the workflow cannot run or be turned on","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"conflict","reason":"workflow_incomplete","message":"This workflow is not ready: Add the webhook address in \"Send changes to the webhook\"; build the method of \"Get today’s rates\". It cannot run or be turned on until then.","next_step":"Fill in each value in incomplete (PATCH /v1/workflows/{id}); build each pending step’s method (POST /v1/workflows/{id}/steps/{key}/build), or remove the step (DELETE /v1/workflows/{id}/steps/{key}).","steps":[{"key":"rates","name":"Get today’s rates"}],"incomplete":[{"key":"post","field":"url","message":"Add the webhook address"}],"doc_url":"https://docs.fous.com/guides/errors#conflict","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}}}}},"/v1/workflows/{id}/runs":{"post":{"operationId":"runWorkflow","tags":["Workflows"],"summary":"Run a workflow","description":"Starts a run by hand, enabled or not, with input for the trigger’s inputs (defaults filled in, numbers and booleans read from text). With wait (0 to 60 seconds, default 0) the answer is held until the run ends: 200 once it ended, else 202 while it goes on; read it with GET /v1/workflows/{id}/runs/{run_id}. Each method step is a run of its own, in GET /v1/runs too. A run costs 1 credit for each step that runs (methods, AI and emails; steps inside For each once per item). The number shown before you run (cost) is the full run; a run a filter ends early costs less. Transforms, webhooks, triggers, For each, filters and delays are free; failed steps cost nothing. A step whose failure can pass (the site or Fous failing for a moment, a rate limit) is tried again after 20 s, 2 min, 10 min and 30 min, 5 attempts in all; a method step whose method Fous is repairing waits for the repair. A step the organization cannot pay for fails with error.code insufficient_credits, and the run stops there.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"example":"wf_01m72hccc2f47t2r9qry60m4cq"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"input":{"type":"object","description":"Values for the trigger’s inputs."},"wait":{"type":"integer","minimum":0,"maximum":60,"default":0}}},"example":{"input":{"hts_code":"6109.10.0012"},"wait":30}}}},"responses":{"200":{"description":"The run ended within wait.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowRun"},"example":{"id":"wfr_01m72hcccgfzqsgbfn5w7q33sv","workflow_id":"wf_01m72hccc2f47t2r9qry60m4cq","status":"completed","trigger":"manual","input":{"hts_code":"6109.10.0012"},"error":null,"credits":2,"output":{"sent":1},"created_at":"2026-11-10T10:52:08.464Z","started_at":"2026-11-10T10:52:08.465Z","finished_at":"2026-11-10T10:52:15.650Z","resume_at":null,"steps":[{"seq":1,"key":"duty","path":"duty","type":"method","name":"Look up the import duty","status":"completed","input":{"hts_code":"6109.10.0012"},"output":{"status":"completed","data":{"release":"2026 HTS Revision 22","hts_code":"6109.10.00.12","description":"Men's (338)","description_path":["T-shirts, singlets, tank tops and similar garments, knitted or crocheted:","Of cotton","Men's or boys':","Other T-shirts:","Men's (338)"],"general_rate":"16.5%","special_rates":"Free (AU,BH,CL,CO,IL,JO,KR,MA,OM,P,PA,PE,S,SG)","column_2_rate":"90%","rate_source_code":"6109.10.00","source_url":"https://hts.usitc.gov/search?query=6109100012","units":["doz.","kg"],"footnotes":[],"note":"Rates are those shown in the current HTS schedule; additional duties and eligibility conditions may apply."},"run_id":"run_01m72hcccpfjaatbegf499rgk8","error":null},"error":null,"method_run_id":"run_01m72hcccpfjaatbegf499rgk8","attempts":[],"waiting":null,"started_at":"2026-11-10T10:52:08.470Z","finished_at":"2026-11-10T10:52:15.291Z"},{"seq":2,"key":"note","path":"note","type":"transform","name":"Write the rates as a note","status":"completed","input":null,"output":"HTS 6109.10.00.12 (2026 HTS Revision 22)\nGeneral rate: 16.5%\nSpecial rates: Free (AU,BH,CL,CO,IL,JO,KR,MA,OM,P,PA,PE,S,SG)\nColumn 2 rate: 90%\nhttps://hts.usitc.gov/search?query=6109100012","error":null,"method_run_id":null,"attempts":[],"waiting":null,"started_at":"2026-11-10T10:52:15.293Z","finished_at":"2026-11-10T10:52:15.307Z"},{"seq":3,"key":"send","path":"send","type":"email","name":"Email the note","status":"completed","input":{"to":["ada@example.com"],"subject":"Import duty for 6109.10.0012","body":"HTS 6109.10.00.12 (2026 HTS Revision 22)\nGeneral rate: 16.5%\nSpecial rates: Free (AU,BH,CL,CO,IL,JO,KR,MA,OM,P,PA,PE,S,SG)\nColumn 2 rate: 90%\nhttps://hts.usitc.gov/search?query=6109100012"},"output":{"sent":1},"error":null,"method_run_id":null,"attempts":[],"waiting":null,"started_at":"2026-11-10T10:52:15.310Z","finished_at":"2026-11-10T10:52:15.648Z"}]}}}},"202":{"description":"Queued or still going.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowRun"},"example":{"id":"wfr_01m72hcccgfzqsgbfn5w7q33sv","workflow_id":"wf_01m72hccc2f47t2r9qry60m4cq","status":"queued","trigger":"manual","input":{"hts_code":"6109.10.0012"},"error":null,"credits":0,"output":{"sent":1},"created_at":"2026-11-10T10:52:08.464Z","started_at":null,"finished_at":null,"resume_at":null,"steps":[]}}}},"400":{"description":"The body does not hold, or the input does not fit the trigger’s inputs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"body: Unrecognized key: \"hts_code\"","errors":[{"path":"body","message":"Unrecognized key: \"hts_code\""}],"doc_url":"https://docs.fous.com/guides/errors#invalid_request","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"404":{"description":"No such workflow","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found","message":"No such workflow.","doc_url":"https://docs.fous.com/guides/errors#not_found","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"409":{"description":"reason workflow_incomplete: a value is still to fill in (incomplete) or a step’s method still to build (steps), so the workflow cannot run or be turned on","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"conflict","reason":"workflow_incomplete","message":"This workflow is not ready: Add the webhook address in \"Send changes to the webhook\"; build the method of \"Get today’s rates\". It cannot run or be turned on until then.","next_step":"Fill in each value in incomplete (PATCH /v1/workflows/{id}); build each pending step’s method (POST /v1/workflows/{id}/steps/{key}/build), or remove the step (DELETE /v1/workflows/{id}/steps/{key}).","steps":[{"key":"rates","name":"Get today’s rates"}],"incomplete":[{"key":"post","field":"url","message":"Add the webhook address"}],"doc_url":"https://docs.fous.com/guides/errors#conflict","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}}}},"get":{"operationId":"listWorkflowRuns","tags":["Workflows"],"summary":"List a workflow’s runs","description":"The workflow’s runs, newest first, without their steps. Free.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"example":"wf_01m72hccc2f47t2r9qry60m4cq"},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},{"name":"before","in":"query","description":"The id of the last run you read (wfr_…), or an ISO time: the page after it. Keep reading while has_more is true.","schema":{"type":"string"},"example":"wfr_01m72hcccgfzqsgbfn5w7q33sv"}],"responses":{"200":{"description":"The runs.","content":{"application/json":{"schema":{"type":"object","required":["runs","has_more"],"properties":{"runs":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowRun"}},"has_more":{"type":"boolean","description":"Whether older runs follow."}}},"example":{"runs":[{"id":"wfr_01m72hcccgfzqsgbfn5w7q33sv","workflow_id":"wf_01m72hccc2f47t2r9qry60m4cq","status":"completed","trigger":"manual","input":{"hts_code":"6109.10.0012"},"error":null,"credits":2,"created_at":"2026-11-10T10:52:08.464Z","started_at":"2026-11-10T10:52:08.465Z","finished_at":"2026-11-10T10:52:15.650Z","resume_at":null}],"has_more":false}}}},"404":{"description":"No such workflow","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found","message":"No such workflow.","doc_url":"https://docs.fous.com/guides/errors#not_found","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}}}}},"/v1/workflows/{id}/runs/{run_id}":{"get":{"operationId":"getWorkflowRun","tags":["Workflows"],"summary":"Get a workflow run","description":"The run with each step as it ran: its status, resolved input, output and error. A step that takes time (a method, a loop, a delay) shows running until it ends. With wait (0 to 60 seconds, default 0) the answer is held until the run ends. Free.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"example":"wf_01m72hccc2f47t2r9qry60m4cq"},{"name":"run_id","in":"path","required":true,"schema":{"type":"string"},"example":"wfr_01m72hcccgfzqsgbfn5w7q33sv"},{"name":"wait","in":"query","description":"Seconds to hold the answer while it is still running, 0 to 60.","schema":{"type":"integer","minimum":0,"maximum":60,"default":0}}],"responses":{"200":{"description":"The run has ended.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowRun"},"example":{"id":"wfr_01m72hcccgfzqsgbfn5w7q33sv","workflow_id":"wf_01m72hccc2f47t2r9qry60m4cq","status":"completed","trigger":"manual","input":{"hts_code":"6109.10.0012"},"error":null,"credits":2,"output":{"sent":1},"created_at":"2026-11-10T10:52:08.464Z","started_at":"2026-11-10T10:52:08.465Z","finished_at":"2026-11-10T10:52:15.650Z","resume_at":null,"steps":[{"seq":1,"key":"duty","path":"duty","type":"method","name":"Look up the import duty","status":"completed","input":{"hts_code":"6109.10.0012"},"output":{"status":"completed","data":{"release":"2026 HTS Revision 22","hts_code":"6109.10.00.12","description":"Men's (338)","description_path":["T-shirts, singlets, tank tops and similar garments, knitted or crocheted:","Of cotton","Men's or boys':","Other T-shirts:","Men's (338)"],"general_rate":"16.5%","special_rates":"Free (AU,BH,CL,CO,IL,JO,KR,MA,OM,P,PA,PE,S,SG)","column_2_rate":"90%","rate_source_code":"6109.10.00","source_url":"https://hts.usitc.gov/search?query=6109100012","units":["doz.","kg"],"footnotes":[],"note":"Rates are those shown in the current HTS schedule; additional duties and eligibility conditions may apply."},"run_id":"run_01m72hcccpfjaatbegf499rgk8","error":null},"error":null,"method_run_id":"run_01m72hcccpfjaatbegf499rgk8","attempts":[],"waiting":null,"started_at":"2026-11-10T10:52:08.470Z","finished_at":"2026-11-10T10:52:15.291Z"},{"seq":2,"key":"note","path":"note","type":"transform","name":"Write the rates as a note","status":"completed","input":null,"output":"HTS 6109.10.00.12 (2026 HTS Revision 22)\nGeneral rate: 16.5%\nSpecial rates: Free (AU,BH,CL,CO,IL,JO,KR,MA,OM,P,PA,PE,S,SG)\nColumn 2 rate: 90%\nhttps://hts.usitc.gov/search?query=6109100012","error":null,"method_run_id":null,"attempts":[],"waiting":null,"started_at":"2026-11-10T10:52:15.293Z","finished_at":"2026-11-10T10:52:15.307Z"},{"seq":3,"key":"send","path":"send","type":"email","name":"Email the note","status":"completed","input":{"to":["ada@example.com"],"subject":"Import duty for 6109.10.0012","body":"HTS 6109.10.00.12 (2026 HTS Revision 22)\nGeneral rate: 16.5%\nSpecial rates: Free (AU,BH,CL,CO,IL,JO,KR,MA,OM,P,PA,PE,S,SG)\nColumn 2 rate: 90%\nhttps://hts.usitc.gov/search?query=6109100012"},"output":{"sent":1},"error":null,"method_run_id":null,"attempts":[],"waiting":null,"started_at":"2026-11-10T10:52:15.310Z","finished_at":"2026-11-10T10:52:15.648Z"}]}}}},"202":{"description":"Still going (queued, running or waiting).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowRun"},"example":{"id":"wfr_01m72hcccgfzqsgbfn5w7q33sv","workflow_id":"wf_01m72hccc2f47t2r9qry60m4cq","status":"running","trigger":"manual","input":{"hts_code":"6109.10.0012"},"error":null,"credits":2,"output":null,"created_at":"2026-11-10T10:52:08.464Z","started_at":"2026-11-10T10:52:08.465Z","finished_at":null,"resume_at":null,"steps":[{"seq":1,"key":"duty","path":"duty","type":"method","name":"Look up the import duty","status":"completed","input":{"hts_code":"6109.10.0012"},"output":{"status":"completed","data":{"release":"2026 HTS Revision 22","hts_code":"6109.10.00.12","description":"Men's (338)","description_path":["T-shirts, singlets, tank tops and similar garments, knitted or crocheted:","Of cotton","Men's or boys':","Other T-shirts:","Men's (338)"],"general_rate":"16.5%","special_rates":"Free (AU,BH,CL,CO,IL,JO,KR,MA,OM,P,PA,PE,S,SG)","column_2_rate":"90%","rate_source_code":"6109.10.00","source_url":"https://hts.usitc.gov/search?query=6109100012","units":["doz.","kg"],"footnotes":[],"note":"Rates are those shown in the current HTS schedule; additional duties and eligibility conditions may apply."},"run_id":"run_01m72hcccpfjaatbegf499rgk8","error":null},"error":null,"method_run_id":"run_01m72hcccpfjaatbegf499rgk8","attempts":[],"waiting":null,"started_at":"2026-11-10T10:52:08.470Z","finished_at":"2026-11-10T10:52:15.291Z"},{"seq":2,"key":"note","path":"note","type":"transform","name":"Write the rates as a note","status":"completed","input":null,"output":"HTS 6109.10.00.12 (2026 HTS Revision 22)\nGeneral rate: 16.5%\nSpecial rates: Free (AU,BH,CL,CO,IL,JO,KR,MA,OM,P,PA,PE,S,SG)\nColumn 2 rate: 90%\nhttps://hts.usitc.gov/search?query=6109100012","error":null,"method_run_id":null,"attempts":[],"waiting":null,"started_at":"2026-11-10T10:52:15.293Z","finished_at":"2026-11-10T10:52:15.307Z"},{"seq":3,"key":"send","path":"send","type":"email","name":"Email the note","status":"running","input":{"to":["ada@example.com"],"subject":"Import duty for 6109.10.0012","body":"HTS 6109.10.00.12 (2026 HTS Revision 22)\nGeneral rate: 16.5%\nSpecial rates: Free (AU,BH,CL,CO,IL,JO,KR,MA,OM,P,PA,PE,S,SG)\nColumn 2 rate: 90%\nhttps://hts.usitc.gov/search?query=6109100012"},"output":null,"error":null,"method_run_id":null,"attempts":[],"waiting":null,"started_at":"2026-11-10T10:52:15.310Z","finished_at":null}]}}}},"400":{"description":"wait is not a whole number from 0 to 60","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"wait is a whole number of seconds from 0 to 60.","doc_url":"https://docs.fous.com/guides/errors#invalid_request","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"404":{"description":"No such workflow run","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found","message":"No such workflow run.","doc_url":"https://docs.fous.com/guides/errors#not_found","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}}}}},"/v1/workflows/{id}/runs/{run_id}/cancel":{"post":{"operationId":"cancelWorkflowRun","tags":["Workflows"],"summary":"Cancel a workflow run","description":"Cancels a run that is queued, running or waiting: it does not go on, and a method run its step had going is stopped and free. The steps already finished stay charged (credits on the answer).","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"example":"wf_01m72hccc2f47t2r9qry60m4cq"},{"name":"run_id","in":"path","required":true,"schema":{"type":"string"},"example":"wfr_01m72hcccgfzqsgbfn5w7q33sv"}],"responses":{"200":{"description":"Canceled.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowRun"},"example":{"id":"wfr_01m72hcccgfzqsgbfn5w7q33sv","workflow_id":"wf_01m72hccc2f47t2r9qry60m4cq","status":"canceled","trigger":"manual","input":{"hts_code":"6109.10.0012"},"error":{"code":"canceled","message":"The run was canceled."},"credits":2,"output":{"sent":1},"created_at":"2026-11-10T10:52:08.464Z","started_at":"2026-11-10T10:52:08.465Z","finished_at":"2026-11-10T10:52:15.650Z","resume_at":null,"steps":[]}}}},"404":{"description":"No such workflow run","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found","message":"No such workflow run.","doc_url":"https://docs.fous.com/guides/errors#not_found","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"409":{"description":"Already ended","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"conflict","message":"The run has already ended.","doc_url":"https://docs.fous.com/guides/errors#conflict","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}}}}},"/v1/workflows/{id}/webhook":{"post":{"operationId":"renewWorkflowWebhook","tags":["Workflows"],"summary":"Renew a webhook address","description":"Gives a webhook workflow a new address; the old one stops working at once. A webhook workflow gets its first address when it is saved.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"example":"wf_01m72hccc2f47t2r9qry60m4cq"}],"responses":{"200":{"description":"The new address.","content":{"application/json":{"schema":{"type":"object","required":["webhook_url"],"properties":{"webhook_url":{"type":"string"}}},"example":{"webhook_url":"https://api.fous.com/v1/hooks/whk_3q9ZxK0cLm2vT8yR5nB1wJ7dF4hG6sPa"}}}},"404":{"description":"No such workflow","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found","message":"No such workflow.","doc_url":"https://docs.fous.com/guides/errors#not_found","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"409":{"description":"Not a webhook workflow","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"conflict","message":"Only a workflow with a webhook trigger has a webhook address: set its trigger type to webhook first.","doc_url":"https://docs.fous.com/guides/errors#conflict","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}}}}},"/v1/workflows/{id}/signing-secret":{"post":{"operationId":"renewWorkflowSigningSecret","tags":["Workflows"],"summary":"Renew the signing secret","description":"Gives the workflow a new secret for signing its webhook steps’ calls (X-Fous-Signature); the old one stops signing at once.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"example":"wf_01m72hccc2f47t2r9qry60m4cq"}],"responses":{"200":{"description":"The new secret.","content":{"application/json":{"schema":{"type":"object","required":["signing_secret"],"properties":{"signing_secret":{"type":"string"}}},"example":{"signing_secret":"whsec_3q9ZxK0cLm2vT8yR5nB1wJ7dF4hG6sPa"}}}},"404":{"description":"No such workflow","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found","message":"No such workflow.","doc_url":"https://docs.fous.com/guides/errors#not_found","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}}}}},"/v1/hooks/{token}":{"post":{"operationId":"callWorkflowWebhook","tags":["Workflows"],"summary":"Start a run from a webhook","description":"A webhook workflow’s address (webhook_url): another service POSTs JSON here and its fields are the run’s input, checked against the trigger’s inputs. No API key: the address is the secret. The workflow must be enabled. At most 60 calls a minute per workflow, and 100 of its runs waiting to start. With an Idempotency-Key header (or a sender’s delivery id: webhook-id, svix-id, X-GitHub-Delivery, X-Shopify-Webhook-Id), a call that repeats one within 24 hours answers the run the first started (repeated: true) instead of starting another.","security":[],"parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string"},"example":"whk_3q9ZxK0cLm2vT8yR5nB1wJ7dF4hG6sPa"},{"name":"Idempotency-Key","in":"header","required":false,"description":"The sender’s own id for the call, up to 255 characters. Without it, a sender’s delivery id is used the same way: webhook-id (Standard Webhooks), svix-id, X-GitHub-Delivery or X-Shopify-Webhook-Id.","schema":{"type":"string","maxLength":255},"example":"order-1042"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","description":"Any JSON object, up to 256 KB."},"example":{"order_id":1042,"customer":{"name":"Ada"}}}}},"responses":{"202":{"description":"Queued.","content":{"application/json":{"schema":{"type":"object","required":["run_id","workflow_id"],"properties":{"run_id":{"type":"string"},"workflow_id":{"type":"string"},"repeated":{"type":"boolean","description":"The Idempotency-Key was sent within 24 hours: its run."}}},"example":{"run_id":"wfr_01m72hcccgfzqsgbfn5w7q33sv","workflow_id":"wf_01m72hccc2f47t2r9qry60m4cq"}}}},"400":{"description":"The body does not fit the trigger’s inputs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"input.order_id: Required.","errors":[{"path":"input.order_id","message":"Required."}],"doc_url":"https://docs.fous.com/guides/errors#invalid_request","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"403":{"description":"Webhook triggers come with a paid plan (limit.kind api)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"plan_limit","message":"Webhook triggers come with a paid plan. This organization is on Free: run the workflow by hand or on a schedule, or choose a plan.","next_step":"Choose a plan at https://app.fous.com/billing, then turn the workflow on.","limit":{"kind":"api"},"billing_url":"https://app.fous.com/billing","doc_url":"https://docs.fous.com/guides/errors#plan_limit","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"404":{"description":"No workflow at this address","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found","message":"No workflow listens at this address.","doc_url":"https://docs.fous.com/guides/errors#not_found","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"409":{"description":"The workflow is turned off","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"conflict","message":"The workflow is turned off: turn it on in Fous Studio.","doc_url":"https://docs.fous.com/guides/errors#conflict","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}},"429":{"description":"Too many calls this minute, or 100 runs waiting to start","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited","message":"Too many calls to this webhook; try again shortly.","retry_after":12,"doc_url":"https://docs.fous.com/guides/errors#rate_limited","request_id":"req_mh7c2k9xQ1v3Zt8LbN0pRwY4"}}}}}}}},"/v1/account":{"get":{"operationId":"getAccount","tags":["Account"],"summary":"Get the account","description":"The organization behind the key: its plan, credits left, limits and what it uses of them, builds and prices. Free.","responses":{"200":{"description":"The account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Account"},"example":{"organization":{"id":"org_01M4CD7TVHDBPFQHZD05XMW5PB","name":"Agent Test"},"plan":{"id":"pro","name":"Pro"},"credits":{"balance":2585,"balance_usd":25.85,"monthly_included":5000,"resets_at":null,"extra_on":true},"limits":{"requests_per_minute":60,"concurrent_runs":10,"logins":5,"sites":5,"seats":10,"run_history_hours":336,"health_check_hours":24,"monthly_spend_limit_credits":null},"usage":{"sites":2,"logins":1},"builds":{"included":30,"used":3,"period":"month","resets_at":"2026-12-03T09:12:44.000Z","extra_credits":null},"prices":{"search":0,"run":1},"workflows":{"external_email":false},"key":{"name":"Server","expires_at":null,"last_used_at":"2026-10-23T09:11:15.000Z"}}}}}}}}},"x-error-codes":[{"code":"invalid_request","status":400,"retryable":false,"description":"The request itself is malformed: a missing or invalid parameter or body field, or (413, reason body_too_large) a body over 4 MB. A workflow’s definition or a run’s input lists every problem in errors, each at its path. Fix it and send again."},{"code":"unauthorized","status":401,"retryable":false,"description":"No API key, or the key is invalid, revoked or expired; reason says which. Send Authorization: Bearer <key>."},{"code":"insufficient_credits","status":402,"retryable":false,"description":"Not enough credits left: required_credits is what the run costs and available_credits what you have left. reason spend_limit (with spend_limit) means the monthly spend limit is reached. billing_url says where to get more: on Free, next_step says to buy credits there (200 for $12, as often as needed; they never expire) or choose a plan, and when next month’s 100 free credits come; on Starter, Pro and Business extra credits are charged automatically up to a monthly limit, so it says to turn them on or raise the limit; an Enterprise agreement without its own price for extra credits adds them by writing to us. Nothing was charged."},{"code":"traffic_budget_reached","status":402,"retryable":false,"description":"This organization has used its residential routes for this month, and the run needed one. Runs on sites that answer Fous directly keep working; the rest come back next month, or talk to support. Nothing was charged."},{"code":"forbidden","status":403,"retryable":false,"description":"Not allowed for this credential: for Studio’s session not a member of the organization, a reader, who may only read (owners, admins and members build, run, connect and change methods), or a failed CSRF check."},{"code":"connection_required","status":403,"retryable":false,"description":"The method runs with an account on its site and none is connected, or it signed out. connect names the site and type (and connection_id and its status when you have a connection there); connect_url is the Fous Studio page where a person connects it. Sign in there or with POST /v1/connections/{id}/sign-in, or connect one with POST /v1/connections, then run again."},{"code":"plan_limit","status":403,"retryable":false,"description":"A limit of the plan, named in limit.kind: logins (its website logins are all in use: remove one in Studio, or move to a bigger plan; the ones you have keep working), sites (its sites all have methods: build on one of them, delete a site’s methods in Studio, or move to a bigger plan; the ones you have keep running), builds (Free’s 3 builds are used, for good, or a paid plan’s builds of the month when the plan takes no extra credits for more; a failed build or a repair never counts), chat_messages (Free’s AI messages are used), email_recipients (a workflow email to someone outside the organization, which needs Business or Enterprise), or api (on Free, a build started with an API key or MCP client, which must start in Fous Studio or on a paid plan; a workflow’s webhook trigger needs a paid plan the same way)."},{"code":"not_found","status":404,"retryable":false,"description":"No such method, run, build, connection or workflow. For a method, suggestions lists close matches and, when one is close enough, did_you_mean names it."},{"code":"request_timeout","status":408,"retryable":true,"description":"The answer took longer than the server waits. A run may still finish: run with a shorter wait and poll GET /v1/runs/{id}."},{"code":"conflict","status":409,"retryable":false,"description":"Not possible in the state it is in: a run that was stopped (reason stopped; a write that was already sent carries may_have_run), cancelling a run, build or workflow run that already ended, a webhook of a workflow that is turned off, dismissing a build that is still running, a message to a build that has ended (reason build_ended), or a sign-in answer while it still works on the last one (reason sign_in_busy) or for a step that is no longer the current one (reason step_expired)."},{"code":"invalid_input","status":422,"retryable":false,"description":"The input does not fit the method’s input_schema. errors lists every problem at once (unknown names with did_you_mean, missing, wrong types, values outside an enum or range); input_schema is the method’s own and example a call that fits. Nothing was charged."},{"code":"request_refused","status":422,"retryable":false,"description":"The request check found that a build breaks the acceptable use rules; reason is its verdict (explicit, harmful or platform_probe) and doc_url the rules, in the Terms. Only such a verdict turns a request away: an unclear request goes on, and so does one the check could not reach. Nothing started or was charged."},{"code":"not_buildable","status":422,"retryable":false,"description":"A build request that involves no website, app, account or API, so no method can do it; example shows a request that can be built. Nothing started or was charged."},{"code":"rate_limited","status":429,"retryable":true,"description":"Too many requests, searches or runs at once for your plan, builds at once (concurrent_builds), or AI requests in a minute (ai_per_minute, chat_per_minute): limit says which (and its value when it has one), retry_after and the Retry-After header when to retry. A site limiting Fous is upstream_error with reason site_rate_limited."},{"code":"server_error","status":500,"retryable":true,"description":"Something failed inside Fous. Try again shortly."},{"code":"upstream_error","status":503,"retryable":true,"description":"The site answered with an error, or its answer no longer fits the method (Fous checks the method on its saved examples and repairs it when they break too). reason site_rate_limited means the site itself slowed you down."},{"code":"upstream_blocked","status":503,"retryable":true,"description":"The site refused the request on every route Fous tried."},{"code":"upstream_timeout","status":503,"retryable":true,"description":"The site did not answer in time, or no browser was free in time."},{"code":"upstream_geo_blocked","status":503,"retryable":false,"description":"The site does not serve the country the run left from. Run it with a connection or method set to a country the site serves. Nothing was charged."},{"code":"run_traffic_limit","status":503,"retryable":false,"description":"The run moved more data than a run may, so it stopped. Use a method that loads less of the site, or an API the site offers. Nothing was charged."},{"code":"method_unavailable","status":503,"retryable":false,"description":"The method’s spec itself failed (Fous checks it on its saved examples and repairs it when they fail too). Search for another method."},{"code":"method_repairing","status":503,"retryable":true,"description":"The version is under repair, confirmed broken: runs are refused until the repair ends, usually within minutes. repair says when it is back at the latest (also Retry-After), version and latest_version which version this is, alternatives which methods do the same. Nothing was charged."},{"code":"service_unavailable","status":503,"retryable":true,"description":"Fous itself (the builder, billing) is briefly unavailable; nothing was started or charged. Retry after retry_after seconds."}],"x-mcp":{"url":"https://api.fous.com/mcp","tools":["search","run","run_action","get_run","stop","build","connections","methods","builds","workflows","account"]}}