# Send notify

URL: https://docs.hanzo.ai/docs/openapi/notify/post-notify-send

> Delivers one transactional message by email or SMS through the caller org's own provider credential.

`POST /v1/notify/send`

> [Notify →](https://docs.hanzo.ai/docs/openapi/notify) · [All API references →](https://docs.hanzo.ai/docs/openapi) · [Get started →](https://docs.hanzo.ai/docs/guides)

|               |                                        |
| ------------- | -------------------------------------- |
| **Address**   | `https://api.hanzo.ai/v1/notify/send`  |
| **Method**    | `POST`                                 |
| **Operation** | `post_notify_send`                     |
| **Auth**      | `Authorization: Bearer $HANZO_API_KEY` |

Delivers one transactional message by email or SMS through the caller
org's own provider credential.

The channel comes from the body — sms or email — and the provider credential is
read from KMS at orgs/\<org>/notify/\<service>/\<key>, never from the environment.
The org is the validated principal's, never a client-supplied value, so a caller
can only ever send as their own tenant; an unauthenticated caller gets 401.
Naming no provider picks the one whose credentials are actually configured
(Twilio, then Plivo for SMS; Twilio Email, then SMTP for email) and fails closed
when none is. Delivery is synchronous and per recipient: one recipient answers
the bare {message\_id,status} outcome, several answer the {items:\[…]} envelope. A
terminal provider failure is a 200 whose status is failed with the reason in
error, never a transport error. sync=true is REQUIRED — an async dispatch
answers 503, because the queue plane that would run it is owned elsewhere. The
message body wins verbatim when present; otherwise template\_id (or the event
name) selects a built-in template rendered against template\_vars.

## Request

9 fields, body `application/json` (required).

| Field           | In   | Type      | Required | Description                                                                                                                                                           |
| --------------- | ---- | --------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `body`          | body | string    | —        | Body is the message text, sent verbatim when present — the no-template path.                                                                                          |
| `channel`       | body | string    | —        | Channel selects the delivery channel, sms or email.                                                                                                                   |
| `event`         | body | string    | —        | Event is the event name, which doubles as the template id when TemplateID is empty — the IAM OTP path sends event=iam.otp\_sent and nothing else.                     |
| `provider`      | body | string    | —        | Provider pins a provider service name (twilio, plivo, twilio\_email, mail).                                                                                           |
| `subject`       | body | string    | —        | Subject is the message subject, carried on the email channel only.                                                                                                    |
| `sync`          | body | string    | —        | Sync must be exactly "true": delivery here is synchronous, and anything else answers 503 because the queue plane that would run an async dispatch is owned elsewhere. |
| `template_id`   | body | string    | —        | TemplateID selects a built-in template when Body is empty.                                                                                                            |
| `template_vars` | body | any       | —        | TemplateVars carries the values the selected template renders against, as a raw JSON object.                                                                          |
| `to`            | body | string\[] | —        | To is the destination address per recipient — a phone number for sms, an email address for email.                                                                     |

## Response

| Status    | Body            | Meaning |
| --------- | --------------- | ------- |
| `200`     |                 | ok      |
| `default` | problem-details | refused |

`200` body — 1 field.

| Field    | In   | Type | Always | Description |
| -------- | ---- | ---- | ------ | ----------- |
| `(body)` | body | any  | yes    |             |

Failure carries the platform error shape — see [Errors](https://docs.hanzo.ai/docs/errors).

## Examples

**CLI**

```bash
hanzo notify send create
```

**SDK**

**.ts**

```ts
import { Configuration, NotifyApi } from 'hanzoai';

const api = new NotifyApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.postNotifySend({ body: "<body>", channel: "<channel>" });
```

**.py**

```python
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import NotifyApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = NotifyApi(client).post_notify_send(body="<body>", channel="<channel>")
```

**.go**

```go
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.NotifyAPI.PostNotifySend(context.Background()).Execute()
if err != nil {
	return err
}
```

**.rs**

```rust
use hanzo_client::apis::{configuration::Configuration, notify_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = notify_api::post_notify_send(&cfg, Default::default()).await?;
```

**.java**

```java
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.NotifyApi;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new NotifyApi(client).postNotifySend();
```

**HTTP**

```bash
curl -X POST https://api.hanzo.ai/v1/notify/send \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "body": "<body>",
       "channel": "<channel>"
     }'
```

**MCP**

MCP reaches **notify** through the `notify` tool, which names its 4 operations with its own verbs — this one among them, under a name only MCP declares. `describe` explains any of them:

```bash
curl -X POST https://api.hanzo.ai/v1/mcp \
  -H "Content-Type: application/json" \
  -d '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "tools/call",
       "params": {
         "name": "describe",
         "arguments": {
           "op": "get_notify_health"
         }
       }
     }'
```

---

[Notify API](https://docs.hanzo.ai/docs/openapi/notify) · [All Hanzo APIs](https://docs.hanzo.ai/docs/openapi) · [Interactive reference](https://docs.hanzo.ai/docs/openapi/reference)
