n8n-nodes-pilot-status 2.19.0 → 2.21.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/CHANGELOG.md +162 -0
- package/README.md +120 -4
- package/dist/credentials/PilotStatusApi.credentials.d.ts +3 -1
- package/dist/credentials/PilotStatusApi.credentials.js +4 -1
- package/dist/credentials/PilotStatusChatwootApi.credentials.d.ts +13 -0
- package/dist/credentials/PilotStatusChatwootApi.credentials.js +28 -0
- package/dist/credentials/PilotStatusMetaNumberApi.credentials.d.ts +13 -0
- package/dist/credentials/PilotStatusMetaNumberApi.credentials.js +37 -0
- package/dist/credentials/version.d.ts +1 -1
- package/dist/credentials/version.js +1 -1
- package/dist/nodes/PilotStatus/PilotStatus.node.d.ts +145 -0
- package/dist/nodes/PilotStatus/PilotStatus.node.js +2405 -117
- package/dist/nodes/PilotStatusTrigger/PilotStatusTrigger.node.js +1 -0
- package/package.json +4 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,168 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `n8n-nodes-pilot-status`.
|
|
4
4
|
|
|
5
|
+
## 2.21.0 - 2026-11-29
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- Every request sends `x-pilot-status-client: n8n/<version>`, which the API reads before the
|
|
10
|
+
User-Agent. A browser `fetch` cannot set `User-Agent`, so without it browser calls were
|
|
11
|
+
counted as `browser` instead of as this client.
|
|
12
|
+
|
|
13
|
+
- **Pilot Status Meta Number** credential (`pilotStatusMetaNumberApi`: Meta Access Token,
|
|
14
|
+
Meta App Secret) and **Pilot Status Chatwoot** credential (`pilotStatusChatwootApi`: User
|
|
15
|
+
Access Token). The secrets of **Number → Create Meta Number** and **Chatwoot → Connect /
|
|
16
|
+
Test / Update** now come from these credentials, encrypted in n8n's database, instead of
|
|
17
|
+
node parameters, which n8n writes in plain text into the workflow JSON on export or share.
|
|
18
|
+
The `metaAccessToken`, `metaAppSecret` and Chatwoot `userAccessToken` parameters are gone;
|
|
19
|
+
ids (Phone Number ID, WABA ID, App ID, Instance URL, Account ID) stay as parameters.
|
|
20
|
+
Chatwoot → Update replaces the token only with **Replace Token** on; without a credential
|
|
21
|
+
no token is sent and the stored one is kept. **Not breaking for published users:** those
|
|
22
|
+
parameters only existed in unreleased 2.21.0 work (Chatwoot already on `develop`, never
|
|
23
|
+
published); no published version had them.
|
|
24
|
+
|
|
25
|
+
- **Webhook → Get Many** (`GET /v1/webhooks`): every number webhook in the credential's
|
|
26
|
+
scope, never the secret, with the circuit-breaker status. Needs `webhooks:read`.
|
|
27
|
+
- **Webhook → Update** (`PATCH /v1/webhooks/{id}`): only the fields added under **Update
|
|
28
|
+
Fields** are sent — **Name**, **URL**, **Events** (comma-separated, REPLACES the list) and
|
|
29
|
+
**Active** (off pauses the webhook). The number of a webhook is not changeable here.
|
|
30
|
+
- **Webhook → Get Logs** (`GET /v1/webhooks/{id}/logs`): the latest delivery attempts,
|
|
31
|
+
`{ webhookId, logs }`, with **Limit** (1–50, query `limit`) and **Event** (query `event`).
|
|
32
|
+
- **Template → Create** (`POST /v1/templates`): **Name**, **Body** (text with `{{variables}}`
|
|
33
|
+
or the template JSON), **Examples (JSON)** and, under Additional Fields, **Category** and
|
|
34
|
+
**Language**. The number/WABA come from the credential; `variables` is derived by the API.
|
|
35
|
+
- **Template → Update** (`PUT /v1/templates/{id}`): **Body** and **Examples (JSON)** only
|
|
36
|
+
(the API ignores name, category and language on update).
|
|
37
|
+
- **Message → Get Group Messages** (`GET /v1/messages/group`): Start/End Date, Page and Page
|
|
38
|
+
Size, the same fields as Get History.
|
|
39
|
+
- **Message → Get Unread Counts** (`GET /v1/messages/unread/counts`): optional **WhatsApp
|
|
40
|
+
Number IDs** (comma-separated, max 100), sent as `whatsappNumberIds`.
|
|
41
|
+
- **Message → Resend** (`POST /v1/messages/{id}/resend`): resends a FAILED/CANCELED message
|
|
42
|
+
as a new one; no body.
|
|
43
|
+
- **Group → Create** (`POST /v1/groups`): **Subject** and optional **Participants**.
|
|
44
|
+
- **Group → Get** / **Leave** (`GET` / `DELETE /v1/groups/{id}`), with **Group ID** (the JID,
|
|
45
|
+
URL-encoded).
|
|
46
|
+
- **Group → Add / Remove / Promote / Demote Participants** (`POST|DELETE
|
|
47
|
+
/v1/groups/{id}/participants`, `POST …/participants/promote|demote`): **Participants**
|
|
48
|
+
comma-separated, trimmed and deduped; at least one.
|
|
49
|
+
- **Group → Get Invite Link** (`POST /v1/groups/{id}/invite`): **Reset Link** sends
|
|
50
|
+
`{ reset: true }`.
|
|
51
|
+
- **Group → Pin Message** (`POST /v1/groups/{id}/pin`): **Message ID** and **Action**
|
|
52
|
+
(pin/unpin).
|
|
53
|
+
- **Chatwoot** resource (`/v1/chatwoot*`): **Get**, **Connect** (Instance URL, Account ID,
|
|
54
|
+
User Access Token as a password field, Channel Mode), **Update** (only the added Update
|
|
55
|
+
Fields; Reconnect sends `action: "reconnect"`), **Disconnect** (Delete Inbox →
|
|
56
|
+
`?deleteInbox=true`), **Test** (token optional), and **Start / Get / Cancel History Sync**
|
|
57
|
+
(Window 30/90 days, Mark as Read).
|
|
58
|
+
- **Number → Get Many** (`GET /v1/numbers`): every number of the workspace. Needs an
|
|
59
|
+
account (tenant/workspace) credential; a number key gets `403 NUMBER_SCOPE_NOT_ALLOWED`.
|
|
60
|
+
- **Number → Create Meta Number** (`POST /v1/numbers/meta`): **Name**, **Number**, **Meta
|
|
61
|
+
Phone Number ID**, **Meta WABA ID**, **Meta Access Token** and **Meta App Secret** (password
|
|
62
|
+
fields), **Meta App ID** and **Route Webhooks to Pilot Status**.
|
|
63
|
+
- **Number → Get Many API Keys / Create API Key / Revoke API Key**
|
|
64
|
+
(`GET|POST /v1/numbers/{id}/api-keys`, `DELETE …/api-keys/{keyId}`): account credential
|
|
65
|
+
only; Create sends `{ name }` and returns the secret ONCE.
|
|
66
|
+
- **Number → Archive / Unarchive Chat** (`POST|DELETE /v1/numbers/{id}/chats/{jid}/archive`)
|
|
67
|
+
and **Block / Unblock Contact** (`POST|DELETE …/contacts/{phone}/block`): **Chat JID** and
|
|
68
|
+
**Contact Phone** are URL-encoded; no body.
|
|
69
|
+
- **Phone Line → Get Many Lines / Get Line** (`GET /v1/phone-lines`, `GET …/{id}`):
|
|
70
|
+
**Include Closed** (query `includeClosed`) adds the RETURNED and CANCELED lines.
|
|
71
|
+
- **Phone Line → Search Available** (`GET /v1/phone-lines/available`): **Area Code (DDD)**
|
|
72
|
+
(query `ddd`) → numbers plus the monthly `price` / `currency`. Does not charge.
|
|
73
|
+
- **Phone Line → Buy Lines** (`POST /v1/phone-lines`): ⚠️ **charges the account** (wallet
|
|
74
|
+
first, then the saved card), one monthly subscription per number. **Numbers**
|
|
75
|
+
(comma-separated, 1–10) go out as `{ numbers }`; **Idempotency Key** (required) as the
|
|
76
|
+
`Idempotency-Key` header, so a retry cannot charge twice. Read every `results[i].ok`.
|
|
77
|
+
- **Phone Line → Cancel Line** (`DELETE /v1/phone-lines/{id}`): a paid line is not refunded
|
|
78
|
+
and runs to `currentPeriodEnd`; an unpaid one is returned to the carrier now (irreversible).
|
|
79
|
+
- **Phone Line → Get Many Activations / Request Activation Code / Get Activation / Cancel
|
|
80
|
+
Activation** (`GET|POST /v1/phone-lines/{id}/activations`, `GET
|
|
81
|
+
…/activations/{activationId}`, `POST …/{id}/activations/{activationId}/cancel`): **Limit**
|
|
82
|
+
1–100 (query `limit`) on the list; no body; none of them charges.
|
|
83
|
+
- **Flow → Get Flow JSON** (`GET /v1/flows/{id}/json`): `{ flowId, flowJson }`, the string
|
|
84
|
+
Meta holds, also for a published Flow. Reads Meta, writes nothing.
|
|
85
|
+
- **Flow → Preview** (`POST /v1/flows/{id}/preview`): **Invalidate Previous Link** →
|
|
86
|
+
`{ invalidate }`. ⛔ The returned link needs no login; on a `data_exchange` Flow the
|
|
87
|
+
preview calls your endpoint for real.
|
|
88
|
+
- **Flow → Get Many Traces** (`GET /v1/flows/{id}/traces`): not paginated; empty list carries
|
|
89
|
+
`FLOW_TRACES_RETENTION_WINDOW`.
|
|
90
|
+
- **Flow → Get / Set / Register Endpoint** (`GET|PUT|POST /v1/flows/{id}/endpoint`): Set sends
|
|
91
|
+
`{ url }` (**Destination URL**) or `{ url: null }` (**Remove Destination**), plus
|
|
92
|
+
`rotateSecret: true` (**Rotate Secret**); the secret comes back once. Register ⚠️ writes the
|
|
93
|
+
Flow's `endpoint_uri` on Meta, `{ confirmOverwrite }` (**Confirm Overwrite**, default off).
|
|
94
|
+
The `PATCH` alias of the PUT is not a separate operation.
|
|
95
|
+
- **Flow → Sync From Meta** (`POST /v1/flows/meta/sync`): no body →
|
|
96
|
+
`{ created, updated, seen, truncated }`; `429 FLOW_SYNC_IN_PROGRESS` while one runs.
|
|
97
|
+
- **Workspace Member** resource (`/v1/workspace/members`): **Get Many** (`{ members, seatsUsed,
|
|
98
|
+
seatLimit }`, never an invite link), **Invite** (`{ email, role, sendEmail }` +
|
|
99
|
+
`allowedNumberIds` from **Number IDs**), **Update Role** (`{ role }` + `allowedNumberIds`),
|
|
100
|
+
**Update Numbers** (`{ allowedNumberIds }`; `[]` only with **All Numbers**, a blank list is
|
|
101
|
+
refused instead of widening the member), **Remove** (query `apiKeyAction` from **API Key
|
|
102
|
+
Action**) and **Resend Invite** (`{ sendEmail }`). Member ID is URL-encoded. ⚠️ Invite emails
|
|
103
|
+
the invitee unless **Send Email** is off, and then `inviteUrl` comes back once; Resend
|
|
104
|
+
rotates the token and the old link stops working; Remove cuts access at once and revokes
|
|
105
|
+
the member's OAuth tokens, and stops with `409 MEMBER_HAS_API_KEYS` while they own working
|
|
106
|
+
keys. Every write needs an account key (`403 MACHINE_CREDENTIAL_CANNOT_MANAGE_MEMBERS`).
|
|
107
|
+
- **Branding** resource (`GET|PUT /v1/branding`): **Get**, and **Update**, a partial upsert of
|
|
108
|
+
only the fields added under **Update Fields** (a text field left empty is sent as `null`
|
|
109
|
+
and cleared). Workspace key, `workspace:branding:manage`.
|
|
110
|
+
- **Subscription** resource (`/v1/subscription/extra-numbers`): **Preview Extra Numbers**
|
|
111
|
+
(`GET`, query `quantity`; charges nothing), **Buy Extra Numbers** (`POST`, `{ quantity }` +
|
|
112
|
+
`confirm: true` with **Confirm Plan Conversion**; **Idempotency Key** required, sent as the
|
|
113
|
+
`Idempotency-Key` header), **Schedule Removal** (`DELETE`, `{ quantity }`) and **Cancel
|
|
114
|
+
Scheduled Removal** (`DELETE …/schedule`). 💸 Buy charges on the spot (prorated, wallet then
|
|
115
|
+
card) and on a FREE plan converts the account to On Demand (`409 CONFIRMATION_REQUIRED`
|
|
116
|
+
without the confirmation). Schedule Removal takes effect next cycle, with no refund of the
|
|
117
|
+
period already paid. Defaults to Preview.
|
|
118
|
+
- **API Key → Regenerate Own Key** (`POST /v1/api-keys/regenerate`, no body): ⛔ revokes the
|
|
119
|
+
key the credential is calling with, at once; the new `key` comes back once (`201`). If the
|
|
120
|
+
n8n credential holds that key, every later call answers `401` until the new key is pasted
|
|
121
|
+
in. The existing **Regenerate** (`POST /v1/api-keys`, a number's default key) is unchanged.
|
|
122
|
+
- **Conversation → Get Many** (`GET /v1/conversations`): query `page`, `pageSize` (1–100) and
|
|
123
|
+
`startDate` / `endDate` (by last activity) when set. Number-scoped key, `chat:read`.
|
|
124
|
+
- **Meta Pricing → Get** (`GET /v1/meta/pricing`): `market`, `currency`, `category` only when
|
|
125
|
+
set (none = catalogue, all three = price) and `tiers=true` with **Include Volume Tiers**.
|
|
126
|
+
- **Embed → Create Session** (`POST /v1/embed/sessions`): `{ surface, allowedOrigins }` +
|
|
127
|
+
`whatsappNumberIds` (chat), `ttlSeconds` (> 0) and `brandingOverride` (JSON object) when
|
|
128
|
+
set. The returned `token` is a short-lived bearer credential.
|
|
129
|
+
- **Knowledge → Search** (`POST /v1/knowledge/search`): `{ query, limit }` + `type` /
|
|
130
|
+
`language` when narrowed. Public knowledge, no workspace data.
|
|
131
|
+
- `knownDebt.n8n` is now empty: every public `/v1` endpoint is reachable from the node.
|
|
132
|
+
- The Webhook resource now defaults to **Get Many**; **Webhook ID** only shows on the
|
|
133
|
+
operations that address one webhook.
|
|
134
|
+
|
|
135
|
+
### Fixed
|
|
136
|
+
|
|
137
|
+
- **Group dropdown** (the group picker of Message → Send and the other group fields) was
|
|
138
|
+
always empty: it read `GET /v1/groups` as a bare array of `{ id, subject }`, but the API
|
|
139
|
+
answers `{ groups: [{ id, name }] }`. It now reads `groups` and shows the group name, or
|
|
140
|
+
the group id when the name is null.
|
|
141
|
+
- **Flow → Update / Delete / Upload JSON / Publish / Deprecate / Get Responses / Get
|
|
142
|
+
Endpoint Key / Register Endpoint Key** put the Flow id (or the Number ID of the two
|
|
143
|
+
endpoint-key operations) into the URL raw: an id with `/`, `?` or `#` reached another path.
|
|
144
|
+
It is now URL-encoded (`encodeURIComponent`), like the Flow operations added in this
|
|
145
|
+
release. Get Many and Create have no id in the URL.
|
|
146
|
+
- **Pilot Status Trigger → Signing Secret** now warns (field hint and README) that the secret
|
|
147
|
+
is saved in the workflow JSON and must be removed before exporting or sharing the workflow.
|
|
148
|
+
It stays a node parameter; behaviour is unchanged.
|
|
149
|
+
|
|
150
|
+
## 2.20.0 - 2026-11-27
|
|
151
|
+
|
|
152
|
+
### Added
|
|
153
|
+
|
|
154
|
+
- **WhatsApp Number ID** on Ad Account → Get Many (query filter) and Ad Account → Link
|
|
155
|
+
(body). Ad accounts now belong to ONE official (Cloud API) number: with a workspace key
|
|
156
|
+
the number is REQUIRED on Link; with a number key it may be left empty (the key's own
|
|
157
|
+
number is used). Empty → not sent.
|
|
158
|
+
- **WhatsApp Number ID** on Lead Page → Get Many: optional query filter to one number.
|
|
159
|
+
|
|
160
|
+
### Changed
|
|
161
|
+
|
|
162
|
+
- Ad Account operations accept number-scoped keys (no longer workspace key only). Unlink
|
|
163
|
+
with a number key only reaches that number's accounts (404 otherwise).
|
|
164
|
+
- Descriptions document `422 ADS_REQUIRE_OFFICIAL_NUMBER` (number is not official) and
|
|
165
|
+
`409 AD_ACCOUNT_LINKED_TO_ANOTHER_NUMBER` (account already linked to another number).
|
|
166
|
+
|
|
5
167
|
## 2.19.0 - 2026-11-24
|
|
6
168
|
|
|
7
169
|
### Added
|
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ This is the official [n8n](https://n8n.io/) node for [Pilot Status](https://pilo
|
|
|
4
4
|
|
|
5
5
|
With this integration, you can seamlessly connect your n8n workflows to Pilot Status to send messages, connect WhatsApp numbers, and react to incoming messages or status changes in real time.
|
|
6
6
|
|
|
7
|
-
> **Not every endpoint is a node operation, and that is deliberate.** In an n8n node the cost is not the HTTP call — it is the UI: every field needs a control written and positioned by hand, and every optional one needs a hidden twin to undo n8n's empty-value behaviour. So this node covers the operations a workflow author actually reaches for. For anything else in the public API —
|
|
7
|
+
> **Not every endpoint is a node operation, and that is deliberate.** In an n8n node the cost is not the HTTP call — it is the UI: every field needs a control written and positioned by hand, and every optional one needs a hidden twin to undo n8n's empty-value behaviour. So this node covers the operations a workflow author actually reaches for. For anything else in the public API — template delete, webhook create/delete, billing — use n8n's built-in **HTTP Request** node with the same **Pilot Status API** credential: it is header auth, so it works out of the box. That is the supported escape hatch, not a workaround.
|
|
8
8
|
|
|
9
9
|
## 📦 Installation
|
|
10
10
|
|
|
@@ -39,6 +39,13 @@ The credential has three optional fields:
|
|
|
39
39
|
- **WhatsApp Number ID** — sent as `x-whatsapp-number-id` on every request. Fill it in when your key is **tenant-scoped** and the operation is per-number; a **number-scoped** key already carries its number, and the header is ignored.
|
|
40
40
|
- **Workspace ID** — only for an **account key** (`ps_account_...`, created in *Profile → API*): sent as `x-workspace-id` to name the workspace the key acts on (an id from **Workspace (Account Key) → Get Many**). Without it, every workspace operation answers `400 WORKSPACE_ID_REQUIRED`; a workspace the key's user is not an active member of answers `403 WORKSPACE_MEMBERSHIP_REQUIRED`. Leave it empty for a workspace or number key. With an account key and no Workspace ID, the credential test calls `GET /v1/workspaces` instead of `/v1/templates`.
|
|
41
41
|
|
|
42
|
+
### Secret credentials (Meta Number, Chatwoot)
|
|
43
|
+
|
|
44
|
+
Two operations need a third-party secret. It is **never** a node parameter: n8n writes parameters in plain text into the workflow JSON (export, share, templates), while credentials stay encrypted in n8n's database. Select these on the node, next to the Pilot Status API credential; they only appear on the operations that use them.
|
|
45
|
+
|
|
46
|
+
- **Pilot Status Meta Number** (`pilotStatusMetaNumberApi`) — **Meta Access Token** and **Meta App Secret**, for **Number → Create Meta Number**. Required there: without it the node fails with *Select a 'Pilot Status Meta Number' credential*. Phone Number ID, WABA ID and App ID stay as node parameters (they are ids, not secrets, and change per number).
|
|
47
|
+
- **Pilot Status Chatwoot** (`pilotStatusChatwootApi`) — **User Access Token**, for **Chatwoot → Connect / Test / Update**. Required on Connect (*Select a 'Pilot Status Chatwoot' credential*); optional on Test (none reuses the stored token) and on Update (sent only with **Replace Token** on). Instance URL and Account ID stay as node parameters.
|
|
48
|
+
|
|
42
49
|
Every request made with the credential (operations, dropdowns, the trigger's webhook registration and the credential test) carries `User-Agent: pilot-status-n8n/<version>` (e.g. `pilot-status-n8n/2.14.0`) instead of n8n's generic `n8n`.
|
|
43
50
|
|
|
44
51
|
*Note: TEST keys will only send messages to the WhatsApp number registered in your Pilot Status Profile.*
|
|
@@ -65,6 +72,8 @@ Every delivery from a webhook that has a secret carries `x-pilot-status-signatur
|
|
|
65
72
|
|
|
66
73
|
The secret is returned in clear **once**: in the `201` of the create (`POST /v1/webhooks` → `hasSecret`, `secret`; or the dashboard) and by **Webhook → Rotate Secret** (below). No read path returns it. Automatic registration does **not** fill the field for you — to sign a webhook it registered, run **Webhook → Rotate Secret** on its id and paste the new secret here. Webhooks created before 2026-09-15 have no secret (their deliveries are unsigned) until rotated.
|
|
67
74
|
|
|
75
|
+
⚠️ **Signing Secret** is a node parameter, so it is saved in the workflow JSON: remove it before exporting or sharing a workflow that contains this trigger.
|
|
76
|
+
|
|
68
77
|
### Available Events:
|
|
69
78
|
- **Message Sent** (`message.sent`): Triggered when the message is sent to the provider.
|
|
70
79
|
- **Message Delivered** (`message.delivered`): Triggered when the message is successfully delivered to the device.
|
|
@@ -100,6 +109,9 @@ The **Pilot Status** node provides several resources and operations to manage yo
|
|
|
100
109
|
- **Get History:** Read the conversation history of the number, newest first — both directions, every provider, including messages imported from the device on connect. Filters by **Start Date** / **End Date** over the *provider* timestamp (when the message happened, not when it was ingested). This is how you fetch old messages: the webhook does not replay history by default. Requires a number-scoped API key.
|
|
101
110
|
- **Get Many:** The message **log** — sent and received, with delivery status, newest first. Different from Get History: this is the operational trail (`status`, `errorCode`, `origin`, whether the 24h window was open at send), not the chat thread. Filters: Direction, Status (comma-separated), Page, Page Size. For date/search/template filters use the HTTP Request node.
|
|
102
111
|
- **Get Unread:** Unread inbound messages. ⚠️ `total` is the **real** unread count from the conversation counters — *not* the length of the returned list, which carries only the latest unread per conversation.
|
|
112
|
+
- **Get Group Messages:** `GET /v1/messages/group?startDate=&endDate=&page=&pageSize=` — the stored messages of the number's GROUP conversations, newest first, `{ messages, total, page, pageSize, totalPages }`; same filters as Get History. Number-scoped credential; empty on `RELAY_ONLY`.
|
|
113
|
+
- **Get Unread Counts:** `GET /v1/messages/unread/counts?whatsappNumberIds=` — `{ byNumber: [{ whatsappNumberId, number, displayName, total }] }`, each `total` equal to Get Unread's. **WhatsApp Number IDs** (comma-separated, max 100) is optional: empty counts every number in the credential's reach. `400 TOO_MANY_NUMBERS`, `403 NUMBER_NOT_IN_GRANT`, `404 NUMBER_NOT_FOUND`. Needs `chat:read`.
|
|
114
|
+
- **Resend:** `POST /v1/messages/{id}/resend`, no body → `202`, a NEW message (`originalMessageId` points back). Only `FAILED`/`CANCELED` (`409 MESSAGE_NOT_RESENDABLE`); a second resend within 120 s is `409 RESEND_ALREADY_IN_FLIGHT`; no stored request is `422`. Number-scoped credential; needs `messages:resend`.
|
|
103
115
|
- **Mark as Read:** Blue ticks for a contact's last inbound message and every earlier one, without sending anything. Best-effort: a `200` with `acked: false` means there was nothing to acknowledge, or the number is `RELAY_ONLY`.
|
|
104
116
|
- **Send Typing Indicator:** Show "typing"/"recording" to a contact. It clears when a message is sent or after a provider timeout (~25s on Meta). On **META** numbers `recording` is shown as `typing` and `paused` is a no-op — read `effectiveState` in the response for what actually happened.
|
|
105
117
|
- **Cancel:** Cancel scheduled (not-yet-sent) messages by id.
|
|
@@ -123,6 +135,12 @@ The **Pilot Status** node provides several resources and operations to manage yo
|
|
|
123
135
|
- **Ignore Newsletters** and **Mark Read On Send** are platform-level too (not Evolution GO fields). **Mark Read On Send** (on by default) is the default for **Mark Read** on Message → Send: switched off, a send from a **Meta Cloud API** number goes out without the "typing" indicator and does **not** mark the contact's last message as read (no blue ticks) — Meta only allows typing as part of a read receipt, so the two are inseparable. It has no effect on Evolution numbers: sending never marks read there, and read-on-arrival is **Read Messages**.
|
|
124
136
|
- **Always Online**, **Reject Call**, **Reject Call Message**, **Read Messages**, **Ignore Groups**, **Ignore Status** are the Evolution GO advanced settings, in the GO dialect (`ignoreGroups`, not the v2 `groupsIgnore`). They are tri-state: *Inherit From Provider* leaves the field untouched, *Reset to Provider Default* clears the stored value. On a Meta number they are stored but never applied.
|
|
125
137
|
|
|
138
|
+
- **Get Many:** `GET /v1/numbers` → every number of the workspace (web and official Meta). Needs an **account** (tenant/workspace) credential: a number key gets `403 NUMBER_SCOPE_NOT_ALLOWED`.
|
|
139
|
+
- **Create Meta Number:** `POST /v1/numbers/meta` with `{ name, number, metaPhoneId, metaWabaId, metaAccessToken, metaAppSecret, metaAppId, routeWebhooksToPilot }` → `201 { number, webhook, linkedApiKeyId }`. Your own WABA credentials: the ids are node fields, `metaAccessToken` and `metaAppSecret` come from the **Pilot Status Meta Number** credential. **Route Webhooks to Pilot Status** subscribes the WHOLE WABA to our callback. A number key cannot create numbers; an existing number is `409`.
|
|
140
|
+
- **Get Many API Keys:** `GET /v1/numbers/{id}/api-keys` → `{ data }`, masked. **Create API Key:** `POST /v1/numbers/{id}/api-keys` with `{ name }` → `201 { apiKey }` — the secret `apiKey.key` is returned **only once**; `409 NUMBER_KEY_LIMIT_REACHED` at the limit. **Revoke API Key:** `DELETE /v1/numbers/{id}/api-keys/{keyId}` → `{ revoked, id }`; the default key is `409 PRIMARY_KEY_USE_REGENERATE` (use API Key → Regenerate). All three need an account credential (`403 NUMBER_SCOPE_NOT_ALLOWED` for a number key).
|
|
141
|
+
- **Archive / Unarchive Chat:** `POST` / `DELETE /v1/numbers/{id}/chats/{jid}/archive`, no body. QR (Evolution GO) numbers only — an official number is `422 NOT_AVAILABLE_FOR_OFFICIAL_NUMBERS`. **Chat JID** (E.164 or full JID) is URL-encoded.
|
|
142
|
+
- **Block / Unblock Contact:** `POST` / `DELETE /v1/numbers/{id}/contacts/{phone}/block`, no body. QR and official numbers; any other rail is `422 FEATURE_NOT_SUPPORTED`. **Contact Phone** is URL-encoded. Archive and block need `contacts:manage`.
|
|
143
|
+
|
|
126
144
|
### 3. API Key
|
|
127
145
|
- **Regenerate:** Regenerate the default API Key of a single WhatsApp number (tenant-scoped), identified by its `whatsappNumberId`. The previous key for that number is rotated and the new key is returned.
|
|
128
146
|
- **Get Many:** List API Keys. With a tenant key, this reveals every number's real API key.
|
|
@@ -187,7 +205,7 @@ Workspace (tenant-scoped) API key only, `integrations:manage`. Access to an ad a
|
|
|
187
205
|
- **Lead Form → Get Many:** `GET /v1/lead-pages/{pageLinkId}/forms` — `{ forms, formsTruncated, numberIsOfficial, templates }`, each form with questions, consent checkboxes and its stored `config` (`null` = never configured).
|
|
188
206
|
- **Lead Form → Update:** `PUT /v1/lead-pages/{pageLinkId}/forms/{formId}` — creates or **replaces** the whole config: **Auto-Send Enabled**, **Consent Checkbox Key**, **Template ID** (official numbers), **Free Text** (other numbers), **Variable Map (JSON)**, **Form Name**. Empty Consent Checkbox Key / Template ID / Free Text go out as `null`. ⚠️ With Auto-Send Enabled, new leads get a WhatsApp message without a human.
|
|
189
207
|
|
|
190
|
-
### 7. Phone Line (identity verification
|
|
208
|
+
### 7. Phone Line (lines, activation codes, identity verification, activation audio)
|
|
191
209
|
|
|
192
210
|
Requires a **workspace (tenant-scoped) API key** — a number-scoped key is refused. The verification operations need the **OWNER** role (`phone_lines:purchase`); the audio needs `phone_lines:read`. Errors come back as `{ error, code }`.
|
|
193
211
|
|
|
@@ -200,6 +218,19 @@ Requires a **workspace (tenant-scoped) API key** — a number-scoped key is refu
|
|
|
200
218
|
- **Submit Document:** Send a new document when `document.status` is `UNREADABLE`/`UNCLEAR` or the status is `NEEDS_DOCUMENT`. Same file rules and hourly limit as the start; no idempotency key.
|
|
201
219
|
- **Download Activation Audio:** The recording of an activation call (`activationId` from the `phone_line.audio_received` / `phone_line.code_received` webhook), returned as **n8n binary data** in the field set by *Put Output File in Field* (default `data`), with the MIME type from `Content-Type` and the file name from `Content-Disposition`. The JSON part carries only `{ activationId, contentType, contentLength, fileName }`. ⛔ The recording **speaks the activation code** — treat the file as a credential (do not post it to chats or logs). An unknown id, a line from another workspace, a missing recording or a returned/canceled line all answer `404 ACTIVATION_NOT_FOUND`.
|
|
202
220
|
|
|
221
|
+
**Lines and activation codes** (tenant-scoped credential; a number key gets `403 NUMBER_SCOPE_NOT_ALLOWED`):
|
|
222
|
+
- **Get Many Lines:** `GET /v1/phone-lines` → `{ lines }`, newest purchase first, not paginated. **Include Closed** (`includeClosed`) adds `RETURNED` / `CANCELED`. `phone_lines:read` (ADMIN and up).
|
|
223
|
+
- **Get Line:** `GET /v1/phone-lines/{id}` → `{ line }`; another workspace's line is `404 LINE_NOT_FOUND`.
|
|
224
|
+
- **Search Available:** `GET /v1/phone-lines/available?ddd=11` → `{ ddd, totalAvailable, numbers: [{ number, display }], price, currency }` — `price` is what one line costs this workspace per month. Does not charge; `phone_lines:purchase` (OWNER). `400 INVALID_AREA_CODE`, `503 SUPPLIER_UNAVAILABLE`.
|
|
225
|
+
- **Buy Lines:** `POST /v1/phone-lines` with `{ numbers }` (**Numbers**, comma-separated, 1–10, the `number` values from Search Available) and the **Idempotency Key** as the `Idempotency-Key` header. 💸 **This charges your account**: each number is a monthly subscription charged on the spot (wallet first, then the saved card). `200` does **not** mean success — read every `results[i].ok` (`PAYMENT_FAILED`; `PAYMENT_PROVIDER_ERROR`, the card **may** have been charged; `PURCHASE_NOT_COMPLETED`, refunded to the wallet). Retry with the **same** key: a number already processed answers `REQUEST_ALREADY_PROCESSED` instead of charging twice. On a `500`, list the lines before retrying. Needs `phone_lines:purchase` (OWNER) and an approved verification (`403 VERIFICATION_REQUIRED` / `VERIFICATION_REJECTED`).
|
|
226
|
+
- **Cancel Line:** `DELETE /v1/phone-lines/{id}` → `{ line }`. An `ACTIVE` (paid) line is **not refunded** and stays usable until `currentPeriodEnd` (`cancelAtPeriodEnd: true`). ⛔ An unpaid line (`PAYMENT_PENDING`, `SUSPENDED`) is returned to the carrier **now** — irreversible, the number can never be bought back. A finished line is `409 NOT_CANCELABLE`. `phone_lines:cancel` (OWNER).
|
|
227
|
+
- **Get Many Activations:** `GET /v1/phone-lines/{id}/activations?limit=20` → `{ activations }`, newest first, **codes included** (credentials). **Limit** 1–100 (`400 INVALID_LIMIT`).
|
|
228
|
+
- **Request Activation Code:** `POST /v1/phone-lines/{id}/activations`, no body → `201 { activation }`. It does not place the call: ask WhatsApp to verify the number **by call**; the call is captured for 5 minutes (`pollDeadline`). `409 LINE_NOT_ACTIVE` / `ACTIVATION_IN_PROGRESS`. Does not charge.
|
|
229
|
+
- **Get Activation:** `GET /v1/phone-lines/activations/{activationId}` → `{ activation }` — poll until `TRANSCRIBED` (`code`), `TIMED_OUT` or `FAILED`.
|
|
230
|
+
- **Cancel Activation:** `POST /v1/phone-lines/{id}/activations/{activationId}/cancel`, no body → the request ends `TIMED_OUT` (`failureReason: "canceled_by_customer"`), so a new one can be requested now. Cancels the request only, not the line. `409 ACTIVATION_NOT_WAITING` once the call was captured.
|
|
231
|
+
|
|
232
|
+
The activations need `phone_lines:read`.
|
|
233
|
+
|
|
203
234
|
**Document input — two options (Document Source):**
|
|
204
235
|
- **Binary Field** (default): the name of a binary property of the input item (e.g. the output of *Read/Write Files from Disk*, *HTTP Request* or a form upload). It is sent as `data:<mimeType>;base64,<data>`.
|
|
205
236
|
- **Data URI**: a ready `data:<mime>;base64,...` string.
|
|
@@ -244,6 +275,14 @@ Tenant-scoped credential. Nothing here charges by itself — a human pays the ho
|
|
|
244
275
|
template. WhatsApp Business App / coexistence accounts answer `422
|
|
245
276
|
TEMPLATE_INSIGHTS_UNAVAILABLE_SMB` (Meta gives no insights there); a non-Meta template
|
|
246
277
|
answers `409 TEMPLATE_NOT_ON_META`. The first call may enable insights on the WABA at Meta.
|
|
278
|
+
- **Create:** `POST /v1/templates` with **Name**, **Body** (plain text with `{{variables}}`, or
|
|
279
|
+
the full template JSON as text: header, body, footer, buttons), **Examples (JSON)** (a
|
|
280
|
+
sample per variable, e.g. `{"1": "Ana"}` — missing ones are `400 TEMPLATE_EXAMPLES_REQUIRED`)
|
|
281
|
+
and, under Additional Fields, **Category** (default `UTILITY`) and **Language** (default
|
|
282
|
+
`pt_BR`) → `201 { id, name, category, metaStatus? }`. The number/WABA come from the
|
|
283
|
+
credential; then **Submit to Meta**.
|
|
284
|
+
- **Update:** `PUT /v1/templates/{id}` with **Body** and **Examples (JSON)** only — name,
|
|
285
|
+
category and language cannot be changed. `404 TEMPLATE_NOT_FOUND` outside the scope.
|
|
247
286
|
- **Submit to Meta:** `POST /v1/templates/{id}/submit`, no body → the template with
|
|
248
287
|
`metaStatus` (usually `PENDING`) and `metaTemplateId`. `409 TEMPLATE_ALREADY_SUBMITTED` /
|
|
249
288
|
`TEMPLATE_NOT_EDITABLE`, `400 META_API_ERROR` (with `meta_code`).
|
|
@@ -256,7 +295,7 @@ Tenant-scoped credential. Nothing here charges by itself — a human pays the ho
|
|
|
256
295
|
name on the WABA) and blocks reusing it for ~30 days; `via_number: null` on a Meta template
|
|
257
296
|
means the real delete would be refused (`409 META_TEMPLATE_DELETE_REFUSED`). The real
|
|
258
297
|
delete is not a node operation — use the HTTP Request node.
|
|
259
|
-
- Submit, Sync and Preview Delete need a **number-scoped** credential (number key, or tenant
|
|
298
|
+
- Create, Update, Submit, Sync and Preview Delete need a **number-scoped** credential (number key, or tenant
|
|
260
299
|
key + WhatsApp Number ID) with `templates:manage`; Submit and Sync need a Meta Cloud API
|
|
261
300
|
number with a WABA (`422 TEMPLATE_REQUIRES_META_NUMBER`).
|
|
262
301
|
|
|
@@ -284,7 +323,11 @@ Not the account-level **Workspace (Account Key)** resource (`/v1/workspaces`, pl
|
|
|
284
323
|
|
|
285
324
|
### 19. Webhook (number webhooks, `/v1/webhooks`)
|
|
286
325
|
|
|
287
|
-
The registry the **Pilot Status Trigger** registers in.
|
|
326
|
+
The registry the **Pilot Status Trigger** registers in. Create and delete stay on the HTTP Request node. Permission `webhooks:manage` (Get Many: `webhooks:read`); a webhook outside the credential's scope is `404 WEBHOOK_NOT_FOUND`.
|
|
327
|
+
|
|
328
|
+
- **Get Many:** `GET /v1/webhooks` → every number webhook in the credential's scope (a number-scoped key sees its number only), never the secret, with the circuit status. A per-number OAuth connection without a number is `400 NUMBER_REQUIRED`.
|
|
329
|
+
- **Update:** `PATCH /v1/webhooks/{id}` with only the **Update Fields** you add: Name, URL, Events (comma-separated, replaces the list), Active (off pauses). The number cannot be changed (`400 NUMBER_RESCOPE_NOT_SUPPORTED`).
|
|
330
|
+
- **Get Logs:** `GET /v1/webhooks/{id}/logs?limit=&event=` → `{ webhookId, logs }`, newest first; Limit 1–50, Event optional.
|
|
288
331
|
|
|
289
332
|
- **Rotate Secret:** `POST /v1/webhooks/{id}/rotate-secret`, no body → `{ id, hasSecret: true, secret }` — the new signing secret **in clear, once** (no read returns it). Immediate, **no overlap**: the old secret stops at once; deliveries already in flight may still be signed with it — accept both briefly, or rotate when quiet. The only way to get a secret for a webhook created before 2026-09-15.
|
|
290
333
|
- **Reactivate:** `POST /v1/webhooks/{id}/reactivate`, no body → `{ ok, released, stillHeld, circuitOpen, circuitOpenedAt, circuitSuccessPct, heldCount, droppedCount }` — resumes a destination paused by the circuit breaker (it only closes by hand), re-queuing `released` held events. Idempotent.
|
|
@@ -302,6 +345,79 @@ Posts from the credential's number. **Evolution Go numbers only** (`400 NOT_SUPP
|
|
|
302
345
|
- **Get:** `GET /v1/stories/{id}` → `{ id, type, status, caption, recipientsMode, recipientCount, recipients, createdAt, sentAt, revokedAt }`. `recipients` is `null` while `QUEUED` or outside retention (`redacted: true`). Not a story → `404`.
|
|
303
346
|
- **Delete:** `DELETE /v1/stories/{id}` → `{ id, revokedAt }`. Only a `SENT`, not revoked story (`409 STORY_NOT_REVOCABLE`); more than 24 h after `sentAt` → `410 STORY_EXPIRED`. Not billed.
|
|
304
347
|
|
|
348
|
+
### 21. Group (`/v1/groups`)
|
|
349
|
+
|
|
350
|
+
The groups of the credential's number. **Group ID** is the JID (`…@g.us`) from **Get Many**; it is URL-encoded in the path. A provider that cannot do the operation answers `400 FEATURE_NOT_SUPPORTED`. **Participants** is a comma-separated list of E.164 numbers without `+` (or JIDs), trimmed and deduped.
|
|
351
|
+
|
|
352
|
+
- **Get Many:** `GET /v1/groups`.
|
|
353
|
+
- **Create:** `POST /v1/groups` with `{ subject, participants? }` → `201 { id, subject, participants }`. **Subject** 1–100 characters.
|
|
354
|
+
- **Get:** `GET /v1/groups/{id}` → `{ id, subject, participants }`. While the provider backs off: `503 GROUP_INFO_TEMPORARILY_UNAVAILABLE` with `Retry-After`.
|
|
355
|
+
- **Leave:** `DELETE /v1/groups/{id}` → `{ success: true }` — the number leaves; the group stays for the others.
|
|
356
|
+
- **Add Participants** / **Remove Participants:** `POST` / `DELETE /v1/groups/{id}/participants` with `{ participants }` → `{ affected }`. At least one participant (the node stops before calling with an empty list).
|
|
357
|
+
- **Promote Participants** / **Demote Participants:** `POST /v1/groups/{id}/participants/promote` / `…/demote`, same body and answer.
|
|
358
|
+
- **Get Invite Link:** `POST /v1/groups/{id}/invite` → `{ link }`. **Reset Link** sends `{ reset: true }` and revokes the current link.
|
|
359
|
+
- **Pin Message:** `POST /v1/groups/{id}/pin` with `{ messageId, action: "pin" | "unpin" }` → `{ success: true }`.
|
|
360
|
+
|
|
361
|
+
### 22. Chatwoot (`/v1/chatwoot`)
|
|
362
|
+
|
|
363
|
+
The Chatwoot integration of the credential's number. A tenant key needs the number (`x-whatsapp-number-id`), otherwise `400 NUMBER_REQUIRED`; another tenant's number is `404 NUMBER_NOT_FOUND`. The **User Access Token** comes from the **Pilot Status Chatwoot** credential (never a node field) and is never returned.
|
|
364
|
+
|
|
365
|
+
- **Get:** `GET /v1/chatwoot` → the integration status (no token).
|
|
366
|
+
- **Connect:** `POST /v1/chatwoot` with `{ instanceUrl, accountId, userAccessToken, channelMode? }` (`auto` | `api` | `native`) — creates the inbox and starts mirroring. Run **Test** first.
|
|
367
|
+
- **Update:** `PATCH /v1/chatwoot` with only what is added under **Update Fields**: **Enabled** (off pauses), **Instance URL** / **Account ID** / **Replace Token** (sends the credential's token; any of them re-runs the connect and RECREATES the inbox — without a credential, Replace Token sends nothing and the stored token is kept), **Reconnect** (`action: "reconnect"`, rebuilds the inbox with the stored credential), **Channel Mode**. Not connected → `404 NOT_CONNECTED`.
|
|
368
|
+
- **Disconnect:** `DELETE /v1/chatwoot`, idempotent. **Delete Inbox** adds `?deleteInbox=true` and ALSO deletes the remote inbox and its history in Chatwoot.
|
|
369
|
+
- **Test:** `POST /v1/chatwoot/test` with `{ instanceUrl, accountId, userAccessToken? }` → `{ ok, checks }`; writes nothing. Without a Pilot Status Chatwoot credential the stored token is reused.
|
|
370
|
+
- **Start History Sync:** `POST /v1/chatwoot/history-sync` with `{ windowDays: 30 | 90, markRead }` → `202 { historySync }`. Meta numbers in coexistence with Chatwoot on the API channel only (`422 FEATURE_NOT_SUPPORTED` / `HISTORY_SYNC_NOT_COEXISTENCE` / `CHATWOOT_NOT_CONNECTED`); a run in progress is `409 ALREADY_RUNNING`.
|
|
371
|
+
- **Get History Sync:** `GET /v1/chatwoot/history-sync` → `{ historySync }`.
|
|
372
|
+
- **Cancel History Sync:** `DELETE /v1/chatwoot/history-sync` → `{ historySync, code }`; a run that never started closes at once.
|
|
373
|
+
|
|
374
|
+
### 23. Flow (WhatsApp Flows, `/v1/flows`)
|
|
375
|
+
|
|
376
|
+
Meta (Cloud API) numbers only — a web number answers `422 FLOW_REQUIRES_META_NUMBER`. The credential must be a **number-scoped key**: the number and its WABA come from the key, and naming one in the body (`whatsappNumberId`, `numberId`, `wabaId`) is `400 FLOW_NUMBER_FROM_KEY`. **Flow ID** is always the LOCAL `id` from **Get Many**, never Meta's `metaFlowId` (`404 FLOW_NOT_FOUND`). Seventeen operations: Get Many, Create, Update, Delete, Upload Flow JSON, Publish, Deprecate, Get Many Responses, Get / Register Endpoint Key, and the seven below.
|
|
377
|
+
|
|
378
|
+
- **Get Flow JSON:** `GET /v1/flows/{id}/json` → `{ flowId, flowJson }`. `flowJson` is the document Meta holds, as a **string**, byte for byte — the same field Upload Flow JSON takes. Works on a published Flow (the starting point of a clone). Can be megabytes. Reads Meta, writes nothing; `502 FLOW_JSON_UNAVAILABLE`. `flows:read`.
|
|
379
|
+
- **Preview:** `POST /v1/flows/{id}/preview` with `{ invalidate }` (**Invalidate Previous Link**, default off) → `{ flowId, previewUrl, expiresAt, invalidated, requiresLogin: false, warning, warningEN }`. ⛔ The link needs **no login** — treat it as a secret. Calls Meta; works on a DRAFT. ⚠️ Not a sandbox: on a `data_exchange` Flow the preview calls your endpoint for real. `502 FLOW_PREVIEW_UNAVAILABLE`. `flows:manage`.
|
|
380
|
+
- **Get Many Traces:** `GET /v1/flows/{id}/traces` → `{ traces }`, what our proxy saw on the `data_exchange` calls (bodies withheld under `RELAY_ONLY`). Not paginated (`page`/`pageSize` → `400 FLOW_TRACES_NOT_PAGINATED`); ~24 h retention, and an empty list carries `notice: "FLOW_TRACES_RETENTION_WINDOW"`. `flows:read`.
|
|
381
|
+
- **Get Endpoint:** `GET /v1/flows/{id}/endpoint` → `{ flowId, url, hasSecret, endpointUri, metaEndpointUri, drift, numberHasKey, numberKeyUploadedAt, warnings }`. `numberHasKey: false` (`FLOW_ENDPOINT_NUMBER_HAS_NO_KEY`) means Meta can never call it. `flows:manage`.
|
|
382
|
+
- **Set Endpoint:** `PUT /v1/flows/{id}/endpoint` with `{ url }` (**Destination URL**, https only) or `{ url: null }` (**Remove Destination**, keeps the secret), plus `rotateSecret: true` with **Rotate Secret**. Answers the Get Endpoint fields plus `secret`, returned **once**, on the response that minted it. Does not touch Meta. `flows:manage`.
|
|
383
|
+
- **Register Endpoint:** `POST /v1/flows/{id}/endpoint` with `{ confirmOverwrite }` (**Confirm Overwrite**, default off). ⚠️ **Writes on Meta**: points the Flow's `endpoint_uri` at our proxy (needed to publish a `data_exchange` Flow); answers the Get Endpoint fields plus `republished`, `finalStatus`. Pointing somewhere else already → `409` unless confirmed. `flows:manage`.
|
|
384
|
+
- **Sync From Meta:** `POST /v1/flows/meta/sync`, no body → `{ created, updated, seen, truncated }`. Mirrors the WABA's catalogue now (creates/updates rows; calls Meta). One at a time per number: `429 FLOW_SYNC_IN_PROGRESS`. `flows:manage`.
|
|
385
|
+
|
|
386
|
+
### 24. Workspace Member (`/v1/workspace/members`)
|
|
387
|
+
|
|
388
|
+
Members and pending invites of the credential's workspace, one list (same row). **Member ID** is the MEMBERSHIP id (`members[].id`), not the user id. **Get Many** accepts a workspace key; **every write needs a user on the wire** — an account key (`ps_account_…` + Workspace ID): a classic `ps_` key answers `403 MACHINE_CREDENTIAL_CANNOT_MANAGE_MEMBERS`.
|
|
389
|
+
|
|
390
|
+
- **Get Many:** `GET /v1/workspace/members` → `{ members, seatsUsed, seatLimit }` (`seatLimit: null`, unlimited). Never returns an invite link. `members:read` (ADMIN and up).
|
|
391
|
+
- **Invite:** `POST /v1/workspace/members` with `{ email, role, sendEmail }` and `allowedNumberIds` (**Number IDs**, comma-separated; blank = not sent, every number). ⚠️ By default **emails the invitee**. With **Send Email** off nothing is emailed and `inviteUrl` comes back **once** — a live link to join the workspace, treat it as a secret. `201`, or `200 resent: true` for a pending invite; expires in 7 days. `403 ROLE_NOT_ASSIGNABLE` / `FEATURE_DISABLED`, `409 ALREADY_MEMBER`, `429` (30/h per workspace, 3/h per address). `members:invite` (ADMIN and up).
|
|
392
|
+
- **Update Role:** `PATCH /v1/workspace/members/{id}` with `{ role }` (+ `allowedNumberIds` when **Number IDs** is filled). OWNER is never given or taken here. `400 ROLE_NOT_ASSIGNABLE`, `409 OWNER_IMMUTABLE` / `WOULD_ORPHAN_WORKSPACE`. `members:role:update` (OWNER).
|
|
393
|
+
- **Update Numbers:** `PATCH /v1/workspace/members/{id}/numbers` with `{ allowedNumberIds }`, which **replaces** the list. `[]` (= every number, including ones connected later) is sent only with **All Numbers** on; a blank list is refused in the node. `409 SCOPE_NOT_APPLICABLE` for OWNER/ADMIN. `members:scope:update` (ADMIN and up).
|
|
394
|
+
- **Remove:** `DELETE /v1/workspace/members/{id}` → `{ removed, email, apiKeysRevoked, apiKeysReassigned, oauthTokensRevoked }`. ⛔ An ACTIVE member loses access **at once** and their OAuth tokens are revoked; a PENDING invite is revoked (its link dies). No undo — invite again. If they own working API keys the call stops with `409 MEMBER_HAS_API_KEYS` and the list: repeat with **API Key Action** (query `apiKeyAction`) — **Revoke** takes down every integration on those keys, **Keep** reassigns them to you. `members:remove` (OWNER).
|
|
395
|
+
- **Resend Invite:** `POST /v1/workspace/members/{id}/resend` with `{ sendEmail }`. ⚠️ Always rotates the token: the link the invitee holds **stops working**. New email by default, or the new `inviteUrl` once with Send Email off. `409 ALREADY_ACCEPTED`. `members:invite`.
|
|
396
|
+
|
|
397
|
+
### 25. Branding (`/v1/branding`)
|
|
398
|
+
|
|
399
|
+
White-label look of the connect / remote-pairing pages. Workspace (tenant-scoped) key; `workspace:branding:manage` (ADMIN and up).
|
|
400
|
+
|
|
401
|
+
- **Get:** `GET /v1/branding` → `{ branding }` (logoUrl, primaryColor, backgroundColor, companyName, subtitle, supportUrl, defaultRedirectUrl, hidePilotStatusBranding).
|
|
402
|
+
- **Update:** `PUT /v1/branding`, a partial upsert: only the fields added under **Update Fields**; a text field added but left **empty** is sent as `null` and cleared. Colors `#RRGGBB`, URLs https only (`400`). ⚠️ Shows at once on every page your customers open.
|
|
403
|
+
|
|
404
|
+
### 26. Subscription (paid extra numbers, `/v1/subscription/extra-numbers`)
|
|
405
|
+
|
|
406
|
+
The **paid capacity** (slots) of the workspace, not the connected numbers: deleting a number frees its slot and does not cut the bill. Workspace (tenant-scoped) key; a number key gets `403`.
|
|
407
|
+
|
|
408
|
+
- **Preview Extra Numbers:** `GET /v1/subscription/extra-numbers?quantity=N` → `{ plan, requiresConversion, explanation, currentNumbers, requested, billedQuantity, currency, unitPriceMonthly, proratedUnitPrice, proratedTotal, remainingDays, totalDaysInCycle, walletBalance, hasSavedCard, fundingSource, … }`. `proratedTotal` is what Buy charges today. Charges nothing. `billing:read` (ADMIN and up).
|
|
409
|
+
- **Buy Extra Numbers:** `POST /v1/subscription/extra-numbers` with `{ quantity }` (+ `confirm: true` with **Confirm Plan Conversion**) and the **Idempotency Key** as the `Idempotency-Key` header (required in the node). 💸 **This charges your account** on the spot: prorated for the rest of the cycle, wallet credits first, then the saved card; then monthly until a removal is scheduled. ⚠️ On a FREE plan it **converts the account to On Demand** — every number becomes paid — and answers `409 CONFIRMATION_REQUIRED` (with the preview) unless confirmed. Never a checkout link: `402 INSUFFICIENT_FUNDS` / `PAYMENT_FAILED`; `502 PAYMENT_PROVIDER_ERROR` adds no slot. Retry with the **same** key within 24 h to get the original result instead of a second charge (`409 IDEMPOTENCY_KEY_REUSED` with another quantity, `IDEMPOTENCY_KEY_IN_USE` while one is in flight). `409 UNUSED_CAPACITY_AVAILABLE` when a paid slot is already free. `billing:manage` (OWNER).
|
|
410
|
+
- **Schedule Removal:** `DELETE /v1/subscription/extra-numbers` with `{ quantity }`. Gives the slots back at the **next cycle**: nothing changes now, **no refund** — the period already paid is kept and the slots stay usable until it ends. Calling again overwrites the target. `409 NUMBER_LIMIT_EXCEEDED` below the connected numbers. `billing:manage` (OWNER).
|
|
411
|
+
- **Cancel Scheduled Removal:** `DELETE /v1/subscription/extra-numbers/schedule`, no body. The next cycle keeps the current capacity — and its charge. No-op if nothing was scheduled. `billing:manage` (OWNER).
|
|
412
|
+
|
|
413
|
+
### 27. API Key → Regenerate Own Key, Conversation, Meta Pricing, Embed, Knowledge
|
|
414
|
+
|
|
415
|
+
- **API Key → Regenerate Own Key:** `POST /v1/api-keys/regenerate`, no body → `201 { id, name, key, keyPrefix, keyLast4, scope, whatsappNumberId, createdAt }`. ⛔ **Revokes the key this credential is calling with, at once** (no grace period): a number key rotates itself, the workspace's primary key rotates itself (a named `ps_workspace_` key rotates the primary and survives). ⚠️ If this n8n credential holds that key, **every later node and workflow using it answers `401`** until you paste the new key into the credential. The new `key` is shown **once** — store it first and keep the output out of logs. Zero-downtime: create a named key, switch to it, then revoke the old one. Account key: `apikeys:reveal` (OWNER); per-number OAuth grant: `403 NUMBERS_GRANT_NOT_ALLOWED`. Different from **Regenerate** (`POST /v1/api-keys`), which rotates a given number's default key.
|
|
416
|
+
- **Conversation → Get Many:** `GET /v1/conversations?page=&pageSize=&startDate=&endDate=` → `{ conversations, total, page, pageSize, totalPages }`, latest activity first; dates filter by `lastMessageAt`. RELAY_ONLY redacts peer/preview and adds a `notice`. Number-scoped key, `chat:read` (AGENT and up).
|
|
417
|
+
- **Meta Pricing → Get:** `GET /v1/meta/pricing` — Meta's **published** per-message rate, not your bill. All of **Market**, **Currency**, **Category** blank → the catalogue; all three → `{ market, marketName, currency, category, pricePerMessage, fetchedAt, source }` (+ `volumeTiers` with **Include Volume Tiers**, `tiers=true`); some → `400`. Any key.
|
|
418
|
+
- **Embed → Create Session:** `POST /v1/embed/sessions` with `{ surface, allowedOrigins }` (+ `whatsappNumberIds` from **Number IDs** on chat, `ttlSeconds` when > 0, `brandingOverride` from **Branding Override (JSON)**) → `201 { token, surface, whatsappNumberIds, allowedOrigins, expiresAt }`. ⚠️ The `token` is a bearer credential until `expiresAt` (chat: read and send on those numbers; connect: connect a number to the workspace) — give it only to that user's page. Chat on a workspace key needs Number IDs (`400 NUMBERS_REQUIRED`); connect needs a workspace key (`403 NUMBER_SCOPE_NOT_ALLOWED`). TTL default 15 min chat / 30 min connect, max 3600 s. Chat `messages:send`, connect `numbers:connect`.
|
|
419
|
+
- **Knowledge → Search:** `POST /v1/knowledge/search` with `{ query, limit }` (+ `type` doc/blog/page, `language` pt-BR/en/es) → `{ results: [{ title, url, type, language, updated, snippet, score }] }`. The public Pilot Status docs, blog and site pages; no workspace data. Any key.
|
|
420
|
+
|
|
305
421
|
---
|
|
306
422
|
|
|
307
423
|
## 💡 Use Case Examples
|
|
@@ -7,7 +7,9 @@ export declare const DEFAULT_BASE_URL = "https://pilotstatus.com.br";
|
|
|
7
7
|
* `/v1` callers by User-Agent and recognises this node only when the header STARTS
|
|
8
8
|
* with `pilot-status-n8n/<version>`; without it n8n would send its generic `n8n`.
|
|
9
9
|
*/
|
|
10
|
-
export declare const USER_AGENT = "pilot-status-n8n/2.
|
|
10
|
+
export declare const USER_AGENT = "pilot-status-n8n/2.21.0";
|
|
11
|
+
/** `x-pilot-status-client: n8n/<version>`, read by the API BEFORE the User-Agent. */
|
|
12
|
+
export declare const CLIENT_HEADER = "n8n/2.21.0";
|
|
11
13
|
export declare class PilotStatusApi implements ICredentialType {
|
|
12
14
|
name: string;
|
|
13
15
|
displayName: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PilotStatusApi = exports.USER_AGENT = exports.DEFAULT_BASE_URL = void 0;
|
|
3
|
+
exports.PilotStatusApi = exports.CLIENT_HEADER = exports.USER_AGENT = exports.DEFAULT_BASE_URL = void 0;
|
|
4
4
|
const version_1 = require("./version");
|
|
5
5
|
/** Production. This is the value stored in every credential that does not pick another one. */
|
|
6
6
|
exports.DEFAULT_BASE_URL = 'https://pilotstatus.com.br';
|
|
@@ -11,6 +11,8 @@ exports.DEFAULT_BASE_URL = 'https://pilotstatus.com.br';
|
|
|
11
11
|
* with `pilot-status-n8n/<version>`; without it n8n would send its generic `n8n`.
|
|
12
12
|
*/
|
|
13
13
|
exports.USER_AGENT = `pilot-status-n8n/${version_1.PACKAGE_VERSION}`;
|
|
14
|
+
/** `x-pilot-status-client: n8n/<version>`, read by the API BEFORE the User-Agent. */
|
|
15
|
+
exports.CLIENT_HEADER = `n8n/${version_1.PACKAGE_VERSION}`;
|
|
14
16
|
class PilotStatusApi {
|
|
15
17
|
constructor() {
|
|
16
18
|
this.name = 'pilotStatusApi';
|
|
@@ -59,6 +61,7 @@ class PilotStatusApi {
|
|
|
59
61
|
headers: {
|
|
60
62
|
'x-api-key': '={{$credentials.apiKey}}',
|
|
61
63
|
'User-Agent': exports.USER_AGENT,
|
|
64
|
+
'x-pilot-status-client': exports.CLIENT_HEADER,
|
|
62
65
|
// An empty header is omitted by n8n, so a credential without a number
|
|
63
66
|
// keeps behaving exactly as before — it does not become
|
|
64
67
|
// `x-whatsapp-number-id: `, which the server would read as a header
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
/**
|
|
3
|
+
* The Chatwoot user access token used by Chatwoot → Connect, Test and Update. It lives in a
|
|
4
|
+
* credential (encrypted in n8n's database) instead of a node parameter, which n8n writes in
|
|
5
|
+
* plain text into the workflow JSON. Instance URL and Account ID are not secret and stay as
|
|
6
|
+
* node parameters.
|
|
7
|
+
*/
|
|
8
|
+
export declare class PilotStatusChatwootApi implements ICredentialType {
|
|
9
|
+
name: string;
|
|
10
|
+
displayName: string;
|
|
11
|
+
documentationUrl: string;
|
|
12
|
+
properties: INodeProperties[];
|
|
13
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PilotStatusChatwootApi = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* The Chatwoot user access token used by Chatwoot → Connect, Test and Update. It lives in a
|
|
6
|
+
* credential (encrypted in n8n's database) instead of a node parameter, which n8n writes in
|
|
7
|
+
* plain text into the workflow JSON. Instance URL and Account ID are not secret and stay as
|
|
8
|
+
* node parameters.
|
|
9
|
+
*/
|
|
10
|
+
class PilotStatusChatwootApi {
|
|
11
|
+
constructor() {
|
|
12
|
+
this.name = 'pilotStatusChatwootApi';
|
|
13
|
+
this.displayName = 'Pilot Status Chatwoot';
|
|
14
|
+
this.documentationUrl = 'https://pilotstatus.com.br/docs';
|
|
15
|
+
this.properties = [
|
|
16
|
+
{
|
|
17
|
+
displayName: 'User Access Token',
|
|
18
|
+
name: 'userAccessToken',
|
|
19
|
+
type: 'string',
|
|
20
|
+
typeOptions: { password: true },
|
|
21
|
+
default: '',
|
|
22
|
+
required: true,
|
|
23
|
+
description: 'Chatwoot user access token (Profile → Access Token)',
|
|
24
|
+
},
|
|
25
|
+
];
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.PilotStatusChatwootApi = PilotStatusChatwootApi;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
/**
|
|
3
|
+
* The two secrets of Number → Create Meta Number. They live in a credential (encrypted in
|
|
4
|
+
* n8n's database) instead of node parameters, which n8n writes in plain text into the
|
|
5
|
+
* workflow JSON on every export or share. The ids that go with them (Phone Number ID,
|
|
6
|
+
* WABA ID, App ID) are not secret and stay as node parameters.
|
|
7
|
+
*/
|
|
8
|
+
export declare class PilotStatusMetaNumberApi implements ICredentialType {
|
|
9
|
+
name: string;
|
|
10
|
+
displayName: string;
|
|
11
|
+
documentationUrl: string;
|
|
12
|
+
properties: INodeProperties[];
|
|
13
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PilotStatusMetaNumberApi = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* The two secrets of Number → Create Meta Number. They live in a credential (encrypted in
|
|
6
|
+
* n8n's database) instead of node parameters, which n8n writes in plain text into the
|
|
7
|
+
* workflow JSON on every export or share. The ids that go with them (Phone Number ID,
|
|
8
|
+
* WABA ID, App ID) are not secret and stay as node parameters.
|
|
9
|
+
*/
|
|
10
|
+
class PilotStatusMetaNumberApi {
|
|
11
|
+
constructor() {
|
|
12
|
+
this.name = 'pilotStatusMetaNumberApi';
|
|
13
|
+
this.displayName = 'Pilot Status Meta Number';
|
|
14
|
+
this.documentationUrl = 'https://pilotstatus.com.br/docs';
|
|
15
|
+
this.properties = [
|
|
16
|
+
{
|
|
17
|
+
displayName: 'Meta Access Token',
|
|
18
|
+
name: 'metaAccessToken',
|
|
19
|
+
type: 'string',
|
|
20
|
+
typeOptions: { password: true },
|
|
21
|
+
default: '',
|
|
22
|
+
required: true,
|
|
23
|
+
description: 'System-user access token with access to the WABA',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
displayName: 'Meta App Secret',
|
|
27
|
+
name: 'metaAppSecret',
|
|
28
|
+
type: 'string',
|
|
29
|
+
typeOptions: { password: true },
|
|
30
|
+
default: '',
|
|
31
|
+
required: true,
|
|
32
|
+
description: 'App secret of your Meta app (signs the webhooks)',
|
|
33
|
+
},
|
|
34
|
+
];
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
exports.PilotStatusMetaNumberApi = PilotStatusMetaNumberApi;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const PACKAGE_VERSION = "2.
|
|
1
|
+
export declare const PACKAGE_VERSION = "2.21.0";
|