Skip to main content
An end-user credential is one of your users’ accounts on one site, for example the LinkedIn account of the user you know as acme-user-4471. Your backend creates it with no secret in the request. Tilion returns a single-use link, your product sends the signed-in user to it, and the user types the username and password on a page served by Tilion. From then on, a session opened for that user can sign in to the site with the stored sign-in. Neither your code nor the agent ever receives the password, the authenticator seed, or the site’s session cookies. Org-level credentials (Credentials and approvals) hold your organisation’s own logins. End-user credentials hold your users’ logins and are kept apart: the /v1/credentials routes never return an end-user credential, and the routes on this page never return an org-level one.

How it works

  1. Your backend calls POST /v1/credentials/end-users with your id for the user (end_user_ref) and the site (host). The response has a connect_url.
  2. Your product shows that link to the signed-in user, inside your own app. The link works once, for 15 minutes.
  3. The user enters the sign-in on the Tilion page. The credential becomes active, and your webhook receives end_user_credential.active if you have one set up.
  4. When an agent needs to act for that user, open a session with end_user_ref and run the login task. Tilion types the password itself, in a browser tab the caller cannot reach, then saves the site’s cookies to the credential so the next sign-in can usually skip the password.
  5. When the user disconnects the site in your product, call DELETE /v1/credentials/end-users/{id}. Running sessions are signed out of the site.
A session opened with end_user_ref is a protected session for its whole life. See Protected sessions for what that changes.

Scopes

These routes check their scope strictly: a key with no scope record is refused. Ask for the scopes when you create the key in the dashboard. A key with admin has all three. A key without the scope gets 403 with {"detail": "this API key lacks the 'end_user_credentials:write' scope"}.

Conventions

The end-user credential object

No field ever holds a secret. Statuses: The site, the user and the approval setting never change. To change them, revoke the credential and create a new one.

POST /v1/credentials/end-users

Create an end-user credential and its first connect link. Auth: Bearer API key with end_user_credentials:write. Request: The body never carries a secret. A request with any of username, password, secret, totp, otp, cookie, cookies or token is refused with 400 plain_secret_refused.
Response (201):
connect_url is returned once. The token is stored hashed, and no route returns it again. If you lose it, mint a new link. Errors: A revoked credential does not block a new one for the same user and site.

GET /v1/credentials/end-users

List end-user credentials, newest first. Auth: Bearer API key with end_user_credentials:read. Query: Response: {"end_user_credentials": [...], "next_cursor": "..."}. next_cursor is null on the last page. Errors: 422 for an unknown status or a limit below 1; 400 cursor_invalid for a cursor this API did not return; 400 host_invalid.

GET /v1/credentials/end-users/{id}

One end-user credential. A revoked one is still readable. Auth: Bearer API key with end_user_credentials:read. Errors: 404 not_found.

POST /v1/credentials/end-users/{id}/link

Mint a new connect link for an existing credential. Use it when a pending credential’s link expired, when a credential is needs_auth, or when the user wants to change the stored sign-in. Any earlier open link stops working. Completing a link from this route replaces the stored sign-in; a link from the create route never overwrites one. Auth: Bearer API key with end_user_credentials:write. Request (optional): kinds, return_url and reason, as for create. Response: {"id", "status", "connect_url", "connect_expires_at"}. Errors: 404 not_found; 409 end_user_credential_revoked (create a new credential instead); 400 plain_secret_refused; 400 host_invalid for a bad return_url; 422 for bad kinds.

DELETE /v1/credentials/end-users/{id}

Revoke one end-user credential. The status becomes revoked first, so no new sign-in can start. Then the password, seed and cookies are deleted, any open link is voided, and every running session that signed in with the credential has the site’s cookies deleted. Tokens the site keeps in page storage are not cleared. A protected session also re-checks its credentials every 30 seconds, so it signs itself out even if it missed the revoke. Auth: Bearer API key with end_user_credentials:write. Response: {"ok": true, "id": "...", "status": "revoked", "sessions_reached": 2}. sessions_reached is the number of sessions recorded as using the credential, each told to sign out; a session that already ended can be in the count. Repeating the call answers 200 with sessions_reached: 0, and so does revoking a pending credential. Errors: 404 not_found.

DELETE /v1/credentials/end-users?end_user_ref=

Revoke every credential of one user, for example when the user deletes their account or makes a privacy request. Auth: Bearer API key with end_user_credentials:write. Response: {"ok": true, "end_user_ref": "acme-user-4471", "revoked": 3}. Errors: 422 when end_user_ref is missing. An end_user_ref with no credentials answers 200 with revoked: 0.

The connect page

