Early access · launching soon. Request access

Early access

Early access · launching soon
Product
IntelligenceEarly access. Designed and in development. No results yet. See what's left on the roadmap.
Developers
Resources
Request access

A person reads every request.

REST APIEarly accessDesigned and in development. No results yet. See what's left on the roadmap.

REST API quickstart: send push notifications

Oricato Team Last updated SDK 1.0.1

Early access · launching soon. The REST API described here is the one early-access projects use today.

The Oricato REST API lets your own server, cron job or scheduler create push notification messages for one app: send now, send at a set time, or send at a local time in each person’s own time zone. A message created through the API is checked exactly like one written in the dashboard, and it shows up in the dashboard’s Messages list with the source API and the name of the key that created it.

This guide walks through all six REST endpoints with curl, then shows the create call in Node.js and Python.

Method Path What it does
GET /api/v1/me Shows which project the key belongs to
POST /api/v1/audience/estimate Counts an audience before you send
POST /api/v1/messages Creates a message and schedules it (or saves a draft)
GET /api/v1/messages Lists messages, newest first
GET /api/v1/messages/{message_id} Reads one message with its totals
POST /api/v1/messages/{message_id}/cancel Stops what has not been sent yet

If you already run a OneSignal scheduler, you can keep it and point it at the OneSignal-compatible endpoint instead. See Migrate from OneSignal.

Prerequisites

  • An Oricato project with Firebase credentials uploaded, and at least one device subscribed. Without working credentials, creating a message that sends answers 409 credentials_missing or 409 credentials_invalid. See Firebase and APNs credentials.
  • An API key. In the dashboard, open your project’s Settings → API keys and select Create API key. Give it a name (for example “Scheduler”) and a Messages per day limit (1 to 100,000, default 500). The secret is a 44-character secret of letters and digits, and it is shown once: copy it into your server’s secret store right away. Only admins and owners can create or revoke keys. Read API keys and App Check before you put a key on a server.
  • Your REST address. The same Send from your server card in Settings → API keys shows it as REST address: your API address followed by /api/v1. In the samples below it is written as <ORICATO_API_ADDRESS>/api/v1.

Note: API keys belong on servers only. Never put an Oricato API key in a mobile app, a web page or a public repository. Your apps use the SDKs, which take a Project ID, not a key.

How requests work

  • Authentication. Send the key in the Authorization header: Authorization: Bearer <ORICATO_API_KEY>. The schemes Key and Basic are also accepted with the raw key (not base64), so Key <ORICATO_API_KEY> and Basic <ORICATO_API_KEY> work too. The scheme name is not case-sensitive.
  • The key decides the project. There is no project ID in any REST path or body.
  • JSON. Request and response bodies are UTF-8 JSON with snake_case field names. Send Content-Type: application/json. A request with no Content-Type header is accepted and read as JSON, but a header with any other type answers 415 unsupported_media_type. Decoding is strict: an unknown field answers 400 validation_failed with the field code unknown_field, so a typo fails loudly instead of being ignored.
  • Request IDs. Every response carries an X-Request-Id header. Send your own (8 to 64 letters, digits, ., _ or -) and it is reused, which makes your logs and ours easy to match.
  • Body size. Requests are limited to 1 MiB (413 body_too_large).

Steps

1. Check the key with GET /me

curl <ORICATO_API_ADDRESS>/api/v1/me \
  -H "Authorization: Bearer $ORICATO_API_KEY"

The response names the project the key belongs to and shows the key’s display prefix (the first 12 characters; the full secret is never stored).

{
  "project": {
    "id": "019a1f2e-4c3b-7d8a-9e01-23456789abcd",
    "name": "Lingora",
    "platforms": ["android", "ios"],
    "accent_color": "#3B5BDB",
    "icon_emoji": null,
    "archived": false
  },
  "api_key": {
    "id": "019a2b7c-1d2e-7f30-8a41-5b6c7d8e9f01",
    "name": "Scheduler",
    "prefix": "<KEY_PREFIX>"
  }
}

