Pingwa Actions API
The Actions API from Pingwa — 8 operation(s) for actions.
The Actions API from Pingwa — 8 operation(s) for actions.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/pingwa-dev:pingwa-dev-actions-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: pingwa Actions API
version: 0.1.0
tags:
- name: Actions
paths:
/v1/actions:
post:
summary: Create Action
description: 'Create an action: a button the owner taps in WhatsApp after writing `menu`.
Without `target_url` the action is delivered by pull only: each tap''s event waits up
to 60 seconds for a listener on GET /v1/actions/events (`pingwa listen`), which posts
the result to /v1/actions/events/{run_id}/result.
Each tap sends ONE POST to `target_url` (no retry, settings.action_timeout_s timeout),
signed like the inbound webhook: header `X-Pingwa-Signature: sha256=`, the
HMAC-SHA256 of the exact raw body with this action''s `secret`. Body:
`{"event": "action_triggered", "run_id", "action_id", "label",
"actor": {"name", "role"}, "triggered_at"}` (never a phone number). Answer 2xx, with
`{"reply": "..."}` to choose the text sent back (else `reply_ok`, else "Done");
anything else answers "Could not run ". Each run counts as one message.
`"kind": "report"` (control-06): the tap records who and when, plus up to 3 `inputs`
asked one after another (`{"type": "text|number|choice|location|photo", "label",
"required", "options"}`); stored and charged once when complete, then POSTed (event
`action_report`, retried, `event_id` = the run id) when `target_url` is set. A
report''s `confirm` is ignored.
`"near": {"lat", "lon", "radius_m"}` (control-09, a trigger only; radius_m 50 to
50000): the tap (after confirm) asks for the person''s location; a point inside the
radius runs it and the event gets `location` {lat, lon, distance_m}, outside nothing
runs. A person can still drop a pin anywhere: friction and a record, not proof.
`"sign_query": true` (control-07, for a receiver that cannot read headers, such as
Google Apps Script): every delivery''s URL also gets
`pingwa_signature=sha256%3D` (the same signature, URL-encoded) after its own
query, and a 302 or 303 answer counts as delivered (never followed).
The `secret` (whsec_...) is in this response ONLY: store it to verify the signature.'
operationId: create_action_v1_actions_post
parameters:
- name: authorization
in: header
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: Authorization
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/ActionIn'
responses:
'201':
description: Successful Response
content:
application/json:
schema:
type: object
additionalProperties: true
title: Response Create Action V1 Actions Post
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
tags:
- Actions
get:
summary: List Actions
description: 'This number''s active actions, in `menu` order (oldest first), and how many its plan
allows; past that (after a downgrade) an action is over_plan_limit: it stays, but
neither shows nor runs. The secret is never returned here.'
operationId: list_actions_v1_actions_get
parameters:
- name: authorization
in: header
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: Authorization
responses:
'200':
description: Successful Response
content:
application/json:
schema:
type: object
additionalProperties: true
title: Response List Actions V1 Actions Get
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
tags:
- Actions
/v1/actions/runs:
get:
summary: List Action Runs
description: 'The runs of this number''s actions, newest first: triggers (answers null) and
reports (their answers, in asking order; a photo with a signed /v1/media URL valid
settings.media_url_ttl). Filters: `action_id`, `since` / `until` (ISO dates, UTC days,
both included; or date-times). Pages of `limit` (at most 200), the next one with
`before=` (a run id, or an ISO date-time). `?format=csv`: the same
filters, up to 5000 rows, columns time, action, actor, result and one per input
label; a cell that starts with = + - @ is prefixed with '' (never a formula).'
operationId: list_action_runs_v1_actions_runs_get
parameters:
- name: action_id
in: query
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: Action Id
- name: since
in: query
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: Since
- name: until
in: query
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: Until
- name: limit
in: query
required: false
schema:
type: integer
minimum: 1
default: 50
title: Limit
- name: before
in: query
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: Before
- name: format
in: query
required: false
schema:
enum:
- json
- csv
type: string
default: json
title: Format
- name: authorization
in: header
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: Authorization
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
tags:
- Actions
/v1/actions/pause:
post:
summary: Pause Actions
description: 'Stop every action of this number at once (a lost phone, a guest who should not get
in): until POST /v1/actions/resume (or `resume` from the owner''s WhatsApp) nothing runs,
whoever taps (the owner, a team member, a guest) and from wherever; each refused tap is
a run with result `paused`. The same as `pause` from the owner''s WhatsApp. Pausing
twice changes nothing. GET /v1/me says `actions_paused`.'
operationId: pause_actions_v1_actions_pause_post
parameters:
- name: authorization
in: header
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: Authorization
responses:
'200':
description: Successful Response
content:
application/json:
schema:
type: object
additionalProperties: true
title: Response Pause Actions V1 Actions Pause Post
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
tags:
- Actions
/v1/actions/resume:
post:
summary: Resume Actions
description: 'Undo POST /v1/actions/pause (or `pause` from WhatsApp): actions run again.'
operationId: resume_actions_v1_actions_resume_post
parameters:
- name: authorization
in: header
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: Authorization
responses:
'200':
description: Successful Response
content:
application/json:
schema:
type: object
additionalProperties: true
title: Response Resume Actions V1 Actions Resume Post
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
tags:
- Actions
/v1/actions/{action_id}:
patch:
summary: Update Action
description: 'Change an action''s label, target_url, confirm, reply_ok (null: back to "Done") or
(control-03) notify_owner, (control-09) near (null: no location asked); only the fields sent change. target_url is checked as at create; null makes it a pull
action (a listener on GET /v1/actions/events), a URL a push one. The secret stays.'
operationId: update_action_v1_actions__action_id__patch
parameters:
- name: action_id
in: path
required: true
schema:
type: string
title: Action Id
- name: authorization
in: header
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: Authorization
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/ActionPatch'
responses:
'200':
description: Successful Response
content:
application/json:
schema:
type: object
additionalProperties: true
title: Response Update Action V1 Actions Action Id Patch
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
tags:
- Actions
delete:
summary: Delete Action
description: 'Delete an action: it leaves the menu at once, an old menu''s button for it answers
"not available", and its secret is not kept. Its run history stays.'
operationId: delete_action_v1_actions__action_id__delete
parameters:
- name: action_id
in: path
required: true
schema:
type: string
title: Action Id
- name: authorization
in: header
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: Authorization
responses:
'200':
description: Successful Response
content:
application/json:
schema:
type: object
additionalProperties: true
title: Response Delete Action V1 Actions Action Id Delete
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
tags:
- Actions
/v1/actions/{action_id}/rotate-secret:
post:
summary: Rotate Action Secret
description: 'control-12: a new signing secret for this action (a leaked secret, a receiver handed
to someone else). The new `secret` (whsec_...) is in this response ONLY; the old one
stops at once: every delivery after this signs with the new one. The key requirement
of PATCH /v1/actions/{id} (fix round 1: not stricter): scope `manage`, the action of
the key''s own number (a secondary number''s key rotates its own number''s actions).
Another number''s or a deleted action is 404. An action_rotated event goes on the
number''s ledger; the secret is never logged.'
operationId: rotate_action_secret_v1_actions__action_id__rotate_secret_post
parameters:
- name: action_id
in: path
required: true
schema:
type: string
title: Action Id
- name: authorization
in: header
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: Authorization
responses:
'200':
description: Successful Response
content:
application/json:
schema:
type: object
additionalProperties: true
title: Response Rotate Action Secret V1 Actions Action Id Rotate Secret Post
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
tags:
- Actions
/v1/actions/events:
get:
summary: Action Events Poll
description: 'The tapped pull actions of this number (actions without target_url), long-poll up
to `wait` seconds (capped at 30): `{"events": [...]}`, empty on timeout, at most `max`
a call (1 to 10; default 10: ask for as many as you can start now). An event is the
webhook body (`event` action_triggered, `run_id`, `action_id`, `label`, `actor`,
`triggered_at`) plus `expires_at` and `take_deadline` (the take + 15 seconds, the
server''s clock: a result after it is refused, so do not start a command that cannot
finish before it). Each event is handed to ONE caller, once; an event older than 60
seconds is never handed out (the person is told nobody was listening). Answer each
within 15 seconds with POST /v1/actions/events/{run_id}/result. A caller that is gone
is never handed an event. There is no cursor: what is handed out is
gone from the queue. Scope `actions:listen` (or a full key); at most 4 long-polls at
once per key (429 too_many_listeners).'
operationId: action_events_poll_v1_actions_events_get
parameters:
- name: wait
in: query
required: false
schema:
type: integer
default: 0
title: Wait
- name: max
in: query
required: false
schema:
anyOf:
- type: integer
minimum: 1
- type: 'null'
title: Max
- name: authorization
in: header
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: Authorization
responses:
'200':
description: Successful Response
content:
application/json:
schema:
type: object
additionalProperties: true
title: Response Action Events Poll V1 Actions Events Get
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
tags:
- Actions
/v1/actions/events/{run_id}/result:
post:
summary: Action Event Result
description: 'The result of a run a listener took: `{"ok": true|false, "reply": "..."}`. The
person who tapped gets `reply` (cleaned, cut at a word past 1024 characters) or, ok,
the action''s reply_ok or "Done: "; not ok, "Could not run " (with the
reply after a colon when there is one). Once per run (409 result_already_sent), within
15 seconds of taking the event (410 result_too_late: the person was told "No answer
from "); another number''s run or an unknown id is 404, a run whose event was not
handed out 409 run_not_taken.'
operationId: action_event_result_v1_actions_events__run_id__result_post
parameters:
- name: run_id
in: path
required: true
schema:
type: string
title: Run Id
- name: authorization
in: header
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: Authorization
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/ResultIn'
responses:
'200':
description: Successful Response
content:
application/json:
schema:
type: object
additionalProperties: true
title: Response Action Event Result V1 Actions Events Run Id Result Post
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
tags:
- Actions
components:
schemas:
HTTPValidationError:
properties:
detail:
items:
$ref: '#/components/schemas/ValidationError'
type: array
title: Detail
type: object
title: HTTPValidationError
Near:
properties:
lat:
type: number
title: Lat
lon:
type: number
title: Lon
radius_m:
type: number
title: Radius M
additionalProperties: false
type: object
required:
- lat
- lon
- radius_m
title: Near
description: 'control-09: run only near this point: the tap asks for the person''s location, and
a point within radius_m metres (haversine) runs it (near.py).'
ValidationError:
properties:
loc:
items:
anyOf:
- type: string
- type: integer
type: array
title: Location
msg:
type: string
title: Message
type:
type: string
title: Error Type
input:
title: Input
ctx:
type: object
title: Context
type: object
required:
- loc
- msg
- type
title: ValidationError
ActionIn:
properties:
label:
type: string
title: Label
target_url:
anyOf:
- type: string
- type: 'null'
title: Target Url
confirm:
type: boolean
title: Confirm
default: false
reply_ok:
anyOf:
- type: string
maxLength: 1024
- type: 'null'
title: Reply Ok
kind:
type: string
enum:
- trigger
- report
title: Kind
default: trigger
inputs:
anyOf:
- items:
$ref: '#/components/schemas/ReportInput'
type: array
- type: 'null'
title: Inputs
notify_owner:
type: string
enum:
- in_window
- always
- never
title: Notify Owner
default: in_window
sign_query:
type: boolean
title: Sign Query
default: false
near:
anyOf:
- $ref: '#/components/schemas/Near'
- type: 'null'
type: object
required:
- label
title: ActionIn
ResultIn:
properties:
ok:
type: boolean
title: Ok
reply:
anyOf:
- type: string
maxLength: 65536
- type: 'null'
title: Reply
type: object
required:
- ok
title: ResultIn
ActionPatch:
properties:
label:
anyOf:
- type: string
- type: 'null'
title: Label
target_url:
anyOf:
- type: string
- type: 'null'
title: Target Url
confirm:
anyOf:
- type: boolean
- type: 'null'
title: Confirm
reply_ok:
anyOf:
- type: string
maxLength: 1024
- type: 'null'
title: Reply Ok
kind:
anyOf:
- type: string
- type: 'null'
title: Kind
inputs:
anyOf:
- items:
$ref: '#/components/schemas/ReportInput'
type: array
- type: 'null'
title: Inputs
notify_owner:
anyOf:
- type: string
enum:
- in_window
- always
- never
- type: 'null'
title: Notify Owner
sign_query:
anyOf:
- type: boolean
- type: 'null'
title: Sign Query
near:
anyOf:
- $ref: '#/components/schemas/Near'
- type: 'null'
type: object
title: ActionPatch
ReportInput:
properties:
type:
type: string
enum:
- text
- number
- choice
- location
- photo
title: Type
label:
type: string
title: Label
required:
type: boolean
title: Required
default: true
options:
anyOf:
- items:
type: string
type: array
- type: 'null'
title: Options
type: object
required:
- type
- label
title: ReportInput
description: 'control-06: one question of a report action, asked after the tap in this order.'