GET /connect/{token} and POST /connect/{token} are the page the user opens. They need no API key and are plain HTML that loads nothing from another origin. Who can complete a link: whoever opens it first. Hand it only to the signed-in user inside your product, never by email or chat. Open connect_url as a top-level page (a redirect or a new tab): it cannot be shown in an iframe. The authenticator key is optional on the page and may be an otpauth:// address or the setup key. Use kinds: ["totp"] alone only on /link, to add a key to a credential that already has a password. Completing a new link clears the saved cookies, so the next sign-in types the password.

Signing in

Open a protected session

Add end_user_ref to POST /v1/session. The key needs end_user_credentials:use as well as sessions:write.
The response carries "end_user_ref": "acme-user-4471" and "protected": true next to the usual session fields, and GET /v1/session/{id} returns both too. The user need not have a credential yet.

Run the login task

end_user_credential_id is optional. Without it, the credential is found from the session’s end_user_ref and the site of the page the browser is on. Tilion opens the credential’s login_url (or the site’s home page) itself, so the caller does not choose where a secret is typed. On a new session, whose page is still blank, pass end_user_credential_id or navigate to the site first; otherwise the result is no_credential_for_host. The task first restores the saved cookies. If the site shows a signed-in state, the sign-in is done without typing anything. Otherwise it types the stored username and password, and a code from the stored authenticator seed if the site asks for one. With no seed, the task does not enter a code: if the site asks for one, the result is login_not_verified. Ask for the authenticator key on the connect page with kinds: ["password", "totp"]. After a successful sign-in, the site’s cookies are saved to the credential.
method is restored when the saved cookies worked, or typed. A typed sign-in that fails still reports typed. A typed sign-in on a real site takes 25 to 45 seconds, close to the 57 second limit for a synchronous call. Run it with "async_mode": true and poll GET /v1/job/{job_id}. Refusals are HTTP 200 with ok: false and an error code. Nothing is decrypted before every check passes. A credential with approval: required answers ok: false with no error, status: "awaiting_approval" and an approval_id. Call again with the approval_id once a member approves (see Credentials and approvals). In a protected session, login refuses the parameters username, password, totp, credential, cred and allow_hosts with HTTP 400 literal_credentials_refused (with async_mode, the job ends in status: "error" carrying that code). It ignores url, the selector parameters and success_text, so the caller cannot choose the fields a password is typed into.

Protected sessions

A protected session still supports every way of driving the browser, including Playwright and raw CDP, so existing automation runs unchanged. A connected site is the site of any credential of the session’s user that is not revoked, pending ones included, with its subdomains. What changes: If Tilion cannot read the user’s connected sites when a raw CDP connection opens, the connection is closed with code 1013 and GET /context answers 503 protected_state_unavailable. Retry after a moment. What this promises: the password and authenticator seed are never readable by your code or the agent. Session cookies and stored tokens are left out of the REST answers and of the raw CDP cookie listings, network events, storage reads and body reads named in the table above. Other CDP commands are not filtered. The limit: a script you run on a connected site’s page, with Runtime.evaluate or Playwright’s page.evaluate, runs as that page. It can use the signed-in session, as it must for the agent to work, and it can read what the site keeps where page scripts can reach it, such as a cookie not marked HttpOnly or a token in localStorage. Tilion does not filter script results. A site that keeps its session in HttpOnly cookies is fully covered.

Webhooks

Status changes are sent to your organisation’s webhook: end_user_credential.active when the user completes a link, end_user_credential.revoked, and end_user_credential.needs_auth (reserved, not sent today). They are sent only when the webhook has a signing secret, so an unsigned webhook never receives them. Ask Tilion support to set the secret for your organisation.
reason is set only for needs_auth. A payload never carries a password, a cookie or the webhook address. Check the signature over the raw body before parsing it, and refuse a timestamp more than five minutes old:
Each event is tried a few times within a few seconds and then dropped. A 4xx answer other than 408 or 429 is not retried, and redirects are not followed. Events are not stored, so reconcile with GET /v1/credentials/end-users. Treat the webhook as a hint: read the credential with GET /v1/credentials/end-users/{id} before acting on it.

MCP tools

The hosted MCP server’s credential tools take an optional end_user_ref: The MCP tools can list, connect and wait for an end user’s credential. They cannot open a session with end_user_ref: do that with POST /v1/session. credential_connect always asks for a password and cannot set kinds, return_url, login_url or sign_in_hosts. credential_wait returns at once when the credential is already active. The key behind the MCP connection needs the three end_user_credentials scopes. The cdp scope that the MCP OAuth flow issues does not include them, so connect with an API key that has them.