apologist 1.3.0 → 1.3.1

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 (57) hide show
  1. checksums.yaml +4 -4
  2. data/.fern/metadata.json +2 -2
  3. data/README.md +1 -3
  4. data/lib/Apologist/benchmarks/client.rb +2 -1
  5. data/lib/Apologist/benchmarks/types/benchmark_run_request_content.rb +1 -1
  6. data/lib/Apologist/benchmarks/types/benchmark_run_request_content_one_item.rb +15 -0
  7. data/lib/Apologist/channels/client.rb +41 -14
  8. data/lib/Apologist/channels/types/chatwoot_webhook_payload.rb +35 -0
  9. data/lib/Apologist/channels/types/chatwoot_webhook_payload_account.rb +11 -0
  10. data/lib/Apologist/channels/types/chatwoot_webhook_payload_conversation.rb +18 -0
  11. data/lib/Apologist/channels/types/chatwoot_webhook_payload_conversation_account.rb +11 -0
  12. data/lib/Apologist/channels/types/chatwoot_webhook_payload_sender.rb +16 -0
  13. data/lib/Apologist/chat/client.rb +103 -6
  14. data/lib/Apologist/chat/types/anonymize_completion_request.rb +11 -0
  15. data/lib/Apologist/chat/types/anonymize_completion_response.rb +11 -0
  16. data/lib/Apologist/chat/types/chat_completion_request.rb +75 -0
  17. data/lib/Apologist/chat/types/chat_completion_request_logprobs.rb +15 -0
  18. data/lib/Apologist/chat/types/chat_completion_request_metadata.rb +33 -0
  19. data/lib/Apologist/chat/types/chat_completion_request_reasoning_effort.rb +15 -0
  20. data/lib/Apologist/chat/types/chat_completion_request_response_format.rb +13 -0
  21. data/lib/Apologist/chat/types/chat_completion_request_response_format_json_schema.rb +19 -0
  22. data/lib/Apologist/chat/types/chat_completion_request_response_format_type.rb +17 -0
  23. data/lib/Apologist/chat/types/chat_completion_request_tool_choice.rb +15 -0
  24. data/lib/Apologist/chat/types/chat_completion_request_tool_choice_zero.rb +15 -0
  25. data/lib/Apologist/chat/types/chat_completion_request_verbosity.rb +16 -0
  26. data/lib/Apologist/chat/types/list_chat_completions_request.rb +6 -0
  27. data/lib/Apologist/chat/types/scrub_completion_request.rb +11 -0
  28. data/lib/Apologist/chat/types/scrub_completion_response.rb +11 -0
  29. data/lib/Apologist/client.rb +1 -1
  30. data/lib/Apologist/ct_as/client.rb +3 -5
  31. data/lib/Apologist/ct_as/types/cta_match_request.rb +27 -0
  32. data/lib/Apologist/evaluators/types/evaluator_request_content.rb +2 -1
  33. data/lib/Apologist/evaluators/types/evaluator_request_content_one_item.rb +15 -0
  34. data/lib/Apologist/types/chatwoot_conversation_meta.rb +11 -0
  35. data/lib/Apologist/types/chatwoot_conversation_meta_sender.rb +11 -0
  36. data/lib/Apologist/types/completion_redact_response.rb +16 -0
  37. data/lib/Apologist/types/{chat_completion_request_reasoning_effort.rb → completion_redact_response_mode.rb} +3 -4
  38. data/lib/Apologist/types/user_flag.rb +2 -0
  39. data/lib/Apologist/types/webhook_evaluation.rb +1 -1
  40. data/lib/Apologist/types/webhook_event_info_key.rb +1 -0
  41. data/lib/Apologist/types/webhook_payload.rb +6 -2
  42. data/lib/Apologist/types/webhook_payload_trace.rb +13 -0
  43. data/lib/Apologist/version.rb +1 -1
  44. data/lib/Apologist.rb +29 -14
  45. data/reference.md +586 -24
  46. metadata +29 -14
  47. data/lib/Apologist/channels/types/receive_chatwoot_webhook_request.rb +0 -17
  48. data/lib/Apologist/types/chat_completion_request.rb +0 -11
  49. data/lib/Apologist/types/chat_completion_request_logprobs.rb +0 -13
  50. data/lib/Apologist/types/chat_completion_request_metadata.rb +0 -31
  51. data/lib/Apologist/types/chat_completion_request_response_format.rb +0 -11
  52. data/lib/Apologist/types/chat_completion_request_response_format_json_schema.rb +0 -17
  53. data/lib/Apologist/types/chat_completion_request_response_format_type.rb +0 -15
  54. data/lib/Apologist/types/chat_completion_request_tool_choice.rb +0 -13
  55. data/lib/Apologist/types/chat_completion_request_tool_choice_zero.rb +0 -13
  56. data/lib/Apologist/types/chat_completion_request_verbosity.rb +0 -14
  57. data/lib/Apologist/types/cta_match_request.rb +0 -11
