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
| Permission | Allows |
|---|---|
campaigns:read | List and read placements, and read their reports |
settings:write | Create, 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"
}
| Field | Values |
|---|---|
key | Lowercase 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 |
appIds | The apps the placement lives in, or null for every app of the workspace |
fields | Up 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 |
allowedContent | Which content a campaign may use here: native (a card drawn by the SDK), html (sandboxed HTML), data (the fields only). Default ["native", "data"] |
emptyBehavior | collapse (default) closes the space when nothing is eligible; keep_space keeps it so the layout does not move |
maxItems | 1-10. More than 1 is a carousel or a list |
replacement | When a better item replaces one already shown: higher_priority_only (default), any_better, sticky_until_ineligible |
frequencyCap | Per 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 |
dismissal | How long a dismissed item stays away from that person: forever (default), days (with dismissalDays, 1-365), refresh (until the next refresh) |
holdoutPercent | 0-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 |
ranking | priority (default) or ai: rank the eligible items for each person with the workspace's AI model, see AI ranking. Priority is always the fallback |
rankingHoldoutPercent | 5-50, default 20. With ai, that share of people keeps priority order, so the report measures what ranking adds (rankingLift) |
cacheTtlSeconds | 60-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 |
status | active or archived |
usage | How 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": []
}
requestsasked for this placement;filledwere answered with at least one item;holdoutwere answered "held out".fillRate= filled / (requests - holdout), so the control group is not counted as a miss.impressionsare viewable views (half of the item in view for one second);controlExposuresare held-out people whose empty spot was in view.goalis the conversion goal the lift counts: the goal of the campaigns and journeys that showed in the placement - a campaign's ownconversionTracking.primaryConversion(event, property conditions, refinement) andconversionWindowHours, a journey step its journey's - withisDefault: true(purchase within 168 hours) when none set one. It isnullwhen they count different goals.upliftis the placement against nothing: people who saw an item against people in the placement holdout, the share who reached the goal withinwindowHoursof their first exposure.upliftPctis the relative lift,significantmeanspValue< 0.05. It isnullwhile the placement holdout is off (placementHoldoutPercent0) and nobody was held out in the range. With no held-out people yetupliftPctisnullandreasonisno_control; with no conversions on either side,no_conversions; when the campaigns here count different goals,mixed_goals(each campaign's lift is on itsbyCampaignrow).revenueis the order value of the goal events in that window - 0 for a goal that carries none,nullintotalswhen the goals differ.byCampaignhas one row per campaign or journey step that showed in the placement or whose control group was shown something else there, with its owngoaland two lifts shaped likeuplift: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 (nullwhile the placement holdout is off and nobody was held out).fallthroughImpressionscounts the views it got only because the control group of a campaign above it saw it instead; they stay inimpressionsand in its viewers. Each row also hasholdoutSees("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 rowvsNothingalso counts those people andvsNextisnull.rankingLift(placements withranking: "ai"):aiandprioritygroups - people,clickRate(clicked an item in the placement),conversionRate(reached the goal within its window of their first decision) - withclickLiftPct,conversionLiftPct, their p-values andsignificant, and thegoalcounted. When the campaigns here count different goals only clicks are compared:goalisnull, the conversion fields arenullandconversionReasonismixed_goals(goals_unavailablewhen the goals could not be read).reasonisno_holdoutorno_aiwhile a group is empty;nullwhen the placement never ranked by AI in the range.dailyhas one row per day of the range, zeros included;byCampaignone row per campaign or journey step that showed in the placement.unavailablenames 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:contentorcoupon(a coupon needscouponCode).datauses 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); onPATCHit is optional (omitted = unchanged) and[]/nullare refused.datais exactly the Data fields of these placements, typed as a placement campaign'sdatais: a number,true/falsefor yes/no ("12"and"true"are stored as12andtrue), 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 beforeplacementIdsexisted returnsnull) is never served, and everyPATCHto it is refused until it setsplacementIds. SettingplacementIds,dataorkindchecks 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 carriesdata.coupon_expires_at(ISO-8601) anddata.coupon_apply_urlwhen 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_codeserves its fallback code,send_withoutserves the offer with no code,skip(the default) serves the offer'sfallbackOfferId, 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 throughPOST /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) andfilterGroups(the campaign targeting filter shape), evaluated like campaign targeting;startsAt/endsAtis the window (start included, end excluded).segmentIdsmust be segments of this workspace, and a campaign'scustomContent.offerIdan offer of this workspace - anything else is refused with400when 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
datawins over them, a coupon arrives asdata.coupon_code, and the item carriesoffer: { "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 theusers:readscope, 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, throughPOST /v1/in-app/placements. - Who: exactly one of
externalId(your customer id),userId(the Joryio contact id, 24 hex characters - a customer id inuserIdis a400) oranonymousId(a visitor not yet identified). None, or more than one, is a400- except withtrackingConsent: "denied", which may name nobody. An id that matches no contact answers empty placements, never an error. - Consent:
trackingConsentis required (granted,denied,pending). Withdenied, 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 thedeliveryTokenonly 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, callPOST /v1/placements/decideagain for that placement.- Control answer - an answer with
isControl: truemay carryshowWhen: report{ "controlToken": "...", "action": "control_viewed" }toPOST /v1/in-app/trackonly 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 -
includeShowWhenin the body must be a boolean (400otherwise); in the query onlytrueorfalseis accepted (400includeShowWhen must be true or false). Absent orfalse: only load campaigns, as before.