n8n-nodes-pilot-status 2.14.0 → 2.15.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,44 @@
2
2
 
3
3
  All notable changes to `n8n-nodes-pilot-status`.
4
4
 
5
+ ## 2.15.1 - 2026-11-09
6
+
7
+ ### Fixed
8
+
9
+ - **Message → Get Many**: the **Status** filter lists `PLAYED` (the recipient listened to
10
+ the voice note) among the accepted values; the API used to refuse it with
11
+ `400 INVALID_STATUS`.
12
+
13
+ ## 2.15.0 - 2026-11-09
14
+
15
+ ### Added
16
+
17
+ - **Template** resource:
18
+ - **Submit to Meta** (`POST /v1/templates/{id}/submit`, no body): the template with
19
+ `metaStatus` (usually `PENDING`) and `metaTemplateId`.
20
+ - **Sync From Meta** (`POST /v1/templates/sync`, no body): `{ created, updated }`. `429
21
+ TEMPLATE_SYNC_IN_PROGRESS` (with `Retry-After`) while a sync of the same number runs.
22
+ - **Preview Delete** (`DELETE /v1/templates/{id}?dry_run=true`): what a delete would do —
23
+ `{ dry_run, action, template, waba, via_number, warnings }` — and nothing changes. A
24
+ separate operation, not a flag: the node has no real template delete.
25
+ - **Current Workspace** resource (`/v1/workspace`, the credential's workspace — a workspace
26
+ key, or an account key with Workspace ID): **Get**, **Rename** (`{ name }`), **Get
27
+ Settings**, **Update Settings** (Main Timezone, Main Language `pt`/`en`/`es`; at least
28
+ one), **Archive** (`{ confirmName }` typed exactly — irreversible from the API, locks
29
+ everyone out) and **Transfer Ownership** (`{ email }`). Archive and Transfer Ownership are
30
+ OWNER only and need the OWNER's account key: any `ps_` workspace or number key answers
31
+ `403 MACHINE_CREDENTIAL_CANNOT_MANAGE_WORKSPACE`.
32
+ - **Webhook** resource (number webhooks, `/v1/webhooks`): **Rotate Secret** (`POST
33
+ …/{id}/rotate-secret` → `{ id, hasSecret, secret }`, the new secret in clear once, no
34
+ overlap) and **Reactivate** (`POST …/{id}/reactivate`, resumes a destination paused by the
35
+ circuit breaker).
36
+
37
+ ### Fixed
38
+
39
+ - The trigger's **Signing Secret** description and the README no longer say the API never
40
+ returns the secret: the create response carries it once, and **Webhook → Rotate Secret**
41
+ returns a new one.
42
+
5
43
  ## 2.14.0 - 2026-11-05
6
44
 
7
45
  ### Added
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Pilot Status - n8n Integration
2
2
 
