Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/targeting-recipients-from-offset.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@epilot/targeting-client": minor
---

Add `from` offset parameter to `getRecipients`

- `getRecipients` (`GET /v1/campaign/{campaign_id}/recipients`) now accepts an optional `from` query parameter — a zero-based offset of the first item to return. This enables direct (random-access) pagination to any page in a single request, instead of walking `next` cursors page by page. When `from` is provided it takes precedence over `next`.
14 changes: 12 additions & 2 deletions clients/targeting-client/src/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -479,11 +479,21 @@
{
"name": "next",
"in": "query",
"description": "Cursor for pagination",
"description": "Cursor for sequential pagination. Ignored when `from` is provided.",
"schema": {
"type": "string"
}
},
{
"name": "from",
"in": "query",
"description": "Zero-based offset of the first item to return. Enables direct (random-access) pagination to any page. When provided, it takes precedence over `next`.",
"schema": {
"type": "integer",
"minimum": 0,
"default": 0
}
},
{
"name": "q",
"in": "query",
Expand Down Expand Up @@ -1313,7 +1323,7 @@
},
"target_ids": {
"type": "array",
"description": "List of target entity IDs to attach to the campaign. Today only a single\nentry is supported (campaign.target is has_one) but the array shape is kept\nfor forward-compatibility only `target_ids[0]` is used.\n",
"description": "List of target entity IDs to attach to the campaign. Today only a single\nentry is supported (campaign.target is has_one) but the array shape is kept\nfor forward-compatibility \u2014 only `target_ids[0]` is used.\n",
"items": {
"$ref": "#/components/schemas/BaseUUID"
}
Expand Down
12 changes: 11 additions & 1 deletion packages/epilot-sdk-v2/src/definitions/targeting.json
Original file line number Diff line number Diff line change
Expand Up @@ -428,11 +428,21 @@
{
"name": "next",
"in": "query",
"description": "Cursor for pagination",
"description": "Cursor for sequential pagination. Ignored when `from` is provided.",
"schema": {
"type": "string"
}
},
{
"name": "from",
"in": "query",
"description": "Zero-based offset of the first item to return. Enables direct (random-access) pagination to any page. When provided, it takes precedence over `next`.",
"schema": {
"type": "integer",
"minimum": 0,
"default": 0
}
},
{
"name": "q",
"in": "query",
Expand Down
Loading