What you should see: 200 with your app’s name. A 401 unauthorized means the key is missing, malformed, unknown or revoked (see Troubleshooting).

2. Estimate the audience

Before you create a message, count who it would reach. The request takes optional platforms (default: the project’s platforms) and an audience (an AudienceSpec, described below).

curl <ORICATO_API_ADDRESS>/api/v1/audience/estimate \
  -H "Authorization: Bearer $ORICATO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "platforms": ["android", "ios"],
    "audience": { "include_countries": ["US", "GB", "DE", "BR", "JP"] }
  }'
{
  "count": 24318,
  "exact": true,
  "method": "counters",
  "as_of": "2026-10-16T09:30:12Z",
  "by_platform": { "android": 16904, "ios": 7414 },
  "by_language": [
    { "language": "en", "count": 11820 },
    { "language": "de", "count": 4610 },
    { "language": "pt", "count": 4402 },
    { "language": "ja", "count": 3486 }
  ],
  "by_country": [
    { "country": "US", "count": 8930 },
    { "country": "DE", "count": 4688 },
    { "country": "BR", "count": 4415 },
    { "country": "JP", "count": 3512 },
    { "country": "GB", "count": 2773 }
  ]
}
  • method is counters when the audience uses only countries, languages and platforms. These are answered from live counters and are always exact: true.
  • Any other filter (tags, app version, activity, engagement, IDs) makes it a database count (method: "query") with a 3-second limit. If the limit runs out, you get the counters’ answer for the countries and languages part with exact: false. Sending is unaffected: every filter is applied per person at send time.
  • by_language lists every language (up to 200), which tells you which languages need a translation. by_country lists the top 20.
  • Identical requests within 10 seconds are answered from a cache. Estimates have their own rate limit of 2 requests per second (burst 10) per key.

AudienceSpec

Every field is optional, and conditions are combined with AND. An empty audience {} means everyone subscribed on the message’s platforms.

Field Type Rules
include_countries / exclude_countries string[] Up to 250 ISO 3166-1 alpha-2 codes each (ZZ = unknown). They must not overlap.
include_languages / exclude_languages string[] Up to 200 language codes each, such as en, pt, zh-hans. They must not overlap.
app_version_min / app_version_max string Such as 3.2.0; both inclusive. Devices without an app version never match a version filter.
last_active_within_days int 1 to 3,650. Seen in the last N days.
inactive_for_more_than_days int 1 to 3,650. Not seen for more than N days (re-engagement).
first_seen_within_days int 1 to 3,650. New in the last N days (onboarding).
tags object[] Up to 20, ANDed. Each is key, relation (eq, neq, exists, not_exists) and value (required for eq and neq, up to 256 characters). neq also matches people without the key.
engagement_levels string[] Any of champion, active, light, sleeping, new.
external_user_ids string[] Up to 10,000 of your own user IDs (1 to 128 characters each).
subscription_ids uuid[] Up to 10,000. Use either this or external_user_ids, not both.
test_only bool Only devices marked as test devices. Default false.

3. Send a message now

POST /api/v1/messages takes a MessageInput plus an optional "draft" flag (default false). With draft: false the message is validated and scheduled in the same call. A message needs at least a default_language and one translation with a body. This sample adds titles and two more languages:

curl <ORICATO_API_ADDRESS>/api/v1/messages \
  -H "Authorization: Bearer $ORICATO_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: weekly-digest-2026-10-16" \
  -d '{
    "name": "Weekly digest",
    "content": {
      "default_language": "en",
      "translations": [
        { "language": "en", "title": "Your weekly digest", "body": "Five new stories picked for you this week." },
        { "language": "es", "title": "Tu resumen semanal", "body": "Cinco historias nuevas elegidas para ti esta semana." },
        { "language": "de", "title": "Dein Wochenrückblick", "body": "Fünf neue Geschichten, für dich ausgewählt." }
      ]
    }
  }'

People whose app language has no translation get the default_language one. With no audience the message goes to everyone subscribed, and with no schedule it sends now.

