Edu Scheduler Notifier API Documentation
Source Code: https://github.com/eduhub123/edu_scheduler_notifier
Postman Collection: Go-LLM-Notification.postman_collection.json
Base URL
http://your-domain/api/v1
Authentication
All endpoints require API Key authentication via the X-API-Key
request header, except for the /health
check endpoint.
Header:
X-API-Key: your-api-key
Default API Key: cUvFlPeNFdJkdJGFzxBciAxK4wDYKbNe
API Endpoints
Health Check
Endpoint |
Description |
Authentication |
Request |
Success Response (200 OK) |
GET /health |
Checks the service health. |
No |
None |
json { "status": "ok", "timestamp": "..." } |
Notification Endpoints
Endpoint |
Description |
Authentication |
Request Body |
Success Response (200 OK) |
POST /notification/push |
Sends a push notification. |
Yes |
json { "title": "...", "body": "...", "tokens": [...], "metadata": {...}, "product": "..." } |
json { "message": "Notification queued successfully", "payload": { "title": "...", "body": "...", "tokens": [...], "metadata": {...}, "product": "..." } } |
POST /notification/email |
Sends an email notification. |
Yes |
json { "to": "...", "subject": "...", "body": "..." } |
(Implied: Success message, e.g., { "message": "Email queued successfully" } ) |
Prompt Management
Endpoint |
Description |
Authentication |
Request |
Success Response (200 OK / 201 Created) |
GET /prompt/:promptId |
Gets a specific prompt by ID. |
Yes |
Path Param: :promptId |
json { "_id": "...", "name": "...", "template": "...", "created_at": "...", "updated_at": "..." } |
POST /prompt |
Creates a new prompt. |
Yes |
Body: json { "name": "...", "template": "..." } |
json { "_id": "...", "name": "...", "template": "...", "created_at": "...", "updated_at": "..." } (Status Code might be 201 Created) |
PUT /prompt/:promptId |
Updates an existing prompt. |
Yes |
Path Param: :promptId <br/> Body: json { "name": "...", "template": "..." } |
json { "message": "Prompt updated successfully" } |
DELETE /prompt/:promptId |
Deletes a prompt. |
Yes |
Path Param: :promptId |
json { "message": "Prompt deleted successfully" } |
GET /prompts |
Gets all prompts (paginated). |
Yes |
Query Params (optional): <br/> page (default: 1) <br/> page_size (default: 10, max: 100) |
json { "data": [ { "_id": "...", ... } ], "pagination": { "total": ..., "page": ..., "page_size": ..., "total_page": ... } } |
Scheduler Management
Endpoint |
Description |
Authentication |
Request |
Success Response (200 OK) |
POST /scheduler/register |
Registers a new scheduled job. |
Yes |
Body: json { "name": "...", "schedule": "...", "handler": "...", "params": { "kwargs": { ... }, "args": [...] } } <br/> Available Handlers: test_handler , schedule_notification , schedule_execute_prompt |
json { "message": "Registered job successfully", "payload": { "id": "...", "name": "...", "schedule": "...", "handler": "...", "params": { "kwargs": { ... } } } } |
PUT /scheduler/job/:schedulerId |
Controls a job (START/STOP/DELETE). |
Yes |
Path Param: :schedulerId <br/> Body: json { "command": "START" } (or STOP , DELETE ) |
json { "message": "Started job successfully", "error": "" } (Message varies based on command) |
GET /scheduler/jobs |
Gets all scheduled jobs. |
Yes |
None |
json { "data": [ { "id": "...", "name": "...", "schedule": "...", "handler": "...", "status": "...", "params": { "kwargs": { ... } } } ], "error": "" } |
Segment Endpoint
Endpoint |
Description |
Authentication |
Request |
Success Response (200 OK) |
GET /segment |
Gets segment information. |
Yes |
None |
json { "segments": [ { "id": "...", "name": "...", "criteria": { ... } } ] } |
Error Responses
The API uses standard HTTP status codes for errors. The general JSON response format for errors is:
{
"error": "Error Type Summary",
"details": "Specific error message"
}
Status Code |
Error Type |
Example Details |
400 |
Bad Request |
"Invalid request payload" |
401 |
Unauthorized |
"Invalid or missing API key" |
404 |
Not Found |
"Resource not found" |
500 |
Internal Server Error |
(Varies depending on the server issue) |