data/reference.md CHANGED
@@ -27,7 +27,7 @@ Returns a paginated list of chat completions (prompts) for the agent, with appli
27
27
  <dd>
28
28
 
29
29
  ```ruby
30
- client.chat.list_chat_completions
30
+ client.chat.list_chat_completions(traceparent: "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01")
31
31
  ```
32
32
  </dd>
33
33
  </dl>
@@ -186,6 +186,30 @@ client.chat.list_chat_completions
186
186
  <dl>
187
187
  <dd>
188
188
 
189
+ **traceparent:** `String` — W3C Trace Context parent. When present, the Agent continues this trace for the request. Applies to all `/api/v1` endpoints.
190
+
191
+ </dd>
192
+ </dl>
193
+
194
+ <dl>
195
+ <dd>
196
+
197
+ **tracestate:** `String` — Optional W3C tracestate associated with traceparent.
198
+
199
+ </dd>
200
+ </dl>
201
+
202
+ <dl>
203
+ <dd>
204
+
205
+ **baggage:** `String` — Optional W3C baggage. Prompt text is never copied onto spans.
206
+
207
+ </dd>
208
+ </dl>
209
+
210
+ <dl>
211
+ <dd>
212
+
189
213
  **request_options:** `Apologist::Chat::RequestOptions`
190
214
 
191
215
  </dd>
@@ -225,9 +249,7 @@ Creates a chat completion using the agent's configured model. Supports both stre
225
249
  <dd>
226
250
 
227
251
  ```ruby
228
- client.chat.create_chat_completion(request: {
229
- key: "value"
230
- })
252
+ client.chat.create_chat_completion(traceparent: "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01")
231
253
  ```
232
254
  </dd>
233
255
  </dl>