The response is 201 Created with the full Message:

{
  "id": "019a3c5e-7b21-7d4e-9f10-2b8c4d6e8a01",
  "project_id": "019a1f2e-4c3b-7d8a-9e01-23456789abcd",
  "kind": "campaign",
  "name": "Weekly digest",
  "content": {
    "default_language": "en",
    "translations": [
      { "language": "en", "title": "Your weekly digest", "subtitle": "", "body": "Five new stories picked for you this week." },
      { "language": "es", "title": "Tu resumen semanal", "subtitle": "", "body": "Cinco historias nuevas elegidas para ti esta semana." },
      { "language": "de", "title": "Dein Wochenrückblick", "subtitle": "", "body": "Fünf neue Geschichten, für dich ausgewählt." }
    ],
    "image_url": null,
    "launch_url": null,
    "additional_data": {}
  },
  "category_id": null,
  "platforms": ["android", "ios"],
  "android": {
    "channel_id": null,
    "small_icon": null,
    "accent_color": null,
    "sound": null,
    "priority": "high",
    "visibility": null,
    "group": null
  },
  "ios": {
    "sound": null,
    "badge_type": "none",
    "badge_count": null,
    "interruption_level": null,
    "thread_id": null
  },
  "ttl_seconds": 86400,
  "collapse_key": null,
  "audience": {},
  "schedule": {
    "mode": "now",
    "send_at": null,
    "local_time": null,
    "starts_at": null,
    "start_date": null,
    "missed_zones": "next_day",
    "timezone": null
  },
  "test_of_message_id": null,
  "duplicated_from_message_id": null,
  "source": "api",
  "created_by": { "type": "api_key", "id": "019a2b7c-1d2e-7f30-8a41-5b6c7d8e9f01", "label": "Scheduler" },
  "category": null,
  "route": null,
  "autopilot": null,
  "receipt_sample_percent": 100,
  "daily_cap_overridden": false,
  "status": "sending",
  "version": 2,
  "first_send_at": "2026-10-16T09:31:04Z",
  "last_send_at": "2026-10-16T09:31:04Z",
  "audience_estimate": 24318,
  "confirmed_audience": null,
  "totals": {
    "recipients": 0,
    "sent": 0,
    "failed": 0,
    "delivered": 0,
    "delivered_sample_percent": 100,
    "opened": 0,
    "conversions": 0,
    "invalidated": 0,
    "expired": 0,
    "cancelled": 0,
    "skipped": 0,
    "open_rate": 0,
    "delivery_rate": 0
  },
  "progress": { "slices_total": 1, "slices_done": 0, "batches_total": 0, "batches_done": 0, "percent": 0 },
  "failure": null,
  "created_at": "2026-10-16T09:31:04Z",
  "updated_at": "2026-10-16T09:31:04Z",
  "scheduled_at": "2026-10-16T09:31:04Z",
  "sending_started_at": "2026-10-16T09:31:04Z",
  "completed_at": null,
  "cancelled_at": null,
  "cancelled_by": null,
  "archived_at": null,
  "archived_by": null,
  "editable": false
}

Every documented field is always present, and nullable fields come back as null. A send-now message comes back already sending, with sending_started_at set and editable: false. Its version is 2 because scheduling in the same call counts as one change after the create. The status then moves from sending to sent (or partially_sent or failed). Only at_time and local_time messages start at scheduled.

Retry safely with Idempotency-Key

The Idempotency-Key header (1 to 128 printable ASCII characters) makes the create call safe to retry. For 30 days:

  • The same key with an identical body returns the original message with 200 OK and the same body as the original 201. No second message is created.
  • The same key with a different body answers 409 idempotency_conflict, with the original message’s ID in details.message_id.

Bodies are compared after canonicalizing the JSON (sorted keys, no extra whitespace), so reformatting the same body does not count as a change. Use one key per logical message, for example weekly-digest-2026-10-16.

An Idempotency-Key header that is present but empty, or that has non-printable characters, answers 400 validation_failed with the field Idempotency-Key.

