Skip to content
Fous Docs
MarkdownStudio

Connections

Website logins and API keys that methods run with.

The Connection object

  • idstringrequired

    conn_ followed by 26 characters.

  • platformobjectrequired
    Show child attributes
    • namestring
    • domainstring
  • 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 platform use it unless a call names another.

  • hintstring or null

    api_key: the last characters of the saved key.

  • account_hintstring or null

    session: the signed-in account, masked.

  • connect_urlstring

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

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

    • rejectedboolean

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

    • 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

      cancelledexpired

    • messagestringrequired
  • messagestring

    POST /v1/connections for a site whose login is already connected: that this one is the account runs use.

  • 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 answer carries the sign-in’s 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 using the person’s details, or the person signs in at connect_url, a Fous Studio page. Once signed in, the connection turns active and becomes the site’s default. An organization has one login per site: asking again answers 200 with that connection, and its sign-in when one runs (an active login stays as it is; to sign in another account, restart the sign-in on it). type "api_key": the site’s own API key, stored encrypted and never returned. The same key sent again for the same site answers 200 with the connection already there (made the site’s default) instead of adding another.

Request body

Required, JSON.

  • platformstringrequired

    The site’s domain.

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

  • attestbooleanrequired

    Your confirmation that you are authorized to use this account for this purpose. Kept on the connection with who confirmed it and when.

    true

  • 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 when one runs), 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, or no attest: true
429rate_limitedToo many requests for the plan this minute
503service_unavailableNo browser is free for a sign-in now

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

Path parameters

  • idstringrequired

    conn_ followed by 26 characters.

Request body

Required, JSON.

  • defaultbooleanrequired

    true

Returns

A Connection object.

  • 200The connection, now the default.

Errors

StatusCodeWhen
404not_foundUnknown connection

Delete a connection

Removes the connection and wipes its saved key or sign-in. Only a person signed in to Fous Studio removes a connection: an API key gets 403.

Path parameters

  • idstringrequired

    conn_ followed by 26 characters.

Returns

  • 200Disconnected.

The answer has these fields:

  • idstring
  • deletedboolean

Errors

StatusCodeWhen
403forbiddenOnly Studio removes connections
404not_foundUnknown connection

Run a sign-in

A website login’s sign-in, run inside Fous. {"attest": true} starts one (or answers with the one that runs); add "restart": true to start again in its place, for instance to sign in another account; login_url names the sign-in page. {"step_id", "fields"} answers the current step with the person’s details, by field id; {"step_id", "choice"} picks one of its choices. {} answers with the sign-in as it is. 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.

  • attestboolean

    To start or restart: your confirmation that you are authorized to use this account.

    true

  • restartboolean

    With attest: start again in place of the sign-in that runs.

  • login_urlstring

    With attest: the site’s sign-in page (https, on the site).

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

  • 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 no attest: true
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_unavailableNo browser is free for a sign-in now

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