Endpoints

Notifications

POST/api/v1/device-tokens

Register device token for push notifications.

Registers or updates FCM device token for mobile notifications.

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Request model for device token registration.

Response Body

application/json

application/json

curl -X POST "https://example.com/api/v1/device-tokens" \  -H "Content-Type: application/json" \  -d '{    "token": "string",    "platform": "string"  }'
{  "id": "string",  "user_id": "string",  "platform": "string",  "is_active": true,  "created_at": "string"}
DELETE/api/v1/device-tokens/{token}

Deactivate device token.

Marks device token as inactive to stop receiving notifications.

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Path Parameters

token*Token

Response Body

application/json

curl -X DELETE "https://example.com/api/v1/device-tokens/string"
Empty
GET/api/v1/users/me/devices

List registered devices for the current user.

Returns all active FCM device tokens owned by the authenticated user, ordered by registration date descending.

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Response Body

application/json

curl -X GET "https://example.com/api/v1/users/me/devices"
[  {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "platform": "string",    "device_name": "string",    "created_at": "2019-08-24T14:15:22Z"  }]
DELETE/api/v1/users/me/devices/{device_id}

Unregister a device by ID.

Permanently removes the FCM device token. The device will no longer receive push notifications. Returns 404 if the device does not exist or belongs to another user.

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Path Parameters

device_id*Device Id
Formatuuid

Response Body

application/json

curl -X DELETE "https://example.com/api/v1/users/me/devices/497f6eca-6276-4993-bfeb-53cbbbba6f08"
Empty
GET/api/v1/notifications/schedule

Get the current user's notification schedule.

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Response Body

application/json

curl -X GET "https://example.com/api/v1/notifications/schedule"
{  "id": "string",  "user_id": "string",  "mode": "string",  "days_of_week": [    "string"  ],  "start_time": "string",  "end_time": "string",  "timezone": "string",  "critical_override": true}
PUT/api/v1/notifications/schedule

Create or update the current user's notification schedule.

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X PUT "https://example.com/api/v1/notifications/schedule" \  -H "Content-Type: application/json" \  -d '{}'
{  "id": "string",  "user_id": "string",  "mode": "string",  "days_of_week": [    "string"  ],  "start_time": "string",  "end_time": "string",  "timezone": "string",  "critical_override": true}
GET/api/v1/notifications/history

Get the last 50 notification history entries for the current user.

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Response Body

application/json

curl -X GET "https://example.com/api/v1/notifications/history"
[  {    "id": "string",    "incident_id": "string",    "title": "string",    "body": "string",    "status": "string",    "reason": "string",    "bypassed_dnd": true,    "sent_at": "string"  }]