Skip to main content
This guide takes you from a site key to a Verified Account that your server has verified. Work in Development first, with a pk_test_... site key.

Before you start

Verified Accounts is part of a paid plan. See pricing. You need:
  • A site key whose allowed origins include your page. See Keys and environments.
  • A signed-in user on your side, and a stable ID for that user’s account.
platform-user-ref must be an ID that never changes for the account, such as your internal user ID. It must not be an email address. BotShield refuses a value that contains @ with notarize_ref_must_be_stable, because an email address can change and it identifies a person. BotShield stores the value only as a one-way hash.

Steps

1

Turn on Link with BotShield ID

In the BotShield Console, open Verified Accounts and select Set up Link with BotShield ID in the page header. Add a surface in three steps:
  1. The surface. Name the page where the chip goes, for example Sign-in · app.example.com, and pick the site key for it. One surface has one site key.
  2. The tag. Copy the tag the Console shows.
  3. Turn it on. In Production, the Console asks you to confirm with your Developer passkey.
The switch is the authority. The chip appears only while it is on. Your page markup cannot turn it on.
A gate can also link the person as they pass, through its link setting (required, optional or never). See Linking at a gate.
2

Add the widget after your sign-in

Show the chip only to a user you have just signed in or re-authenticated. The link says that the human confirming is the one using this account, so your own sign-in has to come first.
3

The person links the account

The widget shows the Link with BotShield ID chip, with Tap to secure this account under the title.The code lasts 5 minutes and works once. The person can scan the QR code, or type the code at app.botshield.ai/link.In BotShield, the person sees your platform’s name and confirms with a passkey. The chip on your page then reads Account secured.
4

Handle the result on your page

Listen for botshield:success and send the token to your server. trusted is true when the account is linked.
Treat trusted in the browser as a hint. The decision belongs on your server.
5

Verify on your server

Send the token to POST /sdk/verify-token. The token lives 120 seconds and is good for one check. You can call without a key and send your organization ID as audience, or call with your secret API key as Authorization: Bearer bs_…, and BotShield then uses your key’s organization as the audience.
Check all of these before you mark the account as linked:
  1. data.error is absent and valid is true.
  2. organization_id is your organization. Pass your organization ID as audience, or call with your API key, and BotShield checks this for you.
  3. request_id is the one your page sent.
  4. trusted is true.
Then store trusted_since against your user record. See Token and webhooks for local verification and for the events your endpoint receives.
6

Store the handle

Your webhook endpoint receives account.secured with the account’s handle, an opaque value that starts with OP_. Store it beside your user. Every later account event carries it. See Staying in sync.
7

See it in the Console

Open Verified Accounts, then the Registry tab, with the Development toggle selected. The account appears by its handle, with the date it was linked.The Try it tab runs the same chip against your Development key, with you as the customer. Use it to see each state before you ship.

Server-to-server

If you create verification requests from your server instead of using the widget, pass partner_user_ref to POST /sdk/create-verification-link for a gate whose link setting is optional or required. The same rules apply: a stable ID that is not an email address. On an optional gate, notarize: false skips the offer for one request. notarize: true cannot turn the offer on while the gate’s setting is never; the request is then an ordinary verification. A required gate refuses a request without partner_user_ref with link_requires_user_ref.

Test the other paths

Next steps

Account lifecycle

What happens after the link: status, unlink and link again.

Server API

Read the status and unlink from your server.