Sign in to fill these examples with your own keys. Sign in Start free trial

Unique args

Pass tracking fields that come back on delivery webhooks.

Unique args are your own key and value pairs, such as a campaign id or an account id. PostShiba attaches them to a send and returns them on every delivery webhook for that message.

Set unique args

Each send path takes them in a different place. PostShiba reads the X-Capsule-Unique-Args header and strips it before the mail leaves, so recipients never see it.

Send path Where to put them
REST unique_args object on the send body
SMTP X-Capsule-Unique-Args header with a JSON object
HTTP inject X-Capsule-Unique-Args in content.headers
Dashboard test send Unique args under More
send-with-unique-args.sh
1curl -sS -X POST \ 2 -H 'Authorization: Bearer YOUR_API_KEY' \ 3 -H 'Content-Type: application/json' \ 4 -d '{ 5 "from": "hello@mail.example.com", 6 "to": ["you@example.com"], 7 "subject": "PostShiba test", 8 "text": "hello from PostShiba", 9 "unique_args": {"campaign_id": "cmp_123", "site": "docs"} 10 }' \ 11 https://app.postshiba.com/api/v1/emails

The header value is the same object as JSON.

X-Capsule-Unique-Args.json
1{ 2 "campaign_id": "cmp_123", 3 "site": "docs" 4}

Limits

Limit Value
Keys 32 at most
Key length 64 bytes
Value length 256 bytes
Value types Scalars only (strings, numbers, booleans)

The send still goes out when an arg breaks a limit. Keys past the 32nd, and keys or values that are too long, are left off the webhook events.

These keys are reserved because every event already carries them, and they are also left off: event, email, timestamp, sg_event_id, sg_message_id, smtp-id, and tenant_id. See Event types.

Next steps