More MessageInput fields

Field Type Rules / default
name string Up to 200 characters; only your team sees it. Default "".
content.default_language string Required, and it must have a translation.
content.translations[] object[] 1 to 60, one per language. title and subtitle (iOS only) up to 250 characters; body required, 1 to 2,000.
content.image_url string An https:// URL, up to 1,024 characters.
content.launch_url string Up to 1,024 characters. https, http (with a warning) or one of the project’s allowed URL schemes for deep links.
content.additional_data object Up to 50 string pairs for your app. Keys match ^[A-Za-z0-9_.-]{1,64}$ and values are up to 1,024 characters. Keys must not start with fx_, google., gcm., from, collapse_key or message_type (so from_screen is rejected).
category_id uuid One of the project’s message categories.
platforms string[] android, ios. Default: the project’s platforms.
android.channel_id string Must exist in the project’s Android channel list. null uses the default channel.
android.priority string high (default) or normal. Also small_icon, accent_color, sound, visibility, group.
ios.badge_type string none (default), set or increase, with badge_count. Also sound, interruption_level, thread_id.
ttl_seconds int 0 to 2,419,200 (28 days). Default 14,400 (4 hours) for local_time, otherwise 86,400.
collapse_key string 1 to 64 bytes matching ^[A-Za-z0-9_.:-]+$. A newer message with the same key replaces the older one on the device.
audience AudienceSpec Default {} (everyone subscribed).
schedule Schedule Default {"mode": "now"}.

Every translation must build a push payload within the platform limit (Android 4,000 bytes, iOS 3,800 bytes), or the call answers 422 payload_too_large with the sizes in details.payloads.

Note: android.channel_id must name a channel that exists in the project’s channel list in the dashboard, and the app must create that same channel ID on the device. Android fixes a channel’s sound and vibration once it is created, so use a new channel ID to change them. See Android notification channels.

4. Schedule a message, or save a draft

The schedule object has three modes.

mode Fields What happens
now none Sends right away.
at_time send_at One instant for everyone. Between 1 minute ago and 365 days ahead.
local_time local_time + start_date Everyone gets it at local_time (HH:MM, 24 h) on that calendar date in their own time zone.
local_time local_time + starts_at Each person gets it at the first local_time in their own time zone at or after that instant.
local_time local_time only With neither starts_at nor start_date, each person gets it at their next local_time after the moment you schedule it.

Local time on a date (start_date, up to 365 days ahead). A message for Monday arrives on Monday everywhere:

curl <ORICATO_API_ADDRESS>/api/v1/messages \
  -H "Authorization: Bearer $ORICATO_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: morning-tip-2026-11-02" \
  -d '{
    "name": "Morning tip",
    "content": {
      "default_language": "en",
      "translations": [
        { "language": "en", "title": "Start your week strong", "body": "Try today's two-minute warm-up." },
        { "language": "pt", "title": "Comece bem a semana", "body": "Experimente o aquecimento de dois minutos de hoje." },
        { "language": "ja", "title": "いい一週間のスタートを", "body": "今日の2分間ウォームアップを試してみましょう。" }
      ],
      "launch_url": "https://lingora.example/today"
    },
    "audience": { "include_countries": ["US", "GB", "BR", "JP"] },
    "schedule": { "mode": "local_time", "local_time": "08:00", "start_date": "2026-11-02", "missed_zones": "next_day" }
  }'

missed_zones decides what happens to people whose 08:00 on that date has already passed when you schedule: next_day (the default) sends at their next 08:00, and skip leaves them out. schedule.timezone is optional and only used for display in the dashboard; it does not change who gets the message when.

One instant for everyone (at_time):

{
  "content": {
    "default_language": "en",
    "translations": [{ "language": "en", "title": "Live in one hour", "body": "The community Q&A starts at 15:00 UTC." }]
  },
  "schedule": { "mode": "at_time", "send_at": "2026-11-05T14:00:00Z" }
}

