Recipients
A recipient is a named destination, usually a person or a team. You send to the name, never to a device.
A recipient is a named destination inside a project, like me, ops or sara. Your code sends to the name; Push works out which browsers are connected to it. People and devices can come and go without any change to your code.
Names#
- Lowercase letters, digits,
-and_, starting with a letter or digit, from 1 to 40 characters. - Unique within a project. Two projects can each have a recipient called
ops. - Use stable names. A user id from your own system works well, such as
user-4821.
⫻
pattern
Browsers and attempts#
A recipient can have several connected browsers, such as a laptop and a phone. Each send creates one attempt per connected browser, and each attempt has its own status. A send to a recipient with three browsers is three attempts, and counts as three.
Browsers join a recipient only when a person allows it, from the dashboard or a connect link. See Connecting browsers.
Limits#
- Up to 50 recipients per project.
- Up to 20 connected browsers per recipient.
- Up to 100 connected browsers per account, across all projects.
- Only connected browsers count. A browser that was disconnected frees its place.
Sending to a recipient#
Put the recipient's name in the recipient field of POST /v1/notifications. If the name does not exist in the key's project, or the recipient has no connected browsers, the request fails and nothing is stored or charged:
⫻
422 Unprocessable Entity
| Code | HTTP | When |
|---|---|---|
| INVALID_RECIPIENT | 422 | No recipient with that name in the key's project, or it has no connected browsers. |
| VALIDATION_ERROR | 400 | The recipient value does not match the name pattern. |