@ingenx-io/valets-schema-mcp-server 0.1.10 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/data/docs/collections/firestore-paths.md +20 -0
  2. package/data/docs/enums/attention-status.md +1 -1
  3. package/data/docs/enums/booking-status.md +1 -1
  4. package/data/docs/enums/customer-payment-status.md +1 -1
  5. package/data/docs/enums/customer-payment-target-type.md +1 -1
  6. package/data/docs/enums/delivery-type.md +1 -1
  7. package/data/docs/enums/deployment-link-type.md +1 -1
  8. package/data/docs/enums/event-status.md +1 -1
  9. package/data/docs/enums/fulfillment-status.md +1 -1
  10. package/data/docs/enums/loyalty-transaction-type.md +1 -1
  11. package/data/docs/enums/order-status.md +1 -1
  12. package/data/docs/enums/outbound-message-format.md +22 -0
  13. package/data/docs/enums/outbound-message-purpose.md +24 -0
  14. package/data/docs/enums/outbound-message-status.md +4 -4
  15. package/data/docs/enums/payment-method.md +2 -2
  16. package/data/docs/enums/payment-proof-status.md +2 -2
  17. package/data/docs/enums/payment-status.md +2 -2
  18. package/data/docs/enums/pending-issue.md +2 -2
  19. package/data/docs/enums/return-status.md +2 -2
  20. package/data/docs/enums/session-status.md +2 -2
  21. package/data/docs/enums/site-status.md +2 -2
  22. package/data/docs/enums/stocktake-frequency.md +2 -2
  23. package/data/docs/enums/stocktake-item-status.md +2 -2
  24. package/data/docs/enums/stocktake-status.md +2 -2
  25. package/data/docs/enums/ticket-status.md +2 -2
  26. package/data/docs/enums/waba-label.md +2 -2
  27. package/data/docs/enums/whatsapp-template-status.md +26 -0
  28. package/data/docs/index.md +9 -5
  29. package/data/docs/models/allowed-user.md +1 -1
  30. package/data/docs/models/analytics-backfill.md +1 -1
  31. package/data/docs/models/analytics-daily.md +1 -1
  32. package/data/docs/models/analytics-event.md +1 -1
  33. package/data/docs/models/analytics-hourly.md +1 -1
  34. package/data/docs/models/booking-version.md +1 -1
  35. package/data/docs/models/booking.md +1 -1
  36. package/data/docs/models/customer-payment-allocation.md +1 -1
  37. package/data/docs/models/customer-payment.md +1 -1
  38. package/data/docs/models/customer.md +1 -1
  39. package/data/docs/models/event.md +1 -1
  40. package/data/docs/models/loyalty-config.md +1 -1
  41. package/data/docs/models/loyalty-reward.md +1 -1
  42. package/data/docs/models/loyalty-status.md +1 -1
  43. package/data/docs/models/loyalty-transaction.md +1 -1
  44. package/data/docs/models/magic-link-request.md +1 -1
  45. package/data/docs/models/metrics-current.md +1 -1
  46. package/data/docs/models/metrics-daily.md +1 -1
  47. package/data/docs/models/metrics-monthly.md +1 -1
  48. package/data/docs/models/order-item.md +1 -1
  49. package/data/docs/models/order.md +1 -1
  50. package/data/docs/models/sale.md +1 -1
  51. package/data/docs/models/site-payment.md +1 -1
  52. package/data/docs/models/site.md +1 -1
  53. package/data/docs/models/stocktake-item.md +1 -1
  54. package/data/docs/models/stocktake.md +1 -1
  55. package/data/docs/models/ticket.md +1 -1
  56. package/data/docs/models/whatsapp-inbound-message.md +1 -1
  57. package/data/docs/models/whatsapp-outbound-lifecycle-event.md +310 -0
  58. package/data/docs/models/whatsapp-outbound-message.md +395 -172
  59. package/data/docs/models/whatsapp-template.md +177 -0
  60. package/data/static/llms.txt +110 -32
  61. package/data/static/openapi.yaml +274 -66
  62. package/data/static/schemas.json +354 -69
  63. package/package.json +1 -1
  64. package/data/docs/enums/outbound-message-kind.md +0 -23
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  title: "WhatsappOutboundMessage"
3
3
  sidebar_label: "WhatsappOutboundMessage"
4
- sidebar_position: 29
4
+ sidebar_position: 30
5
5
  ---
6
6
 
7
7
  # WhatsappOutboundMessage
@@ -12,21 +12,25 @@ sidebar_position: 29
12
12
  ```json
13
13
  {
14
14
  "id": null,
15
- "messageId": "mes_ref123",
16
15
  "to": "to",
17
16
  "waba": "waba",
18
17
  "wabaId": "wab_ref123",
19
- "sentAt": "sentAt",
20
- "phoneNumberId": "pho_ref123",
21
18
  "kind": "kind",
22
- "templateName": "templateName",
23
- "status": "status",
24
- "contactWaId": null,
25
- "appId": null,
19
+ "text": null,
20
+ "template": null,
21
+ "purpose": "purpose",
26
22
  "orderUuid": null,
27
- "statusUpdatedAt": "statusUpdatedAt",
28
- "failureCode": null,
29
- "failureErrors": null
23
+ "sentBy": {
24
+ "uid": "user_u8x92kqm"
25
+ },
26
+ "createdAt": "createdAt",
27
+ "status": "status",
28
+ "wamid": null,
29
+ "error": null,
30
+ "sentAt": "sentAt",
31
+ "deliveredAt": "deliveredAt",
32
+ "readAt": "readAt",
33
+ "failedAt": "failedAt"
30
34
  }
31
35
  ```