send_at accepts any RFC 3339 offset and is returned in UTC with Z.

A draft ("draft": true) is validated and saved without being scheduled, so a teammate can review it in the dashboard and schedule it there. The REST API has no schedule endpoint for drafts.

{
  "draft": true,
  "name": "Holiday announcement",
  "content": {
    "default_language": "en",
    "translations": [{ "language": "en", "title": "Holiday hours", "body": "Here is what changes this season." }]
  },
  "schedule": { "mode": "at_time", "send_at": "2026-12-20T16:00:00Z" }
}

The response is 201 with "status": "draft". Drafts count toward the key’s daily quota.

Note: If a schedule would give anyone more notifications on one local day than the project’s daily limit per person, the call answers 409 daily_cap_exceeded with cap, local_date, timezones and message_ids in details. API keys can never override the daily cap. For the full scheduling rules, see Local-time delivery and scheduling.

5. List messages

curl "<ORICATO_API_ADDRESS>/api/v1/messages?status=scheduled&kind=campaign&limit=50" \
  -H "Authorization: Bearer $ORICATO_API_KEY"
  • status (optional): draft, scheduled, sending, sent, partially_sent, cancelled or failed.
  • kind: campaign (default) or test.
  • limit: 1 to 200, default 50.
  • cursor: the next_cursor of the previous page.

The list holds every message of the project, including those created in the dashboard, newest first:

{
  "items": [
    {
      "id": "019a3d10-2a4f-7c61-8b02-9d3e4f5a6b7c",
      "project_id": "019a1f2e-4c3b-7d8a-9e01-23456789abcd",
      "project": {
        "id": "019a1f2e-4c3b-7d8a-9e01-23456789abcd",
        "name": "Lingora",
        "platforms": ["android", "ios"],
        "accent_color": "#3B5BDB",
        "icon_emoji": null,
        "archived": false
      },
      "kind": "campaign",
      "name": "Morning tip",
      "title_preview": "Morning tip",
      "status": "scheduled",
      "version": 2,
      "source": "api",
      "created_by": { "type": "api_key", "id": "019a2b7c-1d2e-7f30-8a41-5b6c7d8e9f01", "label": "Scheduler" },
      "platforms": ["android", "ios"],
      "schedule": {
        "mode": "local_time",
        "send_at": null,
        "local_time": "08:00",
        "starts_at": null,
        "start_date": "2026-11-02",
        "missed_zones": "next_day",
        "timezone": null
      },
      "first_send_at": "2026-11-01T23:00:00Z",
      "display_at": "2026-11-01T23:00:00Z",
      "audience_estimate": 19902,
      "totals": {
        "recipients": 0, "sent": 0, "failed": 0, "delivered": 0, "delivered_sample_percent": 100,
        "opened": 0, "conversions": 0, "invalidated": 0, "expired": 0, "cancelled": 0, "skipped": 0,
        "open_rate": 0, "delivery_rate": 0
      },
      "progress_percent": 0,
      "category": null,
      "autopilot": false,
      "cancelled_by": null,
      "archived_at": null,
      "created_at": "2026-10-16T09:40:22Z",
      "editable": true
    }
  ],
  "next_cursor": "eyJ2IjoxLCJrIjpbIjAxOWEzZDEwLTJhNGYtN2M2MS04YjAyLTlkM2U0ZjVhNmI3YyJdLCJmIjoiNGQ3YTEyYjAifQ"
}

To read the next page, pass next_cursor back as cursor with the same filters. next_cursor is null on the last page. Treat the cursor as opaque: a cursor used with different filters answers 400 invalid_cursor.

curl "<ORICATO_API_ADDRESS>/api/v1/messages?status=scheduled&kind=campaign&limit=50&cursor=eyJ2IjoxLCJrIjpbIjAxOWEzZDEwLTJhNGYtN2M2MS04YjAyLTlkM2U0ZjVhNmI3YyJdLCJmIjoiNGQ3YTEyYjAifQ" \
  -H "Authorization: Bearer $ORICATO_API_KEY"

