List WhatsApp Flows with AvenPing API
/v2/formsmaps to Meta flows. List and detail come from Graph; search uses the AvenPing database. Auth, Premium/Enterprise, and an active plan are required.
Base: /v2/forms
Auth + Premium/Enterprise + active plan required. See HTTP API v2 Overview.
Prerequisites
- An API token and Premium/Enterprise plan (Authentication)
- A linked WhatsApp Business account (GET /v2/me)
- Optional:
phoneNumberIdoraccountIdwhen you need a non-default WABA
Step-by-step
Authenticate
SendAuthorization: Bearer YOUR_TOKENorX-API-Token: YOUR_TOKEN.Select the WABA (optional)
Pass queryphoneNumberIdoraccountIdon list, search, and get-by-id — same selector as Templates. Without them, list/get use the default WABA; search queries all linked WABAs.List or search
GET /v2/formslists Meta flows from Graph.GET /v2/forms/searchqueries AvenPing DB rows (q,limit1–50). Call/searchas a path so it is not treated as a flow id.Fetch one flow
GET /v2/forms/:flowIdreturns the Graph object for that flow. MissingflowIdreturns400 VALIDATION_ERROR. Graph 4xx map to the same error envelope as other proxied routes.
GET /v2/forms
Query (optional): limit (default "25"), after (cursor), phoneNumberId, accountId (same WABA selection as Templates).
Example request:
bash
curl -sS "https://api.avenping.com/v2/forms?limit=25" \
-H "Authorization: Bearer YOUR_TOKEN"Response 200:
json
{
"success": true,
"data": {
"items": [
{
"id": "flow-id-from-meta",
"name": "Lead capture",
"status": "PUBLISHED",
"categories": ["OTHER"]
}
],
"paging": {
"cursors": {
"after": "QVFIUz..."
}
}
}
}items are Meta flow objects from GET /{waba-id}/flows (fields vary).
GET /v2/forms/search
Query
| Name | Type | Default | Notes |
|---|---|---|---|
q | string | — | Optional filter on name (contains) or status (exact uppercased match) |
limit | integer | 20 | 1–50 |
phoneNumberId / accountId | string | — | When set, search only that WABA’s rows; otherwise all linked WABAs |
Example request:
bash
curl -sS "https://api.avenping.com/v2/forms/search?q=lead&limit=10" \
-H "Authorization: Bearer YOUR_TOKEN"Response 200 — each item is a WhatsAppForm row (Prisma); shape is illustrative:
json
{
"success": true,
"data": {
"items": [
{
"id": "flow-id-from-meta",
"name": "Lead capture",
"status": "PUBLISHED",
"validation": [],
"accountId": "clu01exampleaccountid01",
"createdAt": "2025-02-10T12:00:00.000Z",
"updatedAt": "2025-02-11T09:15:00.000Z",
"_count": {
"responses": 0
}
}
]
}
}Note: The server registers /search before /:flowId. Call GET /v2/forms/search?q=... so the path is not confused with GET /v2/forms/:flowId.
GET /v2/forms/:flowId
Same optional phoneNumberId / accountId query as list (Graph is called with that WABA’s token).
Example request:
bash
curl -sS "https://api.avenping.com/v2/forms/flow-id-from-meta" \
-H "Authorization: Bearer YOUR_TOKEN"Response 200 — data is the raw Graph object for GET /{flow-id} (Meta node). Shape varies; often includes id, name, status, and flow definition fields.
json
{
"success": true,
"data": {
"id": "flow-id-from-meta",
"name": "Lead capture",
"status": "PUBLISHED"
}
}FAQ
Why is search a different path from list?
GET /v2/forms lists Meta flows from Graph. GET /v2/forms/search queries AvenPing DB rows. Call /search before /:flowId so search is not treated as a flow id.
Can I list flows for a specific WABA?
Yes. Pass phoneNumberId or accountId as query parameters on list, search, and get-by-id. Search without a selector includes rows from all linked WABAs.
What happens if the flow id is missing?
GET /v2/forms/:flowId returns 400 VALIDATION_ERROR when flowId is empty. Graph errors follow the same envelope as other proxied routes (VALIDATION_ERROR for most 4xx, with details when Meta returns a payload).