Skip to content

Commit d131d8f

Browse files
authored
Merge branch 'main' into worktree-swml-transcribe-docs
2 parents 24f51cc + ffedcee commit d131d8f

4 files changed

Lines changed: 90 additions & 0 deletions

File tree

fern/apis/signalwire-rest/openapi.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36532,6 +36532,11 @@ components:
3653236532
examples:
3653336533
- - notification
3653436534
- order-confirmation
36535+
status_callback:
36536+
type: string
36537+
description: URL to receive delivery status callbacks for the outbound message (e.g., `queued`, `sent`, `delivered`, `failed`). Not set if not specified. The callback uses the [message status callback payload](/docs/apis/rest/messages/webhooks/message-status-callback).
36538+
examples:
36539+
- https://example.com/message_status
3653536540
body:
3653636541
type: string
3653736542
description: Required if `media` is not present. The body of the SMS message.
@@ -36570,6 +36575,11 @@ components:
3657036575
examples:
3657136576
- - notification
3657236577
- order-confirmation
36578+
status_callback:
36579+
type: string
36580+
description: URL to receive delivery status callbacks for the outbound message (e.g., `queued`, `sent`, `delivered`, `failed`). Not set if not specified. The callback uses the [message status callback payload](/docs/apis/rest/messages/webhooks/message-status-callback).
36581+
examples:
36582+
- https://example.com/message_status
3657336583
media:
3657436584
type: array
3657536585
items:

fern/products/swml/pages/reference/methods/calling/send_sms.mdx

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ The `send_sms` object accepts the following properties depending on the message
4646
</ParamField>
4747

4848

49+
<ParamField path="send_sms.status_callback" type="string" toc={true}>
50+
URL to receive delivery status callbacks for the outbound message (e.g., `queued`, `sent`, `delivered`, `failed`). Default is not set. See [Status callbacks](#status-callbacks) below.
51+
</ParamField>
52+
53+
4954
</Tab>
5055
<Tab title="MMS">
5156

@@ -79,6 +84,11 @@ The `send_sms` object accepts the following properties depending on the message
7984
</ParamField>
8085

8186

87+
<ParamField path="send_sms.status_callback" type="string" toc={true}>
88+
URL to receive delivery status callbacks for the outbound message (e.g., `queued`, `sent`, `delivered`, `failed`). Default is not set. See [Status callbacks](#status-callbacks) below.
89+
</ParamField>
90+
91+
8292
</Tab>
8393
</Tabs>
8494

@@ -88,6 +98,19 @@ Set by the method:
8898

8999
- **send_sms_result:** (out) `success` | `failed`.
90100

101+
## **Status callbacks**
102+
103+
When `status_callback` is set, SignalWire sends an HTTP `POST` to that URL each time the outbound
104+
message transitions to a new state. Callback delivery is independent of SWML execution: the document
105+
continues as soon as the message is accepted, and delivery-state callbacks fire afterwards.
106+
107+
The callback uses the same payload as other outbound messages sent through SignalWire:
108+
109+
<WebhookPayloadSnippet webhook="messageStatusCallback" />
110+
111+
See the [Message status callback](/docs/apis/rest/messages/webhooks/message-status-callback)
112+
webhook page for the full field reference and the list of possible `status` values.
113+
91114
## **Examples**
92115

93116
<Tabs>
@@ -168,5 +191,44 @@ sections:
168191
</CodeBlock>
169192
</CodeBlocks>
170193

194+
</Tab>
195+
<Tab title="Status callbacks">
196+
197+
Send a message and receive delivery status updates at a callback URL:
198+
199+
<CodeBlocks>
200+
<CodeBlock title="YAML">
201+
```yaml
202+
version: 1.0.0
203+
sections:
204+
main:
205+
- send_sms:
206+
from_number: "+155512312345"
207+
to_number: "+15555554321"
208+
body: "Hi, I hope you're well."
209+
status_callback: "https://example.com/message_status"
210+
```
211+
</CodeBlock>
212+
<CodeBlock title="JSON">
213+
```json
214+
{
215+
"version": "1.0.0",
216+
"sections": {
217+
"main": [
218+
{
219+
"send_sms": {
220+
"from_number": "+155512312345",
221+
"to_number": "+15555554321",
222+
"body": "Hi, I hope you're well.",
223+
"status_callback": "https://example.com/message_status"
224+
}
225+
}
226+
]
227+
}
228+
}
229+
```
230+
</CodeBlock>
231+
</CodeBlocks>
232+
171233
</Tab>
172234
</Tabs>

specs/swml/calling/Methods/send_sms/main.tsp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ model SMSBase {
2121
@doc("Array of tags to associate with the message to facilitate log searches.")
2222
@example(#["notification", "order-confirmation"])
2323
tags?: string[];
24+
25+
@doc("URL to receive delivery status callbacks for the outbound message (e.g., `queued`, `sent`, `delivered`, `failed`). Not set if not specified. The callback uses the [message status callback payload](/docs/apis/rest/messages/webhooks/message-status-callback).")
26+
@example("https://example.com/message_status")
27+
status_callback?: string;
2428
}
2529

2630
@summary("SMS")

specs/swml/calling/tsp-output/@typespec/json-schema/SWMLObject.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4363,6 +4363,13 @@
43634363
],
43644364
"description": "Array of tags to associate with the message to facilitate log searches."
43654365
},
4366+
"status_callback": {
4367+
"type": "string",
4368+
"examples": [
4369+
"https://example.com/message_status"
4370+
],
4371+
"description": "URL to receive delivery status callbacks for the outbound message (e.g., `queued`, `sent`, `delivered`, `failed`). Not set if not specified. The callback uses the [message status callback payload](/docs/apis/rest/messages/webhooks/message-status-callback)."
4372+
},
43664373
"body": {
43674374
"type": "string",
43684375
"examples": [
@@ -4418,6 +4425,13 @@
44184425
],
44194426
"description": "Array of tags to associate with the message to facilitate log searches."
44204427
},
4428+
"status_callback": {
4429+
"type": "string",
4430+
"examples": [
4431+
"https://example.com/message_status"
4432+
],
4433+
"description": "URL to receive delivery status callbacks for the outbound message (e.g., `queued`, `sent`, `delivered`, `failed`). Not set if not specified. The callback uses the [message status callback payload](/docs/apis/rest/messages/webhooks/message-status-callback)."
4434+
},
44214435
"media": {
44224436
"type": "array",
44234437
"items": {

0 commit comments

Comments
 (0)