Archived messages are listed like any others, with archived_at set. The REST API has no archive endpoints.

6. Read one message and its totals

curl <ORICATO_API_ADDRESS>/api/v1/messages/019a3c5e-7b21-7d4e-9f10-2b8c4d6e8a01 \
  -H "Authorization: Bearer $ORICATO_API_KEY"

The response is 200 with the full Message (the same shape as step 3). After the send, its totals fill in:

{
  "status": "sent",
  "totals": {
    "recipients": 24318,
    "sent": 24102,
    "failed": 216,
    "delivered": 22871,
    "delivered_sample_percent": 100,
    "opened": 1687,
    "conversions": 241,
    "invalidated": 198,
    "expired": 0,
    "cancelled": 0,
    "skipped": 0,
    "open_rate": 0.07,
    "delivery_rate": 0.9489
  }
}
Field Meaning
sent Accepted by Firebase Cloud Messaging.
delivered Confirmed by the app on the device; never more than sent. Scaled when the project samples delivery receipts (delivered_sample_percent 10), and null when receipts are off (0).
opened People who tapped the notification.
conversions Events from trackEvent within 24 hours of an open.
invalidated Devices FCM reported as gone, usually uninstalls. They are not sent to again.
expired Not sent because the message’s time window had passed.
open_rate / delivery_rate opened / sent and delivered / sent, as fractions rounded to 4 decimals.

A message ID from another project answers 404 not_found, exactly like one that does not exist.

7. Cancel a message

curl -X POST <ORICATO_API_ADDRESS>/api/v1/messages/019a3d10-2a4f-7c61-8b02-9d3e4f5a6b7c/cancel \
  -H "Authorization: Bearer $ORICATO_API_KEY"

The call has no body. It works only while the message is scheduled or sending; in any other status (including draft) it answers 409 invalid_state with details.status and details.allowed_statuses. Every pending time-zone group and batch is cancelled at once; batches already in flight finish their current attempt (at most 500 sends). What was already sent stays sent. The response is 200 with the Message, now "status": "cancelled", with cancelled_at and cancelled_by (the key’s name) set.

The create call in Node.js and Python

Both samples read the key from the ORICATO_API_KEY environment variable, send an Idempotency-Key, and retry 429 and 503 after Retry-After with the same key and body, so a retry can never create a second message.

Node.js 18 or later (built-in fetch):

const BASE = "<ORICATO_API_ADDRESS>/api/v1";

async function createMessage(body, idempotencyKey, maxAttempts = 5) {
  for (let attempt = 1; attempt <= maxAttempts; attempt++) {
    const res = await fetch(`${BASE}/messages`, {
      method: "POST",
      headers: {
        Authorization: `Bearer ${process.env.ORICATO_API_KEY}`,
        "Content-Type": "application/json",
        "Idempotency-Key": idempotencyKey,
      },
      body: JSON.stringify(body),
    });

    if (res.status === 201 || res.status === 200) {
      return res.json(); // 200 = this key was already used with this body
    }

    if ((res.status === 429 || res.status === 503) && attempt < maxAttempts) {
      const err = await res.json();
      if (err.error.code === "key_quota_exceeded") {
        throw new Error(`Daily quota reached; resets at ${err.error.details.resets_at}`);
      }
      const waitSeconds = Number(res.headers.get("Retry-After") ?? "1");
      await new Promise((r) => setTimeout(r, waitSeconds * 1000));
      continue;
    }

    const err = await res.json();
    throw new Error(`${res.status} ${err.error.code}: ${err.error.message} (request ${err.error.request_id})`);
  }
}

const message = await createMessage(
  {
    name: "Weekly digest",
    content: {
      default_language: "en",
      translations: [
        { language: "en", title: "Your weekly digest", body: "Five new stories picked for you this week." },
      ],
    },
    schedule: { mode: "at_time", send_at: "2026-11-06T17:00:00Z" },
  },
  "weekly-digest-2026-11-06",
);
console.log(message.id, message.status);

Python 3 (requests):

