Skip to content

Add batch API support (Track v2)#138

Merged
hownowstephen merged 1 commit into
mainfrom
MESS-678_add-batch-api
May 7, 2026
Merged

Add batch API support (Track v2)#138
hownowstephen merged 1 commit into
mainfrom
MESS-678_add-batch-api

Conversation

@hownowstephen
Copy link
Copy Markdown
Contributor

@hownowstephen hownowstephen commented May 7, 2026

Summary

  • Add Client#batch for POST /api/v2/batch (Track v2 API)
  • Accepts an array of operations — identify, event, delete, etc. for people and objects
  • Uses existing Track client auth (site_id + api_key)
  • Pass-through design: no client-side validation of individual operations, API handles that

Closes #106. Requested by multiple users over 18+ months.

Test plan

  • CI passes on Ruby 3.3, 3.4, 4.0, head
  • Mixed operations sent correctly to /api/v2/batch
  • Object operations work
  • Empty/non-array input rejected
  • Non-2xx responses raise InvalidResponse

Note

Low Risk
Adds a new API wrapper method and documentation/tests for posting batch operations; behavior is straightforward and limited to a new endpoint call with basic input validation.

Overview
Adds Client#batch to send Track v2 batch operations via POST /api/v2/batch, accepting an array of operations and rejecting empty/non-array inputs.

Updates the README with usage examples for batching identify/event/delete operations, and adds specs covering mixed person/object batches plus error handling for invalid inputs and non-2xx responses.

Reviewed by Cursor Bugbot for commit 3745567. Bugbot is set up for automated code reviews on this repo. Configure here.

Adds Client#batch for POST /api/v2/batch, supporting mixed operations
(identify, event, delete, etc.) for people and objects in a single
request. Passes through the operations array — the API validates
individual items.

Closes #106
@hownowstephen hownowstephen merged commit 7797fb0 into main May 7, 2026
9 checks passed
@hownowstephen hownowstephen deleted the MESS-678_add-batch-api branch May 7, 2026 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for batch api

2 participants