Menu
Platform
AI
App store purchases
Database
Flags
Jobs and cron
Localization
Monitoring
Notifications
Payments
Queues
Sandboxes
Webhooks
Getting Started
Authentication
KV Store
Deploy & Infrastructure
Reference
Create a message
Sends a Message.
Sends a Message.
- Path
POST https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/messages - Scope
notify:send - Effect
write— a successful call changes state. - Collection messages
- Query
message_id,validate_only
#Request
| Field | Type | What it is |
|---|---|---|
parent | string | The parent to create in. Required. |
message_id | string | The message id, the final name segment; the server assigns one when empty. |
message | Message | The message to create; only caller-writable fields are read. Required. |
validate_only | bool | Validate and return the result without writing anything. |
#Message
| Field | Type | What it is |
|---|---|---|
name | string | orgs/{org}/projects/{project}/envs/{env}/messages/{message}. |
meta | ResourceMeta | Resource metadata. |
recipient | string | The recipient. Required. |
topic | string | The topic preferences are checked against, for example billing. Required. |
template | string | The template to render; required unless mailbox and content are set. |
data | struct | Template variables. |
channels | Channel[] | Restrict to these channels, in fallback order; empty uses the recipient's preferences. One of email, sms, push, inbox. |
send_time | timestamp | Send no earlier than this. |
delivery_deadline_time | timestamp | Deliver no later than this; a delivery still open then fails with expired. Unset retries for up to a day. The message record is kept. |
mailbox | string | Send as this mailbox (its address, display name and, for a connected mailbox, its own SMTP) instead of a verified Email Domain. |
content | MessageContent | Inline content, only with mailbox: the subject and bodies as written, not rendered from a template. |
parent_message_id | string | In-Reply-To: the Message-ID this answers, without angle brackets. |
references | string[] | The thread's Message-IDs, oldest first, without angle brackets. |
#ResourceMeta
| Field | Type | What it is |
|---|---|---|
labels | map<string, string> | Caller-writable, indexed labels (AIP-122 label rules). |
annotations | map<string, string> | Caller-writable, unindexed annotations. |
display_name | string | Caller-writable human-readable name. |
#MessageContent
| Field | Type | What it is |
|---|---|---|
subject | string | The subject. Required. |
text_body | string | The plain-text body. |
html_body | string | The HTML body. |
#Response
| Field | Type | What it is |
|---|---|---|
name | string | orgs/{org}/projects/{project}/envs/{env}/messages/{message}. |
uid | string | msg_<cell><ulid>; never reused. Output only. |
meta | ResourceMeta | Resource metadata. |
recipient | string | The recipient. Required. |
topic | string | The topic preferences are checked against, for example billing. Required. |
template | string | The template to render; required unless mailbox and content are set. |
template_version | int64 | The template version rendered; pinned at admission. Output only. |
data | struct | Template variables. |
channels | Channel[] | Restrict to these channels, in fallback order; empty uses the recipient's preferences. One of email, sms, push, inbox. |
send_time | timestamp | Send no earlier than this. |
broadcast | string | The broadcast that created it, if any. Output only. |
state | MessageState | The admission and delivery state. Output only. One of accepted, suppressed, delivering, delivered, failed, cancelled, rate_limited. |
deliveries | ChannelDelivery[] | Per-channel deliveries and their receipts. Output only. |
delivery_deadline_time | timestamp | Deliver no later than this; a delivery still open then fails with expired. Unset retries for up to a day. The message record is kept. |
state_reason | string | Why the message is in its state, for example recipient_interval for RATE_LIMITED or suppressed for SUPPRESSED. Output only. |
capture | MessageCapture | A test recipient's rendered content; empty for every other recipient. Output only. |
mailbox | string | Send as this mailbox (its address, display name and, for a connected mailbox, its own SMTP) instead of a verified Email Domain. |
content | MessageContent | Inline content, only with mailbox: the subject and bodies as written, not rendered from a template. |
parent_message_id | string | In-Reply-To: the Message-ID this answers, without angle brackets. |
references | string[] | The thread's Message-IDs, oldest first, without angle brackets. |
email_message_id | string | The Message-ID Notify gave the email, without angle brackets. Output only. |
#ResourceMeta
| Field | Type | What it is |
|---|---|---|
generation | int64 | Increases by one on every change to spec. Output only. |
etag | string | Strong ETag (AIP-154): changes on any change to spec, status, or metadata. Send it back as If-Match or etag to make Update and Delete conditional; a mismatch fails with ABORTED / 409 ETAG_MISMATCH. Output only. |
create_time | timestamp | When the Resource was created. Output only. |
update_time | timestamp | When the Resource last changed. Output only. |
delete_time | timestamp | Set while the Resource is being deleted. Output only. |
labels | map<string, string> | Caller-writable, indexed labels (AIP-122 label rules). |
annotations | map<string, string> | Caller-writable, unindexed annotations. |
display_name | string | Caller-writable human-readable name. |
creator | string | The principal that created the Resource. Output only. |
#ChannelDelivery
| Field | Type | What it is |
|---|---|---|
channel | Channel | The channel. Output only. One of email, sms, push, inbox. |
masked_address | string | The address, masked. Output only. |
state | ChannelDeliveryState | The delivery state. Output only. One of pending, sent, delivered, bounced, failed, skipped, captured, suppressed. |
provider_receipt | string | The provider's acceptance id. Output only. |
receipt_time | timestamp | When the provider receipt closed the delivery. Output only. |
error_code | string | A machine-readable failure code. Output only. |
provider_response | string | The provider's last reply, for example 250 2.0.0 queued as …. Output only. |
attempts | int32 | Hand-off attempts so far. Output only. |
#MessageCapture
| Field | Type | What it is |
|---|---|---|
subject | string | The email subject. Output only. |
text_body | string | The plain-text body. Output only. |
html_body | string | The HTML body. Output only. |
links | string[] | Every link in the bodies, in order. Output only. |
#MessageContent
| Field | Type | What it is |
|---|---|---|
subject | string | The subject. Required. |
text_body | string | The plain-text body. |
html_body | string | The HTML body. |
#Errors
UNAUTHENTICATED— No valid key or token was presented.PERMISSION_DENIED— The key lacks the method's permission.UNKNOWN_FIELD— The request has a field the schema does not know.INVALID_FIELD— A field failed validation.RESOURCE_ALREADY_EXISTS— A Resource with this name exists.IDEMPOTENCY_KEY_REUSED— An Idempotency-Key was reused with another body.IDEMPOTENCY_IN_PROGRESS— The first call with this Idempotency-Key is still running.PLAN_LIMIT_REACHED— The plan's limit is reached.RATE_LIMITED— The rate limit is reached; see Retry-After.INVALID_STATE— The Resource is in a state that forbids the call.
Every error arrives in the body Errors describes.
#Examples
curl -X POST "https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/messages" \
-H "Authorization: Bearer $SYLPHX_API_KEY" \
-H "Content-Type: application/json" \
-d '{"recipient":"…","topic":"…"}'