From 4f8ee9e4dc4ae1daf4b14b0aaecd55f23d88e4f2 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 16 Jun 2026 10:51:30 +0000 Subject: [PATCH] feat(targeting-client): add `from` offset param to getRecipients Add an optional zero-based `from` query parameter to getRecipients enabling direct (random-access) pagination to any page in a single request. When provided it takes precedence over the `next` cursor. Generated artifacts are produced from these specs by the SDK build; a changeset is included for the release. Co-authored-by: Claude --- .changeset/targeting-recipients-from-offset.md | 7 +++++++ clients/targeting-client/src/openapi.json | 14 ++++++++++++-- .../epilot-sdk-v2/src/definitions/targeting.json | 12 +++++++++++- 3 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 .changeset/targeting-recipients-from-offset.md diff --git a/.changeset/targeting-recipients-from-offset.md b/.changeset/targeting-recipients-from-offset.md new file mode 100644 index 00000000..d6c1a2e6 --- /dev/null +++ b/.changeset/targeting-recipients-from-offset.md @@ -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`. diff --git a/clients/targeting-client/src/openapi.json b/clients/targeting-client/src/openapi.json index c1f133d0..99a20b62 100644 --- a/clients/targeting-client/src/openapi.json +++ b/clients/targeting-client/src/openapi.json @@ -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", @@ -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" } diff --git a/packages/epilot-sdk-v2/src/definitions/targeting.json b/packages/epilot-sdk-v2/src/definitions/targeting.json index 2eb81e0d..6f11f962 100644 --- a/packages/epilot-sdk-v2/src/definitions/targeting.json +++ b/packages/epilot-sdk-v2/src/definitions/targeting.json @@ -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",