Skip to main content

Placements API

A placement is a named spot inside your app or website - home_hero, cart_upsell, account_banner - that Joryio fills for each person from in-app campaigns and journeys. Your app asks for a placement by its key; marketers then target it from a campaign of type Placement or a journey step.

All endpoints on this page are relative to the base URL: https://api-eu1.joryio.com/api - see API Overview.

Placements are switched on for your organization by Joryio. Until they are, the endpoints on this page and POST /v1/placements/decide answer 403 with "code": "FEATURE_NOT_ENABLED", and the SDK placement request answers empty placements (each spot shows what your app does when nothing is eligible). Contact Joryio support to have them switched on.

Permissions​

PermissionAllows
campaigns:readList and read placements, and read their reports
settings:writeCreate, change and archive placements - a placement is developer configuration, because the app's code asks for its key by name

The placement object​

{
"id": "3f6b2a54-0c1e-4b7a-9d55-1a2b3c4d5e6f",
"key": "home_hero",
"name": "Home hero",
"description": "The banner at the top of the home screen",
"appIds": null,
"fields": [
{ "key": "headline", "label": "Headline", "type": "text", "required": true },
{ "key": "image_url", "label": "Image", "type": "image_url" },
{ "key": "cta_url", "label": "Button link", "type": "url" }
],
"allowedContent": ["native", "data"],
"emptyBehavior": "collapse",
"maxItems": 1,
"replacement": "higher_priority_only",
"frequencyCap": { "maxImpressions": 3, "window": "1d" },
"dismissal": "days",
"dismissalDays": 7,
"holdoutPercent": 0,
"ranking": "priority",
"rankingHoldoutPercent": 20,
"cacheTtlSeconds": 300,
"sizeHint": { "aspect": "16:9" },
"status": "active",
"usage": { "campaigns": 2, "journeys": 1 },
"createdBy": "b7c1d2e3-4f50-4a6b-8c7d-9e0f1a2b3c4d",
"createdAt": "2026-11-21T08:00:00.000Z",
"updatedAt": "2026-11-21T08:00:00.000Z"
}
FieldValues
keyLowercase letters, digits and underscores, starting with a letter or digit, at most 64. Unique per workspace among placements that are not archived. Cannot change once a campaign or journey using the placement went live
appIdsThe apps the placement lives in, or null for every app of the workspace
fieldsUp to 30 data fields the app reads: key (starts with a letter, at most 40), label, type (text, long_text, url, image_url, number, boolean, color), required, default
allowedContentWhich content a campaign may use here: native (a card drawn by the SDK), html (sandboxed HTML), data (the fields only). Default ["native", "data"]
emptyBehaviorcollapse (default) closes the space when nothing is eligible; keep_space keeps it so the layout does not move
maxItems1-10. More than 1 is a carousel or a list
replacementWhen a better item replaces one already shown: higher_priority_only (default), any_better, sticky_until_ineligible
frequencyCapPer person, across every item in this placement: maxImpressions and window (once, lifetime, session, or a number and min, h, d, w, mo). null = no placement cap
dismissalHow long a dismissed item stays away from that person: forever (default), days (with dismissalDays, 1-365), refresh (until the next refresh)
holdoutPercent0-50, default 0 (off). The optional placement holdout: that share of people sees nothing in the placement from any campaign, and their control exposure records the campaign they would have seen (the report's "vs nothing"). It measures the placement itself; a single campaign is measured by its A/B control group - see the Campaigns API
rankingpriority (default) or ai: rank the eligible items for each person with the workspace's AI model, see AI ranking. Priority is always the fallback
rankingHoldoutPercent5-50, default 20. With ai, that share of people keeps priority order, so the report measures what ranking adds (rankingLift)
cacheTtlSeconds60-3600, default 300. How long a device keeps an answer before asking again
sizeHint{ width?, height?, aspect? } for the editor preview and the keep_space placeholder
statusactive or archived
usageHow many campaigns and journeys that are not archived use the placement

List placements​

GET /placements?status=active

status is active (default), archived or all. Returns an array of placement objects, newest first.

include=campaigns adds campaigns to each placement: its campaigns that are not archived, [{ "id", "name", "status" }], ordered by name - one request for the whole list (the visual editor's "In this slot").

Create a placement​

POST /placements

The body is the placement object without the read-only fields (id, status, usage, createdBy, dates). Only key and name are required; everything else takes the defaults above.

{
"key": "home_hero",
"name": "Home hero",
"fields": [{ "key": "headline", "label": "Headline", "type": "text", "required": true }],
"maxItems": 1,
"holdoutPercent": 0
}

409 when the key is already used by another placement in the workspace that is not archived.

Read a placement​

GET /placements/{id}

Update a placement​

PATCH /placements/{id}

Any field of the create body. Changing key answers 409 once a campaign or journey using the placement went live - the app asks for the key by name, so create a new placement instead. An archived placement cannot be edited (409).

Archive a placement​

POST /placements/{id}/archive

Placements are archived, never deleted, so reports keep resolving them. Archiving frees the key for a new placement. While an active, scheduled or paused campaign, or an active or paused journey, uses the placement, the answer is 409 and names them:

{
"message": "This placement is used by live campaigns or journeys. Stop or archive them first.",
"campaigns": [{ "id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d", "name": "Summer sale hero", "status": "active" }],
"journeys": []
}

Placement report​

GET /placements/{id}/stats - how the placement performs. startDate and endDate are whole days (YYYY-MM-DD) in the workspace reporting time zone; the default is the last 30 days, and one report covers at most 400 days. Needs campaigns:read.

GET /placements/{id}/stats?startDate=2026-11-01&endDate=2026-11-21
{
"placementId": "3f2a1b4c-5d6e-4f70-8a9b-0c1d2e3f4a5b",
"placementKey": "home_hero",
"range": { "startDate": "2026-11-01", "endDate": "2026-11-21", "timezone": "Europe/Athens" },
"totals": {
"requests": 41200, "filled": 30950, "holdout": 2060, "fillRate": 79.07,
"impressions": 28400, "uniqueViewers": 9100, "clicks": 1420, "ctr": 5,
"dismissals": 310, "dismissalRate": 1.09, "conversions": 120, "conversionRate": 0.42,
"controlExposures": 1880, "revenue": 18250.5
},
"goal": { "eventName": "purchase", "windowHours": 168, "isDefault": true },
"uplift": {
"windowHours": 168,
"goal": { "eventName": "purchase", "windowHours": 168, "isDefault": true },
"treatmentPeople": 9100, "treatmentConverters": 546, "treatmentRevenue": 18250.5,
"controlPeople": 480, "controlConverters": 22, "controlRevenue": 690,
"treatmentRate": 6, "controlRate": 4.58, "upliftPct": 30.91,
"pValue": 0.2213, "significant": false, "reason": null
},
"placementHoldoutPercent": 5,
"daily": [{ "day": "2026-11-01", "requests": 1900, "filled": 1420, "holdout": 95, "impressions": 1300, "uniqueViewers": 700, "clicks": 61, "dismissals": 12, "conversions": 5, "controlExposures": 88 }],
"byCampaign": [{ "campaignId": "6f0c2a54-0c1e-4b7a-9d55-1a2b3c4d5e6f", "impressions": 20100, "fallthroughImpressions": 640, "clicks": 1090, "dismissals": 200, "conversions": 90, "ctr": 5.42, "goal": { "eventName": "purchase", "windowHours": 168, "isDefault": true }, "vsNext": { "...": "as uplift" }, "vsNothing": { "...": "as uplift" } }],
"unavailable": []
}
  • requests asked for this placement; filled were answered with at least one item; holdout were answered "held out". fillRate = filled / (requests - holdout), so the control group is not counted as a miss.
  • impressions are viewable views (half of the item in view for one second); controlExposures are held-out people whose empty spot was in view.
  • goal is the conversion goal the lift counts: the goal of the campaigns and journeys that showed in the placement - a campaign's own conversionTracking.primaryConversion (event, property conditions, refinement) and conversionWindowHours, a journey step its journey's - with isDefault: true (purchase within 168 hours) when none set one. It is null when they count different goals.
  • uplift is the placement against nothing: people who saw an item against people in the placement holdout, the share who reached the goal within windowHours of their first exposure. upliftPct is the relative lift, significant means pValue < 0.05. It is null while the placement holdout is off (placementHoldoutPercent 0) and nobody was held out in the range. With no held-out people yet upliftPct is null and reason is no_control; with no conversions on either side, no_conversions; when the campaigns here count different goals, mixed_goals (each campaign's lift is on its byCampaign row). revenue is the order value of the goal events in that window - 0 for a goal that carries none, null in totals when the goals differ.
  • byCampaign has one row per campaign or journey step that showed in the placement or whose control group was shown something else there, with its own goal and two lifts shaped like uplift: vsNext - its viewers against the people in its A/B control group, who saw the next eligible item instead, or nothing when there was none; vsNothing - its viewers against the placement holdout people who would have seen it (null while the placement holdout is off and nobody was held out). fallthroughImpressions counts the views it got only because the control group of a campaign above it saw it instead; they stay in impressions and in its viewers. Each row also has holdoutSees ("next" or "nothing"): "nothing" only for control exposures recorded before 2026-11-23, when a placement campaign could leave its slot empty - for such a row vsNothing also counts those people and vsNext is null.
  • rankingLift (placements with ranking: "ai"): ai and priority groups - people, clickRate (clicked an item in the placement), conversionRate (reached the goal within its window of their first decision) - with clickLiftPct, conversionLiftPct, their p-values and significant, and the goal counted. When the campaigns here count different goals only clicks are compared: goal is null, the conversion fields are null and conversionReason is mixed_goals (goals_unavailable when the goals could not be read). reason is no_holdout or no_ai while a group is empty; null when the placement never ranked by AI in the range.
  • daily has one row per day of the range, zeros included; byCampaign one row per campaign or journey step that showed in the placement.
  • unavailable names a part that could not be read (serves, uplift, byCampaign, campaignLift, rankingLift, goals) - it is never sent as zeros.

A campaign's own report (GET /campaigns/{id}/in-app-stats) carries stats.byPlacement: the same interactions split by the placement they happened in.

Serving placements to an app​

The SDKs fetch placements for you. An app or a server that draws its own UI can call the same SDK endpoint with the app's SDK key - up to 10 keys per request, at most 20 requests per minute per device (then 429):

POST https://api-eu1.joryio.com/api/v1/in-app/placements
X-SDK-Key: <your SDK key>
{
"anonymousId": "a-6f1c", "userId": "customer-42", "sessionId": "s-1",
"capabilities": ["placements", "content.native", "content.data"],
"trackingConsent": "granted",
"placements": ["home_hero", "cart_upsell"],
"shown": { "home_hero": ["dlv_9b2e7c1a-4f0d-4c6b-8a3e-2d1f0e9c8b7a_6f0c2a54-0c1e-4b7a-9d55-1a2b3c4d5e6f"] }
}
{
"success": true,
"evaluatedAt": "2026-11-21T10:00:00.000Z",
"placements": {
"home_hero": {
"placementKey": "home_hero", "emptyBehavior": "collapse", "maxItems": 1, "ttlSeconds": 300,
"isControl": false, "controlToken": null,
"items": [{
"id": "6f0c2a54-0c1e-4b7a-9d55-1a2b3c4d5e6f", "variantId": "v1", "deliveryId": "dlv_9b2e7c1a-4f0d-4c6b-8a3e-2d1f0e9c8b7a_6f0c2a54-0c1e-4b7a-9d55-1a2b3c4d5e6f", "deliveryToken": "eyJv...", "priority": 8,
"kind": "data", "data": { "headline": "Free shipping today", "cta_url": "https://shop.example/sale" },
"triggers": null, "expiresAt": "2026-11-21T10:05:00.000Z"
}]
},
"cart_upsell": { "placementKey": "cart_upsell", "emptyBehavior": "keep_space", "maxItems": 1, "ttlSeconds": 300, "isControl": false, "controlToken": null, "items": [] }
}
}

An item with products (a campaign that Adds recommended products) also carries products: [{ "id", "title", "price", "compareAtPrice", "discountPercent", "imageUrl", "url" }], picked for the person by the chosen recommendation model; send the product the page shows as context.productId for the related types (similar, bought together, viewed together). An item whose model returns no products is not served.

An unknown or archived key answers an empty placement, never an error. content is sent only when capabilities says the app can draw it; data is always sent. A person held out of the placement (holdoutPercent) gets isControl: true, no items and a controlToken: report { "controlToken": "...", "action": "control_viewed" } to POST /v1/in-app/track once the empty spot has been in view. Report an item's views, clicks and dismissals with its deliveryToken there too - a dismissal is then remembered by the server per the placement's dismissal rule, on every device. With trackingConsent: "denied", or no visitor id, only campaigns that target everyone are served, without tokens. sessionId is then optional; with consent and a visitor id it is required. A person held out of a campaign (its channelConfig.holdoutPercent) simply receives the next eligible item as an ordinary item; when nothing else is eligible the answer is the control answer above. Nothing changes in the app. With channelConfig.holdoutSees: "nothing" the held-out campaign's slot stays empty instead: the answer simply has fewer items, or the control answer above when none is left. The SDKs see no new field - which campaigns were held out, and how, travels only inside the opaque tokens.

Offers​

Reusable content blocks and coupons a placement campaign selects as its content (customContent.offerId). GET /placement-offers (?status=active|archived|all), POST /placement-offers, GET /placement-offers/{id}, PATCH /placement-offers/{id}, POST /placement-offers/{id}/archive. Reading needs campaigns:read, changing needs campaigns:write.

{
"name": "Ten off this week",
"placementIds": ["8e1a7fa9-5b6d-4a2f-8cab-6f708192a3b4"],
"kind": "coupon",
"couponCode": "SAVE10",
"data": { "headline": "10% off this week", "cta_url": "https://shop.example/sale" },
"eligibility": { "segmentIds": ["3f6b2a54-0c1e-4b7a-9d55-1a2b3c4d5e6f"] },
"startsAt": "2026-11-23T00:00:00Z",
"endsAt": "2026-11-30T00:00:00Z",
"fallbackOfferId": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d"
}
  • kind: content or coupon (a coupon needs couponCode). data uses the field keys of the placements that show it.
  • placementIds (required on create, 1-20): the placements of this workspace the offer is for (GET /placements); a placement chosen now must not be archived. A create without it, or with [] / null, is refused (400); on PATCH it is optional (omitted = unchanged) and [] / null are refused. data is exactly the Data fields of these placements, typed as a placement campaign's data is: a number, true / false for yes/no ("12" and "true" are stored as 12 and true), a hex colour (#1a2b3c), and for a link or image a URL, an app link or a /path - Liquid ({{ ... }}) is always allowed. A required field (with no default) is enforced only when every chosen placement has it. Keys no chosen placement has are dropped when the offer is saved (never refused). An offer with no placements (only one created before placementIds existed returns null) is never served, and every PATCH to it is refused until it sets placementIds. Setting placementIds, data or kind checks the content against the placements; other changes do not, so a placement archived or changed later never blocks an edit. Campaigns can still pick any offer of the workspace; Launch Review recommends a change (placement_offer_other_placement) when a variant's offer is made for other placements, and blocks the launch (placement_offer_no_placements) when it has no placements.
  • Codes from the Coupons feature. Instead of couponCode, a coupon offer can name a coupon program: "couponProgramId": "<program id>" (exactly one of the two; a program of this workspace, not archived). Each identified contact who is served the offer is issued their own code by the program - the same code on every later view (the issue key is the campaign's in-app send, so {{ coupons.<slug> }} in the same campaign shows the same code), never one code for two people, and a redemption is credited to the placement campaign like any other coupon use. The item then also carries data.coupon_expires_at (ISO-8601) and data.coupon_apply_url when the code has them. When the program cannot give a code (an empty code bank, a paused program, a visitor who is not an identified contact), the program's own fallback applies: shared_code serves its fallback code, send_without serves the offer with no code, skip (the default) serves the offer's fallbackOfferId, else nothing and the next campaign fills the spot. A code that takes longer than 1.5 s to issue (a first personal code created in the store) is not shown on that view; the next view shows it. Launch Review lists what people see in that case, and blocks a missing or inactive program or an empty code bank. A program an offer uses cannot be deleted (409) - change the offer first. Only verified people get their own code: the app must use SDK Authentication (the signed token names the contact), or the visitor carries a verified storefront identity from a connected store, or your server asks through POST /v1/placements/decide. A contact named only by an external id with SDK Authentication off is a claim anyone can make, so they get the program's fallback, and no code is used up.
  • eligibility: segmentIds (in any of them) and filterGroups (the campaign targeting filter shape), evaluated like campaign targeting; startsAt / endsAt is the window (start included, end excluded).
  • segmentIds must be segments of this workspace, and a campaign's customContent.offerId an offer of this workspace - anything else is refused with 400 when it is saved, instead of being stored and never matching.
  • fallbackOfferId: shown when the person is not eligible - an active offer of the same workspace, at most 3 steps, never a circle. When nothing in the chain is eligible, the item is not served and the next campaign fills the spot.
  • In the served item, the offer's fields come first, the variant's own data wins over them, a coupon arrives as data.coupon_code, and the item carries offer: { "id", "name", "kind", "couponCode" }.

Decide placements from a server​

POST /v1/placements/decide - the headless decision API: one call returns the items for up to ten placements, for a server that draws the page itself (a headless store, a kiosk, a page rendered on your server, an email built elsewhere). The answer is exactly the serve answer above (placements, items, deliveryTokens, isControl, products), decided by the same code - arbitration, caps, dismissals, holdout, AI ranking, recommended products and the serve meter.

POST https://api-eu1.joryio.com/api/v1/placements/decide
Authorization: Bearer <secret API key with users:read>
{
"placements": ["home_hero", "cart_upsell"],
"externalId": "customer-42",
"trackingConsent": "granted",
"sessionId": "checkout-7f3a",
"context": { "productId": "sku-123" }
}
  • Auth: a secret API key (jry_live_...) with the users:read scope, never the public SDK key - a server can name any contact, and the answer is personalised from that contact's profile. The SDK key decides only for its own visitor, through POST /v1/in-app/placements.
  • Who: exactly one of externalId (your customer id), userId (the Joryio contact id, 24 hex characters - a customer id in userId is a 400) or anonymousId (a visitor not yet identified). None, or more than one, is a 400 - except with trackingConsent: "denied", which may name nobody. An id that matches no contact answers empty placements, never an error.
  • Consent: trackingConsent is required (granted, denied, pending). With denied, or no id, only campaigns that target everyone are served, without tokens.
  • Limits: 20 requests per minute per person (then 429 - keep the previous answer), on top of the API key's own rate limit. No app is named, so every placement of the workspace can answer.
  • Reporting: the page that draws an item reports its views and clicks - see Report displays.

Report displays​

Only the page knows when an item was really seen, so with this API your side reports it. Once at least half of the item has been on screen for one second, send its deliveryToken to POST /v1/in-app/track with the public SDK key (X-SDK-Key), from the page or from your server:

{ "campaignId": "6f0c2a54-0c1e-4b7a-9d55-1a2b3c4d5e6f", "deliveryToken": "eyJv...", "action": "displayed", "displayedAt": "2026-11-21T10:00:03.000Z", "sessionId": "checkout-7f3a" }

A click is "action": "clicked", a dismissal "action": "dismissed"; each delivery is counted once. A control answer is reported with { "controlToken": "...", "action": "control_viewed" } once its empty spot has been in view.

Without these reports the campaign shows 0 views, and its A/B and Control Group results stay empty - they compare the people who saw the item.

The dashboard tells you. When the API returned a campaign at least 20 times in the last 7 days and views were reported for fewer than 5% of those deliveries, the campaign's report and the placement's report show a notice ("Served 1,240 times by the API in the last 7 days, but no views were reported"). Under 25% they show a softer note, because an item drawn out of view is rightly not a view. Only the views of items this API returned count - views reported by SDK apps for the same campaign do not hide a missing report. The numbers are on GET /campaigns/{id}/in-app-stats (stats.headlessReport) and GET /placements/{id}/stats (headlessReport): { "windowDays": 7, "decides": 1240, "displays": 0, "notice": "strong" }, where notice is strong, soft or none.

Show when from a server​

By default POST /v1/placements/decide answers only campaigns that show when the page or screen loads: no SDK is on your page to hold the content until its moment. A server that does the timing itself opts in with "includeShowWhen": true in the body, or ?includeShowWhen=true in the query (either one set to true turns it on). Campaigns whose Show when is seconds, scroll, exit or event are then returned too:

  • Items - such an item carries showWhen: { "kind": "seconds", "seconds": 10 }, { "kind": "scroll", "percent": 50 }, { "kind": "exit" } or { "kind": "event", "event": "Added to Cart" } (see Show when). An item without it shows on load. Your page reveals the item at that moment and reports its view with the deliveryToken only when it actually shows it - never when the answer arrives.
  • recheckOn - a placement may list event names that can change its answer. After your page has tracked such an event, call POST /v1/placements/decide again for that placement.
  • Control answer - an answer with isControl: true may carry showWhen: report { "controlToken": "...", "action": "control_viewed" } to POST /v1/in-app/track only once that moment has come and the empty spot has been in view.
  • deferredControls - a filled answer may carry [{ "controlToken": "...", "showWhen": { ... } }]: control exposures of other campaigns whose moment differs from the item shown. Report each once, the same way as the control report above, when its moment has come and the spot has been in view.
  • Errors - includeShowWhen in the body must be a boolean (400 otherwise); in the query only true or false is accepted (400 includeShowWhen must be true or false). Absent or false: only load campaigns, as before.