{ "opencollection": "1.0.0", "info": { "name": "Creed achievements scheduled-notifications API", "version": "1.0.0" }, "items": [ { "info": { "name": "scheduled-notifications", "type": "folder" }, "items": [ { "info": { "name": "Schedule Daily Notifications", "type": "http" }, "http": { "method": "POST", "url": "{{baseUrl}}/api/scheduled-notifications/admin/schedule-daily", "headers": [ { "name": "x-api-key", "value": "" } ], "params": [ { "name": "days_ahead", "value": "", "type": "query", "description": "Days ahead to schedule for (default: 2)" } ] }, "docs": "Daily cron job endpoint to schedule notifications for all users.\nThis should be called once per day (e.g., at midnight UTC).\n\nFor each user with push tokens:\n- Randomly selects a time slot (morning/noon/night)\n- Schedules a notification with content appropriate for that time\n- Respects user's timezone for scheduling\n\nTasks are queued in Redis and processed by Celery workers.\nUse days_ahead to override the default 2-day lead time.\n\nRequires x-api-key header for authentication." }, { "info": { "name": "Send Due Notifications", "type": "http" }, "http": { "method": "POST", "url": "{{baseUrl}}/api/scheduled-notifications/admin/send-due", "headers": [ { "name": "x-api-key", "value": "" } ] }, "docs": "5-minute cron job endpoint to send all due notifications.\nThis should be called every 5 minutes.\n\nChecks for all pending notifications scheduled for current time or earlier and sends them.\nUpdates notification status to 'sent' or 'failed' accordingly.\n\nTasks are queued in Redis and processed by Celery workers.\n\nRequires x-api-key header for authentication." }, { "info": { "name": "Generate Content", "type": "http" }, "http": { "method": "POST", "url": "{{baseUrl}}/api/scheduled-notifications/admin/generate-content", "headers": [ { "name": "x-api-key", "value": "" } ], "params": [ { "name": "start_hours_ahead", "value": "", "type": "query", "description": "Hours ahead of now for window start (default: 47)" }, { "name": "end_hours_ahead", "value": "", "type": "query", "description": "Hours ahead of now for window end (default: 48)" } ] }, "docs": "Hourly cron job endpoint to pre-generate notification content.\nBy default processes a 1-hour time slice 47-48 hours ahead.\nUse start_hours_ahead and end_hours_ahead query params to override.\n\nFor each notification in the slice:\n- Determines type (personalized vs template) via probability\n- Template: inserts content directly into DB\n- Personalized: submits Gemini batch (results collected via retry)\n\nRequires x-api-key header for authentication." }, { "info": { "name": "Test Notification", "type": "http" }, "http": { "method": "POST", "url": "{{baseUrl}}/api/scheduled-notifications/admin/test", "headers": [ { "name": "x-user-id", "value": "" }, { "name": "x-api-key", "value": "" } ], "body": { "type": "json", "data": "{}" } }, "docs": "Generate a test notification for a user.\nShows exactly what would be generated by the production batch system.\n\nArgs:\n- x-user-id (header): The user ID to generate notification for\n- sendToDevice (body): If true, actually sends the notification to the user's device. Default: false\n- deliveryMethod (body): \"push\" for regular push notification, \"live_activity\" for iOS Live Activity. Default: \"push\"\n- notificationType (body): \"personalized\", \"prayer\", or \"journaling\". Default: \"personalized\"\n- time" }, { "info": { "name": "Test Live Activity", "type": "http" }, "http": { "method": "POST", "url": "{{baseUrl}}/api/scheduled-notifications/admin/test-live-activity", "headers": [ { "name": "x-user-id", "value": "" }, { "name": "x-api-key", "value": "" } ], "body": { "type": "json", "data": "{}" } }, "docs": "Trigger a Live Activity on a user's device for testing.\n\nPick a variant from the Swagger \"Examples\" dropdown (prayer / church /\ndevotional / custom reminder, streak, or standard) and send. Reminders carry\nthe per-subtype artwork (via the deep link's reminderType), the weekly streak\nbubbles, and the interactive snooze.\n\n- x-user-id (header): user to send the Live Activity to (must have a stored\n live_activity_tokens pushToStart token)\n- Requires x-api-key header for authentication." } ] } ], "bundled": true }