Skip to content
FousDocs
Open Studio

Runs

Run a method with your own input and get the result.

The RunList object

  • runsarray of objectrequired
    Show child attributes
    • idstringrequired
    • statusstringrequired

      runningcompletedfailedcanceled

    • methodobject or nullrequired

      The method and version that ran; null when it no longer exists.

      Show child attributes
      • idstring
      • slugstring or null
      • versioninteger or null
    • created_atstringrequired
    • completed_atstring or nullrequired
    • creditsintegerrequired

      What it was charged, in credits.

    • duration_msinteger or null
    • expiredboolean

      Its input and result are gone: both are null.

    • inputJSON value

      What it was given, until it expires.

    • dataJSON value

      Its result, until it expires.

    • errorError

      A failed or canceled run, until its input and result expire.

  • has_morebooleanrequired

    More runs are older: send before with the last run’s id.

The Run object

  • idstringrequired

    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).

  • statusstringrequired

    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.

    runningcompletedfailedcanceled

  • methodobject

    The method and the version that ran.

    Show child attributes
    • idstring
    • slugstring or null
    • versioninteger
    • latest_versioninteger

      The method’s newest version.

  • errorError

    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.

  • dataJSON value

    The result, shaped by the method’s output_schema. null once expired.

  • noticestring

    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.

  • emptyboolean

    The site answered and has nothing for this input (still a success).

  • rawJSON value

    With include_raw: the site’s own response.

  • truncatedboolean

    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.

  • missingarray of string

    What the answer lacks, in plain words (a source that failed, items that could not be read, pages not read). Only when something is.

  • creditsintegerrequired

    What it was charged, in credits.

  • costobject

    Deprecated: read credits. The same figure, as runs reported it before credits; on every run that ended.

    Show child attributes
    • creditsinteger
  • duration_msinteger or null
  • expiredboolean

    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_atstringrequired
  • completed_atstring or nullrequired

List runs

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.

Query parameters

  • limitintegerdefault 20
  • beforestring

    Only runs older than this: an ISO time, or a run id (the last one of the page before).

  • methodstring

    Only the runs of this method (its id or slug).

  • statusstring

    Only the runs in this status.

    runningcompletedfailedcanceled

Returns

A RunList object.

  • 200The runs.

Errors

StatusCodeWhen
400invalid_requestlimit, before or status is not one

Run a method

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.

Headers

  • Idempotency-Keystring

    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.

Request body

Required, JSON.

  • methodstringrequired

    The method’s id (mth_…) or slug (<domain>/<name>); add @N to run version N instead of the current one.

  • inputobject

    Fits the method’s input_schema; an input sent as null counts as not sent.

  • connectionstring

    A conn_ id, when the method needs an account and you want one other than the default.

  • include_rawboolean

    Also return the site’s own response as raw.

  • waitinteger

    Seconds to wait for the answer, 0 to 60 (default 30); a longer run answers 202 and goes on.

Returns

A Run object.

  • 200Completed (data may be empty: true when the site has nothing).
  • 202Still running. The same Run, with status "running".

Errors

StatusCodeWhen
400invalid_requestNo method, or a body that does not fit
402insufficient_creditsNot enough credits left
403connection_requiredThe method needs a connected account
404not_foundNo such method or version, or (param connection) no such connection on its site
422invalid_inputThe input does not fit
429rate_limitedToo many requests
503method_repairingupstream_errorupstream_blockedupstream_timeoutservice_unavailableThe 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)

Get a run

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.

Path parameters

  • idstringrequired

Query parameters

  • waitintegerdefault 0

    Seconds to hold the answer while it is still running, 0 to 60.

Returns

A Run object.

  • 200Completed.
  • 202Still running. The same Run, with status "running".

Errors

StatusCodeWhen
404not_foundNo such run, or one older than the 30 days a run stays readable
409conflictThe run was canceled
503method_repairingupstream_errorupstream_blockedupstream_timeoutservice_unavailableThe 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)

Cancel a run

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.

Path parameters

  • idstringrequired

Returns

A Run object.

  • 200Canceled.

Errors

StatusCodeWhen
404not_foundNo such run, or one older than the 30 days a run stays readable
409conflictAlready ended