Skip to content
FousDocs
Open Studio

Connections

Website logins and API keys that methods run with.

The Connection object

  • idstringrequired

    conn_ followed by 26 characters.

  • sitestringrequired

    The site’s domain, like example.com.

  • site_namestringrequired

    The site’s name, like Example.

  • typestringrequired

    session: a website login; api_key: the site’s own API key.

    sessionapi_key

  • statusstringrequired

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

    pendingactiveneeds_attention

  • defaultbooleanrequired

    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_hintstring or null

    What account this is: session, the identifier it signed in with, in full; api_key, the last characters of the saved key.

  • labelstring or null

    The organization’s name for the account ("US warehouse"), to tell several on one site apart; null: none.

  • connect_urlstring

    session, until active or while it signs in again: a Fous Studio page where a person signs in to this connection.

  • countrystring

    session only: the country the login signs in and every run on it leaves from.

  • renewalobject

    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.

    Show child attributes
    • statusstringrequired

      readyneeds_setupmanual

    • factorstringrequired

      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.

      nonetotpemailsmscodedevice

    • messagestringrequired
    • inbound_emailstring

      The address to forward this login’s verification emails to (in_<token>@…). Whoever knows it can deliver codes to its sign-in.

    • totp_savedboolean

      true when an authenticator key is saved on this login. The key itself is never returned.

  • waiting_workflowsarray of string

    needs_attention, when this one connection is read: the names of the workflows waiting on it.

  • sign_inobject

    A website sign-in, while it runs and for a while after it failed. Answer its step with POST /v1/connections/{id}/sign-in.

    Show child attributes
    • statusstringrequired

      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.

      workinginputapprovalfailed

    • step_idstring

      input and approval: the step an answer is for.

    • messagestringrequired

      What the site asks for, or why it failed, in a sentence for the person.

    • codestring

      approval: the number the site shows, which the person picks on their device.

    • factorstring

      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.

      totpemailsmscodedevice

    • try_countryboolean

      failed: the site could not be opened or says it does not serve this country; signing in again with country may work.

    • rejectedboolean

      input: true when the website turned down the last answer; message says so and the same fields are asked again.

    • questionboolean

      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.

    • screenshotstring

      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.

    • repeatedboolean

      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.

    • checkboolean

      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_atstring

      When the sign-in started.

    • fieldsarray of objectrequired

      What the site asks for. Values are never stored or returned.

      Show child attributes
      • idstringrequired

        The key of its value in fields.

      • labelstringrequired

        What to ask the person for.

      • typestringrequired

        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.

        emailtextpasswordcodeselectcheckboxlink

      • requiredbooleanrequired
      • optionsarray of object

        select: the values it takes.

        Show child attributes
        • valuestringrequired
        • labelstringrequired
      • lengthinteger

        code: how many characters, when known.

    • choicesarray of objectrequired

      input: ways to go on (send one as choice), such as where to send a code.

      Show child attributes
      • idstringrequired
      • labelstringrequired
    • expires_atstring

      When the sign-in ends unless it moves on.

  • sign_in_endedobject

    A sign-in the call waited on ended without signing in. An account connected before is unchanged.

    Show child attributes
    • reasonstringrequired

      cancelled

    • messagestringrequired
  • messagestring

    POST /v1/connections for a site whose login is already connected: states that runs use this connection and how to add another.

  • checked_atstring or null
  • created_atstring

List connections

Your organization’s connections, with any sign-in that runs. Free.

Returns

  • 200The organization’s connections.

The answer has these fields:

Connect an account

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.

Request body

Required, JSON.

  • sitestringrequired

    The site’s domain, like example.com.

  • typestringrequired

    sessionapi_key

  • api_keystring

    type api_key only.

  • login_urlstring

    type session only: the site’s sign-in page (https, on the site), when it is not the obvious one.

  • hintstring

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

  • labelstring

    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.

  • totpstring

    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.

  • countrystring

    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.

  • anotherboolean

    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.

  • waitintegerdefault 30

    type session: seconds to wait for the sign-in’s first step.

Returns

A Connection object.

  • 200The site’s connection already there: its login (with its sign-in, started when the login needs one), or that API key saved before.
  • 201Created; a login’s sign-in is under way. The same Connection, with status "pending".

Errors

StatusCodeWhen
400invalid_requestInvalid body
403plan_limitThe plan’s website logins are all in use
429rate_limitedToo many requests for the plan this minute
503service_unavailableSign-in is temporarily unavailable

Check a connection

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.

Path parameters

  • idstringrequired

    conn_ followed by 26 characters.

Query parameters

  • waitintegerdefault 0

    Seconds to hold the answer while the sign-in works or waits for an approval, 0 to 60.

Returns

A Connection object.

  • 200The connection.

Errors

StatusCodeWhen
400invalid_requestwait is not 0 to 60
404not_foundUnknown connection

Update a connection

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

Path parameters

  • idstringrequired

    conn_ followed by 26 characters.

Request body

Required, JSON.

  • defaultboolean

    true

  • totpstring or null

    An authenticator setup key to save (a base32 key, or an otpauth:// or otpauth-migration:// URL); null removes the saved one.

  • labelstring or null

    The account’s name; null or "" clears it.

Returns

A Connection object.

  • 200The connection, now the default.

Errors

StatusCodeWhen
404not_foundUnknown connection

Delete a connection

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.

Path parameters

  • idstringrequired

    conn_ followed by 26 characters.

Returns

  • 200Disconnected.

The answer has these fields:

  • idstring
  • deletedboolean

Errors

StatusCodeWhen
404not_foundUnknown connection

Run a sign-in

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.

Path parameters

  • idstringrequired

    conn_ followed by 26 characters.

Request body

Required, JSON.

  • startboolean

    true: start a sign-in, or answer with the one that runs.

  • restartboolean

    true: start a sign-in in place of the one that runs.

  • countrystring

    Sign in from this country (two letters): the login moves there once the sign-in succeeds; until then it stays where it is.

  • login_urlstring

    The site’s sign-in page (https, on the site) to start the sign-in at.

  • totpstring

    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_idstring

    The step you answer (sign_in.step_id).

  • fieldsobject

    With step_id: a value for each of the step’s field ids (required ones filled in).

  • choicestring

    With step_id: the id of one of the step’s choices.

  • clickobject

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

    Show child attributes
    • xnumberrequired
    • ynumberrequired
  • hintstring

    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.

  • waitintegerdefault 30

    Seconds to wait for the next step.

Returns

A Connection object.

  • 200The connection and its next step; active, without sign_in, once signed in.

Errors

StatusCodeWhen
400invalid_requestInvalid answer, an API key, or nothing to do (no start, restart, login_url or answer)
404not_foundNo such connection, or no sign-in runs
409conflictStill working on the last answer, or not the current step
429rate_limitedToo many requests for the plan this minute
503service_unavailableSign-in is temporarily unavailable

Cancel the sign-in

Stops the sign-in that runs (none: nothing to stop). The connection keeps its status.

Path parameters

  • idstringrequired

    conn_ followed by 26 characters.

Returns

A Connection object.

  • 200The connection.

Errors

StatusCodeWhen
400invalid_requestAn API key
404not_foundUnknown connection

Deliver a verification code or link

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.

Path parameters

  • idstringrequired

    conn_ followed by 26 characters.

Request body

Required, JSON.

  • contentstringrequired

    The message, as received.

  • waitintegerdefault 0

    Seconds to wait for the sign-in to take it.

Returns

A Connection object.

  • 200The connection.

Errors

StatusCodeWhen
404not_foundUnknown connection