planvortex 0.10.0 → 0.12.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.
@@ -205,6 +205,8 @@ interface paths {
205
205
  *
206
206
  * **The user's email must be verified** (`ERROR_CODE_546`). This is the only route in `/apps` that asks for it: an app is a key to the whole public API, and this is what stops a throwaway address from minting them in bulk. Reading, updating and deleting an app you already own do not check it.
207
207
  *
208
+ * **The identifier has a format** (error 533): lowercase letters, numbers, `.`, `-` and `_`, starting with a letter or a number, 3 to 64 characters. Pick it carefully — it cannot be changed later (error 547).
209
+ *
208
210
  * Every URL is validated: a bad entry in `allowed_domains` answers 531, in `redirect_urls` 532, and a bad `webhook_url` answers 535.
209
211
  *
210
212
  * **The secret is not in the response.** Read it with `GET /clients/{id_client}/apps/{id_app}/secret`.
@@ -240,6 +242,8 @@ interface paths {
240
242
  *
241
243
  * **It replaces every field with what the body carries.** `name`, `keycloak_client_idenfifier`, `allowed_domains`, `redirect_urls` and `webhook_url` are all written as sent, so omitting one erases it — sending an update without `webhook_url` turns the webhook off. Read the app first and send it back whole.
242
244
  *
245
+ * **`keycloak_client_idenfifier` is the one field that is NOT overwritten.** Sending a different one answers `ERROR_CODE_547` and nothing is written: it is the `client_id` your integration authenticates with, and renaming it would lock out everything already asking for tokens with the old one. Send it unchanged, or leave it out. If you need a different identifier, create another app.
246
+ *
243
247
  * **An app token works here.** This is the one part of `/apps` that does: an app can read and update its own record, but it cannot list, create, delete, or read the secret. **No plan is required**: apps are on all four plans, the free one included.
244
248
  */
245
249
  put: operations["updateClientApp"];
@@ -275,7 +279,19 @@ interface paths {
275
279
  */
276
280
  get: operations["getClientAppSecret"];
277
281
  put?: never;
278
- post?: never;
282
+ /**
283
+ * Regenerate the app's secret
284
+ * @description Rotates the `client_secret` and returns the new one.
285
+ *
286
+ * **The previous secret stops working the moment this answers** — there is no grace period and no overlap. Anything still holding it gets `invalid_client` from `POST /oauth/token` on its very next call, so roll it out before you rotate, not after.
287
+ *
288
+ * **It also changes how your webhooks are signed.** `x-hub-signature` and `x-hub-signature-256` are HMACs of the body computed with this same secret, so a receiver that verifies the signature will start rejecting legitimate deliveries until it is updated too.
289
+ *
290
+ * The new value comes back only here. If you lose it, read it again with `GET /clients/{id_client}/apps/{id_app}/secret` — it is not stored anywhere on our side except Keycloak.
291
+ *
292
+ * **Needs a USER token, not an app token** (`ERROR_CODE_512`), and the `client_app:update` permission — reading the secret changes nothing, this invalidates what was there.
293
+ */
294
+ post: operations["regenerateClientAppSecret"];
279
295
  delete?: never;
280
296
  options?: never;
281
297
  head?: never;
@@ -351,7 +367,7 @@ interface paths {
351
367
  put?: never;
352
368
  /**
353
369
  * Create an AI publication plan
354
- * @description Create a weekly AI publication plan. The plan is queued in state 'pending' and generated asynchronously by the generate-ai-plans job; poll GET by id while state is pending or generating. Validations at creation: the client plan allows AI (it contracts AI credits; Free does not), the accounts belong to the organization, there are enough AI credits for the deterministic base cost (orchestration + target texts), and there is room in the organization's monthly publication limit. Returns the created plan together with the deterministic cost estimate. Requires the ai_plans:create permission. Since the plan can be generated from a SOURCE (`template` + `source`), part of that validation is the source itself: the article is downloaded, the catalogue is read live and the product pictures are copied — all of it inside this request, so what does not work fails with the user in front of it. A plan whose source did not fit in the week is still created, and says so in ai_plan.warnings (2117).
370
+ * @description Create a weekly AI publication plan. The plan is queued in state 'pending' and generated asynchronously by the generate-ai-plans job; poll GET by id while state is pending or generating. Validations at creation: the client plan allows AI (it contracts AI credits; Free does not), the accounts belong to the organization, there are enough AI credits for the deterministic base cost (orchestration + target texts), and there is room in the organization's monthly publication limit. Returns the created plan together with the deterministic cost estimate. Requires the ai_plans:create permission. Since the plan can be generated from a SOURCE (`template` + `source`), part of that validation is the source itself: the article is downloaded, the catalogue is read live and the product pictures are copied — all of it inside this request, so what does not work fails with the user in front of it. A plan whose source did not fit in the week is still created, and says so in ai_plan.warnings (2117). With a Pinterest account in the plan, two more checks run at creation: every Pinterest account needs its board in `destinations` (2118), and a configuration that would leave pins without an image is refused (2119).
355
371
  */
356
372
  post: operations["addAiPlan"];
357
373
  delete?: never;
@@ -496,6 +512,34 @@ interface paths {
496
512
  patch?: never;
497
513
  trace?: never;
498
514
  };
515
+ "/clients/{id_client}/organizations/{id_organization}/ai_plans/results": {
516
+ parameters: {
517
+ query?: never;
518
+ header?: never;
519
+ path?: never;
520
+ cookie?: never;
521
+ };
522
+ /**
523
+ * Compare the results of AI plans
524
+ * @description What each AI plan achieved with what it published, the aggregate per template and the total — the data behind «which plan worked best?». Requires **both** `ai_plans:read` and `publication_stats:read`: it shows plans and it shows publication metrics.
525
+ *
526
+ * **The range filters on the plan's week** (`week_start`), not on when it was created: a plan created today for next week has published nothing and has no results yet.
527
+ *
528
+ * **Only plans that published something are listed** — with `social_network`, something on those networks. A plan whose posts are all still scheduled would be a row of blanks. Archived plans are included; cancelled ones are not.
529
+ *
530
+ * **The default order is interactions per measured publication**, and only plans with at least 3 measured publications (or all of them, if they published fewer) compete in it; the rest come after. See `AiPlanResult` for why it is that number and not the total or the engagement rate.
531
+ *
532
+ * Covers **this organization only**, not its children — it is the sibling of `GET .../ai_plans` and talks about the same plans. The dashboard's `ai_plan_results` block does include children.
533
+ */
534
+ get: operations["getAiPlanResultsService"];
535
+ put?: never;
536
+ post?: never;
537
+ delete?: never;
538
+ options?: never;
539
+ head?: never;
540
+ patch?: never;
541
+ trace?: never;
542
+ };
499
543
  "/clients/{id_client}/roles": {
500
544
  parameters: {
501
545
  query?: never;
@@ -753,7 +797,7 @@ interface paths {
753
797
  *
754
798
  * **Telegram does not come through here, and cannot be made to.** That network has no callback: the account is created by PlanVortex when the bot is added to a channel, and what authorizes it is a single-use voucher minted at that moment and spent in the same breath — it never leaves the server, so calling this endpoint for `telegram` answers error 700. It is deliberate: the bot is shared, so without it anyone could hang any channel where that bot is an admin off their own organization by passing a chat id by hand. What an integration listens for instead is the `new_account` webhook notification.
755
799
  *
756
- * **And a Telegram account arrives already active.** In the other twelve networks this endpoint hands you accounts that are still off, and you pick which ones spend a plan slot with `POST .../accounts/{id_account}/enable`. Here there is nothing to call: one channel arrives — the one the person picked in Telegram — and PlanVortex takes the slot for it right then. If the plan has no free slot the account is still created, off, and the person is told so in the bot chat; `GET /organizations/{id_organization}/accounts` will not list it, because that listing only returns active accounts, but naming it in the `accounts` filter does return it.
800
+ * **And a Telegram account arrives already active.** In every other network this endpoint hands you accounts that are still off, and you pick which ones spend a plan slot with `POST .../accounts/{id_account}/enable`. Here there is nothing to call: one channel arrives — the one the person picked in Telegram — and PlanVortex takes the slot for it right then. If the plan has no free slot the account is still created, off, and the person is told so in the bot chat; `GET /organizations/{id_organization}/accounts` will not list it, because that listing only returns active accounts, but naming it in the `accounts` filter does return it.
757
801
  */
758
802
  get: operations["connectAccount"];
759
803
  put?: never;
@@ -884,6 +928,56 @@ interface paths {
884
928
  patch?: never;
885
929
  trace?: never;
886
930
  };
931
+ "/organizations/{id_organization}/accounts/{id_account}/destinations": {
932
+ parameters: {
933
+ query?: never;
934
+ header?: never;
935
+ path?: never;
936
+ cookie?: never;
937
+ };
938
+ /**
939
+ * List where this account can publish
940
+ * @description The places inside the account a publication can go to: on Pinterest, the boards.
941
+ *
942
+ * **Most networks have none, and that is not a failure of yours.** Connecting the account already says where a publication comes out — the wall, the channel, the profile — so only the networks that answer `destinations: true` in `GET /social_capabilities` have anything to list. Anywhere else this answers error 992.
943
+ *
944
+ * **Where they exist, the destination is required.** What comes back here is what you send in `destination.id` when creating the publication, and one created without it is created in state `withErrors` with `publication_errors[].code = 987`, which the background job will not attempt.
945
+ *
946
+ * The **sections** of a board are not in this listing: ask for one destination to get them.
947
+ */
948
+ get: operations["getAccountDestinations"];
949
+ put?: never;
950
+ post?: never;
951
+ delete?: never;
952
+ options?: never;
953
+ head?: never;
954
+ patch?: never;
955
+ trace?: never;
956
+ };
957
+ "/organizations/{id_organization}/accounts/{id_account}/destinations/{id_destination}": {
958
+ parameters: {
959
+ query?: never;
960
+ header?: never;
961
+ path?: never;
962
+ cookie?: never;
963
+ };
964
+ /**
965
+ * Read one destination and its sections
966
+ * @description One destination with its detail: on Pinterest, the sections of the board, which is what goes in `destination.section_id`.
967
+ *
968
+ * They are deliberately not in the listing — reading the sections of every board would cost one call to the network per board.
969
+ *
970
+ * **It is checked against this account's own destinations, not asked of the network blind.** A destination that is not in this account answers error 993, whether it never existed, was just deleted, or belongs to somebody else; without that check the endpoint would read any public board's sections with your token.
971
+ */
972
+ get: operations["getAccountDestination"];
973
+ put?: never;
974
+ post?: never;
975
+ delete?: never;
976
+ options?: never;
977
+ head?: never;
978
+ patch?: never;
979
+ trace?: never;
980
+ };
887
981
  "/organizations/{id_organization}/accounts/{id_account}/enable": {
888
982
  parameters: {
889
983
  query?: never;
@@ -1364,7 +1458,7 @@ interface paths {
1364
1458
  *
1365
1459
  * **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.
1366
1460
  *
1367
- * **Read `authorization`, not `link`.** Eleven of the thirteen networks are `redirect` and you send the person to `link`. Two are not, and neither of them fails visibly if you treat it as one:
1461
+ * **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:
1368
1462
  *
1369
1463
  * • **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.
1370
1464
  * • **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.
@@ -1467,7 +1561,7 @@ interface paths {
1467
1561
  };
1468
1562
  /**
1469
1563
  * The whole home screen in one call
1470
- * @description Composes every block of the home screen in a single round trip: operational health, publications, publication metrics, account metrics, plan use, AI plans and unread messages.
1564
+ * @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.
1471
1565
  *
1472
1566
  * **A block the caller cannot read is omitted, not refused.** The endpoint only demands the minimum permission — reading the organization — and then checks each block on its own: somebody who can only see publications still gets their home instead of a 403. `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.
1473
1567
  *
@@ -2354,7 +2448,9 @@ interface paths {
2354
2448
  *
2355
2449
  * `comments` is the coarse gate — whether the network has comments at all. Which *actions* it allows on one is a finer question and lives in `GET /social_comment_actions`, because the shape here is `{[capability]: boolean}` and nesting an object inside would break it.
2356
2450
  *
2357
- * Today ten networks answer `comments: true`: Facebook, Instagram, Threads, LinkedIn, X, YouTube, Google Business, Bluesky, Discord and Telegram. TikTok and WhatsApp answer `false`, for reasons of theirs and not ours.
2451
+ * 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.
2452
+ *
2453
+ * **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.
2358
2454
  *
2359
2455
  * 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.
2360
2456
  *
@@ -2587,7 +2683,7 @@ interface components {
2587
2683
  /**
2588
2684
  * @description **How** an account of this network is authorized, which is not always "send the user to this URL".
2589
2685
  *
2590
- * Eleven of the thirteen networks are `redirect`: open `link` and the network sends the person back to PlanVortex with a code. Two are not:
2686
+ * Almost every network is `redirect`: open `link` and the network sends the person back to PlanVortex with a code. Two are not:
2591
2687
  *
2592
2688
  * • **WhatsApp.** Its sign-up is Meta's *Embedded Signup*: a popup raised by the Facebook JavaScript SDK from your own page, which returns — over `postMessage` — session data (`waba_id`, `phone_number_id`) that no query string carries. Its `link` is therefore an empty string.
2593
2689
  * • **Telegram.** There is no OAuth here: no consent screen, no `code`, no account token. `link` opens a private chat with the PlanVortex bot, the person then adds that bot to their channel, and **the account is created from that event**, not from any request of yours. Which means the connection cannot be finished by calling `GET /organizations/{id_organization}/account-connect/telegram` — see that endpoint.
@@ -2654,6 +2750,101 @@ interface components {
2654
2750
  value_proposition?: string;
2655
2751
  website?: string;
2656
2752
  };
2753
+ /**
2754
+ * @description What ONE AI plan achieved with what it published.
2755
+ *
2756
+ * **Where the numbers come from.** A plan keeps its publications, and each publication keeps the last known value of its metrics (the same ones `GET /organizations/{id}/publications/stats` returns). This adds those up — nothing here is measured twice or asked to the network again.
2757
+ *
2758
+ * **Only the publications that went out and were measured count** (`publications.measured`). A post scheduled for tomorrow, one that failed or one published an hour ago that nobody has measured yet does not lower the average: it is simply not in it.
2759
+ *
2760
+ * **A missing metric is not a zero**, as everywhere else: if no publication of the plan reports `reach`, the plan has no `reach` key.
2761
+ */
2762
+ AiPlanResult: {
2763
+ /** @description Accounts the plan was generated for. */
2764
+ accounts: number;
2765
+ /**
2766
+ * Format: date-time
2767
+ * @description Archived plans are included: archiving is visibility only, and what they published is still published.
2768
+ */
2769
+ archived_date?: string;
2770
+ /** Format: date-time */
2771
+ creation_date: string;
2772
+ /** @description AI credits per interaction: what each interaction cost. Lower is better. Absent with no interactions, with no credits spent (your own AI key) and **whenever `social_network` is filtered** — the cost belongs to the whole plan, and dividing it by one network's interactions would overprice every one of them. */
2773
+ credits_per_engagement?: number;
2774
+ /** @description AI credits the plan cost, for the whole plan. */
2775
+ credits_spent: number;
2776
+ /** @description Interactions per measured publication — **the number plans are ranked by**. The total rewards size (seven accounts for seven days beat one account even if each post does half as well), and the engagement rate divides by reach on some networks and by followers on others, which makes two plans on different networks incomparable. Absent when nothing is measured yet. */
2777
+ engagement_per_publication?: number;
2778
+ /** @description `engagement_per_publication` divided by `expected_engagement_per_publication`: **1 means like your average, 2 twice as much, 0.5 half**. This is the number that says whether a plan is *good*, not just first — the ranking still orders by `engagement_per_publication`, so the first plan can be below 1. Absent with nothing measured or no average to compare with. */
2779
+ engagement_vs_average?: number;
2780
+ /**
2781
+ * @description What **your usual posts** would get with the same mix of networks: the organization's average interactions per measured post on each network, weighted by how many measured posts the plan has there. Two measured posts on Instagram (average 5) and two on LinkedIn (average 1) expect (2·5 + 2·1) / 4 = 3.
2782
+ *
2783
+ * The average covers **every** measured post of the organization in the range, AI ones included, on the same networks. Weighting by network is what keeps a LinkedIn-only plan from always reading as below average just because LinkedIn moves less than Instagram.
2784
+ */
2785
+ expected_engagement_per_publication?: number;
2786
+ id_ai_plan: string;
2787
+ /** @description The organization the plan belongs to. In the dashboard block it can be a **child** of the organization you asked about, and a plan is only reachable by id through its own organization. */
2788
+ id_organization: string;
2789
+ /** Format: date-time */
2790
+ last_publish_date?: string;
2791
+ /** @description Its numbers are still moving: something is still scheduled, or its last publication is less than 7 days old. Comparing it with a plan from last month is unfair to the new one — say so rather than hiding it. */
2792
+ maturing: boolean;
2793
+ metrics: components["schemas"]["NormalizedMetrics"];
2794
+ prompt: string;
2795
+ publications: {
2796
+ /** @description Failed to publish. */
2797
+ failed: number;
2798
+ /** @description Published **and** with metrics collected: the only ones the averages use. */
2799
+ measured: number;
2800
+ /** @description Went out to the network. */
2801
+ published: number;
2802
+ /** @description Scheduled, or being published right now. */
2803
+ scheduled: number;
2804
+ /** @description Publications of the plan that still exist. Deleted ones do not count. */
2805
+ total: number;
2806
+ };
2807
+ /** @description Whether the plan competes in the ranking: it needs at least **3 measured publications**, or all of them if it published fewer. With a single measurement, one lucky post would put its plan first. */
2808
+ ranked: boolean;
2809
+ /** @description Networks the plan published on. With the `social_network` filter, only the filtered ones. */
2810
+ social_networks: components["schemas"]["SocialNetwork"][];
2811
+ /**
2812
+ * @description Only these two can have results. A `generated` plan was never validated, but someone may have published some of its drafts by hand.
2813
+ * @enum {string}
2814
+ */
2815
+ state: "generated" | "validated";
2816
+ /**
2817
+ * @description What the plan was generated from. A plan created before templates existed reads `standard`.
2818
+ * @enum {string}
2819
+ */
2820
+ template: "standard" | "from_images" | "from_text" | "from_catalog" | "campaign";
2821
+ /**
2822
+ * Format: date-time
2823
+ * @description The week the plan publishes in. **This is what the range filters on**, not the creation date.
2824
+ */
2825
+ week_start: string;
2826
+ };
2827
+ /** @description The aggregate of a set of plans: all of them, or those of one template. */
2828
+ AiPlanResultsGroup: {
2829
+ /** @description Credits per interaction, counting **only the plans that already have something measured**: a plan validated yesterday brings its whole cost and no interactions, and would make the group look expensive for arriving late. Absent with the `social_network` filter. */
2830
+ credits_per_engagement?: number;
2831
+ /** @description Credits of every plan in the group. */
2832
+ credits_spent: number;
2833
+ /** @description A **weighted** average: every interaction of the group divided by every measured publication of the group — not the average of each plan's average, which would let a one-post plan weigh as much as a forty-post one. */
2834
+ engagement_per_publication?: number;
2835
+ /** @description The group's interactions per post over what was expected, computed over the **same** plans on both sides — a plan with no reference cannot add its interactions to one side only. */
2836
+ engagement_vs_average?: number;
2837
+ /** @description What your usual posts would get with the group's mix of networks, weighted like its average. Only plans that have a reference count. */
2838
+ expected_engagement_per_publication?: number;
2839
+ metrics: components["schemas"]["NormalizedMetrics"];
2840
+ plans: number;
2841
+ publications: {
2842
+ measured: number;
2843
+ published: number;
2844
+ };
2845
+ /** @description How many of them compete in the ranking (see `AiPlanResult.ranked`). */
2846
+ ranked_plans: number;
2847
+ };
2657
2848
  AiPlansAiPlan: {
2658
2849
  /** @example 66d04a6a427f4c43b9d97f54 */
2659
2850
  _id: string;
@@ -2674,6 +2865,8 @@ interface components {
2674
2865
  creation_date: string;
2675
2866
  /** @description AI credits actually consumed by the generation. */
2676
2867
  credits_spent: number;
2868
+ /** @description The destination of each account of the plan that needs one (today, the board of every Pinterest account). Empty on a plan without such accounts, and on every plan created before destinations existed. */
2869
+ destinations?: components["schemas"]["AiPlansAiPlanDestination"][];
2677
2870
  /** @description Last generation error. Present only in state `failed`. */
2678
2871
  error?: components["schemas"]["AiPlansAiPlanNotice"];
2679
2872
  /** Format: date-time */
@@ -2709,7 +2902,11 @@ interface components {
2709
2902
  /**
2710
2903
  * @description Non-blocking notices about the LAST attempt (they are cleared when a new one starts). The plan is generated and perfectly usable; your UI just has to say what happened.
2711
2904
  *
2712
- * Today there is one: **2117 — some source items did not fit in the plan week.** A plan is weekly and the source does not extend it, so 12 photos with 6 slots left publish 6 and the rest are dropped. `data` carries `{ source_items, capacity }`. Better said BEFORE creating the plan (the slots are the publish days x the accounts) than after charging for it.
2905
+ * Today there are two.
2906
+ *
2907
+ * **2117 — some source items did not fit in the plan week.** A plan is weekly and the source does not extend it, so 12 photos with 6 slots left publish 6 and the rest are dropped. `data` carries `{ source_items, capacity }`. Better said BEFORE creating the plan (the slots are the publish days x the accounts) than after charging for it.
2908
+ *
2909
+ * **922 — a publication of a network that cannot publish without an image was left without one.** On Pinterest a pin is an image or a video, never text. The plan cannot be created with a configuration that would cause this (2119), but an image generation that fails halfway through the plan cannot be foreseen. `data` carries `{ step, social_network, id_account, id_publication }`: that draft will not publish until it has an image — regenerate it or attach one.
2713
2910
  */
2714
2911
  warnings?: components["schemas"]["AiPlansAiPlanNotice"][];
2715
2912
  };
@@ -2727,6 +2924,14 @@ interface components {
2727
2924
  AiPlansAiPlanCreateRequest: {
2728
2925
  /** @description Account ids (belonging to the organization) to generate the plan for. */
2729
2926
  accounts: string[];
2927
+ /**
2928
+ * @description Where each account publishes, for the networks that answer `destinations: true` in `GET /social_capabilities` — today `pinterest` alone, where it is the board of every pin of that account.
2929
+ *
2930
+ * **On Pinterest it is required, one entry per Pinterest account of the plan.** A plan without it — or with a board id that is not a string of digits — is rejected with **2118**, listing EVERY account that fails in `data.accounts[]` with the same `reason` as the publication's 987 (`missing`, `invalid_id`, `invalid_section_id`), so your UI can mark them all at once. Without this check the plan would be created, charged, and leave a week of drafts in `withErrors` with the 987.
2931
+ *
2932
+ * Entries for accounts on networks without destinations are dropped, not rejected. The board is **not** checked against Pinterest at creation — that would make creating a plan depend on Pinterest answering; a board that does not exist fails when the pin is published. Read the account's boards with `GET /organizations/{id_organization}/accounts/{id_account}/destinations`.
2933
+ */
2934
+ destinations?: components["schemas"]["AiPlansAiPlanDestination"][];
2730
2935
  options?: components["schemas"]["AiPlansAiPlanOptionsInput"];
2731
2936
  /** @description Theme prompt written by the user. */
2732
2937
  prompt: string;
@@ -2748,6 +2953,18 @@ interface components {
2748
2953
  /** @description Shortcut to estimate.estimated_cost. */
2749
2954
  estimated_cost: number;
2750
2955
  };
2956
+ /**
2957
+ * @description The destination of ONE account of the plan: the Pinterest board where **all** of that account's publications of the plan go.
2958
+ *
2959
+ * One per ACCOUNT, not one per plan, because a plan can carry three Pinterest profiles and each one has its own boards. And it travels with the account, not with the content: in a `shared` plan the same content replicated to three profiles lands on three boards with nothing else to touch.
2960
+ *
2961
+ * There is no default destination stored on the account: it lives in the plan alone.
2962
+ */
2963
+ AiPlansAiPlanDestination: {
2964
+ destination: components["schemas"]["PublicationDestination"];
2965
+ /** @description An account of the plan — one of `accounts`. An entry for an account that is not in the plan is a 2106 (almost always an id swapped by mistake). */
2966
+ id_account: string;
2967
+ };
2751
2968
  AiPlansAiPlanList: {
2752
2969
  ai_plans: components["schemas"]["AiPlansAiPlan"][];
2753
2970
  total: number;
@@ -2777,6 +2994,8 @@ interface components {
2777
2994
  * @default es
2778
2995
  */
2779
2996
  language: string;
2997
+ /** @description The destination link given to the plan's publications on the networks with `link: true` (today `pinterest`). Absent when none was sent or the plan has no such network. */
2998
+ link?: string;
2780
2999
  /** @description Optional cap on the number of images; the credit budget may reduce it further. */
2781
3000
  max_images?: number;
2782
3001
  /**
@@ -2823,6 +3042,12 @@ interface components {
2823
3042
  gallery_uploads?: string[];
2824
3043
  /** @description Language of the generated texts. Optional; defaults to `"es"`. */
2825
3044
  language?: string;
3045
+ /**
3046
+ * @description **The destination link** of the plan's publications — the pin's `link`, the same for every publication of the plan. Optional: a pin without a link is legitimate, it just takes nobody anywhere.
3047
+ *
3048
+ * It only reaches the publications of the networks that answer `link: true` in `GET /social_capabilities` (today `pinterest`); with none of them in the plan it is dropped. With one, it is validated **at creation**: a URL Pinterest would reject is a **994** now (`data.reason` `invalid_url` or `too_long`), not a week of pins failing at publish time.
3049
+ */
3050
+ link?: string;
2826
3051
  /** @description Optional cap on the number of images; the credit budget may reduce it further. */
2827
3052
  max_images?: number;
2828
3053
  /** @description Days of the week the plan publishes on, in ISO 8601 numbering (1 = Monday ... 7 = Sunday). Defaults to the whole week. There is still at most ONE publication per day and account, so this is what bounds the size and the cost of the plan: the number of generated posts is (selected days x accounts). Must be a non-empty array of unique integers between 1 and 7, or the request is rejected with 2106. The 7-day window starts at week_start, so each ISO day appears exactly once: with a week_start in mid-week, day 1 (Monday) is the FOLLOWING Monday. If the selected days leave no future slot at all, the request is rejected with 2108. Optional; defaults to `[1,2,3,4,5,6,7]`. */
@@ -2841,6 +3066,32 @@ interface components {
2841
3066
  */
2842
3067
  week_start?: string;
2843
3068
  };
3069
+ AiPlansAiPlanResults: {
3070
+ /** @description The page of plans, in `sort` order. */
3071
+ ai_plans: components["schemas"]["AiPlanResult"][];
3072
+ /** @description One entry per template that has plans in the range, best `engagement_per_publication` first. This is the answer to «which kind of plan works for me?». */
3073
+ by_template: components["schemas"]["AiPlansAiPlanResultsTemplateGroup"][];
3074
+ /** @description The range that was actually used. The plans in it are those whose **week** starts inside it. */
3075
+ range: {
3076
+ /** Format: date-time */
3077
+ from_date: string;
3078
+ /** Format: date-time */
3079
+ previous_from_date?: string;
3080
+ /** Format: date-time */
3081
+ previous_to_date?: string;
3082
+ /** Format: date-time */
3083
+ to_date: string;
3084
+ };
3085
+ /** @description The order that was applied. */
3086
+ sort: string;
3087
+ /** @description Plans with results in the range (and filters), across every page. */
3088
+ total: number;
3089
+ totals: components["schemas"]["AiPlanResultsGroup"];
3090
+ };
3091
+ AiPlansAiPlanResultsTemplateGroup: components["schemas"]["AiPlanResultsGroup"] & {
3092
+ /** @enum {string} */
3093
+ template: "standard" | "from_images" | "from_text" | "from_catalog" | "campaign";
3094
+ };
2844
3095
  /** @description The plan source as it was STORED: a snapshot taken when the plan was created, not a live reference. It is what makes a retry reproduce the same plan even if the article went offline or the product left the catalogue — same reason as `organization_context`. */
2845
3096
  AiPlansAiPlanSource: {
2846
3097
  /** @description `campaign`. The event and its date, already normalised to the start of ITS day in the plan timezone. */
@@ -2935,7 +3186,7 @@ interface components {
2935
3186
  id_client: string;
2936
3187
  /** @description The user who created the app, when it was created from the panel. */
2937
3188
  id_user?: string;
2938
- /** @description The app's `client_id`. */
3189
+ /** @description The app's `client_id`. Fixed for the life of the app: it cannot be changed once created (error 547). */
2939
3190
  keycloak_client_idenfifier: string;
2940
3191
  name: string;
2941
3192
  redirect_urls: string[];
@@ -2951,7 +3202,14 @@ interface components {
2951
3202
  AppsClientAppInput: {
2952
3203
  /** @description Origins allowed to call the API with this app's identity. Every entry has to be a valid URL (error 531). */
2953
3204
  allowed_domains?: string[];
2954
- /** @description The app's `client_id`, which is what you send to `POST /oauth/token`. It has to be unique across PlanVortex (error 534). The spelling of the field is historical and kept for compatibility. */
3205
+ /**
3206
+ * @description The app's `client_id`, which is what you send to `POST /oauth/token`.
3207
+ *
3208
+ * **Format is enforced** (error 533): lowercase letters, numbers, `.`, `-` and `_`, starting with a letter or a number, between 3 and 64 characters — `shop-integration`, not `Shop Integration`. Keycloak itself accepts anything, so an identifier with a space in it used to create an app that could never get a token.
3209
+ *
3210
+ * It also has to be unique across PlanVortex (error 534), and **it cannot be changed once the app exists** (error 547): it is what your integration authenticates with, so renaming it would lock out everything already using the old one. Send it unchanged on an update, or leave it out. The spelling of the field is historical and kept for compatibility.
3211
+ * @example shop-integration
3212
+ */
2955
3213
  keycloak_client_idenfifier: string;
2956
3214
  /** @description A name for the app. Cannot be blank (error 525). */
2957
3215
  name: string;
@@ -3058,6 +3316,8 @@ interface components {
3058
3316
  * @description Maximum size of one file, in megabytes.
3059
3317
  *
3060
3318
  * **On `slack` this one is a ceiling, not a promise.** 1.024 MB is what the network allows; the real limit is the lesser of that and the storage the client's own workspace plan still has, which no API exposes. A file inside this number can still come back as error 986. It is the only key in this map with that property.
3319
+ *
3320
+ * **On `pinterest` this number is the IMAGE one** (~20 MB); a video is allowed two orders of magnitude more. It is the one entry in this map that does not apply to every file of its network, so a size warning shown against it would be wrong on every video. Over whichever ceiling applies, the publication is created in state `withErrors` with `publication_errors[].code = 996` and `data.max_mb`.
3061
3321
  */
3062
3322
  max_file_size_mb: components["schemas"]["CatalogSocialLimitsMap"];
3063
3323
  /** @description Second text limit, in UTF-8 bytes. `0` means the network does not measure text in bytes; only Bluesky does, at 3.000. */
@@ -3068,6 +3328,8 @@ interface components {
3068
3328
  * @description How many images one publication accepts. `0` means images are not a publication on that network.
3069
3329
  *
3070
3330
  * **On `discord`, `threads` and `slack` it counts images and videos together**, because there the carousel is one message carrying several attachments and not several publications: what is validated is the total number of files. Over it, the publication is created in state `withErrors` — on `slack` with `publication_errors[].code = 982`.
3331
+ *
3332
+ * **On `pinterest` it is a ceiling with a floor under it.** Several images are a carousel of 2 to 5: one image is not a small carousel (it is a plain image pin, which is a different call) and six is not a trimmed one. Outside that range the publication is created in state `withErrors` with `publication_errors[].code = 990`.
3071
3333
  */
3072
3334
  total_images: components["schemas"]["CatalogSocialLimitsMap"];
3073
3335
  /** @description Maximum video duration. A network that limits weight instead of duration is not here but in `max_file_size_mb`. */
@@ -3328,6 +3590,10 @@ interface components {
3328
3590
  /** @description The coarse gates of one network */
3329
3591
  CommentsSocialCapabilities: {
3330
3592
  comments: boolean;
3593
+ /** @description The network publishes into **places inside the account**, and every publication has to name one: a Pinterest board. When this is `true`, read `GET /organizations/{id_organization}/accounts/{id_account}/destinations` and send one back in `destination` — a publication created without it lands in state `withErrors` with `publication_errors[].code = 987`. Today only `pinterest`. */
3594
+ destinations: boolean;
3595
+ /** @description The publication carries a **destination link of its own** (`link`), separate from its text: where a pin takes whoever clicks it. On a network that answers `false` the field is deleted on save, so do not offer it. Today only `pinterest`. */
3596
+ link: boolean;
3331
3597
  messages: boolean;
3332
3598
  persistent_menu: boolean;
3333
3599
  products: boolean;
@@ -3472,6 +3738,23 @@ interface components {
3472
3738
  previous_total: components["schemas"]["NormalizedMetrics"];
3473
3739
  total: components["schemas"]["NormalizedMetrics"];
3474
3740
  };
3741
+ /**
3742
+ * @description The best AI plans of the range, by interactions per measured publication — the short version of `GET /clients/{id}/organizations/{id}/ai_plans/results`, with the same rules: the range filters on the plan's **week**, and only plans with at least 3 measured publications compete.
3743
+ *
3744
+ * Unlike that endpoint it covers the organization **and its children**, like the rest of this screen, so each plan carries its `id_organization`.
3745
+ */
3746
+ ai_plan_results?: {
3747
+ /** @description Interactions per measured publication across every plan of the range. */
3748
+ engagement_per_publication?: number;
3749
+ /** @description Interactions per post of every plan of the range over what your usual posts would get on the same networks. 1 means like your average. */
3750
+ engagement_vs_average?: number;
3751
+ /** @description Plans with results in the range. */
3752
+ plans: number;
3753
+ /** @description How many of those compete in the ranking. `plans > 0` with `ranked_plans: 0` means there are results, just not enough measured yet. */
3754
+ ranked_plans: number;
3755
+ /** @description Up to three plans, best first. Only ranked ones. */
3756
+ top: components["schemas"]["AiPlanResult"][];
3757
+ };
3475
3758
  ai_plans?: {
3476
3759
  by_state: {
3477
3760
  state?: string;
@@ -3489,6 +3772,8 @@ interface components {
3489
3772
  /** @description Which blocks the caller was allowed to see. A `false` here is a permission (or plan) answer; a block that is `true` but empty means there is no data. */
3490
3773
  available_blocks: {
3491
3774
  account_metrics: boolean;
3775
+ /** @description Needs both `ai_plans:read` and `publication_stats:read`: the block shows plans and their publications' metrics. */
3776
+ ai_plan_results: boolean;
3492
3777
  ai_plans: boolean;
3493
3778
  health: boolean;
3494
3779
  messages: boolean;
@@ -3659,7 +3944,7 @@ interface components {
3659
3944
  * The catalogue grows with the product, so treat an unknown `code` as a generic failure instead of rejecting it.
3660
3945
  */
3661
3946
  Error: {
3662
- /** @description PlanVortex error code. Ranges: 500-546 auth, tokens and client apps · 601-612 user · 700-715 social accounts · 800-810 files · 900-986 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. */
3947
+ /** @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. */
3663
3948
  code: number;
3664
3949
  /** @description Extra context attached to the error, when there is any. */
3665
3950
  data?: {
@@ -4117,6 +4402,8 @@ interface components {
4117
4402
  _id: string;
4118
4403
  /** Format: date-time */
4119
4404
  creation_date: string;
4405
+ /** @description Where inside the account this publication goes. Only present on the networks that answer `destinations: true` in `GET /social_capabilities`. */
4406
+ destination?: components["schemas"]["PublicationDestination"];
4120
4407
  /**
4121
4408
  * @description What this publication's engagement rate is divided by.
4122
4409
  * @enum {string}
@@ -4143,6 +4430,14 @@ interface components {
4143
4430
  /** @description The integration this publication came from — an RSS feed, for instance. Set when it is created and never changed afterwards. */
4144
4431
  id_integration?: string;
4145
4432
  id_organization: string;
4433
+ /**
4434
+ * @description **The destination link**: where the publication takes whoever clicks it. Not to be confused with `url`, which is the link to the publication *on the network* and only exists once it is published.
4435
+ *
4436
+ * Only the networks that answer `link: true` in `GET /social_capabilities` carry it — today `pinterest` alone, where a pin has a `link` field of its own and sending traffic somewhere is the whole point of publishing there. Putting the URL inside `text` instead leaves it visible and unclickable.
4437
+ *
4438
+ * **On every other network the field is deleted on save**, like `destination`.
4439
+ */
4440
+ link?: string;
4146
4441
  /** @description Last known measurement, in the common vocabulary. Absent until it is measured. */
4147
4442
  metrics?: components["schemas"]["NormalizedMetrics"];
4148
4443
  /** @description Internal name. Never shown on the social network. */
@@ -4183,14 +4478,71 @@ interface components {
4183
4478
  /** @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. */
4184
4479
  url?: string;
4185
4480
  };
4481
+ /**
4482
+ * @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.
4483
+ *
4484
+ * Ask `destinations` in `GET /social_capabilities` instead of keeping a list of your own, and read the account's boards with `GET /organizations/{id_organization}/accounts/{id_account}/destinations`.
4485
+ *
4486
+ * **On Pinterest it is required.** A publication created without it is created in state `withErrors` with `publication_errors[].code = 987` and the background job will not attempt it — the same treatment as a YouTube video with no title, and for the same reason: a scheduled publication that dies at 3 a.m. over a board that was missing from the start is a failure that could have been told to the person while they were still there.
4487
+ *
4488
+ * **On every other network the field is deleted, not rejected.** A `destination` on a Facebook publication would be a field that does nothing, and giving it back in the response would be worse than dropping it.
4489
+ *
4490
+ * `name` and `section_name` are labels for display ("Recipes > Desserts"). The server never checks them and nothing is decided by them: what publishes is `id`.
4491
+ */
4492
+ PublicationDestination: {
4493
+ /** @description The board id. **Always a string**, never a number: Pinterest's ids are long integers, so a client that sends one as a JSON number has already lost digits to rounding before the request arrives. That is refused — `publication_errors[].code = 987` with `data.reason = "invalid_id"` — rather than published to some other board. Sending the board's *name* instead of its id fails the same way, which is the likeliest first mistake of an integration. */
4494
+ id?: string;
4495
+ /** @description The board's label, for display. Decides nothing. */
4496
+ name?: string;
4497
+ /** @description Pinterest only: the section of the board, optional. Absent or empty means the board itself. Same rule as `id` — anything that is not a string of digits is `data.reason = "invalid_section_id"`. A board's sections arrive in the detail of one destination, not in the list of them. */
4498
+ section_id?: string;
4499
+ /** @description The section's label, for display. Decides nothing. */
4500
+ section_name?: string;
4501
+ };
4502
+ /** @description A place inside the account a publication can be sent to: on Pinterest, a board. */
4503
+ PublicationsDestination: {
4504
+ /** @description The destination's own description, when the network has one. */
4505
+ description?: string;
4506
+ /** @description What goes in `destination.id` when creating a publication. **Always a string**, even though Pinterest's are long integers — parse it as text or you will lose digits. */
4507
+ id: string;
4508
+ /** @description A cover image for the picker, when the network has one. */
4509
+ image?: string;
4510
+ /** @description The name to show in a picker. */
4511
+ name: string;
4512
+ /** @description Pinterest: `PUBLIC`, `PROTECTED` or `SECRET`. Worth showing: a pin on a secret board is seen by nobody else, and afterwards there is nothing in the statistics that explains why it has no impressions. */
4513
+ privacy?: string;
4514
+ /** @description Pinterest: the board's sections, which is what goes in `destination.section_id`. **Only in the detail of one destination** — listing them for every board would cost one call to the network per board. */
4515
+ sections?: {
4516
+ id: string;
4517
+ name: string;
4518
+ }[];
4519
+ };
4186
4520
  /** @description Body accepted when creating or updating a publication. Only these properties are read; anything else in the payload is ignored. */
4187
4521
  PublicationsPublicationInput: {
4522
+ /**
4523
+ * @description Where inside the account the publication goes. **Required on the networks that answer `destinations: true` in `GET /social_capabilities`** — today `pinterest`, where it is the board — and **deleted** on every other one.
4524
+ *
4525
+ * Read the account's destinations with `GET /organizations/{id_organization}/accounts/{id_account}/destinations` and send back the `id` you got from there. Missing or malformed, the publication is still created, in state `withErrors` with `publication_errors[].code = 987` and a `data.reason` of `missing`, `invalid_id` or `invalid_section_id`. It is **not** checked against the network at creation: that would cost a call to Pinterest on every publication and make creating one depend on Pinterest answering.
4526
+ *
4527
+ * On an update, omitting it keeps the destination that was there.
4528
+ */
4529
+ destination?: components["schemas"]["PublicationDestination"];
4188
4530
  /**
4189
4531
  * @description Identifiers of uploads previously created through the uploads endpoints, attached to this publication.
4190
4532
  *
4191
4533
  * **On Slack the files travel inside the message**, not as publications of their own: up to 10 attachments counting images and videos together (`publication_errors[].code = 982` over it), each one under the `max_file_size_mb.slack` ceiling (code 983), and anything the upload itself refuses comes back as code 986.
4534
+ *
4535
+ * **On Pinterest a pin is an image or a video, never text alone** (code 922 with neither), and it is of one kind only: two to five images make a carousel — outside that range, code 990 — images and videos are not mixed and there is no more than one video (code 916). The weight ceilings are two orders of magnitude apart, so `max_file_size_mb.pinterest` is the **image** one (~20 MB) while a video is allowed far more; over either, code 996 with `data.max_mb`.
4192
4536
  */
4193
4537
  files?: string[];
4538
+ /**
4539
+ * @description **The destination link**: where the publication takes whoever clicks it. Only on the networks that answer `link: true` in `GET /social_capabilities` — today `pinterest`, where it is the whole point of a pin — and **deleted** on every other one. It is not `url`, which is the link to the publication on the network once published.
4540
+ *
4541
+ * It is optional (a pin with no link is legitimate), but if it is sent it must be a real `http(s)://` URL of at most 2.048 characters: a bare domain such as `mysite.com/recipe` is created in state `withErrors` with `publication_errors[].code = 994` and `data.reason` of `invalid_url` or `too_long`. It is checked when the publication is **created**, not when it is published, so a scheduled pin does not die at 3 a.m. over a link that was already wrong.
4542
+ *
4543
+ * On an update: omit it to keep what was there, send `null` or `""` to remove it.
4544
+ */
4545
+ link?: string;
4194
4546
  /** @description Internal name for the publication. Useful for grouping; never shown on the social network. */
4195
4547
  name?: string;
4196
4548
  /**
@@ -4209,7 +4561,7 @@ interface components {
4209
4561
  * Not every connectable network publishes — a local business listing receives reviews, not posts — so this list is shorter than the one in `GET /social_networks`. Ask `GET /allowed_social_publications` rather than hardcoding it, because it grows.
4210
4562
  * @enum {string}
4211
4563
  */
4212
- social_network?: "facebook" | "instagram" | "twitter" | "linkedin" | "tiktok" | "whatsapp" | "youtube" | "bluesky" | "discord" | "telegram" | "threads" | "slack";
4564
+ social_network?: "facebook" | "instagram" | "twitter" | "linkedin" | "tiktok" | "whatsapp" | "youtube" | "bluesky" | "discord" | "telegram" | "threads" | "slack" | "pinterest";
4213
4565
  /**
4214
4566
  * @description Send `draft` to store the publication without publishing it. If omitted, the state is resolved automatically: `ready` when everything validates, `withErrors` otherwise. Forcing `sended` marks it as published without actually sending it.
4215
4567
  * @enum {string}
@@ -4221,9 +4573,15 @@ interface components {
4221
4573
  * **On Telegram the limit depends on what else the publication carries**: 4.096 characters while it is text only, and **1.024** the moment it has an image or a video, because then the text is the caption of a photo, a video or an album and no longer a message. Over the limit it is created in state `withErrors` with `publication_errors[].code = 967`, whose `data` carries `characters`, `max_characters` and `has_media`. Both numbers are published, as `characters.telegram` and `characters.telegram_media` in `GET /social_limits`.
4222
4574
  *
4223
4575
  * **On Slack the limit is 4.000 characters** and it is counted over the text you send, not over what travels: `&`, `<` and `>` are escaped before publishing, so a text made of ampersands grows on the wire and is still measured here. Over the limit the publication is created in state `withErrors` with `publication_errors[].code = 981`. And because the escaped text is what is measured on the wire, a text that passed at 4.000 characters and is full of `&` is **trimmed** before going out — Slack does not reject a long `text`, it truncates it or splits it into several messages, and one publication showing up as two posts is worse. The text goes out **plain**: Slack speaks *mrkdwn* and not Markdown, and PlanVortex sends no `blocks`, so `**bold**` is published literally.
4576
+ *
4577
+ * **On Pinterest `text` is the pin's description**, at most 800 characters — the title is the separate `title` field, which is the first thing anyone arriving from Facebook gets wrong. Over it, `publication_errors[].code = 995` with `data.field = "description"`.
4224
4578
  */
4225
4579
  text?: string;
4226
- /** @description Title for the publication. Only some networks use it: optional on LinkedIn, and **required on YouTube**, where it is the video title and must be 100 characters or fewer — a publication without it, or with a longer one, is created in state `withErrors` with `publication_errors[].code = 944`. */
4580
+ /**
4581
+ * @description Title for the publication. Only some networks use it: optional on LinkedIn, and **required on YouTube**, where it is the video title and must be 100 characters or fewer — a publication without it, or with a longer one, is created in state `withErrors` with `publication_errors[].code = 944`.
4582
+ *
4583
+ * **On Pinterest it is the pin's title**, optional and at most 100 characters; over it the publication is created in state `withErrors` with `publication_errors[].code = 995` and `data.field = "title"`.
4584
+ */
4227
4585
  title?: string;
4228
4586
  };
4229
4587
  PublicationsPublicationList: {
@@ -4328,6 +4686,8 @@ interface components {
4328
4686
  * On `telegram` there are two as well, and **neither of them is asked for**: the Bot API has no method that returns a message's metrics, so `reactions` arrives on its own through the bot and `comments` is counted in PlanVortex's own inbox. There are no impressions, no reach, no views and no forwards to be had anywhere in it, so engagement is computed over followers.
4329
4687
  *
4330
4688
  * On `slack` there is exactly **one**, `reactions`, and the other absences are the informative part: the Web API publishes no impressions, no reach, no views and no clicks for a message, so those keys are missing rather than zero. There is no `comments` either — Slack threads are not read at all (`comments` is `false` in `GET /social_capabilities`). Engagement is computed over the channel's members.
4689
+ *
4690
+ * On `pinterest` there are seven, and three of them exist nowhere else: `saves` — the gesture the whole network is built on —, `outbound_clicks` (clicks that left the pin towards its `link`, which is the one normalised as the common `clicks`) and `pin_clicks` (clicks that opened the pin inside Pinterest, with no common equivalent). `impressions` is real here, so the engagement rate is computed over it and not over followers. `video_views` only exists on a video pin. And `comments` is the odd one: Pinterest **counts** them and offers no way to read them, so the number is reported while `comments` is `false` in `GET /social_capabilities` — this network has no comment inbox, and it is not a gap waiting to be filled.
4331
4691
  */
4332
4692
  PublicationStats: {
4333
4693
  angers?: number;
@@ -4343,7 +4703,11 @@ interface components {
4343
4703
  likes?: number;
4344
4704
  loves?: number;
4345
4705
  negative_feedback?: number;
4706
+ /** @description Pinterest. Clicks that left the pin towards its `link`. This is the one normalised as the common `clicks`. */
4707
+ outbound_clicks?: number;
4346
4708
  page_likes?: number;
4709
+ /** @description Pinterest. Clicks that opened the pin inside Pinterest without leaving it. No common equivalent, so it lives only here. */
4710
+ pin_clicks?: number;
4347
4711
  /** @description X (Twitter). Video playbacks that reached 0% — i.e. started. Comes from X's non-public metrics: omitted when unavailable. */
4348
4712
  playback_0_count?: number;
4349
4713
  /** @description X (Twitter). Video playbacks that reached 25%. Comes from X's non-public metrics: omitted when unavailable. */
@@ -4358,7 +4722,7 @@ interface components {
4358
4722
  profile_visits?: number;
4359
4723
  quotes?: number;
4360
4724
  reach?: number;
4361
- /** @description Telegram and Slack. Every reaction on the post, all emoji together. It is the **complete state and not an increment**: it goes down when somebody takes theirs back. Normalised as `likes`. On `slack` it is the only metric the network gives. */
4725
+ /** @description Telegram, Slack and Pinterest. Every reaction on the post, all emoji together, normalised as `likes`. On `telegram` and `slack` it is the **complete state and not an increment**: it goes down when somebody takes theirs back. On `slack` it is the only metric the network gives. */
4362
4726
  reactions?: number;
4363
4727
  /** @description Telegram. The same total broken down by emoji. Reactions with a custom emoji are grouped under a single key: their identifier means nothing outside the server that created it. */
4364
4728
  reactions_by_emoji?: {
@@ -4367,6 +4731,8 @@ interface components {
4367
4731
  replys?: number;
4368
4732
  retwets?: number;
4369
4733
  saved?: number;
4734
+ /** @description Pinterest. Times the pin was saved to a board — the gesture the network is built on. Normalised as `saves` and counted towards engagement. Not the same key as `saved`, which is Instagram's. */
4735
+ saves?: number;
4370
4736
  share?: number;
4371
4737
  shareMentions?: number;
4372
4738
  shares?: number;
@@ -4412,7 +4778,7 @@ interface components {
4412
4778
  * **This list grows.** Treat it as an open enumeration: a client that rejects an unknown value breaks the day a network is added, which happens several times a year. Not every network does everything — ask `GET /social_capabilities`.
4413
4779
  * @enum {string}
4414
4780
  */
4415
- SocialNetwork: "facebook" | "instagram" | "linkedin" | "tiktok" | "twitter" | "whatsapp" | "youtube" | "google_business" | "bluesky" | "discord" | "telegram" | "threads" | "slack";
4781
+ SocialNetwork: "facebook" | "instagram" | "linkedin" | "tiktok" | "twitter" | "whatsapp" | "youtube" | "google_business" | "bluesky" | "discord" | "telegram" | "threads" | "slack" | "pinterest";
4416
4782
  /** @description Statistics collection settings. Only `auto_refresh_twitter` is read; any other key is ignored. */
4417
4783
  StatsSettings: {
4418
4784
  /**
@@ -4548,12 +4914,16 @@ interface components {
4548
4914
  };
4549
4915
  };
4550
4916
  parameters: {
4917
+ /** @description Start of the range, ISO 8601. Defaults to 30 days before `to_date`. A range longer than 366 days answers error 1003. */
4918
+ AiPlansfromDate: string;
4551
4919
  /** @description AI plan identifier */
4552
4920
  AiPlansidAiPlan: string;
4553
4921
  /** @description Client identifier */
4554
4922
  AiPlansidClient: string;
4555
4923
  /** @description Organization identifier */
4556
4924
  AiPlansidOrganization: string;
4925
+ /** @description End of the range, ISO 8601. Defaults to now. */
4926
+ AiPlanstoDate: string;
4557
4927
  /** @description App identifier */
4558
4928
  AppsidApp: string;
4559
4929
  /** @description Client identifier */
@@ -5219,6 +5589,34 @@ interface operations {
5219
5589
  400: components["responses"]["AppsError"];
5220
5590
  };
5221
5591
  };
5592
+ regenerateClientAppSecret: {
5593
+ parameters: {
5594
+ query?: never;
5595
+ header?: never;
5596
+ path: {
5597
+ /** @description App identifier */
5598
+ id_app: components["parameters"]["AppsidApp"];
5599
+ /** @description Client identifier */
5600
+ id_client: components["parameters"]["AppsidClient"];
5601
+ };
5602
+ cookie?: never;
5603
+ };
5604
+ requestBody?: never;
5605
+ responses: {
5606
+ /** @description The new secret */
5607
+ 200: {
5608
+ headers: {
5609
+ [name: string]: unknown;
5610
+ };
5611
+ content: {
5612
+ "application/json": {
5613
+ secret: string;
5614
+ };
5615
+ };
5616
+ };
5617
+ 400: components["responses"]["AppsError"];
5618
+ };
5619
+ };
5222
5620
  getClientOrganizations: {
5223
5621
  parameters: {
5224
5622
  query?: {
@@ -5541,6 +5939,9 @@ interface operations {
5541
5939
  * | `2114` | The source URL points to a non-public address (`from_text`): loopback, private, link-local or CGNAT. Checked before every redirect and again when the socket opens. |
5542
5940
  * | `2115` | The selected account has no usable product catalogue (`from_catalog`): its network has no products, or the catalogue could not be read — expired token, deleted catalogue, missing permission — or came back empty. |
5543
5941
  * | `2116` | The source has no usable items: no images, no products, or no text at all (neither `url` nor `text`, or a pasted text under 200 characters). |
5942
+ * | `994` | Invalid `options.link` with a network that uses it (`pinterest`) in the plan. `data.reason` is `invalid_url` or `too_long`. |
5943
+ * | `2118` | A Pinterest account of the plan has no valid board in `destinations`. `data.accounts[]` lists every one that fails, as `{ _id, social_network, reason }`, with `reason` `missing`, `invalid_id` or `invalid_section_id`. |
5944
+ * | `2119` | The plan would leave pins without an image: a pin is never text-only. Only checked with Pinterest in the plan and a template that GENERATES images (`from_images` and `from_catalog` bring their own photo). `data.reason` is `images_disabled` (`allow_images: false`), `max_images` (a cap below what is needed) or `credits` (not enough credits for that many images); `data` also carries `{ required, images_target, social_networks }`. The images needed are one per day and per account of a network that requires one — Instagram included, because both networks draw on the same image budget. |
5544
5945
  * | `521` | Invalid client. The identifier is invalid or doesn't exist |
5545
5946
  */
5546
5947
  400: {
@@ -5939,6 +6340,73 @@ interface operations {
5939
6340
  };
5940
6341
  };
5941
6342
  };
6343
+ getAiPlanResultsService: {
6344
+ parameters: {
6345
+ query?: {
6346
+ /** @description Start of the range, ISO 8601. Defaults to 30 days before `to_date`. A range longer than 366 days answers error 1003. */
6347
+ from_date?: components["parameters"]["AiPlansfromDate"];
6348
+ /** @description Plans per page. At most 100. */
6349
+ limit?: number;
6350
+ /** @description Number of plans to skip (pagination) */
6351
+ offset?: number;
6352
+ /** @description Recompute every plan with **only** its publications on these networks, which is what makes plans on different networks comparable. Repeat the parameter for several. `credits_per_engagement` disappears with this filter. */
6353
+ social_network?: components["schemas"]["SocialNetwork"][];
6354
+ /** @description Order of the plans. Each one has its natural direction — `credits_per_engagement` cheapest first, `week_start` newest first, everything else highest first — and plans without that value go last. */
6355
+ sort?: "engagement_per_publication" | "engagement" | "impressions" | "reach" | "credits_per_engagement" | "credits_spent" | "week_start";
6356
+ /** @description Only plans generated from this template. An unknown one answers error 2111. */
6357
+ template?: "standard" | "from_images" | "from_text" | "from_catalog" | "campaign";
6358
+ /** @description End of the range, ISO 8601. Defaults to now. */
6359
+ to_date?: components["parameters"]["AiPlanstoDate"];
6360
+ };
6361
+ header?: never;
6362
+ path: {
6363
+ /** @description Client identifier */
6364
+ id_client: components["parameters"]["AiPlansidClient"];
6365
+ /** @description Organization identifier */
6366
+ id_organization: components["parameters"]["AiPlansidOrganization"];
6367
+ };
6368
+ cookie?: never;
6369
+ };
6370
+ requestBody?: never;
6371
+ responses: {
6372
+ /** @description Successful operation */
6373
+ 200: {
6374
+ headers: {
6375
+ [name: string]: unknown;
6376
+ };
6377
+ content: {
6378
+ "application/json": components["schemas"]["AiPlansAiPlanResults"];
6379
+ };
6380
+ };
6381
+ /**
6382
+ * @description The request failed. The body carries the PlanVortex error code in `code`:
6383
+ *
6384
+ * | Code | Meaning |
6385
+ * | --- | --- |
6386
+ * | `1000` | Invalid `from_date`, or an unknown `sort` or `social_network` (`data.allowed` lists the valid values) |
6387
+ * | `1001` | Invalid `to_date` |
6388
+ * | `1003` | Range longer than 366 days |
6389
+ * | `2111` | Unknown `template` |
6390
+ * | `1101` | Invalid organization |
6391
+ * | `521` | Invalid client. The identifier is invalid or doesn't exist |
6392
+ */
6393
+ 400: {
6394
+ headers: {
6395
+ [name: string]: unknown;
6396
+ };
6397
+ content: {
6398
+ "application/json": components["schemas"]["Error"];
6399
+ };
6400
+ };
6401
+ /** @description Unhandled error by the server */
6402
+ 500: {
6403
+ headers: {
6404
+ [name: string]: unknown;
6405
+ };
6406
+ content?: never;
6407
+ };
6408
+ };
6409
+ };
5942
6410
  getClientRoles: {
5943
6411
  parameters: {
5944
6412
  query?: {
@@ -7062,6 +7530,177 @@ interface operations {
7062
7530
  400: components["responses"]["MessagesError"];
7063
7531
  };
7064
7532
  };
7533
+ getAccountDestinations: {
7534
+ parameters: {
7535
+ query?: {
7536
+ /** @description `true` skips the short cache and asks the network again. For a board that was created a moment ago — not on every call: all of PlanVortex's Pinterest traffic leaves through one application, and the cache is what keeps a picker that opens on every compose from spending it. */
7537
+ refresh?: "true" | "false";
7538
+ };
7539
+ header?: never;
7540
+ path: {
7541
+ /** @description Connected account identifier */
7542
+ id_account: string;
7543
+ /** @description Organization identifier */
7544
+ id_organization: string;
7545
+ };
7546
+ cookie?: never;
7547
+ };
7548
+ requestBody?: never;
7549
+ responses: {
7550
+ /** @description The account's destinations */
7551
+ 200: {
7552
+ headers: {
7553
+ [name: string]: unknown;
7554
+ };
7555
+ content: {
7556
+ /**
7557
+ * @example {
7558
+ * "destinations": [
7559
+ * {
7560
+ * "id": "1093847562910384756",
7561
+ * "name": "Recipes",
7562
+ * "privacy": "PUBLIC",
7563
+ * "image": "https://i.pinimg.com/…/board.jpg"
7564
+ * },
7565
+ * {
7566
+ * "id": "1093847562910384799",
7567
+ * "name": "Drafts",
7568
+ * "privacy": "SECRET"
7569
+ * }
7570
+ * ]
7571
+ * }
7572
+ */
7573
+ "application/json": {
7574
+ destinations: components["schemas"]["PublicationsDestination"][];
7575
+ };
7576
+ };
7577
+ };
7578
+ /**
7579
+ * @description The request failed. The body carries the PlanVortex error code in `code`:
7580
+ *
7581
+ * | Code | Meaning |
7582
+ * | --- | --- |
7583
+ * | `992` | This network has no destinations: the account itself is where publications go. `data` carries `social_network` |
7584
+ * | `701` | Account not found in this organization |
7585
+ * | `700` | Account not connected, missing authorization tokens |
7586
+ * | `1101` | Invalid organization |
7587
+ */
7588
+ 400: {
7589
+ headers: {
7590
+ [name: string]: unknown;
7591
+ };
7592
+ content: {
7593
+ "application/json": components["schemas"]["Error"];
7594
+ };
7595
+ };
7596
+ /** @description Pinterest is rate limiting, and the request was correct: wait and repeat it. `code` is 991 and `data.retry_after_seconds` says how long. The ceiling is the **application's**, shared by every PlanVortex client on the network, so this is not a sign that the account is broken. */
7597
+ 429: {
7598
+ headers: {
7599
+ /** @description Seconds to wait before trying again. */
7600
+ "Retry-After"?: number;
7601
+ [name: string]: unknown;
7602
+ };
7603
+ content: {
7604
+ "application/json": components["schemas"]["Error"];
7605
+ };
7606
+ };
7607
+ /** @description Unhandled error by the server */
7608
+ 500: {
7609
+ headers: {
7610
+ [name: string]: unknown;
7611
+ };
7612
+ content?: never;
7613
+ };
7614
+ };
7615
+ };
7616
+ getAccountDestination: {
7617
+ parameters: {
7618
+ query?: {
7619
+ /** @description `true` skips the short cache and asks the network again. For a board that was created a moment ago — not on every call: all of PlanVortex's Pinterest traffic leaves through one application, and the cache is what keeps a picker that opens on every compose from spending it. */
7620
+ refresh?: "true" | "false";
7621
+ };
7622
+ header?: never;
7623
+ path: {
7624
+ /** @description Connected account identifier */
7625
+ id_account: string;
7626
+ /** @description The destination's id **on the network** — the `id` of an entry in the listing, not a PlanVortex identifier. */
7627
+ id_destination: string;
7628
+ /** @description Organization identifier */
7629
+ id_organization: string;
7630
+ };
7631
+ cookie?: never;
7632
+ };
7633
+ requestBody?: never;
7634
+ responses: {
7635
+ /** @description The destination */
7636
+ 200: {
7637
+ headers: {
7638
+ [name: string]: unknown;
7639
+ };
7640
+ content: {
7641
+ /**
7642
+ * @example {
7643
+ * "destination": {
7644
+ * "id": "1093847562910384756",
7645
+ * "name": "Recipes",
7646
+ * "privacy": "PUBLIC",
7647
+ * "sections": [
7648
+ * {
7649
+ * "id": "5039281746501928374",
7650
+ * "name": "Desserts"
7651
+ * },
7652
+ * {
7653
+ * "id": "5039281746501928375",
7654
+ * "name": "Breakfast"
7655
+ * }
7656
+ * ]
7657
+ * }
7658
+ * }
7659
+ */
7660
+ "application/json": {
7661
+ destination: components["schemas"]["PublicationsDestination"];
7662
+ };
7663
+ };
7664
+ };
7665
+ /**
7666
+ * @description The request failed. The body carries the PlanVortex error code in `code`:
7667
+ *
7668
+ * | Code | Meaning |
7669
+ * | --- | --- |
7670
+ * | `993` | That destination is not in this account. `data` carries `social_network` and `destination_id` |
7671
+ * | `992` | This network has no destinations: the account itself is where publications go |
7672
+ * | `701` | Account not found in this organization |
7673
+ * | `700` | Account not connected, missing authorization tokens |
7674
+ * | `1101` | Invalid organization |
7675
+ */
7676
+ 400: {
7677
+ headers: {
7678
+ [name: string]: unknown;
7679
+ };
7680
+ content: {
7681
+ "application/json": components["schemas"]["Error"];
7682
+ };
7683
+ };
7684
+ /** @description Pinterest is rate limiting, and the request was correct: wait and repeat it. `code` is 991 and `data.retry_after_seconds` says how long. The ceiling is the **application's**, shared by every PlanVortex client on the network, so this is not a sign that the account is broken. */
7685
+ 429: {
7686
+ headers: {
7687
+ /** @description Seconds to wait before trying again. */
7688
+ "Retry-After"?: number;
7689
+ [name: string]: unknown;
7690
+ };
7691
+ content: {
7692
+ "application/json": components["schemas"]["Error"];
7693
+ };
7694
+ };
7695
+ /** @description Unhandled error by the server */
7696
+ 500: {
7697
+ headers: {
7698
+ [name: string]: unknown;
7699
+ };
7700
+ content?: never;
7701
+ };
7702
+ };
7703
+ };
7065
7704
  enableAccount: {
7066
7705
  parameters: {
7067
7706
  query?: never;
@@ -10784,7 +11423,9 @@ interface operations {
10784
11423
  * "products": false,
10785
11424
  * "webhooks": true,
10786
11425
  * "persistent_menu": false,
10787
- * "comments": true
11426
+ * "comments": true,
11427
+ * "destinations": false,
11428
+ * "link": false
10788
11429
  * },
10789
11430
  * "google_business": {
10790
11431
  * "publications": false,
@@ -10792,7 +11433,19 @@ interface operations {
10792
11433
  * "products": false,
10793
11434
  * "webhooks": false,
10794
11435
  * "persistent_menu": false,
10795
- * "comments": true
11436
+ * "comments": true,
11437
+ * "destinations": false,
11438
+ * "link": false
11439
+ * },
11440
+ * "pinterest": {
11441
+ * "publications": true,
11442
+ * "messages": false,
11443
+ * "products": false,
11444
+ * "webhooks": false,
11445
+ * "persistent_menu": false,
11446
+ * "comments": false,
11447
+ * "destinations": true,
11448
+ * "link": true
10796
11449
  * }
10797
11450
  * }
10798
11451
  */
@@ -10917,7 +11570,8 @@ interface operations {
10917
11570
  * "discord",
10918
11571
  * "telegram",
10919
11572
  * "threads",
10920
- * "slack"
11573
+ * "slack",
11574
+ * "pinterest"
10921
11575
  * ]
10922
11576
  */
10923
11577
  "application/json": components["schemas"]["SocialNetwork"][];
@@ -10999,7 +11653,7 @@ interface operations {
10999
11653
  * de una organizacion. Aqui se llama `PublicationInput`. Los que describen LO MISMO en varias
11000
11654
  * secciones viven en `common.json` y conservan su nombre —`Publication`, `Account`, `Upload`,
11001
11655
  * `Message`, `Contact`, `NormalizedMetrics`—: es lo que evita dos tipos para un solo objeto.
11002
- * 2. **Abre las enumeraciones que crecen** (§ trampa 8 del roadmap). `ALLOWED_RRSS` va por trece
11656
+ * 2. **Abre las enumeraciones que crecen** (§ trampa 8 del roadmap). `ALLOWED_RRSS` va por catorce
11003
11657
  * redes y sube varias veces al ano. Si `social_network` fuera una union cerrada, el dia que
11004
11658
  * entre la siguiente **dejaria de compilar el codigo de todos los integradores** hasta que
11005
11659
  * actualizasen el paquete, y lo unico que habria pasado es que la API devuelve un valor mas.
@@ -11061,7 +11715,13 @@ interface Paginated<T> {
11061
11715
  * `GET /social_capabilities`.
11062
11716
  */
11063
11717
  type SocialNetwork = OpenEnum<Schemas["SocialNetwork"]>;
11064
- /** Una red que tiene comentarios. Tambien crece. */
11718
+ /**
11719
+ * Una red que tiene comentarios. Tambien crece.
11720
+ *
11721
+ * **No es `SocialNetwork` menos las que no publican**: son dos listas independientes. `pinterest`
11722
+ * publica y NO esta aqui —la API de Pinterest no deja leer los comentarios de un pin, aunque el
11723
+ * numero si llega en sus metricas—, igual que `google_business` esta aqui y no publica.
11724
+ */
11065
11725
  type CommentNetwork = OpenEnum<Schemas["CommentsCommentNetworkName"]>;
11066
11726
  /**
11067
11727
  * El estado de una publicacion.
@@ -11246,6 +11906,25 @@ type AccountMetrics = Schemas["AccountsMetricModel"];
11246
11906
  type AccountMetricRow = AccountMetrics["stats"][number];
11247
11907
  /** El menu fijo del chat, en el formato de Meta. Solo lo tienen las redes con mensajeria. */
11248
11908
  type PersistentMenu = Schemas["AccountsPersistentMenu"];
11909
+ /**
11910
+ * Un sitio DENTRO de la cuenta al que se puede mandar una publicacion: en Pinterest, un tablero.
11911
+ *
11912
+ * Lo que devuelven `accounts.destinations()` y `accounts.destination()`, que es lo que se ENSENA en
11913
+ * un selector. Lo que se MANDA al crear la publicacion es {@link PublicationDestination}, con
11914
+ * `id` como identificador —siempre una cadena— y `name` solo como etiqueta.
11915
+ *
11916
+ * `privacy` merece ensenarse: un pin en un tablero `SECRET` no lo ve nadie mas, y luego no hay nada
11917
+ * en las estadisticas que explique por que no tiene impresiones. Y `sections` solo viene en el
11918
+ * detalle de uno, nunca en la lista.
11919
+ */
11920
+ type Destination = Schemas["PublicationsDestination"];
11921
+ /**
11922
+ * El `destination` de una publicacion: en que tablero sale. Ver {@link PublicationInput}.
11923
+ *
11924
+ * Solo decide `id` (y `section_id`, si va a una seccion del tablero). `name` y `section_name` son
11925
+ * etiquetas para pintar "Recetas > Postres": el servidor no las comprueba.
11926
+ */
11927
+ type PublicationDestination = Schemas["PublicationDestination"];
11249
11928
  /**
11250
11929
  * El token temporal con el que UNA PERSONA conecta una cuenta social, y la URL a la que mandarla.
11251
11930
  *
@@ -11274,7 +11953,7 @@ type ConnectToken = Operations["createTemporalConnectToken"]["responses"][200]["
11274
11953
  */
11275
11954
  type ConnectLink = Schemas["AccountsSocialLinksList"]["links"][number];
11276
11955
  /**
11277
- * Con que se autoriza una red: `redirect` (once de las trece), `meta_embedded_signup` (WhatsApp) o
11956
+ * Con que se autoriza una red: `redirect` (doce de las catorce), `meta_embedded_signup` (WhatsApp) o
11278
11957
  * `telegram_bot` (Telegram). Se saca de {@link ConnectLink} y esta aqui para poder nombrarlo en un
11279
11958
  * `switch`.
11280
11959
  *
@@ -11339,6 +12018,9 @@ type FileProperties = Schemas["FileProperties"];
11339
12018
  * Si `state` es `withErrors`, el motivo esta en `publication_errors` —que es un ARRAY— y su `code`
11340
12019
  * es un codigo del catalogo de PlanVortex, nunca un status HTTP.
11341
12020
  *
12021
+ * En Pinterest `destination` dice en que tablero salio el pin, y `link` a donde lleva: no se
12022
+ * confunda con `url`, que es el enlace a la publicacion EN la red y solo existe ya publicada.
12023
+ *
11342
12024
  * Y OJO EN TELEGRAM: un album es UNA publicacion que son VARIOS mensajes. `external_identifier` es
11343
12025
  * el primero y el resto viajan en `extra_data.telegram_message_ids`, que es el unico sitio donde
11344
12026
  * hoy escribe nadie ese campo. En un canal privado ademas no hay `url`, porque no hay `@nombre` que
@@ -11365,6 +12047,25 @@ type PublicationErrorDetail = Publication["publication_errors"][number];
11365
12047
  *
11366
12048
  * `publish_date` admite un `Date` ademas de la cadena ISO: la libreria lo convierte. Sin eso, el
11367
12049
  * primer olvido es siempre el `.toISOString()`.
12050
+ *
12051
+ * **Dos campos que solo aplican a unas redes**, y ninguna de las dos listas se copia: se pregunta
12052
+ * `destinations` y `link` en `catalog.socialCapabilities()`. Hoy las dos son solo `pinterest`.
12053
+ *
12054
+ * - **`destination`: en Pinterest es OBLIGATORIO.** Elegir la cuenta no elige donde sale el pin:
12055
+ * sale en un TABLERO, y se lee con `accounts.destinations()`. Sin el, la publicacion se crea
12056
+ * igual pero en `withErrors` con el 987 y nadie la intenta. `destination.id` es SIEMPRE una
12057
+ * cadena —los ids de Pinterest son enteros largos y un `number` ya ha perdido digitos antes de
12058
+ * salir—, y mandar el NOMBRE del tablero en vez de su id falla igual.
12059
+ * - **`link`: el enlace de destino va aqui, no dentro de `text`.** Es a donde lleva el pin a quien
12060
+ * lo pulsa; metido en el texto se ve y no se puede pulsar. Un enlace que no es `http(s)` es un
12061
+ * 994 al crear.
12062
+ *
12063
+ * En las demas redes los dos se BORRAN al guardar, no se rechazan.
12064
+ *
12065
+ * Y lo demas de Pinterest que el tipo no dice: **no hay publicaciones de solo texto** (922), un
12066
+ * carrusel es de 2 a 5 imagenes sin mezclar con video (990), y `title` y `text` son dos campos con
12067
+ * dos limites —100 y 800— que ademas no se cuentan en la misma unidad (995): el titulo en puntos de
12068
+ * codigo, la descripcion en unidades UTF-16. Los dos numeros vienen de `catalog.socialLimits()`.
11368
12069
  */
11369
12070
  type PublicationInput = Override<Schemas["PublicationsPublicationInput"], {
11370
12071
  social_network: SocialNetwork;
@@ -11615,8 +12316,29 @@ type AiPlanOptionsInput = Schemas["AiPlansAiPlanOptionsInput"];
11615
12316
  * `template` y `source` son OPCIONALES: sin ellos el plan es `standard`, que es exactamente lo que
11616
12317
  * hacia cualquier plan antes de que existieran las plantillas. Mandar una opcion que la plantilla
11617
12318
  * elegida no admite —un `shared` en `from_images`— es un 2106, no un silencio.
12319
+ *
12320
+ * **Con una cuenta de Pinterest en el plan hay dos comprobaciones mas, las dos al crear:**
12321
+ *
12322
+ * - **`destinations` es obligatorio para cada cuenta de Pinterest**: el tablero donde salen TODOS
12323
+ * sus pins del plan, uno por cuenta ({@link AiPlanDestination}). Sin el —o con un id que no es
12324
+ * una cadena de digitos— el plan se rechaza con el **2118**, que trae en `data.accounts` TODAS
12325
+ * las cuentas que fallan. Sin esa comprobacion el plan se crearia, se cobraria y dejaria una
12326
+ * semana de borradores con el 987.
12327
+ * - **Un plan que dejaria pins sin imagen se rechaza con el 2119**: un pin nunca es solo texto.
12328
+ * Solo con una plantilla que GENERA imagenes, y `data.reason` dice por que: `images_disabled`,
12329
+ * `max_images` o `credits`. Las imagenes necesarias son una por dia y cuenta de una red que la
12330
+ * exige, Instagram incluida, porque las dos redes tiran del mismo presupuesto.
12331
+ *
12332
+ * Y `options.link` es el enlace de destino de todos los pins del plan: se valida al crear (994) y
12333
+ * se tira si el plan no tiene ninguna red con `link`.
11618
12334
  */
11619
12335
  type AiPlanCreateRequest = Schemas["AiPlansAiPlanCreateRequest"];
12336
+ /**
12337
+ * El tablero de UNA cuenta de Pinterest del plan: donde salen todos sus pins. Va por cuenta y no
12338
+ * por plan porque cada perfil tiene sus tableros, y en un plan `shared` el mismo contenido sale en
12339
+ * el tablero de cada perfil sin tocar nada mas. No hay tablero por defecto guardado en la cuenta.
12340
+ */
12341
+ type AiPlanDestination = Schemas["AiPlansAiPlanDestination"];
11620
12342
  /**
11621
12343
  * La fuente del plan, tal y como se MANDA. **Una forma por plantilla**: manda solo los campos de la
11622
12344
  * que elegiste —lo que no lee se ignora, y lo que necesita y no recibe es un 2112—.
@@ -11657,10 +12379,15 @@ type AiPlanSourceProduct = Schemas["AiPlansAiPlanSourceProduct"];
11657
12379
  * Algo que el plan tiene que decir de si mismo, con la forma de un error de la API. Lo comparten
11658
12380
  * `error` (solo en estado `failed`) y `warnings` (en un plan que se genero bien).
11659
12381
  *
11660
- * Hoy hay un aviso: **2117 — parte de la fuente no cabia en la semana del plan**. Un plan es
11661
- * SEMANAL y la fuente no lo alarga, asi que 12 fotos con 6 huecos libres publican 6 y las demas se
11662
- * quedan fuera; `data` trae `{source_items, capacity}`. Se dice mejor ANTES de crear el plan —los
11663
- * huecos son los dias de publicacion por las cuentas— que despues de haberlo cobrado.
12382
+ * Hoy hay dos avisos:
12383
+ *
12384
+ * - **2117 — parte de la fuente no cabia en la semana del plan**. Un plan es SEMANAL y la fuente
12385
+ * no lo alarga, asi que 12 fotos con 6 huecos libres publican 6 y las demas se quedan fuera;
12386
+ * `data` trae `{source_items, capacity}`. Se dice mejor ANTES de crear el plan —los huecos son
12387
+ * los dias de publicacion por las cuentas— que despues de haberlo cobrado.
12388
+ * - **922 — una publicacion de una red que no publica sin imagen se quedo sin ella**: un pin cuya
12389
+ * imagen fallo a mitad de la generacion. El 2119 impide la configuracion que lo provoca, pero no
12390
+ * un fallo del proveedor. `data.id_publication` dice cual: no saldra hasta que tenga imagen.
11664
12391
  */
11665
12392
  type AiPlanNotice = Schemas["AiPlansAiPlanNotice"];
11666
12393
  /**
@@ -11673,6 +12400,35 @@ type AiPlanNotice = Schemas["AiPlansAiPlanNotice"];
11673
12400
  type AiPlanCostEstimate = Schemas["AiPlansAiPlanCostEstimate"];
11674
12401
  /** Lo que devuelve encolar un plan: el plan en `pending` y lo que se calculo que costaria. */
11675
12402
  type AiPlanCreateResult = Schemas["AiPlansAiPlanCreateResponse"];
12403
+ /**
12404
+ * Lo que rindio UN plan con lo que publico.
12405
+ *
12406
+ * **Las medias solo cuentan las publicaciones medidas** (`publications.measured`): una programada,
12407
+ * una fallida o una recien publicada que nadie ha medido no bajan nada, simplemente no estan.
12408
+ *
12409
+ * `engagement_per_publication` es la cifra por la que se ordena, y **solo compite el plan con
12410
+ * `ranked: true`** —al menos 3 publicaciones medidas, o todas si publico menos—. `maturing: true`
12411
+ * dice que sus numeros todavia se mueven: comparar ese plan con uno del mes pasado es injusto con el
12412
+ * nuevo. Y una metrica ausente en `metrics` es que ninguna publicacion del plan la da, no un cero.
12413
+ *
12414
+ * **Ser el primero no es ser bueno**, y para eso esta `engagement_vs_average`: la media del plan entre
12415
+ * lo que habrian sacado tus publicaciones habituales con sus mismas redes (1 = como tu media, 2 = el
12416
+ * doble). El ranking sigue ordenando por `engagement_per_publication`, asi que el primero puede estar
12417
+ * por debajo de 1 —un plan de LinkedIn saca menos por publicacion que uno de Instagram y aun asi puede
12418
+ * doblar lo suyo—.
12419
+ */
12420
+ type AiPlanResult = Schemas["AiPlanResult"];
12421
+ /**
12422
+ * El agregado de un conjunto de planes. `engagement_per_publication` es una media PONDERADA —todas
12423
+ * las interacciones entre todas las publicaciones medidas—, no la media de las medias.
12424
+ */
12425
+ type AiPlanResultsGroup = Schemas["AiPlanResultsGroup"];
12426
+ /** El agregado de los planes de UNA plantilla: la respuesta a «¿que tipo de plan me funciona?». */
12427
+ type AiPlanResultsTemplateGroup = Schemas["AiPlansAiPlanResultsTemplateGroup"];
12428
+ /** Lo que devuelve {@link AiPlansResource.results}: el total, el desglose por plantilla y la pagina. */
12429
+ type AiPlanResults = Schemas["AiPlansAiPlanResults"];
12430
+ /** Por que se pueden ordenar los resultados. Cada criterio lleva su direccion natural. */
12431
+ type AiPlanResultsSort = NonNullable<NonNullable<Operations["getAiPlanResultsService"]["parameters"]["query"]>["sort"]>;
11676
12432
  /** Una app de cliente: las credenciales con las que una integracion se autentica. */
11677
12433
  type ClientApp = Schemas["AppsClientApp"];
11678
12434
  /** Lo que se manda para crear o actualizar una app. Al actualizar, REEMPLAZA los cinco campos. */
@@ -11879,21 +12635,24 @@ declare class PlanVortexError extends Error {
11879
12635
  readonly retryAfter: number | undefined;
11880
12636
  constructor(code: number, message: string, options?: PlanVortexErrorOptions);
11881
12637
  }
11882
- /** 500-546 — tokens, apps de cliente, permisos. Incluye el 501 y el 522, los de token caducado. */
12638
+ /** 500-548 — tokens, apps de cliente, permisos. Incluye el 501 y el 522, los de token caducado. */
11883
12639
  declare class AuthError extends PlanVortexError {
11884
12640
  }
11885
12641
  /** 601-612 — el usuario final. */
11886
12642
  declare class UserError extends PlanVortexError {
11887
12643
  }
11888
- /** 700-715 — cuentas sociales: desconectada, sin permisos en la red, sin refrescar. */
12644
+ /** 700-716 — cuentas sociales: desconectada, sin permisos en la red, sin refrescar. */
11889
12645
  declare class AccountError extends PlanVortexError {
11890
12646
  }
11891
12647
  /** 800-810 — ficheros: formato no admitido, demasiado grande, conversión fallida. */
11892
12648
  declare class FileError extends PlanVortexError {
11893
12649
  }
11894
- /** 900-986 — publicaciones, incluidos los límites por red (caracteres, imágenes, duración), los
11895
- * dos frenos de ritmo —978 (demasiado rápido en esta cuenta) y 979 (tope diario de esa red)— y
11896
- * los de Slack (980-986), que empiezan por el más común: 980, la app no está en el canal. */
12650
+ /** 900-996 — publicaciones, incluidos los límites por red (caracteres, imágenes, duración), los
12651
+ * dos frenos de ritmo —978 (demasiado rápido en esta cuenta) y 979 (tope diario de esa red)—, los
12652
+ * de Slack (980-986), que empiezan por el más común: 980, la app no está en el canal, y los de
12653
+ * Pinterest (987-996), que empiezan igual: 987, la publicación no dice en qué tablero va. Y uno
12654
+ * de ellos no es un fallo: el 991 es Pinterest frenando a la aplicación, sale 429 con
12655
+ * `Retry-After` y la respuesta es esperar. */
11897
12656
  declare class PublicationError extends PlanVortexError {
11898
12657
  }
11899
12658
  /** 1100-1111 — organizaciones, y el token temporal atado a una sola de ellas (1101). */
@@ -12223,4 +12982,4 @@ interface PlanVortexWebhooksOptions {
12223
12982
  */
12224
12983
  declare function planvortexWebhooks(options: PlanVortexWebhooksOptions): (request: WebhookRequestLike, response: WebhookResponseLike, next: (error?: unknown) => void) => void;
12225
12984
 
12226
- export { type AiContext as $, type Account as A, type PlanUse as B, type ConnectLink as C, type Dashboard as D, type EnableResult as E, type IntegrationProvider as F, type Integration as G, type IntegrationConnectRequest as H, type IntegrationProviderName as I, type IntegrationUpdate as J, type IntegrationPickerConfig as K, type MessageTemplate as L, type MetricName as M, type Conversation as N, type ConversationTotals as O, type Paginated as P, type Message as Q, type MessageInput as R, type SocialNetwork as S, type TopPublicationsResult as T, type Client as U, type Organization as V, type AiSettings as W, type ClientWithOrganizations as X, type PlanData as Y, type PlanUseData as Z, type ConnectToken as _, type ConnectResult as a, type PlannerTemplateField as a$, type SocialCredentialsInput as a0, type Product as a1, type ProductInput as a2, type ProductCatalog as a3, type ProductCatalogInput as a4, type PublicationInput as a5, type PublicationState as a6, type PublicationStats as a7, type PublicationStatsHistory as a8, type Upload as a9, type EngagementBase as aA, FileError as aB, type FileFormat as aC, type FileProperties as aD, type FileType as aE, IntegrationError as aF, type IntegrationErrorChange as aG, type MessageChange as aH, type MessageOptions as aI, type MessageType as aJ, MessagingError as aK, type MetricRow as aL, NO_ERROR_CODE as aM, type components as aN, type operations as aO, type paths as aP, type webhooks as aQ, type OpenEnum as aR, OrganizationError as aS, PLANVORTEX_ERROR_RANGES as aT, PlanLimitError as aU, PlanVortexAuthenticationError as aV, PlanVortexConfigError as aW, PlanVortexConnectionError as aX, PlanVortexError as aY, type PlanVortexErrorOptions as aZ, type PlanVortexErrorRange as a_, AccountError as aa, type AccountMetricRow as ab, type AccountStateChange as ac, type AccountWebhookChangeBase as ad, type AccountWithError as ae, type AiPlanCostEstimate as af, AiPlanError as ag, type AiPlanNotice as ah, type AiPlanOptions as ai, type AiPlanOptionsInput as aj, type AiPlanSource as ak, type AiPlanSourceImageInput as al, type AiPlanSourceInput as am, type AiPlanSourceProduct as an, type AiPlanState as ao, type ApiErrorBody as ap, type AspectRatios as aq, AuthError as ar, type ClientPlan as as, type CommentAuthor as at, type CommentChange as au, type ContactChannel as av, ContactError as aw, type DashboardAiPlanRef as ax, type DashboardPublicationRef as ay, type DashboardRange as az, type AccountMetrics as b, type PlannerTemplateFieldType as b0, type PlannerTemplateName as b1, ProductError as b2, PublicationError as b3, type PublicationErrorDetail as b4, type PublicationMetrics as b5, type PublicationStatsPoint as b6, type PublicationType as b7, type PublicationsSummary as b8, type RssConfig as b9, type HandleWebhookRequestOptions as bA, type PlanVortexWebhooksOptions as bB, type RawWebhookBody as bC, type VerifyWebhookSignatureOptions as bD, WEBHOOK_EVENTS as bE, WEBHOOK_SIGNATURE_HEADERS as bF, WebhookBodyError as bG, type WebhookHeaders as bH, type WebhookRequestLike as bI, type WebhookResponseLike as bJ, WebhookSignatureError as bK, handleWebhookRequest as bL, isAccountStateChange as bM, isCommentChange as bN, isIntegrationErrorChange as bO, isMessageChange as bP, parseWebhookPayload as bQ, planvortexWebhooks as bR, verifyWebhookSignature as bS, type SocialAuthorizationMethod as ba, type SocialCredentials as bb, type SocialIdentifier as bc, type SocialIdentifierInput as bd, type SocialLimitsMap as be, TOKEN_ERROR_CODES as bf, type TopPublication as bg, type UnknownWebhookChange as bh, UserError as bi, type WebhookAlgorithm as bj, type WebhookChange as bk, type WebhookEvent as bl, type WithAccount as bm, type WithPublication as bn, account as bo, accountId as bp, errorFamilyForCode as bq, isPlanVortexError as br, isTokenError as bs, messageContact as bt, messageContactId as bu, messageDirection as bv, messageFileIds as bw, messageFiles as bx, publication as by, publicationId as bz, type PersistentMenu as c, type Publication as d, type AiPlanCreateRequest as e, type AiPlanCreateResult as f, type AiPlan as g, type ClientApp as h, type ClientAppInput as i, type SocialCapabilities as j, type CommentActions as k, type SocialLimits as l, type PublicationLimits as m, type AspectRatiosByNetwork as n, type PlannerTemplate as o, type CommentNetwork as p, type Comment as q, type CommentThread as r, type CommentReplyResult as s, type ContactExtraData as t, type Contact as u, type ContactCreate as v, type ContactUpdate as w, type DashboardMetricsResult as x, type PublicationsSummaryResult as y, type PublicationsStatsResult as z };
12985
+ export { type ClientWithOrganizations 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 MessageTemplate as R, type SocialNetwork as S, type TopPublicationsResult as T, type Conversation as U, type ConversationTotals as V, type Message as W, type MessageInput as X, type Client as Y, type Organization as Z, type AiSettings as _, type ConnectResult as a, PLANVORTEX_ERROR_RANGES as a$, type PlanData as a0, type PlanUseData as a1, type ConnectToken as a2, type AiContext as a3, type SocialCredentialsInput as a4, type Product as a5, type ProductInput as a6, type ProductCatalog as a7, type ProductCatalogInput as a8, type PublicationInput as a9, type ClientPlan as aA, type CommentAuthor as aB, type CommentChange as aC, type ContactChannel as aD, ContactError as aE, type DashboardAiPlanRef as aF, type DashboardPublicationRef as aG, type DashboardRange as aH, type EngagementBase as aI, FileError as aJ, type FileFormat as aK, type FileProperties as aL, type FileType as aM, IntegrationError as aN, type IntegrationErrorChange as aO, type MessageChange as aP, type MessageOptions as aQ, type MessageType as aR, MessagingError as aS, type MetricRow as aT, NO_ERROR_CODE as aU, type components as aV, type operations as aW, type paths as aX, type webhooks as aY, type OpenEnum as aZ, OrganizationError as a_, type PublicationState as aa, type PublicationStats as ab, type PublicationStatsHistory as ac, type Upload as ad, AccountError as ae, type AccountMetricRow as af, type AccountStateChange as ag, type AccountWebhookChangeBase as ah, type AccountWithError as ai, type AiPlanCostEstimate as aj, type AiPlanDestination as ak, AiPlanError as al, type AiPlanNotice as am, type AiPlanOptions as an, type AiPlanOptionsInput as ao, type AiPlanResult as ap, type AiPlanResultsGroup as aq, type AiPlanResultsTemplateGroup as ar, type AiPlanSource as as, type AiPlanSourceImageInput as at, type AiPlanSourceInput as au, type AiPlanSourceProduct as av, type AiPlanState as aw, type ApiErrorBody as ax, type AspectRatios as ay, AuthError as az, type AccountMetrics as b, PlanLimitError as b0, PlanVortexAuthenticationError as b1, PlanVortexConfigError as b2, PlanVortexConnectionError as b3, PlanVortexError as b4, type PlanVortexErrorOptions as b5, type PlanVortexErrorRange as b6, type PlannerTemplateField as b7, type PlannerTemplateFieldType as b8, ProductError as b9, isTokenError as bA, messageContact as bB, messageContactId as bC, messageDirection as bD, messageFileIds as bE, messageFiles as bF, publication as bG, publicationId as bH, type HandleWebhookRequestOptions as bI, type PlanVortexWebhooksOptions as bJ, type RawWebhookBody as bK, type VerifyWebhookSignatureOptions as bL, WEBHOOK_EVENTS as bM, WEBHOOK_SIGNATURE_HEADERS as bN, WebhookBodyError as bO, type WebhookHeaders as bP, type WebhookRequestLike as bQ, type WebhookResponseLike as bR, WebhookSignatureError as bS, handleWebhookRequest as bT, isAccountStateChange as bU, isCommentChange as bV, isIntegrationErrorChange as bW, isMessageChange as bX, parseWebhookPayload as bY, planvortexWebhooks as bZ, verifyWebhookSignature as b_, type PublicationDestination as ba, PublicationError as bb, type PublicationErrorDetail as bc, type PublicationMetrics as bd, type PublicationStatsPoint as be, type PublicationType as bf, type PublicationsSummary as bg, type RssConfig as bh, type SocialAuthorizationMethod as bi, type SocialCredentials as bj, type SocialIdentifier as bk, type SocialIdentifierInput as bl, type SocialLimitsMap as bm, TOKEN_ERROR_CODES as bn, type TopPublication as bo, type UnknownWebhookChange as bp, UserError as bq, type WebhookAlgorithm as br, type WebhookChange as bs, type WebhookEvent as bt, type WithAccount as bu, type WithPublication as bv, account as bw, accountId as bx, errorFamilyForCode as by, isPlanVortexError as bz, type PersistentMenu as c, 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 };