planvortex 0.19.0 → 0.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/README.md +20 -3
- package/dist/{chunk-ZHS7FY3T.js → chunk-A77VAAQH.js} +8 -3
- package/dist/chunk-A77VAAQH.js.map +1 -0
- package/dist/{index-DD7oGNvm.d.cts → index-BsE8URFA.d.cts} +287 -23
- package/dist/{index-DD7oGNvm.d.ts → index-BsE8URFA.d.ts} +287 -23
- package/dist/index.cjs +87 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +70 -10
- package/dist/index.d.ts +70 -10
- package/dist/index.js +83 -5
- package/dist/index.js.map +1 -1
- package/dist/webhooks/index.cjs +6 -1
- package/dist/webhooks/index.cjs.map +1 -1
- package/dist/webhooks/index.d.cts +1 -1
- package/dist/webhooks/index.d.ts +1 -1
- package/dist/webhooks/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-ZHS7FY3T.js.map +0 -1
|
@@ -991,7 +991,7 @@ interface paths {
|
|
|
991
991
|
* Re-enable a disconnected account
|
|
992
992
|
* @description Brings back an account that was removed, without going through the authorization again — as long as its stored token still works.
|
|
993
993
|
*
|
|
994
|
-
* It takes a **slot of the plan**, so it fails with error 706 when the organization is already at its account limit. It also turns the network's webhooks back on, on any plan but the free one.
|
|
994
|
+
* It takes a **slot of the plan**, so it fails with error 706 when the organization is already at its account limit. It also turns the network's webhooks back on, on any plan but the free one. On the free plan a `whatsapp` account that is not active cannot be enabled (error 516), because its chat and its templates need a paid plan. One that is already active can still be reconnected.
|
|
995
995
|
*
|
|
996
996
|
* **On `telegram` you normally never call this.** That network's accounts are born active — there is no authorization return in which to choose them, so PlanVortex takes the slot when the bot is added to the channel. The one case left is a channel that arrived while the plan was full: it stays off until a slot frees up, and this is what turns it on.
|
|
997
997
|
*
|
|
@@ -1017,6 +1017,10 @@ interface paths {
|
|
|
1017
1017
|
*
|
|
1018
1018
|
* The shape of a template is the network's own: PlanVortex does not normalise it.
|
|
1019
1019
|
*
|
|
1020
|
+
* **A rejected template says why.** WhatsApp templates carry `rejected_reason` (`INVALID_FORMAT`, `PROMOTIONAL`, `TAG_CONTENT_MISMATCH`...) next to their `status`, as WhatsApp sends it.
|
|
1021
|
+
*
|
|
1022
|
+
* **`health` says whether the account can start conversations at all.** A template is only needed outside the 24-hour window, which is exactly what a failed payment method or an unverified business blocks, and neither of them fails when you create or approve a template: the message is simply never delivered. `health` is WhatsApp's own status for the phone number, reduced to `can_send_message` (`AVAILABLE`, `LIMITED`, `BLOCKED`), the `issues` behind it with WhatsApp's code (141006 = payment method, 141010 = business not verified) and `notes`. When it can't be read the field is absent, which means unknown, not healthy.
|
|
1023
|
+
*
|
|
1020
1024
|
* **WhatsApp only.** No other network implements message templates: asking any of them returns HTTP 500 with `code: 500` (an unhandled server error), not the 1502 you would expect. Check `messages` in `GET /social_capabilities` and that the account is WhatsApp before calling.
|
|
1021
1025
|
*/
|
|
1022
1026
|
get: operations["getMessageTemplates"];
|
|
@@ -1027,6 +1031,10 @@ interface paths {
|
|
|
1027
1031
|
*
|
|
1028
1032
|
* **Approval is not immediate.** The template comes back in a pending state and only becomes usable when the network approves it, which takes minutes or hours and can be refused.
|
|
1029
1033
|
*
|
|
1034
|
+
* **WhatsApp templates are checked before they leave.** WhatsApp rejects a badly formatted template in the same second with `INVALID_FORMAT` and no explanation, so PlanVortex checks the rules it documents first and answers **1513** with `data.field` and `data.reason`: `invalid_name` (lowercase letters, numbers and underscores only), `missing_language`, `missing_body`, `body_too_long` (1,024 characters), `malformed_variable`, `variables_not_sequential`, `variable_at_edge` (the text can't start or end with a variable), `adjacent_variables` and `missing_examples`. **A body with variables needs one example per variable** in `example.body_text`, as in the example below.
|
|
1035
|
+
*
|
|
1036
|
+
* If WhatsApp refuses the template when it is created (a language it doesn't have, a name already in use), the answer is **1514** with WhatsApp's own `code`, `subcode` and `message` in `data`.
|
|
1037
|
+
*
|
|
1030
1038
|
* **WhatsApp only.** No other network implements message templates: asking any of them returns HTTP 500 with `code: 500` (an unhandled server error), not the 1502 you would expect. Check `messages` in `GET /social_capabilities` and that the account is WhatsApp before calling.
|
|
1031
1039
|
*/
|
|
1032
1040
|
post: operations["createMessageTemplate"];
|
|
@@ -1097,6 +1105,37 @@ interface paths {
|
|
|
1097
1105
|
patch?: never;
|
|
1098
1106
|
trace?: never;
|
|
1099
1107
|
};
|
|
1108
|
+
"/organizations/{id_organization}/accounts/{id_account}/messages/{id_message}/files/{index}": {
|
|
1109
|
+
parameters: {
|
|
1110
|
+
query?: never;
|
|
1111
|
+
header?: never;
|
|
1112
|
+
path?: never;
|
|
1113
|
+
cookie?: never;
|
|
1114
|
+
};
|
|
1115
|
+
/**
|
|
1116
|
+
* One file of a message, fetched from the network
|
|
1117
|
+
* @description Files that arrive in a message (a photo, a video, a voice note, a document, a sticker) **are not stored by PlanVortex**: they stay on the network, and `message_options.files_urls` says where each one is.
|
|
1118
|
+
*
|
|
1119
|
+
* • **With `url`** (Instagram and Messenger): Meta's own CDN link. It works until Meta expires it.
|
|
1120
|
+
* • **Without `url`** (every WhatsApp file): WhatsApp only hands a file over with the account's token, through a link that lasts five minutes, so there is no link to give you.
|
|
1121
|
+
*
|
|
1122
|
+
* Either way, this endpoint asks the network for the file now and streams it back without keeping a copy. `index` is the file's position in `files_urls`. `message_options.files` holds only the files **you** sent from PlanVortex, which are uploads.
|
|
1123
|
+
*
|
|
1124
|
+
* **The network decides how long a file lives.** WhatsApp lets go of a file 7 days after it arrived, and Meta drops one when the message or the story is deleted. After that the answer is **1515**, with `data.social_network`; on a number that also runs the WhatsApp Business app, the file is still there. **1516** means the message is not from this account, or has no file at that position.
|
|
1125
|
+
*
|
|
1126
|
+
* Images, videos and audio come back `inline`. Anything else (a PDF, a spreadsheet, an HTML file, an SVG) comes back as an `attachment`: someone outside the business sent it, so don't render it inside your own pages.
|
|
1127
|
+
*
|
|
1128
|
+
* **Playing it in a browser.** Not every format WhatsApp accepts plays in a browser: an AMR voice note or a 3GPP video plays in none, and Safari does not play the Ogg/Opus of an ordinary voice note. Add `playable=1` and an audio or a video comes back converted to a format every browser plays (`audio/mp4` or `video/mp4`). **1517** means it could not be converted; the original is still there without the parameter, and the original is what a download should give.
|
|
1129
|
+
*/
|
|
1130
|
+
get: operations["getMessageFile"];
|
|
1131
|
+
put?: never;
|
|
1132
|
+
post?: never;
|
|
1133
|
+
delete?: never;
|
|
1134
|
+
options?: never;
|
|
1135
|
+
head?: never;
|
|
1136
|
+
patch?: never;
|
|
1137
|
+
trace?: never;
|
|
1138
|
+
};
|
|
1100
1139
|
"/organizations/{id_organization}/accounts/{id_account}/metric_list": {
|
|
1101
1140
|
parameters: {
|
|
1102
1141
|
query?: never;
|
|
@@ -1419,6 +1458,42 @@ interface paths {
|
|
|
1419
1458
|
patch?: never;
|
|
1420
1459
|
trace?: never;
|
|
1421
1460
|
};
|
|
1461
|
+
"/organizations/{id_organization}/comments/{id_comment}/files/{index}": {
|
|
1462
|
+
parameters: {
|
|
1463
|
+
query?: never;
|
|
1464
|
+
header?: never;
|
|
1465
|
+
path?: never;
|
|
1466
|
+
cookie?: never;
|
|
1467
|
+
};
|
|
1468
|
+
/**
|
|
1469
|
+
* One file of a comment, fetched from the network
|
|
1470
|
+
* @description Files in a comment (a photo, a GIF, a sticker, a video) **are not stored by PlanVortex**: they stay on the network, and the comment's `files_urls` says where each one is. This endpoint asks the network for the file now and streams it back without keeping a copy. `index` is the file's position in `files_urls`.
|
|
1471
|
+
*
|
|
1472
|
+
* You need it when a file has no `url`, or when its `url` stopped loading:
|
|
1473
|
+
*
|
|
1474
|
+
* • **LinkedIn** gives only the image's id, never a link.
|
|
1475
|
+
* • **Telegram**'s download link carries the bot's token, so it never leaves PlanVortex. A bot can only download up to 20 MB: past that the answer is **1515** with `data.reason: "too_big"` and `data.max_mb: 20`, and the file is only visible in Telegram. Tell the user that, not that the file is gone: it is still there.
|
|
1476
|
+
* • **Bluesky** videos are an HLS playlist that browsers other than Safari do not play; this returns the video file itself.
|
|
1477
|
+
* • **Facebook, Threads and Discord** links expire; this reads the comment again and returns the file behind a fresh link.
|
|
1478
|
+
* • **X** links do not expire, and reading a post again costs money, so X is not re-read: if its `url` no longer loads, the post was deleted and the answer is **1515**.
|
|
1479
|
+
*
|
|
1480
|
+
* **1515** means the network no longer has the file (`data.social_network`), and **2602** that the comment has no file at that position. A comment of another organization is **1102**.
|
|
1481
|
+
*
|
|
1482
|
+
* Images, videos and audio come back `inline`. Anything else comes back as an `attachment`: someone outside the business posted it, so don't render it inside your own pages.
|
|
1483
|
+
*
|
|
1484
|
+
* **Playing it in a browser.** Not every audio or video format plays in every browser: Safari does not play the Ogg/Opus of a Telegram voice note, for instance. Add `playable=1` and an audio or a video comes back converted to a format every browser plays (`audio/mp4` or `video/mp4`). **1517** means it could not be converted; the original is still there without the parameter, and the original is what a download should give.
|
|
1485
|
+
*
|
|
1486
|
+
* Requires the `comments:read` permission (`client_organization_comments:read` for apps) and a paid plan.
|
|
1487
|
+
*/
|
|
1488
|
+
get: operations["getCommentFile"];
|
|
1489
|
+
put?: never;
|
|
1490
|
+
post?: never;
|
|
1491
|
+
delete?: never;
|
|
1492
|
+
options?: never;
|
|
1493
|
+
head?: never;
|
|
1494
|
+
patch?: never;
|
|
1495
|
+
trace?: never;
|
|
1496
|
+
};
|
|
1422
1497
|
"/organizations/{id_organization}/comments/{id_comment}/replies": {
|
|
1423
1498
|
parameters: {
|
|
1424
1499
|
query?: never;
|
|
@@ -1490,6 +1565,8 @@ interface paths {
|
|
|
1490
1565
|
*
|
|
1491
1566
|
* **A network that cannot produce a link simply does not appear.** That is a legitimate answer, not a failure: it is what happens with `discord` in an organization that has not saved its own bot credentials yet (see `PUT /organizations/{id_organization}/social_credentials/{social_network}`).
|
|
1492
1567
|
*
|
|
1568
|
+
* **On the free plan `whatsapp` does not appear either**, unless the organization already has an active WhatsApp account, which has to stay reconnectable. Its chat and its templates need a paid plan, so enabling a new account answers error 516. Asking for it by name gets you an empty list, not an error.
|
|
1569
|
+
*
|
|
1493
1570
|
* **An app cannot call this.** Connecting a social account is an OAuth flow with a person in front of it, so this endpoint only accepts a user token or a temporal connect token; with app credentials it answers error 519. The way an integration does it is to issue a temporal connect token with `GET /organizations/{id_organization}/temporal_connect_token` and hand it to its end user.
|
|
1494
1571
|
*
|
|
1495
1572
|
* **Read `authorization`, not `link`.** Almost every network is `redirect` and you send the person to `link`. Two are not, and neither of them fails visibly if you treat it as one:
|
|
@@ -1568,6 +1645,8 @@ interface paths {
|
|
|
1568
1645
|
/**
|
|
1569
1646
|
* List the contacts of an organization
|
|
1570
1647
|
* @description Newest first. `search` is a full-text search over the name, and `extra_data` filters by your own fields — which is what makes it possible to ask for "the contacts of this campaign" without keeping a second database.
|
|
1648
|
+
*
|
|
1649
|
+
* **A WhatsApp contact may have no phone number.** Since 2026 Meta leaves the number out for people who use a WhatsApp username and have not dealt with that business number by phone in the last 30 days. Such a contact's WhatsApp `external_identifier` is their `user_id` (the BSUID, e.g. `ES.13491208655302741918`), not a phone number, so don't show it or dial it as one. You can still write to them: PlanVortex sends through the BSUID. When their number arrives later, the same contact gets it as `external_identifier` and keeps its `_id` and its messages.
|
|
1571
1650
|
*/
|
|
1572
1651
|
get: operations["getContacts"];
|
|
1573
1652
|
put?: never;
|
|
@@ -1649,7 +1728,7 @@ interface paths {
|
|
|
1649
1728
|
* The whole home screen in one call
|
|
1650
1729
|
* @description Composes every block of the home screen in a single round trip: operational health, publications, publication metrics, account metrics, plan use, AI plans, the best AI plans and unread messages.
|
|
1651
1730
|
*
|
|
1652
|
-
* **A block the caller cannot read is omitted, not refused.** The endpoint
|
|
1731
|
+
* **A block the caller cannot read is omitted, not refused.** The endpoint lets in anyone who can read at least one block (the organization, publications, publication stats, account stats, accounts, messages or AI plans) and then checks each block on its own: somebody who can only see publications gets their home with that block, not a 403. A caller who can read none of them gets `520`. `available_blocks` says which blocks were allowed, so an absent block for lack of permission and an absent block for lack of data can be drawn differently.
|
|
1653
1732
|
*
|
|
1654
1733
|
* The messages block is also omitted when the client's plan has no messaging.
|
|
1655
1734
|
*/
|
|
@@ -2335,7 +2414,7 @@ interface paths {
|
|
|
2335
2414
|
*
|
|
2336
2415
|
* **It connects once.** As soon as an `account-connect` succeeds, the token stops being able to connect anything else and answers error 543; the `enable` calls that finish that same connection keep working until it expires. Issue a new one per connection — they are free and immediate.
|
|
2337
2416
|
*
|
|
2338
|
-
* **If you pass `social_network`, the token is bound to that network** and will not connect any other (error 544). Leave it out to let the person pick.
|
|
2417
|
+
* **If you pass `social_network`, the token is bound to that network** and will not connect any other (error 544). Leave it out to let the person pick. On the free plan, asking for `whatsapp` answers error 516 unless the organization already has an active WhatsApp account to reconnect: its chat and its templates need a paid plan.
|
|
2339
2418
|
*
|
|
2340
2419
|
* **Or show the account picker yourself** with `account_selection=integrator`. By default PlanVortex shows the screen where the person picks which accounts to enable, and only then sends them to your `redirect_uri`. In this mode that screen is yours:
|
|
2341
2420
|
*
|
|
@@ -2389,7 +2468,7 @@ interface paths {
|
|
|
2389
2468
|
};
|
|
2390
2469
|
/**
|
|
2391
2470
|
* Unread messages in the organization
|
|
2392
|
-
* @description How many incoming messages are still unread across every account of the organization.
|
|
2471
|
+
* @description How many incoming messages are still unread across every account of the organization, in total and per account. `total` is the number for a badge; `accounts` says which account holds them, so an inbox can mark the right one instead of making the user open each. It costs one query: do not compute it by walking the conversations.
|
|
2393
2472
|
*/
|
|
2394
2473
|
get: operations["getUnreadMessages"];
|
|
2395
2474
|
put?: never;
|
|
@@ -2593,6 +2672,8 @@ interface paths {
|
|
|
2593
2672
|
*
|
|
2594
2673
|
* **Four more are what TikTok's content sharing guidelines ask a composer to show**, and are `true` only on `tiktok` today: `visibility` (on TikTok, with no default), `interactions`, `commercial_content`, and `publish_settings`, which says the options each account allows must be read from `GET /organizations/{id_organization}/accounts/{id_account}/publish_settings` instead of a fixed list.
|
|
2595
2674
|
*
|
|
2675
|
+
* **`statistics` says whether PlanVortex reads any metric of that network.** It is `true` on every network but `whatsapp`, which does not publish and has no metrics to read. Use it to decide which accounts to offer on a statistics screen (or filter the account list with `capability=statistics`) instead of finding out from an empty series.
|
|
2676
|
+
*
|
|
2596
2677
|
* A `true` here is about the **network**, not about one account of it: a Telegram channel with no linked discussion group answers 965 on its comments even though the network has them.
|
|
2597
2678
|
*
|
|
2598
2679
|
* Only needs authentication.
|
|
@@ -2733,7 +2814,7 @@ interface webhooks {
|
|
|
2733
2814
|
*
|
|
2734
2815
|
* A WhatsApp number can work in the **WhatsApp Business app** on a phone and in PlanVortex at the same time. What the business sends from the app arrives as `field: "message_echoes"`, with the message in `messageObj` as one of **ours**: `contact_id` is the person it was sent to and `from_contact_id` is absent. Store it in the thread; do not answer it. It does not open WhatsApp's 24-hour window.
|
|
2735
2816
|
*
|
|
2736
|
-
* When a contact edits or deletes a message, no event is sent: the message itself changes, and the next read returns it with `edit_date` or `
|
|
2817
|
+
* When a contact edits or deletes a message, or anyone reacts to one, no event is sent: the message itself changes, and the next read returns it with `edit_date`, `deleted_date` or its `reactions`.
|
|
2737
2818
|
*
|
|
2738
2819
|
* ### Verifying the signature
|
|
2739
2820
|
*
|
|
@@ -3771,6 +3852,12 @@ interface components {
|
|
|
3771
3852
|
* • A Telegram comment lives in a **different chat** from the post it answers (the channel's linked discussion group), so it needs two ids at once and travels as `{thread}/{message}`: replying wants the first, deleting wants the second.
|
|
3772
3853
|
*/
|
|
3773
3854
|
external_id: string;
|
|
3855
|
+
/**
|
|
3856
|
+
* @description The comment's files: a photo, a GIF, a sticker, a video. **PlanVortex does not store them** (see `SocialFileUrl`): open `url` when there is one, and when there is not, or it stops loading, fetch the file with `GET /organizations/{id_organization}/comments/{id_comment}/files/{index}`.
|
|
3857
|
+
*
|
|
3858
|
+
* Facebook, Threads, LinkedIn, X, Bluesky, Discord and Telegram give a comment's files, and on Google Business they are the photos and videos of a review. Instagram and YouTube do not expose them in their APIs, so there the list is always empty. A comment that is only a photo has an empty `text` and one file here.
|
|
3859
|
+
*/
|
|
3860
|
+
files_urls?: components["schemas"]["SocialFileUrl"][];
|
|
3774
3861
|
/** @description Hidden on the network. A hidden comment is never swept as deleted: on YouTube, hiding one makes the API stop returning it forever, and without that exception hiding would be indistinguishable from deleting. */
|
|
3775
3862
|
hidden: boolean;
|
|
3776
3863
|
/**
|
|
@@ -3807,7 +3894,7 @@ interface components {
|
|
|
3807
3894
|
/** @description Absent when the network does not publish it — not zero */
|
|
3808
3895
|
reply_count?: number;
|
|
3809
3896
|
social_network: components["schemas"]["CommentsCommentNetworkName"];
|
|
3810
|
-
/** @description **May legitimately be empty.** A stars-only review carries no text at all, so render `rating` alongside it and never assume a blank comment is a loading failure. */
|
|
3897
|
+
/** @description **May legitimately be empty.** A stars-only review carries no text at all, and a comment can be only a photo or a sticker (see `files_urls`), so render `rating` and the files alongside it and never assume a blank comment is a loading failure. */
|
|
3811
3898
|
text: string;
|
|
3812
3899
|
};
|
|
3813
3900
|
/** @description What one network lets you do to a comment. Four booleans and never fewer: an absent key would be indistinguishable from an oversight. */
|
|
@@ -3880,6 +3967,8 @@ interface components {
|
|
|
3880
3967
|
publish_settings: boolean;
|
|
3881
3968
|
/** @description The publication can say **who can reply** to it (`reply_control`): anyone, the account's followers, the profiles it follows or the profiles mentioned in the text. It is set when the publication goes out and cannot be changed afterwards. On a network that answers `false` the field is deleted on save, so do not offer it. Today only `threads`. */
|
|
3882
3969
|
reply_control: boolean;
|
|
3970
|
+
/** @description PlanVortex reads **statistics** for this network: account metrics (`GET /organizations/{id_organization}/accounts/{id_account}/metrics`, whose names come from `.../metric_list`) and, on the networks that publish, the metrics of each publication. It is `true` exactly when the network declares at least one account metric, so it never promises a statistics screen that would stay empty. Today every network but `whatsapp`, which does not publish and has none. */
|
|
3971
|
+
statistics: boolean;
|
|
3883
3972
|
/** @description The publication can say **who can see it** when it goes out (`visibility`). On a network that answers `false` the field is deleted on save, so do not offer it. Today `youtube` (public, unlisted, private) and `tiktok` (public, friends, followers, private; which ones each account allows comes from `publish_settings`). */
|
|
3884
3973
|
visibility: boolean;
|
|
3885
3974
|
webhooks: boolean;
|
|
@@ -3997,7 +4086,7 @@ interface components {
|
|
|
3997
4086
|
ContactsSocialIdentifierInput: {
|
|
3998
4087
|
/** @description Only when you are keeping an identifier the API already gave you. */
|
|
3999
4088
|
_id?: string;
|
|
4000
|
-
/** @description The contact id on that channel — the phone number on WhatsApp, the PSID on Messenger. Optional in the model, but a contact without it cannot be written to, and it is what deduplicates on create. */
|
|
4089
|
+
/** @description The contact id on that channel — the phone number on WhatsApp, the PSID on Messenger. Optional in the model, but a contact without it cannot be written to, and it is what deduplicates on create. On WhatsApp, for someone whose number you don't have, the `user_id` (BSUID) of a contact the API already returned also works: PlanVortex then writes to them through it. */
|
|
4001
4090
|
external_identifier?: string;
|
|
4002
4091
|
social_network: components["schemas"]["ContactChannel"];
|
|
4003
4092
|
};
|
|
@@ -4243,7 +4332,7 @@ interface components {
|
|
|
4243
4332
|
* The catalogue grows with the product, so treat an unknown `code` as a generic failure instead of rejecting it.
|
|
4244
4333
|
*/
|
|
4245
4334
|
Error: {
|
|
4246
|
-
/** @description PlanVortex error code. Ranges: 500-554 auth, tokens, client apps and connect sessions · 601-612 user · 700-716 social accounts · 800-810 files · 900-996 publications · 1000-1003 general · 1100-1111 organizations · 1200-1207 roles · 1300-
|
|
4335
|
+
/** @description PlanVortex error code. Ranges: 500-554 auth, tokens, client apps and connect sessions · 601-612 user · 700-716 social accounts · 800-810 files · 900-996 publications · 1000-1003 general · 1100-1111 organizations · 1200-1207 roles · 1300-1309 client plan · 1400-1408 organization plan · 1500-1517 messaging · 1600-1601 contacts · 1900-1906 payments · 2000-2099 products · 2100-2199 AI plans · 2200-2299 integrations · 2500-2599 publication fields, the ones that no longer fit in 900-996 (visibility, made for kids, TikTok's interactions and commercial content) · 2600-2699 comments, the ones that no longer fit in 945-948. */
|
|
4247
4336
|
code: number;
|
|
4248
4337
|
/** @description Extra context attached to the error, when there is any. */
|
|
4249
4338
|
data?: {
|
|
@@ -4500,6 +4589,28 @@ interface components {
|
|
|
4500
4589
|
message_errors: components["schemas"]["Error"][];
|
|
4501
4590
|
message_options: components["schemas"]["MessageOptions"];
|
|
4502
4591
|
message_type: components["schemas"]["MessageType"];
|
|
4592
|
+
/**
|
|
4593
|
+
* @description The emoji reactions this message has on the network: WhatsApp, Instagram, Messenger and Bluesky. On WhatsApp, Instagram and Messenger each side has at most one reaction per message, and a new one replaces the old; on Bluesky one person can add several. Empty when there are none.
|
|
4594
|
+
*
|
|
4595
|
+
* A reaction is not a new message and **no webhook event is sent** for it: the message itself changes, and the next read returns it with its `reactions`. A reaction to a message PlanVortex never received (sent before the account was connected) is not recorded. On Bluesky, which has no webhook, a new reaction is picked up within a few minutes, and a removed one the next time the conversation is read.
|
|
4596
|
+
*/
|
|
4597
|
+
reactions?: {
|
|
4598
|
+
/**
|
|
4599
|
+
* @description Who reacted: the `contact`, or the `account` itself (the business, from the network's own app or inbox).
|
|
4600
|
+
* @enum {string}
|
|
4601
|
+
*/
|
|
4602
|
+
by: "contact" | "account";
|
|
4603
|
+
/**
|
|
4604
|
+
* Format: date-time
|
|
4605
|
+
* @description When the reaction was added.
|
|
4606
|
+
*/
|
|
4607
|
+
date: string;
|
|
4608
|
+
/**
|
|
4609
|
+
* @description The emoji, as the network sends it.
|
|
4610
|
+
* @example 👍
|
|
4611
|
+
*/
|
|
4612
|
+
emoji: string;
|
|
4613
|
+
}[];
|
|
4503
4614
|
read: boolean;
|
|
4504
4615
|
/** @description Absent on the messages that carry no text of their own, such as a `messaging_seen` acknowledgement. */
|
|
4505
4616
|
text?: string;
|
|
@@ -4508,11 +4619,8 @@ interface components {
|
|
|
4508
4619
|
MessageOptions: {
|
|
4509
4620
|
/** @description The uploads attached to the message. **Populated** wherever the message itself is: the messages list and webhook deliveries carry whole uploads, everything else carries their identifiers. Handle both. */
|
|
4510
4621
|
files: (string | components["schemas"]["Upload"])[];
|
|
4511
|
-
/** @description Files
|
|
4512
|
-
files_urls:
|
|
4513
|
-
mime_type?: string;
|
|
4514
|
-
url?: string;
|
|
4515
|
-
}[];
|
|
4622
|
+
/** @description Files that arrived with the message from the network. PlanVortex does not store them: they live on the network (see `SocialFileUrl`). On WhatsApp every file is here, photos and videos included, and none has a `url`. */
|
|
4623
|
+
files_urls: components["schemas"]["SocialFileUrl"][];
|
|
4516
4624
|
/** @description Meta cards, for `elements_message` and `button_message`. */
|
|
4517
4625
|
metaElements?: {
|
|
4518
4626
|
[key: string]: unknown;
|
|
@@ -4582,7 +4690,7 @@ interface components {
|
|
|
4582
4690
|
/**
|
|
4583
4691
|
* @description What kind of message this is. `simple_message` and `file_message` work everywhere; the rest are network-specific shapes.
|
|
4584
4692
|
*
|
|
4585
|
-
* `unsupported_message` only ever **arrives**: a
|
|
4693
|
+
* `unsupported_message` only ever **arrives**: a message the network does not let the API show. On WhatsApp it is a type the API cannot read, with WhatsApp's reason in `message_errors`; if the number is also in the WhatsApp Business app, the message can be read there. On Instagram and Messenger it is something that is not a file, such as an audio shared from Instagram's own library, which arrives as an empty template. It carries no files and keeps the caption as `text` when there is one. Sending one is refused.
|
|
4586
4694
|
* @enum {string}
|
|
4587
4695
|
*/
|
|
4588
4696
|
MessageType: "simple_message" | "file_message" | "comment_message" | "publication_message" | "quick_reply_message" | "button_message" | "elements_message" | "postback_message" | "template_message" | "interactive_message" | "unsupported_message";
|
|
@@ -5372,10 +5480,28 @@ interface components {
|
|
|
5372
5480
|
*/
|
|
5373
5481
|
verified_date?: string;
|
|
5374
5482
|
};
|
|
5483
|
+
/**
|
|
5484
|
+
* @description A file that arrived from the network: a photo, a video, a voice note, a document or a sticker in a private message or a comment. **PlanVortex does not store it**: it stays on the network, and this says where to find it.
|
|
5485
|
+
*
|
|
5486
|
+
* • **With `url`**: the network's own link, which your page can load directly. On Instagram, Messenger, Facebook, Threads and Discord it **expires**; on X and Bluesky it does not.
|
|
5487
|
+
* • **Without `url`**: the network only hands the file over with a token that never leaves PlanVortex (WhatsApp, and Telegram, whose download link carries the bot's token), or gives only an identifier (LinkedIn, a Bluesky video). Fetch it through the API.
|
|
5488
|
+
*
|
|
5489
|
+
* Either way, when `url` is missing or stops loading, fetch the file with `GET .../messages/{id_message}/files/{index}` or `GET .../comments/{id_comment}/files/{index}`, where `index` is its position in the list. PlanVortex asks the network for it at that moment and streams it back without keeping a copy.
|
|
5490
|
+
*/
|
|
5491
|
+
SocialFileUrl: {
|
|
5492
|
+
/** @description The file's id on the network (WhatsApp's media id, Telegram's `file_id`, a Bluesky CID, a LinkedIn image URN). Treat it as opaque. */
|
|
5493
|
+
external_id?: string;
|
|
5494
|
+
/** @description Always present, so you can decide how to show it. When the network does not say, it is the most likely type: the file fetched through the API comes with its real `Content-Type`. */
|
|
5495
|
+
mime_type: string;
|
|
5496
|
+
/** @description The document's file name, when the network gives one. */
|
|
5497
|
+
name?: string;
|
|
5498
|
+
/** @description The network's direct link, when there is one a browser can open. It may expire. Never present on WhatsApp, Telegram, LinkedIn or a Bluesky video. */
|
|
5499
|
+
url?: string;
|
|
5500
|
+
};
|
|
5375
5501
|
/** @description The same person, on one channel. */
|
|
5376
5502
|
SocialIdentifier: {
|
|
5377
5503
|
_id: string;
|
|
5378
|
-
/** @description Identifier of the contact on that channel. */
|
|
5504
|
+
/** @description Identifier of the contact on that channel. On WhatsApp it is the phone number, digits only, **except** for someone who uses a WhatsApp username and has not shared their number with that business number: then it is their `user_id` (the BSUID, e.g. `ES.13491208655302741918`). It has a country code and a dot in front, so it never looks like a phone number. Don't show it or dial it as one. */
|
|
5379
5505
|
external_identifier?: string;
|
|
5380
5506
|
/**
|
|
5381
5507
|
* Format: date-time
|
|
@@ -5383,6 +5509,8 @@ interface components {
|
|
|
5383
5509
|
*/
|
|
5384
5510
|
last_send_date?: string;
|
|
5385
5511
|
social_network: components["schemas"]["ContactChannel"];
|
|
5512
|
+
/** @description **WhatsApp only.** The person's business-scoped user id at Meta (BSUID), e.g. `ES.13491208655302741918`. Meta sends it with every message, and since 2026 it may leave the phone number out for people who use a username and have not dealt with that business number by phone in the last 30 days. When there is no phone number it is also the `external_identifier`, and PlanVortex writes to the contact through it. Treat it as opaque: it is scoped to Meta's business portfolio, and it changes when the person changes their number (PlanVortex updates the contact when that happens). */
|
|
5513
|
+
user_id?: string;
|
|
5386
5514
|
};
|
|
5387
5515
|
/**
|
|
5388
5516
|
* @description A social network supported by PlanVortex.
|
|
@@ -7847,8 +7975,10 @@ interface operations {
|
|
|
7847
7975
|
* @description Only accounts whose network can do this. It is the same matrix `GET /social_capabilities` publishes, applied server-side: the way to ask for 'the accounts I can publish with' without keeping your own table of which network does what.
|
|
7848
7976
|
*
|
|
7849
7977
|
* `comments` also looks at each account, not only at its network: a LinkedIn **personal profile** is left out, because only LinkedIn pages have a comment inbox. `total` counts the same way.
|
|
7978
|
+
*
|
|
7979
|
+
* `statistics` leaves out the networks PlanVortex reads no metric from (today `whatsapp`): the accounts worth offering on a statistics screen.
|
|
7850
7980
|
*/
|
|
7851
|
-
capability?: "publications" | "messages" | "products" | "webhooks" | "persistent_menu" | "comments";
|
|
7981
|
+
capability?: "publications" | "messages" | "products" | "webhooks" | "persistent_menu" | "comments" | "statistics";
|
|
7852
7982
|
/** @description The limit of records will be retrieved (pagination) */
|
|
7853
7983
|
limit?: number;
|
|
7854
7984
|
/** @description Free-text search over the account's name and username. */
|
|
@@ -8358,6 +8488,7 @@ interface operations {
|
|
|
8358
8488
|
* | --- | --- |
|
|
8359
8489
|
* | `700` | The account has no usable token: it has to be connected again |
|
|
8360
8490
|
* | `706` | The organization has no account slots left in its plan |
|
|
8491
|
+
* | `516` | The plan is free and this network needs a paid plan (today, `whatsapp`) |
|
|
8361
8492
|
* | `519` | This endpoint does not accept app credentials |
|
|
8362
8493
|
* | `544` | This temporal connect token was issued for a different social network |
|
|
8363
8494
|
*/
|
|
@@ -8404,7 +8535,23 @@ interface operations {
|
|
|
8404
8535
|
};
|
|
8405
8536
|
content: {
|
|
8406
8537
|
"application/json": {
|
|
8407
|
-
/** @description
|
|
8538
|
+
/** @description Whether the account can start conversations. WhatsApp only, and absent when it couldn't be read. */
|
|
8539
|
+
health?: {
|
|
8540
|
+
/** @enum {string} */
|
|
8541
|
+
can_send_message: "AVAILABLE" | "LIMITED" | "BLOCKED";
|
|
8542
|
+
/** @description What blocks or limits it. Calling (SIP) errors are left out: they don't affect messaging. */
|
|
8543
|
+
issues: {
|
|
8544
|
+
/** @description WhatsApp's code: 141006 = payment method, 141010 = business not verified. */
|
|
8545
|
+
code: number;
|
|
8546
|
+
description?: string;
|
|
8547
|
+
/** @description Where the problem is: `PHONE_NUMBER`, `WABA`, `BUSINESS` or `APP`. */
|
|
8548
|
+
entity_type: string;
|
|
8549
|
+
solution?: string;
|
|
8550
|
+
}[];
|
|
8551
|
+
/** @description Warnings that are not errors, such as a display name still pending approval. */
|
|
8552
|
+
notes: string[];
|
|
8553
|
+
};
|
|
8554
|
+
/** @description Templates as the network returns them. For WhatsApp: `id`, `name`, `status`, `category`, `language`, `components` and, when rejected, `rejected_reason`. */
|
|
8408
8555
|
templates: {
|
|
8409
8556
|
[key: string]: unknown;
|
|
8410
8557
|
}[];
|
|
@@ -8578,6 +8725,39 @@ interface operations {
|
|
|
8578
8725
|
400: components["responses"]["MessagesError"];
|
|
8579
8726
|
};
|
|
8580
8727
|
};
|
|
8728
|
+
getMessageFile: {
|
|
8729
|
+
parameters: {
|
|
8730
|
+
query?: {
|
|
8731
|
+
/** @description `1` (or `true`) returns an audio or a video in a format every browser plays: audio as AAC in an M4A (`audio/mp4`), video as H.264 with AAC in an MP4 (`video/mp4`). Ask for it only when your player can't open the original. Images and documents come back unchanged. **1517** means it could not be converted (`data.reason`: `too_big` past 64 MB, or `unreadable`); the original is still there without this parameter. Offer the original for download, not the converted copy. */
|
|
8732
|
+
playable?: "1" | "true";
|
|
8733
|
+
};
|
|
8734
|
+
header?: never;
|
|
8735
|
+
path: {
|
|
8736
|
+
/** @description Connected account identifier */
|
|
8737
|
+
id_account: components["parameters"]["MessagesidAccount"];
|
|
8738
|
+
/** @description The message's `_id`. */
|
|
8739
|
+
id_message: string;
|
|
8740
|
+
/** @description Organization identifier */
|
|
8741
|
+
id_organization: components["parameters"]["MessagesidOrganization"];
|
|
8742
|
+
/** @description Position of the file in `message_options.files_urls`, from 0. */
|
|
8743
|
+
index: number;
|
|
8744
|
+
};
|
|
8745
|
+
cookie?: never;
|
|
8746
|
+
};
|
|
8747
|
+
requestBody?: never;
|
|
8748
|
+
responses: {
|
|
8749
|
+
/** @description The file, with the network's `Content-Type`. With `playable`, an audio comes back as `audio/mp4` and a video as `video/mp4`. */
|
|
8750
|
+
200: {
|
|
8751
|
+
headers: {
|
|
8752
|
+
[name: string]: unknown;
|
|
8753
|
+
};
|
|
8754
|
+
content: {
|
|
8755
|
+
"*/*": string;
|
|
8756
|
+
};
|
|
8757
|
+
};
|
|
8758
|
+
400: components["responses"]["MessagesError"];
|
|
8759
|
+
};
|
|
8760
|
+
};
|
|
8581
8761
|
getMetricList: {
|
|
8582
8762
|
parameters: {
|
|
8583
8763
|
query?: never;
|
|
@@ -9422,6 +9602,37 @@ interface operations {
|
|
|
9422
9602
|
400: components["responses"]["CommentsCommentError"];
|
|
9423
9603
|
};
|
|
9424
9604
|
};
|
|
9605
|
+
getCommentFile: {
|
|
9606
|
+
parameters: {
|
|
9607
|
+
query?: {
|
|
9608
|
+
/** @description `1` (or `true`) returns an audio or a video in a format every browser plays: audio as AAC in an M4A (`audio/mp4`), video as H.264 with AAC in an MP4 (`video/mp4`). Ask for it only when your player can't open the original. Images and documents come back unchanged. **1517** means it could not be converted (`data.reason`: `too_big` past 64 MB, or `unreadable`); the original is still there without this parameter. Offer the original for download, not the converted copy. */
|
|
9609
|
+
playable?: "1" | "true";
|
|
9610
|
+
};
|
|
9611
|
+
header?: never;
|
|
9612
|
+
path: {
|
|
9613
|
+
/** @description Comment identifier (PlanVortex's `_id`, not the network's `external_id`) */
|
|
9614
|
+
id_comment: components["parameters"]["CommentsidComment"];
|
|
9615
|
+
/** @description Organization identifier */
|
|
9616
|
+
id_organization: components["parameters"]["CommentsidOrganization"];
|
|
9617
|
+
/** @description Position of the file in the comment's `files_urls`, from 0. */
|
|
9618
|
+
index: number;
|
|
9619
|
+
};
|
|
9620
|
+
cookie?: never;
|
|
9621
|
+
};
|
|
9622
|
+
requestBody?: never;
|
|
9623
|
+
responses: {
|
|
9624
|
+
/** @description The file, with the network's `Content-Type`. With `playable`, an audio comes back as `audio/mp4` and a video as `video/mp4`. */
|
|
9625
|
+
200: {
|
|
9626
|
+
headers: {
|
|
9627
|
+
[name: string]: unknown;
|
|
9628
|
+
};
|
|
9629
|
+
content: {
|
|
9630
|
+
"*/*": string;
|
|
9631
|
+
};
|
|
9632
|
+
};
|
|
9633
|
+
400: components["responses"]["CommentsCommentError"];
|
|
9634
|
+
};
|
|
9635
|
+
};
|
|
9425
9636
|
getCommentReplies: {
|
|
9426
9637
|
parameters: {
|
|
9427
9638
|
query?: {
|
|
@@ -9639,6 +9850,7 @@ interface operations {
|
|
|
9639
9850
|
* | `553` | Some account is not part of this session. `data.accounts` lists them |
|
|
9640
9851
|
* | `706` | The new accounts do not fit in the plan. `data` carries `limit`, `used` and `requested`, and none was enabled |
|
|
9641
9852
|
* | `1101` | Invalid organization |
|
|
9853
|
+
* | `516` | The plan is free and one of the accounts belongs to a network that needs a paid plan (today, `whatsapp`) |
|
|
9642
9854
|
*/
|
|
9643
9855
|
400: {
|
|
9644
9856
|
headers: {
|
|
@@ -11762,6 +11974,7 @@ interface operations {
|
|
|
11762
11974
|
* | Code | Meaning |
|
|
11763
11975
|
* | --- | --- |
|
|
11764
11976
|
* | `514` | This endpoint needs app credentials: neither a user token nor a temporal connect token can issue one |
|
|
11977
|
+
* | `516` | The plan is free, `social_network` needs a paid plan (today, `whatsapp`) and the organization has no active account of it to reconnect |
|
|
11765
11978
|
* | `532` | `redirect_uri` is not one of the app's registered `redirect_urls` |
|
|
11766
11979
|
* | `549` | `account_selection` is not `planvortex` or `integrator`, or it is `integrator` without `redirect_uri` or `social_network`. `data` says which |
|
|
11767
11980
|
* | `550` | `account_selection=integrator` on a network with no return to the browser (`telegram`) |
|
|
@@ -11829,7 +12042,29 @@ interface operations {
|
|
|
11829
12042
|
[name: string]: unknown;
|
|
11830
12043
|
};
|
|
11831
12044
|
content: {
|
|
12045
|
+
/**
|
|
12046
|
+
* @example {
|
|
12047
|
+
* "total": 5,
|
|
12048
|
+
* "accounts": [
|
|
12049
|
+
* {
|
|
12050
|
+
* "id_account": "6650f1c2a8b4e1d2c3f4a5b6",
|
|
12051
|
+
* "total": 3
|
|
12052
|
+
* },
|
|
12053
|
+
* {
|
|
12054
|
+
* "id_account": "6650f1c2a8b4e1d2c3f4a5b7",
|
|
12055
|
+
* "total": 2
|
|
12056
|
+
* }
|
|
12057
|
+
* ]
|
|
12058
|
+
* }
|
|
12059
|
+
*/
|
|
11832
12060
|
"application/json": {
|
|
12061
|
+
/** @description The same count per account. Only accounts with something unread are listed, most unread first; an account that is missing has none. */
|
|
12062
|
+
accounts: {
|
|
12063
|
+
/** @description The account's `_id`. */
|
|
12064
|
+
id_account: string;
|
|
12065
|
+
total: number;
|
|
12066
|
+
}[];
|
|
12067
|
+
/** @description Unread incoming messages across every account. Always the sum of `accounts`. */
|
|
11833
12068
|
total: number;
|
|
11834
12069
|
};
|
|
11835
12070
|
};
|
|
@@ -12349,7 +12584,8 @@ interface operations {
|
|
|
12349
12584
|
* "made_for_kids": false,
|
|
12350
12585
|
* "interactions": false,
|
|
12351
12586
|
* "commercial_content": false,
|
|
12352
|
-
* "publish_settings": false
|
|
12587
|
+
* "publish_settings": false,
|
|
12588
|
+
* "statistics": true
|
|
12353
12589
|
* },
|
|
12354
12590
|
* "google_business": {
|
|
12355
12591
|
* "publications": false,
|
|
@@ -12365,7 +12601,8 @@ interface operations {
|
|
|
12365
12601
|
* "made_for_kids": false,
|
|
12366
12602
|
* "interactions": false,
|
|
12367
12603
|
* "commercial_content": false,
|
|
12368
|
-
* "publish_settings": false
|
|
12604
|
+
* "publish_settings": false,
|
|
12605
|
+
* "statistics": true
|
|
12369
12606
|
* },
|
|
12370
12607
|
* "pinterest": {
|
|
12371
12608
|
* "publications": true,
|
|
@@ -12381,7 +12618,8 @@ interface operations {
|
|
|
12381
12618
|
* "made_for_kids": false,
|
|
12382
12619
|
* "interactions": false,
|
|
12383
12620
|
* "commercial_content": false,
|
|
12384
|
-
* "publish_settings": false
|
|
12621
|
+
* "publish_settings": false,
|
|
12622
|
+
* "statistics": true
|
|
12385
12623
|
* },
|
|
12386
12624
|
* "threads": {
|
|
12387
12625
|
* "publications": true,
|
|
@@ -12397,7 +12635,25 @@ interface operations {
|
|
|
12397
12635
|
* "made_for_kids": false,
|
|
12398
12636
|
* "interactions": false,
|
|
12399
12637
|
* "commercial_content": false,
|
|
12400
|
-
* "publish_settings": false
|
|
12638
|
+
* "publish_settings": false,
|
|
12639
|
+
* "statistics": true
|
|
12640
|
+
* },
|
|
12641
|
+
* "whatsapp": {
|
|
12642
|
+
* "publications": false,
|
|
12643
|
+
* "messages": true,
|
|
12644
|
+
* "products": false,
|
|
12645
|
+
* "webhooks": true,
|
|
12646
|
+
* "persistent_menu": false,
|
|
12647
|
+
* "comments": false,
|
|
12648
|
+
* "destinations": false,
|
|
12649
|
+
* "link": false,
|
|
12650
|
+
* "reply_control": false,
|
|
12651
|
+
* "visibility": false,
|
|
12652
|
+
* "made_for_kids": false,
|
|
12653
|
+
* "interactions": false,
|
|
12654
|
+
* "commercial_content": false,
|
|
12655
|
+
* "publish_settings": false,
|
|
12656
|
+
* "statistics": false
|
|
12401
12657
|
* }
|
|
12402
12658
|
* }
|
|
12403
12659
|
*/
|
|
@@ -13256,7 +13512,15 @@ type ContactCreate = Schemas["ContactsContactCreate"];
|
|
|
13256
13512
|
type ContactUpdate = Schemas["ContactsContactUpdate"];
|
|
13257
13513
|
/** Los campos propios de un contacto: el bloque de direccion y las seis propiedades libres. */
|
|
13258
13514
|
type ContactExtraData = Schemas["ContactExtraData"];
|
|
13259
|
-
/**
|
|
13515
|
+
/**
|
|
13516
|
+
* El mismo contacto, en un canal. Es una red social o `email`.
|
|
13517
|
+
*
|
|
13518
|
+
* **EN WHATSAPP PUEDE NO HABER TELEFONO.** Desde 2026 Meta deja de mandar el numero de quien usa
|
|
13519
|
+
* nombre de usuario y no ha tenido trato por telefono con ese numero de negocio en 30 dias. Lo que
|
|
13520
|
+
* llega siempre es `user_id`, su BSUID (`ES.13491208655302741918`), y sin telefono es tambien el
|
|
13521
|
+
* `external_identifier`. Se reconoce porque lleva el pais y un punto delante: nunca se parece a un
|
|
13522
|
+
* telefono, y no se ensena ni se marca como si lo fuera. Se le puede escribir igual.
|
|
13523
|
+
*/
|
|
13260
13524
|
type SocialIdentifier = Schemas["SocialIdentifier"];
|
|
13261
13525
|
/**
|
|
13262
13526
|
* El mismo, tal y como se MANDA: aqui `_id` es opcional y el servidor pone uno.
|
|
@@ -13747,7 +14011,7 @@ declare class OrganizationError extends PlanVortexError {
|
|
|
13747
14011
|
*/
|
|
13748
14012
|
declare class PlanLimitError extends PlanVortexError {
|
|
13749
14013
|
}
|
|
13750
|
-
/** 1500-
|
|
14014
|
+
/** 1500-1517 — conversaciones, mensajes, plantillas y sus archivos. Exige plan de pago. */
|
|
13751
14015
|
declare class MessagingError extends PlanVortexError {
|
|
13752
14016
|
}
|
|
13753
14017
|
/** 1600-1601 — contactos. */
|