Admin API

The Admin API provides server-to-server endpoints for administrative operations like sending push notifications.

Introduction

The Admin API allows server-to-server communication for administrative operations in your app. Currently, it supports sending push notifications to users programmatically.

Base URL: https://api.starti.app/v1

Authentication

All API requests must include an API key in the x-api-key header. You can obtain your API key from the Manager system.

curl -H "x-api-key: YOUR_API_KEY" https://api.starti.app/v1/...

Endpoints

Send Push Notifications

POST /push-notifications/send

Send either badge updates or notifications to specified users. You can send multiple notifications in a single request.

Request Body

The request body should be an array of notification objects. Each notification can be either a badge update or a notification.

Badge Update
{
  "userIds": ["user123", "user456"],
  "badgeCount": 5
}
FieldTypeDescription
userIdsstring[]Array of user IDs to receive the badge update
badgeCountintegerNumber to display on the app badge (0 removes the badge)
Notification
{
  "userIds": ["user123", "user456"],
  "title": "New Message",
  "body": "You have received a new message",
  "openToUrl": "https://example.com/message/123",
  "badgeCount": 5
}
FieldTypeDescription
userIdsstring[]Array of user IDs to receive the notification
titlestringTitle of the notification
bodystringBody text of the notification
openToUrlstringOptional URL to open when the notification is tapped
badgeCountintegerOptional number to display on the app badge

Example Request

curl -X POST \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '[
    {
      "userIds": ["user123"],
      "title": "New Message",
      "body": "You have received a new message",
      "openToUrl": "https://example.com/message/123"
    },
    {
      "userIds": ["user456"],
      "badgeCount": 5
    }
  ]' \
  https://api.starti.app/v1/push-notifications/send

Responses

200 Success

A successful request with no warnings returns no content (empty response).

If there are warnings, the response will include them:

{
  "message": "Notifications sent with warnings",
  "warnings": [
    "User 'user789' not found"
  ]
}
400 Bad Request
{
  "message": "Invalid request body",
  "issues": [
    [
      {
          "code": "invalid_type",
          "expected": "number",
          "received": "undefined",
          "path": [
            0,
            "badgeCount"
          ],
          "message": "Required"
      },
      {
          "code": "unrecognized_keys",
          "keys": [
            "title"
          ],
          "path": [
            0
          ],
          "message": "Unrecognized key(s) in object: 'title'"
      }
    ],
    [
      {
        "code": "invalid_type",
        "expected": "string",
        "received": "undefined",
        "path": [
          0,
          "body"
        ],
        "message": "Required"
      }
    ]
  ]
}
401 Unauthorized

Returned when the API key is missing or invalid.