> ## Documentation Index
> Fetch the complete documentation index at: https://docs.corsair.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# ntfy API reference

> API reference for the ntfy plugin in Corsair: every `ntfy.api.*` operation with its input and output types, taken from the plugin's Zod schemas.

> [!NOTE]
>
> **New to Corsair?** See [API access](https://docs.corsair.dev/concepts/api.md), [authentication](https://docs.corsair.dev/concepts/auth.md), and [error handling](https://docs.corsair.dev/concepts/error-handling).

## Account

### changePassword

`account.changePassword`

Change the signed-in account password; the old one stops working

**Risk:** `destructive`

```ts theme={null}
await corsair.ntfy.api.account.changePassword({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `password` | `string` | Yes | The current password |
| `newPassword` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean` | Yes | — |

***

### create

`account.create`

Sign up a new user on a server with signup enabled (anonymous call)

**Risk:** `write`

```ts theme={null}
await corsair.ntfy.api.account.create({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `username` | `string` | Yes | — |
| `password` | `string` | Yes | — |
| `email` | `string` | No | Optional; with email configured on the server a verification link is sent |

Signup must be enabled on the server, and ntfy refuses it from a signed-in user: use the plugin with `anonymous: true` and no key.

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean` | Yes | — |

***

### delete

`account.delete`

Delete the signed-in account, its tokens and reservations, confirmed with the current password

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.ntfy.api.account.delete({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `password` | `string` | Yes | The current password, as confirmation |

Confirmed with the current password. The server marks the account for removal, so it can stay listed (and keep its tier) for a while.

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean` | Yes | — |

***

### login

`account.login`

Sign in with username:password and get a new session token

**Risk:** `write`

```ts theme={null}
await corsair.ntfy.api.account.login({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `token` | `string` | Yes | — |
| `username` | `string` | Yes | — |

***

### requestPasswordReset

`account.requestPasswordReset`

Email a password reset link to the account (server needs email sending)

**Risk:** `destructive`

```ts theme={null}
await corsair.ntfy.api.account.requestPasswordReset({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `identifier` | `string` | Yes | Username or email address |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean` | Yes | — |

***

### resetPassword

`account.resetPassword`

Set a new password with the token from a reset link

**Risk:** `write`

```ts theme={null}
await corsair.ntfy.api.account.resetPassword({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `token` | `string` | Yes | The token from the reset link |
| `password` | `string` | Yes | The new password |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean` | Yes | — |

***

### updateSettings

`account.updateSettings`

Change account preferences: language, date/time format and notification sound, minimum priority, auto-delete

**Risk:** `write`

```ts theme={null}
await corsair.ntfy.api.account.updateSettings({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `language` | `string` | No | — |
| `dateFormat` | `string` | No | — |
| `timeFormat` | `string` | No | — |
| `notification` | `object` | No | sound, min\_priority (1-5) and delete\_after (seconds) |

> [accordion] notification full type
>
> ```ts theme={null}
> {
>   sound?: string,
>   min_priority?: number,
>   delete_after?: number
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean` | Yes | — |

***

### usage

`account.usage`

Read the account view: tier limits, messages/emails/calls used and remaining, and the daily reset time

**Risk:** `read`

```ts theme={null}
await corsair.ntfy.api.account.usage({});
```

**Input:** *empty object*

Anonymous callers get an IP-based view; with a token it is the account tier. No per-topic stats exist on ntfy.sh.

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `username` | `string` | Yes | — |
| `role` | `string` | Yes | — |
| `limits` | `object` | Yes | — |
| `stats` | `object` | Yes | — |

> [accordion] limits full type
>
> ```ts theme={null}
> {
>   basis?: string | null,
>   messages?: number | null,
>   messages_expiry_duration?: number | null,
>   emails?: number | null,
>   calls?: number | null,
>   reservations?: number | null,
>   attachment_total_size?: number | null,
>   attachment_file_size?: number | null,
>   attachment_expiry_duration?: number | null,
>   attachment_bandwidth?: number | null
> }
> ```

> [accordion] stats full type
>
> ```ts theme={null}
> {
>   messages?: number | null,
>   messages_remaining?: number | null,
>   emails?: number | null,
>   emails_remaining?: number | null,
>   calls?: number | null,
>   calls_remaining?: number | null,
>   reservations?: number | null,
>   reservations_remaining?: number | null,
>   attachment_total_size?: number | null,
>   attachment_total_size_remaining?: number | null,
>   reset_at?: number | null
> }
> ```

***

## Billing

### cancelSubscription

`billing.cancelSubscription`

Cancel the paid subscription at the end of the period

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.ntfy.api.billing.cancelSubscription({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean` | Yes | — |

***

### createPortalSession

`billing.createPortalSession`

Get a Stripe billing portal URL for the account

**Risk:** `write`

```ts theme={null}
await corsair.ntfy.api.billing.createPortalSession({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `redirect_url` | `string` | Yes | — |

***

### createSubscription

`billing.createSubscription`

Start a paid subscription; returns a Stripe checkout URL

**Risk:** `destructive`

```ts theme={null}
await corsair.ntfy.api.billing.createSubscription({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `tier` | `string` | Yes | Tier code from billing.tiers |
| `interval` | `month \| year` | Yes | — |

Returns a Stripe checkout URL to open; nothing is charged until checkout is completed.

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `redirect_url` | `string` | Yes | — |

***

### tiers

`billing.tiers`

List the paid tiers with their prices and limits, plus the free tier (servers with payments only)

**Risk:** `read`

```ts theme={null}
await corsair.ntfy.api.billing.tiers({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `tiers` | `object[]` | Yes | — |

> [accordion] tiers full type
>
> ```ts theme={null}
> {
>   code?: string,
>   name?: string,
>   prices?: {
>     month: number,
>     year: number
>   } | null,
>   limits?: {
>     basis?: string,
>     messages?: number,
>     messages_expiry_duration?: number,
>     emails?: number,
>     calls?: number,
>     reservations?: number,
>     attachment_total_size?: number,
>     attachment_file_size?: number,
>     attachment_expiry_duration?: number,
>     attachment_bandwidth?: number
>   } | null
> }[]
> ```

***

### updateSubscription

`billing.updateSubscription`

Switch the paid subscription to another tier or interval (charges or prorates)

**Risk:** `destructive`

```ts theme={null}
await corsair.ntfy.api.billing.updateSubscription({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `tier` | `string` | Yes | Tier code from billing.tiers |
| `interval` | `month \| year` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean` | Yes | — |

***

## Emails

### add

`emails.add`

Add an email address to the account and send it a verification link

**Risk:** `destructive`

```ts theme={null}
await corsair.ntfy.api.emails.add({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `email` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean` | Yes | — |

***

### delete

`emails.delete`

Remove an email address from the account

**Risk:** `destructive`

```ts theme={null}
await corsair.ntfy.api.emails.delete({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `email` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean` | Yes | — |

***

### resendVerification

`emails.resendVerification`

Send the verification link for a pending email address again

**Risk:** `destructive`

```ts theme={null}
await corsair.ntfy.api.emails.resendVerification({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `email` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean` | Yes | — |

***

### setPrimary

`emails.setPrimary`

Make a verified email address the primary one

**Risk:** `write`

```ts theme={null}
await corsair.ntfy.api.emails.setPrimary({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `email` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean` | Yes | — |

***

### verify

`emails.verify`

Confirm an email address with the token from its verification link

**Risk:** `write`

```ts theme={null}
await corsair.ntfy.api.emails.verify({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `token` | `string` | Yes | The token from the verification link |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean` | Yes | — |

***

## Files

### download

`files.download`

Download a message attachment stored on the server (/file/\{id}) and return the file

**Risk:** `read`

```ts theme={null}
await corsair.ntfy.api.files.download({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | Attachment id from a message `attachment.url` (/file/\<id>, an extension is allowed) |

Takes the id at the end of `attachment.url` (/file/\<id>) and returns the file: text as `text`, other files as base64.

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `contentBase64` | `string` | No | The file, base64-encoded. Missing when the file came back as text or contentOmitted is set. |
| `text` | `string` | No | The file as text, in place of contentBase64, when it is a text file (CSV, JSON, Markdown, XML and the like) in UTF-8. |
| `contentType` | `string` | Yes | Media type of the file, for example application/pdf. |
| `byteLength` | `number` | Yes | Size of the file in bytes. |
| `filename` | `string` | No | The file name, when known. |
| `contentOmitted` | `not_requested \| over_limit` | No | Set when the content was left out: the caller did not ask for it, or the file was over the limit. |
| `fileId` | `string` | No | Where the host saved the file. Over the limit it comes in place of the content; a host that keeps every file sets it beside the content too. On Corsair it is a Files id (fil\_…): pass it to another app wherever that app takes a file URL, or read a text file or PDF with files.read\_text. |

***

## Messages

### clear

`messages.clear`

Mark a message as read and dismissed on subscribers (sends a message\_clear event)

**Risk:** `write`

```ts theme={null}
await corsair.ntfy.api.messages.clear({ topic: 'mytopic', sequenceId: 'disk-alert' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `topic` | `string` | Yes | Topic name |
| `sequenceId` | `string` | Yes | Sequence id of the message to mark as read |

Sends a `message_clear` event: subscribers mark the message read and dismissed. The cache entry stays until it expires.

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | — |
| `time` | `number` | Yes | Unix seconds |
| `expires` | `number \| null` | No | Unix seconds the cache entry expires |
| `event` | `message_clear` | Yes | — |
| `topic` | `string` | Yes | — |
| `sequence_id` | `string \| null` | No | — |

***

### delete

`messages.delete`

Delete a message by sequence id, sending a delete event to subscribers; the cache entry is removed

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.ntfy.api.messages.delete({ topic: 'mytopic', sequenceId: 'disk-alert' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `topic` | `string` | Yes | Topic name |
| `sequenceId` | `string` | Yes | Sequence id of the message to delete |

Sends a `message_delete` event. A scheduled message that has not gone out is cancelled and removed from the server; a delivered one stays cached with the delete event after it, and clients that support it remove the notification. Republishing the same `sequenceId` revives the sequence.

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | — |
| `time` | `number` | Yes | Unix seconds |
| `expires` | `number \| null` | No | Unix seconds the cache entry expires |
| `event` | `message_delete` | Yes | — |
| `topic` | `string` | Yes | — |
| `sequence_id` | `string \| null` | No | — |

***

### poll

`messages.poll`

Read cached messages from one or more topics, optionally including scheduled ones, with since/filters

**Risk:** `read`

```ts theme={null}
await corsair.ntfy.api.messages.poll({ topic: 'mytopic', since: '10min' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `topic` | `string` | Yes | Topic name, or a comma-separated list of up to 150 topics, \[-\_A-Za-z0-9]\{1,64} each |
| `since` | `string \| number` | No | Read messages since: a duration ("10min"), unix seconds, a message id, "all" (default), or "latest" |
| `scheduled` | `boolean` | No | Include scheduled (undelivered) messages |
| `id` | `string` | No | Only the message with this id |
| `message` | `string` | No | Filter by message text |
| `title` | `string` | No | Filter by title |
| `priority` | `(number \| min \| low \| default \| high \| urgent)[]` | No | Only these priorities (OR filter) |
| `tags` | `string[]` | No | Only messages with all of these tags (AND filter) |

Reads the server-side cache (12h on ntfy.sh, 10 MB replay cap per topic). Poll filters: `message`, `title`, `id` match text; `priority` is an OR list, `tags` an AND list. A multi-topic comma list (up to 150 topics) interleaves by time.

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `messages` | `object[]` | Yes | — |

> [accordion] messages full type
>
> ```ts theme={null}
> {
>   id: string,
>   time: number,
>   expires?: number | null,
>   event: message,
>   topic: string,
>   message: string,
>   sequence_id?: string | null,
>   title?: string | null,
>   priority?: number | null,
>   tags?: string[] | null,
>   click?: string | null,
>   icon?: string | null,
>   content_type?: string | null,
>   actions?: {
>     action: view | broadcast | http | copy,
>     label: string,
>     url?: string,
>     clear?: boolean,
>     method?: string,
>     headers?: Record<string, string>,
>     body?: string,
>     intent?: string,
>     extras?: Record<string, string>,
>     value?: string
>   }[] | null,
>   attachment?: {
>     name: string,
>     url: string,
>     type?: string | null,
>     size?: number | null,
>     expires?: number | null
>   } | null
> }[]
> ```

***

### send

`messages.send`

Publish a notification to a topic; every subscriber gets a push, so the send cannot be undone

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.ntfy.api.messages.send({ topic: 'mytopic', message: 'Disk space is low at 5.1 GB', title: 'Low disk space alert', priority: 4, tags: ['warning', 'cd'] });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `topic` | `string` | Yes | Topic name, \[-\_A-Za-z0-9]\{1,64} |
| `message` | `string` | No | Notification body; the server default is "triggered" |
| `title` | `string` | No | Notification title |
| `priority` | `number \| min \| low \| default \| high \| urgent` | No | Priority as 1-5 or min\|low\|default\|high\|urgent |
| `tags` | `string[]` | No | Emoji tags, e.g. \["warning","skull"] |
| `click` | `string` | No | URL opened when the notification is clicked |
| `markdown` | `boolean` | No | Render the message as markdown |
| `actions` | `object[]` | No | Up to 3 action buttons |
| `delay` | `string` | No | Delayed delivery, e.g. "30min" or "9am"; ntfy.sh accepts 10s to 3d. Cancel before delivery with messages.delete |
| `icon` | `string` | No | URL of a JPEG or PNG shown as the notification icon |
| `attach` | `string` | No | URL of a file to attach (the server does not download it) |
| `filename` | `string` | No | File name for the `attach` URL |
| `email` | `string` | No | Also email the notification to this address (the server must have email sending configured; counts against the daily email limit) |
| `call` | `string` | No | Also phone this verified number (or "yes" for the first one) and read the message out; needs a tier with calls |
| `cache` | `boolean` | No | false: deliver to current subscribers only, do not cache |
| `firebase` | `boolean` | No | false: do not forward to Firebase (Android app without instant delivery) |
| `sequenceId` | `string` | No | Optional sequence id, \[-\_A-Za-z0-9]\{1,64}; publishing again with the same id updates (replaces) the message on subscribers |

Publishes as JSON to the server root. `email` and `call` also email or phone someone (servers with those features). `message` defaults to 'triggered' server-side. `delay` accepts 10s to 3d on ntfy.sh; self-hosted servers may differ.

> [accordion] actions full type
>
> ```ts theme={null}
> {
>   action: view | broadcast | http | copy,
>   label: string,
>   url?: string,
>   clear?: boolean,
>   method?: string,
>   headers?: Record<string, string>,
>   body?: string,
>   intent?: string,
>   extras?: Record<string, string>,
>   value?: string
> }[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | — |
| `time` | `number` | Yes | Unix seconds |
| `expires` | `number \| null` | No | Unix seconds the cache entry expires |
| `event` | `message` | Yes | — |
| `topic` | `string` | Yes | — |
| `message` | `string` | Yes | — |
| `sequence_id` | `string \| null` | No | — |
| `title` | `string \| null` | No | — |
| `priority` | `number \| null` | No | — |
| `tags` | `string[] \| null` | No | — |
| `click` | `string \| null` | No | — |
| `icon` | `string \| null` | No | — |
| `content_type` | `string \| null` | No | — |
| `actions` | `object[] \| null` | No | — |
| `attachment` | `object \| null` | No | — |

> [accordion] actions full type
>
> ```ts theme={null}
> {
>   action: view | broadcast | http | copy,
>   label: string,
>   url?: string,
>   clear?: boolean,
>   method?: string,
>   headers?: Record<string, string>,
>   body?: string,
>   intent?: string,
>   extras?: Record<string, string>,
>   value?: string
> }[] | null
> ```

> [accordion] attachment full type
>
> ```ts theme={null}
> {
>   name: string,
>   url: string,
>   type?: string | null,
>   size?: number | null,
>   expires?: number | null
> } | null
> ```

***

### sendFile

`messages.sendFile`

Upload a file as a message attachment (PUT /\{topic}); every subscriber gets a push, so the send cannot be undone

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.ntfy.api.messages.sendFile({ topic: 'mytopic', filename: 'report.txt', contentBase64: 'aGVsbG8K', message: 'Nightly report' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `topic` | `string` | Yes | Topic name, \[-\_A-Za-z0-9]\{1,64} |
| `contentBase64` | `string` | Yes | The file, base64-encoded. It becomes the message attachment. |
| `filename` | `string` | Yes | Attachment file name shown to subscribers |
| `contentType` | `string` | No | Media type of the file; defaults to application/octet-stream |
| `message` | `string` | No | Notification body |
| `title` | `string` | No | Notification title |
| `priority` | `number \| min \| low \| default \| high \| urgent` | No | — |
| `tags` | `string[]` | No | — |
| `click` | `string` | No | — |
| `icon` | `string` | No | — |
| `delay` | `string` | No | — |
| `sequenceId` | `string` | No | — |

Uploads the file as the request body (PUT /\{topic}) with the other options as X- headers. The answer carries `attachment` with its name, size, type, expiry and URL. The server needs an attachment cache; ntfy.sh limits files by tier.

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | — |
| `time` | `number` | Yes | Unix seconds |
| `expires` | `number \| null` | No | Unix seconds the cache entry expires |
| `event` | `message` | Yes | — |
| `topic` | `string` | Yes | — |
| `message` | `string` | Yes | — |
| `sequence_id` | `string \| null` | No | — |
| `title` | `string \| null` | No | — |
| `priority` | `number \| null` | No | — |
| `tags` | `string[] \| null` | No | — |
| `click` | `string \| null` | No | — |
| `icon` | `string \| null` | No | — |
| `content_type` | `string \| null` | No | — |
| `actions` | `object[] \| null` | No | — |
| `attachment` | `object \| null` | No | — |

> [accordion] actions full type
>
> ```ts theme={null}
> {
>   action: view | broadcast | http | copy,
>   label: string,
>   url?: string,
>   clear?: boolean,
>   method?: string,
>   headers?: Record<string, string>,
>   body?: string,
>   intent?: string,
>   extras?: Record<string, string>,
>   value?: string
> }[] | null
> ```

> [accordion] attachment full type
>
> ```ts theme={null}
> {
>   name: string,
>   url: string,
>   type?: string | null,
>   size?: number | null,
>   expires?: number | null
> } | null
> ```

***

### update

`messages.update`

Publish a new version of a message under an existing sequence id; the server keeps both versions and notifies again

**Risk:** `destructive`

```ts theme={null}
await corsair.ntfy.api.messages.update({ topic: 'mytopic', message: 'Disk space is low at 4.9 GB', sequenceId: 'disk-alert' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `topic` | `string` | Yes | Topic name, \[-\_A-Za-z0-9]\{1,64} |
| `message` | `string` | No | Notification body; the server default is "triggered" |
| `title` | `string` | No | Notification title |
| `priority` | `number \| min \| low \| default \| high \| urgent` | No | Priority as 1-5 or min\|low\|default\|high\|urgent |
| `tags` | `string[]` | No | Emoji tags, e.g. \["warning","skull"] |
| `click` | `string` | No | URL opened when the notification is clicked |
| `markdown` | `boolean` | No | Render the message as markdown |
| `actions` | `object[]` | No | Up to 3 action buttons |
| `delay` | `string` | No | Delayed delivery, e.g. "30min" or "9am"; ntfy.sh accepts 10s to 3d. Cancel before delivery with messages.delete |
| `icon` | `string` | No | URL of a JPEG or PNG shown as the notification icon |
| `attach` | `string` | No | URL of a file to attach (the server does not download it) |
| `filename` | `string` | No | File name for the `attach` URL |
| `email` | `string` | No | Also email the notification to this address (the server must have email sending configured; counts against the daily email limit) |
| `call` | `string` | No | Also phone this verified number (or "yes" for the first one) and read the message out; needs a tier with calls |
| `cache` | `boolean` | No | false: deliver to current subscribers only, do not cache |
| `firebase` | `boolean` | No | false: do not forward to Firebase (Android app without instant delivery) |
| `sequenceId` | `string` | Yes | Sequence id of the message to update; the server keeps both versions and notifies again |

Publishes with `sequence_id` set. The server keeps both versions and every subscriber is notified again.

> [accordion] actions full type
>
> ```ts theme={null}
> {
>   action: view | broadcast | http | copy,
>   label: string,
>   url?: string,
>   clear?: boolean,
>   method?: string,
>   headers?: Record<string, string>,
>   body?: string,
>   intent?: string,
>   extras?: Record<string, string>,
>   value?: string
> }[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | — |
| `time` | `number` | Yes | Unix seconds |
| `expires` | `number \| null` | No | Unix seconds the cache entry expires |
| `event` | `message` | Yes | — |
| `topic` | `string` | Yes | — |
| `message` | `string` | Yes | — |
| `sequence_id` | `string \| null` | No | — |
| `title` | `string \| null` | No | — |
| `priority` | `number \| null` | No | — |
| `tags` | `string[] \| null` | No | — |
| `click` | `string \| null` | No | — |
| `icon` | `string \| null` | No | — |
| `content_type` | `string \| null` | No | — |
| `actions` | `object[] \| null` | No | — |
| `attachment` | `object \| null` | No | — |

> [accordion] actions full type
>
> ```ts theme={null}
> {
>   action: view | broadcast | http | copy,
>   label: string,
>   url?: string,
>   clear?: boolean,
>   method?: string,
>   headers?: Record<string, string>,
>   body?: string,
>   intent?: string,
>   extras?: Record<string, string>,
>   value?: string
> }[] | null
> ```

> [accordion] attachment full type
>
> ```ts theme={null}
> {
>   name: string,
>   url: string,
>   type?: string | null,
>   size?: number | null,
>   expires?: number | null
> } | null
> ```

***

## Phone Numbers

### add

`phoneNumbers.add`

Add a phone number to the account with the code it received

**Risk:** `write`

```ts theme={null}
await corsair.ntfy.api.phoneNumbers.add({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `number` | `string` | Yes | E.164 phone number, e.g. +12223334444 |
| `code` | `string` | Yes | The code the verification sent |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean` | Yes | — |

***

### delete

`phoneNumbers.delete`

Remove a verified phone number from the account

**Risk:** `destructive`

```ts theme={null}
await corsair.ntfy.api.phoneNumbers.delete({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `number` | `string` | Yes | E.164 phone number, e.g. +12223334444 |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean` | Yes | — |

***

### sendVerification

`phoneNumbers.sendVerification`

Send a verification code to a phone number by SMS or call (needs a tier with calls)

**Risk:** `destructive`

```ts theme={null}
await corsair.ntfy.api.phoneNumbers.sendVerification({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `number` | `string` | Yes | E.164 phone number, e.g. +12223334444 |
| `channel` | `sms \| call` | Yes | How the code is delivered |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean` | Yes | — |

***

## Reservations

### add

`reservations.add`

Reserve a topic for the account and set what everyone else may do on it

**Risk:** `write`

```ts theme={null}
await corsair.ntfy.api.reservations.add({ topic: 'mytopic', everyone: 'deny-all' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `topic` | `string` | Yes | Topic name, \[-\_A-Za-z0-9]\{1,64} |
| `everyone` | `read-write \| read-only \| write-only \| deny-all` | Yes | What everyone else may do on the reserved topic |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean` | Yes | — |

***

### delete

`reservations.delete`

Release a reserved topic, optionally deleting its cached messages

**Risk:** `destructive`

```ts theme={null}
await corsair.ntfy.api.reservations.delete({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `topic` | `string` | Yes | Topic name, \[-\_A-Za-z0-9]\{1,64} |
| `deleteMessages` | `boolean` | No | Also delete the topic's cached messages and attachments |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean` | Yes | — |

***

## Server

### config

`server.config`

Read the server feature flags: login, signup, payments, calls, emails, reservations, web push

**Risk:** `read`

```ts theme={null}
await corsair.ntfy.api.server.config({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `base_url` | `string` | No | — |
| `app_root` | `string` | No | — |
| `enable_login` | `boolean` | No | — |
| `require_login` | `boolean` | No | — |
| `enable_signup` | `boolean` | No | — |
| `enable_payments` | `boolean` | No | — |
| `enable_calls` | `boolean` | No | — |
| `enable_emails` | `boolean` | No | — |
| `enable_reset_password` | `boolean` | No | — |
| `enable_reservations` | `boolean` | No | — |
| `enable_web_push` | `boolean` | No | — |
| `billing_contact` | `string` | No | — |
| `web_push_public_key` | `string` | No | — |
| `disallowed_topics` | `string[] \| null` | No | — |
| `config_hash` | `string` | No | — |

***

### health

`server.health`

Read server health (healthy flag and role)

**Risk:** `read`

```ts theme={null}
await corsair.ntfy.api.server.health({});
```

**Input:** *empty object*

No special rights needed, but corsair still sends the token.

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `healthy` | `boolean` | Yes | — |
| `role` | `string` | Yes | — |

***

### metrics

`server.metrics`

Read Prometheus metrics as text (servers with metrics enabled)

**Risk:** `read`

```ts theme={null}
await corsair.ntfy.api.server.metrics({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `text` | `string` | Yes | Prometheus text exposition format |

***

### ready

`server.ready`

Read whether the server is ready for traffic (load balancer check)

**Risk:** `read`

```ts theme={null}
await corsair.ntfy.api.server.ready({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ready` | `boolean` | Yes | — |
| `role` | `string` | No | — |
| `draining` | `boolean` | No | — |

***

### stats

`server.stats`

Read server-wide totals: message count and rate per second

**Risk:** `read`

```ts theme={null}
await corsair.ntfy.api.server.stats({});
```

**Input:** *empty object*

Server-wide totals, not per-account.

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `messages` | `number` | Yes | — |
| `messages_rate` | `number` | Yes | — |

***

### version

`server.version`

Read the server version, commit and build date

**Risk:** `read`

```ts theme={null}
await corsair.ntfy.api.server.version({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `version` | `string` | Yes | — |
| `commit` | `string` | No | — |
| `date` | `string` | No | — |

***

## Subscriptions

### add

`subscriptions.add`

Add a topic subscription to the account (synced to the web app and phone apps)

**Risk:** `write`

```ts theme={null}
await corsair.ntfy.api.subscriptions.add({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `baseUrl` | `string` | Yes | Server the subscription belongs to, e.g. [https://ntfy.sh](https://ntfy.sh) |
| `topic` | `string` | Yes | Topic name, \[-\_A-Za-z0-9]\{1,64} |
| `displayName` | `string \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `base_url` | `string` | Yes | — |
| `topic` | `string` | Yes | — |
| `display_name` | `string \| null` | No | — |

***

### delete

`subscriptions.delete`

Remove a synced topic subscription from the account

**Risk:** `write`

```ts theme={null}
await corsair.ntfy.api.subscriptions.delete({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `baseUrl` | `string` | Yes | — |
| `topic` | `string` | Yes | Topic name, \[-\_A-Za-z0-9]\{1,64} |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean` | Yes | — |

***

### update

`subscriptions.update`

Change a synced subscription's display name

**Risk:** `write`

```ts theme={null}
await corsair.ntfy.api.subscriptions.update({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `baseUrl` | `string` | Yes | Server the subscription belongs to, e.g. [https://ntfy.sh](https://ntfy.sh) |
| `topic` | `string` | Yes | Topic name, \[-\_A-Za-z0-9]\{1,64} |
| `displayName` | `string \| null` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `base_url` | `string` | Yes | — |
| `topic` | `string` | Yes | — |
| `display_name` | `string \| null` | No | — |

***

## Tiers

### create

`tiers.create`

Admin: create a tier with message, email, call, reservation and attachment limits

**Risk:** `write`

```ts theme={null}
await corsair.ntfy.api.tiers.create({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `code` | `string` | Yes | Tier code, e.g. pro |
| `name` | `string` | Yes | — |
| `messages_limit` | `number` | No | Messages per day |
| `messages_expiry_duration` | `number` | No | Seconds messages stay cached |
| `emails_limit` | `number` | No | — |
| `calls_limit` | `number` | No | — |
| `reservations_limit` | `number` | No | — |
| `attachment_file_size_limit` | `number` | No | Bytes |
| `attachment_total_size_limit` | `number` | No | Bytes |
| `attachment_expiry_duration` | `number` | No | Seconds |
| `attachment_bandwidth_limit` | `number` | No | Bytes per day |
| `stripe_monthly_price_id` | `string` | No | — |
| `stripe_yearly_price_id` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean` | Yes | — |

***

### delete

`tiers.delete`

Admin: delete a tier that no user is on

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.ntfy.api.tiers.delete({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `code` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean` | Yes | — |

***

### list

`tiers.list`

Admin: list tiers with their limits and user counts

**Risk:** `read`

```ts theme={null}
await corsair.ntfy.api.tiers.list({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `tiers` | `object[]` | Yes | — |

> [accordion] tiers full type
>
> ```ts theme={null}
> {
>   code: string,
>   name: string,
>   messages_limit?: number,
>   messages_expiry_duration?: number,
>   emails_limit?: number,
>   calls_limit?: number,
>   reservations_limit?: number,
>   attachment_file_size_limit?: number,
>   attachment_total_size_limit?: number,
>   attachment_expiry_duration?: number,
>   attachment_bandwidth_limit?: number,
>   stripe_monthly_price_id?: string,
>   stripe_yearly_price_id?: string,
>   id?: string,
>   users?: number
> }[]
> ```

***

### update

`tiers.update`

Admin: change a tier's limits

**Risk:** `write`

```ts theme={null}
await corsair.ntfy.api.tiers.update({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `code` | `string` | Yes | Tier code, e.g. pro |
| `name` | `string` | Yes | — |
| `messages_limit` | `number` | No | Messages per day |
| `messages_expiry_duration` | `number` | No | Seconds messages stay cached |
| `emails_limit` | `number` | No | — |
| `calls_limit` | `number` | No | — |
| `reservations_limit` | `number` | No | — |
| `attachment_file_size_limit` | `number` | No | Bytes |
| `attachment_total_size_limit` | `number` | No | Bytes |
| `attachment_expiry_duration` | `number` | No | Seconds |
| `attachment_bandwidth_limit` | `number` | No | Bytes per day |
| `stripe_monthly_price_id` | `string` | No | — |
| `stripe_yearly_price_id` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean` | Yes | — |

***

## Tokens

### create

`tokens.create`

Create an access token for the signed-in account (returned once, tk\_...)

**Risk:** `write`

```ts theme={null}
await corsair.ntfy.api.tokens.create({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `label` | `string` | No | — |
| `expires` | `number` | No | Unix seconds the token expires. Omitted, the server default applies (72 hours on ntfy 2.38); 0 means it never expires. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `token` | `string` | Yes | — |
| `label` | `string` | No | — |
| `last_access` | `number` | No | — |
| `last_origin` | `string` | No | — |
| `expires` | `number` | No | — |
| `provisioned` | `boolean` | No | — |

***

### delete

`tokens.delete`

Revoke an access token (the given one, or the one making the call)

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.ntfy.api.tokens.delete({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `token` | `string` | No | The token to delete; omit to delete the token this call is made with |

Without `token`, revokes the token the call is made with.

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean` | Yes | — |

***

### update

`tokens.update`

Change an access token's label or expiry

**Risk:** `write`

```ts theme={null}
await corsair.ntfy.api.tokens.update({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `token` | `string` | Yes | The token to change (tk\_...) |
| `label` | `string` | No | — |
| `expires` | `number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `token` | `string` | Yes | — |
| `label` | `string` | No | — |
| `last_access` | `number` | No | — |
| `last_origin` | `string` | No | — |
| `expires` | `number` | No | — |
| `provisioned` | `boolean` | No | — |

***

## Topics

### checkAuth

`topics.checkAuth`

Check that the credential may read the topic(s); 200 with success true, 401/403 otherwise

**Risk:** `read`

```ts theme={null}
await corsair.ntfy.api.topics.checkAuth({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `topic` | `string` | Yes | Topic name, or a comma-separated list of topics |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean` | Yes | — |

***

## Users

### create

`users.create`

Admin: create a user with a password or bcrypt hash and an optional tier

**Risk:** `write`

```ts theme={null}
await corsair.ntfy.api.users.create({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `username` | `string` | Yes | — |
| `password` | `string` | No | — |
| `hash` | `string` | No | A bcrypt hash instead of a password |
| `tier` | `string` | No | Tier code |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean` | Yes | — |

***

### createToken

`users.createToken`

Admin: create an access token for a user (returned once)

**Risk:** `write`

```ts theme={null}
await corsair.ntfy.api.users.createToken({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `username` | `string` | Yes | — |
| `label` | `string` | No | — |
| `expires` | `number` | No | Unix seconds; omit or 0 for never |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `username` | `string` | Yes | — |
| `token` | `string` | Yes | — |
| `label` | `string` | No | — |
| `expires` | `number` | No | — |
| `last_access` | `number` | No | — |
| `last_origin` | `string` | No | — |
| `provisioned` | `boolean` | No | — |

***

### delete

`users.delete`

Admin: delete a user and their tokens and grants

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.ntfy.api.users.delete({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `username` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean` | Yes | — |

***

### deleteToken

`users.deleteToken`

Admin: revoke one of a user's access tokens

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.ntfy.api.users.deleteToken({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `username` | `string` | Yes | — |
| `token` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean` | Yes | — |

***

### grantAccess

`users.grantAccess`

Admin: grant a user (or "\*" everyone) read/write/deny access to a topic or pattern

**Risk:** `write`

```ts theme={null}
await corsair.ntfy.api.users.grantAccess({ username: 'phil', topic: 'alerts*', permission: 'read-only' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `username` | `string` | Yes | A user, or "\*" for everyone |
| `topic` | `string` | Yes | Topic or pattern (\* wildcard) |
| `permission` | `read-write \| rw \| read-only \| read \| ro \| write-only \| write \| wo \| deny-all \| deny \| none` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean` | Yes | — |

***

### list

`users.list`

Admin: list users (or one by username) with role, tier and topic grants

**Risk:** `read`

```ts theme={null}
await corsair.ntfy.api.users.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `username` | `string` | No | Read only this user |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `users` | `object[]` | Yes | — |

> [accordion] users full type
>
> ```ts theme={null}
> {
>   username: string,
>   role: string,
>   tier?: string,
>   tier_name?: string,
>   provisioned?: boolean,
>   default_access?: string,
>   grants?: {
>     topic: string,
>     permission: string,
>     provisioned?: boolean
>   }[] | null
> }[]
> ```

***

### listTokens

`users.listTokens`

Admin: list a user's access tokens

**Risk:** `read`

```ts theme={null}
await corsair.ntfy.api.users.listTokens({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `username` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `tokens` | `object[]` | Yes | — |

> [accordion] tokens full type
>
> ```ts theme={null}
> {
>   username: string,
>   token: string,
>   label?: string,
>   expires?: number,
>   last_access?: number,
>   last_origin?: string,
>   provisioned?: boolean
> }[]
> ```

***

### resetAccess

`users.resetAccess`

Admin: remove a user's topic grants (one topic or all)

**Risk:** `destructive`

```ts theme={null}
await corsair.ntfy.api.users.resetAccess({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `username` | `string` | Yes | — |
| `topic` | `string` | No | Only this topic's grant; omit for all of the user's grants |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean` | Yes | — |

***

### resetPassword

`users.resetPassword`

Admin: make a password reset link for a user, optionally emailing it

**Risk:** `destructive`

```ts theme={null}
await corsair.ntfy.api.users.resetPassword({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `username` | `string` | Yes | — |
| `sendEmail` | `boolean` | No | Also email the link to the user's primary address |

Returns a reset link holding a token; the server needs a base URL configured. `sendEmail` also emails it.

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `link` | `string` | Yes | — |
| `email` | `string` | No | — |

***

### update

`users.update`

Admin: change a user's password or tier

**Risk:** `write`

```ts theme={null}
await corsair.ntfy.api.users.update({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `username` | `string` | Yes | — |
| `password` | `string` | No | — |
| `hash` | `string` | No | — |
| `tier` | `string` | No | Tier code; "-" removes the tier |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean` | Yes | — |

***

## Web Push

### subscribe

`webPush.subscribe`

Register or update a browser push subscription for topics

**Risk:** `write`

```ts theme={null}
await corsair.ntfy.api.webPush.subscribe({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `endpoint` | `string` | Yes | The browser push service endpoint |
| `auth` | `string` | Yes | — |
| `p256dh` | `string` | Yes | — |
| `topics` | `string[]` | Yes | Topics this browser subscription follows |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean` | Yes | — |

***

### unsubscribe

`webPush.unsubscribe`

Remove a browser push subscription

**Risk:** `write`

```ts theme={null}
await corsair.ntfy.api.webPush.unsubscribe({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `endpoint` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean` | Yes | — |

***


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.