API guide
Ding delivers alerts from your server to people who connected your app. You never handle their device tokens or Ding sessions.
Quick start
Register your app with a website you control and a contact email. Verify the email, add the DNS TXT record from your app’s Overview, then create a test key on the Keys page. Test keys deliver only to your own account; Ding reviews apps by hand before live keys unlock.
curl https://publish.ding.social/v1/app-events \
--request POST \
--header "Authorization: Bearer $DING_APP_KEY" \
--header "Content-Type: application/json" \
--header "Idempotency-Key: match-42-turn-7-player-a" \
--data '{
"recipient": "did:plc:PLAYER_DID",
"title": "It is your turn",
"category": "turns"
}'
One request, one recipient. Keep the publishing key on your server. Leave out category until you have declared one.
Let people connect
Share your connect link, https://ding.social/connect/APP_ID. Your app’s Overview shows it with a copy button, a QR code and an HTML snippet:
<a href="https://ding.social/connect/APP_ID">Get alerts in Ding</a>
On an iPhone with Ding installed the link opens your app in Ding, ready to connect; elsewhere it shows a page about your app with an Open in Ding button. Connecting is the consent. Afterwards each person sets every category, including the two built-in rows, to Off, Inbox or Push, and can disconnect at any time. You address each recipient by their account’s DID, which you already have once they sign in to your service.
Categories
On the app’s Categories page, list the kinds of alert you send: an ID your server uses, a title and one line people see, and a default of Push, Inbox or Off. Up to ten. Push sends a notification, Inbox saves it without pushing and Off skips it, your own test alerts included. Alerts naming an undeclared ID are refused.
Every app also has two built-in rows after its own: Alerts for you (ding:alerts, Push by default) covers personal alerts sent without a category, and Announcements (ding:announcements, Off by default) covers every announcement. A categorised personal alert follows its category alone; a categorised announcement needs both its category and Announcements switched on, and the more restrictive of the two applies.
Alert fields
A richer alert names the account it is about, adds an image and buttons, and stops a late push:
{
"recipient": "did:plc:PLAYER_DID",
"title": "made a move",
"body": "Match 42, move 18.",
"url": "https://example.com/matches/42",
"category": "turns",
"actor": "did:plc:OPPONENT_DID",
"image": "https://example.com/matches/42/board.png",
"actions": [
{ "label": "Open match", "url": "https://example.com/matches/42" }
],
"collapseKey": "match-42-turn",
"expiresAt": "2027-01-01T18:00:00Z"
}
| Field | Required | Meaning |
|---|---|---|
recipient | Required | The DID of the recipient’s account. It must have connected your app. |
title | Required | Up to 160 characters. With actor, write it as what that account did, for example made a move: Ding puts its name in front. |
body | Optional | Up to 2,000 characters. |
url | Optional | An HTTPS link on your registered website. |
category | Optional | The ID of a category you declared, for example turns. An undeclared ID is refused. Without one, the alert follows the built-in Alerts for you row. |
actor | Optional | The DID of the account the alert is about, for example the opponent who moved. Ding leads the alert with that account’s name and avatar, and people’s mutes for that account apply. |
actions | Optional | Up to two buttons, in your order. Each is {"label","url"} with an HTTPS link on your website, or {"label","record"} with an AT Protocol record template that opens in at.new: a JSON object up to 2 KB whose $type is app.bsky.feed.post or an NSID under your website’s host name reversed (com.example.play for play.example.com), and whose strings may hold {{...}} placeholders. Labels are 1 to 24 characters on one line. Labels Ding uses for its own actions, such as Reply, Follow back or Secure account, are refused. |
image | Optional | An HTTPS PNG, JPEG or WebP on your website, up to 2,048 characters, 1 MB and 4,096 pixels on each side. Ding copies it and serves it from its own address, so you never see who loads it. Shown under the body and in the push. |
collapseKey | Optional | A newer alert with the same key replaces the older one. |
subject | Optional | An at:// record the alert is about. |
expiresAt | Optional | A future time after which Ding stops a late push. |
Announcements
POST /v1/app-announcements takes the same fields without recipient and needs a key with the announcements scope. It goes to everyone connected who switched on the built-in Announcements row (Off by default), and its category too when it names one. Announcements count toward the same per-person limit as personal alerts.
Batches
POST /v1/app-events/batch sends up to 100 personal alerts in one request with the alerts scope. The Idempotency-Key header covers the batch; each item is a personal alert with its own id, which is that item’s idempotency key (a body id is refused on the single endpoints).
curl https://publish.ding.social/v1/app-events/batch \
--request POST \
--header "Authorization: Bearer $DING_APP_KEY" \
--header "Content-Type: application/json" \
--header "Idempotency-Key: round-9-pairings" \
--data '{
"items": [
{
"id": "match-51-start-a",
"recipient": "did:plc:PLAYER_A",
"title": "Your match has started",
"category": "turns"
},
{
"id": "match-51-start-b",
"recipient": "did:plc:PLAYER_B",
"title": "Your match has started",
"category": "turns"
}
]
}'
The response is 200 with one result per item, in order: {"items":[{"id","accepted","duplicate","error","code","field"}]}. A malformed item fails only itself. A batch counts once against the per-minute and per-day request limits and once per item against the recipient limits. Replaying the batch key with the same content returns the same results with an Idempotent-Replayed header.
Test keys
A test key runs every check and returns real responses marked "test": true, but delivers only to your own account, and only if you connected your app in Ding. Test keys are available as soon as your email and website are verified, before review, and you can connect your own app in Ding at the same point.
Retries, limits and responses
- Every request needs an
Idempotency-Key. Reuse the same key and payload when retrying; use a new key for a new alert. - Every response carries
RateLimitandRateLimit-Policyheaders. RespectRetry-Afteron429. - Accepted means Ding queued the alert. It never confirms delivery to a person, because that would reveal who connected your app.
- Responses are JSON:
{"id","accepted","duplicate","test"}on success,{"error","code","requestId","field"}on failure. Quote therequestIdwhen you contact us.
App icon
Once your website is verified you can add an icon in Settings: a square PNG, JPEG or WebP on your website, up to 512 KB and 4,096 pixels on each side. Ding copies it when you save. It appears in Ding once the app is approved, and a new icon is reviewed again.
Staying able to publish
Keep the DNS TXT record in place: Ding re-checks it daily and pauses publishing if it stays missing for 72 hours, emailing your contact address first. Publishing also pauses while the account that owns the app is deactivated, suspended or taken down, and resumes when it is active again.