|
175 | 175 | "post": { |
176 | 176 | "tags": ["PushNotifications"], |
177 | 177 | "summary": "Send a push notification", |
178 | | - "description": "Sends a push notification to devices matched by API key scope and optional target channels. Supports optional redirection URL, optional media preview or playback when the notification is expanded, and up to 4 interactive actions. `media` cannot be combined with `actions`.", |
| 178 | + "description": "Sends a push notification to devices matched by API key scope and optional target channels. Supports optional redirection URL, optional media preview or playback when the notification is expanded, and up to 4 interactive actions. `media` cannot be combined with `actions`. Optional tags to organize and filter notification history.", |
179 | 179 | "operationId": "sendPushNotification", |
180 | 180 | "x-codeSamples": [ |
181 | 181 | { |
|
288 | 288 | } |
289 | 289 | ] |
290 | 290 | } |
| 291 | + }, |
| 292 | + "tagged": { |
| 293 | + "summary": "Organize notification history with tags", |
| 294 | + "value": { |
| 295 | + "title": "New subscription 💸", |
| 296 | + "message": "Customer upgraded to Pro plan", |
| 297 | + "tags": ["user:382", "billing"] |
| 298 | + } |
291 | 299 | } |
292 | 300 | } |
293 | 301 | } |
|
316 | 324 | "effective_channel_slugs": ["devs", "ops"], |
317 | 325 | "timestamp": "2025-08-12T12:00:00.000Z" |
318 | 326 | } |
| 327 | + }, |
| 328 | + "tagged": { |
| 329 | + "value": { |
| 330 | + "success": true, |
| 331 | + "devices_notified": 2, |
| 332 | + "users_notified": 1, |
| 333 | + "effective_channel_slugs": null, |
| 334 | + "tags": ["user:382", "billing"], |
| 335 | + "timestamp": "2025-08-12T12:00:00.000Z" |
| 336 | + } |
319 | 337 | } |
320 | 338 | } |
321 | 339 | } |
|
332 | 350 | "error": "Invalid channel targeting", |
333 | 351 | "message": "target.channels must be an array of channel slugs" |
334 | 352 | } |
| 353 | + }, |
| 354 | + "invalid_tags": { |
| 355 | + "value": { |
| 356 | + "error": "Invalid tags", |
| 357 | + "code": "invalid_tags", |
| 358 | + "message": "tags must use 1-64 lowercase letters, numbers, dashes, underscores, periods, or colons" |
| 359 | + } |
335 | 360 | } |
336 | 361 | } |
337 | 362 | } |
|
398 | 423 | "put": { |
399 | 424 | "tags": ["LiveActivities"], |
400 | 425 | "summary": "Start a new Live Activity or update an existing one", |
401 | | - "description": "Use a stable stream_key for each ongoing thing you want to show as a Live Activity. Send the latest content_state whenever it changes, and ActivitySmith will keep the Live Activity in sync. For timer streams, send duration_seconds to start or reset the timer; omit duration_seconds on later updates to preserve the existing timer window. Use secondary_action for a second button on alert, progress, and segmented_progress Live Activities.", |
| 426 | + "description": "Use a stable stream_key for each ongoing thing you want to show as a Live Activity. Send the latest content_state whenever it changes, and ActivitySmith will keep the Live Activity in sync. For timer streams, send duration_seconds to start or reset the timer; omit duration_seconds on later updates to preserve the existing timer window. Use secondary_action for a second button on alert, progress, and segmented_progress Live Activities. Optional tags to organize and filter notification history. On later stream updates, omit tags to keep the current tags, send tags again to replace them, or send an empty array to clear them.", |
402 | 427 | "operationId": "reconcileLiveActivityStream", |
403 | 428 | "x-activitysmith-lifecycle": "recommended_managed", |
404 | 429 | "x-codeSamples": [ |
|
533 | 558 | } |
534 | 559 | } |
535 | 560 | } |
| 561 | + }, |
| 562 | + "tagged": { |
| 563 | + "summary": "Organize notification history with tags", |
| 564 | + "value": { |
| 565 | + "content_state": { |
| 566 | + "title": "Search Reindex", |
| 567 | + "subtitle": "catalog-v2", |
| 568 | + "type": "progress", |
| 569 | + "percentage": 42 |
| 570 | + }, |
| 571 | + "tags": ["user:382", "search-reindex"] |
| 572 | + } |
536 | 573 | } |
537 | 574 | } |
538 | 575 | } |
|
572 | 609 | "activity_id": null, |
573 | 610 | "timestamp": "2025-08-12T12:10:00.000Z" |
574 | 611 | } |
| 612 | + }, |
| 613 | + "tagged": { |
| 614 | + "value": { |
| 615 | + "success": true, |
| 616 | + "operation": "started", |
| 617 | + "stream_key": "search-reindex", |
| 618 | + "activity_id": "h8QmSyYFTuwOIF6Wh3YcZlzHLhUcr034", |
| 619 | + "devices_notified": 2, |
| 620 | + "tags": ["user:382", "search-reindex"], |
| 621 | + "timestamp": "2025-08-12T12:00:00.000Z" |
| 622 | + } |
575 | 623 | } |
576 | 624 | } |
577 | 625 | } |
|
594 | 642 | "error": "Invalid channel targeting", |
595 | 643 | "message": "channels must contain at least one channel" |
596 | 644 | } |
| 645 | + }, |
| 646 | + "invalid_tags": { |
| 647 | + "value": { |
| 648 | + "error": "Invalid tags", |
| 649 | + "code": "invalid_tags", |
| 650 | + "message": "tags must contain at most 20 unique values" |
| 651 | + } |
597 | 652 | } |
598 | 653 | } |
599 | 654 | } |
|
833 | 888 | "post": { |
834 | 889 | "tags": ["LiveActivities"], |
835 | 890 | "summary": "Start a Live Activity (legacy manual lifecycle)", |
836 | | - "description": "Legacy manual lifecycle endpoint. For new integrations, use PUT /live-activity/stream/{stream_key} so ActivitySmith can manage start, update, rotation, and end state for you. This endpoint remains supported for existing integrations and advanced lifecycle control. Starts a Live Activity on devices matched by API key scope and optional target channels. Supports segmented_progress, progress, metrics, stats, alert, and timer activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes. Use secondary_action for a second button on alert, progress, and segmented_progress Live Activities.", |
| 891 | + "description": "Legacy manual lifecycle endpoint. For new integrations, use PUT /live-activity/stream/{stream_key} so ActivitySmith can manage start, update, rotation, and end state for you. This endpoint remains supported for existing integrations and advanced lifecycle control. Starts a Live Activity on devices matched by API key scope and optional target channels. Supports segmented_progress, progress, metrics, stats, alert, and timer activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes. Use secondary_action for a second button on alert, progress, and segmented_progress Live Activities. Optional tags to organize and filter notification history.", |
837 | 892 | "operationId": "startLiveActivity", |
838 | 893 | "x-activitysmith-lifecycle": "legacy_manual", |
839 | 894 | "x-activitysmith-recommended-alternative": "PUT /live-activity/stream/{stream_key}", |
|
988 | 1043 | } |
989 | 1044 | } |
990 | 1045 | } |
| 1046 | + }, |
| 1047 | + "tagged": { |
| 1048 | + "summary": "Organize notification history with tags", |
| 1049 | + "value": { |
| 1050 | + "content_state": { |
| 1051 | + "title": "Nightly database backup", |
| 1052 | + "subtitle": "create snapshot", |
| 1053 | + "number_of_steps": 3, |
| 1054 | + "current_step": 1, |
| 1055 | + "type": "segmented_progress", |
| 1056 | + "color": "yellow" |
| 1057 | + }, |
| 1058 | + "tags": ["user:382", "database-backup"] |
| 1059 | + } |
991 | 1060 | } |
992 | 1061 | } |
993 | 1062 | } |
|
1018 | 1087 | "effective_channel_slugs": ["devs", "ops"], |
1019 | 1088 | "timestamp": "2026-01-28T09:57:22.929Z" |
1020 | 1089 | } |
| 1090 | + }, |
| 1091 | + "tagged": { |
| 1092 | + "value": { |
| 1093 | + "success": true, |
| 1094 | + "activity_id": "pLAr-Hnq9ZFW4sxlk43Lhbuok4GLh7UW", |
| 1095 | + "devices_notified": 2, |
| 1096 | + "users_notified": 1, |
| 1097 | + "tags": ["user:382", "database-backup"], |
| 1098 | + "timestamp": "2026-01-28T09:57:22.929Z" |
| 1099 | + } |
1021 | 1100 | } |
1022 | 1101 | } |
1023 | 1102 | } |
|
1034 | 1113 | "error": "Invalid channel targeting", |
1035 | 1114 | "message": "target.channels must be an array of channel slugs" |
1036 | 1115 | } |
| 1116 | + }, |
| 1117 | + "invalid_tags": { |
| 1118 | + "value": { |
| 1119 | + "error": "Invalid tags", |
| 1120 | + "code": "invalid_tags", |
| 1121 | + "message": "tags must use 1-64 lowercase letters, numbers, dashes, underscores, periods, or colons" |
| 1122 | + } |
1037 | 1123 | } |
1038 | 1124 | } |
1039 | 1125 | } |
|
2111 | 2197 | "url": { |
2112 | 2198 | "type": "string", |
2113 | 2199 | "format": "uri", |
2114 | | - "description": "Action URL. For open_url, use an HTTPS URL or a shortcuts://run-shortcut?name=... URL that runs a specific iPhone Shortcut. For webhook, use an HTTPS URL called by the ActivitySmith backend." |
| 2200 | + "description": "Action URL. For open_url, use an HTTP or HTTPS URL or a shortcuts://run-shortcut?name=... URL that runs a specific iPhone Shortcut. For webhook, use an HTTPS URL called by the ActivitySmith backend." |
2115 | 2201 | }, |
2116 | 2202 | "method": { |
2117 | 2203 | "$ref": "#/components/schemas/PushNotificationWebhookMethod", |
|
2137 | 2223 | "then": { |
2138 | 2224 | "properties": { |
2139 | 2225 | "url": { |
2140 | | - "pattern": "^(https|shortcuts)://" |
| 2226 | + "pattern": "^(http|https|shortcuts)://" |
2141 | 2227 | } |
2142 | 2228 | } |
2143 | 2229 | } |
|
2183 | 2269 | "url": { |
2184 | 2270 | "type": "string", |
2185 | 2271 | "format": "uri", |
2186 | | - "description": "Action URL. For open_url, use an HTTPS URL or a shortcuts://run-shortcut?name=... URL that runs a specific iPhone Shortcut. For webhook, use an HTTPS URL called by the ActivitySmith backend." |
| 2272 | + "description": "Action URL. For open_url, use an HTTP or HTTPS URL or a shortcuts://run-shortcut?name=... URL that runs a specific iPhone Shortcut. For webhook, use an HTTPS URL called by the ActivitySmith backend." |
2187 | 2273 | }, |
2188 | 2274 | "method": { |
2189 | 2275 | "$ref": "#/components/schemas/LiveActivityWebhookMethod", |
|
2209 | 2295 | "then": { |
2210 | 2296 | "properties": { |
2211 | 2297 | "url": { |
2212 | | - "pattern": "^(https|shortcuts)://" |
| 2298 | + "pattern": "^(http|https|shortcuts)://" |
2213 | 2299 | } |
2214 | 2300 | } |
2215 | 2301 | } |
|
2268 | 2354 | "required": ["success", "badge", "devices_notified", "users_notified", "effective_channel_slugs", "timestamp"], |
2269 | 2355 | "additionalProperties": false |
2270 | 2356 | }, |
| 2357 | + "TagSlugs": { |
| 2358 | + "type": "array", |
| 2359 | + "description": "Optional tags to organize and filter notification history.", |
| 2360 | + "items": { |
| 2361 | + "type": "string", |
| 2362 | + "minLength": 1, |
| 2363 | + "maxLength": 64, |
| 2364 | + "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,63}$" |
| 2365 | + }, |
| 2366 | + "examples": [ |
| 2367 | + ["user:382", "environment:production"] |
| 2368 | + ] |
| 2369 | + }, |
2271 | 2370 | "PushNotificationRequest": { |
2272 | 2371 | "type": "object", |
2273 | 2372 | "required": ["title"], |
|
2284 | 2383 | "redirection": { |
2285 | 2384 | "type": "string", |
2286 | 2385 | "format": "uri", |
2287 | | - "pattern": "^(https|shortcuts)://", |
2288 | | - "description": "Optional HTTPS URL or shortcuts://run-shortcut?name=... URL opened when the user taps the notification body. Use shortcuts://run-shortcut?name=... to run a specific iPhone Shortcut that already exists on the user's device. Overrides the default tap target from `media` when both are provided." |
| 2386 | + "pattern": "^(http|https|shortcuts)://", |
| 2387 | + "description": "Optional HTTP URL, HTTPS URL, or shortcuts://run-shortcut?name=... URL opened when the user taps the notification body. Use shortcuts://run-shortcut?name=... to run a specific iPhone Shortcut that already exists on the user's device. Overrides the default tap target from `media` when both are provided." |
2289 | 2388 | }, |
2290 | 2389 | "actions": { |
2291 | 2390 | "type": "array", |
|
2299 | 2398 | }, |
2300 | 2399 | "badge": { "type": "integer" }, |
2301 | 2400 | "sound": { "type": "string" }, |
2302 | | - "target": { "$ref": "#/components/schemas/ChannelTarget" } |
| 2401 | + "target": { "$ref": "#/components/schemas/ChannelTarget" }, |
| 2402 | + "tags": { "$ref": "#/components/schemas/TagSlugs" } |
2303 | 2403 | }, |
2304 | 2404 | "additionalProperties": false |
2305 | 2405 | }, |
|
2313 | 2413 | "type": ["array", "null"], |
2314 | 2414 | "items": { "type": "string" } |
2315 | 2415 | }, |
| 2416 | + "tags": { "$ref": "#/components/schemas/TagSlugs" }, |
2316 | 2417 | "timestamp": { "type": "string", "format": "date-time" } |
2317 | 2418 | }, |
2318 | 2419 | "required": ["success", "timestamp"], |
|
2330 | 2431 | "description": "Optional secondary action button. Supported for alert, progress, and segmented_progress Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action." |
2331 | 2432 | }, |
2332 | 2433 | "alert": { "$ref": "#/components/schemas/AlertPayload" }, |
2333 | | - "target": { "$ref": "#/components/schemas/ChannelTarget" } |
| 2434 | + "target": { "$ref": "#/components/schemas/ChannelTarget" }, |
| 2435 | + "tags": { "$ref": "#/components/schemas/TagSlugs" } |
2334 | 2436 | }, |
2335 | 2437 | "additionalProperties": false |
2336 | 2438 | }, |
|
2346 | 2448 | "type": ["array", "null"], |
2347 | 2449 | "items": { "type": "string" } |
2348 | 2450 | }, |
| 2451 | + "tags": { "$ref": "#/components/schemas/TagSlugs" }, |
2349 | 2452 | "timestamp": { "type": "string", "format": "date-time" } |
2350 | 2453 | }, |
2351 | 2454 | "required": ["success", "activity_id", "timestamp"], |
|
2369 | 2472 | "minItems": 1, |
2370 | 2473 | "description": "Channel slugs. When omitted, API key scope determines recipients." |
2371 | 2474 | }, |
2372 | | - "target": { "$ref": "#/components/schemas/ChannelTarget" } |
| 2475 | + "target": { "$ref": "#/components/schemas/ChannelTarget" }, |
| 2476 | + "tags": { |
| 2477 | + "$ref": "#/components/schemas/TagSlugs", |
| 2478 | + "description": "Optional tags to organize and filter notification history. Omit this field on later updates to keep the current tags, send tags again to replace them, or send an empty array to clear them." |
| 2479 | + } |
2373 | 2480 | }, |
2374 | 2481 | "additionalProperties": false |
2375 | 2482 | }, |
|
2392 | 2499 | "type": ["array", "null"], |
2393 | 2500 | "items": { "type": "string" } |
2394 | 2501 | }, |
| 2502 | + "tags": { "$ref": "#/components/schemas/TagSlugs" }, |
2395 | 2503 | "timestamp": { "type": "string", "format": "date-time" } |
2396 | 2504 | }, |
2397 | 2505 | "required": ["success", "operation", "stream_key", "timestamp"], |
|
0 commit comments