Send Notification By Device ID API

Send push notifications to specific devices using their unique device identifiers

Push Notifications

Send Notification By Device ID API

Target specific devices with push notifications using their unique device ID. Perfect for device-specific alerts and personalized messages.

Device Targeting

Send to specific devices precisely.

Push Notifications

Instant alerts on mobile devices.

Precise Delivery

Reach exactly the device you want.


Endpoint Overview

MUTATION/graphql

Send a push notification to a specific device using its unique device ID. The notification includes a subject and content body.

Authentication:Bearer Token
Required scopes:admin

Request Parameters

deviceIdString!Required

The unique identifier of the target device.

notificationNotificationInput!Required

Object containing the notification details.

subjectString!Required

The notification title/subject.

contentString!Required

The notification body/message content.

dataJSON

Additional data payload for the notification.


GraphQL Mutation

mutation sendNotificationByDeviceId(
  $deviceId: String!
  $notification: NotificationInput!
) {
  sendNotificationByDeviceId(
    deviceId: $deviceId
    notification: $notification
  ) {
    status
    message
  }
}

Variables:

{
  "deviceId": "device_abc123xyz",
  "notification": {
    "subject": "Security Alert",
    "content": "New login detected from a new location. If this wasn't you, please secure your account."
  }
}

HTTP Request:

curl -X POST https://api.orbnet.com/graphql \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_ADMIN_TOKEN" \
  -d '{
    "query": "mutation sendNotificationByDeviceId($deviceId: String!, $notification: NotificationInput!) { sendNotificationByDeviceId(deviceId: $deviceId, notification: $notification) { status message } }",
    "variables": {
      "deviceId": "device_abc123xyz",
      "notification": {
        "subject": "Security Alert",
        "content": "New login detected from a new location."
      }
    }
  }'

Response

200Notification Sent Successfully
{
  "data": {
    "sendNotificationByDeviceId": {
      "status": "sent",
      "message": "Notification delivered successfully"
    }
  }
}
400Device Not Found
{
  "errors": [
    {
      "message": "Device not found or inactive",
      "path": ["sendNotificationByDeviceId"],
      "extensions": {
        "code": "DEVICE_NOT_FOUND"
      }
    }
  ],
  "data": null
}
400Push Token Invalid
{
  "errors": [
    {
      "message": "Device push token is invalid or expired",
      "path": ["sendNotificationByDeviceId"],
      "extensions": {
        "code": "INVALID_PUSH_TOKEN"
      }
    }
  ],
  "data": null
}

Use Cases

Security Alerts

Notify specific device about security events.

Session Warnings

Alert before disconnecting a device.

Connection Updates

Notify about server changes or maintenance.

Support Messages

Direct support communication to user's device.


Best Practices

Verify Device

Confirm device ID is valid before sending.

Clear Subject

Use concise, informative notification titles.

Handle Failures

Implement fallback for failed deliveries.

Rate Limit

Don't spam devices with too many notifications.



Finding Device IDs

Use the Devices query to retrieve device IDs for users. Device IDs are assigned when devices are activated.

Need to Reach All Users?

Use the Send Notification to All API for broadcast messages to all users.

Send to All API