@moltflow/skills 1.1.0 → 1.3.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.
- package/SKILL.md +505 -512
- package/package.json +1 -1
- package/scripts/discover_agent.py +0 -54
package/SKILL.md
CHANGED
|
@@ -1,512 +1,505 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: WhatsApp Automation & A2A
|
|
3
|
-
description: "MoltFlow — complete WhatsApp automation platform: sessions, messaging, groups, labels, webhooks, AI
|
|
4
|
-
metadata: {"openclaw":{"emoji":"📱","homepage":"https://
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# WhatsApp Automation & A2A
|
|
8
|
-
|
|
9
|
-
MoltFlow provides a complete WhatsApp automation API with managed sessions, group monitoring, AI-powered replies,
|
|
10
|
-
|
|
11
|
-
## When to use
|
|
12
|
-
|
|
13
|
-
Use this skill when you need to:
|
|
14
|
-
- Connect and manage WhatsApp sessions (QR pairing, start/stop)
|
|
15
|
-
- Send text messages, list chats, read message history
|
|
16
|
-
- Monitor groups for leads or keywords
|
|
17
|
-
- Manage contact labels (WhatsApp Business sync)
|
|
18
|
-
- Configure webhooks for real-time events
|
|
19
|
-
- Transcribe voice messages (Whisper AI)
|
|
20
|
-
- Manage RAG knowledge base (upload docs, semantic search)
|
|
21
|
-
- Train style profiles and generate AI replies
|
|
22
|
-
- Discover and message other AI agents (A2A JSON-RPC 2.0)
|
|
23
|
-
- Manage encryption keys (X25519-AES256GCM)
|
|
24
|
-
- Collect reviews via sentiment analysis (14+ languages)
|
|
25
|
-
- Export testimonials (JSON/HTML)
|
|
26
|
-
- Manage API keys, usage tracking, billing (Stripe)
|
|
27
|
-
|
|
28
|
-
## Setup
|
|
29
|
-
|
|
30
|
-
Env vars:
|
|
31
|
-
- `MOLTFLOW_API_KEY` (required) — API key from
|
|
32
|
-
- `MOLTFLOW_API_URL` (optional) — defaults to `https://
|
|
33
|
-
|
|
34
|
-
Authentication: `X-API-Key: $MOLTFLOW_API_KEY` header or `Authorization: Bearer $TOKEN` (JWT from login).
|
|
35
|
-
|
|
36
|
-
Base URL: `https://
|
|
37
|
-
|
|
38
|
-
---
|
|
39
|
-
|
|
40
|
-
## 1. Sessions
|
|
41
|
-
|
|
42
|
-
```bash
|
|
43
|
-
# List all sessions
|
|
44
|
-
curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
|
|
45
|
-
https://
|
|
46
|
-
|
|
47
|
-
# Create new session
|
|
48
|
-
curl -X POST -H "X-API-Key: $MOLTFLOW_API_KEY" \
|
|
49
|
-
-H "Content-Type: application/json" \
|
|
50
|
-
-d '{"name": "Main Line"}' \
|
|
51
|
-
https://
|
|
52
|
-
|
|
53
|
-
# Get session details
|
|
54
|
-
curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
|
|
55
|
-
https://
|
|
56
|
-
|
|
57
|
-
# Delete session
|
|
58
|
-
curl -X DELETE -H "X-API-Key: $MOLTFLOW_API_KEY" \
|
|
59
|
-
https://
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
| Endpoint | Method | Description |
|
|
63
|
-
|----------|--------|-------------|
|
|
64
|
-
| `/sessions` | GET | List sessions |
|
|
65
|
-
| `/sessions` | POST | Create session |
|
|
66
|
-
| `/sessions/{id}` | GET | Get session details |
|
|
67
|
-
| `/sessions/{id}` | DELETE | Delete session |
|
|
68
|
-
|
|
69
|
-
## 2. Messages
|
|
70
|
-
|
|
71
|
-
```bash
|
|
72
|
-
# Send text message
|
|
73
|
-
curl -X POST -H "X-API-Key: $MOLTFLOW_API_KEY" \
|
|
74
|
-
-H "Content-Type: application/json" \
|
|
75
|
-
-d '{"session_id": "uuid", "chat_id": "1234567890@c.us", "message": "Hello!"}' \
|
|
76
|
-
https://
|
|
77
|
-
|
|
78
|
-
# List chats for a session
|
|
79
|
-
curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
|
|
80
|
-
https://
|
|
81
|
-
|
|
82
|
-
# Get chat messages
|
|
83
|
-
curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
|
|
84
|
-
https://
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
| Endpoint | Method | Description |
|
|
88
|
-
|----------|--------|-------------|
|
|
89
|
-
| `/messages/send` | POST | Send text message |
|
|
90
|
-
| `/messages/chats/{session_id}` | GET | List chats |
|
|
91
|
-
| `/messages/chat/{session_id}/{chat_id}` | GET | Get messages in chat |
|
|
92
|
-
| `/messages/{message_id}` | GET | Get single message |
|
|
93
|
-
|
|
94
|
-
## 3. Groups
|
|
95
|
-
|
|
96
|
-
```bash
|
|
97
|
-
# List monitored groups
|
|
98
|
-
curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
|
|
99
|
-
https://
|
|
100
|
-
|
|
101
|
-
# List available WhatsApp groups
|
|
102
|
-
curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
|
|
103
|
-
https://
|
|
104
|
-
|
|
105
|
-
# Add group to monitor
|
|
106
|
-
curl -X POST -H "X-API-Key: $MOLTFLOW_API_KEY" \
|
|
107
|
-
-H "Content-Type: application/json" \
|
|
108
|
-
-d '{"session_id": "uuid", "wa_group_id": "123456@g.us", "monitor_mode": "first_message"}' \
|
|
109
|
-
https://
|
|
110
|
-
|
|
111
|
-
# Update monitoring settings
|
|
112
|
-
curl -X PATCH -H "X-API-Key: $MOLTFLOW_API_KEY" \
|
|
113
|
-
-H "Content-Type: application/json" \
|
|
114
|
-
-d '{"monitor_mode": "keyword", "monitor_keywords": ["looking for", "need help"]}' \
|
|
115
|
-
https://
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
| Endpoint | Method | Description |
|
|
119
|
-
|----------|--------|-------------|
|
|
120
|
-
| `/groups` | GET | List monitored groups |
|
|
121
|
-
| `/groups/available/{session_id}` | GET | List available WhatsApp groups |
|
|
122
|
-
| `/groups` | POST | Add group to monitoring |
|
|
123
|
-
| `/groups/{id}` | GET | Get group details |
|
|
124
|
-
| `/groups/{id}` | PATCH | Update monitoring settings |
|
|
125
|
-
| `/groups/{id}` | DELETE | Remove from monitoring |
|
|
126
|
-
|
|
127
|
-
## 4. Labels
|
|
128
|
-
|
|
129
|
-
```bash
|
|
130
|
-
# Create label (color must be hex #RRGGBB)
|
|
131
|
-
curl -X POST -H "X-API-Key: $MOLTFLOW_API_KEY" \
|
|
132
|
-
-H "Content-Type: application/json" \
|
|
133
|
-
-d '{"name": "VIP", "color": "#00FF00"}' \
|
|
134
|
-
https://
|
|
135
|
-
|
|
136
|
-
# Sync label to WhatsApp Business
|
|
137
|
-
curl -X POST -H "X-API-Key: $MOLTFLOW_API_KEY" \
|
|
138
|
-
"https://
|
|
139
|
-
|
|
140
|
-
# Import labels from WhatsApp Business
|
|
141
|
-
curl -X POST -H "X-API-Key: $MOLTFLOW_API_KEY" \
|
|
142
|
-
"https://
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
| Endpoint | Method | Description |
|
|
146
|
-
|----------|--------|-------------|
|
|
147
|
-
| `/labels` | GET | List labels |
|
|
148
|
-
| `/labels` | POST | Create label |
|
|
149
|
-
| `/labels/business-check` | GET | Check WhatsApp Business status |
|
|
150
|
-
| `/labels/{id}` | GET / PATCH / DELETE | Get, update, delete label |
|
|
151
|
-
| `/labels/{id}/sync` | POST | Sync to WhatsApp Business |
|
|
152
|
-
| `/labels/sync-from-whatsapp` | POST | Import from WhatsApp |
|
|
153
|
-
|
|
154
|
-
## 5. Webhooks
|
|
155
|
-
|
|
156
|
-
```bash
|
|
157
|
-
#
|
|
158
|
-
curl -
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
|
169
|
-
|
|
170
|
-
| `/webhooks` | GET |
|
|
171
|
-
| `/webhooks` | POST |
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
|
251
|
-
|
|
252
|
-
| `/ai/
|
|
253
|
-
| `/ai/
|
|
254
|
-
| `/ai/
|
|
255
|
-
| `/ai/
|
|
256
|
-
| `/ai/
|
|
257
|
-
| `/ai/
|
|
258
|
-
| `/ai/
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
-
|
|
334
|
-
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
|
347
|
-
|
|
348
|
-
| `/
|
|
349
|
-
| `/
|
|
350
|
-
| `/
|
|
351
|
-
| `/
|
|
352
|
-
| `/
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
#
|
|
464
|
-
curl -H "
|
|
465
|
-
"https
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
|
481
|
-
|
|
482
|
-
| `/
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
-
|
|
496
|
-
-
|
|
497
|
-
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
<!-- FILEMAP:BEGIN -->
|
|
507
|
-
```text
|
|
508
|
-
[moltflow file map]|root: .
|
|
509
|
-
|.:{SKILL.md,package.json}
|
|
510
|
-
|scripts:{quickstart.py,a2a_client.py,discover_agent.py,send_message.py,admin.py,ai_config.py,reviews.py}
|
|
511
|
-
```
|
|
512
|
-
<!-- FILEMAP:END -->
|
|
1
|
+
---
|
|
2
|
+
name: "WhatsApp Automation & A2A"
|
|
3
|
+
description: "MoltFlow — complete WhatsApp automation platform: sessions, messaging, groups, labels, webhooks, AI-powered replies, auto-feedback collection, intention detection, lead management, anti-spam safeguards, agent-to-agent protocol (JSON-RPC, encryption), and configurable rules."
|
|
4
|
+
metadata: {"openclaw":{"emoji":"📱","homepage":"https://waiflow.app","requires":{"env":["MOLTFLOW_API_KEY"]},"primaryEnv":"MOLTFLOW_API_KEY"}}
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# WhatsApp Automation & A2A
|
|
8
|
+
|
|
9
|
+
MoltFlow provides a complete WhatsApp automation API with managed sessions, group monitoring, AI-powered replies, auto-feedback collection, intention detection, lead management, and agent-to-agent communication.
|
|
10
|
+
|
|
11
|
+
## When to use
|
|
12
|
+
|
|
13
|
+
Use this skill when you need to:
|
|
14
|
+
- Connect and manage WhatsApp sessions (QR pairing, start/stop)
|
|
15
|
+
- Send text messages, list chats, read message history
|
|
16
|
+
- Monitor groups for leads or keywords
|
|
17
|
+
- Manage contact labels (WhatsApp Business sync)
|
|
18
|
+
- Configure webhooks for real-time events
|
|
19
|
+
- Transcribe voice messages (Whisper AI)
|
|
20
|
+
- Manage RAG knowledge base (upload docs, semantic search)
|
|
21
|
+
- Train style profiles and generate AI replies
|
|
22
|
+
- Discover and message other AI agents (A2A JSON-RPC 2.0)
|
|
23
|
+
- Manage encryption keys (X25519-AES256GCM)
|
|
24
|
+
- Collect reviews via sentiment analysis (14+ languages)
|
|
25
|
+
- Export testimonials (JSON/HTML)
|
|
26
|
+
- Manage API keys, usage tracking, billing (Stripe)
|
|
27
|
+
|
|
28
|
+
## Setup
|
|
29
|
+
|
|
30
|
+
Env vars:
|
|
31
|
+
- `MOLTFLOW_API_KEY` (required) — API key from waiflow.app dashboard
|
|
32
|
+
- `MOLTFLOW_API_URL` (optional) — defaults to `https://apiv2.waiflow.app`
|
|
33
|
+
|
|
34
|
+
Authentication: `X-API-Key: $MOLTFLOW_API_KEY` header or `Authorization: Bearer $TOKEN` (JWT from login).
|
|
35
|
+
|
|
36
|
+
Base URL: `https://apiv2.waiflow.app/api/v2`
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## 1. Sessions
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
# List all sessions
|
|
44
|
+
curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
|
|
45
|
+
https://apiv2.waiflow.app/api/v2/sessions
|
|
46
|
+
|
|
47
|
+
# Create new session
|
|
48
|
+
curl -X POST -H "X-API-Key: $MOLTFLOW_API_KEY" \
|
|
49
|
+
-H "Content-Type: application/json" \
|
|
50
|
+
-d '{"name": "Main Line"}' \
|
|
51
|
+
https://apiv2.waiflow.app/api/v2/sessions
|
|
52
|
+
|
|
53
|
+
# Get session details
|
|
54
|
+
curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
|
|
55
|
+
https://apiv2.waiflow.app/api/v2/sessions/{session_id}
|
|
56
|
+
|
|
57
|
+
# Delete session
|
|
58
|
+
curl -X DELETE -H "X-API-Key: $MOLTFLOW_API_KEY" \
|
|
59
|
+
https://apiv2.waiflow.app/api/v2/sessions/{session_id}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
| Endpoint | Method | Description |
|
|
63
|
+
|----------|--------|-------------|
|
|
64
|
+
| `/sessions` | GET | List sessions |
|
|
65
|
+
| `/sessions` | POST | Create session |
|
|
66
|
+
| `/sessions/{id}` | GET | Get session details |
|
|
67
|
+
| `/sessions/{id}` | DELETE | Delete session |
|
|
68
|
+
|
|
69
|
+
## 2. Messages
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
# Send text message
|
|
73
|
+
curl -X POST -H "X-API-Key: $MOLTFLOW_API_KEY" \
|
|
74
|
+
-H "Content-Type: application/json" \
|
|
75
|
+
-d '{"session_id": "uuid", "chat_id": "1234567890@c.us", "message": "Hello!"}' \
|
|
76
|
+
https://apiv2.waiflow.app/api/v2/messages/send
|
|
77
|
+
|
|
78
|
+
# List chats for a session
|
|
79
|
+
curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
|
|
80
|
+
https://apiv2.waiflow.app/api/v2/messages/chats/{session_id}
|
|
81
|
+
|
|
82
|
+
# Get chat messages
|
|
83
|
+
curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
|
|
84
|
+
https://apiv2.waiflow.app/api/v2/messages/chat/{session_id}/{chat_id}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
| Endpoint | Method | Description |
|
|
88
|
+
|----------|--------|-------------|
|
|
89
|
+
| `/messages/send` | POST | Send text message |
|
|
90
|
+
| `/messages/chats/{session_id}` | GET | List chats |
|
|
91
|
+
| `/messages/chat/{session_id}/{chat_id}` | GET | Get messages in chat |
|
|
92
|
+
| `/messages/{message_id}` | GET | Get single message |
|
|
93
|
+
|
|
94
|
+
## 3. Groups
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
# List monitored groups
|
|
98
|
+
curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
|
|
99
|
+
https://apiv2.waiflow.app/api/v2/groups
|
|
100
|
+
|
|
101
|
+
# List available WhatsApp groups
|
|
102
|
+
curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
|
|
103
|
+
https://apiv2.waiflow.app/api/v2/groups/available/{session_id}
|
|
104
|
+
|
|
105
|
+
# Add group to monitor
|
|
106
|
+
curl -X POST -H "X-API-Key: $MOLTFLOW_API_KEY" \
|
|
107
|
+
-H "Content-Type: application/json" \
|
|
108
|
+
-d '{"session_id": "uuid", "wa_group_id": "123456@g.us", "monitor_mode": "first_message"}' \
|
|
109
|
+
https://apiv2.waiflow.app/api/v2/groups
|
|
110
|
+
|
|
111
|
+
# Update monitoring settings
|
|
112
|
+
curl -X PATCH -H "X-API-Key: $MOLTFLOW_API_KEY" \
|
|
113
|
+
-H "Content-Type: application/json" \
|
|
114
|
+
-d '{"monitor_mode": "keyword", "monitor_keywords": ["looking for", "need help"]}' \
|
|
115
|
+
https://apiv2.waiflow.app/api/v2/groups/{group_id}
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
| Endpoint | Method | Description |
|
|
119
|
+
|----------|--------|-------------|
|
|
120
|
+
| `/groups` | GET | List monitored groups |
|
|
121
|
+
| `/groups/available/{session_id}` | GET | List available WhatsApp groups |
|
|
122
|
+
| `/groups` | POST | Add group to monitoring |
|
|
123
|
+
| `/groups/{id}` | GET | Get group details |
|
|
124
|
+
| `/groups/{id}` | PATCH | Update monitoring settings |
|
|
125
|
+
| `/groups/{id}` | DELETE | Remove from monitoring |
|
|
126
|
+
|
|
127
|
+
## 4. Labels
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
# Create label (color must be hex #RRGGBB)
|
|
131
|
+
curl -X POST -H "X-API-Key: $MOLTFLOW_API_KEY" \
|
|
132
|
+
-H "Content-Type: application/json" \
|
|
133
|
+
-d '{"name": "VIP", "color": "#00FF00"}' \
|
|
134
|
+
https://apiv2.waiflow.app/api/v2/labels
|
|
135
|
+
|
|
136
|
+
# Sync label to WhatsApp Business
|
|
137
|
+
curl -X POST -H "X-API-Key: $MOLTFLOW_API_KEY" \
|
|
138
|
+
"https://apiv2.waiflow.app/api/v2/labels/{label_id}/sync?session_id={session_id}"
|
|
139
|
+
|
|
140
|
+
# Import labels from WhatsApp Business
|
|
141
|
+
curl -X POST -H "X-API-Key: $MOLTFLOW_API_KEY" \
|
|
142
|
+
"https://apiv2.waiflow.app/api/v2/labels/sync-from-whatsapp?session_id={session_id}"
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
| Endpoint | Method | Description |
|
|
146
|
+
|----------|--------|-------------|
|
|
147
|
+
| `/labels` | GET | List labels |
|
|
148
|
+
| `/labels` | POST | Create label |
|
|
149
|
+
| `/labels/business-check` | GET | Check WhatsApp Business status |
|
|
150
|
+
| `/labels/{id}` | GET / PATCH / DELETE | Get, update, delete label |
|
|
151
|
+
| `/labels/{id}/sync` | POST | Sync to WhatsApp Business |
|
|
152
|
+
| `/labels/sync-from-whatsapp` | POST | Import from WhatsApp |
|
|
153
|
+
|
|
154
|
+
## 5. Webhooks
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
# List webhooks
|
|
158
|
+
curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
|
|
159
|
+
https://apiv2.waiflow.app/api/v2/webhooks
|
|
160
|
+
|
|
161
|
+
# Test webhook
|
|
162
|
+
curl -X POST -H "X-API-Key: $MOLTFLOW_API_KEY" \
|
|
163
|
+
https://apiv2.waiflow.app/api/v2/webhooks/{webhook_id}/test
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
| Endpoint | Method | Description |
|
|
167
|
+
|----------|--------|-------------|
|
|
168
|
+
| `/webhooks` | GET | List webhooks |
|
|
169
|
+
| `/webhooks` | POST | Create webhook |
|
|
170
|
+
| `/webhooks/{id}` | GET / PATCH / DELETE | Get, update, delete |
|
|
171
|
+
| `/webhooks/{id}/test` | POST | Send test payload |
|
|
172
|
+
|
|
173
|
+
**Webhook events:** `message.received`, `message.sent`, `message.delivered`, `message.read`, `lead.detected`, `session.connected`, `session.disconnected`, `group.message`
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
## 6. AI — Voice Transcription
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
# Queue voice message for transcription
|
|
181
|
+
curl -X POST -H "X-API-Key: $MOLTFLOW_API_KEY" \
|
|
182
|
+
-d '{"message_id": "uuid-of-voice-message"}' \
|
|
183
|
+
https://apiv2.waiflow.app/api/v2/ai/voice/transcribe
|
|
184
|
+
|
|
185
|
+
# Check transcription status
|
|
186
|
+
curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
|
|
187
|
+
https://apiv2.waiflow.app/api/v2/ai/voice/status/{task_id}
|
|
188
|
+
|
|
189
|
+
# Get transcript
|
|
190
|
+
curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
|
|
191
|
+
https://apiv2.waiflow.app/api/v2/ai/messages/{message_id}/transcript
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
## 7. AI — Knowledge Base (RAG)
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
# Search knowledge base
|
|
198
|
+
curl -X POST -H "X-API-Key: $MOLTFLOW_API_KEY" \
|
|
199
|
+
-d '{"query": "return policy", "top_k": 5}' \
|
|
200
|
+
https://apiv2.waiflow.app/api/v2/ai/knowledge/search
|
|
201
|
+
|
|
202
|
+
# List knowledge sources
|
|
203
|
+
curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
|
|
204
|
+
https://apiv2.waiflow.app/api/v2/ai/knowledge/sources
|
|
205
|
+
|
|
206
|
+
# Delete knowledge source
|
|
207
|
+
curl -X DELETE -H "X-API-Key: $MOLTFLOW_API_KEY" \
|
|
208
|
+
https://apiv2.waiflow.app/api/v2/ai/knowledge/{source_id}
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
## 8. AI — Style Profiles (Learn Mode)
|
|
212
|
+
|
|
213
|
+
```bash
|
|
214
|
+
# Train style profile from message history
|
|
215
|
+
curl -X POST -H "X-API-Key: $MOLTFLOW_API_KEY" \
|
|
216
|
+
-d '{"contact_id": "optional-contact-jid"}' \
|
|
217
|
+
https://apiv2.waiflow.app/api/v2/ai/style/train
|
|
218
|
+
|
|
219
|
+
# Check training status
|
|
220
|
+
curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
|
|
221
|
+
https://apiv2.waiflow.app/api/v2/ai/style/status/{task_id}
|
|
222
|
+
|
|
223
|
+
# Get / list / delete style profiles
|
|
224
|
+
curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
|
|
225
|
+
https://apiv2.waiflow.app/api/v2/ai/style/profiles
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
## 9. AI — Reply Generation
|
|
229
|
+
|
|
230
|
+
```bash
|
|
231
|
+
# Generate AI reply (uses RAG + style)
|
|
232
|
+
curl -X POST -H "X-API-Key: $MOLTFLOW_API_KEY" \
|
|
233
|
+
-d '{"contact_id": "jid", "context": "customer question", "use_rag": true, "apply_style": true}' \
|
|
234
|
+
https://apiv2.waiflow.app/api/v2/ai/ai/generate-reply
|
|
235
|
+
|
|
236
|
+
# Preview AI reply (no usage tracking)
|
|
237
|
+
curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
|
|
238
|
+
"https://apiv2.waiflow.app/api/v2/ai/ai/preview?contact_id=jid&context=question&use_rag=true&apply_style=true"
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
### AI API Reference
|
|
242
|
+
|
|
243
|
+
| Endpoint | Method | Description |
|
|
244
|
+
|----------|--------|-------------|
|
|
245
|
+
| `/ai/voice/transcribe` | POST | Queue voice transcription |
|
|
246
|
+
| `/ai/voice/status/{task_id}` | GET | Check transcription status |
|
|
247
|
+
| `/ai/messages/{id}/transcript` | GET | Get transcript |
|
|
248
|
+
| `/ai/knowledge/ingest` | POST | Ingest document |
|
|
249
|
+
| `/ai/knowledge/search` | POST | Semantic search |
|
|
250
|
+
| `/ai/knowledge/sources` | GET | List knowledge sources |
|
|
251
|
+
| `/ai/knowledge/{id}` | DELETE | Delete source |
|
|
252
|
+
| `/ai/style/train` | POST | Train style profile |
|
|
253
|
+
| `/ai/style/status/{task_id}` | GET | Training status |
|
|
254
|
+
| `/ai/style/profile` | GET | Get style profile |
|
|
255
|
+
| `/ai/style/profiles` | GET | List all profiles |
|
|
256
|
+
| `/ai/style/profile/{id}` | DELETE | Delete profile |
|
|
257
|
+
| `/ai/ai/generate-reply` | POST | Generate AI reply |
|
|
258
|
+
| `/ai/ai/preview` | GET | Preview reply (no tracking) |
|
|
259
|
+
|
|
260
|
+
---
|
|
261
|
+
|
|
262
|
+
## 10. A2A — Agent-to-Agent Protocol
|
|
263
|
+
|
|
264
|
+
**Requires Business plan.** Uses JSON-RPC 2.0 over HTTPS with X25519-AES256GCM encryption.
|
|
265
|
+
|
|
266
|
+
### Bootstrap & encryption
|
|
267
|
+
|
|
268
|
+
```bash
|
|
269
|
+
# Get full configuration
|
|
270
|
+
curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
|
|
271
|
+
https://apiv2.waiflow.app/api/v2/agent/bootstrap
|
|
272
|
+
|
|
273
|
+
# Get your public key (auto-generates if none)
|
|
274
|
+
curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
|
|
275
|
+
https://apiv2.waiflow.app/api/v2/agent/public-key
|
|
276
|
+
|
|
277
|
+
# Rotate keypair
|
|
278
|
+
curl -X POST -H "X-API-Key: $MOLTFLOW_API_KEY" \
|
|
279
|
+
https://apiv2.waiflow.app/api/v2/agent/rotate-keys
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
### Discover agents
|
|
283
|
+
|
|
284
|
+
```bash
|
|
285
|
+
# Resolve phone to MoltFlow agent
|
|
286
|
+
curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
|
|
287
|
+
https://apiv2.waiflow.app/api/v2/agents/resolve/+1234567890
|
|
288
|
+
|
|
289
|
+
# List peers
|
|
290
|
+
curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
|
|
291
|
+
https://apiv2.waiflow.app/api/v2/agents/peers
|
|
292
|
+
|
|
293
|
+
# Update trust level (discovered, verified, blocked)
|
|
294
|
+
curl -X PATCH -H "X-API-Key: $MOLTFLOW_API_KEY" \
|
|
295
|
+
-H "Content-Type: application/json" \
|
|
296
|
+
-d '{"trust_level": "verified"}' \
|
|
297
|
+
https://apiv2.waiflow.app/api/v2/agents/peers/{peer_id}/trust
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
### Send A2A messages (JSON-RPC 2.0)
|
|
301
|
+
|
|
302
|
+
```bash
|
|
303
|
+
curl -X POST -H "X-API-Key: $MOLTFLOW_API_KEY" \
|
|
304
|
+
-H "Content-Type: application/json" \
|
|
305
|
+
-d '{
|
|
306
|
+
"jsonrpc": "2.0",
|
|
307
|
+
"method": "agent.message.send",
|
|
308
|
+
"params": {
|
|
309
|
+
"phone": "+1234567890",
|
|
310
|
+
"message": {"parts": [{"text": "Hello from my agent!"}]}
|
|
311
|
+
},
|
|
312
|
+
"id": "1"
|
|
313
|
+
}' \
|
|
314
|
+
https://apiv2.waiflow.app/api/v2/a2a
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
### Content policy
|
|
318
|
+
|
|
319
|
+
```bash
|
|
320
|
+
# Get policy settings
|
|
321
|
+
curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
|
|
322
|
+
https://apiv2.waiflow.app/api/v2/a2a-policy/settings
|
|
323
|
+
|
|
324
|
+
# Update policy
|
|
325
|
+
curl -X PUT -H "X-API-Key: $MOLTFLOW_API_KEY" \
|
|
326
|
+
-H "Content-Type: application/json" \
|
|
327
|
+
-d '{"block_api_keys": true, "block_credit_cards": true, "block_emails": false}' \
|
|
328
|
+
https://apiv2.waiflow.app/api/v2/a2a-policy/settings
|
|
329
|
+
|
|
330
|
+
# Test content against policy
|
|
331
|
+
curl -X POST -H "X-API-Key: $MOLTFLOW_API_KEY" \
|
|
332
|
+
-H "Content-Type: application/json" \
|
|
333
|
+
-d '{"content": "My API key is sk-abc123"}' \
|
|
334
|
+
https://apiv2.waiflow.app/api/v2/a2a-policy/test
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
### A2A API Reference
|
|
338
|
+
|
|
339
|
+
| Endpoint | Method | Description |
|
|
340
|
+
|----------|--------|-------------|
|
|
341
|
+
| `/agent/bootstrap` | GET | Full onboarding config |
|
|
342
|
+
| `/agent/public-key` | GET | Get X25519 public key |
|
|
343
|
+
| `/agent/rotate-keys` | POST | Rotate keypair |
|
|
344
|
+
| `/agent/peer/{tenant_id}/public-key` | GET | Peer's public key |
|
|
345
|
+
| `/agents/resolve/{phone}` | GET | Resolve phone to agent |
|
|
346
|
+
| `/agents/peers` | GET | List discovered peers |
|
|
347
|
+
| `/agents/peers/{id}/trust` | PATCH | Update trust level |
|
|
348
|
+
| `/a2a` | POST | JSON-RPC 2.0 endpoint |
|
|
349
|
+
| `/a2a-policy/settings` | GET/PUT | Get/update policy |
|
|
350
|
+
| `/a2a-policy/rules` | POST | Add custom filter rule |
|
|
351
|
+
| `/a2a-policy/test` | POST | Test content against policy |
|
|
352
|
+
| `/a2a-policy/stats` | GET | Blocking statistics |
|
|
353
|
+
|
|
354
|
+
**JSON-RPC methods:** `agent.message.send`, `group.getContext`, `agent.group.create`, `agent.group.invite`, `agent.group.list`, `webhook_manager`
|
|
355
|
+
|
|
356
|
+
**Trust levels:** `discovered` → `verified` → `blocked`
|
|
357
|
+
|
|
358
|
+
**Encryption:** X25519-AES256GCM, ECDH key exchange, HKDF-SHA256, 32-byte keys (base64)
|
|
359
|
+
|
|
360
|
+
---
|
|
361
|
+
|
|
362
|
+
## 11. Reviews — Sentiment Analysis & Testimonials
|
|
363
|
+
|
|
364
|
+
```bash
|
|
365
|
+
# Create review collector
|
|
366
|
+
curl -X POST -H "X-API-Key: $MOLTFLOW_API_KEY" \
|
|
367
|
+
-d '{
|
|
368
|
+
"name": "Customer Feedback",
|
|
369
|
+
"session_id": "uuid-of-whatsapp-session",
|
|
370
|
+
"source_type": "groups",
|
|
371
|
+
"min_positive_words": 3,
|
|
372
|
+
"min_sentiment_score": 0.6,
|
|
373
|
+
"include_keywords": ["great", "excellent"],
|
|
374
|
+
"languages": []
|
|
375
|
+
}' \
|
|
376
|
+
https://apiv2.waiflow.app/api/v2/reviews/collectors
|
|
377
|
+
|
|
378
|
+
# Trigger manual scan
|
|
379
|
+
curl -X POST -H "X-API-Key: $MOLTFLOW_API_KEY" \
|
|
380
|
+
https://apiv2.waiflow.app/api/v2/reviews/collectors/{id}/run
|
|
381
|
+
|
|
382
|
+
# List reviews
|
|
383
|
+
curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
|
|
384
|
+
"https://apiv2.waiflow.app/api/v2/reviews?approved_only=false&limit=50"
|
|
385
|
+
|
|
386
|
+
# Approve review
|
|
387
|
+
curl -X PATCH -H "X-API-Key: $MOLTFLOW_API_KEY" \
|
|
388
|
+
-d '{"is_approved": true}' \
|
|
389
|
+
https://apiv2.waiflow.app/api/v2/reviews/{id}
|
|
390
|
+
|
|
391
|
+
# Export testimonials as HTML
|
|
392
|
+
curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
|
|
393
|
+
"https://apiv2.waiflow.app/api/v2/reviews/testimonials/export?format=html"
|
|
394
|
+
```
|
|
395
|
+
|
|
396
|
+
### Reviews API Reference
|
|
397
|
+
|
|
398
|
+
| Endpoint | Method | Description |
|
|
399
|
+
|----------|--------|-------------|
|
|
400
|
+
| `/reviews/collectors` | GET/POST | List/create collectors |
|
|
401
|
+
| `/reviews/collectors/{id}` | GET/PATCH/DELETE | Manage collector |
|
|
402
|
+
| `/reviews/collectors/{id}/run` | POST | Trigger scan |
|
|
403
|
+
| `/reviews` | GET | List reviews |
|
|
404
|
+
| `/reviews/stats` | GET | Review statistics |
|
|
405
|
+
| `/reviews/{id}` | GET/PATCH/DELETE | Manage review |
|
|
406
|
+
| `/reviews/testimonials/export` | GET | Export (format=json/html) |
|
|
407
|
+
|
|
408
|
+
**Supported languages (14+):** English, Spanish, Portuguese, French, German, Italian, Dutch, Russian, Arabic, Hebrew, Chinese, Japanese, Korean, Hindi, Turkish
|
|
409
|
+
|
|
410
|
+
**Collector fields:** `name`, `session_id`, `source_type` (all/groups/chats/selected), `min_positive_words` (1-10), `min_sentiment_score` (0.0-1.0), `include_keywords`, `exclude_keywords`, `languages`
|
|
411
|
+
|
|
412
|
+
---
|
|
413
|
+
|
|
414
|
+
## 12. Auth & API Keys
|
|
415
|
+
|
|
416
|
+
```bash
|
|
417
|
+
# Login
|
|
418
|
+
curl -X POST -d '{"email": "user@example.com", "password": "..."}' \
|
|
419
|
+
https://apiv2.waiflow.app/api/v2/auth/login
|
|
420
|
+
|
|
421
|
+
# Get current user
|
|
422
|
+
curl -H "Authorization: Bearer $TOKEN" \
|
|
423
|
+
https://apiv2.waiflow.app/api/v2/auth/me
|
|
424
|
+
|
|
425
|
+
# Create API key
|
|
426
|
+
curl -X POST -H "Authorization: Bearer $TOKEN" \
|
|
427
|
+
-d '{"name": "Production Key", "expires_in_days": 90}' \
|
|
428
|
+
https://apiv2.waiflow.app/api/v2/api-keys
|
|
429
|
+
|
|
430
|
+
# Revoke key
|
|
431
|
+
curl -X DELETE -H "Authorization: Bearer $TOKEN" \
|
|
432
|
+
https://apiv2.waiflow.app/api/v2/api-keys/{id}
|
|
433
|
+
|
|
434
|
+
# Rotate key
|
|
435
|
+
curl -X POST -H "Authorization: Bearer $TOKEN" \
|
|
436
|
+
https://apiv2.waiflow.app/api/v2/api-keys/{id}/rotate
|
|
437
|
+
```
|
|
438
|
+
|
|
439
|
+
| Endpoint | Method | Description |
|
|
440
|
+
|----------|--------|-------------|
|
|
441
|
+
| `/auth/login` | POST | Login (email/password), returns JWT |
|
|
442
|
+
| `/auth/refresh` | POST | Refresh token |
|
|
443
|
+
| `/auth/me` | GET | Current user + tenant |
|
|
444
|
+
| `/auth/magic-link/request` | POST | Request magic link |
|
|
445
|
+
| `/api-keys` | GET/POST | List/create API keys |
|
|
446
|
+
| `/api-keys/{id}` | GET/DELETE | Get/revoke key |
|
|
447
|
+
| `/api-keys/{id}/rotate` | POST | Rotate key |
|
|
448
|
+
|
|
449
|
+
## 13. Usage & Billing
|
|
450
|
+
|
|
451
|
+
```bash
|
|
452
|
+
# Current period usage
|
|
453
|
+
curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
|
|
454
|
+
https://apiv2.waiflow.app/api/v2/usage/current
|
|
455
|
+
|
|
456
|
+
# Daily breakdown
|
|
457
|
+
curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
|
|
458
|
+
"https://apiv2.waiflow.app/api/v2/usage/daily?days=30"
|
|
459
|
+
|
|
460
|
+
# List plans
|
|
461
|
+
curl https://apiv2.waiflow.app/api/v2/billing/plans
|
|
462
|
+
|
|
463
|
+
# Create checkout session
|
|
464
|
+
curl -X POST -H "Authorization: Bearer $TOKEN" \
|
|
465
|
+
-d '{"plan": "pro", "cycle": "monthly", "success_url": "https://...", "cancel_url": "https://..."}' \
|
|
466
|
+
https://apiv2.waiflow.app/api/v2/billing/checkout
|
|
467
|
+
|
|
468
|
+
# Billing portal
|
|
469
|
+
curl -H "Authorization: Bearer $TOKEN" \
|
|
470
|
+
https://apiv2.waiflow.app/api/v2/billing/portal
|
|
471
|
+
```
|
|
472
|
+
|
|
473
|
+
| Endpoint | Method | Description |
|
|
474
|
+
|----------|--------|-------------|
|
|
475
|
+
| `/usage/current` | GET | Current period usage + limits |
|
|
476
|
+
| `/usage/history` | GET | Historical usage |
|
|
477
|
+
| `/usage/daily` | GET | Daily breakdown |
|
|
478
|
+
| `/billing/plans` | GET | Available plans |
|
|
479
|
+
| `/billing/subscription` | GET | Current subscription |
|
|
480
|
+
| `/billing/checkout` | POST | Stripe checkout session |
|
|
481
|
+
| `/billing/portal` | GET | Stripe billing portal |
|
|
482
|
+
| `/billing/cancel` | POST | Cancel subscription |
|
|
483
|
+
|
|
484
|
+
---
|
|
485
|
+
|
|
486
|
+
## Notes
|
|
487
|
+
|
|
488
|
+
- All messages include anti-spam compliance (typing indicators, random delays)
|
|
489
|
+
- Rate limits by plan: Free 10/min, Starter 60/min, Pro 300/min, Business 1000/min
|
|
490
|
+
- Sessions require QR code pairing on first connect
|
|
491
|
+
- Use E.164 phone format without `+` where required
|
|
492
|
+
- AI features require Pro plan or above
|
|
493
|
+
- A2A protocol requires Business plan
|
|
494
|
+
- AI reply generation includes safety: input sanitization, intent verification, output filtering, PII/secrets detection
|
|
495
|
+
- Content policy filters secrets (API keys, tokens) and PII (SSN, credit cards)
|
|
496
|
+
- API keys use name + expires_in_days (no scopes param); raw key shown only once at creation
|
|
497
|
+
- Respect WhatsApp opt-in, business hours, and opt-out requests
|
|
498
|
+
|
|
499
|
+
<!-- FILEMAP:BEGIN -->
|
|
500
|
+
```text
|
|
501
|
+
[moltflow file map]|root: .
|
|
502
|
+
|.:{SKILL.md,package.json}
|
|
503
|
+
|scripts:{quickstart.py,a2a_client.py,send_message.py,admin.py,ai_config.py,reviews.py}
|
|
504
|
+
```
|
|
505
|
+
<!-- FILEMAP:END -->
|
package/package.json
CHANGED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
"""
|
|
3
|
-
A2A Discovery Script
|
|
4
|
-
Fetches and validates the agent.json card.
|
|
5
|
-
"""
|
|
6
|
-
import requests
|
|
7
|
-
import sys
|
|
8
|
-
import json
|
|
9
|
-
import argparse
|
|
10
|
-
from typing import Dict, Any
|
|
11
|
-
|
|
12
|
-
def discover_agent(base_url: str) -> Dict[str, Any]:
|
|
13
|
-
"""
|
|
14
|
-
Fetch the .well-known/agent.json from the base URL.
|
|
15
|
-
"""
|
|
16
|
-
# Ensure URL doesn't end with slash to avoid double slashes
|
|
17
|
-
url = f"{base_url.rstrip('/')}/.well-known/agent.json"
|
|
18
|
-
|
|
19
|
-
try:
|
|
20
|
-
response = requests.get(url, timeout=10)
|
|
21
|
-
response.raise_for_status()
|
|
22
|
-
|
|
23
|
-
data = response.json()
|
|
24
|
-
|
|
25
|
-
# Validation
|
|
26
|
-
if "supportedInterfaces" not in data:
|
|
27
|
-
print(f"WARNING: {url} response missing 'supportedInterfaces'.", file=sys.stderr)
|
|
28
|
-
|
|
29
|
-
return data
|
|
30
|
-
|
|
31
|
-
except requests.exceptions.RequestException as e:
|
|
32
|
-
# Return a structured error for the agent to parse
|
|
33
|
-
return {
|
|
34
|
-
"error": True,
|
|
35
|
-
"message": f"Discovery failed: {str(e)}",
|
|
36
|
-
"url": url
|
|
37
|
-
}
|
|
38
|
-
except json.JSONDecodeError:
|
|
39
|
-
return {
|
|
40
|
-
"error": True,
|
|
41
|
-
"message": "Invalid JSON response from endpoint",
|
|
42
|
-
"url": url
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
if __name__ == "__main__":
|
|
46
|
-
parser = argparse.ArgumentParser(description="Discover MoltFlow Agent capabilities.")
|
|
47
|
-
parser.add_argument("url", help="Base URL of the agent (e.g., https://api.waiflow.app)")
|
|
48
|
-
|
|
49
|
-
args = parser.parse_args()
|
|
50
|
-
|
|
51
|
-
card = discover_agent(args.url)
|
|
52
|
-
|
|
53
|
-
# Output solely JSON for easy parsing by calling agent
|
|
54
|
-
print(json.dumps(card, indent=2))
|