Gen-Endpoint
Back to API List
Device Management API
Register and manage mobile devices, push tokens, preferences, and device analytics.
Mobile
Internal API - Hosted by this App
API Endpoints & Usage
Explore and interact with the available endpoints for the Device Management API. These API routes are live! The paths shown below are relative to your application's base URL. For example, if this application is hosted at https://gen-endpoint.com, an endpoint path for this API, such as /api/devices/register, would be accessible at https://gen-endpoint.com/api/devices/register. You can use the "Try it out" section for each endpoint or use tools like curl, Postman, or your browser's address bar (for GET requests) to interact with them.
POST

/api/devices/register

Register new device with platform and capabilities.

Show Static Examples

Example Request Body:

{
  "deviceId": "device_abc123",
  "platform": "ios",
  "osVersion": "17.0",
  "appVersion": "1.2.3",
  "pushToken": "apns_token_123",
  "deviceInfo": {
    "model": "iPhone 15 Pro",
    "manufacturer": "Apple"
  }
}

Example Response:

{
  "id": "dev_789",
  "deviceId": "device_abc123",
  "platform": "ios",
  "status": "active",
  "registeredAt": "2024-08-16T12:00:00Z",
  "lastSeen": "2024-08-16T12:00:00Z"
}
Try it out
PUT

/api/devices/{deviceId}/token

Update push notification token for device. Replace {deviceId} with an actual ID.

Show Static Examples

Example Request Body:

{
  "pushToken": "new_apns_token_456",
  "tokenType": "apns"
}

Example Response:

{
  "deviceId": "device_abc123",
  "pushToken": "new_apns_token_456",
  "updatedAt": "2024-08-16T12:05:00Z",
  "status": "token_updated"
}
Try it out

Replace placeholders (e.g., {userId}) with actual values in the path above.

GET

/api/devices

List user devices with last activity and status.

Show Static Examples

Example Response:

[
  {
    "id": "dev_789",
    "deviceId": "device_abc123",
    "platform": "ios",
    "deviceInfo": {
      "model": "iPhone 15 Pro"
    },
    "lastSeen": "2024-08-16T12:00:00Z",
    "status": "active"
  },
  {
    "id": "dev_790",
    "deviceId": "device_def456",
    "platform": "android",
    "deviceInfo": {
      "model": "Pixel 8"
    },
    "lastSeen": "2024-08-15T18:30:00Z",
    "status": "inactive"
  }
]
Try it out

You can add or change query parameters in the path above (e.g., ?name=User).

PUT

/api/devices/{deviceId}/preferences

Update notification preferences for device. Replace {deviceId} with an actual ID.

Show Static Examples

Example Request Body:

{
  "notifications": {
    "push": true,
    "email": false,
    "marketing": false
  },
  "quietHours": {
    "enabled": true,
    "start": "22:00",
    "end": "08:00",
    "timezone": "America/New_York"
  }
}

Example Response:

{
  "deviceId": "device_abc123",
  "preferences": {
    "notifications": {
      "push": true,
      "email": false,
      "marketing": false
    },
    "quietHours": {
      "enabled": true,
      "start": "22:00",
      "end": "08:00",
      "timezone": "America/New_York"
    }
  },
  "updatedAt": "2024-08-16T12:10:00Z"
}
Try it out

Replace placeholders (e.g., {userId}) with actual values in the path above.