Skip to content

A token for a cross-domain link

GET
/v1/decorate
curl --request GET \
--url 'https://stitch-collector-dev.magic-blocks.workers.dev/v1/decorate?to=example'

Mints a signed, short-lived token from the _bid cookie so a link from one of our domains to another carries the visitor across. The SDK calls it when decorating a link; the anonymous id itself never reaches page JavaScript.

to
required
string

The destination host. Must be one of our registered domains.

The token to append to the link.

Media type application/json
object
token
required
string
Example generated
{
"token": "example"
}

No _bid cookie: nothing to carry.

to is missing or not one of our domains.

Media type application/json
object
error
required

What was wrong, in a sentence. A 401 carries unauthorized and nothing more.

string
Example generated
{
"error": "example"
}