planvortex 0.13.0 → 0.14.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.
@@ -1085,6 +1085,7 @@ interface paths {
1085
1085
  *
1086
1086
  * • `simple_message` needs `text`, and it is validated against `characters` in `GET /social_limits`.
1087
1087
  * • **WhatsApp only allows a free-form message inside 24 hours** of the contact's last message. Outside that window the only thing that goes through is a `template_message` with a pre-approved template, and anything else answers an error.
1088
+ * • A `template_message` needs `message_options.template_name` and `template_language`, and, if the template's body has variables, `template_parameters` with their values in order (`{{1}}`, `{{2}}`...). That is what turns an approved template into an appointment reminder with the customer's name and time.
1088
1089
  * • `file_message` needs at least one entry in `message_options.files` (an upload of this organization) or in `files_urls`.
1089
1090
  * • Facebook and Instagram accept **one** file per message.
1090
1091
  * • `quick_reply_message`, `button_message`, `elements_message` and `interactive_message` are Meta-only shapes and each one requires its own block inside `message_options`.
@@ -1462,6 +1463,8 @@ interface paths {
1462
1463
  *
1463
1464
  * • **WhatsApp is not a URL at all.** Its sign-up is Meta's Embedded Signup, a popup you raise with the Facebook JavaScript SDK, so its `link` is an empty string and everything you need to open that popup travels in `authorization`. A client that loops over the list and redirects to `link` sends its user to its own page.
1464
1465
  * • **Telegram has a link and still is not a redirect.** It opens a chat with the PlanVortex bot, and nobody comes back from it: the account is born minutes later, from the bot being added to a channel, and it is announced over the WebSocket. Open it in another tab and keep listening; redirect to it and there is nobody left to tell.
1466
+ *
1467
+ * **With a temporal token issued with `account_selection=integrator`** the list has a single entry: the session's network, with the session's `state` inside its link. Any other link would go back through the hosted flow, which that token cannot use (error 554). Once the person has come back from the network the session is no longer waiting for a link, and this answers 551.
1465
1468
  */
1466
1469
  get: operations["getConnectLinks"];
1467
1470
  put?: never;
@@ -1472,6 +1475,56 @@ interface paths {
1472
1475
  patch?: never;
1473
1476
  trace?: never;
1474
1477
  };
1478
+ "/organizations/{id_organization}/connect_sessions/{id_session}": {
1479
+ parameters: {
1480
+ query?: never;
1481
+ header?: never;
1482
+ path?: never;
1483
+ cookie?: never;
1484
+ };
1485
+ /**
1486
+ * Read a connect session
1487
+ * @description What your user authorized, so your app can show its own account picker. It only exists for temporal tokens issued with `account_selection=integrator`.
1488
+ *
1489
+ * **What arrives at your `redirect_uri`**: `connect_session` and `social_network`, never account ids. When the connection did not finish there is also `error`: the network's own value (`access_denied` when the person cancelled), `no_accounts` when the network returned none (on `instagram`, an account that is not a business account linked to a page), or `connect_failed` together with our `error_code`. In those three cases the session is still `pending` and the person can try again with the same link.
1490
+ *
1491
+ * **Only the app that issued the token** can read it, with its own credentials. Any other app gets 551, the same answer as an unknown or expired session: the id travels in a URL and should not confirm to anybody that it exists.
1492
+ *
1493
+ * `already_enabled` marks an account that was already connected (a reconnection), which takes no slot. `accounts_used` and `accounts_limit` are the plan counter. A `returned` session lives **thirty minutes**.
1494
+ */
1495
+ get: operations["getConnectSession"];
1496
+ put?: never;
1497
+ post?: never;
1498
+ delete?: never;
1499
+ options?: never;
1500
+ head?: never;
1501
+ patch?: never;
1502
+ trace?: never;
1503
+ };
1504
+ "/organizations/{id_organization}/connect_sessions/{id_session}/confirm": {
1505
+ parameters: {
1506
+ query?: never;
1507
+ header?: never;
1508
+ path?: never;
1509
+ cookie?: never;
1510
+ };
1511
+ get?: never;
1512
+ put?: never;
1513
+ /**
1514
+ * Confirm the accounts of a connect session
1515
+ * @description Enables the accounts your user picked and closes the session. Send an empty list if they picked none: the session closes and nothing is enabled.
1516
+ *
1517
+ * **All or nothing.** If the new accounts do not fit in the plan, the answer is 706 with `{limit, used, requested}` and **none** of them is enabled, so you can show that number as it is. Accounts with `already_enabled: true` do not count.
1518
+ *
1519
+ * Each enabled account fires the `new_account` webhook to your app, as on any other connection.
1520
+ */
1521
+ post: operations["confirmConnectSession"];
1522
+ delete?: never;
1523
+ options?: never;
1524
+ head?: never;
1525
+ patch?: never;
1526
+ trace?: never;
1527
+ };
1475
1528
  "/organizations/{id_organization}/contacts": {
1476
1529
  parameters: {
1477
1530
  query?: never;
@@ -2247,6 +2300,16 @@ interface paths {
2247
2300
  *
2248
2301
  * **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.
2249
2302
  *
2303
+ * **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:
2304
+ *
2305
+ * 1. The `url` that comes back is **the network's own authorization page**, so the person goes there straight from your app. Keep the `connect_session` id next to your user's session.
2306
+ * 2. When they finish, the network sends them through PlanVortex, which renders nothing, to `redirect_uri?connect_session=…&social_network=…`. Check that the id is the one you started.
2307
+ * 3. Read the accounts with `GET /organizations/{id_organization}/connect_sessions/{id_session}`, show your picker, and confirm with `POST /organizations/{id_organization}/connect_sessions/{id_session}/confirm`.
2308
+ *
2309
+ * This mode needs `redirect_uri` and `social_network` (error 549): your app also picks the network. `telegram` cannot use it (error 550), because its link opens a chat that never comes back to the browser. On `whatsapp` the `url` is still a PlanVortex page with one button, because Meta's popup only opens on our domain; the picker after it is yours.
2310
+ *
2311
+ * PlanVortex's domain does show in the address bar on the way back: networks only return to the URLs registered in their own portals.
2312
+ *
2250
2313
  * If you send `redirect_uri` it has to be one of the app's `redirect_urls`, or the call answers error 532.
2251
2314
  */
2252
2315
  get: operations["createTemporalConnectToken"];
@@ -2489,7 +2552,7 @@ interface paths {
2489
2552
  *
2490
2553
  * Today ten networks answer `comments: true`: Facebook, Instagram, Threads, LinkedIn, X, YouTube, Google Business, Bluesky, Discord and Telegram. TikTok, WhatsApp, Slack and Pinterest answer `false`, for reasons of theirs and not ours — on Pinterest the API *counts* a pin's comments and offers no way to read them, so the figure shows up in the publication's statistics and there is still no inbox.
2491
2554
  *
2492
- * **Two of the keys are about publishing, not about reading.** `destinations` says the network publishes into places inside the account and every publication has to name one — a Pinterest board, read with `GET /organizations/{id_organization}/accounts/{id_account}/destinations`. `link` says a publication carries a destination link of its own, separate from its text. Both are `false` everywhere but `pinterest` today, and both are the reason to ask this matrix instead of keeping a list of your own: a composer with its own copy of which network has which field is exactly what drifted with the character limits.
2555
+ * **Three of the keys are about publishing, not about reading.** `destinations` says the network publishes into places inside the account and every publication has to name one — a Pinterest board, read with `GET /organizations/{id_organization}/accounts/{id_account}/destinations`. `link` says a publication carries a destination link of its own, separate from its text. Both are `false` everywhere but `pinterest` today. `reply_control` says a publication can choose who can reply to it, and is `true` only on `threads`. The three are the reason to ask this matrix instead of keeping a list of your own: a composer with its own copy of which network has which field is exactly what drifted with the character limits.
2493
2556
  *
2494
2557
  * 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.
2495
2558
  *
@@ -2686,6 +2749,39 @@ interface components {
2686
2749
  AccountsAccountOne: {
2687
2750
  account: components["schemas"]["Account"];
2688
2751
  };
2752
+ /** @description A connection in `account_selection=integrator` mode, from the moment the temporal token is issued until your app confirms which accounts stay. */
2753
+ AccountsConnectSession: {
2754
+ /** @description The id that comes back in your `redirect_uri` as `connect_session`. */
2755
+ _id: string;
2756
+ /** @description The accounts **this** authorization brought back, in the order the network returned them. Never other pending accounts of the organization. Empty while `pending`. */
2757
+ accounts: components["schemas"]["AccountsConnectSessionAccount"][];
2758
+ /** @description Accounts the plan allows. New accounts beyond `accounts_limit - accounts_used` answer 706 on confirm. */
2759
+ accounts_limit: number;
2760
+ /** @description Accounts of the plan already in use: the same counter the PlanVortex screen shows. */
2761
+ accounts_used: number;
2762
+ /** Format: date-time */
2763
+ creation_date?: string;
2764
+ /**
2765
+ * Format: date-time
2766
+ * @description While `pending`, the token's expiry. Once `returned`, thirty minutes after the person came back. After it the session answers 551 and its accounts stay unconnected.
2767
+ */
2768
+ expires_at: string;
2769
+ id_client?: string;
2770
+ id_organization?: string;
2771
+ /** @description The app that issued the token. Only that app can read or confirm the session. */
2772
+ keycloak_client_idenfifier?: string;
2773
+ redirect_uri?: string;
2774
+ social_network: components["schemas"]["SocialNetwork"];
2775
+ /**
2776
+ * @description `pending`: the person has not come back from the network yet. `returned`: the accounts are waiting for your choice. `confirmed`: done, the session cannot be used again.
2777
+ * @enum {string}
2778
+ */
2779
+ status: "pending" | "returned" | "confirmed";
2780
+ };
2781
+ AccountsConnectSessionAccount: components["schemas"]["Account"] & {
2782
+ /** @description `true` when the account was already connected before this authorization (a reconnection). Confirming it takes no slot of the plan. */
2783
+ already_enabled: boolean;
2784
+ };
2689
2785
  AccountsMetricList: ("page_total_actions" | "page_call_phone_clicks_logged_in_unique" | "page_get_directions_clicks_logged_in_unique" | "page_website_clicks_logged_in_unique" | "page_post_engagements" | "page_consumptions_unique" | "page_negative_feedback" | "page_negative_feedback_unique" | "page_fans_online_per_day" | "page_impressions" | "page_impressions_unique" | "page_impressions_paid" | "page_impressions_paid_unique" | "page_impressions_organic_v2" | "page_impressions_organic_unique_v2" | "page_impressions_viral" | "page_impressions_viral_unique" | "page_impressions_nonviral" | "page_impressions_nonviral_unique" | "page_posts_impressions" | "page_posts_impressions_unique" | "page_posts_impressions_paid" | "page_posts_impressions_paid_unique" | "page_posts_impressions_organic" | "page_posts_impressions_organic_unique" | "page_posts_served_impressions_organic_unique" | "page_posts_impressions_viral" | "page_posts_impressions_viral_unique" | "page_posts_impressions_nonviral" | "page_posts_impressions_nonviral_unique" | "impressions" | "reach" | "total_interactions" | "accounts_engaged" | "likes" | "comments" | "saves" | "shares" | "replies" | "follows_and_unfollows" | "profile_links_taps" | "website_clicks" | "profile_views" | "paidFollowers" | "organicFollowerGain" | "careersPageBannerPromoClicks" | "careersPagePromoLinksClicks" | "careersPageEmployeesClicks" | "careersPageJobsClicks" | "careersPageViewsUnique" | "careersPageViews" | "overviewPageViewsUnique" | "overviewPageViews" | "allPageViews" | "follows" | "share" | "views")[];
2690
2786
  /** @description A metric series for one account, already grouped. `group` says what each row covers: a range of 31 days or less is grouped by day, up to 720 by month, and beyond that by year. */
2691
2787
  AccountsMetricModel: {
@@ -2744,6 +2840,8 @@ interface components {
2744
2840
  graph_version?: string;
2745
2841
  /** @description `meta_embedded_signup` only. Goes to `extras.sessionInfoVersion`. */
2746
2842
  session_info_version?: string;
2843
+ /** @description `meta_embedded_signup` only, and only with a temporal token issued with `account_selection=integrator`. The popup hands the `code` back in JavaScript, not in a URL from Meta, so whoever builds the return URL has to add this as `state`. The PlanVortex page does it for you. */
2844
+ state?: string;
2747
2845
  /**
2748
2846
  * @description `redirect`: send the user to `link`. `meta_embedded_signup`: open the Meta popup with the fields below. `telegram_bot`: open `link` in another tab and wait for the account to show up.
2749
2847
  * @enum {string}
@@ -2789,6 +2887,23 @@ interface components {
2789
2887
  value_proposition?: string;
2790
2888
  website?: string;
2791
2889
  };
2890
+ /**
2891
+ * @description Where an AI-generated image came from. **Only images a model generated carry it**: a photo the organization uploaded, a product photo pulled from a connected shop or an image imported from an integration never does.
2892
+ *
2893
+ * It is set when the image is generated and cannot be edited. Use it to show your own AI label: under article 50(4) of the EU AI Act, telling the audience that an image is AI-generated is the job of whoever publishes it.
2894
+ *
2895
+ * Images made with the default model also carry a signed C2PA manifest, IPTC metadata and a SynthID watermark in the file itself. PlanVortex keeps the IPTC marker when it crops or recompresses an image for a network; the C2PA signature does not survive a change of pixels.
2896
+ */
2897
+ AiImageOrigin: {
2898
+ /** Format: date-time */
2899
+ generated_at: string;
2900
+ /** @description The AI plan that generated it. */
2901
+ id_ai_plan?: string;
2902
+ /** @description The model, as it was requested, for instance `google/gemini-3.1-flash-image`. */
2903
+ model: string;
2904
+ /** @description The AI provider that answered: `openrouter` unless the client brought its own key. */
2905
+ provider: string;
2906
+ };
2792
2907
  /**
2793
2908
  * @description What ONE AI plan achieved with what it published.
2794
2909
  *
@@ -3654,6 +3769,8 @@ interface components {
3654
3769
  persistent_menu: boolean;
3655
3770
  products: boolean;
3656
3771
  publications: boolean;
3772
+ /** @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`. */
3773
+ reply_control: boolean;
3657
3774
  webhooks: boolean;
3658
3775
  };
3659
3776
  /**
@@ -4000,7 +4117,7 @@ interface components {
4000
4117
  * The catalogue grows with the product, so treat an unknown `code` as a generic failure instead of rejecting it.
4001
4118
  */
4002
4119
  Error: {
4003
- /** @description PlanVortex error code. Ranges: 500-548 auth, tokens and client apps · 601-612 user · 700-716 social accounts · 800-810 files · 900-996 publications · 1000-1003 general · 1100-1111 organizations · 1200-1207 roles · 1300-1308 client plan · 1400-1408 organization plan · 1500-1512 messaging · 1600-1601 contacts · 1900-1906 payments · 2000-2099 products · 2100-2199 AI plans · 2200-2299 integrations. */
4120
+ /** @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-1308 client plan · 1400-1408 organization plan · 1500-1512 messaging · 1600-1601 contacts · 1900-1906 payments · 2000-2099 products · 2100-2199 AI plans · 2200-2299 integrations. */
4004
4121
  code: number;
4005
4122
  /** @description Extra context attached to the error, when there is any. */
4006
4123
  data?: {
@@ -4274,6 +4391,8 @@ interface components {
4274
4391
  template_language?: string;
4275
4392
  /** @description Required for `template_message`. */
4276
4393
  template_name?: string;
4394
+ /** @description For a `template_message` whose body has variables: their values, in order. The first one fills `{{1}}`, the second `{{2}}`, and so on. Without them WhatsApp rejects a template that has variables, so a reminder with the customer's name and time needs this. Each value is a non-empty string with no line breaks, no tabs and no more than four consecutive spaces; anything else answers `1511` with `data.field` = `template_parameters` and `data.index` pointing at the bad value. Only positional body variables are supported: named variables (`{{name}}`) and variables in the header or in a button URL are not sent yet. */
4395
+ template_parameters?: string[];
4277
4396
  /** @description WhatsApp interactive list, for `interactive_message`. It needs at least one section. */
4278
4397
  whatsappInteractive?: {
4279
4398
  [key: string]: unknown;
@@ -4556,6 +4675,7 @@ interface components {
4556
4675
  };
4557
4676
  Publication: {
4558
4677
  _id: string;
4678
+ ai_generated?: components["schemas"]["PublicationAiGenerated"];
4559
4679
  /** Format: date-time */
4560
4680
  creation_date: string;
4561
4681
  /** @description Where inside the account this publication goes. Only present on the networks that answer `destinations: true` in `GET /social_capabilities`. */
@@ -4616,6 +4736,13 @@ interface components {
4616
4736
  publication_type: "profile" | "page" | "group" | "reels" | "stories" | "message";
4617
4737
  /** Format: date-time */
4618
4738
  publish_date?: string;
4739
+ /**
4740
+ * @description **Who can reply** to the publication, on the networks that answer `reply_control: true` in `GET /social_capabilities` (today `threads`). Absent means the network's default, which is anyone. It is set when the publication goes out and cannot be changed afterwards.
4741
+ *
4742
+ * **On every other network the field is deleted on save**, like `link`.
4743
+ * @enum {string}
4744
+ */
4745
+ reply_control?: "everyone" | "accounts_you_follow" | "mentioned_only" | "followers_only";
4619
4746
  /** @description Manual retries already spent on a failed publication, against the `max_retries` published by `GET /publication_limits`. Only `POST .../retry` increases it; updating the publication resets it to 0. */
4620
4747
  retries: number;
4621
4748
  /** @description Always the network of the account in `id_account`. */
@@ -4634,6 +4761,17 @@ interface components {
4634
4761
  /** @description Link to the publication on the network, when there is one. A **private** Telegram channel has no public URL, so it comes back empty even though the post went out. */
4635
4762
  url?: string;
4636
4763
  };
4764
+ /**
4765
+ * @description Which part of a publication was generated by AI. **Absent means nothing was.**
4766
+ *
4767
+ * Use it to show your own AI label: under article 50(4) of the EU AI Act, telling the audience is the job of whoever publishes.
4768
+ */
4769
+ PublicationAiGenerated: {
4770
+ /** @description At least one of the files carries `ai_generated`. Recomputed every time the publication is saved, so replacing an AI image with a photo of your own turns it off. */
4771
+ image: boolean;
4772
+ /** @description The text was written by the AI planner. Set when the draft is created and never changed afterwards, not even if the text is rewritten: it says where the text came from, not who reviewed it. */
4773
+ text: boolean;
4774
+ };
4637
4775
  /**
4638
4776
  * @description **Where inside the account** a publication goes, on the networks where choosing the account is not yet choosing the destination. Today that is `pinterest` alone, where it is the board the pin is saved to.
4639
4777
  *
@@ -4711,6 +4849,20 @@ interface components {
4711
4849
  * @description When the publication must go out. If omitted, it is published immediately. An invalid date returns error 938.
4712
4850
  */
4713
4851
  publish_date?: string;
4852
+ /**
4853
+ * @description **Who can reply** to the publication. Only on the networks that answer `reply_control: true` in `GET /social_capabilities` (today `threads`), and **deleted** on every other one.
4854
+ *
4855
+ * - `everyone`: anyone. It is the network's default, and what applies when the field is omitted.
4856
+ * - `followers_only`: only the account's followers.
4857
+ * - `accounts_you_follow`: only the profiles the account follows.
4858
+ * - `mentioned_only`: only the profiles mentioned in the text.
4859
+ *
4860
+ * **It is set when the publication goes out and cannot be changed afterwards**: Threads has no way to change it on a published post through its API. A value the network does not accept does not fail the request: the publication is still created, in state `withErrors` with `publication_errors[].code = 997`, whose `data` carries the `allowed` values. It is checked when the publication is **created**, so a scheduled post does not fail at 3 a.m. over a value that was already wrong.
4861
+ *
4862
+ * On an update: omit it to keep what was there, send `null` or `""` to go back to the network's default.
4863
+ * @enum {string}
4864
+ */
4865
+ reply_control?: "everyone" | "accounts_you_follow" | "mentioned_only" | "followers_only";
4714
4866
  /**
4715
4867
  * @description Network the publication targets. **Required when creating**: the request fails with error 702 if it is missing or not one of these values. It must match the network of the account in the path.
4716
4868
  *
@@ -4954,6 +5106,7 @@ interface components {
4954
5106
  */
4955
5107
  Upload: {
4956
5108
  _id: string;
5109
+ ai_generated?: components["schemas"]["AiImageOrigin"];
4957
5110
  /** @description Cover of a video, which is another upload of its own and comes back already resolved. It never appears on its own in the library listing. */
4958
5111
  cover_image?: components["schemas"]["Upload"];
4959
5112
  /** @description Point of the video, in milliseconds, used as the cover frame. */
@@ -7359,6 +7512,7 @@ interface operations {
7359
7512
  * | `519` | This endpoint does not accept app credentials |
7360
7513
  * | `543` | This temporal connect token has already connected an account. Issue a new one |
7361
7514
  * | `544` | This temporal connect token was issued for a different social network |
7515
+ * | `554` | The temporal token was issued with `account_selection=integrator`. In that mode the return goes through the connect session, which checks the `state` that ties it to whoever started |
7362
7516
  * | `700` | The connection cannot be completed through this endpoint. It is what `telegram` always answers here: that network's accounts are created from the bot being added to a channel, never from a call of yours |
7363
7517
  * | `1101` | Invalid organization, or a temporal token for a different one |
7364
7518
  */
@@ -8977,9 +9131,122 @@ interface operations {
8977
9131
  *
8978
9132
  * | Code | Meaning |
8979
9133
  * | --- | --- |
8980
- * | `1101` | Invalid organization |
8981
9134
  * | `523` | Invalid application |
8982
9135
  * | `532` | `redirect_uri` is not one of the fronts registered on the server |
9136
+ * | `551` | The temporal token is for `account_selection=integrator` and its connect session has expired or is no longer waiting for the person |
9137
+ * | `1101` | Invalid organization |
9138
+ */
9139
+ 400: {
9140
+ headers: {
9141
+ [name: string]: unknown;
9142
+ };
9143
+ content: {
9144
+ "application/json": components["schemas"]["Error"];
9145
+ };
9146
+ };
9147
+ /** @description Unhandled error by the server */
9148
+ 500: {
9149
+ headers: {
9150
+ [name: string]: unknown;
9151
+ };
9152
+ content?: never;
9153
+ };
9154
+ };
9155
+ };
9156
+ getConnectSession: {
9157
+ parameters: {
9158
+ query?: never;
9159
+ header?: never;
9160
+ path: {
9161
+ /** @description Organization identifier */
9162
+ id_organization: string;
9163
+ /** @description The `connect_session` that came back in your `redirect_uri` */
9164
+ id_session: string;
9165
+ };
9166
+ cookie?: never;
9167
+ };
9168
+ requestBody?: never;
9169
+ responses: {
9170
+ /** @description The session and its accounts. */
9171
+ 200: {
9172
+ headers: {
9173
+ [name: string]: unknown;
9174
+ };
9175
+ content: {
9176
+ "application/json": {
9177
+ connect_session: components["schemas"]["AccountsConnectSession"];
9178
+ };
9179
+ };
9180
+ };
9181
+ /**
9182
+ * @description The request failed. The body carries the PlanVortex error code in `code`:
9183
+ *
9184
+ * | Code | Meaning |
9185
+ * | --- | --- |
9186
+ * | `514` | This endpoint needs app credentials |
9187
+ * | `551` | Connect session not found, expired, or issued by another app |
9188
+ * | `1101` | Invalid organization |
9189
+ */
9190
+ 400: {
9191
+ headers: {
9192
+ [name: string]: unknown;
9193
+ };
9194
+ content: {
9195
+ "application/json": components["schemas"]["Error"];
9196
+ };
9197
+ };
9198
+ /** @description Unhandled error by the server */
9199
+ 500: {
9200
+ headers: {
9201
+ [name: string]: unknown;
9202
+ };
9203
+ content?: never;
9204
+ };
9205
+ };
9206
+ };
9207
+ confirmConnectSession: {
9208
+ parameters: {
9209
+ query?: never;
9210
+ header?: never;
9211
+ path: {
9212
+ /** @description Organization identifier */
9213
+ id_organization: string;
9214
+ /** @description The `connect_session` that came back in your `redirect_uri` */
9215
+ id_session: string;
9216
+ };
9217
+ cookie?: never;
9218
+ };
9219
+ requestBody: {
9220
+ content: {
9221
+ "application/json": {
9222
+ /** @description Ids of the session's accounts to enable. */
9223
+ accounts: string[];
9224
+ };
9225
+ };
9226
+ };
9227
+ responses: {
9228
+ /** @description The accounts that were enabled. */
9229
+ 200: {
9230
+ headers: {
9231
+ [name: string]: unknown;
9232
+ };
9233
+ content: {
9234
+ "application/json": {
9235
+ accounts: components["schemas"]["Account"][];
9236
+ };
9237
+ };
9238
+ };
9239
+ /**
9240
+ * @description The request failed. The body carries the PlanVortex error code in `code`:
9241
+ *
9242
+ * | Code | Meaning |
9243
+ * | --- | --- |
9244
+ * | `514` | This endpoint needs app credentials |
9245
+ * | `551` | Connect session not found, expired, or issued by another app |
9246
+ * | `552` | The session is not waiting for a confirmation: the person has not come back yet, or it was already confirmed. `data.status` says which |
9247
+ * | `553` | Some account is not part of this session. `data.accounts` lists them |
9248
+ * | `706` | The new accounts do not fit in the plan. `data` carries `limit`, `used` and `requested`, and none was enabled |
9249
+ * | `1101` | Invalid organization |
8983
9250
  */
8984
9251
  400: {
8985
9252
  headers: {
@@ -11060,6 +11327,8 @@ interface operations {
11060
11327
  createTemporalConnectToken: {
11061
11328
  parameters: {
11062
11329
  query?: {
11330
+ /** @description Who shows the screen where the person picks which accounts to enable. `planvortex` (the default) is the PlanVortex screen. `integrator` sends the person back to your `redirect_uri` with a connect session, and the picking is yours: see above. Requires `redirect_uri` and `social_network` (error 549). */
11331
+ account_selection?: "planvortex" | "integrator";
11063
11332
  /** @description Where the user comes back after connecting. Has to be one of the app's `redirect_urls` (error 532). */
11064
11333
  redirect_uri?: string;
11065
11334
  /** @description Network the user is going to connect. It travels inside the returned URL **and inside the token itself**, so the token will only connect that network (error 544 otherwise). A network outside the allowed list is rejected here with error 702. */
@@ -11081,6 +11350,8 @@ interface operations {
11081
11350
  };
11082
11351
  content: {
11083
11352
  "application/json": {
11353
+ /** @description Only with `account_selection=integrator`: the id of the connect session. It comes back in your `redirect_uri` as `connect_session`; compare the two, so a session somebody else started cannot land in your user's browser. */
11354
+ connect_session?: string;
11084
11355
  /**
11085
11356
  * Format: date-time
11086
11357
  * @description When the token stops working. Fifteen minutes after it was issued.
@@ -11088,7 +11359,7 @@ interface operations {
11088
11359
  expires_at: string;
11089
11360
  /** @description The same token, on its own. This is what you pass to a client that authenticates with a temporal token; do not parse it out of `url`. */
11090
11361
  token: string;
11091
- /** @description Ready to redirect to. Carries the token in its `token` query parameter, and the network in `social_network` when one was asked for. */
11362
+ /** @description Ready to redirect to. Carries the token in its `token` query parameter, and the network in `social_network` when one was asked for. With `account_selection=integrator` it is the network's authorization page instead (on `whatsapp`, the PlanVortex page that opens Meta's popup). */
11092
11363
  url: string;
11093
11364
  };
11094
11365
  };
@@ -11100,6 +11371,8 @@ interface operations {
11100
11371
  * | --- | --- |
11101
11372
  * | `514` | This endpoint needs app credentials: neither a user token nor a temporal connect token can issue one |
11102
11373
  * | `532` | `redirect_uri` is not one of the app's registered `redirect_urls` |
11374
+ * | `549` | `account_selection` is not `planvortex` or `integrator`, or it is `integrator` without `redirect_uri` or `social_network`. `data` says which |
11375
+ * | `550` | `account_selection=integrator` on a network with no return to the browser (`telegram`) |
11103
11376
  * | `702` | `social_network` is not one of the networks PlanVortex supports |
11104
11377
  * | `1101` | Invalid organization |
11105
11378
  */
@@ -11678,7 +11951,8 @@ interface operations {
11678
11951
  * "persistent_menu": false,
11679
11952
  * "comments": true,
11680
11953
  * "destinations": false,
11681
- * "link": false
11954
+ * "link": false,
11955
+ * "reply_control": false
11682
11956
  * },
11683
11957
  * "google_business": {
11684
11958
  * "publications": false,
@@ -11688,7 +11962,8 @@ interface operations {
11688
11962
  * "persistent_menu": false,
11689
11963
  * "comments": true,
11690
11964
  * "destinations": false,
11691
- * "link": false
11965
+ * "link": false,
11966
+ * "reply_control": false
11692
11967
  * },
11693
11968
  * "pinterest": {
11694
11969
  * "publications": true,
@@ -11698,7 +11973,19 @@ interface operations {
11698
11973
  * "persistent_menu": false,
11699
11974
  * "comments": false,
11700
11975
  * "destinations": true,
11701
- * "link": true
11976
+ * "link": true,
11977
+ * "reply_control": false
11978
+ * },
11979
+ * "threads": {
11980
+ * "publications": true,
11981
+ * "messages": false,
11982
+ * "products": false,
11983
+ * "webhooks": true,
11984
+ * "persistent_menu": false,
11985
+ * "comments": true,
11986
+ * "destinations": false,
11987
+ * "link": false,
11988
+ * "reply_control": true
11702
11989
  * }
11703
11990
  * }
11704
11991
  */
@@ -12247,6 +12534,30 @@ interface EnableResult {
12247
12534
  /** A donde mandar al usuario despues, si el token temporal llevaba `redirect_uri`. */
12248
12535
  redirect_uri?: string;
12249
12536
  }
12537
+ /**
12538
+ * Quien ensena la pantalla de elegir cuentas al volver de la red. `planvortex` (lo de siempre) o
12539
+ * `integrator`: el usuario vuelve a tu `redirect_uri` con una sesion de conexion y el selector lo
12540
+ * pones tu. Ver {@link ConnectSession}.
12541
+ */
12542
+ type AccountSelection = "planvortex" | "integrator";
12543
+ /**
12544
+ * Una conexion en el modo `account_selection: "integrator"`: lo que autorizo tu usuario, para que
12545
+ * tu app ensene su propio selector y confirme las elegidas con
12546
+ * `accounts.confirmConnectSession()`.
12547
+ *
12548
+ * Solo la puede leer la app que emitio el token. `accounts` son las de ESTA autorizacion, nunca
12549
+ * otras pendientes de la organizacion; `already_enabled` marca una reconexion, que no gasta plaza;
12550
+ * y `accounts_used`/`accounts_limit` son el contador del plan. Una sesion `returned` vive media
12551
+ * hora.
12552
+ */
12553
+ type ConnectSession = Override<Schemas["AccountsConnectSession"], {
12554
+ social_network: SocialNetwork;
12555
+ accounts: ConnectSessionAccount[];
12556
+ }>;
12557
+ /** Una cuenta de una {@link ConnectSession}: una {@link Account} mas `already_enabled`. */
12558
+ type ConnectSessionAccount = Account & {
12559
+ already_enabled: boolean;
12560
+ };
12250
12561
  /**
12251
12562
  * Un fichero de la biblioteca de la organizacion.
12252
12563
  *
@@ -12261,6 +12572,25 @@ type Upload = Override<Schemas["Upload"], {
12261
12572
  }>;
12262
12573
  /** Ancho, alto, duracion y tamano de un fichero, mas en que redes cabe **por su recorte**. */
12263
12574
  type FileProperties = Schemas["FileProperties"];
12575
+ /**
12576
+ * De que modelo salio una imagen: el `ai_generated` de un {@link Upload}. **Solo lo llevan las
12577
+ * imagenes que genero la IA** —nunca una foto subida, ni la de un producto de una tienda— y no se
12578
+ * puede editar.
12579
+ *
12580
+ * Es lo que necesitas para cumplir TU parte del AI Act: el articulo 50.4 obliga a quien publica a
12581
+ * avisar a su audiencia cuando una imagen generada puede pasar por real, y con este campo pintas la
12582
+ * etiqueta en tu producto. La marca en el propio fichero (C2PA, IPTC y SynthID con el modelo por
12583
+ * defecto) la pone PlanVortex; el C2PA no sobrevive a un recorte, el IPTC si.
12584
+ */
12585
+ type AiImageOrigin = Schemas["AiImageOrigin"];
12586
+ /**
12587
+ * Que parte de una {@link Publication} genero la IA. **Ausente = nada.**
12588
+ *
12589
+ * `text` lo sella el planificador al crear el borrador y no cambia aunque el texto se reescriba:
12590
+ * dice de donde salio, no quien lo reviso. `image` se recalcula con los ficheros cada vez que se
12591
+ * guarda: cambiar la imagen generada por una foto propia lo apaga.
12592
+ */
12593
+ type PublicationAiGenerated = Schemas["PublicationAiGenerated"];
12264
12594
  /**
12265
12595
  * Una publicacion: programada, enviada o fallida.
12266
12596
  *
@@ -12951,7 +13281,7 @@ declare class PlanVortexError extends Error {
12951
13281
  readonly retryAfter: number | undefined;
12952
13282
  constructor(code: number, message: string, options?: PlanVortexErrorOptions);
12953
13283
  }
12954
- /** 500-548 — tokens, apps de cliente, permisos. Incluye el 501 y el 522, los de token caducado. */
13284
+ /** 500-554 — tokens, apps de cliente, permisos, sesiones de conexion. Incluye el 501 y el 522, los de token caducado. */
12955
13285
  declare class AuthError extends PlanVortexError {
12956
13286
  }
12957
13287
  /** 601-612 — el usuario final. */
@@ -13298,4 +13628,4 @@ interface PlanVortexWebhooksOptions {
13298
13628
  */
13299
13629
  declare function planvortexWebhooks(options: PlanVortexWebhooksOptions): (request: WebhookRequestLike, response: WebhookResponseLike, next: (error?: unknown) => void) => void;
13300
13630
 
13301
- export { type AiSettings as $, type Account as A, type CommentReplyResult as B, type ConnectLink as C, type Destination as D, type EnableResult as E, type ContactExtraData as F, type Contact as G, type ContactCreate as H, type ContactUpdate as I, type IntegrationProviderName as J, type IntegrationProvider as K, type Integration as L, type MetricName as M, type IntegrationConnectRequest as N, type IntegrationUpdate as O, type Paginated as P, type IntegrationPickerConfig as Q, type IntegrationCatalogPage as R, type SocialNetwork as S, type TopPublicationsResult as T, type MessageTemplate as U, type Conversation as V, type ConversationTotals as W, type Message as X, type MessageInput as Y, type Client as Z, type Organization as _, type ConnectResult as a, type paths as a$, type ClientWithOrganizations as a0, type PlanData as a1, type PlanUseData as a2, type ConnectToken as a3, type AiContext as a4, type SocialCredentialsInput as a5, type Product as a6, type ProductInput as a7, type ProductCatalog as a8, type ProductCatalogInput as a9, AuthError as aA, type ClientPlan as aB, type CommentAuthor as aC, type CommentChange as aD, type ContactChannel as aE, ContactError as aF, type DashboardAiPlanRef as aG, type DashboardPublicationRef as aH, type DashboardRange as aI, type EngagementBase as aJ, FileError as aK, type FileFormat as aL, type FileProperties as aM, type FileType as aN, type IntegrationCatalogProduct as aO, type IntegrationConfig as aP, IntegrationError as aQ, type IntegrationErrorChange as aR, type IntegrationFormField as aS, type MessageChange as aT, type MessageOptions as aU, type MessageType as aV, MessagingError as aW, type MetricRow as aX, NO_ERROR_CODE as aY, type components as aZ, type operations as a_, type PublicationInput as aa, type PublicationState as ab, type PublicationStats as ac, type PublicationStatsHistory as ad, type Upload as ae, AccountError as af, type AccountMetricRow as ag, type AccountStateChange as ah, type AccountWebhookChangeBase as ai, type AccountWithError as aj, type AiPlanCostEstimate as ak, type AiPlanDestination as al, AiPlanError as am, type AiPlanNotice as an, type AiPlanOptions as ao, type AiPlanOptionsInput as ap, type AiPlanResult as aq, type AiPlanResultsGroup as ar, type AiPlanResultsTemplateGroup as as, type AiPlanSource as at, type AiPlanSourceImageInput as au, type AiPlanSourceInput as av, type AiPlanSourceProduct as aw, type AiPlanState as ax, type ApiErrorBody as ay, type AspectRatios as az, type AccountMetrics as b, isIntegrationErrorChange as b$, type webhooks as b0, type OpenEnum as b1, OrganizationError as b2, PLANVORTEX_ERROR_RANGES as b3, PlanLimitError as b4, PlanVortexAuthenticationError as b5, PlanVortexConfigError as b6, PlanVortexConnectionError as b7, PlanVortexError as b8, type PlanVortexErrorOptions as b9, type WooCommerceConnectRequest as bA, account as bB, accountId as bC, errorFamilyForCode as bD, isPlanVortexError as bE, isTokenError as bF, messageContact as bG, messageContactId as bH, messageDirection as bI, messageFileIds as bJ, messageFiles as bK, publication as bL, publicationId as bM, type HandleWebhookRequestOptions as bN, type PlanVortexWebhooksOptions as bO, type RawWebhookBody as bP, type VerifyWebhookSignatureOptions as bQ, WEBHOOK_EVENTS as bR, WEBHOOK_SIGNATURE_HEADERS as bS, WebhookBodyError as bT, type WebhookHeaders as bU, type WebhookRequestLike as bV, type WebhookResponseLike as bW, WebhookSignatureError as bX, handleWebhookRequest as bY, isAccountStateChange as bZ, isCommentChange as b_, type PlanVortexErrorRange as ba, type PlannerTemplateField as bb, type PlannerTemplateFieldType as bc, ProductError as bd, type PublicationDestination as be, PublicationError as bf, type PublicationErrorDetail as bg, type PublicationMetrics as bh, type PublicationStatsPoint as bi, type PublicationType as bj, type PublicationsSummary as bk, type RssConfig as bl, type SocialAuthorizationMethod as bm, type SocialCredentials as bn, type SocialIdentifier as bo, type SocialIdentifierInput as bp, type SocialLimitsMap as bq, TOKEN_ERROR_CODES as br, type TopPublication as bs, type UnknownWebhookChange as bt, UserError as bu, type WebhookAlgorithm as bv, type WebhookChange as bw, type WebhookEvent as bx, type WithAccount as by, type WithPublication as bz, type PersistentMenu as c, isMessageChange as c0, parseWebhookPayload as c1, planvortexWebhooks as c2, verifyWebhookSignature as c3, type Dashboard as d, type DashboardMetricsResult as e, type PublicationsSummaryResult as f, type PublicationsStatsResult as g, type PlanUse as h, type Publication as i, type AiPlanResultsSort as j, type PlannerTemplateName as k, type AiPlanCreateRequest as l, type AiPlanCreateResult as m, type AiPlan as n, type AiPlanResults as o, type ClientApp as p, type ClientAppInput as q, type SocialCapabilities as r, type CommentActions as s, type SocialLimits as t, type PublicationLimits as u, type AspectRatiosByNetwork as v, type PlannerTemplate as w, type CommentNetwork as x, type Comment as y, type CommentThread as z };
13631
+ export { type Organization as $, type Account as A, type CommentThread as B, type ConnectLink as C, type Destination as D, type EnableResult as E, type CommentReplyResult as F, type ContactExtraData as G, type Contact as H, type ContactCreate as I, type ContactUpdate as J, type IntegrationProviderName as K, type IntegrationProvider as L, type MetricName as M, type Integration as N, type IntegrationConnectRequest as O, type Paginated as P, type IntegrationUpdate as Q, type IntegrationPickerConfig as R, type SocialNetwork as S, type TopPublicationsResult as T, type IntegrationCatalogPage as U, type MessageTemplate as V, type Conversation as W, type ConversationTotals as X, type Message as Y, type MessageInput as Z, type Client as _, type ConnectResult as a, type MetricRow as a$, type AiSettings as a0, type ClientWithOrganizations as a1, type AccountSelection as a2, type PlanData as a3, type PlanUseData as a4, type ConnectToken as a5, type AiContext as a6, type SocialCredentialsInput as a7, type Product as a8, type ProductInput as a9, type AiPlanState as aA, type ApiErrorBody as aB, type AspectRatios as aC, AuthError as aD, type ClientPlan as aE, type CommentAuthor as aF, type CommentChange as aG, type ConnectSessionAccount as aH, type ContactChannel as aI, ContactError as aJ, type DashboardAiPlanRef as aK, type DashboardPublicationRef as aL, type DashboardRange as aM, type EngagementBase as aN, FileError as aO, type FileFormat as aP, type FileProperties as aQ, type FileType as aR, type IntegrationCatalogProduct as aS, type IntegrationConfig as aT, IntegrationError as aU, type IntegrationErrorChange as aV, type IntegrationFormField as aW, type MessageChange as aX, type MessageOptions as aY, type MessageType as aZ, MessagingError as a_, type ProductCatalog as aa, type ProductCatalogInput as ab, type PublicationInput as ac, type PublicationState as ad, type PublicationStats as ae, type PublicationStatsHistory as af, type Upload as ag, AccountError as ah, type AccountMetricRow as ai, type AccountStateChange as aj, type AccountWebhookChangeBase as ak, type AccountWithError as al, type AiImageOrigin as am, type AiPlanCostEstimate as an, type AiPlanDestination as ao, AiPlanError as ap, type AiPlanNotice as aq, type AiPlanOptions as ar, type AiPlanOptionsInput as as, type AiPlanResult as at, type AiPlanResultsGroup as au, type AiPlanResultsTemplateGroup as av, type AiPlanSource as aw, type AiPlanSourceImageInput as ax, type AiPlanSourceInput as ay, type AiPlanSourceProduct as az, type ConnectSession as b, type WebhookResponseLike as b$, NO_ERROR_CODE as b0, type components as b1, type operations as b2, type paths as b3, type webhooks as b4, type OpenEnum as b5, OrganizationError as b6, PLANVORTEX_ERROR_RANGES as b7, PlanLimitError as b8, PlanVortexAuthenticationError as b9, type WebhookAlgorithm as bA, type WebhookChange as bB, type WebhookEvent as bC, type WithAccount as bD, type WithPublication as bE, type WooCommerceConnectRequest as bF, account as bG, accountId as bH, errorFamilyForCode as bI, isPlanVortexError as bJ, isTokenError as bK, messageContact as bL, messageContactId as bM, messageDirection as bN, messageFileIds as bO, messageFiles as bP, publication as bQ, publicationId as bR, type HandleWebhookRequestOptions as bS, type PlanVortexWebhooksOptions as bT, type RawWebhookBody as bU, type VerifyWebhookSignatureOptions as bV, WEBHOOK_EVENTS as bW, WEBHOOK_SIGNATURE_HEADERS as bX, WebhookBodyError as bY, type WebhookHeaders as bZ, type WebhookRequestLike as b_, PlanVortexConfigError as ba, PlanVortexConnectionError as bb, PlanVortexError as bc, type PlanVortexErrorOptions as bd, type PlanVortexErrorRange as be, type PlannerTemplateField as bf, type PlannerTemplateFieldType as bg, ProductError as bh, type PublicationAiGenerated as bi, type PublicationDestination as bj, PublicationError as bk, type PublicationErrorDetail as bl, type PublicationMetrics as bm, type PublicationStatsPoint as bn, type PublicationType as bo, type PublicationsSummary as bp, type RssConfig as bq, type SocialAuthorizationMethod as br, type SocialCredentials as bs, type SocialIdentifier as bt, type SocialIdentifierInput as bu, type SocialLimitsMap as bv, TOKEN_ERROR_CODES as bw, type TopPublication as bx, type UnknownWebhookChange as by, UserError as bz, type AccountMetrics as c, WebhookSignatureError as c0, handleWebhookRequest as c1, isAccountStateChange as c2, isCommentChange as c3, isIntegrationErrorChange as c4, isMessageChange as c5, parseWebhookPayload as c6, planvortexWebhooks as c7, verifyWebhookSignature as c8, type PersistentMenu as d, type Dashboard as e, type DashboardMetricsResult as f, type PublicationsSummaryResult as g, type PublicationsStatsResult as h, type PlanUse as i, type Publication as j, type AiPlanResultsSort as k, type PlannerTemplateName as l, type AiPlanCreateRequest as m, type AiPlanCreateResult as n, type AiPlan as o, type AiPlanResults as p, type ClientApp as q, type ClientAppInput as r, type SocialCapabilities as s, type CommentActions as t, type SocialLimits as u, type PublicationLimits as v, type AspectRatiosByNetwork as w, type PlannerTemplate as x, type CommentNetwork as y, type Comment as z };