32
36
 
@@ -34,26 +38,41 @@ sidebar_position: 29
34
38
 
35
39
 
36
40
  - [1. Property `id`](#id)
37
- - [2. Property `messageId`](#messageId)
38
- - [3. Property `to`](#to)
39
- - [4. Property `waba`](#waba)
40
- - [5. Property `wabaId`](#wabaId)
41
- - [6. Property `sentAt`](#sentAt)
42
- - [6.1. Property `_seconds`](#sentAt__seconds)
43
- - [6.2. Property `_nanoseconds`](#sentAt__nanoseconds)
44
- - [7. Property `phoneNumberId`](#phoneNumberId)
45
- - [8. Property `kind`](#kind)
46
- - [9. Property `templateName`](#templateName)
47
- - [10. Property `status`](#status)
48
- - [11. Property `contactWaId`](#contactWaId)
49
- - [12. Property `appId`](#appId)
50
- - [13. Property `orderUuid`](#orderUuid)
51
- - [14. Property `statusUpdatedAt`](#statusUpdatedAt)
52
- - [14.1. Property `firestore-timestamp`](#statusUpdatedAt_anyOf_i0)
53
- - [14.2. Property `item 1`](#statusUpdatedAt_anyOf_i1)
54
- - [15. Property `failureCode`](#failureCode)
55
- - [16. Property `failureErrors`](#failureErrors)
56
- - [16.1. failureErrors items](#failureErrors_items)
41
+ - [2. Property `to`](#to)
42
+ - [3. Property `waba`](#waba)
43
+ - [4. Property `wabaId`](#wabaId)
44
+ - [5. Property `kind`](#kind)
45
+ - [6. Property `text`](#text)
46
+ - [7. Property `template`](#template)
47
+ - [7.1. Property `name`](#template_name)
48
+ - [7.2. Property `language`](#template_language)
49
+ - [7.3. Property `variables`](#template_variables)
50
+ - [7.3.1. Property `additionalProperties`](#template_variables_additionalProperties)
51
+ - [8. Property `purpose`](#purpose)
52
+ - [8.1. Property `outbound-message-purpose`](#purpose_anyOf_i0)
53
+ - [8.2. Property `item 1`](#purpose_anyOf_i1)
54
+ - [9. Property `orderUuid`](#orderUuid)
55
+ - [10. Property `sentBy`](#sentBy)
56
+ - [10.1. Property `uid`](#sentBy_uid)
57
+ - [10.2. Property `email`](#sentBy_email)
58
+ - [11. Property `createdAt`](#createdAt)
59
+ - [11.1. Property `_seconds`](#createdAt__seconds)
60
+ - [11.2. Property `_nanoseconds`](#createdAt__nanoseconds)
61
+ - [12. Property `status`](#status)
62
+ - [13. Property `wamid`](#wamid)
63
+ - [14. Property `error`](#error)
64
+ - [15. Property `sentAt`](#sentAt)
65
+ - [15.1. Property `firestore-timestamp`](#sentAt_anyOf_i0)
66
+ - [15.2. Property `item 1`](#sentAt_anyOf_i1)
67
+ - [16. Property `deliveredAt`](#deliveredAt)
68
+ - [16.1. Property `firestore-timestamp`](#deliveredAt_anyOf_i0)
69
+ - [16.2. Property `item 1`](#deliveredAt_anyOf_i1)
70
+ - [17. Property `readAt`](#readAt)
71
+ - [17.1. Property `firestore-timestamp`](#readAt_anyOf_i0)
72
+ - [17.2. Property `item 1`](#readAt_anyOf_i1)
73
+ - [18. Property `failedAt`](#failedAt)
74
+ - [18.1. Property `firestore-timestamp`](#failedAt_anyOf_i0)
75
+ - [18.2. Property `item 1`](#failedAt_anyOf_i1)
57
76
 
58
77
  | | |
59
78
  | ------------------------- | --------------------------------------- |
@@ -62,26 +81,28 @@ sidebar_position: 29
62
81
  | **Additional properties** | Not allowed |
63
82
  | **Defined in** | #/definitions/whatsapp-outbound-message |
64
83
 
65
- **Description:** WhatsappOutboundMessage — outbound WhatsApp message persisted at send time (GH#38). Collection: whatsapp_outbound_messages/\{docId\}. Top-level scope. Symmetric counterpart to WhatsappInboundMessage (GH#36).
66
-
67
- | Property | Pattern | Type | Deprecated | Definition | Title/Description |
68
- | -------------------------------------- | ------- | ---------------- | ---------- | ---------------------------------------- | ----------------------------------------------------------------------------------- |
69
- | - [id](#id ) | No | string or null | No | - | (Read-only) Firestore document ID — wamid on success, generated UUID on failure. |
70
- | + [messageId](#messageId ) | No | string | No | - | (Immutable) WhatsApp message ID (wamid) on success; generated UUID on send failure. |
71
- | + [to](#to ) | No | string | No | - | (Immutable) Recipient phone number in E.164 format. Mirrors inbound \`from\`. |
72
- | + [waba](#waba ) | No | enum (of string) | No | In #/definitions/waba-label | (Immutable) WABA that sent the message. Mirrors inbound \`waba\`. |
73
- | + [wabaId](#wabaId ) | No | string | No | - | (Immutable) Meta WABA ID. Mirrors inbound \`wabaId\`. |
74
- | + [sentAt](#sentAt ) | No | object | No | In #/definitions/firestore-timestamp | (Read-only) Server-side send timestamp. Mirrors inbound \`receivedAt\`. |
75
- | + [phoneNumberId](#phoneNumberId ) | No | string | No | - | (Immutable) Meta phone number ID used for the send (specific line within the WABA). |
76
- | + [kind](#kind ) | No | enum (of string) | No | In #/definitions/outbound-message-kind | (Immutable) Message kind. |
77
- | + [templateName](#templateName ) | No | string | No | - | (Immutable) WhatsApp template name used for the send. |
78
- | + [status](#status ) | No | enum (of string) | No | In #/definitions/outbound-message-status | Delivery status. Updated in-place by Meta delivery callbacks. |
79
- | - [contactWaId](#contactWaId ) | No | string or null | No | - | Normalized wa_id returned by Meta on success. May differ from \`to\`. |
80
- | - [appId](#appId ) | No | string or null | No | - | Tenant appId when applicable. |
81
- | - [orderUuid](#orderUuid ) | No | string or null | No | - | Order reference. Present on review_request messages only. |
82
- | - [statusUpdatedAt](#statusUpdatedAt ) | No | Combination | No | - | Timestamp of the last status update from a Meta delivery callback. |
83
- | - [failureCode](#failureCode ) | No | integer or null | No | - | Meta error code. Present on failed sends only. |
84
- | - [failureErrors](#failureErrors ) | No | array or null | No | - | Raw Meta error objects. Present on failed sends only. |
84
+ **Description:** WhatsappOutboundMessage — Firestore-as-the-bus outbox doc (GH#43). Collection: whatsapp_outbound_messages/\{docId\}. Top-level scope; mirrors WhatsappInboundMessage. Dashboard enqueues `queued`; backend sends and owns the lifecycle.
85
+
86
+ | Property | Pattern | Type | Deprecated | Definition | Title/Description |
87
+ | ------------------------------ | ------- | ---------------- | ---------- | ---------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
88
+ | - [id](#id ) | No | string or null | No | - | (Read-only) Firestore document ID — auto-generated at enqueue time. |
89
+ | + [to](#to ) | No | string | No | - | (Immutable) Recipient phone number in E.164 format. Must match the inbound \`from\` for the same conversation. |
90
+ | + [waba](#waba ) | No | enum (of string) | No | In #/definitions/waba-label | (Immutable) WABA that will send the message. Mirrors inbound \`waba\`. |
91
+ | + [wabaId](#wabaId ) | No | string | No | - | (Immutable) Meta WABA ID. Mirrors inbound \`wabaId\`. |
92
+ | + [kind](#kind ) | No | enum (of string) | No | In #/definitions/outbound-message-format | (Immutable) Message format: \`text\` or \`template\`. Set \`text\` xor \`template\` to match. |
93
+ | - [text](#text ) | No | string or null | No | - | Free-form message body. Present only when kind=text. |
94
+ | - [template](#template ) | No | object or null | No | - | Template send payload. Present only when kind=template. |
95
+ | - [purpose](#purpose ) | No | Combination | No | - | Business purpose (otp \| review_request \| adhoc \| conversational). Optional. |
96
+ | - [orderUuid](#orderUuid ) | No | string or null | No | - | Order reference. Present on review_request messages. |
97
+ | + [sentBy](#sentBy ) | No | object | No | - | (Immutable) Dashboard actor who enqueued the message. |
98
+ | + [createdAt](#createdAt ) | No | object | No | In #/definitions/firestore-timestamp | (Immutable) Enqueue timestamp, set by the dashboard at create. |
99
+ | + [status](#status ) | No | enum (of string) | No | In #/definitions/outbound-message-status | Delivery status. Created as \`queued\` by the dashboard; updated in place by the backend. |
100
+ | - [wamid](#wamid ) | No | string or null | No | - | (Read-only) WhatsApp message ID returned by Meta once the backend sends. Absent while queued or on failure. |
101
+ | - [error](#error ) | No | string or null | No | - | (Read-only) Human-readable failure reason. Present on status=failed. Raw Meta error detail lives in the lifecycle_events subcollection. |
102
+ | - [sentAt](#sentAt ) | No | Combination | No | - | (Read-only) When the backend sent the message to Meta. |
103
+ | - [deliveredAt](#deliveredAt ) | No | Combination | No | - | (Read-only) When Meta reported delivery. |
104
+ | - [readAt](#readAt ) | No | Combination | No | - | (Read-only) When Meta reported the recipient read the message. |
105
+ | - [failedAt](#failedAt ) | No | Combination | No | - | (Read-only) When the send failed. |
85
106
 
86
107
  ## <a name="id"></a>1. Property `id`
87
108
 
@@ -90,39 +111,26 @@ sidebar_position: 29
90
111
  | **Type** | `string or null` |
91
112
  | **Required** | No |
92
113
 
93
- **Description:** (Read-only) Firestore document ID — wamid on success, generated UUID on failure.
114
+ **Description:** (Read-only) Firestore document ID — auto-generated at enqueue time.
94
115
 
95
116
  :::warning Server-set
96
117
  Do not include in write requests. This field is set exclusively by the server (Firestore trigger or Admin SDK). Clients that send it will have the value silently ignored or may receive a validation error.
97
118
  :::
98
119
 
99
- ## <a name="messageId"></a>2. Property `messageId`
100
-
101
- | | |
102
- | ------------ | -------- |
103
- | **Type** | `string` |
104
- | **Required** | Yes |
105
-
106
- **Description:** (Immutable) WhatsApp message ID (wamid) on success; generated UUID on send failure.
107
-
108
- :::info Immutable
109
- Set at creation only. This field cannot be modified after the document is created. Include it in CREATE payloads; omit it (or leave unchanged) in UPDATE payloads.
110
- :::
111
-
112
- ## <a name="to"></a>3. Property `to`
120
+ ## <a name="to"></a>2. Property `to`
113
121
 
114
122
  | | |
115
123
  | ------------ | -------- |
116
124
  | **Type** | `string` |
117
125
  | **Required** | Yes |
118
126
 
119
- **Description:** (Immutable) Recipient phone number in E.164 format. Mirrors inbound `from`.
127
+ **Description:** (Immutable) Recipient phone number in E.164 format. Must match the inbound `from` for the same conversation.
120
128
 
121
129
  :::info Immutable
122
130
  Set at creation only. This field cannot be modified after the document is created. Include it in CREATE payloads; omit it (or leave unchanged) in UPDATE payloads.
123
131
  :::
124
132
 
125
- ## <a name="waba"></a>4. Property `waba`
133
+ ## <a name="waba"></a>3. Property `waba`
126
134
 
127
135
  | | |
128
136
  | -------------- | ------------------------ |
@@ -130,7 +138,7 @@ Set at creation only. This field cannot be modified after the document is create
130
138
  | **Required** | Yes |
131
139
  | **Defined in** | #/definitions/waba-label |
132
140
 
133
- **Description:** (Immutable) WABA that sent the message. Mirrors inbound `waba`.
141
+ **Description:** (Immutable) WABA that will send the message. Mirrors inbound `waba`.
134
142
 
135
143
  Must be one of:
136
144
  * "cmz"
@@ -140,7 +148,7 @@ Must be one of:
140
148
  Set at creation only. This field cannot be modified after the document is created. Include it in CREATE payloads; omit it (or leave unchanged) in UPDATE payloads.
141
149
  :::
142
150
 
143
- ## <a name="wabaId"></a>5. Property `wabaId`
151
+ ## <a name="wabaId"></a>4. Property `wabaId`
144
152
 
145
153
  | | |
146
154
  | ------------ | -------- |
@@ -153,96 +161,236 @@ Set at creation only. This field cannot be modified after the document is create
153
161
  Set at creation only. This field cannot be modified after the document is created. Include it in CREATE payloads; omit it (or leave unchanged) in UPDATE payloads.
154
162
  :::
155
163
 
156
- ## <a name="sentAt"></a>6. Property `sentAt`
164
+ ## <a name="kind"></a>5. Property `kind`
157
165
 
158
- | | |
159
- | ------------------------- | --------------------------------- |
160
- | **Type** | `object` |
161
- | **Required** | Yes |
162
- | **Additional properties** | Not allowed |
163
- | **Defined in** | #/definitions/firestore-timestamp |
166
+ | | |
167
+ | -------------- | ------------------------------------- |
168
+ | **Type** | `enum (of string)` |
169
+ | **Required** | Yes |
170
+ | **Defined in** | #/definitions/outbound-message-format |
164
171
 
165
- **Description:** (Read-only) Server-side send timestamp. Mirrors inbound `receivedAt`.
172
+ **Description:** (Immutable) Message format: `text` or `template`. Set `text` xor `template` to match.
166
173
 
167
- | Property | Pattern | Type | Deprecated | Definition | Title/Description |
168
- | --------------------------------------- | ------- | ------- | ---------- | ---------- | ----------------- |
169
- | + [_seconds](#sentAt__seconds ) | No | integer | No | - | - |
170
- | + [_nanoseconds](#sentAt__nanoseconds ) | No | integer | No | - | - |
174
+ Must be one of:
175
+ * "text"
176
+ * "template"
171
177
 
172
- ### <a name="sentAt__seconds"></a>6.1. Property `_seconds`
178
+ :::info Immutable
179
+ Set at creation only. This field cannot be modified after the document is created. Include it in CREATE payloads; omit it (or leave unchanged) in UPDATE payloads.
180
+ :::
173
181
 
174
- | | |
175
- | ------------ | --------- |
176
- | **Type** | `integer` |
177
- | **Required** | Yes |
182
+ ## <a name="text"></a>6. Property `text`
178
183
 
179
- | Restrictions | |
180
- | ------------ | ---------------------- |
181
- | **Minimum** | &ge; -9007199254740991 |
182
- | **Maximum** | &le; 9007199254740991 |
184
+ | | |
185
+ | ------------ | ---------------- |
186
+ | **Type** | `string or null` |
187
+ | **Required** | No |
183
188
 
184
- ### <a name="sentAt__nanoseconds"></a>6.2. Property `_nanoseconds`
189
+ **Description:** Free-form message body. Present only when kind=text.
185
190
 
186
- | | |
187
- | ------------ | --------- |
188
- | **Type** | `integer` |
189
- | **Required** | Yes |
191
+ :::tip When to set
192
+ Set only when kind === "text" — the free-form message body.
193
+ :::
190
194
 
191
- | Restrictions | |
192
- | ------------ | ---------------------- |
193
- | **Minimum** | &ge; -9007199254740991 |
194
- | **Maximum** | &le; 9007199254740991 |
195
+ ## <a name="template"></a>7. Property `template`
195
196
 
196
- :::warning Server-set
197
- Do not include in write requests. This field is set exclusively by the server (Firestore trigger or Admin SDK). Clients that send it will have the value silently ignored or may receive a validation error.
198
- :::
197
+ | | |
198
+ | ------------ | ---------------- |
199
+ | **Type** | `object or null` |
200
+ | **Required** | No |
199
201
 
200
- ## <a name="phoneNumberId"></a>7. Property `phoneNumberId`
202
+ **Description:** Template send payload. Present only when kind=template.
203
+
204
+ | Property | Pattern | Type | Deprecated | Definition | Title/Description |
205
+ | ----------------------------------- | ------- | ------ | ---------- | ---------- | ------------------------------------------------------------------------------ |
206
+ | + [name](#template_name ) | No | string | No | - | WhatsApp template name (must exist and be APPROVED in whatsapp_templates). |
207
+ | + [language](#template_language ) | No | string | No | - | Template language/locale code (e.g. "en", "fr"). |
208
+ | - [variables](#template_variables ) | No | object | No | - | Template variable values, keyed by the variable name declared on the template. |
209
+
210
+ ### <a name="template_name"></a>7.1. Property `name`
201
211
 
202
212
  | | |
203
213
  | ------------ | -------- |
204
214
  | **Type** | `string` |
205
215
  | **Required** | Yes |
206
216
 
207
- **Description:** (Immutable) Meta phone number ID used for the send (specific line within the WABA).
217
+ **Description:** WhatsApp template name (must exist and be APPROVED in whatsapp_templates).
208
218
 
209
- :::info Immutable
210
- Set at creation only. This field cannot be modified after the document is created. Include it in CREATE payloads; omit it (or leave unchanged) in UPDATE payloads.
219
+ ### <a name="template_language"></a>7.2. Property `language`
220
+
221
+ | | |
222
+ | ------------ | -------- |
223
+ | **Type** | `string` |
224
+ | **Required** | Yes |
225
+
226
+ **Description:** Template language/locale code (e.g. "en", "fr").
227
+
228
+ ### <a name="template_variables"></a>7.3. Property `variables`
229
+
230
+ | | |
231
+ | ------------------------- | ----------------------------------------------------------------------------------------------- |
232
+ | **Type** | `object` |
233
+ | **Required** | No |
234
+ | **Additional properties** | [Each additional property must conform to the schema](#template_variables_additionalProperties) |
235
+
236
+ **Description:** Template variable values, keyed by the variable name declared on the template.
237
+
238
+ | Property | Pattern | Type | Deprecated | Definition | Title/Description |
239
+ | ----------------------------------------------- | ------- | ------ | ---------- | ---------- | ----------------- |
240
+ | - [](#template_variables_additionalProperties ) | No | string | No | - | - |
241
+
242
+ #### <a name="template_variables_additionalProperties"></a>7.3.1. Property `additionalProperties`
243
+
244
+ | | |
245
+ | ------------ | -------- |
246
+ | **Type** | `string` |
247
+ | **Required** | No |
248
+
249
+ :::tip When to set
250
+ Set only when kind === "template".
211
251
  :::
212
252
 
213
- ## <a name="kind"></a>8. Property `kind`
253
+ ## <a name="purpose"></a>8. Property `purpose`
254
+
255
+ | | |
256
+ | ------------------------- | ---------------- |
257
+ | **Type** | `combining` |
258
+ | **Required** | No |
259
+ | **Additional properties** | Any type allowed |
260
+
261
+ **Description:** Business purpose (otp | review_request | adhoc | conversational). Optional.
262
+
263
+ | Any of(Option) |
264
+ | --------------------------------------------- |
265
+ | [outbound-message-purpose](#purpose_anyOf_i0) |
266
+ | [item 1](#purpose_anyOf_i1) |
214
267
 
215
- | | |
216
- | -------------- | ----------------------------------- |
217
- | **Type** | `enum (of string)` |
218
- | **Required** | Yes |
219
- | **Defined in** | #/definitions/outbound-message-kind |
268
+ ### <a name="purpose_anyOf_i0"></a>8.1. Property `outbound-message-purpose`
220
269
 
221
- **Description:** (Immutable) Message kind.
270
+ | | |
271
+ | -------------- | -------------------------------------- |
272
+ | **Type** | `enum (of string)` |
273
+ | **Required** | No |
274
+ | **Defined in** | #/definitions/outbound-message-purpose |
275
+
276
+ **Description:** Business purpose of an outbound WhatsApp message — orthogonal to its format (see OutboundMessageFormat). `otp`/`review_request`/`adhoc` are system-originated; `conversational` is a human agent reply from the dashboard inbox. Optional signal carried for analytics/triggers (GH#43; supersedes the GH#38 OutboundMessageKind).
222
277
 
223
278
  Must be one of:
224
279
  * "otp"
225
280
  * "review_request"
226
281
  * "adhoc"
282
+ * "conversational"
283
+
284
+ ### <a name="purpose_anyOf_i1"></a>8.2. Property `item 1`
285
+
286
+ | | |
287
+ | ------------ | ------ |
288
+ | **Type** | `null` |
289
+ | **Required** | No |
290
+
291
+ :::info Immutable
292
+ Set at creation only. This field cannot be modified after the document is created. Include it in CREATE payloads; omit it (or leave unchanged) in UPDATE payloads.
293
+ :::
294
+
295
+ :::note
296
+ Business purpose, orthogonal to `kind`. Carried for analytics/triggers; defaults to conversational for dashboard agent replies.
297
+ :::
298
+
299
+ ## <a name="orderUuid"></a>9. Property `orderUuid`
300
+
301
+ | | |
302
+ | ------------ | ---------------- |
303
+ | **Type** | `string or null` |
304
+ | **Required** | No |
305
+
306
+ **Description:** Order reference. Present on review_request messages.
227
307
 
228
308
  :::info Immutable
229
309
  Set at creation only. This field cannot be modified after the document is created. Include it in CREATE payloads; omit it (or leave unchanged) in UPDATE payloads.
230
310
  :::
231
311
 
232
- ## <a name="templateName"></a>9. Property `templateName`
312
+ ## <a name="sentBy"></a>10. Property `sentBy`
313
+
314
+ | | |
315
+ | ------------------------- | ----------- |
316
+ | **Type** | `object` |
317
+ | **Required** | Yes |
318
+ | **Additional properties** | Not allowed |
319
+
320
+ **Description:** (Immutable) Dashboard actor who enqueued the message.
321
+
322
+ | Property | Pattern | Type | Deprecated | Definition | Title/Description |
323
+ | ------------------------- | ------- | ------ | ---------- | ---------- | ----------------------------------------------------------------- |
324
+ | + [uid](#sentBy_uid ) | No | string | No | - | Firebase Auth UID of the dashboard user who enqueued the message. |
325
+ | - [email](#sentBy_email ) | No | string | No | - | Email of the sender, if available. |
326
+
327
+ ### <a name="sentBy_uid"></a>10.1. Property `uid`
233
328
 
234
329
  | | |
235
330
  | ------------ | -------- |
236
331
  | **Type** | `string` |
237
332
  | **Required** | Yes |
238
333
 
239
- **Description:** (Immutable) WhatsApp template name used for the send.
334
+ **Description:** Firebase Auth UID of the dashboard user who enqueued the message.
335
+
336
+ ### <a name="sentBy_email"></a>10.2. Property `email`
337
+
338
+ | | |
339
+ | ------------ | -------- |
340
+ | **Type** | `string` |
341
+ | **Required** | No |
342
+
343
+ **Description:** Email of the sender, if available.
344
+
345
+ :::info Immutable
346
+ Set at creation only. This field cannot be modified after the document is created. Include it in CREATE payloads; omit it (or leave unchanged) in UPDATE payloads.
347
+ :::
348
+
349
+ ## <a name="createdAt"></a>11. Property `createdAt`
350
+
351
+ | | |
352
+ | ------------------------- | --------------------------------- |
353
+ | **Type** | `object` |
354
+ | **Required** | Yes |
355
+ | **Additional properties** | Not allowed |
356
+ | **Defined in** | #/definitions/firestore-timestamp |
357
+
358
+ **Description:** (Immutable) Enqueue timestamp, set by the dashboard at create.
359
+
360
+ | Property | Pattern | Type | Deprecated | Definition | Title/Description |
361
+ | ------------------------------------------ | ------- | ------- | ---------- | ---------- | ----------------- |
362
+ | + [_seconds](#createdAt__seconds ) | No | integer | No | - | - |
363
+ | + [_nanoseconds](#createdAt__nanoseconds ) | No | integer | No | - | - |
364
+
365
+ ### <a name="createdAt__seconds"></a>11.1. Property `_seconds`
366
+
367
+ | | |
368
+ | ------------ | --------- |
369
+ | **Type** | `integer` |
370
+ | **Required** | Yes |
371
+
372
+ | Restrictions | |
373
+ | ------------ | ---------------------- |
374
+ | **Minimum** | &ge; -9007199254740991 |
375
+ | **Maximum** | &le; 9007199254740991 |
376
+
377
+ ### <a name="createdAt__nanoseconds"></a>11.2. Property `_nanoseconds`
378
+
379
+ | | |
380
+ | ------------ | --------- |
381
+ | **Type** | `integer` |
382
+ | **Required** | Yes |
383
+
384
+ | Restrictions | |
385
+ | ------------ | ---------------------- |
386
+ | **Minimum** | &ge; -9007199254740991 |
387
+ | **Maximum** | &le; 9007199254740991 |
240
388
 
241
389
  :::info Immutable
242
390
  Set at creation only. This field cannot be modified after the document is created. Include it in CREATE payloads; omit it (or leave unchanged) in UPDATE payloads.
243
391
  :::
244
392
 
245
- ## <a name="status"></a>10. Property `status`
393
+ ## <a name="status"></a>12. Property `status`
246
394
 
247
395
  | | |
248
396
  | -------------- | ------------------------------------- |
@@ -250,43 +398,83 @@ Set at creation only. This field cannot be modified after the document is create
250
398
  | **Required** | Yes |
251
399
  | **Defined in** | #/definitions/outbound-message-status |
252
400
 
253
- **Description:** Delivery status. Updated in-place by Meta delivery callbacks.
401
+ **Description:** Delivery status. Created as `queued` by the dashboard; updated in place by the backend.
254
402
 
255
403
  Must be one of:
256
- * "accepted"
404
+ * "queued"
257
405
  * "sent"
258
406
  * "delivered"
259
407
  * "read"
260
408
  * "failed"
261
409
 
262
- ## <a name="contactWaId"></a>11. Property `contactWaId`
410
+ :::note
411
+ Dashboard must create with `queued`. The backend owns every transition after (sent → delivered → read, or failed).
412
+ :::
413
+
414
+ ## <a name="wamid"></a>13. Property `wamid`
263
415
 
264
416
  | | |
265
417
  | ------------ | ---------------- |
266
418
  | **Type** | `string or null` |
267
419
  | **Required** | No |
268
420
 
269
- **Description:** Normalized wa_id returned by Meta on success. May differ from `to`.
421
+ **Description:** (Read-only) WhatsApp message ID returned by Meta once the backend sends. Absent while queued or on failure.
422
+
423
+ :::warning Server-set
424
+ Do not include in write requests. This field is set exclusively by the server (Firestore trigger or Admin SDK). Clients that send it will have the value silently ignored or may receive a validation error.
425
+ :::
270
426
 
271
- ## <a name="appId"></a>12. Property `appId`
427
+ ## <a name="error"></a>14. Property `error`
272
428
 
273
429
  | | |
274
430
  | ------------ | ---------------- |
275
431
  | **Type** | `string or null` |
276
432
  | **Required** | No |
277
433
 
278
- **Description:** Tenant appId when applicable.
434
+ **Description:** (Read-only) Human-readable failure reason. Present on status=failed. Raw Meta error detail lives in the lifecycle_events subcollection.
279
435
 
280
- ## <a name="orderUuid"></a>13. Property `orderUuid`
436
+ :::warning Server-set
437
+ Do not include in write requests. This field is set exclusively by the server (Firestore trigger or Admin SDK). Clients that send it will have the value silently ignored or may receive a validation error.
438
+ :::
281
439
 
282
- | | |
283
- | ------------ | ---------------- |
284
- | **Type** | `string or null` |
285
- | **Required** | No |
440
+ ## <a name="sentAt"></a>15. Property `sentAt`
286
441
 
287
- **Description:** Order reference. Present on review_request messages only.
442
+ | | |
443
+ | ------------------------- | ---------------- |
444
+ | **Type** | `combining` |
445
+ | **Required** | No |
446
+ | **Additional properties** | Any type allowed |
288
447
 
289
- ## <a name="statusUpdatedAt"></a>14. Property `statusUpdatedAt`
448
+ **Description:** (Read-only) When the backend sent the message to Meta.
449
+
450
+ | Any of(Option) |
451
+ | --------------------------------------- |
452
+ | [firestore-timestamp](#sentAt_anyOf_i0) |
453
+ | [item 1](#sentAt_anyOf_i1) |
454
+
455
+ ### <a name="sentAt_anyOf_i0"></a>15.1. Property `firestore-timestamp`
456
+
457
+ | | |
458
+ | ------------------------- | ----------------------- |
459
+ | **Type** | `object` |
460
+ | **Required** | No |
461
+ | **Additional properties** | Not allowed |
462
+ | **Same definition as** | [createdAt](#createdAt) |
463
+
464
+ **Description:** Firestore Timestamp serialized representation
465
+
466
+ ### <a name="sentAt_anyOf_i1"></a>15.2. Property `item 1`
467
+
468
+ | | |
469
+ | ------------ | ------ |
470
+ | **Type** | `null` |
471
+ | **Required** | No |
472
+
473
+ :::warning Server-set
474
+ Do not include in write requests. This field is set exclusively by the server (Firestore trigger or Admin SDK). Clients that send it will have the value silently ignored or may receive a validation error.
475
+ :::
476
+
477
+ ## <a name="deliveredAt"></a>16. Property `deliveredAt`
290
478
 
291
479
  | | |
292
480
  | ------------------------- | ---------------- |
@@ -294,73 +482,108 @@ Must be one of:
294
482
  | **Required** | No |
295
483
  | **Additional properties** | Any type allowed |
296
484
 
297
- **Description:** Timestamp of the last status update from a Meta delivery callback.
485
+ **Description:** (Read-only) When Meta reported delivery.
298
486
 
299
- | Any of(Option) |
300
- | ------------------------------------------------ |
301
- | [firestore-timestamp](#statusUpdatedAt_anyOf_i0) |
302
- | [item 1](#statusUpdatedAt_anyOf_i1) |
487
+ | Any of(Option) |
488
+ | -------------------------------------------- |
489
+ | [firestore-timestamp](#deliveredAt_anyOf_i0) |
490
+ | [item 1](#deliveredAt_anyOf_i1) |
303
491
 
304
- ### <a name="statusUpdatedAt_anyOf_i0"></a>14.1. Property `firestore-timestamp`
492
+ ### <a name="deliveredAt_anyOf_i0"></a>16.1. Property `firestore-timestamp`
305
493
 
306
- | | |
307
- | ------------------------- | ----------------- |
308
- | **Type** | `object` |
309
- | **Required** | No |
310
- | **Additional properties** | Not allowed |
311
- | **Same definition as** | [sentAt](#sentAt) |
494
+ | | |
495
+ | ------------------------- | ----------------------- |
496
+ | **Type** | `object` |
497
+ | **Required** | No |
498
+ | **Additional properties** | Not allowed |
499
+ | **Same definition as** | [createdAt](#createdAt) |
312
500
 
313
501
  **Description:** Firestore Timestamp serialized representation
314
502
 
315
- ### <a name="statusUpdatedAt_anyOf_i1"></a>14.2. Property `item 1`
503
+ ### <a name="deliveredAt_anyOf_i1"></a>16.2. Property `item 1`
316
504
 
317
505
  | | |
318
506
  | ------------ | ------ |
319
507
  | **Type** | `null` |
320
508
  | **Required** | No |
321
509
 
322
- ## <a name="failureCode"></a>15. Property `failureCode`
510
+ :::warning Server-set
511
+ Do not include in write requests. This field is set exclusively by the server (Firestore trigger or Admin SDK). Clients that send it will have the value silently ignored or may receive a validation error.
512
+ :::
323
513
 
324
- | | |
325
- | ------------ | ----------------- |
326
- | **Type** | `integer or null` |
327
- | **Required** | No |
514
+ ## <a name="readAt"></a>17. Property `readAt`
328
515
 
329
- **Description:** Meta error code. Present on failed sends only.
516
+ | | |
517
+ | ------------------------- | ---------------- |
518
+ | **Type** | `combining` |
519
+ | **Required** | No |
520
+ | **Additional properties** | Any type allowed |
330
521
 
331
- | Restrictions | |
332
- | ------------ | ---------------------- |
333
- | **Minimum** | &ge; -9007199254740991 |
334
- | **Maximum** | &le; 9007199254740991 |
522
+ **Description:** (Read-only) When Meta reported the recipient read the message.
335
523
 
336
- ## <a name="failureErrors"></a>16. Property `failureErrors`
524
+ | Any of(Option) |
525
+ | --------------------------------------- |
526
+ | [firestore-timestamp](#readAt_anyOf_i0) |
527
+ | [item 1](#readAt_anyOf_i1) |
337
528
 
338
- | | |
339
- | ------------ | --------------- |
340
- | **Type** | `array or null` |
341
- | **Required** | No |
529
+ ### <a name="readAt_anyOf_i0"></a>17.1. Property `firestore-timestamp`
342
530
 
343
- **Description:** Raw Meta error objects. Present on failed sends only.
531
+ | | |
532
+ | ------------------------- | ----------------------- |
533
+ | **Type** | `object` |
534
+ | **Required** | No |
535
+ | **Additional properties** | Not allowed |
536
+ | **Same definition as** | [createdAt](#createdAt) |
344
537
 
345
- | | Array restrictions |
346
- | -------------------- | ------------------ |
347
- | **Min items** | N/A |
348
- | **Max items** | N/A |
349
- | **Items unicity** | False |
350
- | **Additional items** | False |
351
- | **Tuple validation** | See below |
538
+ **Description:** Firestore Timestamp serialized representation
539
+
540
+ ### <a name="readAt_anyOf_i1"></a>17.2. Property `item 1`
541
+
542
+ | | |
543
+ | ------------ | ------ |
544
+ | **Type** | `null` |
545
+ | **Required** | No |
352
546
 
353
- | Each item of this array must be | Description |
354
- | ------------------------------------------- | ----------- |
355
- | [failureErrors items](#failureErrors_items) | - |
547
+ :::warning Server-set
548
+ Do not include in write requests. This field is set exclusively by the server (Firestore trigger or Admin SDK). Clients that send it will have the value silently ignored or may receive a validation error.
549
+ :::
356
550
 
357
- ### <a name="failureErrors_items"></a>16.1. failureErrors items
551
+ ## <a name="failedAt"></a>18. Property `failedAt`
358
552
 
359
553
  | | |
360
554
  | ------------------------- | ---------------- |
361
- | **Type** | `object` |
555
+ | **Type** | `combining` |
362
556
  | **Required** | No |
363
557
  | **Additional properties** | Any type allowed |
364
558
 
559
+ **Description:** (Read-only) When the send failed.
560
+
561
+ | Any of(Option) |
562
+ | ----------------------------------------- |
563
+ | [firestore-timestamp](#failedAt_anyOf_i0) |
564
+ | [item 1](#failedAt_anyOf_i1) |
565
+
566
+ ### <a name="failedAt_anyOf_i0"></a>18.1. Property `firestore-timestamp`
567
+
568
+ | | |
569
+ | ------------------------- | ----------------------- |
570
+ | **Type** | `object` |
571
+ | **Required** | No |
572
+ | **Additional properties** | Not allowed |
573
+ | **Same definition as** | [createdAt](#createdAt) |
574
+
575
+ **Description:** Firestore Timestamp serialized representation
576
+
577
+ ### <a name="failedAt_anyOf_i1"></a>18.2. Property `item 1`
578
+
579
+ | | |
580
+ | ------------ | ------ |
581
+ | **Type** | `null` |
582
+ | **Required** | No |
583
+
365
584
  ----------------------------------------------------------------------------------------------------------------------------
366
- Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-05-16 at 00:20:07 +0000
585
+ Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2026-05-27 at 01:15:18 +0000
586
+
587
+ :::warning Server-set
588
+ Do not include in write requests. This field is set exclusively by the server (Firestore trigger or Admin SDK). Clients that send it will have the value silently ignored or may receive a validation error.
589
+ :::