API Reference

Personalization

Entries can carry per-audience variant overrides on top of their default data. Consume them server-side or resolve them yourself. For the concepts, see the personalization guide.

Resolve on the server

Pass the visitor's active variants via ?variants=a,b. The response's data comes back already merged, and the response echoes activeVariants:

curl 'https://glu.so/api/v1/public/content/posts/hello-world?variants=mobile,returning' \
  -H 'Authorization: Bearer YOUR_API_KEY'

Resolve on your site

Omit variants and the response includes the raw personalization override layer plus the space's audiences catalog, so your front end can match conditions (country, device, UTM, cookies) and apply overrides itself:

{
  "doc": {
    "data": { "title": "Hello world", … },
    "personalization": {
      "returning": { "title": "Welcome back!" }
    },
    "audiences": [
      { "key": "returning", "label": "Returning visitor", "conditions": … }
    ]
  }
}