import os
import time

import requests

BASE = "<ORICATO_API_ADDRESS>/api/v1"


def create_message(body, idempotency_key, max_attempts=5):
    headers = {
        "Authorization": f"Bearer {os.environ['ORICATO_API_KEY']}",
        "Content-Type": "application/json",
        "Idempotency-Key": idempotency_key,
    }
    for attempt in range(1, max_attempts + 1):
        res = requests.post(f"{BASE}/messages", json=body, headers=headers, timeout=30)

        if res.status_code in (200, 201):
            return res.json()  # 200 = this key was already used with this body

        err = res.json()["error"]
        if res.status_code in (429, 503) and attempt < max_attempts:
            if err["code"] == "key_quota_exceeded":
                raise RuntimeError(f"Daily quota reached; resets at {err['details']['resets_at']}")
            time.sleep(int(res.headers.get("Retry-After", "1")))
            continue

        raise RuntimeError(f"{res.status_code} {err['code']}: {err['message']} (request {err['request_id']})")


message = create_message(
    {
        "name": "Weekly digest",
        "content": {
            "default_language": "en",
            "translations": [
                {"language": "en", "title": "Your weekly digest", "body": "Five new stories picked for you this week."}
            ],
        },
        "schedule": {"mode": "at_time", "send_at": "2026-11-06T17:00:00Z"},
    },
    "weekly-digest-2026-11-06",
)
print(message["id"], message["status"])

Errors

Every error uses the same envelope. message is a plain-English sentence, details is always an object, and request_id matches the X-Request-Id header.

{
  "error": {
    "code": "validation_failed",
    "message": "Some fields need your attention.",
    "details": {
      "fields": [
        { "field": "content.translations[1].body", "code": "required", "message": "Body is required." }
      ]
    },
    "request_id": "019a3c5e-9f02-7a13-b4c5-d6e7f8091a2b"
  }
}

validation_failed lists every problem at once in details.fields, each with a dotted field path and a code such as required, unknown_field, invalid_format, invalid_value, too_long, out_of_range or not_found.

HTTP code Meaning and what to do
400 invalid_json The body is not valid JSON, or not a JSON object.
400 validation_failed Fix the fields listed in details.fields.
400 invalid_cursor The cursor is malformed or was made for different filters.
401 unauthorized The key is missing, malformed, unknown or revoked. details.reason is missing, invalid or revoked.
403 project_archived The key’s project is archived.
404 not_found No such message, or it belongs to another project.
409 credentials_missing The project has no Firebase credentials yet.
409 credentials_invalid The project’s Firebase credentials are marked invalid. Upload a working key.
409 idempotency_conflict The same Idempotency-Key was used with a different body. details.message_id is the original.
409 daily_cap_exceeded Someone would get more than the daily limit on one local day. See details.
409 invalid_state The action is not allowed in the message’s current status (for example cancelling a sent message).
413 body_too_large The request is over 1 MiB.
415 unsupported_media_type Send Content-Type: application/json.
422 payload_too_large A translation is too big for a platform. details.payloads lists the sizes.
429 rate_limited Too many requests. Wait Retry-After seconds (also in details.retry_after_seconds).
429 key_quota_exceeded The key created its max_messages_per_day messages today (UTC). details.limit and details.resets_at.
500 internal_error Unexpected. Retry later and quote the request_id if it repeats.
503 service_unavailable The service is busy or restarting. Retry after Retry-After.

Rate limits and quotas

Limit Rate Applies to
Per key 20 requests/s, burst 40 Every /api/v1 request
Creates per key 5 requests/s, burst 20 POST /api/v1/messages (and the OneSignal-compatible create)
Estimates per key 2 requests/s, burst 10 POST /api/v1/audience/estimate
Daily quota per key max_messages_per_day, default 500 Messages created per UTC day, drafts included, answered with 429 key_quota_exceeded
Failed keys per network 30 failures/min Every rejected key (malformed, unknown or revoked) from one IP prefix; after that, requests from it get 429 before any key lookup

