feat: add App API Collections methods#242
Merged
Merged
Conversation
Batch 11. Adds the 7 collection endpoints to APIClient: list/create/get/
update/delete plus get/replace content.
Verified against the services backend (ext_api/collections/*), not the
OpenAPI spec:
- Collection ids are integers; create/update take { name, data?, url? } with
data and url mutually exclusive; DELETE returns 204 (and 409s if the
collection is still used by a campaign).
- The content endpoints carry a raw top-level JSON array of row objects
(not an object), so updateCollectionContent posts the array directly.
Includes unit tests (100% coverage), live round-trip coverage, and docs.
karngyan
previously approved these changes
Jul 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Another set of the App API backfill which adds the 7 collection endpoints to
APIClient:listCollectionsGET /v1/collectionscreateCollectionPOST /v1/collectionsgetCollectionGET /v1/collections/{id}updateCollectionPUT /v1/collections/{id}deleteCollectionDELETE /v1/collections/{id}(204)getCollectionContentGET /v1/collections/{id}/contentupdateCollectionContentPUT /v1/collections/{id}/contentAssisted by AI 🤖
Implementation note
updateCollectionContentsends a top-level array. The sharedRequestDatatype stays object-shaped (widening it globally broketrack.ts, which does property access on request bodies), so the array is cast at that one call site — the transport alreadyJSON.stringifys it correctly.lib/request.tsis unchanged.Note
Medium Risk
Large additive API surface including ESP suppression mutations and imports; risk is mitigated by following existing client patterns and extensive stub/live tests rather than changing core transport.
Overview
Expands
APIClientwith a broad App API backfill: new typed request/option shapes and methods wired through the existingrequesthelpers, plus matchingdocs/app.mdsections and unit/live integration coverage.Collections — CRUD plus
getCollectionContent/updateCollectionContentfor row data.updateCollectionContentPUTs a top-level JSON array; the body is cast at that call site so sharedRequestDatastays object-shaped elsewhere.Deliverability — ESP suppression search/list (workspace and per-domain), create/delete suppressions; reporting webhook CRUD.
Content & ops — Snippet list/create/upsert/delete; sender identity list/get/used-by; workspace-wide message list/get/archived content; CSV
createImport/getImport; data-indexbatchUpdateAttributes/batchUpdateEvents;listWorkspacesandgetIpAddresses.Live tests exercise round-trips where safe (collections, suppressions, webhooks, snippets, imports when
CIO_TEST_IMPORT_CSV_URLis set).Reviewed by Cursor Bugbot for commit 385c6cd. Bugbot is set up for automated code reviews on this repo. Configure here.