Reimport a customer's history
curl -X POST "https://api.summerbase.com/v1/customers/:id/reimport" \ -H "Authorization: Bearer sb_..." \ -H "Content-Type: application/json" \ -d '{ "history": [ { "effective_at": "2025-11-03T16:20:00Z", "properties": { "name": "Northwind Labs", "seats": 20 } }, { "effective_at": "2026-06-12T15:47:00Z", "properties": { "seats": 25 } } ] }'const response = await fetch("https://api.summerbase.com/v1/customers/:id/reimport", { method: "POST", headers: { Authorization: "Bearer sb_...", "Content-Type": "application/json", }, body: JSON.stringify({ "history": [ { "effective_at": "2025-11-03T16:20:00Z", "properties": { "name": "Northwind Labs", "seats": 20 } }, { "effective_at": "2026-06-12T15:47:00Z", "properties": { "seats": 25 } } ] }),})const data = await response.json()Replace everything your source has said about a customer with its history, sent all at once and oldest first — the one way to write the past.
Each entry is a patch onto the one before it, applied through the same
rules as an update; the first is applied to a customer holding nothing
of yours. Your properties on the customer are replaced; other sources’
properties and every identity stay, and identities adds to them. Lands
whole or not at all.
What it replaces is deleted for good: gone from every answer within moments, and from every copy Summerbase keeps within a day.
A customer that does not exist yet is created by its first entry.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The customer — a Summerbase id, or a source identity like stripe:cus_123.
Example
backend:acct_4821Query Parameters
Section titled “Query Parameters”Relationships to include in the response instead of fetching separately. A dotted path expands what an expanded record can expand in turn — at most 4 deep, 10 paths a request, and never back to a record already on the path.
Request Bodyrequired
Section titled “Request Bodyrequired”object
The customer’s history, oldest first. At most 10,000 entries.
object
When this became true. Later than the entry before it.
Properties in your source that changed at this moment; null clears one.
object
object
What to do with the value. Defaults to setting it.
What this value is. Given here, it is not inferred; omitted, the key’s existing definition decides, and a new key takes the type its first value looks like.
The value, as a string. Parsed into the key’s type — which type states
outright, or which the key’s existing definition decides. Null clears the
key.
What other sources call this customer, as source:id. Attached once, beside
the history — an identity is an address rather than a value and has no
moment. One that already identifies another record is refused.
What each source calls this record, as <source>:<id in that source>. Any entry addresses it — stripe:cus_123.
Example
{ "history": [ { "effective_at": "2025-11-03T16:20:00Z", "properties": { "name": "Northwind Labs", "seats": 20 } }, { "effective_at": "2026-06-12T15:47:00Z", "properties": { "seats": 25 } } ]}Response
Section titled “Response”Returns the customer object.
Example
{ "arr": "15000.00", "churned_at": null, "country_code": "US", "created_at": "2025-11-03T16:20:04Z", "email": "billing@northwind.example.com", "first_paying_at": "2025-12-01T10:04:00Z", "first_seen_at": "2025-11-03T16:20:00Z", "first_subscribed_at": "2025-11-17T10:04:00Z", "id": "0199a7c2-4e1b-7f38-b9d2-5a6c8e0f1d73", "identities": [ "stripe:cus_QX7bN2kLp4Rt9v", "backend:acct_4821" ], "mrr": "1250.00", "name": "Northwind Labs", "object": "customer", "properties": { "seats": 25 }, "properties_by_source": { "backend": { "seats": 25 }, "stripe": { "email": "billing@northwind.example.com", "name": "Northwind Labs" } }, "signed_up_at": "2025-11-03T16:20:00Z", "status": "paying"}