Developer
Subscriber Records
POST
/api/subscribers/{token}/upsert
Token + HMAC
Upsert a record
Create or update a subscriber and its structured records in one call. The subscriber is matched by email within the list; each record is matched by (kind, external_id). Writes must be signed when the list has a secret — send the HMAC-SHA256 of the raw request body in the X-Signature header.
Path parameters
|
token
string
required
|
— |
Body parameters
|
email
string · email
optional
|
The subscriber's email address. Required — identifies the subscriber. |
|
first_name
string
optional
|
Subscriber first name (optional). |
|
last_name
string
optional
|
Subscriber last name (optional). |
|
custom_data
string
optional
|
Object merged into the subscriber's stored custom data (optional). |
|
records
string
optional
|
Array of records to upsert. Each requires `kind`, `external_id`, and a `payload` object; a `date` (with optional `recurs: "annual"`) anywhere in the payload schedules the record's `next_event_at`. |
Responses
200
{ "success": true, "subscriber_id": 4471, "records": [ { "id": 88, "kind": "appo...
401
{ "error": "Invalid signature" }
422
{ "error": "email is required" }
BODY='{"email":"a@b.com","records":[{"kind":"appointment","external_id":"u_88","payload":{"date":"2026-06-12"}}]}'
SIG=$(printf '%s' "$BODY" | openssl dgst -sha256 -hmac "$SECRET" | awk '{print $2}')
curl -X POST https://landing.pivotal.digital/api/subscribers/$TOKEN/upsert \
-H "Content-Type: application/json" \
-H "X-Signature: sha256=$SIG" \
-d "$BODY"
$body = json_encode(['email' => 'a@b.com', 'records' => [
['kind' => 'appointment', 'external_id' => 'u_88', 'payload' => ['date' => '2026-06-12']],
]]);
$sig = hash_hmac('sha256', $body, $secret);
Http::withHeaders(['X-Signature' => "sha256=$sig"])
->withBody($body, 'application/json')
->post("https://landing.pivotal.digital/api/subscribers/$token/upsert");
response
{
"success": true,
"subscriber_id": 4471,
"records": [
{ "id": 88, "kind": "appointment", "external_id": "u_88", "next_event_at": "2026-06-12" }
]
}
{ "error": "Invalid signature" }
{ "error": "email is required" }
GET
/api/subscribers/{token}/{email}
API key
Fetch records
Fetch a subscriber and all of their records by email. Reads are not signed — they're already scoped by the list token and don't mutate state.
Path parameters
|
token
string
required
|
— |
|
email
string
required
|
— pattern: .* |
Responses
200
{ "email": "a@b.com", "first_name": "Jane", "last_name": "Doe", "custom_data": {...
404
{ "error": "Subscriber not found" }
curl https://landing.pivotal.digital/api/subscribers/$TOKEN/a@b.com
response
{
"email": "a@b.com",
"first_name": "Jane",
"last_name": "Doe",
"custom_data": {},
"records": [
{ "kind": "appointment", "external_id": "u_88", "payload": {}, "next_event_at": "2026-06-12", "recurrence": "annual" }
]
}
{ "error": "Subscriber not found" }
DELETE
/api/subscribers/{token}/records/{externalId}
Token + HMAC
Delete a record
Delete a single record by its external_id. The kind and email query parameters identify which subscriber's record to remove. Signed like upsert.
Path parameters
|
token
string
required
|
— |
|
externalId
string
required
|
— |
Query parameters
|
kind
string
optional
|
Record category to delete (query param). Required. |
|
email
string · email
optional
|
Email of the owning subscriber (query param). Required. |
Responses
204
(no content — deleted or already absent)
401
{ "error": "Invalid signature" }
422
{ "error": "kind and email query params required" }
curl -X DELETE "https://landing.pivotal.digital/api/subscribers/$TOKEN/records/u_88?kind=appointment&email=a@b.com" \
-H "X-Signature: sha256=$SIG"
response
(no content — deleted or already absent)
{ "error": "Invalid signature" }
{ "error": "kind and email query params required" }
Landing Platform