One key’s creates run one at a time; up to 8 may run or wait at once, and more answer 429 rate_limited with Retry-After: 1.

Retry guidance

  • Retry 429 rate_limited and 503 service_unavailable after the Retry-After seconds, with the same Idempotency-Key and the same body. If the first attempt was in fact created, the retry returns it with 200.
  • Do not retry key_quota_exceeded in a loop; its Retry-After points at the next UTC midnight (details.resets_at).
  • Do not retry 4xx validation and state errors unchanged. Fix the request first.
  • Never reuse an Idempotency-Key for a different message.

Verify it works

  1. Open the dashboard’s Messages list. The message you created is there with an API badge and by followed by your key’s name (for example “by Scheduler”), and its status matches the status the API returned.
  2. Open the message’s report. As the send runs, Sent, Delivered and Opened move up, and they match the totals from GET /api/v1/messages/{message_id}.
  3. In Settings → API keys, the key’s Used today count and Last used time have changed. (Last used is updated at most once per minute.)
  4. On a test device, the notification arrives. To send only to your test devices while you build, use "audience": { "test_only": true }.

Troubleshooting

404 or a non-JSON answer on every call

You used the API address without /api/v1. The SDKs take the API address with no path; only server calls add /api/v1. Copy the REST address from Settings → API keys, and make sure there is no double slash.

401 unauthorized

Check details.reason:

  • missing: no Authorization header was sent.
  • invalid: the header is malformed or the key is unknown. The value must be Bearer, Key or Basic followed by the full secret (44 characters). With Basic, send the raw key, not base64. A display prefix such as <KEY_PREFIX> is not a key.
  • revoked: the key was revoked in the dashboard. Revoking takes effect immediately on the server that handled it and within 5 seconds everywhere. Create a new key; a revoked key never works again.

400 validation_failed with unknown_field

Decoding is strict. A common cause is adding a project ID or an app_id to the body: the key already decides the project, so there is no project ID in REST paths or bodies. (The app_id field belongs to the OneSignal-compatible endpoint.)

409 credentials_missing or credentials_invalid

Upload a working Firebase service account key in the dashboard first. For iOS, also upload your APNs auth key (.p8) in your Firebase project, or iOS sends fail with apns_auth_error. See Firebase and APNs credentials.

A local-time message arrived “a day late” or not at all for some people

With start_date, the date is the calendar date in each subscriber’s own time zone, not in yours. People whose local_time had already passed when you scheduled get it at their next local_time (missed_zones: "next_day") or not at all ("skip"). schedule.timezone is display-only. If you want “the next 08:00 for each person from now on”, use starts_at instead of start_date. Remember that local_time messages default to a 4-hour ttl_seconds.

409 daily_cap_exceeded

The schedule would give some people more than the project’s daily limit per person on one local day. details.local_date and details.timezones say where, and details.message_ids lists the other messages involved. Move the message to another day, or ask an admin to send it from the dashboard; API keys cannot override the cap.

429 key_quota_exceeded

The key reached its messages per day (UTC), drafts included. The limit is set when the key is created (1 to 100,000); create a new key with a higher limit if your volume really needs it.

409 invalid_state on cancel

Only scheduled and sending messages can be cancelled. Drafts are deleted or scheduled from the dashboard, and finished messages cannot be cancelled.

The API accepted the message, but a device shows nothing or shows it silently

The REST call only creates the message. If the report shows sent but devices show nothing, the problem is on the app side: on Android, check that the app manifest declares com.oricato.push.OricatoMessagingService, and that a Firebase API key restricted without your app’s SHA-1 is not blocking the FCM token (“BAD CONFIG” in Firebase Installations logs). Some Android OEM skins, such as TECNO HiOS, demote notifications to silent by default. See Troubleshooting delivery.

Related

Get early access to Oricato.

Founding teams get early access, free help moving from OneSignal, and a founding discount.

We use this to reply, plan your invitation and set up your account. Privacy Policy

A person reads every request.

Or get the monthly newsletter