# Send your first notification

Connect your own account, then send one identifiable message and verify it in the app.

## 1. Prepare the receiving side

Open the [Pijon app](https://app.pijon.fyi). Sign in to your active account. In Settings, copy your **Recipient ID**. In Devices, connect a supported receiving client and grant notification permission when you want push. A device must be both registered and enabled. Account access or a receiving client may require operator assistance during the current rollout.

## 2. Prepare the sending side

In Applications, create an application, open its details, and copy its Application ID. Create a scoped API key there and save its one-time secret in your server or local secret store. A generic wildcard key is insufficient. Both `test` and `live` labels can send real notifications.

Open the application's **Subscription link** or **Preview approval** while signed in as the receiving user. Approve the application and the `general` category. Self-notifications also require this approval. See [recipient setup](/docs/recipients).

## 3. Configure your shell

Set `PIJON_API_KEY` privately in your environment or secret manager; do not paste it into a chat or commit it. Set the other values in your shell. Replace the uppercase placeholders with the IDs copied above.

```bash
export PIJON_API_BASE_URL='https://api.pijon.fyi/api/v1'
export PIJON_APPLICATION_ID='YOUR_APPLICATION_ULID'
export PIJON_RECIPIENT_ID='YOUR_RECIPIENT_ULID'
export PIJON_IDEMPOTENCY_KEY="quickstart-$(date +%s)-$$"
```

Generate the idempotency key **once for this message**. Keep the same key and body if the request times out and you retry. Generate a new key only for a new logical notification. This request can notify real devices and consume allowance.

## 4. Send once

After setting `PIJON_API_KEY`, run this request or download a [runnable example](/docs/examples).

```bash
curl --fail-with-body --silent --show-error --max-time 20 \
  "$PIJON_API_BASE_URL/notifications" \
  -H "Authorization: Bearer $PIJON_API_KEY" \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -H "Idempotency-Key: $PIJON_IDEMPOTENCY_KEY" \
  --data "{\"application_id\":\"$PIJON_APPLICATION_ID\",\"recipient_id\":\"$PIJON_RECIPIENT_ID\",\"body\":\"Hello from Pijon docs\"}"
```

## 5. Verify the result

A first send returns `202` with `data.notification.id`, `data.notification.status`, `data.notification.endpoint_count`, and `data.replayed: false`. Copy the notification ID. Retrying the identical request with the same key returns `200`, the same notification ID, and `replayed: true` without another notification or delivery charge. Changing the body with that key produces `409`.

In the sender's History, find the notification ID. In the recipient's Inbox, open the same notification. Confirm display on your chosen device separately. `endpoint_count: 0` / `inbox_only` can be valid when no eligible push destination exists or preferences suppress push. A script key cannot query History or Inbox; use the authenticated app.

If it does not work, use [Troubleshooting](/docs/troubleshooting). Never treat `202` or a provider receipt alone as proof that a person saw the message.
