[relaybell docs › Sending › Send to one user](https://relaybell.com/docs/send-to-one-user) · [All docs as Markdown](https://relaybell.com/docs.md) · [Index for AI assistants](https://relaybell.com/llms.txt)

# Send to one user

> Transactional sends to one of your own users by externalId, with examples in cURL, Node.js, Python and PHP.

First link the browser to your user: pass your own user id as `externalId` in `RelayBell.init()`, or call `RelayBell.identify(externalId)` once the visitor signs in (with `userHash` if you use [identity verification](https://relaybell.com/docs/identity)). Then send with that id from your server. If no subscribed browser has the id, the send still answers `202` and simply reaches nobody.

```bash tab="cURL"
curl -X POST https://relaybell.com/api/v1/notifications \
  -H "Authorization: Bearer rb_live_xxxxx" -H "Content-Type: application/json" \
  -d '{
    "externalId": "user_123",
    "transactional": true,
    "title": "Your order has shipped",
    "body": "Order #1042 is on its way.",
    "url": "https://shop.example/orders/1042"
  }'
```

```js tab="Node.js"
// Node.js (npm install relaybell)
const { RelayBell } = require("relaybell");
const rb = new RelayBell({ apiKey: process.env.RELAYBELL_API_KEY });
const { notificationId } = await rb.send({
  externalId: "user_123",
  transactional: true,
  title: "Your order has shipped",
  body: "Order #1042 is on its way.",
  url: "https://shop.example/orders/1042",
});
```

```python tab="Python"
# Python (pip install relaybell)
import os
from relaybell import RelayBell
rb = RelayBell(os.environ["RELAYBELL_API_KEY"])
res = rb.send(
    externalId="user_123",
    transactional=True,
    title="Your order has shipped",
    body="Order #1042 is on its way.",
    url="https://shop.example/orders/1042",
)
print(res["notificationId"])
```

```php tab="PHP"
<?php // PHP (composer require relaybell/relaybell-php)
$rb = new Relaybell\Client(getenv('RELAYBELL_API_KEY'));
$res = $rb->send([
    'externalId'    => 'user_123',
    'transactional' => true,
    'title'         => 'Your order has shipped',
    'body'          => 'Order #1042 is on its way.',
    'url'           => 'https://shop.example/orders/1042',
]);
echo $res['notificationId'];
```

For several users at once, send `"externalIds": ["user_1", "user_2"]` instead.