@@ -242,7 +264,263 @@ client.chat.create_chat_completion(request: {
242
264
  <dl>
243
265
  <dd>
244
266
 
245
- **request:** `Apologist::Types::ChatCompletionRequest`
267
+ **traceparent:** `String` — W3C Trace Context parent. When present, the Agent continues this trace for the request. Applies to all `/api/v1` endpoints.
268
+
269
+ </dd>
270
+ </dl>
271
+
272
+ <dl>
273
+ <dd>
274
+
275
+ **tracestate:** `String` — Optional W3C tracestate associated with traceparent.
276
+
277
+ </dd>
278
+ </dl>
279
+
280
+ <dl>
281
+ <dd>
282
+
283
+ **baggage:** `String` — Optional W3C baggage. Prompt text is never copied onto spans.
284
+
285
+ </dd>
286
+ </dl>
287
+
288
+ <dl>
289
+ <dd>
290
+
291
+ **audio:** `Internal::Types::Hash[String, Object]`
292
+
293
+ </dd>
294
+ </dl>
295
+
296
+ <dl>
297
+ <dd>
298
+
299
+ **frequency_penalty:** `Integer`
300
+
301
+ </dd>
302
+ </dl>
303
+
304
+ <dl>
305
+ <dd>
306
+
307
+ **logit_bias:** `Internal::Types::Hash[String, Object]`
308
+
309
+ </dd>
310
+ </dl>
311
+
312
+ <dl>
313
+ <dd>
314
+
315
+ **logprobs:** `Apologist::Chat::Types::ChatCompletionRequestLogprobs`
316
+
317
+ </dd>
318
+ </dl>
319
+
320
+ <dl>
321
+ <dd>
322
+
323
+ **top_logprobs:** `Integer`
324
+
325
+ </dd>
326
+ </dl>
327
+
328
+ <dl>
329
+ <dd>
330
+
331
+ **max_completion_tokens:** `Integer` — Output-token cap for this request. An API key may set this above the agent's Max Output Tokens. The value cannot exceed the model's maximum. Requests without an API key keep the agent's Max Output Tokens.
332
+
333
+ </dd>
334
+ </dl>
335
+
336
+ <dl>
337
+ <dd>
338
+
339
+ **max_tokens:** `Integer`
340
+
341
+ </dd>
342
+ </dl>
343
+
344
+ <dl>
345
+ <dd>
346
+
347
+ **messages:** `Internal::Types::Array[Apologist::Types::ChatMessage]` — Chat messages in OpenAI format. Required when `prompt` is omitted.
348
+
349
+ </dd>
350
+ </dl>
351
+
352
+ <dl>
353
+ <dd>
354
+
355
+ **metadata:** `Apologist::Chat::Types::ChatCompletionRequestMetadata`
356
+
357
+ </dd>
358
+ </dl>
359
+
360
+ <dl>
361
+ <dd>
362
+
363
+ **modalities:** `Internal::Types::Array[Object]`
364
+
365
+ </dd>
366
+ </dl>
367
+
368
+ <dl>
369
+ <dd>
370
+
371
+ **model:** `String`
372
+
373
+ </dd>
374
+ </dl>
375
+
376
+ <dl>
377
+ <dd>
378
+
379
+ **n:** `Integer`
380
+
381
+ </dd>
382
+ </dl>
383
+
384
+ <dl>
385
+ <dd>
386
+
387
+ **parallel_tool_calls:** `Internal::Types::Boolean`
388
+
389
+ </dd>
390
+ </dl>
391
+
392
+ <dl>
393
+ <dd>
394
+
395
+ **prediction:** `Internal::Types::Hash[String, Object]`
396
+
397
+ </dd>
398
+ </dl>
399
+
400
+ <dl>
401
+ <dd>
402
+
403
+ **presence_penalty:** `Integer`
404
+
405
+ </dd>
406
+ </dl>
407
+
408
+ <dl>
409
+ <dd>
410
+
411
+ **prompt:** `String` — User text to complete. Required when `messages` is omitted.
412
+
413
+ </dd>
414
+ </dl>
415
+
416
+ <dl>
417
+ <dd>
418
+
419
+ **reasoning_effort:** `Apologist::Chat::Types::ChatCompletionRequestReasoningEffort`
420
+
421
+ </dd>
422
+ </dl>
423
+
424
+ <dl>
425
+ <dd>
426
+
427
+ **verbosity:** `Apologist::Chat::Types::ChatCompletionRequestVerbosity`
428
+
429
+ </dd>
430
+ </dl>
431
+
432
+ <dl>
433
+ <dd>
434
+
435
+ **response_format:** `Apologist::Chat::Types::ChatCompletionRequestResponseFormat`
436
+
437
+ </dd>
438
+ </dl>
439
+
440
+ <dl>
441
+ <dd>
442
+
443
+ **seed:** `Integer`
444
+
445
+ </dd>
446
+ </dl>
447
+
448
+ <dl>
449
+ <dd>
450
+
451
+ **service_tier:** `String`
452
+
453
+ </dd>
454
+ </dl>
455
+
456
+ <dl>
457
+ <dd>
458
+
459
+ **stop:** `String`
460
+
461
+ </dd>
462
+ </dl>
463
+
464
+ <dl>
465
+ <dd>
466
+
467
+ **store:** `Internal::Types::Boolean`
468
+
469
+ </dd>
470
+ </dl>
471
+
472
+ <dl>
473
+ <dd>
474
+
475
+ **stream:** `Internal::Types::Boolean`
476
+
477
+ </dd>
478
+ </dl>
479
+
480
+ <dl>
481
+ <dd>
482
+
483
+ **stream_options:** `Internal::Types::Hash[String, Object]`
484
+
485
+ </dd>
486
+ </dl>
487
+
488
+ <dl>
489
+ <dd>
490
+
491
+ **temperature:** `Integer`
492
+
493
+ </dd>
494
+ </dl>
495
+
496
+ <dl>
497
+ <dd>
498
+
499
+ **top_p:** `Integer`
500
+
501
+ </dd>
502
+ </dl>
503
+
504
+ <dl>
505
+ <dd>
506
+
507
+ **tools:** `Internal::Types::Array[Object]` — OpenAI-compatible function tool definitions. Passed through to the model as declaration-only tools (the client executes them and returns role=tool messages).
508
+
509
+ </dd>
510
+ </dl>
511
+
512
+ <dl>
513
+ <dd>
514
+
515
+ **tool_choice:** `Apologist::Chat::Types::ChatCompletionRequestToolChoice`
516
+
517
+ </dd>
518
+ </dl>
519
+
520
+ <dl>
521
+ <dd>
522
+
523
+ **user:** `String`
246
524
 
247
525
  </dd>
248
526
  </dl>
@@ -563,6 +841,130 @@ client.chat.share_completion(id: "id")
563
841
  </dl>
564
842
 
565
843
 
844
+ </dd>
845
+ </dl>
846
+ </details>
847
+
848
+ <details><summary><code>client.chat.<a href="/lib/Apologist/chat/client.rb">scrub_completion</a>(id:) -> Apologist::Chat::Types::ScrubCompletionResponse</code></summary>
849
+ <dl>
850
+ <dd>
851
+
852
+ #### 📝 Description
853
+
854
+ <dl>
855
+ <dd>
856
+
857
+ <dl>
858
+ <dd>
859
+
860
+ Replaces this chat completion's message-adjacent text with a placeholder. Conversation rows, identifiers, likes, flags, and analytics identity stay in place. Repeat calls finish leftover rows.
861
+ </dd>
862
+ </dl>
863
+ </dd>
864
+ </dl>
865
+
866
+ #### 🔌 Usage
867
+
868
+ <dl>
869
+ <dd>
870
+
871
+ <dl>
872
+ <dd>
873
+
874
+ ```ruby
875
+ client.chat.scrub_completion(id: "id")
876
+ ```
877
+ </dd>
878
+ </dl>
879
+ </dd>
880
+ </dl>
881
+
882
+ #### ⚙️ Parameters
883
+
884
+ <dl>
885
+ <dd>
886
+
887
+ <dl>
888
+ <dd>
889
+
890
+ **id:** `String` — The numeric id or UUID of the chat completion
891
+
892
+ </dd>
893
+ </dl>
894
+
895
+ <dl>
896
+ <dd>
897
+
898
+ **request_options:** `Apologist::Chat::RequestOptions`
899
+
900
+ </dd>
901
+ </dl>
902
+ </dd>
903
+ </dl>
904
+
905
+
906
+ </dd>
907
+ </dl>
908
+ </details>
909
+
910
+ <details><summary><code>client.chat.<a href="/lib/Apologist/chat/client.rb">anonymize_completion</a>(id:) -> Apologist::Chat::Types::AnonymizeCompletionResponse</code></summary>
911
+ <dl>
912
+ <dd>
913
+
914
+ #### 📝 Description
915
+
916
+ <dl>
917
+ <dd>
918
+
919
+ <dl>
920
+ <dd>
921
+
922
+ Redacts detected personal data in this chat completion's message-adjacent text with regex, then an optional hosted redaction service when the Agent has that option on. Conversation rows, identifiers, likes, flags, and analytics identity stay in place. Repeat calls finish leftover rows and skip text that is already redacted.
923
+ </dd>
924
+ </dl>
925
+ </dd>
926
+ </dl>
927
+
928
+ #### 🔌 Usage
929
+
930
+ <dl>
931
+ <dd>
932
+
933
+ <dl>
934
+ <dd>
935
+
936
+ ```ruby
937
+ client.chat.anonymize_completion(id: "id")
938
+ ```
939
+ </dd>
940
+ </dl>
941
+ </dd>
942
+ </dl>
943
+
944
+ #### ⚙️ Parameters
945
+
946
+ <dl>
947
+ <dd>
948
+
949
+ <dl>
950
+ <dd>
951
+
952
+ **id:** `String` — The numeric id or UUID of the chat completion
953
+
954
+ </dd>
955
+ </dl>
956
+
957
+ <dl>
958
+ <dd>
959
+
960
+ **request_options:** `Apologist::Chat::RequestOptions`
961
+
962
+ </dd>
963
+ </dl>
964
+ </dd>
965
+ </dl>
966
+
967
+
566
968
  </dd>
567
969
  </dl>
568
970
  </details>
@@ -762,7 +1164,7 @@ client.corpus.log_corpus_view(
762
1164
  <dl>
763
1165
  <dd>
764
1166
 
765
- **model:** `String` — The model type (e.g., 'source')
1167
+ **model:** `String` — Listing model. One of collection, contributor, organization, or source.
766
1168
 
767
1169
  </dd>
768
1170
  </dl>
@@ -852,7 +1254,7 @@ client.corpus.log_corpus_impression(
852
1254
  <dl>
853
1255
  <dd>
854
1256
 
855
- **model:** `String` — The model type (e.g., 'source')
1257
+ **model:** `String` — Listing model. One of collection, contributor, organization, or source.
856
1258
 
857
1259
  </dd>
858
1260
  </dl>
@@ -942,7 +1344,7 @@ client.corpus.log_corpus_referral_redirect(
942
1344
  <dl>
943
1345
  <dd>
944
1346
 
945
- **model:** `String` — The model type (e.g., 'source')
1347
+ **model:** `String` — Listing model. One of collection, contributor, organization, or source.
946
1348
 
947
1349
  </dd>
948
1350
  </dl>
@@ -1040,7 +1442,7 @@ client.corpus.log_corpus_referral(
1040
1442
  <dl>
1041
1443
  <dd>
1042
1444
 
1043
- **model:** `String` — The model type (e.g., 'source')
1445
+ **model:** `String` — Listing model. One of collection, contributor, organization, or source.
1044
1446
 
1045
1447
  </dd>
1046
1448
  </dl>
@@ -1312,7 +1714,7 @@ client.evaluators.evaluate_content(
1312
1714
  <dl>
1313
1715
  <dd>
1314
1716
 
1315
- **content:** `Apologist::Evaluators::Types::EvaluatorRequestContent`
1717
+ **content:** `Apologist::Evaluators::Types::EvaluatorRequestContent` — Text to evaluate, an array of strings, or chat messages.
1316
1718
 
1317
1719
  </dd>
1318
1720
  </dl>
@@ -1489,9 +1891,7 @@ Finds matching CTAs based on conversation context, user, session, device, or mes
1489
1891
  <dd>
1490
1892
 
1491
1893
  ```ruby
1492
- client.ct_as.match_ctas(request: {
1493
- key: "value"
1494
- })
1894
+ client.ct_as.match_ctas
1495
1895
  ```
1496
1896
  </dd>
1497
1897
  </dl>
@@ -1506,7 +1906,71 @@ client.ct_as.match_ctas(request: {
1506
1906
  <dl>
1507
1907
  <dd>
1508
1908
 
1509
- **request:** `Apologist::Types::CtaMatchRequest`
1909
+ **conversation:** `String`
1910
+
1911
+ </dd>
1912
+ </dl>
1913
+
1914
+ <dl>
1915
+ <dd>
1916
+
1917
+ **client:** `String`
1918
+
1919
+ </dd>
1920
+ </dl>
1921
+
1922
+ <dl>
1923
+ <dd>
1924
+
1925
+ **device:** `String`
1926
+
1927
+ </dd>
1928
+ </dl>
1929
+
1930
+ <dl>
1931
+ <dd>
1932
+
1933
+ **language:** `String` — ISO language code, or `auto` to detect from the prompt.
1934
+
1935
+ </dd>
1936
+ </dl>
1937
+
1938
+ <dl>
1939
+ <dd>
1940
+
1941
+ **limit:** `Integer`
1942
+
1943
+ </dd>
1944
+ </dl>
1945
+
1946
+ <dl>
1947
+ <dd>
1948
+
1949
+ **messages:** `Internal::Types::Array[Apologist::Types::ChatMessage]` — Chat messages in OpenAI format.
1950
+
1951
+ </dd>
1952
+ </dl>
1953
+
1954
+ <dl>
1955
+ <dd>
1956
+
1957
+ **session:** `String`
1958
+
1959
+ </dd>
1960
+ </dl>
1961
+
1962
+ <dl>
1963
+ <dd>
1964
+
1965
+ **user:** `String`
1966
+
1967
+ </dd>
1968
+ </dl>
1969
+
1970
+ <dl>
1971
+ <dd>
1972
+
1973
+ **variables:** `Internal::Types::Hash[String, String]` — Flat string key/value pairs substituted into `{key}` placeholders in evaluator prompts run during CTA matching. Not persisted.
1510
1974
 
1511
1975
  </dd>
1512
1976
  </dl>
@@ -2215,7 +2679,7 @@ client.benchmarks.list_benchmark_runs(id: "id")
2215
2679
  <dl>
2216
2680
  <dd>
2217
2681
 
2218
- Executes a benchmark run and returns the aggregated result with nested evaluators, questions, and a flat evaluations array.
2682
+ Executes a benchmark run and returns the aggregated result with nested evaluators, questions, and a flat evaluations array. A run that cannot finish inside one request returns 202 with `completed_at` null and continues in the background. Poll Get a benchmark run until `completed_at` is set.
2219
2683
  </dd>
2220
2684
  </dl>
2221
2685
  </dd>
@@ -2879,7 +3343,7 @@ client.channels.get_chatwoot_channel_status(id: "id")
2879
3343
  </dl>
2880
3344
  </details>
2881
3345
 
2882
- <details><summary><code>client.channels.<a href="/lib/Apologist/channels/client.rb">receive_chatwoot_webhook</a>(id:, request) -> </code></summary>
3346
+ <details><summary><code>client.channels.<a href="/lib/Apologist/channels/client.rb">receive_chatwoot_webhook</a>(channel_id:, request) -> </code></summary>
2883
3347
  <dl>
2884
3348
  <dd>
2885
3349
 
@@ -2907,9 +3371,35 @@ Receives Chatwoot Agent Bot webhook events for the channel. Chatwoot owns the me
2907
3371
 
2908
3372
  ```ruby
2909
3373
  client.channels.receive_chatwoot_webhook(
2910
- id: "id",
2911
- body: {
2912
- key: "value"
3374
+ channel_id: "91",
3375
+ chatwoot_signature: "sha256=2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824",
3376
+ chatwoot_timestamp: "1710000000",
3377
+ event: "message_created",
3378
+ id: 9001,
3379
+ content: "Hello from Messenger",
3380
+ message_type: "incoming",
3381
+ private: false,
3382
+ account: {
3383
+ id: 7
3384
+ },
3385
+ sender: {
3386
+ id: 55,
3387
+ name: "Pat",
3388
+ type: "contact"
3389
+ },
3390
+ conversation: {
3391
+ id: 42,
3392
+ status: "pending",
3393
+ account: {
3394
+ id: 7
3395
+ },
3396
+ meta: {
3397
+ assignee_type: "AgentBot",
3398
+ sender: {
3399
+ id: 55,
3400
+ name: "Pat"
3401
+ }
3402
+ }
2913
3403
  }
2914
3404
  )
2915
3405
  ```
@@ -2926,7 +3416,7 @@ client.channels.receive_chatwoot_webhook(
2926
3416
  <dl>
2927
3417
  <dd>
2928
3418
 
2929
- **id:** `String` — The channel id
3419
+ **channel_id:** `String` — The channel id
2930
3420
 
2931
3421
  </dd>
2932
3422
  </dl>
@@ -2950,7 +3440,79 @@ client.channels.receive_chatwoot_webhook(
2950
3440
  <dl>
2951
3441
  <dd>
2952
3442
 
2953
- **request:** `Internal::Types::Hash[String, Object]` — Chatwoot Agent Bot webhook payload (`event` plus message or conversation fields).
3443
+ **event:** `String` — Chatwoot event name. Incoming visitor messages use `message_created`. Staff takeover and assignment use conversation events such as `conversation_opened`, `conversation_status_changed`, and `conversation_updated`.
3444
+
3445
+ </dd>
3446
+ </dl>
3447
+
3448
+ <dl>
3449
+ <dd>
3450
+
3451
+ **id:** `Integer` — Message id on `message_*` events. Conversation display id on `conversation_*` events.
3452
+
3453
+ </dd>
3454
+ </dl>
3455
+
3456
+ <dl>
3457
+ <dd>
3458
+
3459
+ **content:** `String` — Message text. Present on message events. Empty or private notes are ignored.
3460
+
3461
+ </dd>
3462
+ </dl>
3463
+
3464
+ <dl>
3465
+ <dd>
3466
+
3467
+ **message_type:** `String` — Incoming visitor messages are `incoming` (or `0`). Staff replies are `outgoing` (or `1`).
3468
+
3469
+ </dd>
3470
+ </dl>
3471
+
3472
+ <dl>
3473
+ <dd>
3474
+
3475
+ **private:** `Internal::Types::Boolean` — When true, the Agent ignores the message (Chatwoot private note).
3476
+
3477
+ </dd>
3478
+ </dl>
3479
+
3480
+ <dl>
3481
+ <dd>
3482
+
3483
+ **account:** `Apologist::Channels::Types::ChatwootWebhookPayloadAccount`
3484
+
3485
+ </dd>
3486
+ </dl>
3487
+
3488
+ <dl>
3489
+ <dd>
3490
+
3491
+ **sender:** `Apologist::Channels::Types::ChatwootWebhookPayloadSender` — Present on message events.
3492
+
3493
+ </dd>
3494
+ </dl>
3495
+
3496
+ <dl>
3497
+ <dd>
3498
+
3499
+ **conversation:** `Apologist::Channels::Types::ChatwootWebhookPayloadConversation` — Nested on message events. Conversation events send `id`, `status`, and `meta` at the top level instead.
3500
+
3501
+ </dd>
3502
+ </dl>
3503
+
3504
+ <dl>
3505
+ <dd>
3506
+
3507
+ **status:** `String` — Top-level conversation status on conversation events.
3508
+
3509
+ </dd>
3510
+ </dl>
3511
+
3512
+ <dl>
3513
+ <dd>
3514
+
3515
+ **meta:** `Apologist::Types::ChatwootConversationMeta` — Top-level conversation meta on conversation events.
2954
3516
 
2955
3517
  </dd>
2956
3518
  </dl>
@@ -3662,7 +4224,7 @@ client.channels.receive_twilio_message(id: "id")
3662
4224
  <dl>
3663
4225
  <dd>
3664
4226
 
3665
- Handles the Meta WhatsApp Cloud API webhook verification handshake, echoing `hub.challenge` when `hub.verify_token` matches the channel's configured token.
4227
+ Handles the Meta WhatsApp Cloud API webhook verification handshake. Requires an `api_key` query parameter or `x-api-key` header, then echoes `hub.challenge` when `hub.verify_token` matches the channel's configured token.
3666
4228
  </dd>
3667
4229
  </dl>
3668
4230
  </dd>
@@ -3752,7 +4314,7 @@ client.channels.verify_whats_app_webhook(
3752
4314
  <dl>
3753
4315
  <dd>
3754
4316
 
3755
- Receives WhatsApp Cloud API message events for the channel. Payload shape is defined by Meta. Signature verification via `x-hub-signature-256` is used when the channel has an App Secret configured; otherwise the webhook relies on URL secrecy and/or an `api_key` query parameter.
4317
+ Receives WhatsApp Cloud API message events for the channel. Payload shape is defined by Meta. An `api_key` query parameter or `x-api-key` header is required. Signature verification via `x-hub-signature-256` is also required when the channel has an App Secret configured.
3756
4318
  </dd>
3757
4319
  </dl>
3758
4320
  </dd>
@@ -3795,7 +4357,7 @@ client.channels.receive_whats_app_message(
3795
4357
  <dl>
3796
4358
  <dd>
3797
4359
 
3798
- **hub_signature256:** `String` — Meta `sha256=<hex>` HMAC of the raw body keyed with the WhatsApp App Secret. Required when the channel has an App Secret configured and the webhook URL does not include an api_key.
4360
+ **hub_signature256:** `String` — Meta `sha256=<hex>` HMAC of the raw body keyed with the WhatsApp App Secret. Required when the channel has an App Secret configured.
3799
4361
 
3800
4362
  </dd>
3801
4363
  </dl>