Website components

Mint a short-lived token for one website (from your server)

Call from your server with your secret key, then put the token in the page (the component's token attribute). The token works only from origin, only for scopes (suggest, select, display, identity) and, when given, only for company_numbers, for ttl_seconds (30 to 900, default 600). Revoking the secret key stops its tokens at once. Minting is free; requests made with the token count against your plan as the secret key's would. At most 600 tokens a minute per key.

post/elements/v1/tokens

Request

  • Base URL: https://api.companystack.co.uk
  • URL: https://api.companystack.co.uk/elements/v1/tokens
  • Auth: HTTP bearer

Request body

originstring required

The exact website the page is on (no wildcard)

scopesstring[] required
company_numbersstring[]

Limit the token to these companies (leave out for any)

ttl_secondsinteger
end_userstring

An opaque id for the visitor, so the per-visitor limits apply to them (never an email address or name)

Example request

{
  "origin": "https://portal.example.co.uk"
}

Response

The token

tokenstring
expires_atstring
originstring
scopesstring[]
company_numbersstring[] nullable

Changes

No recorded changes to this operation across all 1 revision of this API.