List Sources
const url = 'https://api.pocketbell.dev/v1/sources';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.pocketbell.dev/v1/sources \ --header 'Authorization: Bearer <token>'Authorizations
Section titled “Authorizations”Responses
Section titled “Responses”The account’s Sources, in its own order: as arranged, then the rest by name.
object
object
Api: sends with an API key. webhook: another service posts events to its URL.
Webhook only: the title, with {{field}} placeholders.
Webhook only: the message; empty means a summary of the event.
Webhook only: when the latest event arrived.
Webhook only: the field whose value sets the priority; null: always the default.
Webhook only: the priority for each value of priority_field, the first match winning. Any other value gets the default.
object
Webhook only: the field whose value is the replace key, so a later event with the same value replaces the earlier notification; null: none.
The devices it sends to, of those still receiving; null: every device, including new ones. If every chosen device is removed, it sends to every device.
Identifies the key without revealing it.
The sound its notifications play; null: the device’s own.
Always null: every Critical notification plays the Critical sound.
Notifications sent in the last 24 hours.
Webhook only: the tool its latest event is from, when Pocketbell writes its notifications (no template of its own); null otherwise.
When it last sent a notification that was taken, within the plan’s history.
The last notification it sent that was refused, and why: the sender alone saw the error.
object
The error the sender got: monthly_limit_reached, rate_limited, pro_required or question_limit.
Example
{ "sources": [ { "id": "src_01jz9k6q8r3tfv0x2m4n5p7s8a", "name": "Production Servers", "kind": "api", "priority_field": "status", "priority_values": [ { "value": "down", "priority": "silent" } ], "replace_field": "check", "api_key_hint": "pb_live_8fK2…Qx4a", "default_priority": "silent", "sound": "default", "critical_sound": "default", "automatic_tool": "Uptime Kuma", "last_refused": { "code": "monthly_limit_reached" } } ]}Missing or ended session.
object
object
Which fields were wrong, for invalid_request.
object
Example
{ "error": { "code": "invalid_request" }}