planvortex 0.0.1 → 0.2.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.
@@ -192,6 +192,8 @@ interface paths {
192
192
  /**
193
193
  * List the client's apps
194
194
  * @description The apps of a client. Secrets never travel here: to read one, ask for it explicitly with the `secret` endpoint.
195
+ *
196
+ * **Needs a USER token, not an app token.** With client credentials it answers `ERROR_CODE_512`. It also needs the **Custom plan** (`ERROR_CODE_542`): apps are what that plan adds, and they are the door to this whole API.
195
197
  */
196
198
  get: operations["getClientApps"];
197
199
  put?: never;
@@ -204,6 +206,10 @@ interface paths {
204
206
  * Every URL is validated: a bad entry in `allowed_domains` answers 531, in `redirect_urls` 532, and a bad `webhook_url` answers 535.
205
207
  *
206
208
  * **The secret is not in the response.** Read it with `GET /clients/{id_client}/apps/{id_app}/secret`.
209
+ *
210
+ * **A client can only have ONE app.** Creating a second one is rejected with `ERROR_CODE_536`: delete or update the one that exists. The listing is paginated because every listing in this API is, not because there can be more than one.
211
+ *
212
+ * **Needs a USER token, not an app token.** With client credentials it answers `ERROR_CODE_512`. It also needs the **Custom plan** (`ERROR_CODE_542`): apps are what that plan adds, and they are the door to this whole API.
207
213
  */
208
214
  post: operations["createClientApp"];
209
215
  delete?: never;
@@ -222,6 +228,8 @@ interface paths {
222
228
  /**
223
229
  * Get one app
224
230
  * @description The app's record, without its secret. Note the envelope: `{client_app}` here, `{client_apps, total}` in the list.
231
+ *
232
+ * **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. The **Custom plan** is still required (`ERROR_CODE_542`).
225
233
  */
226
234
  get: operations["getClientApp"];
227
235
  /**
@@ -229,12 +237,18 @@ interface paths {
229
237
  * @description Replaces the app's configuration. **Every field is overwritten with what you send**, so a `redirect_urls` you leave out becomes an empty list — send the whole object, not a patch.
230
238
  *
231
239
  * Changing `webhook_url` takes effect on the next event; there is no verification handshake.
240
+ *
241
+ * **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
+ *
243
+ * **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. The **Custom plan** is still required (`ERROR_CODE_542`).
232
244
  */
233
245
  put: operations["updateClientApp"];
234
246
  post?: never;
235
247
  /**
236
248
  * Delete an app
237
249
  * @description Revokes the credentials and marks the app as deleted. **Tokens already issued stop working**: the token endpoint checks that the app still exists before answering, and requests carrying an old token no longer resolve to an app.
250
+ *
251
+ * **Needs a USER token, not an app token.** With client credentials it answers `ERROR_CODE_512`. It also needs the **Custom plan** (`ERROR_CODE_542`): apps are what that plan adds, and they are the door to this whole API.
238
252
  */
239
253
  delete: operations["deleteClientApp"];
240
254
  options?: never;
@@ -254,6 +268,10 @@ interface paths {
254
268
  * @description Returns the `client_secret` in clear. It is a separate endpoint precisely so that the secret never travels inside a listing that gets logged, cached or drawn on a screen by accident.
255
269
  *
256
270
  * The same secret is what signs the outgoing webhooks (`x-hub-signature`, `x-hub-signature-256`).
271
+ *
272
+ * **Needs a USER token, not an app token.** With client credentials it answers `ERROR_CODE_512`. It also needs the **Custom plan** (`ERROR_CODE_542`): apps are what that plan adds, and they are the door to this whole API.
273
+ *
274
+ * It comes straight from Keycloak, so it is the live secret and not a copy: treat the response as a credential and never log it.
257
275
  */
258
276
  get: operations["getClientAppSecret"];
259
277
  put?: never;
@@ -322,6 +340,10 @@ interface paths {
322
340
  /**
323
341
  * List AI publication plans
324
342
  * @description Return the organization's AI plans ordered by creation date (desc), paginated. Requires the ai_plans:read permission.
343
+ *
344
+ * **Cancelled plans are not listed.** Deleting a plan sets it to `cancelled` rather than removing it, and this listing filters those out — so a plan you deleted simply stops appearing, while `GET` by id still returns it.
345
+ *
346
+ * Without `limit` the whole list comes back.
325
347
  */
326
348
  get: operations["getAiPlans"];
327
349
  put?: never;
@@ -676,6 +698,8 @@ interface paths {
676
698
  * **It answers 200 even when it fails.** The result carries `errorCode` and `errorMsg` instead of an error body, because the browser lands here from a redirect and a raw 400 would be a broken page. Check `errorCode`: empty means everything went well.
677
699
  *
678
700
  * **An app cannot call this** — it needs a user token or a temporal connect token (error 519 otherwise). See `GET /organizations/{id_organization}/temporal_connect_token`.
701
+ *
702
+ * **A temporal connect token is spent here.** Once this call succeeds, that token cannot connect anything else and answers error 543; the `enable` calls that finish the same connection still work until it expires. And if the token was issued for one network, calling this for another answers error 544.
679
703
  */
680
704
  get: operations["connectAccount"];
681
705
  put?: never;
@@ -840,6 +864,8 @@ interface paths {
840
864
  * @description The templates the **network** has approved for this account. They are read live from the network, not from our database, so a template approved a minute ago shows up here.
841
865
  *
842
866
  * The shape of a template is the network's own: PlanVortex does not normalise it.
867
+ *
868
+ * **WhatsApp only.** No other network implements message templates: asking any of them returns HTTP 500 with `code: 500` (an unhandled server error), not the 1502 you would expect. Check `messages` in `GET /social_capabilities` and that the account is WhatsApp before calling.
843
869
  */
844
870
  get: operations["getMessageTemplates"];
845
871
  put?: never;
@@ -848,11 +874,15 @@ interface paths {
848
874
  * @description Sends a template to the network for approval. The body travels to the network as it is, so its fields are the network's (for WhatsApp: `name`, `language`, `category`, `components`).
849
875
  *
850
876
  * **Approval is not immediate.** The template comes back in a pending state and only becomes usable when the network approves it, which takes minutes or hours and can be refused.
877
+ *
878
+ * **WhatsApp only.** No other network implements message templates: asking any of them returns HTTP 500 with `code: 500` (an unhandled server error), not the 1502 you would expect. Check `messages` in `GET /social_capabilities` and that the account is WhatsApp before calling.
851
879
  */
852
880
  post: operations["createMessageTemplate"];
853
881
  /**
854
882
  * Delete a message template
855
883
  * @description Deletes the template on the network. **The template is identified by query parameters, not by a path segment**, and WhatsApp needs both the id and the name.
884
+ *
885
+ * **WhatsApp only.** No other network implements message templates: asking any of them returns HTTP 500 with `code: 500` (an unhandled server error), not the 1502 you would expect. Check `messages` in `GET /social_capabilities` and that the account is WhatsApp before calling.
856
886
  */
857
887
  delete: operations["deleteMessageTemplate"];
858
888
  options?: never;
@@ -992,6 +1022,8 @@ interface paths {
992
1022
  /**
993
1023
  * List products
994
1024
  * @description The products of a catalogue, or a single product when `product_id` is sent. As with the catalogues, `total` counts the page.
1025
+ *
1026
+ * **Facebook and Instagram only.** They are the only two networks with `products: true` in `GET /social_capabilities`; WhatsApp does not have it either, despite its own catalogue. Everything here speaks Meta Commerce, with Meta's own field names.
995
1027
  */
996
1028
  get: operations["getProducts"];
997
1029
  put?: never;
@@ -1000,6 +1032,8 @@ interface paths {
1000
1032
  * @description **One endpoint does both.** Send `id` in the body and the existing product is updated; leave it out and a new product is created inside `product_catalog_id`.
1001
1033
  *
1002
1034
  * `product_catalog_id` travels as a **query parameter** and is required when creating. Without it the call answers error 2000.
1035
+ *
1036
+ * **Facebook and Instagram only.** They are the only two networks with `products: true` in `GET /social_capabilities`; WhatsApp does not have it either, despite its own catalogue. Everything here speaks Meta Commerce, with Meta's own field names.
1003
1037
  */
1004
1038
  post: operations["createProduct"];
1005
1039
  delete?: never;
@@ -1020,6 +1054,8 @@ interface paths {
1020
1054
  * @description The catalogues owned by the business behind this account.
1021
1055
  *
1022
1056
  * **`total` is the size of the page, not of the collection.** Meta paginates with cursors and does not return a count, so there is nothing better to report: keep asking with a larger `offset` until a page comes back short.
1057
+ *
1058
+ * **Facebook and Instagram only.** They are the only two networks with `products: true` in `GET /social_capabilities`; WhatsApp does not have it either, despite its own catalogue. Everything here speaks Meta Commerce, with Meta's own field names.
1023
1059
  */
1024
1060
  get: operations["getProductCatalogs"];
1025
1061
  put?: never;
@@ -1028,6 +1064,8 @@ interface paths {
1028
1064
  * @description Creates a catalogue under the business behind this account. Only `name` is required.
1029
1065
  *
1030
1066
  * **The answer carries the identifier, not the object**, even though the field is called `product_catalog`. Read the list back if you need the full catalogue.
1067
+ *
1068
+ * **Facebook and Instagram only.** They are the only two networks with `products: true` in `GET /social_capabilities`; WhatsApp does not have it either, despite its own catalogue. Everything here speaks Meta Commerce, with Meta's own field names.
1031
1069
  */
1032
1070
  post: operations["createProductCatalog"];
1033
1071
  delete?: never;
@@ -1261,6 +1299,8 @@ interface paths {
1261
1299
  * **A network that cannot produce a link simply does not appear.** That is a legitimate answer, not a failure: it is what happens with `discord` in an organization that has not saved its own bot credentials yet (see `PUT /organizations/{id_organization}/social_credentials/{social_network}`).
1262
1300
  *
1263
1301
  * **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.
1302
+ *
1303
+ * **Read `authorization`, not `link`.** Nine of the ten networks are `redirect` and you send the person to `link`. **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.
1264
1304
  */
1265
1305
  get: operations["getConnectLinks"];
1266
1306
  put?: never;
@@ -1684,7 +1724,9 @@ interface paths {
1684
1724
  };
1685
1725
  /**
1686
1726
  * Retrieve publication by identifier
1687
- * @description Retrieve publication by identifier
1727
+ * @description Retrieve publication by identifier.
1728
+ *
1729
+ * A **deleted** publication answers error 917, the same as one that never existed: the delete is soft on our side, but it is a delete for the API.
1688
1730
  */
1689
1731
  get: operations["getPublication"];
1690
1732
  /**
@@ -1695,7 +1737,7 @@ interface paths {
1695
1737
  post?: never;
1696
1738
  /**
1697
1739
  * Delete publication by identifier
1698
- * @description Delete publication by identifier. For an already-sent X (Twitter) publication, removing the tweet on X is a paid action that consumes 15 X credits; it is only removed on X when there are enough credits. Returns error 940 when the X credit pool is exhausted.
1740
+ * @description Delete publication by identifier. It stops being readable by identifier afterwards, so deleting twice answers error 917. For an already-sent X (Twitter) publication, removing the tweet on X is a paid action that consumes 15 X credits; it is only removed on X when there are enough credits. Returns error 940 when the X credit pool is exhausted.
1699
1741
  */
1700
1742
  delete: operations["deletePublication"];
1701
1743
  options?: never;
@@ -1990,13 +2032,17 @@ interface paths {
1990
2032
  *
1991
2033
  * It exists because **an app cannot connect accounts**: `connect_links` and `account-connect` refuse app credentials with error 519, since authorizing Instagram is an OAuth flow with a human in front of it. The shape of the integration is therefore:
1992
2034
  *
1993
- * 1. Your server asks for this token — **this endpoint is the one that requires app credentials**, and a user token is refused.
2035
+ * 1. Your server asks for this token — **this endpoint is the one that requires app credentials**, and a user token is refused. So is a temporal connect token: it cannot renew itself, which is what keeps its life a real limit rather than the first link of a chain.
1994
2036
  * 2. You send your end user to the `url` that comes back, by redirect or in an iframe. The bare
1995
2037
  * `token` comes back too, so a server-side client can authenticate with it directly instead of
1996
2038
  * parsing it out of that URL.
1997
2039
  * 3. With that token the browser completes `connect_links` and `account-connect`.
1998
2040
  *
1999
- * The token lasts **one hour**, is tied to **this** organization — using it against another answers error 1101 — and carries only two permissions: create accounts and read the organization. It is the piece designed for a browser, and the only credential of ours that belongs there.
2041
+ * The token lasts **fifteen minutes**, is tied to **this** organization — using it against another answers error 1101 — and carries only two permissions: create accounts and read the organization. It is the piece designed for a browser, and the only credential of ours that belongs there.
2042
+ *
2043
+ * **It connects once.** As soon as an `account-connect` succeeds, the token stops being able to connect anything else and answers error 543; the `enable` calls that finish that same connection keep working until it expires. Issue a new one per connection — they are free and immediate.
2044
+ *
2045
+ * **If you pass `social_network`, the token is bound to that network** and will not connect any other (error 544). Leave it out to let the person pick.
2000
2046
  *
2001
2047
  * If you send `redirect_uri` it has to be one of the app's `redirect_urls`, or the call answers error 532.
2002
2048
  */
@@ -2433,10 +2479,35 @@ interface components {
2433
2479
  /** @description `default`, or a locale such as `es_ES`. */
2434
2480
  locale?: string;
2435
2481
  }[];
2482
+ /**
2483
+ * @description **How** an account of this network is authorized, which is not always "send the user to this URL".
2484
+ *
2485
+ * Nine of the ten networks are `redirect`: open `link` and the network sends the person back to PlanVortex with a code. **WhatsApp is not.** 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.
2486
+ *
2487
+ * Branch on `authorization.type`, never on whether `link` is empty.
2488
+ */
2489
+ AccountsSocialAuthorizationMethod: {
2490
+ /** @description `meta_embedded_signup` only. Goes to `FB.init({appId})`. It is the same Meta app whose secret PlanVortex uses to exchange the code afterwards. */
2491
+ app_id?: string;
2492
+ /** @description `meta_embedded_signup` only. Goes to `FB.login(cb, {config_id})` — the Embedded Signup configuration. */
2493
+ config_id?: string;
2494
+ /** @description `meta_embedded_signup` only. Goes to `extras.featureType`. */
2495
+ feature_type?: string;
2496
+ /** @description `meta_embedded_signup` only. Goes to `FB.init({version})`. This is the JavaScript SDK version, not the Graph version PlanVortex calls server-side: they move independently. */
2497
+ graph_version?: string;
2498
+ /** @description `meta_embedded_signup` only. Goes to `extras.sessionInfoVersion`. */
2499
+ session_info_version?: string;
2500
+ /**
2501
+ * @description `redirect`: send the user to `link`. `meta_embedded_signup`: open the Meta popup with the fields below.
2502
+ * @enum {string}
2503
+ */
2504
+ type: "redirect" | "meta_embedded_signup";
2505
+ };
2436
2506
  AccountsSocialLinksList: {
2437
2507
  /** @description One entry per network that can be connected right now. */
2438
2508
  links: {
2439
- /** @description The network's authorization URL. Send the user there. */
2509
+ authorization: components["schemas"]["AccountsSocialAuthorizationMethod"];
2510
+ /** @description The network's authorization URL. Send the user there. **Empty when `authorization.type` is not `redirect`** — WhatsApp has no URL to give. */
2440
2511
  link: string;
2441
2512
  social_network: components["schemas"]["SocialNetwork"];
2442
2513
  }[];
@@ -2469,66 +2540,78 @@ interface components {
2469
2540
  };
2470
2541
  AiPlansAiPlan: {
2471
2542
  /** @example 66d04a6a427f4c43b9d97f54 */
2472
- _id?: string;
2543
+ _id: string;
2473
2544
  /** @description Accounts the plan was generated for. */
2474
- accounts?: string[];
2545
+ accounts: string[];
2475
2546
  /** @description Generation attempts consumed (transient failures are retried, max 2). */
2476
- attempts?: number;
2547
+ attempts: number;
2477
2548
  /** Format: date-time */
2478
- creation_date?: string;
2549
+ creation_date: string;
2479
2550
  /** @description AI credits actually consumed by the generation. */
2480
- credits_spent?: number;
2481
- /** @description Last generation error (PublicationError pattern), if any. */
2482
- error?: Record<string, never>;
2551
+ credits_spent: number;
2552
+ /** @description Last generation error, in the same shape as an API error. Present only in state `failed`. */
2553
+ error?: {
2554
+ code: number;
2555
+ data?: {
2556
+ [key: string]: unknown;
2557
+ };
2558
+ message: string;
2559
+ };
2483
2560
  /** Format: date-time */
2484
2561
  generation_end_date?: string;
2485
- id_client?: string;
2486
- id_organization?: string;
2562
+ id_client: string;
2563
+ id_organization: string;
2487
2564
  /** @description User who requested the generation. */
2488
2565
  keycloak_identifier?: string;
2489
- options?: components["schemas"]["AiPlansAiPlanOptions"];
2566
+ options: components["schemas"]["AiPlansAiPlanOptions"];
2490
2567
  /** @description Raw plan returned by the orchestrator, kept for audit (before validation/trimming). */
2491
2568
  orchestrator_result?: Record<string, never>;
2492
- prompt?: string;
2493
- /** @description Generated publications (normal drafts of the publication domain, populated on GET/validate). */
2494
- publications?: Record<string, never>[];
2569
+ /** @description SNAPSHOT of the organization's brand context taken when the plan was created, so a retry or a regeneration reproduces the same plan even if the configuration changed. Absent when the plan was asked for without context, or when the organization had none. */
2570
+ organization_context?: components["schemas"]["AiContext"];
2571
+ prompt: string;
2572
+ /**
2573
+ * @description The generated publications — ordinary drafts of the publication domain.
2574
+ *
2575
+ * **It is not always the same shape.** Reading one plan (`GET`, `validate`, `retry`) returns whole publications with their files resolved; the LISTING returns their identifiers as strings. Check before using them.
2576
+ */
2577
+ publications: (string | components["schemas"]["Publication"])[];
2495
2578
  /**
2496
2579
  * @description State machine: pending -> generating -> generated -> validated | failed | cancelled. Poll the plan while state is pending or generating.
2497
2580
  * @enum {string}
2498
2581
  */
2499
- state?: "pending" | "generating" | "generated" | "validated" | "failed" | "cancelled";
2582
+ state: "pending" | "generating" | "generated" | "validated" | "failed" | "cancelled";
2500
2583
  };
2501
2584
  /** @description Deterministic cost estimate computed by the backend (never by the model). BYOK scopes cost 0 credits. */
2502
2585
  AiPlansAiPlanCostEstimate: {
2503
- available_credits?: number;
2586
+ available_credits: number;
2504
2587
  /** @description Mandatory cost (orchestration + target texts). The plan is rejected if this exceeds the available credits. */
2505
- base_cost?: number;
2588
+ base_cost: number;
2506
2589
  /** @description Total estimated cost including the financeable images (upper bound). */
2507
- estimated_cost?: number;
2508
- images_target?: number;
2509
- texts_target?: number;
2590
+ estimated_cost: number;
2591
+ images_target: number;
2592
+ texts_target: number;
2510
2593
  };
2511
2594
  AiPlansAiPlanCreateRequest: {
2512
2595
  /** @description Account ids (belonging to the organization) to generate the plan for. */
2513
2596
  accounts: string[];
2514
- options?: components["schemas"]["AiPlansAiPlanOptions"];
2597
+ options?: components["schemas"]["AiPlansAiPlanOptionsInput"];
2515
2598
  /** @description Theme prompt written by the user. */
2516
2599
  prompt: string;
2517
2600
  };
2518
2601
  AiPlansAiPlanCreateResponse: {
2519
- ai_plan?: components["schemas"]["AiPlansAiPlan"];
2520
- estimate?: components["schemas"]["AiPlansAiPlanCostEstimate"];
2602
+ ai_plan: components["schemas"]["AiPlansAiPlan"];
2603
+ estimate: components["schemas"]["AiPlansAiPlanCostEstimate"];
2521
2604
  /** @description Shortcut to estimate.estimated_cost. */
2522
- estimated_cost?: number;
2605
+ estimated_cost: number;
2523
2606
  };
2524
2607
  AiPlansAiPlanList: {
2525
- ai_plans?: components["schemas"]["AiPlansAiPlan"][];
2526
- total?: number;
2608
+ ai_plans: components["schemas"]["AiPlansAiPlan"][];
2609
+ total: number;
2527
2610
  };
2528
2611
  AiPlansAiPlanOne: {
2529
- ai_plan?: components["schemas"]["AiPlansAiPlan"];
2612
+ ai_plan: components["schemas"]["AiPlansAiPlan"];
2530
2613
  };
2531
- /** @description Generation options. Optimal publish slots are chosen deterministically by the backend from a fixed table per network, converted to this timezone; the model never invents times. */
2614
+ /** @description Generation options as they were STORED, already normalised: `publish_days` comes sorted and deduplicated, and every default has been resolved. */
2532
2615
  AiPlansAiPlanOptions: {
2533
2616
  /**
2534
2617
  * @description Whether images may be generated. Each image costs 70 AI credits.
@@ -2536,7 +2619,7 @@ interface components {
2536
2619
  */
2537
2620
  allow_images: boolean;
2538
2621
  /** @description Upload ids from the organization's gallery used as visual reference for the generated images. */
2539
- gallery_uploads?: string[];
2622
+ gallery_uploads: string[];
2540
2623
  /**
2541
2624
  * @description Language of the generated texts.
2542
2625
  * @default es
@@ -2557,6 +2640,11 @@ interface components {
2557
2640
  * ]
2558
2641
  */
2559
2642
  publish_days: number[];
2643
+ /**
2644
+ * @description Generate ONE piece of content per day and replicate it across every account, each scheduled at the best hour for ITS network, instead of one publication per account and day. Cheaper — one text and one image per day — and it caps images at 7.
2645
+ * @default false
2646
+ */
2647
+ shared: boolean;
2560
2648
  /**
2561
2649
  * @description IANA timezone for the optimal publish slots (typically the user's browser timezone). publish_date is stored in UTC.
2562
2650
  * @default Europe/Madrid
@@ -2564,24 +2652,64 @@ interface components {
2564
2652
  timezone: string;
2565
2653
  /** @description Optional tone (e.g. 'cercano', 'profesional') passed to the prompt. */
2566
2654
  tone?: string;
2655
+ /**
2656
+ * @description Use the organization's brand context in the prompts. It is copied into the plan as a SNAPSHOT when the plan is created, so a retry or a regeneration uses the context the plan was asked with even if the configuration changed meanwhile.
2657
+ * @default true
2658
+ */
2659
+ use_organization_context: boolean;
2660
+ /**
2661
+ * Format: date-time
2662
+ * @description Start of the week to plan (slots are generated between this date and +7 days). Defaults to now.
2663
+ */
2664
+ week_start: string;
2665
+ };
2666
+ /** @description Generation options, as you SEND them: every one is optional and the server fills in its default. Optimal publish slots are chosen deterministically by the backend from a fixed table per network, converted to this timezone; the model never invents times. */
2667
+ AiPlansAiPlanOptionsInput: {
2668
+ /** @description Whether images may be generated. Each image costs 70 AI credits. Optional; defaults to `true`. */
2669
+ allow_images?: boolean;
2670
+ /** @description Upload ids from the organization's gallery used as visual reference for the generated images. */
2671
+ gallery_uploads?: string[];
2672
+ /** @description Language of the generated texts. Optional; defaults to `"es"`. */
2673
+ language?: string;
2674
+ /** @description Optional cap on the number of images; the credit budget may reduce it further. */
2675
+ max_images?: number;
2676
+ /** @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]`. */
2677
+ publish_days?: number[];
2678
+ /** @description Generate ONE piece of content per day and replicate it across every account, each scheduled at the best hour for ITS network, instead of one publication per account and day. Cheaper — one text and one image per day — and it caps images at 7. Optional; defaults to `false`. */
2679
+ shared?: boolean;
2680
+ /** @description IANA timezone for the optimal publish slots (typically the user's browser timezone). publish_date is stored in UTC. Optional; defaults to `"Europe/Madrid"`. */
2681
+ timezone?: string;
2682
+ /** @description Optional tone (e.g. 'cercano', 'profesional') passed to the prompt. */
2683
+ tone?: string;
2684
+ /** @description Use the organization's brand context in the prompts. It is copied into the plan as a SNAPSHOT when the plan is created, so a retry or a regeneration uses the context the plan was asked with even if the configuration changed meanwhile. Optional; defaults to `true`. */
2685
+ use_organization_context?: boolean;
2567
2686
  /**
2568
2687
  * Format: date-time
2569
2688
  * @description Start of the week to plan (slots are generated between this date and +7 days). Defaults to now.
2570
2689
  */
2571
2690
  week_start?: string;
2572
2691
  };
2692
+ /**
2693
+ * @description An app: the credentials a third-party integration authenticates with.
2694
+ *
2695
+ * **The secret is not here.** It lives in Keycloak and is read with `GET /clients/{id_client}/apps/{id_app}/secret`, which needs a user token.
2696
+ */
2573
2697
  AppsClientApp: {
2574
- _id?: string;
2575
- allowed_domains?: string[];
2698
+ _id: string;
2699
+ allowed_domains: string[];
2576
2700
  /** Format: date-time */
2577
- creation_date?: string;
2578
- id_client?: string;
2701
+ creation_date: string;
2702
+ /** @description Deleting an app marks it instead of removing it — the Keycloak client is gone, so it can no longer get a token — and the listing filters those out. */
2703
+ deleted: boolean;
2704
+ /** Format: date-time */
2705
+ deleted_date?: string;
2706
+ id_client: string;
2579
2707
  /** @description The user who created the app, when it was created from the panel. */
2580
2708
  id_user?: string;
2581
2709
  /** @description The app's `client_id`. */
2582
- keycloak_client_idenfifier?: string;
2583
- name?: string;
2584
- redirect_urls?: string[];
2710
+ keycloak_client_idenfifier: string;
2711
+ name: string;
2712
+ redirect_urls: string[];
2585
2713
  /**
2586
2714
  * @description Where PlanVortex posts events, when one is configured.
2587
2715
  *
@@ -2606,7 +2734,7 @@ interface components {
2606
2734
  /** @description The error shape of the token endpoint, and **only** of the token endpoint. Every other endpoint in the API answers with `Error` instead. */
2607
2735
  AppsOAuthError: {
2608
2736
  /** @enum {string} */
2609
- error?: "invalid_request" | "invalid_client" | "unsupported_grant_type" | "slow_down" | "server_error";
2737
+ error: "invalid_request" | "invalid_client" | "unsupported_grant_type" | "slow_down" | "server_error";
2610
2738
  error_description?: string;
2611
2739
  };
2612
2740
  AppsTokenRequest: {
@@ -2624,12 +2752,12 @@ interface components {
2624
2752
  };
2625
2753
  AppsTokenResponse: {
2626
2754
  /** @description Send it as `Authorization: Bearer <access_token>`. */
2627
- access_token?: string;
2755
+ access_token: string;
2628
2756
  /** @description Seconds the token is valid for. Refresh shortly before it runs out; there is no refresh token. */
2629
- expires_in?: number;
2757
+ expires_in: number;
2630
2758
  scope?: string;
2631
2759
  /** @description Always `Bearer`. */
2632
- token_type?: string;
2760
+ token_type: string;
2633
2761
  };
2634
2762
  /** @description Accepted crops. `values` and `text` are parallel arrays: same index, same ratio. */
2635
2763
  CatalogAspectRatios: {
@@ -2665,18 +2793,21 @@ interface components {
2665
2793
  /** @description Read-only. True when an encrypted API key is stored for this scope. */
2666
2794
  readonly has_api_key?: boolean;
2667
2795
  /** @description Model identifier at the chosen provider (e.g. google/gemini-3-flash). */
2668
- model?: string;
2796
+ model: string;
2669
2797
  /**
2670
2798
  * @description Fixed catalogue of allowed providers. The provider must support the capability of the scope (text for orchestrator/text, image for image).
2671
2799
  * @enum {string}
2672
2800
  */
2673
- provider?: "openrouter" | "openai" | "google" | "anthropic";
2801
+ provider: "openrouter" | "openai" | "google" | "anthropic";
2674
2802
  };
2675
- /** @description Per-scope AI provider configuration (BYOK). Each key is an AI scope; a scope set to null clears its configuration. Scopes: orchestrator and text require a text-capable provider; image requires an image-capable provider; video is reserved for Fase 2. */
2803
+ /** @description Per-scope AI provider configuration (BYOK). Only the scopes you send are touched; a scope set to `null` clears its configuration and returns that scope to PlanVortex credits. `orchestrator` and `text` need a text-capable provider, `image` needs an image-capable one. `video` is reserved for a later phase. */
2676
2804
  ClientsAiSettings: {
2677
- image?: components["schemas"]["ClientsAiScopeSetting"];
2678
- orchestrator?: components["schemas"]["ClientsAiScopeSetting"];
2679
- text?: components["schemas"]["ClientsAiScopeSetting"];
2805
+ /** @description Configuration of the `image` scope. **`null` clears it** and returns the scope to PlanVortex credits. */
2806
+ image?: components["schemas"]["ClientsAiScopeSetting"] | null;
2807
+ /** @description Configuration of the `orchestrator` scope. **`null` clears it** and returns the scope to PlanVortex credits. */
2808
+ orchestrator?: components["schemas"]["ClientsAiScopeSetting"] | null;
2809
+ /** @description Configuration of the `text` scope. **`null` clears it** and returns the scope to PlanVortex credits. */
2810
+ text?: components["schemas"]["ClientsAiScopeSetting"] | null;
2680
2811
  };
2681
2812
  /** @description Who contracts the plan and whom the organizations hang from. */
2682
2813
  ClientsClient: {
@@ -2788,33 +2919,41 @@ interface components {
2788
2919
  };
2789
2920
  /** @description A comment — or a review — as PlanVortex stores it. Remember it is a **snapshot** of what the network said at `collected_date`; the live thread endpoints return the same shape reconciled against the network. */
2790
2921
  CommentsComment: {
2791
- _id?: string;
2792
- author?: components["schemas"]["CommentsCommentAuthor"];
2922
+ _id: string;
2923
+ author: components["schemas"]["CommentsCommentAuthor"];
2793
2924
  /**
2794
2925
  * Format: date-time
2795
2926
  * @description When PlanVortex last read it. The inbox is a photograph and this says how old it is.
2796
2927
  */
2797
- collected_date?: string;
2928
+ collected_date: string;
2798
2929
  /**
2799
2930
  * Format: date-time
2800
2931
  * @description When it was written **on the network**. This is what orders the inbox.
2801
2932
  */
2802
- creation_date?: string;
2933
+ creation_date: string;
2803
2934
  /** @description Gone from the network. The row is kept so it is not created again by the next read or by a repeated webhook; it stops appearing in the inbox. */
2804
- deleted?: boolean;
2935
+ deleted: boolean;
2805
2936
  /**
2806
2937
  * @description The comment's id on the network. Unique per account, and what makes repeated webhook deliveries idempotent.
2807
2938
  *
2808
2939
  * One exception worth knowing: a Google Business reply has no id of its own — it is a *field* of the review — so PlanVortex fabricates a stable one, `{reviewId}/reply`.
2809
2940
  */
2810
- external_id?: string;
2941
+ external_id: string;
2811
2942
  /** @description Hidden on the network. A hidden comment is never swept as deleted: on YouTube, hiding one makes the API stop returning it forever, and without that exception hiding would be indistinguishable from deleting. */
2812
- hidden?: boolean;
2813
- /** @description The connected account it arrived on. Populated with the whole account object in the inbox listing. */
2814
- id_account?: string;
2815
- id_organization?: string;
2816
- /** @description **Your** publication, when there is one — and there often is not: a video uploaded to the channel by hand, a post that predates PlanVortex, and every Google Business review have comments with no publication of ours behind them. What always identifies the target is `publication_external_id`. */
2817
- id_publication?: string;
2943
+ hidden: boolean;
2944
+ /**
2945
+ * @description The connected account it arrived on.
2946
+ *
2947
+ * **It is not always the same shape.** The inbox listing (`GET /organizations/{id}/comments`) returns the whole account resolved; every other operation — the live threads, the reply, the update — returns its identifier as a string. Check before using it.
2948
+ */
2949
+ id_account: string | components["schemas"]["Account"];
2950
+ id_organization: string;
2951
+ /**
2952
+ * @description **Your** publication, when there is one — and there often is not: a video uploaded to the channel by hand, a post that predates PlanVortex, and every Google Business review have comments with no publication of ours behind them. What always identifies the target is `publication_external_id`.
2953
+ *
2954
+ * Same asymmetry as `id_account`: the inbox listing resolves it into the whole publication, every other operation returns the identifier as a string.
2955
+ */
2956
+ id_publication?: string | components["schemas"]["Publication"];
2818
2957
  /** @description Absent when the network does not publish it — not zero */
2819
2958
  like_count?: number;
2820
2959
  /** @description The network id of your reply, so you can find it or delete it later */
@@ -2822,7 +2961,7 @@ interface components {
2822
2961
  /** @description Present only when this is a reply to another comment */
2823
2962
  parent_external_id?: string;
2824
2963
  /** @description What the comment hangs off, on the network: the post/video id in five networks, and the **listing** (`locations/{id}`) for a Google Business review. */
2825
- publication_external_id?: string;
2964
+ publication_external_id: string;
2826
2965
  /**
2827
2966
  * @description Star rating of a **review**. Present only on review networks — today Google Business. Its absence means "this network has no such thing", never zero.
2828
2967
  *
@@ -2830,14 +2969,14 @@ interface components {
2830
2969
  */
2831
2970
  rating?: number;
2832
2971
  /** @description Yours, not the network's. A live read never overwrites it. */
2833
- read?: boolean;
2972
+ read: boolean;
2834
2973
  /** @description Yours, not the network's. Set when you reply through the API. */
2835
- replied?: boolean;
2974
+ replied: boolean;
2836
2975
  /** @description Absent when the network does not publish it — not zero */
2837
2976
  reply_count?: number;
2838
- social_network?: components["schemas"]["CommentsCommentNetworkName"];
2977
+ social_network: components["schemas"]["CommentsCommentNetworkName"];
2839
2978
  /** @description **May legitimately be empty.** A stars-only review carries no text at all, so render `rating` alongside it and never assume a blank comment is a loading failure. */
2840
- text?: string;
2979
+ text: string;
2841
2980
  };
2842
2981
  /** @description What one network lets you do to a comment. Four booleans and never fewer: an absent key would be indistinguishable from an oversight. */
2843
2982
  CommentsCommentActions: {
@@ -2851,9 +2990,9 @@ interface components {
2851
2990
  /** @description Who wrote it. Embedded in the comment and **not** a contact: a YouTube commenter has no private inbox you could ever write to, so they get no contact record. */
2852
2991
  CommentsCommentAuthor: {
2853
2992
  /** @description The author's id on the network. When the network gives none — Google Business publishes no identifier for a reviewer — this falls back to the review's own id, which means two reviews by the same person look like two different authors. There is no way around it from the API. */
2854
- external_id?: string;
2993
+ external_id: string;
2855
2994
  /** @description Whether the connected account wrote it. This is what separates "delete mine" from "delete theirs", and what keeps your own replies out of the inbox. */
2856
- is_own?: boolean;
2995
+ is_own: boolean;
2857
2996
  /** @description Display name. Always present for a review, including anonymous ones, which get a placeholder rather than an empty string. */
2858
2997
  name?: string;
2859
2998
  profile_pic?: string;
@@ -2865,13 +3004,13 @@ interface components {
2865
3004
  CommentsCommentNetworkName: "facebook" | "instagram" | "twitter" | "linkedin" | "youtube" | "google_business" | "bluesky" | "discord";
2866
3005
  /** @description A live read: asked of the network and reconciled with what was stored. */
2867
3006
  CommentsCommentThread: {
2868
- comments?: components["schemas"]["CommentsComment"][];
3007
+ comments: components["schemas"]["CommentsComment"][];
2869
3008
  /** @description X credits this read spent from the client's monthly pool. `0` on every other network. Charged after the fact and by real units, so a failed read charges nothing. */
2870
- credits_consumed?: number;
3009
+ credits_consumed: number;
2871
3010
  /** @description Opaque page token from the network. Pass it back as `offset`; absent means there is no next page. */
2872
3011
  next_cursor?: string;
2873
3012
  /** @description What the network says the total is. On a Google Business listing it is the number of **reviews**, which is not the length of `comments`: your replies travel in the same array as children of the review they answer. */
2874
- total?: number;
3013
+ total: number;
2875
3014
  };
2876
3015
  /**
2877
3016
  * @description One change in the array PlanVortex posts to your app's `webhook_url`, when an **integration** stopped working: a revoked Google Drive token, a feed that no longer answers, a publication quota that ran out.
@@ -2981,96 +3120,162 @@ interface components {
2981
3120
  string_property2?: string;
2982
3121
  zip_code?: string | number;
2983
3122
  };
2984
- ContactsContactInput: {
3123
+ /**
3124
+ * @description A new contact. **At least one identifier is mandatory** (`ERROR_CODE_1601` otherwise): a contact with no channel is a contact nobody can write to.
3125
+ *
3126
+ * Creating is idempotent on the FIRST identifier: if the organization already has a contact with that channel and that `external_identifier`, you get the existing one back untouched — `name`, `profile_image` and `extra_data` of the request are ignored. There is no "already exists" error.
3127
+ */
3128
+ ContactsContactCreate: {
3129
+ extra_data?: components["schemas"]["ContactExtraData"];
3130
+ name?: string;
3131
+ profile_image?: string;
3132
+ social_identifiers: components["schemas"]["ContactsSocialIdentifierInput"][];
3133
+ };
3134
+ /**
3135
+ * @description Changes to a contact. `name`, `profile_image` and `social_identifiers` are left alone when you omit them.
3136
+ *
3137
+ * **`extra_data` is the exception and it is destructive**: it is written with whatever the body carries, so omitting it ERASES every custom field on the contact. Read the contact, change what you need and send the whole block back.
3138
+ */
3139
+ ContactsContactUpdate: {
3140
+ /** @description Written as sent. **Omitting it erases the contact's custom fields.** */
2985
3141
  extra_data?: components["schemas"]["ContactExtraData"];
2986
3142
  name?: string;
2987
3143
  profile_image?: string;
2988
- social_identifiers?: components["schemas"]["SocialIdentifier"][];
3144
+ /** @description Replaces the whole list, it does not merge into it. Omit it to keep the current one. */
3145
+ social_identifiers?: components["schemas"]["ContactsSocialIdentifierInput"][];
3146
+ };
3147
+ /** @description The same person on one channel, as you SEND it. `_id` is optional here and PlanVortex mints one when it is missing — which is the difference with `SocialIdentifier`, where it always travels back. */
3148
+ ContactsSocialIdentifierInput: {
3149
+ /** @description Only when you are keeping an identifier the API already gave you. */
3150
+ _id?: string;
3151
+ /** @description The contact id on that channel — the phone number on WhatsApp, the PSID on Messenger. Optional in the model, but a contact without it cannot be written to, and it is what deduplicates on create. */
3152
+ external_identifier?: string;
3153
+ social_network: components["schemas"]["ContactChannel"];
2989
3154
  };
2990
3155
  /** @description A connected account that has stopped working: an expired token or a revoked permission. Until it is reconnected it neither publishes nor measures. */
2991
3156
  DashboardAccountWithError: {
2992
- _id?: string;
3157
+ _id: string;
2993
3158
  /** @description PlanVortex error code that broke it. `0` means healthy, so anything here is non-zero. */
2994
- error_code?: number;
3159
+ error_code: number;
2995
3160
  image?: string;
2996
- name?: string;
2997
- social_network?: components["schemas"]["SocialNetwork"];
3161
+ name: string;
3162
+ social_network: components["schemas"]["SocialNetwork"];
2998
3163
  username?: string;
2999
3164
  };
3165
+ /**
3166
+ * @description Everything the home screen needs, in ONE round trip.
3167
+ *
3168
+ * **A missing block is not an error.** Each one is checked against its own permission and omitted when the caller cannot read it, instead of failing the whole request; `available_blocks` says which ones were allowed. A block that is `true` in `available_blocks` and absent from the body means there was no data — except `messages`, which also turns to `false` when the plan does not include chat.
3169
+ */
3000
3170
  DashboardDashboard: {
3001
3171
  account_metrics?: {
3002
- by_day?: components["schemas"]["DashboardMetricRow"][];
3003
- by_network?: components["schemas"]["DashboardMetricRow"][];
3004
- previous_total?: components["schemas"]["DashboardNormalizedMetrics"];
3005
- total?: components["schemas"]["DashboardNormalizedMetrics"];
3172
+ by_day: components["schemas"]["DashboardMetricRow"][];
3173
+ by_network: components["schemas"]["DashboardMetricRow"][];
3174
+ previous_total: components["schemas"]["NormalizedMetrics"];
3175
+ total: components["schemas"]["NormalizedMetrics"];
3006
3176
  };
3007
3177
  ai_plans?: {
3008
- by_state?: {
3178
+ by_state: {
3009
3179
  state?: string;
3010
3180
  total?: number;
3011
3181
  }[];
3012
- credits_spent?: number;
3013
- /** @description The most recent plan of the organization, whatever the range. It is what tells you at a glance whether one is still generating, failed, or is waiting to be validated. */
3014
- last_plan?: {
3015
- [key: string]: unknown;
3016
- };
3182
+ credits_spent: number;
3017
3183
  /** @description Publications generated by the plans of the range. */
3018
- publications?: number;
3019
- total?: number;
3184
+ generated_publications: number;
3185
+ /** @description The most recent plan of the organization, **whatever the range**. Absent when there has never been one. */
3186
+ last_plan?: components["schemas"]["DashboardDashboardAiPlanRef"];
3187
+ /** @description Plans already generated and **waiting for someone to validate them**: work paid for that is not publishing anything yet. */
3188
+ pending_validation: number;
3189
+ total: number;
3020
3190
  };
3021
3191
  /** @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. */
3022
- available_blocks?: {
3023
- account_metrics?: boolean;
3024
- ai_plans?: boolean;
3025
- health?: boolean;
3026
- messages?: boolean;
3027
- plan_use?: boolean;
3028
- publication_metrics?: boolean;
3029
- publications?: boolean;
3192
+ available_blocks: {
3193
+ account_metrics: boolean;
3194
+ ai_plans: boolean;
3195
+ health: boolean;
3196
+ messages: boolean;
3197
+ plan_use: boolean;
3198
+ publication_metrics: boolean;
3199
+ publications: boolean;
3030
3200
  };
3031
3201
  /** @description What needs fixing today. Each half has its own permission: somebody who cannot read accounts still sees the failed publications. */
3032
3202
  health?: {
3033
3203
  accounts_with_errors?: components["schemas"]["DashboardAccountWithError"][];
3034
3204
  /** @description Up to ten publications in state `with_errors`, newest first. */
3035
- publications_with_errors?: {
3036
- [key: string]: unknown;
3037
- }[];
3205
+ publications_with_errors?: components["schemas"]["DashboardDashboardPublicationRef"][];
3038
3206
  total_drafts?: number;
3039
3207
  /** @description Up to ten publications due in the next 48 hours. */
3040
- upcoming_publications?: {
3041
- [key: string]: unknown;
3042
- }[];
3208
+ upcoming_publications?: components["schemas"]["DashboardDashboardPublicationRef"][];
3043
3209
  };
3044
3210
  messages?: {
3045
- unread?: number;
3211
+ unread: number;
3046
3212
  };
3047
3213
  plan_use?: components["schemas"]["DashboardPlanUse"];
3048
3214
  publication_metrics?: {
3049
- by_network?: {
3050
- metrics?: components["schemas"]["DashboardNormalizedMetrics"];
3215
+ by_network: {
3216
+ metrics?: components["schemas"]["NormalizedMetrics"];
3051
3217
  publications?: number;
3052
3218
  social_network?: components["schemas"]["SocialNetwork"];
3053
3219
  }[];
3054
- previous_total?: components["schemas"]["DashboardNormalizedMetrics"];
3055
- top?: components["schemas"]["DashboardTopPublication"][];
3056
- total?: components["schemas"]["DashboardNormalizedMetrics"];
3220
+ previous_total: components["schemas"]["NormalizedMetrics"];
3221
+ top: components["schemas"]["DashboardTopPublication"][];
3222
+ total: components["schemas"]["NormalizedMetrics"];
3057
3223
  };
3058
3224
  publications?: components["schemas"]["DashboardPublicationsSummary"] & {
3059
3225
  /** @description The same count for the previous period, for the delta. */
3060
3226
  previous_total?: number;
3061
3227
  };
3062
- range?: components["schemas"]["DashboardDashboardRange"];
3228
+ range: components["schemas"]["DashboardDashboardRange"];
3229
+ };
3230
+ /** @description The most recent AI plan, projected: enough to tell at a glance whether one is still generating, failed, or is waiting to be validated. `publications` are identifiers here. */
3231
+ DashboardDashboardAiPlanRef: {
3232
+ _id: string;
3233
+ /** Format: date-time */
3234
+ creation_date: string;
3235
+ credits_spent?: number;
3236
+ error?: {
3237
+ code: number;
3238
+ data?: {
3239
+ [key: string]: unknown;
3240
+ };
3241
+ message: string;
3242
+ };
3243
+ /** Format: date-time */
3244
+ generation_end_date?: string;
3245
+ prompt?: string;
3246
+ publications?: string[];
3247
+ /** @enum {string} */
3248
+ state: "pending" | "generating" | "generated" | "validated" | "failed" | "cancelled";
3249
+ };
3250
+ /** @description A publication as the health block projects it: a handful of fields, not a whole `Publication`. `state` is not among them — the list it came from already says what state it is in. */
3251
+ DashboardDashboardPublicationRef: {
3252
+ _id: string;
3253
+ /** Format: date-time */
3254
+ creation_date?: string;
3255
+ name?: string;
3256
+ /** @description Only on the failed ones. Same shape as in a full `Publication`. */
3257
+ publication_errors?: {
3258
+ code: number;
3259
+ data?: {
3260
+ [key: string]: unknown;
3261
+ };
3262
+ message: string;
3263
+ }[];
3264
+ /** Format: date-time */
3265
+ publish_date?: string;
3266
+ social_network: components["schemas"]["SocialNetwork"];
3267
+ text?: string;
3063
3268
  };
3064
3269
  /** @description The range that was actually used, plus the previous period of exactly the same length. The previous one is not "last month": comparing 30 days against a calendar month would move the delta with the calendar. */
3065
3270
  DashboardDashboardRange: {
3066
3271
  /** Format: date-time */
3067
- from_date?: string;
3272
+ from_date: string;
3068
3273
  /** Format: date-time */
3069
- previous_from_date?: string;
3274
+ previous_from_date: string;
3070
3275
  /** Format: date-time */
3071
- previous_to_date?: string;
3276
+ previous_to_date: string;
3072
3277
  /** Format: date-time */
3073
- to_date?: string;
3278
+ to_date: string;
3074
3279
  };
3075
3280
  /**
3076
3281
  * @description A metric in PlanVortex's common vocabulary. Each network reports what it reports and PlanVortex translates it; a metric a network does not publish is absent, never zero.
@@ -3078,59 +3283,75 @@ interface components {
3078
3283
  */
3079
3284
  DashboardMetricName: "impressions" | "reach" | "engagement" | "likes" | "comments" | "shares" | "saves" | "clicks" | "video_views" | "profile_views" | "followers" | "followers_gained";
3080
3285
  DashboardMetricRow: {
3081
- /** @description The value of the axis: the day, the network or the account identifier. `null` when `group_by` was `total`. */
3082
- group?: string;
3083
- name?: components["schemas"]["DashboardMetricName"];
3084
- value?: number;
3085
- };
3086
- /** @description Metric name to value. A missing key means the network does not publish that metric. */
3087
- DashboardNormalizedMetrics: {
3088
- [key: string]: number;
3286
+ /** @description The value of the axis: the day, the network or the account identifier. **`null` when `group_by` was `total`** — the field is always there, the value is not always a string. */
3287
+ group: string | null;
3288
+ name: components["schemas"]["DashboardMetricName"];
3289
+ value: number;
3089
3290
  };
3090
3291
  DashboardPlanUse: {
3091
3292
  /** @description What has been handed down to child organizations out of this organization's plan. */
3092
- actual_asigned?: components["schemas"]["PlanData"];
3293
+ actual_asigned: components["schemas"]["PlanData"];
3093
3294
  /** @description What the organization and its children are consuming right now. */
3094
- actual_use?: components["schemas"]["PlanData"];
3295
+ actual_use: components["schemas"]["PlanData"];
3095
3296
  /** @description The plan in force. An organization with no plan of its own inherits the closest parent that has one. */
3096
- limits?: components["schemas"]["PlanData"];
3297
+ limits: components["schemas"]["PlanData"];
3097
3298
  };
3098
3299
  DashboardPublicationsSummary: {
3099
3300
  /** @description Publications **created** each day, split by state. */
3100
- by_day?: {
3301
+ by_day: {
3101
3302
  /** @description `YYYY-MM-DD`, in UTC. */
3102
3303
  day?: string;
3103
3304
  state?: string;
3104
3305
  total?: number;
3105
3306
  }[];
3106
- by_network?: {
3307
+ by_network: {
3107
3308
  social_network?: components["schemas"]["SocialNetwork"];
3108
3309
  total?: number;
3109
3310
  }[];
3110
- by_state?: {
3311
+ by_state: {
3111
3312
  state?: string;
3112
3313
  total?: number;
3113
3314
  }[];
3114
3315
  /** @description Publications that actually **went out** each day, split by network. Only the ones in state `sended`. */
3115
- published_by_day?: {
3316
+ published_by_day: {
3116
3317
  /** @description `YYYY-MM-DD`, in UTC. */
3117
3318
  day?: string;
3118
3319
  social_network?: components["schemas"]["SocialNetwork"];
3119
3320
  total?: number;
3120
3321
  }[];
3121
3322
  /** @description Publications created in the range. */
3122
- total?: number;
3323
+ total: number;
3123
3324
  };
3325
+ /**
3326
+ * @description One row of the ranking. It comes out of the stats aggregation, not out of the publications collection, so it does **not** have the shape of a `Publication`: there is no `_id` (the identifier is `id_publication`) and the content travels nested under `publication`.
3327
+ *
3328
+ * Only publications that have already been measured can appear here. For a listing that includes the unmeasured ones, use `GET /organizations/{id}/publications/stats`.
3329
+ */
3124
3330
  DashboardTopPublication: {
3125
- _id?: string;
3126
- metrics?: components["schemas"]["DashboardNormalizedMetrics"];
3127
- name?: string;
3331
+ /**
3332
+ * Format: date-time
3333
+ * @description When this measurement was taken.
3334
+ */
3335
+ collected_date?: string;
3336
+ /**
3337
+ * @description What this row's engagement rate is divided by. **Two rows with different bases are not comparable**, so say which one it is when you put them in the same table.
3338
+ * @enum {string}
3339
+ */
3340
+ engagement_base?: "reach" | "impressions" | "followers";
3341
+ id_publication: string;
3342
+ metrics: components["schemas"]["NormalizedMetrics"];
3343
+ /** @description The bit of the publication needed to render the row. Nothing else is projected. */
3344
+ publication: {
3345
+ external_identifier?: string;
3346
+ files?: components["schemas"]["Upload"][];
3347
+ publication_type?: string;
3348
+ text?: string;
3349
+ title?: string;
3350
+ url?: string;
3351
+ };
3128
3352
  /** Format: date-time */
3129
3353
  publish_date?: string;
3130
- social_network?: components["schemas"]["SocialNetwork"];
3131
- text?: string;
3132
- } & {
3133
- [key: string]: unknown;
3354
+ social_network: components["schemas"]["SocialNetwork"];
3134
3355
  };
3135
3356
  /**
3136
3357
  * @description Error payload returned by every failing request.
@@ -3140,7 +3361,7 @@ interface components {
3140
3361
  * The catalogue grows with the product, so treat an unknown `code` as a generic failure instead of rejecting it.
3141
3362
  */
3142
3363
  Error: {
3143
- /** @description PlanVortex error code. Ranges: 500-541 auth, tokens and client apps · 601-612 user · 700-715 social accounts · 800-810 files · 900-960 publications · 1000-1003 general · 1100-1111 organizations · 1200-1207 roles · 1300-1307 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. */
3364
+ /** @description PlanVortex error code. Ranges: 500-544 auth, tokens and client apps · 601-612 user · 700-715 social accounts · 800-810 files · 900-960 publications · 1000-1003 general · 1100-1111 organizations · 1200-1207 roles · 1300-1307 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. */
3144
3365
  code: number;
3145
3366
  /** @description Extra context attached to the error, when there is any. */
3146
3367
  data?: {
@@ -3175,13 +3396,15 @@ interface components {
3175
3396
  };
3176
3397
  /** @description Credentials are never returned. `connected` is the summary the panel paints: false means the connection failed and needs attention. */
3177
3398
  IntegrationsIntegration: {
3178
- _id?: string;
3179
- config?: components["schemas"]["IntegrationsRssConfig"];
3180
- connected?: boolean;
3399
+ _id: string;
3400
+ /** @description Provider-specific configuration. **Empty object for `google_drive`** — the Picker supplies everything — so every field here is optional and only an `rss` integration fills them in. */
3401
+ config: components["schemas"]["IntegrationsRssConfig"];
3402
+ /** @description `error_code` is empty. It is computed on the way out, not stored: the panel needs to know whether the connection is alive, not with which credentials. */
3403
+ connected: boolean;
3181
3404
  /** Format: date-time */
3182
- creation_date?: string;
3405
+ creation_date: string;
3183
3406
  /** @description Only enabled integrations consume plan allowance. */
3184
- enabled?: boolean;
3407
+ enabled: boolean;
3185
3408
  /** @description PlanVortex error code of the last failure (2203 token revoked, 2205 feed unreachable, 924 no publication allowance left…). */
3186
3409
  error_code?: number | null;
3187
3410
  /**
@@ -3189,17 +3412,17 @@ interface components {
3189
3412
  * @example ana@empresa.com
3190
3413
  */
3191
3414
  external_identifier?: string;
3192
- id_client?: string;
3193
- id_organization?: string;
3415
+ id_client: string;
3416
+ id_organization: string;
3194
3417
  /** Format: date-time */
3195
3418
  last_used_date?: string;
3196
3419
  /** @example Drive de ana@empresa.com */
3197
- name?: string;
3198
- provider?: components["schemas"]["IntegrationsIntegrationProviderName"];
3420
+ name: string;
3421
+ provider: components["schemas"]["IntegrationsIntegrationProviderName"];
3199
3422
  };
3200
3423
  IntegrationsIntegrationProvider: {
3201
3424
  /**
3202
- * @description File formats accepted at the door. heic/heif are accepted and converted to JPEG on ingestion, so what ends up stored is always jpeg.
3425
+ * @description File formats accepted at the door. **Empty when `file_import` is false** — that is what `rss` returns, and it does not mean "anything goes". heic/heif are accepted and converted to JPEG on ingestion, so what ends up stored is always jpeg.
3203
3426
  * @example [
3204
3427
  * "mp4",
3205
3428
  * "jpeg",
@@ -3210,22 +3433,22 @@ interface components {
3210
3433
  * "heif"
3211
3434
  * ]
3212
3435
  */
3213
- accepted_formats?: string[];
3214
- config_fields?: {
3436
+ accepted_formats: string[];
3437
+ config_fields: {
3215
3438
  default?: unknown;
3216
- name?: string;
3439
+ name: string;
3217
3440
  options?: string[];
3218
3441
  required?: boolean;
3219
3442
  /** @enum {string} */
3220
- type?: "url" | "text" | "textarea" | "boolean" | "accounts" | "select";
3443
+ type: "url" | "text" | "textarea" | "boolean" | "accounts" | "select";
3221
3444
  }[];
3222
3445
  /** @description Polled by the poll-feeds job, which turns new entries into publications. */
3223
- content_feed?: boolean;
3446
+ content_feed: boolean;
3224
3447
  /** @description Contributes files to the library through POST /uploads/import. */
3225
- file_import?: boolean;
3226
- provider?: components["schemas"]["IntegrationsIntegrationProviderName"];
3448
+ file_import: boolean;
3449
+ provider: components["schemas"]["IntegrationsIntegrationProviderName"];
3227
3450
  /** @description true = connect with connect_link + code. false = connect with a form built from config_fields. */
3228
- requires_oauth?: boolean;
3451
+ requires_oauth: boolean;
3229
3452
  };
3230
3453
  /** @enum {string} */
3231
3454
  IntegrationsIntegrationProviderName: "google_drive" | "rss";
@@ -3243,29 +3466,18 @@ interface components {
3243
3466
  url?: string;
3244
3467
  };
3245
3468
  IntegrationsRssConnectRequest: {
3246
- /**
3247
- * @description false (the default) creates each entry as a draft for review. true schedules it a few minutes out, so there is a window to catch it before it goes out on the client's networks.
3248
- * @default false
3249
- */
3250
- auto_publish: boolean;
3469
+ /** @description false (the default) creates each entry as a draft for review. true schedules it a few minutes out, so there is a window to catch it before it goes out on the client's networks. Optional; defaults to `false`. */
3470
+ auto_publish?: boolean;
3251
3471
  /** @description Accounts of this organization the entries will be published to. At least one, otherwise 2206. */
3252
3472
  id_accounts: string[];
3253
- /**
3254
- * @description Import the entry's featured image (enclosure, media:content or the first <img> of the content) into the library and attach it.
3255
- * @default true
3256
- */
3257
- import_image: boolean;
3473
+ /** @description Import the entry's featured image (enclosure, media:content or the first <img> of the content) into the library and attach it. Optional; defaults to `true`. */
3474
+ import_image?: boolean;
3258
3475
  /** @enum {string} */
3259
3476
  provider: "rss";
3260
- /** @default profile */
3261
- publication_type: string;
3262
- /**
3263
- * @description Text template. Placeholders: {{title}}, {{link}}, {{summary}}. The result is truncated to the character limit of each network, taken from GET /social_limits.
3264
- * @default {{title}}
3265
- *
3266
- * {{link}}
3267
- */
3268
- template: string;
3477
+ /** @description Optional; defaults to `"profile"`. */
3478
+ publication_type?: string;
3479
+ /** @description Text template. Placeholders: {{title}}, {{link}}, {{summary}}. The result is truncated to the character limit of each network, taken from GET /social_limits. Optional; defaults to `"{{title}}\n\n{{link}}"`. */
3480
+ template?: string;
3269
3481
  /**
3270
3482
  * @description Public feed URL (RSS 2.0 or Atom). Private or authenticated feeds are not supported.
3271
3483
  * @example https://blog.cliente.com/feed
@@ -3330,34 +3542,38 @@ interface components {
3330
3542
  };
3331
3543
  /** @description One contact's thread, as it looks in an inbox list. */
3332
3544
  MessagesConversation: {
3333
- contact?: components["schemas"]["Contact"];
3545
+ contact: components["schemas"]["Contact"];
3334
3546
  /**
3335
3547
  * Format: date-time
3336
3548
  * @description When the last message of the thread was written, which is what the list is sorted by.
3337
3549
  */
3338
- date?: string;
3550
+ date: string;
3339
3551
  /** @description Unread messages **from the contact**. Ours never count. */
3340
- unread_messages?: number;
3552
+ unread_messages: number;
3341
3553
  };
3342
- /** @description Either `total` (no `group_by`) or `stats` plus `group` (with it). Never both. */
3554
+ /** @description Two different answers, not one with optional fields: **without** `group_by` you get `{total}`, **with** it you get `{stats, group}`. Never both. */
3343
3555
  MessagesConversationTotals: {
3556
+ /** @description Conversations in the range. A conversation is one contact on one day, so the same person writing on Monday and on Tuesday counts twice. */
3557
+ total: number;
3558
+ } | {
3344
3559
  /**
3345
3560
  * @description The grouping that was applied.
3346
3561
  * @enum {string}
3347
3562
  */
3348
- group?: "day" | "month" | "year";
3349
- /** @description The series, sorted ascending. Only when `group_by` was sent. */
3350
- stats?: {
3351
- /** @description Day of the year, month number or year, depending on `group`. */
3352
- groupValue?: number;
3353
- totalConversations?: number;
3563
+ group: "day" | "month" | "year";
3564
+ /** @description The series, sorted ascending. Empty when the range has no conversations. */
3565
+ stats: {
3566
+ /** @description The **number** Mongo's `$dayOfYear` / `$month` / `$year` gives, not a date: 240 for day, 8 for month, 2026 for year. Two years in the same `day` series collide on the same value — narrow the range instead. */
3567
+ groupValue: number;
3568
+ totalConversations: number;
3354
3569
  }[];
3355
- /** @description Conversations in the range. Only when `group_by` was not sent. */
3356
- total?: number;
3357
3570
  };
3571
+ /**
3572
+ * @description What you send to write a message.
3573
+ *
3574
+ * **`comment_message` and `publication_message` cannot be sent through this endpoint today.** Both need `in_response_external_id` — the id of the post or comment being answered — and the endpoint does not read it from the body, so the message would leave with an empty recipient. Use them only through the network's own webhook flow.
3575
+ */
3358
3576
  MessagesMessageInput: {
3359
- /** @description Identifier of the publication or comment being answered. Required by `comment_message` and `publication_message`. */
3360
- in_response_external_id?: string;
3361
3577
  message_options?: components["schemas"]["MessageOptions"];
3362
3578
  message_type: components["schemas"]["MessageType"];
3363
3579
  /** @description Required for the text-based types. Validated against `characters` in `GET /social_limits`. */
@@ -3368,6 +3584,32 @@ interface components {
3368
3584
  * @enum {string}
3369
3585
  */
3370
3586
  MessageType: "simple_message" | "file_message" | "comment_message" | "publication_message" | "quick_reply_message" | "button_message" | "elements_message" | "postback_message" | "template_message" | "interactive_message";
3587
+ /**
3588
+ * @description Metrics translated to a **common vocabulary** shared by every network, which is what makes two networks comparable and summable (each network names them differently: `page_post_engagements`, `total_interactions`, `views`…).
3589
+ *
3590
+ * **A missing key means the network does not publish that metric** — it is never an implicit zero. A key present with value `0` means it was measured and came out zero. Never default a missing key to 0 when displaying it.
3591
+ *
3592
+ * `engagement` is the network's own total when it provides one, and otherwise the sum of likes, comments, shares, saves and clicks. Video views are deliberately excluded from it: a view is not an interaction.
3593
+ */
3594
+ NormalizedMetrics: {
3595
+ clicks?: number;
3596
+ comments?: number;
3597
+ /** @description Total interactions */
3598
+ engagement?: number;
3599
+ /** @description Followers accumulated at that date, not the day's gain. */
3600
+ followers?: number;
3601
+ /** @description Followers gained that day. */
3602
+ followers_gained?: number;
3603
+ /** @description Times the content was shown (not unique) */
3604
+ impressions?: number;
3605
+ likes?: number;
3606
+ profile_views?: number;
3607
+ /** @description Unique users reached */
3608
+ reach?: number;
3609
+ saves?: number;
3610
+ shares?: number;
3611
+ video_views?: number;
3612
+ };
3371
3613
  /** @description The container of accounts, publications and files. Organizations can nest. */
3372
3614
  Organization: {
3373
3615
  /** @example 66d04a6a427f4c43b9d97f54 */
@@ -3564,33 +3806,7 @@ interface components {
3564
3806
  } & {
3565
3807
  [key: string]: unknown;
3566
3808
  };
3567
- /**
3568
- * @description Metrics translated to a **common vocabulary** shared by every network, which is what makes two networks comparable and summable (each network names them differently: `page_post_engagements`, `total_interactions`, `views`…).
3569
- *
3570
- * **A missing key means the network does not publish that metric** — it is never an implicit zero. A key present with value `0` means it was measured and came out zero. Never default a missing key to 0 when displaying it.
3571
- *
3572
- * `engagement` is the network's own total when it provides one, and otherwise the sum of likes, comments, shares, saves and clicks. Video views are deliberately excluded from it: a view is not an interaction.
3573
- */
3574
- PublicationsNormalizedMetrics: {
3575
- clicks?: number;
3576
- comments?: number;
3577
- /** @description Total interactions */
3578
- engagement?: number;
3579
- /** @description Followers accumulated at that date, not the day's gain. */
3580
- followers?: number;
3581
- /** @description Followers gained that day. */
3582
- followers_gained?: number;
3583
- /** @description Times the content was shown (not unique) */
3584
- impressions?: number;
3585
- likes?: number;
3586
- profile_views?: number;
3587
- /** @description Unique users reached */
3588
- reach?: number;
3589
- saves?: number;
3590
- shares?: number;
3591
- video_views?: number;
3592
- };
3593
- PublicationsPublication: {
3809
+ Publication: {
3594
3810
  _id: string;
3595
3811
  /** Format: date-time */
3596
3812
  creation_date: string;
@@ -3613,7 +3829,7 @@ interface components {
3613
3829
  id_integration?: string;
3614
3830
  id_organization: string;
3615
3831
  /** @description Last known measurement, in the common vocabulary. Absent until it is measured. */
3616
- metrics?: components["schemas"]["PublicationsNormalizedMetrics"];
3832
+ metrics?: components["schemas"]["NormalizedMetrics"];
3617
3833
  /** @description Internal name. Never shown on the social network. */
3618
3834
  name?: string;
3619
3835
  /** Format: date-time */
@@ -3643,7 +3859,7 @@ interface components {
3643
3859
  * @enum {string}
3644
3860
  */
3645
3861
  state: "ready" | "withErrors" | "sended" | "draft" | "publishing";
3646
- statistics?: components["schemas"]["PublicationsPublicationStats"];
3862
+ statistics?: components["schemas"]["PublicationStats"];
3647
3863
  /** Format: date-time */
3648
3864
  stats_updated_date?: string;
3649
3865
  text?: string;
@@ -3686,22 +3902,22 @@ interface components {
3686
3902
  title?: string;
3687
3903
  };
3688
3904
  PublicationsPublicationList: {
3689
- publications: components["schemas"]["PublicationsPublication"][];
3905
+ publications: components["schemas"]["Publication"][];
3690
3906
  total: number;
3691
3907
  };
3692
3908
  PublicationsPublicationOne: {
3693
- publication: components["schemas"]["PublicationsPublication"];
3909
+ publication: components["schemas"]["Publication"];
3694
3910
  };
3695
3911
  PublicationsPublicationRetry: {
3696
3912
  /** @description Retries a failed publication accepts in total. Read it from here instead of hardcoding it: it is the same number the server enforces. */
3697
3913
  max_retries: number;
3698
- publication: components["schemas"]["PublicationsPublication"];
3914
+ publication: components["schemas"]["Publication"];
3699
3915
  };
3700
3916
  PublicationsPublicationsStatsList: {
3701
3917
  /** @description Metric the listing is ordered by */
3702
3918
  metric?: string;
3703
3919
  /** @description The requested page. Each publication carries its last known `metrics`, `engagement_base` and `stats_updated_date`; a publication that has not been measured yet has none of them. */
3704
- publications?: components["schemas"]["PublicationsPublication"][];
3920
+ publications?: components["schemas"]["Publication"][];
3705
3921
  /** @description The resolved range and the immediately preceding period of the same length, which is what `summary.previous_total` covers. */
3706
3922
  range?: {
3707
3923
  /** Format: date-time */
@@ -3716,16 +3932,63 @@ interface components {
3716
3932
  /** @description Aggregates for the whole organization in the range. Omitted when `summary=false`. */
3717
3933
  summary?: {
3718
3934
  by_network?: {
3719
- metrics?: components["schemas"]["PublicationsNormalizedMetrics"];
3935
+ metrics?: components["schemas"]["NormalizedMetrics"];
3720
3936
  publications?: number;
3721
3937
  social_network?: string;
3722
3938
  }[];
3723
- previous_total?: components["schemas"]["PublicationsNormalizedMetrics"];
3724
- total?: components["schemas"]["PublicationsNormalizedMetrics"];
3939
+ previous_total?: components["schemas"]["NormalizedMetrics"];
3940
+ total?: components["schemas"]["NormalizedMetrics"];
3725
3941
  };
3726
3942
  /** @description Publications matching the filters, for paging */
3727
3943
  total?: number;
3728
3944
  };
3945
+ /** @description A publication's measured history plus its last known values. */
3946
+ PublicationsPublicationStatsHistory: {
3947
+ /** @enum {string} */
3948
+ engagement_base?: "reach" | "impressions" | "followers";
3949
+ id_publication: string;
3950
+ /** @description The most recent row of the series, with the network's raw payload attached. Absent when the series is empty. */
3951
+ latest?: {
3952
+ /** Format: date-time */
3953
+ collected_date: string;
3954
+ /** @enum {string} */
3955
+ engagement_base?: "reach" | "impressions" | "followers";
3956
+ metrics: components["schemas"]["NormalizedMetrics"];
3957
+ /** @description What the network answered, unprocessed. */
3958
+ raw?: components["schemas"]["PublicationStats"];
3959
+ };
3960
+ metrics?: components["schemas"]["NormalizedMetrics"];
3961
+ /**
3962
+ * Format: date-time
3963
+ * @description When the collector will look again. Absent means the 30-day window is over
3964
+ */
3965
+ next_stats_update?: string;
3966
+ /** Format: date-time */
3967
+ publish_date?: string;
3968
+ /** @description One row per measured day, oldest first. Empty is valid: nothing has been measured yet. */
3969
+ series: components["schemas"]["PublicationsPublicationStatsPoint"][];
3970
+ social_network: components["schemas"]["SocialNetwork"];
3971
+ statistics?: components["schemas"]["PublicationStats"];
3972
+ /**
3973
+ * Format: date-time
3974
+ * @description Last time it was measured. Absent means never
3975
+ */
3976
+ stats_updated_date?: string;
3977
+ };
3978
+ /** @description One measurement of a publication. `metrics` is the **running total** at `collected_date`, not that day's increment. */
3979
+ PublicationsPublicationStatsPoint: {
3980
+ /**
3981
+ * Format: date-time
3982
+ * @description Day of the measurement, normalized to 00:00
3983
+ */
3984
+ collected_date: string;
3985
+ /**
3986
+ * @description What the engagement rate is divided by. Two rows with different bases are not comparable: state the base whenever you put them in the same table.
3987
+ * @enum {string}
3988
+ */
3989
+ engagement_base?: "reach" | "impressions" | "followers";
3990
+ metrics: components["schemas"]["NormalizedMetrics"];
3991
+ };
3729
3992
  /**
3730
3993
  * @description Raw, per-network metrics for a publication. Only the fields that belong to the publication's own social network are returned.
3731
3994
  *
@@ -3735,7 +3998,7 @@ interface components {
3735
3998
  *
3736
3999
  * On `bluesky` there are no impressions and no reach either — only the public counters — so engagement is computed over followers.
3737
4000
  */
3738
- PublicationsPublicationStats: {
4001
+ PublicationStats: {
3739
4002
  angers?: number;
3740
4003
  /** @description X (Twitter). Times the post was saved to bookmarks. Always available (`public_metrics`). Normalised as `saves` and counted towards engagement. */
3741
4004
  bookmarks?: number;
@@ -3779,53 +4042,6 @@ interface components {
3779
4042
  views?: number;
3780
4043
  wows?: number;
3781
4044
  };
3782
- /** @description A publication's measured history plus its last known values. */
3783
- PublicationsPublicationStatsHistory: {
3784
- /** @enum {string} */
3785
- engagement_base?: "reach" | "impressions" | "followers";
3786
- id_publication: string;
3787
- /** @description The most recent row of the series, with the network's raw payload attached. Absent when the series is empty. */
3788
- latest?: {
3789
- /** Format: date-time */
3790
- collected_date: string;
3791
- /** @enum {string} */
3792
- engagement_base?: "reach" | "impressions" | "followers";
3793
- metrics: components["schemas"]["PublicationsNormalizedMetrics"];
3794
- /** @description What the network answered, unprocessed. */
3795
- raw?: components["schemas"]["PublicationsPublicationStats"];
3796
- };
3797
- metrics?: components["schemas"]["PublicationsNormalizedMetrics"];
3798
- /**
3799
- * Format: date-time
3800
- * @description When the collector will look again. Absent means the 30-day window is over
3801
- */
3802
- next_stats_update?: string;
3803
- /** Format: date-time */
3804
- publish_date?: string;
3805
- /** @description One row per measured day, oldest first. Empty is valid: nothing has been measured yet. */
3806
- series: components["schemas"]["PublicationsPublicationStatsPoint"][];
3807
- social_network: components["schemas"]["SocialNetwork"];
3808
- statistics?: components["schemas"]["PublicationsPublicationStats"];
3809
- /**
3810
- * Format: date-time
3811
- * @description Last time it was measured. Absent means never
3812
- */
3813
- stats_updated_date?: string;
3814
- };
3815
- /** @description One measurement of a publication. `metrics` is the **running total** at `collected_date`, not that day's increment. */
3816
- PublicationsPublicationStatsPoint: {
3817
- /**
3818
- * Format: date-time
3819
- * @description Day of the measurement, normalized to 00:00
3820
- */
3821
- collected_date: string;
3822
- /**
3823
- * @description What the engagement rate is divided by. Two rows with different bases are not comparable: state the base whenever you put them in the same table.
3824
- * @enum {string}
3825
- */
3826
- engagement_base?: "reach" | "impressions" | "followers";
3827
- metrics: components["schemas"]["PublicationsNormalizedMetrics"];
3828
- };
3829
4045
  /** @description What can be read back about an organization's own application. The secrets are not here and never will be. */
3830
4046
  SocialCredentials: {
3831
4047
  /** @description The application's name, as Discord returned it when the credentials were validated. */
@@ -4511,8 +4727,8 @@ interface operations {
4511
4727
  };
4512
4728
  content: {
4513
4729
  "application/json": {
4514
- client_apps?: components["schemas"]["AppsClientApp"][];
4515
- total?: number;
4730
+ client_apps: components["schemas"]["AppsClientApp"][];
4731
+ total: number;
4516
4732
  };
4517
4733
  };
4518
4734
  };
@@ -4542,7 +4758,7 @@ interface operations {
4542
4758
  };
4543
4759
  content: {
4544
4760
  "application/json": {
4545
- client_app?: components["schemas"]["AppsClientApp"];
4761
+ client_app: components["schemas"]["AppsClientApp"];
4546
4762
  };
4547
4763
  };
4548
4764
  };
@@ -4570,7 +4786,7 @@ interface operations {
4570
4786
  };
4571
4787
  content: {
4572
4788
  "application/json": {
4573
- client_app?: components["schemas"]["AppsClientApp"];
4789
+ client_app: components["schemas"]["AppsClientApp"];
4574
4790
  };
4575
4791
  };
4576
4792
  };
@@ -4602,7 +4818,7 @@ interface operations {
4602
4818
  };
4603
4819
  content: {
4604
4820
  "application/json": {
4605
- client_app?: components["schemas"]["AppsClientApp"];
4821
+ client_app: components["schemas"]["AppsClientApp"];
4606
4822
  };
4607
4823
  };
4608
4824
  };
@@ -4656,7 +4872,7 @@ interface operations {
4656
4872
  };
4657
4873
  content: {
4658
4874
  "application/json": {
4659
- secret?: string;
4875
+ secret: string;
4660
4876
  };
4661
4877
  };
4662
4878
  };
@@ -5135,10 +5351,8 @@ interface operations {
5135
5351
  content: {
5136
5352
  "application/json": {
5137
5353
  /** @description AI credits this plan has spent in total, this regeneration included. */
5138
- credits_spent?: number;
5139
- publication?: {
5140
- [key: string]: unknown;
5141
- };
5354
+ credits_spent: number;
5355
+ publication: components["schemas"]["Publication"];
5142
5356
  };
5143
5357
  };
5144
5358
  };
@@ -5757,7 +5971,7 @@ interface operations {
5757
5971
  };
5758
5972
  content: {
5759
5973
  "application/json": {
5760
- providers?: components["schemas"]["IntegrationsIntegrationProvider"][];
5974
+ providers: components["schemas"]["IntegrationsIntegrationProvider"][];
5761
5975
  };
5762
5976
  };
5763
5977
  };
@@ -6064,6 +6278,8 @@ interface operations {
6064
6278
  * | Code | Meaning |
6065
6279
  * | --- | --- |
6066
6280
  * | `519` | This endpoint does not accept app credentials |
6281
+ * | `543` | This temporal connect token has already connected an account. Issue a new one |
6282
+ * | `544` | This temporal connect token was issued for a different social network |
6067
6283
  * | `1101` | Invalid organization, or a temporal token for a different one |
6068
6284
  */
6069
6285
  400: {
@@ -6353,9 +6569,9 @@ interface operations {
6353
6569
  };
6354
6570
  content: {
6355
6571
  "application/json": {
6356
- conversations?: components["schemas"]["MessagesConversation"][];
6572
+ conversations: components["schemas"]["MessagesConversation"][];
6357
6573
  /** @description Conversations this account has in total, ignoring the pagination. */
6358
- total?: number;
6574
+ total: number;
6359
6575
  };
6360
6576
  };
6361
6577
  };
@@ -6429,6 +6645,7 @@ interface operations {
6429
6645
  * | `700` | The account has no usable token: it has to be connected again |
6430
6646
  * | `706` | The organization has no account slots left in its plan |
6431
6647
  * | `519` | This endpoint does not accept app credentials |
6648
+ * | `544` | This temporal connect token was issued for a different social network |
6432
6649
  */
6433
6650
  400: {
6434
6651
  headers: {
@@ -6474,10 +6691,10 @@ interface operations {
6474
6691
  content: {
6475
6692
  "application/json": {
6476
6693
  /** @description Templates as the network returns them. */
6477
- templates?: {
6694
+ templates: {
6478
6695
  [key: string]: unknown;
6479
6696
  }[];
6480
- total?: number;
6697
+ total: number;
6481
6698
  };
6482
6699
  };
6483
6700
  };
@@ -6511,7 +6728,7 @@ interface operations {
6511
6728
  };
6512
6729
  content: {
6513
6730
  "application/json": {
6514
- template?: {
6731
+ template: {
6515
6732
  [key: string]: unknown;
6516
6733
  };
6517
6734
  };
@@ -6605,8 +6822,8 @@ interface operations {
6605
6822
  };
6606
6823
  content: {
6607
6824
  "application/json": {
6608
- messages?: components["schemas"]["Message"][];
6609
- total?: number;
6825
+ messages: components["schemas"]["Message"][];
6826
+ total: number;
6610
6827
  };
6611
6828
  };
6612
6829
  };
@@ -6640,7 +6857,7 @@ interface operations {
6640
6857
  };
6641
6858
  content: {
6642
6859
  "application/json": {
6643
- message?: components["schemas"]["Message"];
6860
+ message: components["schemas"]["Message"];
6644
6861
  };
6645
6862
  };
6646
6863
  };
@@ -6865,9 +7082,12 @@ interface operations {
6865
7082
  limit?: components["parameters"]["Productslimit"];
6866
7083
  /** @description Records to skip (pagination) */
6867
7084
  offset?: components["parameters"]["Productsoffset"];
6868
- /** @description Catalogue whose products are listed. */
7085
+ /** @description The catalogue to list. **Effectively required**: without it the request fails with `ERROR_CODE_2000`. Get one from `GET .../products_catalogs`. */
6869
7086
  product_catalog_id?: string;
6870
- /** @description Ask for one product instead of a page. */
7087
+ /**
7088
+ * @deprecated
7089
+ * @description **Do not use: it does not reach the network.** The server forwards it under a different name than the SDK reads, so a request with only `product_id` fails with `ERROR_CODE_2000` ("catalogue or product identifier required"). Ask for the catalogue and pick the product out of the page.
7090
+ */
6871
7091
  product_id?: string;
6872
7092
  };
6873
7093
  header?: never;
@@ -6888,9 +7108,9 @@ interface operations {
6888
7108
  };
6889
7109
  content: {
6890
7110
  "application/json": {
6891
- items?: components["schemas"]["ProductsProduct"][];
6892
- /** @description How many products came back in this page. */
6893
- total?: number;
7111
+ items: components["schemas"]["ProductsProduct"][];
7112
+ /** @description **Always 0 today.** It is read from Meta's `summary.total_count`, and PlanVortex does not ask for the summary, so the field never arrives. Page until you get a short page instead of trusting this number. */
7113
+ total: number;
6894
7114
  };
6895
7115
  };
6896
7116
  };
@@ -6925,7 +7145,7 @@ interface operations {
6925
7145
  };
6926
7146
  content: {
6927
7147
  "application/json": {
6928
- product_id?: string;
7148
+ product_id: string;
6929
7149
  };
6930
7150
  };
6931
7151
  };
@@ -6958,9 +7178,9 @@ interface operations {
6958
7178
  };
6959
7179
  content: {
6960
7180
  "application/json": {
6961
- items?: components["schemas"]["ProductsProductCatalog"][];
6962
- /** @description How many catalogues came back in this page. */
6963
- total?: number;
7181
+ items: components["schemas"]["ProductsProductCatalog"][];
7182
+ /** @description How many catalogues came back **in this page**, not how many exist. It is the length of `items`, so it can never tell you there is another page. */
7183
+ total: number;
6964
7184
  };
6965
7185
  };
6966
7186
  };
@@ -6992,8 +7212,8 @@ interface operations {
6992
7212
  };
6993
7213
  content: {
6994
7214
  "application/json": {
6995
- /** @description Identifier of the catalogue on the network. */
6996
- product_catalog?: string;
7215
+ /** @description Identifier of the catalogue on the network. **A string, not the catalogue**: the name says otherwise and it is the id. Read it back with `GET .../products_catalogs` if you need the rest. */
7216
+ product_catalog: string;
6997
7217
  };
6998
7218
  };
6999
7219
  };
@@ -7212,7 +7432,7 @@ interface operations {
7212
7432
  };
7213
7433
  content: {
7214
7434
  "application/json": {
7215
- publications: components["schemas"]["PublicationsPublication"][];
7435
+ publications: components["schemas"]["Publication"][];
7216
7436
  total: number;
7217
7437
  };
7218
7438
  };
@@ -7330,9 +7550,9 @@ interface operations {
7330
7550
  };
7331
7551
  content: {
7332
7552
  "application/json": {
7333
- comments?: components["schemas"]["CommentsComment"][];
7553
+ comments: components["schemas"]["CommentsComment"][];
7334
7554
  /** @description Rows matching the filters, not rows returned */
7335
- total?: number;
7555
+ total: number;
7336
7556
  };
7337
7557
  };
7338
7558
  };
@@ -7369,7 +7589,7 @@ interface operations {
7369
7589
  };
7370
7590
  content: {
7371
7591
  "application/json": {
7372
- comment?: components["schemas"]["CommentsComment"];
7592
+ comment: components["schemas"]["CommentsComment"];
7373
7593
  };
7374
7594
  };
7375
7595
  };
@@ -7397,7 +7617,7 @@ interface operations {
7397
7617
  };
7398
7618
  content: {
7399
7619
  "application/json": {
7400
- success?: boolean;
7620
+ success: boolean;
7401
7621
  };
7402
7622
  };
7403
7623
  };
@@ -7463,10 +7683,11 @@ interface operations {
7463
7683
  };
7464
7684
  content: {
7465
7685
  "application/json": {
7466
- comment?: components["schemas"]["CommentsComment"];
7686
+ comment: components["schemas"]["CommentsComment"];
7467
7687
  /** @description X credits this reply spent. `0` on every other network. */
7468
- credits_consumed?: number;
7469
- reply?: components["schemas"]["CommentsComment"];
7688
+ credits_consumed: number;
7689
+ /** @description Your reply as it was stored. **It can arrive without `_id`**: the reply is published on the network first and stored afterwards, and storing it is deliberately not allowed to fail the request — the network already published it. When that write fails you get what the network returned, which has no PlanVortex identifier. `comment.our_reply_external_id` is the field that always identifies it. */
7690
+ reply: components["schemas"]["CommentsComment"];
7470
7691
  };
7471
7692
  };
7472
7693
  };
@@ -7540,7 +7761,10 @@ interface operations {
7540
7761
  offset?: components["parameters"]["Contactsoffset"];
7541
7762
  /** @description Full-text search over the contact's name. */
7542
7763
  search?: string;
7543
- /** @description Only the contacts reachable on this network. */
7764
+ /**
7765
+ * @deprecated
7766
+ * @description **Do not use: it always returns an empty list.** The server compares the whole `social_identifiers` array against the network name, and the array holds objects, so nothing ever matches. Filter client-side on `social_identifiers[].social_network` until this is fixed.
7767
+ */
7544
7768
  social_network?: components["schemas"]["SocialNetwork"];
7545
7769
  };
7546
7770
  header?: never;
@@ -7559,8 +7783,8 @@ interface operations {
7559
7783
  };
7560
7784
  content: {
7561
7785
  "application/json": {
7562
- contacts?: components["schemas"]["Contact"][];
7563
- total?: number;
7786
+ contacts: components["schemas"]["Contact"][];
7787
+ total: number;
7564
7788
  };
7565
7789
  };
7566
7790
  };
@@ -7579,7 +7803,7 @@ interface operations {
7579
7803
  };
7580
7804
  requestBody: {
7581
7805
  content: {
7582
- "application/json": components["schemas"]["ContactsContactInput"];
7806
+ "application/json": components["schemas"]["ContactsContactCreate"];
7583
7807
  };
7584
7808
  };
7585
7809
  responses: {
@@ -7590,7 +7814,7 @@ interface operations {
7590
7814
  };
7591
7815
  content: {
7592
7816
  "application/json": {
7593
- contact?: components["schemas"]["Contact"];
7817
+ contact: components["schemas"]["Contact"];
7594
7818
  };
7595
7819
  };
7596
7820
  };
@@ -7642,7 +7866,7 @@ interface operations {
7642
7866
  };
7643
7867
  content: {
7644
7868
  "application/json": {
7645
- contact?: components["schemas"]["Contact"];
7869
+ contact: components["schemas"]["Contact"];
7646
7870
  };
7647
7871
  };
7648
7872
  };
@@ -7663,11 +7887,11 @@ interface operations {
7663
7887
  };
7664
7888
  requestBody: {
7665
7889
  content: {
7666
- "application/json": components["schemas"]["ContactsContactInput"];
7890
+ "application/json": components["schemas"]["ContactsContactUpdate"];
7667
7891
  };
7668
7892
  };
7669
7893
  responses: {
7670
- /** @description Updated */
7894
+ /** @description Updated. **It does not return the contact**: read it again if you need the new state. */
7671
7895
  200: {
7672
7896
  headers: {
7673
7897
  [name: string]: unknown;
@@ -7768,6 +7992,7 @@ interface operations {
7768
7992
  getIntegrations: {
7769
7993
  parameters: {
7770
7994
  query?: {
7995
+ /** @description How many to return. **Without it there is no limit at all** and the whole list comes back — unlike every other listing in this API, which caps at 10. */
7771
7996
  limit?: number;
7772
7997
  offset?: number;
7773
7998
  /** @description Filter by provider */
@@ -7789,8 +8014,8 @@ interface operations {
7789
8014
  };
7790
8015
  content: {
7791
8016
  "application/json": {
7792
- integrations?: components["schemas"]["IntegrationsIntegration"][];
7793
- total?: number;
8017
+ integrations: components["schemas"]["IntegrationsIntegration"][];
8018
+ total: number;
7794
8019
  };
7795
8020
  };
7796
8021
  };
@@ -7828,7 +8053,7 @@ interface operations {
7828
8053
  };
7829
8054
  content: {
7830
8055
  "application/json": {
7831
- integration?: components["schemas"]["IntegrationsIntegration"];
8056
+ integration: components["schemas"]["IntegrationsIntegration"];
7832
8057
  };
7833
8058
  };
7834
8059
  };
@@ -7875,7 +8100,7 @@ interface operations {
7875
8100
  };
7876
8101
  content: {
7877
8102
  "application/json": {
7878
- integration?: components["schemas"]["IntegrationsIntegration"];
8103
+ integration: components["schemas"]["IntegrationsIntegration"];
7879
8104
  };
7880
8105
  };
7881
8106
  };
@@ -7919,7 +8144,7 @@ interface operations {
7919
8144
  };
7920
8145
  content: {
7921
8146
  "application/json": {
7922
- integration?: components["schemas"]["IntegrationsIntegration"];
8147
+ integration: components["schemas"]["IntegrationsIntegration"];
7923
8148
  };
7924
8149
  };
7925
8150
  };
@@ -7955,7 +8180,7 @@ interface operations {
7955
8180
  };
7956
8181
  content: {
7957
8182
  "application/json": {
7958
- success?: boolean;
8183
+ success: boolean;
7959
8184
  };
7960
8185
  };
7961
8186
  };
@@ -7991,12 +8216,12 @@ interface operations {
7991
8216
  };
7992
8217
  content: {
7993
8218
  "application/json": {
7994
- access_token?: string;
8219
+ access_token: string;
7995
8220
  /** @description Google Cloud project NUMBER. With scope drive.file the permission over a picked file is granted to the project that picked it, so this must belong to the same project as the OAuth client. */
7996
- app_id?: string;
7997
- developer_key?: string;
8221
+ app_id: string;
8222
+ developer_key: string;
7998
8223
  /** Format: date-time */
7999
- expires_in?: string;
8224
+ expires_in: string;
8000
8225
  };
8001
8226
  };
8002
8227
  };
@@ -8036,7 +8261,7 @@ interface operations {
8036
8261
  };
8037
8262
  content: {
8038
8263
  "application/json": {
8039
- integration?: components["schemas"]["IntegrationsIntegration"];
8264
+ integration: components["schemas"]["IntegrationsIntegration"];
8040
8265
  };
8041
8266
  };
8042
8267
  };
@@ -8085,7 +8310,7 @@ interface operations {
8085
8310
  content: {
8086
8311
  "application/json": {
8087
8312
  /** @example https://accounts.google.com/o/oauth2/v2/auth?response_type=code&... */
8088
- url?: string;
8313
+ url: string;
8089
8314
  };
8090
8315
  };
8091
8316
  };
@@ -8174,9 +8399,13 @@ interface operations {
8174
8399
  };
8175
8400
  content: {
8176
8401
  "application/json": {
8177
- group_by?: string;
8178
- range?: components["schemas"]["DashboardDashboardRange"];
8179
- stats?: components["schemas"]["DashboardMetricRow"][];
8402
+ /**
8403
+ * @description The axis that was applied. Defaults to `day`; anything else is rejected with 1000.
8404
+ * @enum {string}
8405
+ */
8406
+ group_by: "day" | "network" | "account" | "total";
8407
+ range: components["schemas"]["DashboardDashboardRange"];
8408
+ stats: components["schemas"]["DashboardMetricRow"][];
8180
8409
  };
8181
8410
  };
8182
8411
  };
@@ -8391,7 +8620,7 @@ interface operations {
8391
8620
  };
8392
8621
  content: {
8393
8622
  "application/json": {
8394
- range?: components["schemas"]["DashboardDashboardRange"];
8623
+ range: components["schemas"]["DashboardDashboardRange"];
8395
8624
  } & components["schemas"]["DashboardPublicationsSummary"];
8396
8625
  };
8397
8626
  };
@@ -8426,9 +8655,9 @@ interface operations {
8426
8655
  };
8427
8656
  content: {
8428
8657
  "application/json": {
8429
- metric?: components["schemas"]["DashboardMetricName"];
8430
- publications?: components["schemas"]["DashboardTopPublication"][];
8431
- range?: components["schemas"]["DashboardDashboardRange"];
8658
+ metric: components["schemas"]["DashboardMetricName"];
8659
+ publications: components["schemas"]["DashboardTopPublication"][];
8660
+ range: components["schemas"]["DashboardDashboardRange"];
8432
8661
  };
8433
8662
  };
8434
8663
  };
@@ -8709,7 +8938,7 @@ interface operations {
8709
8938
  [name: string]: unknown;
8710
8939
  };
8711
8940
  content: {
8712
- "application/json": components["schemas"]["PublicationsPublicationStats"];
8941
+ "application/json": components["schemas"]["PublicationStats"];
8713
8942
  };
8714
8943
  };
8715
8944
  /**
@@ -9490,7 +9719,7 @@ interface operations {
9490
9719
  query?: {
9491
9720
  /** @description Where the user comes back after connecting. Has to be one of the app's `redirect_urls` (error 532). */
9492
9721
  redirect_uri?: string;
9493
- /** @description Network the user is going to connect. It travels inside the returned URL. */
9722
+ /** @description Network the user is going to connect. It travels inside the returned URL **and inside the token itself**, so the token will only connect that network (error 544 otherwise). A network outside the allowed list is rejected here with error 702. */
9494
9723
  social_network?: components["schemas"]["SocialNetwork"];
9495
9724
  };
9496
9725
  header?: never;
@@ -9511,7 +9740,7 @@ interface operations {
9511
9740
  "application/json": {
9512
9741
  /**
9513
9742
  * Format: date-time
9514
- * @description When the token stops working. One hour after it was issued.
9743
+ * @description When the token stops working. Fifteen minutes after it was issued.
9515
9744
  */
9516
9745
  expires_at: string;
9517
9746
  /** @description The same token, on its own. This is what you pass to a client that authenticates with a temporal token; do not parse it out of `url`. */
@@ -9526,8 +9755,9 @@ interface operations {
9526
9755
  *
9527
9756
  * | Code | Meaning |
9528
9757
  * | --- | --- |
9529
- * | `514` | This endpoint needs app credentials: a user token cannot issue one |
9758
+ * | `514` | This endpoint needs app credentials: neither a user token nor a temporal connect token can issue one |
9530
9759
  * | `532` | `redirect_uri` is not one of the app's registered `redirect_urls` |
9760
+ * | `702` | `social_network` is not one of the networks PlanVortex supports |
9531
9761
  * | `1101` | Invalid organization |
9532
9762
  */
9533
9763
  400: {
@@ -9566,7 +9796,7 @@ interface operations {
9566
9796
  };
9567
9797
  content: {
9568
9798
  "application/json": {
9569
- total?: number;
9799
+ total: number;
9570
9800
  };
9571
9801
  };
9572
9802
  };
@@ -9592,7 +9822,7 @@ interface operations {
9592
9822
  };
9593
9823
  content: {
9594
9824
  "application/json": {
9595
- total?: number;
9825
+ total: number;
9596
9826
  };
9597
9827
  };
9598
9828
  };
@@ -10279,9 +10509,11 @@ interface operations {
10279
10509
  * Debajo de cada uno esta `src/generated/openapi.d.ts`, que sale del OpenAPI publico y no se toca
10280
10510
  * a mano. Este fichero es la capa fina que hay encima y hace tres cosas que un generador no puede:
10281
10511
  *
10282
- * 1. **Pone nombres legibles.** En lo generado un esquema se llama `PublicationsPublication`,
10512
+ * 1. **Pone nombres legibles.** En lo generado un esquema se llama `PublicationsPublicationInput`,
10283
10513
  * porque los 16 documentos del spec se unen en uno y el `Plan` de un cliente no es el `Plan`
10284
- * de una organizacion. Aqui se llama `Publication`.
10514
+ * de una organizacion. Aqui se llama `PublicationInput`. Los que describen LO MISMO en varias
10515
+ * secciones viven en `common.json` y conservan su nombre —`Publication`, `Account`, `Upload`,
10516
+ * `Message`, `Contact`, `NormalizedMetrics`—: es lo que evita dos tipos para un solo objeto.
10285
10517
  * 2. **Abre las enumeraciones que crecen** (§ trampa 8 del roadmap). `ALLOWED_RRSS` va por diez
10286
10518
  * redes y sube varias veces al ano. Si `social_network` fuera una union cerrada, el dia que
10287
10519
  * entre la undecima **dejaria de compilar el codigo de todos los integradores** hasta que
@@ -10352,9 +10584,9 @@ type CommentNetwork = OpenEnum<Schemas["CommentsCommentNetworkName"]>;
10352
10584
  * `draft` no se envia nunca; `ready` esta programada; `publishing` esta en manos de la red en este
10353
10585
  * momento; `sended` salio; `withErrors` fallo y trae el motivo en `publication_errors`.
10354
10586
  */
10355
- type PublicationState = OpenEnum<Schemas["PublicationsPublication"]["state"]>;
10587
+ type PublicationState = OpenEnum<Schemas["Publication"]["state"]>;
10356
10588
  /** Donde se publica dentro de la red: perfil, pagina, grupo, reel o story. */
10357
- type PublicationType = OpenEnum<Schemas["PublicationsPublication"]["publication_type"]>;
10589
+ type PublicationType = OpenEnum<Schemas["Publication"]["publication_type"]>;
10358
10590
  /** `image` o `video`. Abierto porque el catalogo de formatos se ha ampliado antes (HEIC). */
10359
10591
  type FileType = OpenEnum<Schemas["Upload"]["file_type"]>;
10360
10592
  /** La extension real del fichero ya guardado. Un HEIC entra pero se convierte a JPEG al subirlo. */
@@ -10427,6 +10659,20 @@ type Organization = Schemas["Organization"];
10427
10659
  type AiContext = Schemas["AiContext"];
10428
10660
  /** Las credenciales de la aplicacion propia de una organizacion (BYOB). Los secretos nunca salen. */
10429
10661
  type SocialCredentials = Schemas["SocialCredentials"];
10662
+ /**
10663
+ * Las credenciales tal y como se MANDAN. Son de solo escritura: nada de lo que va aqui vuelve.
10664
+ *
10665
+ * Las tres hacen falta la primera vez; despues, lo que se omite se conserva.
10666
+ */
10667
+ type SocialCredentialsInput = Schemas["OrganizationsSocialCredentialsInput"];
10668
+ /**
10669
+ * La configuracion de proveedores de IA de un cliente (BYOK), ambito a ambito.
10670
+ *
10671
+ * Un ambito en `null` borra su configuracion y devuelve ese ambito a los creditos de PlanVortex.
10672
+ */
10673
+ type AiSettings = Schemas["ClientsAiSettings"];
10674
+ /** Un cliente con sus organizaciones raiz dentro. Es el atajo del arranque: 1 peticion en vez de N. */
10675
+ type ClientWithOrganizations = Operations["getClientsWithOrganizations"]["responses"][200]["content"]["application/json"]["clients"][number];
10430
10676
  /**
10431
10677
  * Una cuenta social conectada a una organizacion.
10432
10678
  *
@@ -10454,15 +10700,26 @@ type PersistentMenu = Schemas["AccountsPersistentMenu"];
10454
10700
  *
10455
10701
  * Las dos cosas valen: `url` es el camino alojado —se redirige al usuario y PlanVortex se encarga
10456
10702
  * de todo—, y `token` es el mismo credencial suelto, para pasarselo a `pv.asTemporalToken(token)`
10457
- * y conducir el flujo desde el front propio. Caduca a la hora (`expires_at`) y sirve para UNA
10458
- * organizacion.
10703
+ * y conducir el flujo desde el front propio. Caduca a los quince minutos (`expires_at`), sirve para
10704
+ * UNA organizacion y se gasta en cuanto conecta una cuenta.
10459
10705
  */
10460
10706
  type ConnectToken = Operations["createTemporalConnectToken"]["responses"][200]["content"]["application/json"];
10461
10707
  /**
10462
- * El enlace de autorizacion de UNA red. Se manda al usuario ahi y la red lo devuelve al panel de
10463
- * PlanVortex, que es quien completa la conexion.
10708
+ * Como se conecta UNA red. Casi siempre es un enlace: se manda al usuario ahi y la red lo devuelve
10709
+ * al panel de PlanVortex, que es quien completa la conexion.
10710
+ *
10711
+ * **Casi. Mira `authorization.type` y no si `link` esta vacio.** WhatsApp no tiene URL de
10712
+ * autorizacion: su alta es el Embedded Signup de Meta, un popup que levanta el SDK de JavaScript de
10713
+ * Facebook desde tu pagina y que devuelve por `postMessage` datos —el `waba_id`, el
10714
+ * `phone_number_id`— que no caben en una query string. Su `link` es cadena vacia y los parametros
10715
+ * del popup (`app_id`, `config_id`, `graph_version`...) viajan en `authorization`.
10464
10716
  */
10465
10717
  type ConnectLink = Schemas["AccountsSocialLinksList"]["links"][number];
10718
+ /**
10719
+ * Con que se autoriza una red: `redirect` (las otras nueve) o `meta_embedded_signup` (WhatsApp).
10720
+ * Se saca de {@link ConnectLink} y esta aqui para poder nombrarlo en un `switch`.
10721
+ */
10722
+ type SocialAuthorizationMethod = ConnectLink["authorization"];
10466
10723
  /**
10467
10724
  * Lo que dejo una autorizacion: las cuentas que se pueden dar de alta.
10468
10725
  *
@@ -10512,7 +10769,7 @@ type FileProperties = Schemas["FileProperties"];
10512
10769
  * Si `state` es `withErrors`, el motivo esta en `publication_errors` —que es un ARRAY— y su `code`
10513
10770
  * es un codigo del catalogo de PlanVortex, nunca un status HTTP.
10514
10771
  */
10515
- type Publication = Override<Schemas["PublicationsPublication"], {
10772
+ type Publication = Override<Schemas["Publication"], {
10516
10773
  social_network: SocialNetwork;
10517
10774
  state: PublicationState;
10518
10775
  publication_type: PublicationType;
@@ -10541,9 +10798,9 @@ type PublicationInput = Override<Schemas["PublicationsPublicationInput"], {
10541
10798
  publish_date: string | Date;
10542
10799
  }>;
10543
10800
  /** El desglose crudo de metricas que da la red, que no es el mismo en dos redes cualesquiera. */
10544
- type PublicationStats = Schemas["PublicationsPublicationStats"];
10801
+ type PublicationStats = Schemas["PublicationStats"];
10545
10802
  /** Las metricas comparables entre redes: las que se pueden sumar en una grafica. */
10546
- type PublicationMetrics = Schemas["PublicationsNormalizedMetrics"];
10803
+ type PublicationMetrics = Schemas["NormalizedMetrics"];
10547
10804
  /** La serie historica de una publicacion, mas su ultima medicion. */
10548
10805
  type PublicationStatsHistory = Override<Schemas["PublicationsPublicationStatsHistory"], {
10549
10806
  social_network: SocialNetwork;
@@ -10556,18 +10813,91 @@ type PublicationStatsPoint = Override<Schemas["PublicationsPublicationStatsPoint
10556
10813
  /**
10557
10814
  * Un comentario, o una resena de Google Business.
10558
10815
  *
10559
- * `id_publication` **falta** cuando el comentario cuelga de una ficha y no de una publicacion
10560
- * nuestra, que es justo el caso de Google Business: ahi `publication_external_id` es la ficha
10561
- * (`locations/{id}`). `rating` solo llega donde se valora con estrellas, y una resena puede venir
10562
- * sin texto ninguno. De lo nuestro solo son `read` y `replied`: todo lo demas lo manda la red.
10816
+ * TRES COSAS QUE SORPRENDEN, las tres comprobadas contra el servidor en la fase 7:
10817
+ *
10818
+ * - **`id_publication` falta** cuando el comentario no cuelga de una publicacion nuestra, y eso
10819
+ * no es raro: la resena de Google Business cuelga de la FICHA (ahi `publication_external_id`
10820
+ * es `locations/{id}`), y un video subido a mano al canal o un post anterior a PlanVortex
10821
+ * tambien reciben comentarios. Lo que identifica siempre es `publication_external_id`.
10822
+ * - **`id_account` e `id_publication` cambian de forma segun la operacion**: LA BANDEJA los
10823
+ * devuelve poblados —el objeto entero— y todo lo demas —los hilos en vivo, responder,
10824
+ * actualizar— como cadena. Es la misma asimetria que `Publication.id_account` y se tapa igual,
10825
+ * con {@link accountId} / {@link account} y {@link publicationId} / {@link publication}.
10826
+ * - **`text` puede venir vacio y no es un fallo**: una resena de solo estrellas no lleva texto,
10827
+ * asi que se pinta el `rating` al lado en vez de dar la fila por rota.
10828
+ *
10829
+ * De lo nuestro solo son `read` y `replied`. Todo lo demas lo manda la red, y una lectura en vivo
10830
+ * pisa lo guardado.
10563
10831
  */
10564
10832
  type Comment = Override<Schemas["CommentsComment"], {
10565
10833
  social_network: CommentNetwork;
10834
+ id_account: string | Account;
10835
+ id_publication: string | Publication;
10566
10836
  }>;
10567
10837
  /** Quien escribio un comentario. `is_own` distingue el nuestro del de un tercero. */
10568
10838
  type CommentAuthor = Schemas["CommentsCommentAuthor"];
10569
- /** Una conversacion de mensajeria con un contacto. */
10570
- type Conversation = Schemas["MessagesConversation"];
10839
+ /**
10840
+ * Un hilo LEIDO EN VIVO: lo que la red dice ahora mismo, ya reconciliado con lo guardado.
10841
+ *
10842
+ * DOS COSAS: `credits_consumed` es dinero de verdad y solo en X —un credito por respuesta
10843
+ * devuelta, `0` en las demas redes—, y `next_cursor` es el token opaco de la red, que se devuelve
10844
+ * TAL CUAL como `offset` en la llamada siguiente. Que falte significa que no hay mas paginas.
10845
+ */
10846
+ type CommentThread = Override<Schemas["CommentsCommentThread"], {
10847
+ comments: Comment[];
10848
+ }>;
10849
+ /**
10850
+ * Lo que devuelve responder a un comentario: el comentario ya marcado como respondido, la
10851
+ * respuesta, y lo que costo.
10852
+ *
10853
+ * **`reply` puede llegar SIN `_id`.** La respuesta se publica primero en la red y se guarda
10854
+ * despues, y guardarla no puede tumbar la peticion —la red ya la publico—, asi que cuando esa
10855
+ * escritura falla lo que llega es lo que devolvio la red, sin identificador de PlanVortex. El
10856
+ * campo que la identifica siempre es `comment.our_reply_external_id`.
10857
+ */
10858
+ interface CommentReplyResult {
10859
+ comment: Comment;
10860
+ reply: Comment;
10861
+ credits_consumed: number;
10862
+ }
10863
+ /**
10864
+ * Una conversacion: un contacto, cuando escribio por ultima vez y cuantos mensajes suyos quedan
10865
+ * sin leer.
10866
+ *
10867
+ * No tiene `_id` propio —sale de una agregacion que lo proyecta fuera— porque la conversacion no
10868
+ * es una entidad: lo que existe son los mensajes con ese contacto. El identificador con el que se
10869
+ * abre el hilo es `conversation.contact._id`.
10870
+ */
10871
+ type Conversation = Override<Schemas["MessagesConversation"], {
10872
+ contact: Contact;
10873
+ }>;
10874
+ /**
10875
+ * Cuantas conversaciones hubo en un rango. Son DOS respuestas distintas, no una con campos de mas:
10876
+ * sin `group_by` llega `{total}` y con el llega `{stats, group}`.
10877
+ *
10878
+ * OJO CON `groupValue`: es el NUMERO que dan `$dayOfYear`, `$month` o `$year` de Mongo —240, 8,
10879
+ * 2026—, no una fecha. Con `group_by: "day"` dos anos del mismo rango caen en el mismo valor.
10880
+ */
10881
+ type ConversationTotals = Schemas["MessagesConversationTotals"];
10882
+ /**
10883
+ * Lo que se manda para escribir un mensaje.
10884
+ *
10885
+ * `comment_message` y `publication_message` estan en {@link MessageType} pero **no se pueden
10886
+ * enviar por aqui**: las dos necesitan el identificador de lo que responden y el endpoint no lo lee
10887
+ * del cuerpo, asi que el mensaje saldria sin destinatario.
10888
+ */
10889
+ type MessageInput = Override<Schemas["MessagesMessageInput"], {
10890
+ message_options: Partial<MessageOptions>;
10891
+ }>;
10892
+ /**
10893
+ * Una plantilla de mensaje, **en el formato de la red**: `name`, `status`, `components` y
10894
+ * `language` de Meta.
10895
+ *
10896
+ * No se traduce a un tipo nuestro a proposito. La plantilla que hay que nombrar al enviar
10897
+ * (`message_options.template_name`) es la de la red, asi que inventar aqui otra forma obligaria a
10898
+ * traducir de vuelta en el unico sitio donde se usa. Y es de WhatsApp y de nadie mas.
10899
+ */
10900
+ type MessageTemplate = Record<string, unknown>;
10571
10901
  /**
10572
10902
  * Un mensaje intercambiado con un contacto.
10573
10903
  *
@@ -10591,16 +10921,165 @@ type Message = Override<Schemas["Message"], {
10591
10921
  type MessageOptions = Override<Schemas["MessageOptions"], {
10592
10922
  files: (string | Upload)[];
10593
10923
  }>;
10924
+ /** Que clase de mensaje es. `simple_message` y `file_message` valen en todas las redes. */
10925
+ type MessageType = Schemas["MessageType"];
10594
10926
  /** Un contacto de la agenda de la organizacion. */
10595
10927
  type Contact = Schemas["Contact"];
10596
- /** Un producto del catalogo de una cuenta (solo en las redes que venden). */
10928
+ /**
10929
+ * Lo que se manda para dar de alta un contacto.
10930
+ *
10931
+ * `social_identifiers` NO es opcional: un contacto sin canal es un contacto al que nadie puede
10932
+ * escribir, y el servidor lo rechaza con el error 1601.
10933
+ */
10934
+ type ContactCreate = Schemas["ContactsContactCreate"];
10935
+ /**
10936
+ * Lo que se manda para cambiar un contacto.
10937
+ *
10938
+ * **`extra_data` es destructivo**: es el unico campo que el servidor escribe con lo que llegue en
10939
+ * vez de conservarlo, asi que omitirlo BORRA los campos propios del contacto. Los otros tres se
10940
+ * respetan cuando no viajan.
10941
+ */
10942
+ type ContactUpdate = Schemas["ContactsContactUpdate"];
10943
+ /** Los campos propios de un contacto: el bloque de direccion y las seis propiedades libres. */
10944
+ type ContactExtraData = Schemas["ContactExtraData"];
10945
+ /** El mismo contacto, en un canal. Es una red social o `email`. */
10946
+ type SocialIdentifier = Schemas["SocialIdentifier"];
10947
+ /**
10948
+ * El mismo, tal y como se MANDA: aqui `_id` es opcional y el servidor pone uno.
10949
+ *
10950
+ * Son dos tipos y no uno porque el que vuelve siempre trae `_id` y el que se manda casi nunca lo
10951
+ * lleva; con un solo tipo, o se exige un identificador que aun no existe o se deja de garantizar
10952
+ * el que si.
10953
+ */
10954
+ type SocialIdentifierInput = Schemas["ContactsSocialIdentifierInput"];
10955
+ /** Donde se puede alcanzar a un contacto: cualquier red con mensajeria, o `email`. */
10956
+ type ContactChannel = OpenEnum<Schemas["ContactChannel"]>;
10957
+ /**
10958
+ * Un producto de un catalogo de Meta Commerce. Solo Facebook e Instagram.
10959
+ *
10960
+ * Habla el vocabulario de Meta y no uno nuestro, a diferencia de las estadisticas: lo que hay aqui
10961
+ * son los campos de la Graph API, con sus nombres.
10962
+ */
10597
10963
  type Product = Schemas["ProductsProduct"];
10598
- /** Una conexion con una herramienta de la que se traen materiales: Google Drive, un RSS. */
10964
+ /** Lo que se manda para crear un producto. Con `id` dentro, ACTUALIZA el que ya existe. */
10965
+ type ProductInput = Schemas["ProductsProductInput"];
10966
+ /** Un catalogo de Meta Commerce: lo que agrupa productos y de donde cuelga todo lo demas. */
10967
+ type ProductCatalog = Schemas["ProductsProductCatalog"];
10968
+ /** Lo que se manda para crear un catalogo. */
10969
+ type ProductCatalogInput = Schemas["ProductsProductCatalogInput"];
10970
+ /**
10971
+ * Una conexion de una ORGANIZACION con una herramienta de la que se trae material: Google Drive,
10972
+ * un feed RSS.
10973
+ *
10974
+ * No confundir con una **app** ({@link ClientApp}), que es el acceso al API de PlanVortex. Son dos
10975
+ * cosas distintas que media web ha llamado igual.
10976
+ *
10977
+ * Las credenciales no salen nunca: para saber si la conexion esta viva esta `connected`, y el
10978
+ * motivo cuando no lo esta, en `error_code`.
10979
+ */
10599
10980
  type Integration = Schemas["IntegrationsIntegration"];
10600
- /** Un plan de publicaciones generado con IA. */
10981
+ /** Que sabe hacer un proveedor y que campos lleva su formulario. Es lo que decide como conectar. */
10982
+ type IntegrationProvider = Schemas["IntegrationsIntegrationProvider"];
10983
+ /** Un proveedor soportado. Abierto porque la lista crece. */
10984
+ type IntegrationProviderName = OpenEnum<Schemas["IntegrationsIntegrationProviderName"]>;
10985
+ /** La configuracion de un feed RSS. En Google Drive el `config` es un objeto vacio. */
10986
+ type RssConfig = Schemas["IntegrationsRssConfig"];
10987
+ /**
10988
+ * Lo que se manda para conectar o reconectar. Son dos formas y las distingue `provider`: con OAuth
10989
+ * viaja el `code`, y sin el, el formulario de `config_fields`.
10990
+ */
10991
+ type IntegrationConnectRequest = Schemas["IntegrationsGoogleDriveConnectRequest"] | Schemas["IntegrationsRssConnectRequest"];
10992
+ /** Lo que se puede cambiar de una integracion ya conectada. */
10993
+ type IntegrationUpdate = Operations["updateIntegration"]["requestBody"]["content"]["application/json"];
10994
+ /**
10995
+ * Lo que el navegador necesita para abrir el Picker de Google. **Lleva un token vivo**: se pide
10996
+ * justo antes de abrirlo y no se guarda en ningun sitio.
10997
+ */
10998
+ type IntegrationPickerConfig = Operations["getIntegrationPickerConfig"]["responses"][200]["content"]["application/json"];
10999
+ /**
11000
+ * Un plan de publicaciones generado con IA.
11001
+ *
11002
+ * **`publications` cambia de forma segun la operacion**, como `Publication.id_account`: leer un
11003
+ * plan lo devuelve con las publicaciones enteras y sus ficheros, y el LISTADO devuelve sus
11004
+ * identificadores. `organization_context` es una FOTO del contexto de marca de la organizacion en
11005
+ * el momento de crear el plan, no el de ahora: es lo que hace que un reintento sea reproducible.
11006
+ */
10601
11007
  type AiPlan = Schemas["AiPlansAiPlan"];
11008
+ /** El estado de un plan. `pending` y `generating` son los dos que hay que sondear. */
11009
+ type AiPlanState = OpenEnum<AiPlan["state"]>;
11010
+ /** Las opciones con las que se genero un plan, ya normalizadas. */
11011
+ type AiPlanOptions = Schemas["AiPlansAiPlanOptions"];
11012
+ /** Las opciones tal y como se MANDAN: todas opcionales, los defaults los pone el servidor. */
11013
+ type AiPlanOptionsInput = Schemas["AiPlansAiPlanOptionsInput"];
11014
+ /** Lo que se manda para encolar un plan. */
11015
+ type AiPlanCreateRequest = Schemas["AiPlansAiPlanCreateRequest"];
11016
+ /**
11017
+ * El presupuesto DETERMINISTA de un plan, calculado por el servidor y nunca por el modelo.
11018
+ *
11019
+ * `base_cost` es lo imprescindible —orquestacion y textos—: si no cabe en `available_credits`, el
11020
+ * plan se rechaza en vez de generarse a medias. `estimated_cost` incluye ademas las imagenes
11021
+ * financiables y es una cota superior.
11022
+ */
11023
+ type AiPlanCostEstimate = Schemas["AiPlansAiPlanCostEstimate"];
11024
+ /** Lo que devuelve encolar un plan: el plan en `pending` y lo que se calculo que costaria. */
11025
+ type AiPlanCreateResult = Schemas["AiPlansAiPlanCreateResponse"];
10602
11026
  /** Una app de cliente: las credenciales con las que una integracion se autentica. */
10603
11027
  type ClientApp = Schemas["AppsClientApp"];
11028
+ /** Lo que se manda para crear o actualizar una app. Al actualizar, REEMPLAZA los cinco campos. */
11029
+ type ClientAppInput = Schemas["AppsClientAppInput"];
11030
+ /**
11031
+ * El rango que se aplico y el periodo anterior con el que se compara, de la MISMA longitud.
11032
+ *
11033
+ * No es "el mes pasado": comparar 30 dias contra un mes natural moveria el delta con el calendario.
11034
+ */
11035
+ type DashboardRange = Schemas["DashboardDashboardRange"];
11036
+ /**
11037
+ * Una metrica del vocabulario COMUN, la que se puede sumar entre redes.
11038
+ *
11039
+ * Cerrada a proposito, al reves que {@link SocialNetwork}: no es una lista que crezca sola con cada
11040
+ * red nueva, es la traduccion que hace comparables a todas. Un nombre que no este aqui es un nombre
11041
+ * crudo de una red y no se puede sumar con nada.
11042
+ */
11043
+ type MetricName = Schemas["DashboardMetricName"];
11044
+ /**
11045
+ * Una fila agregada de metricas de cuenta.
11046
+ *
11047
+ * `group` es el valor del eje —el dia, la red, el identificador de cuenta— y **es `null` cuando se
11048
+ * agrupo por `total`**: el campo viaja siempre, el valor no siempre es una cadena.
11049
+ */
11050
+ type MetricRow = Schemas["DashboardMetricRow"];
11051
+ /** Lo que devuelve {@link DashboardResource.metrics}. */
11052
+ type DashboardMetricsResult = Operations["getOrganizationMetrics"]["responses"][200]["content"]["application/json"];
11053
+ /** Los conteos de publicaciones de un rango. */
11054
+ type PublicationsSummary = Schemas["DashboardPublicationsSummary"];
11055
+ /** Lo que devuelve {@link DashboardResource.publications}: el rango mas los conteos. */
11056
+ type PublicationsSummaryResult = Operations["getPublicationsSummary"]["responses"][200]["content"]["application/json"];
11057
+ /**
11058
+ * Una fila del ranking. **No tiene la forma de una `Publication`**: sale de la agregacion de
11059
+ * estadisticas, asi que el identificador es `id_publication` y el contenido viaja anidado en
11060
+ * `publication`.
11061
+ */
11062
+ type TopPublication = Schemas["DashboardTopPublication"];
11063
+ /** Lo que devuelve {@link DashboardResource.topPublications}. */
11064
+ type TopPublicationsResult = Operations["getTopPublications"]["responses"][200]["content"]["application/json"];
11065
+ /** Lo que devuelve {@link DashboardResource.publicationStats}: los agregados y la pagina. */
11066
+ type PublicationsStatsResult = Schemas["PublicationsPublicationsStatsList"];
11067
+ /** Lo que gasta una organizacion, lo que ha repartido entre sus hijas, y lo que tiene. */
11068
+ type PlanUse = Schemas["DashboardPlanUse"];
11069
+ /** Una cuenta rota: token caducado o permiso revocado. Ni publica ni mide hasta reconectarla. */
11070
+ type AccountWithError = Schemas["DashboardAccountWithError"];
11071
+ /** Una publicacion tal y como la PROYECTA el bloque de salud: cuatro campos, no una `Publication`. */
11072
+ type DashboardPublicationRef = Schemas["DashboardDashboardPublicationRef"];
11073
+ /** El ultimo plan de IA, proyectado, tal y como lo devuelve el bloque de planes. */
11074
+ type DashboardAiPlanRef = Schemas["DashboardDashboardAiPlanRef"];
11075
+ /**
11076
+ * La pantalla de inicio entera.
11077
+ *
11078
+ * **Un bloque que falta no es un error**: cada uno se comprueba contra su propio permiso y se omite
11079
+ * si quien llama no puede leerlo, en vez de tumbar la peticion. `available_blocks` dice cuales se
11080
+ * permitieron; uno en `true` que no viene es que no habia datos.
11081
+ */
11082
+ type Dashboard = Schemas["DashboardDashboard"];
10604
11083
  /**
10605
11084
  * Los cambios que se entregan a la url de webhook de una app NO se tipan aqui.
10606
11085
  *
@@ -10610,19 +11089,40 @@ type ClientApp = Schemas["AppsClientApp"];
10610
11089
  * firma, que es donde se van a buscar. Los tipos se reexportan desde el punto de entrada
10611
11090
  * principal, asi que `import type { WebhookChange } from "planvortex"` sigue valiendo.
10612
11091
  */
11092
+ /** Cualquier cosa que la API devuelve unas veces poblada y otras como identificador. */
11093
+ interface WithAccount {
11094
+ id_account: string | Account;
11095
+ }
11096
+ /** Lo mismo con la publicacion: hoy, un comentario de la bandeja. */
11097
+ interface WithPublication {
11098
+ id_publication?: string | Publication | undefined;
11099
+ }
11100
+ /**
11101
+ * El identificador de la cuenta de una publicacion O de un comentario, venga poblada o no.
11102
+ *
11103
+ * `id_account` llega resuelto en unas operaciones y como cadena en otras —en publicaciones, las
11104
+ * de una sola frente al listado; en comentarios, justo al reves— y esto lo tapa sin obligar a
11105
+ * escribir el `typeof` en cada sitio (§ los avisos de {@link Publication} y {@link Comment}).
11106
+ */
11107
+ declare function accountId(resource: WithAccount): string;
11108
+ /**
11109
+ * La cuenta cuando viene poblada, y `undefined` cuando la API solo mando el identificador.
11110
+ * Contrapartida de {@link accountId}.
11111
+ */
11112
+ declare function account(resource: WithAccount): Account | undefined;
10613
11113
  /**
10614
- * El identificador de la cuenta de una publicacion, venga poblada o no.
11114
+ * El identificador de la publicacion de un comentario, venga poblada o no.
10615
11115
  *
10616
- * `id_account` llega resuelto en las operaciones de una sola publicacion y como cadena en el
10617
- * listado (§ el aviso de {@link Publication}). Esto lo tapa sin obligar a escribir el `typeof` en
10618
- * cada sitio.
11116
+ * Devuelve `undefined` en los dos casos en los que de verdad no hay ninguna: la resena que cuelga
11117
+ * de una ficha de Google Business y el post que no se publico desde PlanVortex.
10619
11118
  */
10620
- declare function accountId(publication: Pick<Publication, "id_account">): string;
11119
+ declare function publicationId(resource: WithPublication): string | undefined;
10621
11120
  /**
10622
- * La cuenta de una publicacion cuando viene poblada, y `undefined` cuando la API solo mando el
10623
- * identificador. Contrapartida de {@link accountId}.
11121
+ * La publicacion cuando viene poblada —solo la bandeja de comentarios la resuelve—, y
11122
+ * `undefined` cuando la API mando el identificador o cuando no hay publicacion detras.
11123
+ * Contrapartida de {@link publicationId}.
10624
11124
  */
10625
- declare function account(publication: Pick<Publication, "id_account">): Account | undefined;
11125
+ declare function publication(resource: WithPublication): Publication | undefined;
10626
11126
  /**
10627
11127
  * Hacia donde va un mensaje.
10628
11128
  *
@@ -10729,7 +11229,7 @@ declare class PlanVortexError extends Error {
10729
11229
  readonly retryAfter: number | undefined;
10730
11230
  constructor(code: number, message: string, options?: PlanVortexErrorOptions);
10731
11231
  }
10732
- /** 500-541 — tokens, apps de cliente, permisos. Incluye el 501 y el 522, los de token caducado. */
11232
+ /** 500-544 — tokens, apps de cliente, permisos. Incluye el 501 y el 522, los de token caducado. */
10733
11233
  declare class AuthError extends PlanVortexError {
10734
11234
  }
10735
11235
  /** 601-612 — el usuario final. */
@@ -11071,4 +11571,4 @@ interface PlanVortexWebhooksOptions {
11071
11571
  */
11072
11572
  declare function planvortexWebhooks(options: PlanVortexWebhooksOptions): (request: WebhookRequestLike, response: WebhookResponseLike, next: (error?: unknown) => void) => void;
11073
11573
 
11074
- export { NO_ERROR_CODE as $, type Account as A, type ClientApp as B, type ConnectLink as C, type ClientPlan as D, type EnableResult as E, type Comment as F, type CommentAuthor as G, type CommentChange as H, type CommentNetwork as I, type Contact as J, ContactError as K, type Conversation as L, type EngagementBase as M, FileError as N, type Organization as O, type Paginated as P, type FileFormat as Q, type FileProperties as R, type SocialNetwork as S, type FileType as T, type Upload as U, type Integration as V, IntegrationError as W, type IntegrationErrorChange as X, type Message as Y, type MessageChange as Z, MessagingError as _, type ConnectResult as a, type components as a0, type operations as a1, type paths as a2, type webhooks as a3, type OpenEnum as a4, OrganizationError as a5, PLANVORTEX_ERROR_RANGES as a6, PlanLimitError as a7, PlanVortexAuthenticationError as a8, PlanVortexConfigError as a9, messageDirection as aA, messageFileIds as aB, messageFiles as aC, type HandleWebhookRequestOptions as aD, type PlanVortexWebhooksOptions as aE, type RawWebhookBody as aF, type VerifyWebhookSignatureOptions as aG, WEBHOOK_EVENTS as aH, WEBHOOK_SIGNATURE_HEADERS as aI, WebhookBodyError as aJ, type WebhookHeaders as aK, type WebhookRequestLike as aL, type WebhookResponseLike as aM, WebhookSignatureError as aN, handleWebhookRequest as aO, isAccountStateChange as aP, isCommentChange as aQ, isIntegrationErrorChange as aR, isMessageChange as aS, parseWebhookPayload as aT, planvortexWebhooks as aU, verifyWebhookSignature as aV, PlanVortexConnectionError as aa, PlanVortexError as ab, type PlanVortexErrorOptions as ac, type PlanVortexErrorRange as ad, type Product as ae, ProductError as af, PublicationError as ag, type PublicationErrorDetail as ah, type PublicationMetrics as ai, type PublicationStatsPoint as aj, type PublicationType as ak, type SocialCredentials as al, type SocialLimitsMap as am, TOKEN_ERROR_CODES as an, type UnknownWebhookChange as ao, UserError as ap, type WebhookAlgorithm as aq, type WebhookChange as ar, type WebhookEvent as as, account as at, accountId as au, errorFamilyForCode as av, isPlanVortexError as aw, isTokenError as ax, messageContact as ay, messageContactId as az, type AccountMetrics as b, type PersistentMenu as c, type SocialCapabilities as d, type CommentActions as e, type SocialLimits as f, type PublicationLimits as g, type AspectRatiosByNetwork as h, type Client as i, type PlanData as j, type ConnectToken as k, type PublicationInput as l, type Publication as m, type PublicationState as n, type PublicationStats as o, type PublicationStatsHistory as p, AccountError as q, type AccountMetricRow as r, type AccountStateChange as s, type AccountWebhookChangeBase as t, type AiContext as u, type AiPlan as v, AiPlanError as w, type ApiErrorBody as x, type AspectRatios as y, AuthError as z };
11574
+ export { type Product as $, type Account as A, type IntegrationProvider as B, type ConnectLink as C, type Dashboard as D, type EnableResult as E, type Integration as F, type IntegrationConnectRequest as G, type IntegrationUpdate as H, type IntegrationProviderName as I, type IntegrationPickerConfig as J, type MessageTemplate as K, type Conversation as L, type MetricName as M, type ConversationTotals as N, type Message as O, type Paginated as P, type MessageInput as Q, type Client as R, type SocialNetwork as S, type TopPublicationsResult as T, type Organization as U, type AiSettings as V, type ClientWithOrganizations as W, type PlanData as X, type ConnectToken as Y, type AiContext as Z, type SocialCredentialsInput as _, type ConnectResult as a, type RssConfig as a$, type ProductInput as a0, type ProductCatalog as a1, type ProductCatalogInput as a2, type PublicationInput as a3, type PublicationState as a4, type PublicationStats as a5, type PublicationStatsHistory as a6, type Upload as a7, AccountError as a8, type AccountMetricRow as a9, type MessageChange as aA, type MessageOptions as aB, type MessageType as aC, MessagingError as aD, type MetricRow as aE, NO_ERROR_CODE as aF, type components as aG, type operations as aH, type paths as aI, type webhooks as aJ, type OpenEnum as aK, OrganizationError as aL, PLANVORTEX_ERROR_RANGES as aM, PlanLimitError as aN, PlanVortexAuthenticationError as aO, PlanVortexConfigError as aP, PlanVortexConnectionError as aQ, PlanVortexError as aR, type PlanVortexErrorOptions as aS, type PlanVortexErrorRange as aT, ProductError as aU, PublicationError as aV, type PublicationErrorDetail as aW, type PublicationMetrics as aX, type PublicationStatsPoint as aY, type PublicationType as aZ, type PublicationsSummary as a_, type AccountStateChange as aa, type AccountWebhookChangeBase as ab, type AccountWithError as ac, type AiPlanCostEstimate as ad, AiPlanError as ae, type AiPlanOptions as af, type AiPlanOptionsInput as ag, type AiPlanState as ah, type ApiErrorBody as ai, type AspectRatios as aj, AuthError as ak, type ClientPlan as al, type CommentAuthor as am, type CommentChange as an, type ContactChannel as ao, ContactError as ap, type DashboardAiPlanRef as aq, type DashboardPublicationRef as ar, type DashboardRange as as, type EngagementBase as at, FileError as au, type FileFormat as av, type FileProperties as aw, type FileType as ax, IntegrationError as ay, type IntegrationErrorChange as az, type AccountMetrics as b, type SocialAuthorizationMethod as b0, type SocialCredentials as b1, type SocialIdentifier as b2, type SocialIdentifierInput as b3, type SocialLimitsMap as b4, TOKEN_ERROR_CODES as b5, type TopPublication as b6, type UnknownWebhookChange as b7, UserError as b8, type WebhookAlgorithm as b9, WebhookSignatureError as bA, handleWebhookRequest as bB, isAccountStateChange as bC, isCommentChange as bD, isIntegrationErrorChange as bE, isMessageChange as bF, parseWebhookPayload as bG, planvortexWebhooks as bH, verifyWebhookSignature as bI, type WebhookChange as ba, type WebhookEvent as bb, type WithAccount as bc, type WithPublication as bd, account as be, accountId as bf, errorFamilyForCode as bg, isPlanVortexError as bh, isTokenError as bi, messageContact as bj, messageContactId as bk, messageDirection as bl, messageFileIds as bm, messageFiles as bn, publication as bo, publicationId as bp, type HandleWebhookRequestOptions as bq, type PlanVortexWebhooksOptions as br, type RawWebhookBody as bs, type VerifyWebhookSignatureOptions as bt, WEBHOOK_EVENTS as bu, WEBHOOK_SIGNATURE_HEADERS as bv, WebhookBodyError as bw, type WebhookHeaders as bx, type WebhookRequestLike as by, type WebhookResponseLike 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 CommentNetwork as o, type Comment as p, type CommentThread as q, type CommentReplyResult as r, type ContactExtraData as s, type Contact as t, type ContactCreate as u, type ContactUpdate as v, type DashboardMetricsResult as w, type PublicationsSummaryResult as x, type PublicationsStatsResult as y, type PlanUse as z };