3
- This is the official [n8n](https://n8n.io/) node for [Pilot Status](https://pilotstatus.com.br) — a WhatsApp transactional, marketing, and bulk messaging platform.
3
+ This is the official [n8n](https://n8n.io/) node for [Pilot Status](https://pilotstatus.com.br/?utm_source=sdk_n8n&utm_medium=docs&utm_campaign=readme&utm_content=intro) — a WhatsApp transactional, marketing, and bulk messaging platform.
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
 
@@ -29,7 +29,7 @@ npm install n8n-nodes-pilot-status
29
29
 
30
30
  To use the Pilot Status node, you need an **API Key**.
31
31
 
32
- 1. Go to your [Pilot Status Dashboard](https://pilotstatus.com.br/api-keys).
32
+ 1. Go to your [Pilot Status Dashboard](https://pilotstatus.com.br/api-keys?utm_source=sdk_n8n&utm_medium=docs&utm_campaign=readme&utm_content=api_keys).
33
33
  2. Create a new API Key.
34
34
  3. In n8n, add a new **Pilot Status API** credential and paste your API Key.
35
35
 
@@ -63,7 +63,7 @@ In this mode the event filter runs **after** delivery: the payload has already r
63
63
 
64
64
  Every delivery from a webhook that has a secret carries `x-pilot-status-signature`: `HMAC-SHA256` hex over the raw body. Paste that secret into the trigger's **Signing Secret** field and any delivery that does not match is rejected with `401`. Leave it empty and **anyone who learns your n8n webhook URL can fire this workflow** with a hand-written payload.
65
65
 
66
- The API never returns the secret — not even in the `201` of the create call — so it cannot be filled in for you, including in Automatic registration. Copy it from the dashboard when the webhook is created; it is shown once.
66
+ 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
67
 
68
68
  ### Available Events:
69
69
  - **Message Sent** (`message.sent`): Triggered when the message is sent to the provider.
@@ -242,6 +242,21 @@ Tenant-scoped credential. Nothing here charges by itself — a human pays the ho
242
242
  template. WhatsApp Business App / coexistence accounts answer `422
243
243
  TEMPLATE_INSIGHTS_UNAVAILABLE_SMB` (Meta gives no insights there); a non-Meta template
244
244
  answers `409 TEMPLATE_NOT_ON_META`. The first call may enable insights on the WABA at Meta.
245
+ - **Submit to Meta:** `POST /v1/templates/{id}/submit`, no body → the template with
246
+ `metaStatus` (usually `PENDING`) and `metaTemplateId`. `409 TEMPLATE_ALREADY_SUBMITTED` /
247
+ `TEMPLATE_NOT_EDITABLE`, `400 META_API_ERROR` (with `meta_code`).
248
+ - **Sync From Meta:** `POST /v1/templates/sync`, no body → `{ created, updated }` — mirrors the
249
+ number's WABA catalogue now. `429 TEMPLATE_SYNC_IN_PROGRESS` (with `Retry-After`) while a
250
+ sync of the same number runs.
251
+ - **Preview Delete:** `DELETE /v1/templates/{id}?dry_run=true` — **changes nothing**; answers
252
+ `{ dry_run, action (DELETE_ON_META_AND_LOCAL|DELETE_LOCAL_ONLY), template, waba, via_number,
253
+ warnings }` (snake_case, as on the wire). Meta deletes **by name** (every language of that
254
+ name on the WABA) and blocks reusing it for ~30 days; `via_number: null` on a Meta template
255
+ means the real delete would be refused (`409 META_TEMPLATE_DELETE_REFUSED`). The real
256
+ delete is not a node operation — use the HTTP Request node.
257
+ - Submit, Sync and Preview Delete need a **number-scoped** credential (number key, or tenant
258
+ key + WhatsApp Number ID) with `templates:manage`; Submit and Sync need a Meta Cloud API
259
+ number with a WABA (`422 TEMPLATE_REQUIRES_META_NUMBER`).
245
260
 
246
261
  ### 16. Workspace and Workspace API Key (account key only)
247
262
 
@@ -252,6 +267,27 @@ These need an **account key** (`ps_account_...`); any other key or an OAuth toke
252
267
  - **Workspace (Account Key) → Link / Unlink Shared Card:** `PUT` / `DELETE /v1/workspaces/{workspaceId}/shared-card`, no body, OWNER of that workspace only → `{ workspaceId, sharedCard, changed }` (idempotent: `changed: false` when nothing changed). Unlink is how a reseller stops its card from paying a defaulting customer's renewals. `409 SHARED_CARD_NOT_CONFIGURED`, `SOURCE_ARCHIVED`, `NO_SHARED_OWNER`; `400 SELF_SOURCE` when linking the source workspace itself.
253
268
  - **Workspace API Key → Get Many / Create / Revoke:** `GET|POST /v1/workspaces/{workspaceId}/api-keys`, `DELETE .../api-keys/{keyId}`, with the user's live role (ADMIN and up). Create mints a named key (`apiKey.key` shown once; `409 WORKSPACE_KEY_LIMIT_REACHED`); Revoke answers `{ id, revokedAt }` (`409 PRIMARY_KEY_NOT_REVOCABLE` for the primary, `404 API_KEY_NOT_FOUND`).
254
269
 
270
+ ### 18. Current Workspace (`/v1/workspace`, the credential's workspace)
271
+
272
+ Not the account-level **Workspace (Account Key)** resource (`/v1/workspaces`, plural): this one acts on the workspace the **credential** points at — a workspace (tenant-scoped) key, or an account key with **Workspace ID** set.
273
+
274
+ - **Get:** `GET /v1/workspace` → `{ id, name, plan, seatsUsed, seatLimit }`. Any role.
275
+ - **Rename:** `PATCH /v1/workspace` with `{ name }` (1–60 characters, trimmed) → `{ id, name }`. `400 INVALID_NAME`.
276
+ - **Get Settings:** `GET /v1/workspace/settings` → `{ settings: { mainCurrency, mainTimezone, mainLanguage, billingMode, currencyLocked }, phoneLinePrice: { currency, price } }`. Any role.
277
+ - **Update Settings:** `PATCH /v1/workspace/settings` with only the fields added under **Update Fields** — **Main Timezone** (IANA) and **Main Language** (`pt`, `en`, `es`); at least one → `{ settings }`. `400 INVALID_TIMEZONE` / `INVALID_LANGUAGE`. Currency and billing mode are not offered (the API refuses them here: the OWNER changes them in the dashboard billing).
278
+ - Rename and Update Settings need `workspace:settings:update`: a workspace `ps_` key passes; an account key needs **ADMIN** and up.
279
+ - **Archive:** `POST /v1/workspace/archive` with `{ confirmName }` — the workspace name typed **exactly** (Get returns it; sent as typed, never trimmed) → `{ archived: true, archivedAt }`. ⛔ **Irreversible from the API**: it locks **everyone** out, the caller included; the workspace's `ps_` keys stop authenticating; there is no unarchive (support only). `400 CONFIRMATION_MISMATCH`, `409 ALREADY_ARCHIVED`.
280
+ - **Transfer Ownership:** `POST /v1/workspace/transfer-ownership` with `{ email }` of an **active** member → `{ transferred: true, newOwnerId, yourNewRole: "ADMIN" }`. You become ADMIN; both sides get their OAuth refresh tokens revoked; it changes who **pays** the bill. `400 NOT_A_MEMBER` / `TARGET_NOT_ACTIVE`, `409 ALREADY_OWNER` / `NOT_OWNER` / `OWNERSHIP_CHANGED`.
281
+ - ⛔ Archive and Transfer Ownership are **OWNER only** and need a **user** on the wire: the OWNER's **account key** (`ps_account_...`) + **Workspace ID**. Any `ps_` workspace or number key answers `403 MACHINE_CREDENTIAL_CANNOT_MANAGE_WORKSPACE`.
282
+
283
+ ### 19. Webhook (number webhooks, `/v1/webhooks`)
284
+
285
+ The registry the **Pilot Status Trigger** registers in. Only two operations; list/create/update/delete stay on the HTTP Request node. Permission `webhooks:manage`; a webhook outside the credential's scope is `404 WEBHOOK_NOT_FOUND`.
286
+
287
+ - **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.
288
+ - **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.
289
+ - `deliveryTimeoutMs` on create/update is platform-staff only (`403 DELIVERY_TIMEOUT_STAFF_ONLY`).
290
+
255
291
  ---
256
292
 
257
293
  ## 💡 Use Case Examples
@@ -267,7 +303,7 @@ Here are some ideas of what you can build with this integration:
267
303
 
268
304
  ## 📚 Documentation & Support
269
305
 
270
- - **API Documentation:** [https://pilotstatus.com.br/docs](https://pilotstatus.com.br/docs)
271
- - **Official Website:** [https://pilotstatus.com.br](https://pilotstatus.com.br)
306
+ - **API Documentation:** [https://pilotstatus.com.br/docs](https://pilotstatus.com.br/docs?utm_source=sdk_n8n&utm_medium=docs&utm_campaign=readme&utm_content=docs)
307
+ - **Official Website:** [https://pilotstatus.com.br](https://pilotstatus.com.br/?utm_source=sdk_n8n&utm_medium=docs&utm_campaign=readme&utm_content=website)
272
308
 
273
309
  If you have any questions or need help, feel free to reach out to our support via the dashboard!
@@ -7,7 +7,7 @@ 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.14.0";
10
+ export declare const USER_AGENT = "pilot-status-n8n/2.15.1";
11
11
  export declare class PilotStatusApi implements ICredentialType {
12
12
  name: string;
13
13
  displayName: string;
@@ -1 +1 @@
1
- export declare const PACKAGE_VERSION = "2.14.0";
1
+ export declare const PACKAGE_VERSION = "2.15.1";
@@ -2,4 +2,4 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PACKAGE_VERSION = void 0;
4
4
  // GENERATED by scripts/write-version.cjs from package.json — do not edit by hand.
5
- exports.PACKAGE_VERSION = "2.14.0";
5
+ exports.PACKAGE_VERSION = "2.15.1";
@@ -97,6 +97,25 @@ export declare function workspaceWebhookUpdatePreSend(this: IExecuteSingleFuncti
97
97
  export declare function workspaceCreatePreSend(this: IExecuteSingleFunctions, requestOptions: IHttpRequestOptions): Promise<IHttpRequestOptions>;
98
98
  /** Workspace API Key → Create: the body is exactly `{ name }`. */
99
99
  export declare function workspaceApiKeyCreatePreSend(this: IExecuteSingleFunctions, requestOptions: IHttpRequestOptions): Promise<IHttpRequestOptions>;
100
+ /**
101
+ * Current Workspace → Rename: the body is exactly `{ name }` — `PATCH /v1/workspace` refuses
102
+ * any other field with 400 UNKNOWN_FIELDS. Trimmed; the API caps it at 60 characters.
103
+ */
104
+ export declare function currentWorkspaceRenamePreSend(this: IExecuteSingleFunctions, requestOptions: IHttpRequestOptions): Promise<IHttpRequestOptions>;
105
+ /**
106
+ * Current Workspace → Update Settings: only the fields added under Update Fields, so a
107
+ * field left out keeps its value. mainCurrency and billingMode are deliberately NOT
108
+ * offered: the route refuses them (400 CURRENCY_NOT_HERE / BILLING_MODE_NOT_HERE).
109
+ */
110
+ export declare function currentWorkspaceSettingsUpdatePreSend(this: IExecuteSingleFunctions, requestOptions: IHttpRequestOptions): Promise<IHttpRequestOptions>;
111
+ /**
112
+ * Current Workspace → Archive: the body is exactly `{ confirmName }`. The name is sent AS
113
+ * TYPED (not trimmed): the API compares it exactly with the workspace name and answers 400
114
+ * CONFIRMATION_MISMATCH otherwise. Empty is refused here, before the round trip.
115
+ */
116
+ export declare function currentWorkspaceArchivePreSend(this: IExecuteSingleFunctions, requestOptions: IHttpRequestOptions): Promise<IHttpRequestOptions>;
117
+ /** Current Workspace → Transfer Ownership: the body is exactly `{ email }`, trimmed. */
118
+ export declare function currentWorkspaceTransferOwnershipPreSend(this: IExecuteSingleFunctions, requestOptions: IHttpRequestOptions): Promise<IHttpRequestOptions>;
100
119
  /**
101
120
  * Billing → Create Checkout: the `POST /v1/billing/checkout` body.
102
121
  *
@@ -11,6 +11,10 @@ exports.workspaceWebhookCreatePreSend = workspaceWebhookCreatePreSend;
11
11
  exports.workspaceWebhookUpdatePreSend = workspaceWebhookUpdatePreSend;
12
12
  exports.workspaceCreatePreSend = workspaceCreatePreSend;
13
13
  exports.workspaceApiKeyCreatePreSend = workspaceApiKeyCreatePreSend;
14
+ exports.currentWorkspaceRenamePreSend = currentWorkspaceRenamePreSend;
15
+ exports.currentWorkspaceSettingsUpdatePreSend = currentWorkspaceSettingsUpdatePreSend;
16
+ exports.currentWorkspaceArchivePreSend = currentWorkspaceArchivePreSend;
17
+ exports.currentWorkspaceTransferOwnershipPreSend = currentWorkspaceTransferOwnershipPreSend;
14
18
  exports.billingCheckoutPreSend = billingCheckoutPreSend;
15
19
  exports.billingPaymentIntentPreSend = billingPaymentIntentPreSend;
16
20
  exports.leadFormConfigPreSend = leadFormConfigPreSend;
@@ -300,6 +304,63 @@ async function workspaceApiKeyCreatePreSend(requestOptions) {
300
304
  requestOptions.body = { name: requiredName.call(this, 'workspaceApiKeyName', 'a workspace API key') };
301
305
  return requestOptions;
302
306
  }
307
+ /**
308
+ * Current Workspace → Rename: the body is exactly `{ name }` — `PATCH /v1/workspace` refuses
309
+ * any other field with 400 UNKNOWN_FIELDS. Trimmed; the API caps it at 60 characters.
310
+ */
311
+ async function currentWorkspaceRenamePreSend(requestOptions) {
312
+ var _a;
313
+ const name = String((_a = this.getNodeParameter('currentWorkspaceName', '')) !== null && _a !== void 0 ? _a : '').trim();
314
+ if (!name)
315
+ throw new Error('Pilot Status: "Name" is required to rename the workspace.');
316
+ requestOptions.body = { name };
317
+ return requestOptions;
318
+ }
319
+ /**
320
+ * Current Workspace → Update Settings: only the fields added under Update Fields, so a
321
+ * field left out keeps its value. mainCurrency and billingMode are deliberately NOT
322
+ * offered: the route refuses them (400 CURRENCY_NOT_HERE / BILLING_MODE_NOT_HERE).
323
+ */
324
+ async function currentWorkspaceSettingsUpdatePreSend(requestOptions) {
325
+ const raw = this.getNodeParameter('currentWorkspaceSettingsFields', {});
326
+ const fields = raw && typeof raw === 'object' ? raw : {};
327
+ const body = {};
328
+ const timezone = typeof fields.mainTimezone === 'string' ? fields.mainTimezone.trim() : '';
329
+ if (timezone)
330
+ body.mainTimezone = timezone;
331
+ const language = typeof fields.mainLanguage === 'string' ? fields.mainLanguage.trim() : '';
332
+ if (language)
333
+ body.mainLanguage = language;
334
+ if (Object.keys(body).length === 0) {
335
+ throw new Error('Pilot Status: add at least one field under "Update Fields" (Main Timezone or Main Language) to update the workspace settings.');
336
+ }
337
+ requestOptions.body = body;
338
+ return requestOptions;
339
+ }
340
+ /**
341
+ * Current Workspace → Archive: the body is exactly `{ confirmName }`. The name is sent AS
342
+ * TYPED (not trimmed): the API compares it exactly with the workspace name and answers 400
343
+ * CONFIRMATION_MISMATCH otherwise. Empty is refused here, before the round trip.
344
+ */
345
+ async function currentWorkspaceArchivePreSend(requestOptions) {
346
+ var _a;
347
+ const confirmName = String((_a = this.getNodeParameter('currentWorkspaceConfirmName', '')) !== null && _a !== void 0 ? _a : '');
348
+ if (!confirmName.trim()) {
349
+ throw new Error('Pilot Status: "Confirm Workspace Name" is required to archive the workspace — type its exact name (Current Workspace → Get returns it).');
350
+ }
351
+ requestOptions.body = { confirmName };
352
+ return requestOptions;
353
+ }
354
+ /** Current Workspace → Transfer Ownership: the body is exactly `{ email }`, trimmed. */
355
+ async function currentWorkspaceTransferOwnershipPreSend(requestOptions) {
356
+ var _a;
357
+ const email = String((_a = this.getNodeParameter('currentWorkspaceNewOwnerEmail', '')) !== null && _a !== void 0 ? _a : '').trim();
358
+ if (!email) {
359
+ throw new Error('Pilot Status: "New Owner Email" is required to transfer the workspace ownership.');
360
+ }
361
+ requestOptions.body = { email };
362
+ return requestOptions;
363
+ }
303
364
  /** A positive finite amount, or a clear error before the round trip (the API's INVALID_AMOUNT). */
304
365
  function positiveAmount(raw, what) {
305
366
  const amount = Number(raw);
@@ -601,6 +662,8 @@ class PilotStatus {
601
662
  { name: 'Billing', value: 'billing' },
602
663
  { name: 'Workspace (Account Key)', value: 'workspace' },
603
664
  { name: 'Workspace API Key (Account Key)', value: 'workspaceApiKey' },
665
+ { name: 'Current Workspace', value: 'currentWorkspace' },
666
+ { name: 'Webhook', value: 'webhook' },
604
667
  ],
605
668
  default: 'message',
606
669
  },
@@ -1315,7 +1378,7 @@ class PilotStatus {
1315
1378
  displayOptions: { show: { resource: ['message'], operation: ['getAll'] } },
1316
1379
  default: '',
1317
1380
  placeholder: 'SENT,DELIVERED',
1318
- description: 'Comma-separated statuses to include: QUEUED, SENT, DELIVERED, READ, FAILED, CANCELED. Leave empty for all.',
1381
+ description: 'Comma-separated statuses to include: QUEUED, SENT, DELIVERED, READ, PLAYED, FAILED, CANCELED. Leave empty for all.',
1319
1382
  },
1320
1383
  {
1321
1384
  displayName: 'Status',
@@ -1736,6 +1799,38 @@ class PilotStatus {
1736
1799
  request: { method: 'GET', url: '=/templates/{{$parameter.templateIdForGet}}/insights' },
1737
1800
  },
1738
1801
  },
1802
+ {
1803
+ name: 'Submit to Meta',
1804
+ value: 'submit',
1805
+ description: 'Submit (or re-submit) the template to Meta for approval on the WABA of the credential\'s number. No body. Answers the template with metaStatus (usually PENDING) and metaTemplateId. Needs a NUMBER-scoped credential (number key, or tenant key + WhatsApp Number ID) on a Meta Cloud API number: otherwise 422 TEMPLATE_REQUIRES_META_NUMBER. 409 TEMPLATE_ALREADY_SUBMITTED / TEMPLATE_NOT_EDITABLE (Meta refuses edits in this state); 400 META_API_ERROR (with meta_code).',
1806
+ action: 'Submit a template to Meta',
1807
+ routing: {
1808
+ request: {
1809
+ method: 'POST',
1810
+ url: '=/templates/{{encodeURIComponent($parameter.templateIdForGet)}}/submit',
1811
+ },
1812
+ },
1813
+ },
1814
+ {
1815
+ name: 'Sync From Meta',
1816
+ value: 'sync',
1817
+ description: 'Mirror the WABA template catalogue of the credential\'s number from Meta now (creates and updates local templates). No body. Answers {created, updated}. 429 TEMPLATE_SYNC_IN_PROGRESS (with Retry-After) while a sync of the same number runs; 422 TEMPLATE_REQUIRES_META_NUMBER when the number is not a Meta Cloud API number.',
1818
+ action: 'Sync templates from Meta',
1819
+ routing: { request: { method: 'POST', url: '/templates/sync' } },
1820
+ },
1821
+ {
1822
+ name: 'Preview Delete',
1823
+ value: 'previewDelete',
1824
+ description: 'Dry run of a template delete — CHANGES NOTHING (DELETE ?dry_run=true). Answers {dry_run, action: DELETE_ON_META_AND_LOCAL | DELETE_LOCAL_ONLY, template, waba, via_number, warnings}. Meta deletes BY NAME (every language of that name on the WABA goes) and blocks reusing the name for ~30 days; via_number null on a Meta template means the real delete would be refused (409 META_TEMPLATE_DELETE_REFUSED). This node does not perform the real delete.',
1825
+ action: 'Preview a template delete',
1826
+ routing: {
1827
+ request: {
1828
+ method: 'DELETE',
1829
+ url: '=/templates/{{encodeURIComponent($parameter.templateIdForGet)}}',
1830
+ qs: { dry_run: 'true' },
1831
+ },
1832
+ },
1833
+ },
1739
1834
  ],
1740
1835
  default: 'getAll',
1741
1836
  },
@@ -1743,7 +1838,9 @@ class PilotStatus {
1743
1838
  displayName: 'Template ID',
1744
1839
  name: 'templateIdForGet',
1745
1840
  type: 'string',
1746
- displayOptions: { show: { resource: ['template'], operation: ['get', 'getInsights'] } },
1841
+ displayOptions: {
1842
+ show: { resource: ['template'], operation: ['get', 'getInsights', 'submit', 'previewDelete'] },
1843
+ },
1747
1844
  default: '',
1748
1845
  required: true,
1749
1846
  },
@@ -4102,6 +4199,186 @@ class PilotStatus {
4102
4199
  default: '',
4103
4200
  required: true,
4104
4201
  },
4202
+ // ----------------------------------
4203
+ // Current Workspace Operations (/v1/workspace, SINGULAR) — the workspace the CREDENTIAL acts
4204
+ // on: a workspace (tenant-scoped) key, or an account key with Workspace ID set. NOT the
4205
+ // account-level Workspace (Account Key) resource above (/v1/workspaces, plural), which lists
4206
+ // and creates workspaces and ignores Workspace ID.
4207
+ // - Get / Get Settings: any role.
4208
+ // - Rename / Update Settings: workspace:settings:update — a workspace ps_ key passes; an
4209
+ // account key needs ADMIN and up.
4210
+ // - Archive / Transfer Ownership: OWNER only AND a user on the wire — the OWNER's account
4211
+ // key + Workspace ID. Every classic ps_ key (workspace or number) answers 403
4212
+ // MACHINE_CREDENTIAL_CANNOT_MANAGE_WORKSPACE: a leaked key must never lock the account
4213
+ // or hand it over.
4214
+ // ----------------------------------
4215
+ {
4216
+ displayName: 'Operation',
4217
+ name: 'operation',
4218
+ type: 'options',
4219
+ noDataExpression: true,
4220
+ displayOptions: { show: { resource: ['currentWorkspace'] } },
4221
+ options: [
4222
+ {
4223
+ name: 'Get',
4224
+ value: 'get',
4225
+ description: 'The credential\'s workspace: {id, name, plan, seatsUsed, seatLimit}. name is what Archive asks you to type. Any role.',
4226
+ action: 'Get the current workspace',
4227
+ routing: { request: { method: 'GET', url: '/workspace' } },
4228
+ },
4229
+ {
4230
+ name: 'Rename',
4231
+ value: 'rename',
4232
+ description: 'Rename the credential\'s workspace. Body {name} (1–60 characters after trimming). Answers {id, name}. 400 INVALID_NAME. A workspace key passes; an account key needs ADMIN and up.',
4233
+ action: 'Rename the current workspace',
4234
+ routing: {
4235
+ request: { method: 'PATCH', url: '/workspace' },
4236
+ send: { preSend: [currentWorkspaceRenamePreSend] },
4237
+ },
4238
+ },
4239
+ {
4240
+ name: 'Get Settings',
4241
+ value: 'getSettings',
4242
+ description: 'Answers {settings: {mainCurrency, mainTimezone, mainLanguage, billingMode, currencyLocked}, phoneLinePrice: {currency, price}}. Any role.',
4243
+ action: 'Get the current workspace settings',
4244
+ routing: { request: { method: 'GET', url: '/workspace/settings' } },
4245
+ },
4246
+ {
4247
+ name: 'Update Settings',
4248
+ value: 'updateSettings',
4249
+ description: 'Change only the fields added under Update Fields (Main Timezone, Main Language; at least one). Answers {settings}. 400 INVALID_TIMEZONE / INVALID_LANGUAGE. Currency and billing mode are not changed here (the OWNER changes them in the dashboard billing). A workspace key passes; an account key needs ADMIN and up.',
4250
+ action: 'Update the current workspace settings',
4251
+ routing: {
4252
+ request: { method: 'PATCH', url: '/workspace/settings' },
4253
+ send: { preSend: [currentWorkspaceSettingsUpdatePreSend] },
4254
+ },
4255
+ },
4256
+ {
4257
+ name: 'Archive',
4258
+ value: 'archive',
4259
+ description: 'IRREVERSIBLE from the API: archives the workspace and LOCKS EVERYONE OUT, the caller included; its ps_ keys stop authenticating and there is no unarchive (support only). OWNER only, with the OWNER\'s account key + Workspace ID — any ps_ workspace or number key answers 403 MACHINE_CREDENTIAL_CANNOT_MANAGE_WORKSPACE. Answers {archived: true, archivedAt}. 400 CONFIRMATION_MISMATCH when the typed name differs; 409 ALREADY_ARCHIVED.',
4260
+ action: 'Archive the current workspace',
4261
+ routing: {
4262
+ request: { method: 'POST', url: '/workspace/archive' },
4263
+ send: { preSend: [currentWorkspaceArchivePreSend] },
4264
+ },
4265
+ },
4266
+ {
4267
+ name: 'Transfer Ownership',
4268
+ value: 'transferOwnership',
4269
+ description: 'Make an ACTIVE member the OWNER; you become ADMIN, and BOTH sides have their OAuth refresh tokens revoked. It changes who PAYS the bill. OWNER only, with the OWNER\'s account key + Workspace ID — any ps_ workspace or number key answers 403 MACHINE_CREDENTIAL_CANNOT_MANAGE_WORKSPACE. Answers {transferred: true, newOwnerId, yourNewRole: ADMIN}. 400 NOT_A_MEMBER / TARGET_NOT_ACTIVE; 409 ALREADY_OWNER / NOT_OWNER / OWNERSHIP_CHANGED.',
4270
+ action: 'Transfer the ownership of the current workspace',
4271
+ routing: {
4272
+ request: { method: 'POST', url: '/workspace/transfer-ownership' },
4273
+ send: { preSend: [currentWorkspaceTransferOwnershipPreSend] },
4274
+ },
4275
+ },
4276
+ ],
4277
+ default: 'get',
4278
+ },
4279
+ {
4280
+ displayName: 'Name',
4281
+ name: 'currentWorkspaceName',
4282
+ type: 'string',
4283
+ description: 'New workspace name (1–60 characters after trimming)',
4284
+ displayOptions: { show: { resource: ['currentWorkspace'], operation: ['rename'] } },
4285
+ default: '',
4286
+ required: true,
4287
+ },
4288
+ {
4289
+ displayName: 'Update Fields',
4290
+ name: 'currentWorkspaceSettingsFields',
4291
+ type: 'collection',
4292
+ placeholder: 'Add Field',
4293
+ displayOptions: { show: { resource: ['currentWorkspace'], operation: ['updateSettings'] } },
4294
+ default: {},
4295
+ options: [
4296
+ {
4297
+ displayName: 'Main Language',
4298
+ name: 'mainLanguage',
4299
+ type: 'options',
4300
+ options: [
4301
+ { name: 'English', value: 'en' },
4302
+ { name: 'Portuguese', value: 'pt' },
4303
+ { name: 'Spanish', value: 'es' },
4304
+ ],
4305
+ default: 'pt',
4306
+ description: 'Default language of the workspace',
4307
+ },
4308
+ {
4309
+ displayName: 'Main Timezone',
4310
+ name: 'mainTimezone',
4311
+ type: 'string',
4312
+ default: '',
4313
+ placeholder: 'America/Sao_Paulo',
4314
+ description: 'IANA timezone. A blank value is ignored; an unknown one is 400 INVALID_TIMEZONE.',
4315
+ },
4316
+ ],
4317
+ },
4318
+ {
4319
+ displayName: 'Confirm Workspace Name',
4320
+ name: 'currentWorkspaceConfirmName',
4321
+ type: 'string',
4322
+ description: 'Type the workspace name EXACTLY (Current Workspace → Get returns it) to confirm the archive. Sent as typed, never trimmed; a mismatch is 400 CONFIRMATION_MISMATCH and archives nothing.',
4323
+ displayOptions: { show: { resource: ['currentWorkspace'], operation: ['archive'] } },
4324
+ default: '',
4325
+ required: true,
4326
+ },
4327
+ {
4328
+ displayName: 'New Owner Email',
4329
+ name: 'currentWorkspaceNewOwnerEmail',
4330
+ type: 'string',
4331
+ placeholder: 'name@email.com',
4332
+ description: 'Email of an ACTIVE member of the workspace who becomes the OWNER',
4333
+ displayOptions: { show: { resource: ['currentWorkspace'], operation: ['transferOwnership'] } },
4334
+ default: '',
4335
+ required: true,
4336
+ },
4337
+ // ----------------------------------
4338
+ // Webhook Operations (/v1/webhooks — the NUMBER webhooks, the registry the Pilot Status
4339
+ // Trigger registers in). Only the two actions a workflow needs here; list/create/update/
4340
+ // delete stay on the HTTP Request node (see README). Permission webhooks:manage. A
4341
+ // webhook of another number than the credential's is 404 WEBHOOK_NOT_FOUND.
4342
+ // (deliveryTimeoutMs on create/update is platform-staff only — 403
4343
+ // DELIVERY_TIMEOUT_STAFF_ONLY — and is not exposed.)
4344
+ // ----------------------------------
4345
+ {
4346
+ displayName: 'Operation',
4347
+ name: 'operation',
4348
+ type: 'options',
4349
+ noDataExpression: true,
4350
+ displayOptions: { show: { resource: ['webhook'] } },
4351
+ options: [
4352
+ {
4353
+ name: 'Rotate Secret',
4354
+ value: 'rotateSecret',
4355
+ description: 'Mint a NEW signing secret and return it in clear ONCE: {id, hasSecret: true, secret} — no read path returns it, store it now. Immediate, with NO overlap: the old secret stops at once (deliveries already in flight may still carry it — accept both briefly, or rotate when quiet). The only way to get a secret for a webhook created before 2026-09-15 (unsigned until rotated). 404 WEBHOOK_NOT_FOUND.',
4356
+ action: 'Rotate the secret of a webhook',
4357
+ routing: {
4358
+ request: { method: 'POST', url: '=/webhooks/{{encodeURIComponent($parameter.webhookId)}}/rotate-secret' },
4359
+ },
4360
+ },
4361
+ {
4362
+ name: 'Reactivate',
4363
+ value: 'reactivate',
4364
+ description: 'Resume delivery to a destination paused by the circuit breaker (it only closes by hand). Idempotent: already delivering → released 0. Answers {ok, released (held events re-queued), stillHeld, circuitOpen, circuitOpenedAt, circuitSuccessPct, heldCount, droppedCount}.',
4365
+ action: 'Reactivate a webhook',
4366
+ routing: {
4367
+ request: { method: 'POST', url: '=/webhooks/{{encodeURIComponent($parameter.webhookId)}}/reactivate' },
4368
+ },
4369
+ },
4370
+ ],
4371
+ default: 'rotateSecret',
4372
+ },
4373
+ {
4374
+ displayName: 'Webhook ID',
4375
+ name: 'webhookId',
4376
+ type: 'string',
4377
+ description: 'Pilot Status id of the number webhook (GET /v1/webhooks, or the dashboard)',
4378
+ displayOptions: { show: { resource: ['webhook'] } },
4379
+ default: '',
4380
+ required: true,
4381
+ },
4105
4382
  ],
4106
4383
  };
4107
4384
  }
@@ -188,7 +188,7 @@ class PilotStatusTrigger {
188
188
  type: 'string',
189
189
  typeOptions: { password: true },
190
190
  default: '',
191
- description: 'The webhook signing secret, shown ONCE in the dashboard when the webhook is created. When filled in, every delivery whose x-pilot-status-signature does not match is rejected with 401. Leave empty to accept unsigned deliveries — but then anyone who learns this URL can fire this workflow. The API never returns the secret, not even on create, so it cannot be filled in automatically.',
191
+ description: 'The webhook signing secret, returned in clear ONCE: in the response of the create (POST /v1/webhooks, or the dashboard) and by Pilot Status → Webhook → Rotate Secret; no read returns it. When filled in, every delivery whose x-pilot-status-signature does not match is rejected with 401. Leave empty to accept unsigned deliveries — but then anyone who learns this URL can fire this workflow. Automatic registration does not fill this field: to sign a webhook it created, run Rotate Secret on its id and paste the result here.',
192
192
  },
193
193
  {
194
194
  displayName: 'Notice: Webhook URL',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-pilot-status",
3
- "version": "2.14.0",
3
+ "version": "2.15.1",
4
4
  "description": "n8n node for Pilot Status API",
5
5
  "keywords": [
6
6
  "n8ncommunity",