@vitrina/api 14.24.0 → 14.26.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.
Files changed (3) hide show
  1. package/dist/index.d.cts +860 -152
  2. package/dist/index.d.ts +860 -152
  3. package/package.json +1 -1
package/dist/index.d.cts CHANGED
@@ -45354,6 +45354,307 @@ interface paths {
45354
45354
  };
45355
45355
  trace?: never;
45356
45356
  };
45357
+ "/instagram-posts/vehicles/{vehicleId}/drafts": {
45358
+ parameters: {
45359
+ query?: never;
45360
+ header?: never;
45361
+ path?: never;
45362
+ cookie?: never;
45363
+ };
45364
+ get?: never;
45365
+ put?: never;
45366
+ /**
45367
+ * Prepare an Instagram post for one-click approval
45368
+ * @description What choosing Instagram in a vehicle's "Publicar" step does: prepares a post in `pending_approval` (server-generated caption, the first 10 photos of the gallery) and publishes NOTHING. 201 when created; 200 with the existing post when the vehicle already has one waiting. 422 when the vehicle has no photos or no Instagram account is connected.
45369
+ */
45370
+ post: {
45371
+ parameters: {
45372
+ query?: never;
45373
+ header?: {
45374
+ /** @description Replay-safe retries: resending the SAME key with the SAME body returns the original response (`X-Idempotent-Replay: 1`) instead of creating a second copy — safe to send whenever a response might not have arrived. The same key with a DIFFERENT body answers `409 IDEMPOTENCY_KEY_CONFLICT`; use a fresh key per operation. */
45375
+ "Idempotency-Key"?: string;
45376
+ };
45377
+ path: {
45378
+ vehicleId: string;
45379
+ };
45380
+ cookie?: never;
45381
+ };
45382
+ requestBody?: never;
45383
+ responses: {
45384
+ /** @description The post already waiting for approval */
45385
+ 200: {
45386
+ headers: {
45387
+ [name: string]: unknown;
45388
+ };
45389
+ content: {
45390
+ "application/json": {
45391
+ data?: unknown;
45392
+ meta?: {
45393
+ [key: string]: unknown;
45394
+ };
45395
+ };
45396
+ };
45397
+ };
45398
+ /** @description The prepared post */
45399
+ 201: {
45400
+ headers: {
45401
+ [name: string]: unknown;
45402
+ };
45403
+ content: {
45404
+ /**
45405
+ * @example {
45406
+ * "data": {
45407
+ * "id": "1a5ea0c1-0000-4000-8000-000000000001",
45408
+ * "vehicle_id": "c4c4c4c4-0000-4000-8000-000000000001",
45409
+ * "status": "pending_approval",
45410
+ * "caption": "⚡️Se vende! Toyota RAV4 Híbrido 2022\n\n$24.990.000\n\n- Automática\n- 38.000 km\n\nEscríbenos por DM.",
45411
+ * "photos": [
45412
+ * {
45413
+ * "photo_index": 0,
45414
+ * "crop": null,
45415
+ * "resolved_url": "https://cdn.vitrinadev.com/vehicles/rav4-1.jpg"
45416
+ * },
45417
+ * {
45418
+ * "photo_index": 1,
45419
+ * "crop": null,
45420
+ * "resolved_url": "https://cdn.vitrinadev.com/vehicles/rav4-2.jpg"
45421
+ * }
45422
+ * ],
45423
+ * "scheduled_at": null,
45424
+ * "published_at": null,
45425
+ * "published_media_id": null,
45426
+ * "messaging_account_id": null,
45427
+ * "error": null,
45428
+ * "created_by": "5e5e5e5e-0000-4000-8000-000000000001",
45429
+ * "created_at": "2026-10-15T14:00:00.000Z",
45430
+ * "updated_at": "2026-10-15T14:00:00.000Z"
45431
+ * }
45432
+ * }
45433
+ */
45434
+ "application/json": {
45435
+ data?: unknown;
45436
+ };
45437
+ };
45438
+ };
45439
+ /** @description Validation error */
45440
+ 400: {
45441
+ headers: {
45442
+ [name: string]: unknown;
45443
+ };
45444
+ content: {
45445
+ "application/json": components["schemas"]["Error"];
45446
+ };
45447
+ };
45448
+ /** @description Unauthorized */
45449
+ 401: {
45450
+ headers: {
45451
+ [name: string]: unknown;
45452
+ };
45453
+ content: {
45454
+ "application/json": components["schemas"]["Error"];
45455
+ };
45456
+ };
45457
+ /** @description Forbidden */
45458
+ 403: {
45459
+ headers: {
45460
+ [name: string]: unknown;
45461
+ };
45462
+ content: {
45463
+ "application/json": components["schemas"]["Error"];
45464
+ };
45465
+ };
45466
+ /** @description Not found */
45467
+ 404: {
45468
+ headers: {
45469
+ [name: string]: unknown;
45470
+ };
45471
+ content: {
45472
+ "application/json": components["schemas"]["Error"];
45473
+ };
45474
+ };
45475
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
45476
+ 409: {
45477
+ headers: {
45478
+ [name: string]: unknown;
45479
+ };
45480
+ content: {
45481
+ "application/json": components["schemas"]["Error"];
45482
+ };
45483
+ };
45484
+ /** @description Rate limited */
45485
+ 429: {
45486
+ headers: {
45487
+ [name: string]: unknown;
45488
+ };
45489
+ content: {
45490
+ "application/json": components["schemas"]["Error"];
45491
+ };
45492
+ };
45493
+ };
45494
+ };
45495
+ delete?: never;
45496
+ options?: never;
45497
+ head?: never;
45498
+ patch?: never;
45499
+ trace?: never;
45500
+ };
45501
+ "/instagram-posts/{id}/approve": {
45502
+ parameters: {
45503
+ query?: never;
45504
+ header?: never;
45505
+ path?: never;
45506
+ cookie?: never;
45507
+ };
45508
+ get?: never;
45509
+ put?: never;
45510
+ /**
45511
+ * Approve and publish (or schedule) a prepared Instagram post
45512
+ * @description Publishes a `pending_approval` post, optionally with an edited caption / photo selection, or schedules it when `scheduled_at` is present. Like the compose POST, a publish that Instagram refuses answers 200 with `status: "failed"` and the reason — branch on `status`. 409 when the post is no longer waiting for approval.
45513
+ */
45514
+ post: {
45515
+ parameters: {
45516
+ query?: never;
45517
+ header?: {
45518
+ /** @description Replay-safe retries: resending the SAME key with the SAME body returns the original response (`X-Idempotent-Replay: 1`) instead of creating a second copy — safe to send whenever a response might not have arrived. The same key with a DIFFERENT body answers `409 IDEMPOTENCY_KEY_CONFLICT`; use a fresh key per operation. */
45519
+ "Idempotency-Key"?: string;
45520
+ };
45521
+ path: {
45522
+ id: string;
45523
+ };
45524
+ cookie?: never;
45525
+ };
45526
+ requestBody?: {
45527
+ content: {
45528
+ /**
45529
+ * @example {
45530
+ * "caption": "⚡️Se vende! Toyota RAV4 Híbrido 2022\n\n$24.990.000\n\n- Automática\n- 38.000 km\n\nEscríbenos por DM.",
45531
+ * "scheduled_at": "2026-10-16T13:00:00.000Z"
45532
+ * }
45533
+ */
45534
+ "application/json": {
45535
+ photos?: {
45536
+ photo_index: number;
45537
+ crop?: {
45538
+ preset?: string;
45539
+ x?: number;
45540
+ y?: number;
45541
+ width?: number;
45542
+ height?: number;
45543
+ } | null;
45544
+ }[];
45545
+ caption?: string;
45546
+ /** Format: date-time */
45547
+ scheduled_at?: string;
45548
+ };
45549
+ };
45550
+ };
45551
+ responses: {
45552
+ /** @description The approved post */
45553
+ 200: {
45554
+ headers: {
45555
+ [name: string]: unknown;
45556
+ };
45557
+ content: {
45558
+ /**
45559
+ * @example {
45560
+ * "data": {
45561
+ * "id": "1a5ea0c1-0000-4000-8000-000000000001",
45562
+ * "vehicle_id": "c4c4c4c4-0000-4000-8000-000000000001",
45563
+ * "status": "scheduled",
45564
+ * "caption": "⚡️Se vende! Toyota RAV4 Híbrido 2022\n\n$24.990.000\n\n- Automática\n- 38.000 km\n\nEscríbenos por DM.",
45565
+ * "photos": [
45566
+ * {
45567
+ * "photo_index": 0,
45568
+ * "crop": null,
45569
+ * "resolved_url": "https://cdn.vitrinadev.com/vehicles/rav4-1.jpg"
45570
+ * },
45571
+ * {
45572
+ * "photo_index": 1,
45573
+ * "crop": null,
45574
+ * "resolved_url": "https://cdn.vitrinadev.com/vehicles/rav4-2.jpg"
45575
+ * }
45576
+ * ],
45577
+ * "scheduled_at": "2026-10-16T13:00:00.000Z",
45578
+ * "published_at": null,
45579
+ * "published_media_id": null,
45580
+ * "messaging_account_id": null,
45581
+ * "error": null,
45582
+ * "created_by": "5e5e5e5e-0000-4000-8000-000000000001",
45583
+ * "created_at": "2026-10-15T14:00:00.000Z",
45584
+ * "updated_at": "2026-10-15T14:02:10.000Z"
45585
+ * }
45586
+ * }
45587
+ */
45588
+ "application/json": {
45589
+ data?: unknown;
45590
+ meta?: {
45591
+ [key: string]: unknown;
45592
+ };
45593
+ };
45594
+ };
45595
+ };
45596
+ /** @description Validation error */
45597
+ 400: {
45598
+ headers: {
45599
+ [name: string]: unknown;
45600
+ };
45601
+ content: {
45602
+ "application/json": components["schemas"]["Error"];
45603
+ };
45604
+ };
45605
+ /** @description Unauthorized */
45606
+ 401: {
45607
+ headers: {
45608
+ [name: string]: unknown;
45609
+ };
45610
+ content: {
45611
+ "application/json": components["schemas"]["Error"];
45612
+ };
45613
+ };
45614
+ /** @description Forbidden */
45615
+ 403: {
45616
+ headers: {
45617
+ [name: string]: unknown;
45618
+ };
45619
+ content: {
45620
+ "application/json": components["schemas"]["Error"];
45621
+ };
45622
+ };
45623
+ /** @description Not found */
45624
+ 404: {
45625
+ headers: {
45626
+ [name: string]: unknown;
45627
+ };
45628
+ content: {
45629
+ "application/json": components["schemas"]["Error"];
45630
+ };
45631
+ };
45632
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
45633
+ 409: {
45634
+ headers: {
45635
+ [name: string]: unknown;
45636
+ };
45637
+ content: {
45638
+ "application/json": components["schemas"]["Error"];
45639
+ };
45640
+ };
45641
+ /** @description Rate limited */
45642
+ 429: {
45643
+ headers: {
45644
+ [name: string]: unknown;
45645
+ };
45646
+ content: {
45647
+ "application/json": components["schemas"]["Error"];
45648
+ };
45649
+ };
45650
+ };
45651
+ };
45652
+ delete?: never;
45653
+ options?: never;
45654
+ head?: never;
45655
+ patch?: never;
45656
+ trace?: never;
45657
+ };
45357
45658
  "/margin/preview": {
45358
45659
  parameters: {
45359
45660
  query?: never;
@@ -167399,44 +167700,350 @@ interface paths {
167399
167700
  };
167400
167701
  };
167401
167702
  };
167402
- put?: never;
167703
+ put?: never;
167704
+ /**
167705
+ * Add a member
167706
+ * @description `user_id` must already be an **active member of this workspace** — an unknown user, one from another workspace, or a deactivated one is refused with a 400. That check is what stops `teams:write` being used to graft an arbitrary user id onto a team, so it is deliberate rather than incidental validation.
167707
+ *
167708
+ * `role` defaults to `member`. Adding the same user twice is a **409** (one membership per user per team). `added_by` records the human who made the change and is NULL when an `sk_*` API key does it, since a key has no subject.
167709
+ */
167710
+ post: {
167711
+ parameters: {
167712
+ query?: never;
167713
+ header?: {
167714
+ /** @description Replay-safe retries: resending the SAME key with the SAME body returns the original response (`X-Idempotent-Replay: 1`) instead of creating a second copy — safe to send whenever a response might not have arrived. The same key with a DIFFERENT body answers `409 IDEMPOTENCY_KEY_CONFLICT`; use a fresh key per operation. */
167715
+ "Idempotency-Key"?: string;
167716
+ };
167717
+ path: {
167718
+ id: string;
167719
+ };
167720
+ cookie?: never;
167721
+ };
167722
+ requestBody?: {
167723
+ content: {
167724
+ /**
167725
+ * @example {
167726
+ * "user_id": "e6e6e6e6-0000-4000-8000-000000000002",
167727
+ * "role": "member"
167728
+ * }
167729
+ */
167730
+ "application/json": {
167731
+ /** Format: uuid */
167732
+ user_id: string;
167733
+ /** @enum {string} */
167734
+ role?: "lead" | "member";
167735
+ };
167736
+ };
167737
+ };
167738
+ responses: {
167739
+ /** @description The membership */
167740
+ 201: {
167741
+ headers: {
167742
+ [name: string]: unknown;
167743
+ };
167744
+ content: {
167745
+ /**
167746
+ * @example {
167747
+ * "data": {
167748
+ * "id": "e7e7e7e7-0000-4000-8000-000000000001",
167749
+ * "team_id": "cccccccc-0000-4000-8000-000000000001",
167750
+ * "user_id": "e6e6e6e6-0000-4000-8000-000000000002",
167751
+ * "role": "member",
167752
+ * "added_by": "11111111-0000-4000-8000-000000000001",
167753
+ * "added_at": "2026-01-10T13:05:00.000Z"
167754
+ * }
167755
+ * }
167756
+ */
167757
+ "application/json": {
167758
+ data?: unknown;
167759
+ };
167760
+ };
167761
+ };
167762
+ /** @description Validation error */
167763
+ 400: {
167764
+ headers: {
167765
+ [name: string]: unknown;
167766
+ };
167767
+ content: {
167768
+ "application/json": components["schemas"]["Error"];
167769
+ };
167770
+ };
167771
+ /** @description Unauthorized */
167772
+ 401: {
167773
+ headers: {
167774
+ [name: string]: unknown;
167775
+ };
167776
+ content: {
167777
+ "application/json": components["schemas"]["Error"];
167778
+ };
167779
+ };
167780
+ /** @description Forbidden */
167781
+ 403: {
167782
+ headers: {
167783
+ [name: string]: unknown;
167784
+ };
167785
+ content: {
167786
+ "application/json": components["schemas"]["Error"];
167787
+ };
167788
+ };
167789
+ /** @description Not found */
167790
+ 404: {
167791
+ headers: {
167792
+ [name: string]: unknown;
167793
+ };
167794
+ content: {
167795
+ "application/json": components["schemas"]["Error"];
167796
+ };
167797
+ };
167798
+ /** @description That user is already in this team */
167799
+ 409: {
167800
+ headers: {
167801
+ [name: string]: unknown;
167802
+ };
167803
+ content?: never;
167804
+ };
167805
+ /** @description Rate limited */
167806
+ 429: {
167807
+ headers: {
167808
+ [name: string]: unknown;
167809
+ };
167810
+ content: {
167811
+ "application/json": components["schemas"]["Error"];
167812
+ };
167813
+ };
167814
+ };
167815
+ };
167816
+ delete?: never;
167817
+ options?: never;
167818
+ head?: never;
167819
+ patch?: never;
167820
+ trace?: never;
167821
+ };
167822
+ "/teams/{id}/members/{membershipId}": {
167823
+ parameters: {
167824
+ query?: never;
167825
+ header?: never;
167826
+ path?: never;
167827
+ cookie?: never;
167828
+ };
167829
+ get?: never;
167830
+ /**
167831
+ * Change a member’s role
167832
+ * @description Moves a membership between `lead` and `member`. The role is a label on the team, not a permission grant: what a user may DO is decided by their workspace role and scopes, so promoting someone to `lead` here does not widen their access.
167833
+ */
167834
+ put: {
167835
+ parameters: {
167836
+ query?: never;
167837
+ header?: never;
167838
+ path: {
167839
+ id: string;
167840
+ membershipId: string;
167841
+ };
167842
+ cookie?: never;
167843
+ };
167844
+ requestBody?: {
167845
+ content: {
167846
+ /**
167847
+ * @example {
167848
+ * "role": "lead"
167849
+ * }
167850
+ */
167851
+ "application/json": {
167852
+ /** @enum {string} */
167853
+ role: "lead" | "member";
167854
+ };
167855
+ };
167856
+ };
167857
+ responses: {
167858
+ /** @description The updated membership */
167859
+ 200: {
167860
+ headers: {
167861
+ [name: string]: unknown;
167862
+ };
167863
+ content: {
167864
+ /**
167865
+ * @example {
167866
+ * "data": {
167867
+ * "id": "e7e7e7e7-0000-4000-8000-000000000001",
167868
+ * "team_id": "cccccccc-0000-4000-8000-000000000001",
167869
+ * "user_id": "11111111-0000-4000-8000-000000000001",
167870
+ * "role": "lead",
167871
+ * "added_by": "11111111-0000-4000-8000-000000000001",
167872
+ * "added_at": "2026-01-10T13:05:00.000Z"
167873
+ * }
167874
+ * }
167875
+ */
167876
+ "application/json": {
167877
+ data?: unknown;
167878
+ meta?: {
167879
+ [key: string]: unknown;
167880
+ };
167881
+ };
167882
+ };
167883
+ };
167884
+ /** @description Validation error */
167885
+ 400: {
167886
+ headers: {
167887
+ [name: string]: unknown;
167888
+ };
167889
+ content: {
167890
+ "application/json": components["schemas"]["Error"];
167891
+ };
167892
+ };
167893
+ /** @description Unauthorized */
167894
+ 401: {
167895
+ headers: {
167896
+ [name: string]: unknown;
167897
+ };
167898
+ content: {
167899
+ "application/json": components["schemas"]["Error"];
167900
+ };
167901
+ };
167902
+ /** @description Forbidden */
167903
+ 403: {
167904
+ headers: {
167905
+ [name: string]: unknown;
167906
+ };
167907
+ content: {
167908
+ "application/json": components["schemas"]["Error"];
167909
+ };
167910
+ };
167911
+ /** @description Not found */
167912
+ 404: {
167913
+ headers: {
167914
+ [name: string]: unknown;
167915
+ };
167916
+ content: {
167917
+ "application/json": components["schemas"]["Error"];
167918
+ };
167919
+ };
167920
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
167921
+ 409: {
167922
+ headers: {
167923
+ [name: string]: unknown;
167924
+ };
167925
+ content: {
167926
+ "application/json": components["schemas"]["Error"];
167927
+ };
167928
+ };
167929
+ /** @description Rate limited */
167930
+ 429: {
167931
+ headers: {
167932
+ [name: string]: unknown;
167933
+ };
167934
+ content: {
167935
+ "application/json": components["schemas"]["Error"];
167936
+ };
167937
+ };
167938
+ };
167939
+ };
167940
+ post?: never;
167941
+ /**
167942
+ * Remove a member
167943
+ * @description Removes the membership only — the user keeps their workspace account and any other team. Tickets already assigned to them keep the assignment: `ticket.assignee_user_id` is deliberately not a foreign key, so work in flight is not orphaned by a team change.
167944
+ */
167945
+ delete: {
167946
+ parameters: {
167947
+ query?: never;
167948
+ header?: never;
167949
+ path: {
167950
+ id: string;
167951
+ membershipId: string;
167952
+ };
167953
+ cookie?: never;
167954
+ };
167955
+ requestBody?: never;
167956
+ responses: {
167957
+ /** @description No content */
167958
+ 204: {
167959
+ headers: {
167960
+ [name: string]: unknown;
167961
+ };
167962
+ content?: never;
167963
+ };
167964
+ /** @description Validation error */
167965
+ 400: {
167966
+ headers: {
167967
+ [name: string]: unknown;
167968
+ };
167969
+ content: {
167970
+ "application/json": components["schemas"]["Error"];
167971
+ };
167972
+ };
167973
+ /** @description Unauthorized */
167974
+ 401: {
167975
+ headers: {
167976
+ [name: string]: unknown;
167977
+ };
167978
+ content: {
167979
+ "application/json": components["schemas"]["Error"];
167980
+ };
167981
+ };
167982
+ /** @description Forbidden */
167983
+ 403: {
167984
+ headers: {
167985
+ [name: string]: unknown;
167986
+ };
167987
+ content: {
167988
+ "application/json": components["schemas"]["Error"];
167989
+ };
167990
+ };
167991
+ /** @description Not found */
167992
+ 404: {
167993
+ headers: {
167994
+ [name: string]: unknown;
167995
+ };
167996
+ content: {
167997
+ "application/json": components["schemas"]["Error"];
167998
+ };
167999
+ };
168000
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
168001
+ 409: {
168002
+ headers: {
168003
+ [name: string]: unknown;
168004
+ };
168005
+ content: {
168006
+ "application/json": components["schemas"]["Error"];
168007
+ };
168008
+ };
168009
+ /** @description Rate limited */
168010
+ 429: {
168011
+ headers: {
168012
+ [name: string]: unknown;
168013
+ };
168014
+ content: {
168015
+ "application/json": components["schemas"]["Error"];
168016
+ };
168017
+ };
168018
+ };
168019
+ };
168020
+ options?: never;
168021
+ head?: never;
168022
+ patch?: never;
168023
+ trace?: never;
168024
+ };
168025
+ "/digest/config": {
168026
+ parameters: {
168027
+ query?: never;
168028
+ header?: never;
168029
+ path?: never;
168030
+ cookie?: never;
168031
+ };
167403
168032
  /**
167404
- * Add a member
167405
- * @description `user_id` must already be an **active member of this workspace** — an unknown user, one from another workspace, or a deactivated one is refused with a 400. That check is what stops `teams:write` being used to graft an arbitrary user id onto a team, so it is deliberate rather than incidental validation.
167406
- *
167407
- * `role` defaults to `member`. Adding the same user twice is a **409** (one membership per user per team). `added_by` records the human who made the change and is NULL when an `sk_*` API key does it, since a key has no subject.
168033
+ * Get the Monday-digest configuration
168034
+ * @description The tenant's digest config (created with its defaults — enabled, Monday 08:00 America/Santiago, email on, WhatsApp OFF — on first read if no row exists yet; WhatsApp sends cost money, so an admin opts in with `whatsapp_enabled: true`, which submits the summary templates to Meta) alongside the RESOLVED recipient list: one entry per active workspace member, with their effective variant(s) (`owner`/`seller`), per-channel eligibility, opt-out state and normalized phone (or a skip reason when none is usable). A member with no explicit override shows the role-derived default (`source: "role_default"`); one who has been customized shows `source: "explicit"`. `whatsapp_templates` reports the WhatsApp templates: `status` is `off` | `no_whatsapp` | `pending` | `ready` | `attention` | `unknown`, with one `templates[]` row per (entry `owner`|`seller`, number) carrying `state` (`missing`|`pending`|`approved`|`rejected`|`blocked`) and `rejection_reason`.
167408
168035
  */
167409
- post: {
168036
+ get: {
167410
168037
  parameters: {
167411
168038
  query?: never;
167412
- header?: {
167413
- /** @description Replay-safe retries: resending the SAME key with the SAME body returns the original response (`X-Idempotent-Replay: 1`) instead of creating a second copy — safe to send whenever a response might not have arrived. The same key with a DIFFERENT body answers `409 IDEMPOTENCY_KEY_CONFLICT`; use a fresh key per operation. */
167414
- "Idempotency-Key"?: string;
167415
- };
167416
- path: {
167417
- id: string;
167418
- };
168039
+ header?: never;
168040
+ path?: never;
167419
168041
  cookie?: never;
167420
168042
  };
167421
- requestBody?: {
167422
- content: {
167423
- /**
167424
- * @example {
167425
- * "user_id": "e6e6e6e6-0000-4000-8000-000000000002",
167426
- * "role": "member"
167427
- * }
167428
- */
167429
- "application/json": {
167430
- /** Format: uuid */
167431
- user_id: string;
167432
- /** @enum {string} */
167433
- role?: "lead" | "member";
167434
- };
167435
- };
167436
- };
168043
+ requestBody?: never;
167437
168044
  responses: {
167438
- /** @description The membership */
167439
- 201: {
168045
+ /** @description The digest config and resolved recipient list */
168046
+ 200: {
167440
168047
  headers: {
167441
168048
  [name: string]: unknown;
167442
168049
  };
@@ -167444,17 +168051,87 @@ interface paths {
167444
168051
  /**
167445
168052
  * @example {
167446
168053
  * "data": {
167447
- * "id": "e7e7e7e7-0000-4000-8000-000000000001",
167448
- * "team_id": "cccccccc-0000-4000-8000-000000000001",
167449
- * "user_id": "e6e6e6e6-0000-4000-8000-000000000002",
167450
- * "role": "member",
167451
- * "added_by": "11111111-0000-4000-8000-000000000001",
167452
- * "added_at": "2026-01-10T13:05:00.000Z"
168054
+ * "config": {
168055
+ * "id": "d1d1d1d1-0000-4000-8000-000000000001",
168056
+ * "tenant_id": "20000000-0000-4000-8000-000000000002",
168057
+ * "enabled": true,
168058
+ * "send_weekday": 1,
168059
+ * "send_hour": 8,
168060
+ * "send_minute": 0,
168061
+ * "timezone": "America/Santiago",
168062
+ * "whatsapp_enabled": false,
168063
+ * "email_enabled": true,
168064
+ * "enabled_at": "2026-10-15T12:00:00.000Z",
168065
+ * "created_at": "2026-10-15T12:00:00.000Z",
168066
+ * "updated_at": "2026-10-15T12:00:00.000Z"
168067
+ * },
168068
+ * "recipients": [
168069
+ * {
168070
+ * "user_id": "20000000-0000-4000-8000-000000000001",
168071
+ * "variants": [
168072
+ * "owner"
168073
+ * ],
168074
+ * "whatsapp_enabled": true,
168075
+ * "email_enabled": true,
168076
+ * "opted_out": false,
168077
+ * "phone_e164": "+56911111111",
168078
+ * "phone_skip_reason": null,
168079
+ * "source": "role_default"
168080
+ * }
168081
+ * ],
168082
+ * "whatsapp_templates": {
168083
+ * "status": "off",
168084
+ * "templates": []
168085
+ * }
167453
168086
  * }
167454
168087
  * }
167455
168088
  */
167456
168089
  "application/json": {
167457
- data?: unknown;
168090
+ data: {
168091
+ config: {
168092
+ /** Format: uuid */
168093
+ id: string;
168094
+ /** Format: uuid */
168095
+ tenant_id: string;
168096
+ enabled: boolean;
168097
+ send_weekday: number;
168098
+ send_hour: number;
168099
+ send_minute: number;
168100
+ timezone: string;
168101
+ whatsapp_enabled: boolean;
168102
+ email_enabled: boolean;
168103
+ enabled_at: string;
168104
+ created_at: string;
168105
+ updated_at: string;
168106
+ };
168107
+ recipients: {
168108
+ /** Format: uuid */
168109
+ user_id: string;
168110
+ variants: ("owner" | "seller")[];
168111
+ whatsapp_enabled: boolean;
168112
+ email_enabled: boolean;
168113
+ opted_out: boolean;
168114
+ phone_e164: string | null;
168115
+ /** @enum {string|null} */
168116
+ phone_skip_reason: "no_phone" | "unparsable" | null;
168117
+ /** @enum {string} */
168118
+ source: "explicit" | "role_default";
168119
+ }[];
168120
+ whatsapp_templates: {
168121
+ /** @enum {string} */
168122
+ status: "off" | "no_whatsapp" | "pending" | "ready" | "attention" | "unknown";
168123
+ templates: {
168124
+ /** @enum {string} */
168125
+ entry: "owner" | "seller";
168126
+ /** Format: uuid */
168127
+ messaging_account_id: string;
168128
+ name: string;
168129
+ /** @enum {string} */
168130
+ state: "missing" | "pending" | "approved" | "rejected" | "blocked";
168131
+ rejection_reason: string | null;
168132
+ }[];
168133
+ };
168134
+ };
167458
168135
  };
167459
168136
  };
167460
168137
  };
@@ -167494,12 +168171,14 @@ interface paths {
167494
168171
  "application/json": components["schemas"]["Error"];
167495
168172
  };
167496
168173
  };
167497
- /** @description That user is already in this team */
168174
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
167498
168175
  409: {
167499
168176
  headers: {
167500
168177
  [name: string]: unknown;
167501
168178
  };
167502
- content?: never;
168179
+ content: {
168180
+ "application/json": components["schemas"]["Error"];
168181
+ };
167503
168182
  };
167504
168183
  /** @description Rate limited */
167505
168184
  429: {
@@ -167512,49 +168191,45 @@ interface paths {
167512
168191
  };
167513
168192
  };
167514
168193
  };
167515
- delete?: never;
167516
- options?: never;
167517
- head?: never;
167518
- patch?: never;
167519
- trace?: never;
167520
- };
167521
- "/teams/{id}/members/{membershipId}": {
167522
- parameters: {
167523
- query?: never;
167524
- header?: never;
167525
- path?: never;
167526
- cookie?: never;
167527
- };
167528
- get?: never;
167529
168194
  /**
167530
- * Change a member’s role
167531
- * @description Moves a membership between `lead` and `member`. The role is a label on the team, not a permission grant: what a user may DO is decided by their workspace role and scopes, so promoting someone to `lead` here does not widen their access.
168195
+ * Update the Monday-digest configuration
168196
+ * @description A PUT that behaves as a PATCH: only the fields present are applied. `recipients`, if present, is a batch of per-user overrides applied in the SAME request — each entry upserts the explicit `digest_recipient` row for that `user_id` (creating it on first customization), so a settings page can save the schedule and the roster edits together. `opted_out: true` opts a recipient out (same effect as them clicking the signed email link); `opted_out: false` clears a prior opt-out. Returns the same shape as the GET.
167532
168197
  */
167533
168198
  put: {
167534
168199
  parameters: {
167535
168200
  query?: never;
167536
168201
  header?: never;
167537
- path: {
167538
- id: string;
167539
- membershipId: string;
167540
- };
168202
+ path?: never;
167541
168203
  cookie?: never;
167542
168204
  };
167543
168205
  requestBody?: {
167544
168206
  content: {
167545
168207
  /**
167546
168208
  * @example {
167547
- * "role": "lead"
168209
+ * "whatsapp_enabled": true
167548
168210
  * }
167549
168211
  */
167550
168212
  "application/json": {
167551
- /** @enum {string} */
167552
- role: "lead" | "member";
168213
+ enabled?: boolean;
168214
+ send_weekday?: number;
168215
+ send_hour?: number;
168216
+ send_minute?: number;
168217
+ timezone?: string;
168218
+ whatsapp_enabled?: boolean;
168219
+ email_enabled?: boolean;
168220
+ recipients?: {
168221
+ /** Format: uuid */
168222
+ user_id: string;
168223
+ variants?: ("owner" | "seller")[];
168224
+ whatsapp_enabled?: boolean;
168225
+ email_enabled?: boolean;
168226
+ opted_out?: boolean;
168227
+ }[];
167553
168228
  };
167554
168229
  };
167555
168230
  };
167556
168231
  responses: {
167557
- /** @description The updated membership */
168232
+ /** @description The updated digest config and resolved recipient list */
167558
168233
  200: {
167559
168234
  headers: {
167560
168235
  [name: string]: unknown;
@@ -167563,19 +168238,101 @@ interface paths {
167563
168238
  /**
167564
168239
  * @example {
167565
168240
  * "data": {
167566
- * "id": "e7e7e7e7-0000-4000-8000-000000000001",
167567
- * "team_id": "cccccccc-0000-4000-8000-000000000001",
167568
- * "user_id": "11111111-0000-4000-8000-000000000001",
167569
- * "role": "lead",
167570
- * "added_by": "11111111-0000-4000-8000-000000000001",
167571
- * "added_at": "2026-01-10T13:05:00.000Z"
168241
+ * "config": {
168242
+ * "id": "d1d1d1d1-0000-4000-8000-000000000001",
168243
+ * "tenant_id": "20000000-0000-4000-8000-000000000002",
168244
+ * "enabled": true,
168245
+ * "send_weekday": 1,
168246
+ * "send_hour": 8,
168247
+ * "send_minute": 0,
168248
+ * "timezone": "America/Santiago",
168249
+ * "whatsapp_enabled": true,
168250
+ * "email_enabled": true,
168251
+ * "enabled_at": "2026-10-15T12:00:00.000Z",
168252
+ * "created_at": "2026-10-15T12:00:00.000Z",
168253
+ * "updated_at": "2026-10-15T12:00:00.000Z"
168254
+ * },
168255
+ * "recipients": [
168256
+ * {
168257
+ * "user_id": "20000000-0000-4000-8000-000000000001",
168258
+ * "variants": [
168259
+ * "owner"
168260
+ * ],
168261
+ * "whatsapp_enabled": true,
168262
+ * "email_enabled": true,
168263
+ * "opted_out": false,
168264
+ * "phone_e164": "+56911111111",
168265
+ * "phone_skip_reason": null,
168266
+ * "source": "role_default"
168267
+ * }
168268
+ * ],
168269
+ * "whatsapp_templates": {
168270
+ * "status": "pending",
168271
+ * "templates": [
168272
+ * {
168273
+ * "entry": "owner",
168274
+ * "messaging_account_id": "a1a1a1a1-0000-4000-8000-000000000001",
168275
+ * "name": "resumen_semanal_v2",
168276
+ * "state": "pending",
168277
+ * "rejection_reason": null
168278
+ * },
168279
+ * {
168280
+ * "entry": "seller",
168281
+ * "messaging_account_id": "a1a1a1a1-0000-4000-8000-000000000001",
168282
+ * "name": "resumen_vendedor_v2",
168283
+ * "state": "pending",
168284
+ * "rejection_reason": null
168285
+ * }
168286
+ * ]
168287
+ * }
167572
168288
  * }
167573
168289
  * }
167574
168290
  */
167575
168291
  "application/json": {
167576
- data?: unknown;
167577
- meta?: {
167578
- [key: string]: unknown;
168292
+ data: {
168293
+ config: {
168294
+ /** Format: uuid */
168295
+ id: string;
168296
+ /** Format: uuid */
168297
+ tenant_id: string;
168298
+ enabled: boolean;
168299
+ send_weekday: number;
168300
+ send_hour: number;
168301
+ send_minute: number;
168302
+ timezone: string;
168303
+ whatsapp_enabled: boolean;
168304
+ email_enabled: boolean;
168305
+ enabled_at: string;
168306
+ created_at: string;
168307
+ updated_at: string;
168308
+ };
168309
+ recipients: {
168310
+ /** Format: uuid */
168311
+ user_id: string;
168312
+ variants: ("owner" | "seller")[];
168313
+ whatsapp_enabled: boolean;
168314
+ email_enabled: boolean;
168315
+ opted_out: boolean;
168316
+ phone_e164: string | null;
168317
+ /** @enum {string|null} */
168318
+ phone_skip_reason: "no_phone" | "unparsable" | null;
168319
+ /** @enum {string} */
168320
+ source: "explicit" | "role_default";
168321
+ }[];
168322
+ whatsapp_templates: {
168323
+ /** @enum {string} */
168324
+ status: "off" | "no_whatsapp" | "pending" | "ready" | "attention" | "unknown";
168325
+ templates: {
168326
+ /** @enum {string} */
168327
+ entry: "owner" | "seller";
168328
+ /** Format: uuid */
168329
+ messaging_account_id: string;
168330
+ name: string;
168331
+ /** @enum {string} */
168332
+ state: "missing" | "pending" | "approved" | "rejected" | "blocked";
168333
+ rejection_reason: string | null;
168334
+ }[];
168335
+ };
167579
168336
  };
167580
168337
  };
167581
168338
  };
@@ -167637,85 +168394,7 @@ interface paths {
167637
168394
  };
167638
168395
  };
167639
168396
  post?: never;
167640
- /**
167641
- * Remove a member
167642
- * @description Removes the membership only — the user keeps their workspace account and any other team. Tickets already assigned to them keep the assignment: `ticket.assignee_user_id` is deliberately not a foreign key, so work in flight is not orphaned by a team change.
167643
- */
167644
- delete: {
167645
- parameters: {
167646
- query?: never;
167647
- header?: never;
167648
- path: {
167649
- id: string;
167650
- membershipId: string;
167651
- };
167652
- cookie?: never;
167653
- };
167654
- requestBody?: never;
167655
- responses: {
167656
- /** @description No content */
167657
- 204: {
167658
- headers: {
167659
- [name: string]: unknown;
167660
- };
167661
- content?: never;
167662
- };
167663
- /** @description Validation error */
167664
- 400: {
167665
- headers: {
167666
- [name: string]: unknown;
167667
- };
167668
- content: {
167669
- "application/json": components["schemas"]["Error"];
167670
- };
167671
- };
167672
- /** @description Unauthorized */
167673
- 401: {
167674
- headers: {
167675
- [name: string]: unknown;
167676
- };
167677
- content: {
167678
- "application/json": components["schemas"]["Error"];
167679
- };
167680
- };
167681
- /** @description Forbidden */
167682
- 403: {
167683
- headers: {
167684
- [name: string]: unknown;
167685
- };
167686
- content: {
167687
- "application/json": components["schemas"]["Error"];
167688
- };
167689
- };
167690
- /** @description Not found */
167691
- 404: {
167692
- headers: {
167693
- [name: string]: unknown;
167694
- };
167695
- content: {
167696
- "application/json": components["schemas"]["Error"];
167697
- };
167698
- };
167699
- /** @description Conflict (incl. Idempotency-Key reuse with different body) */
167700
- 409: {
167701
- headers: {
167702
- [name: string]: unknown;
167703
- };
167704
- content: {
167705
- "application/json": components["schemas"]["Error"];
167706
- };
167707
- };
167708
- /** @description Rate limited */
167709
- 429: {
167710
- headers: {
167711
- [name: string]: unknown;
167712
- };
167713
- content: {
167714
- "application/json": components["schemas"]["Error"];
167715
- };
167716
- };
167717
- };
167718
- };
168397
+ delete?: never;
167719
168398
  options?: never;
167720
168399
  head?: never;
167721
168400
  patch?: never;
@@ -184676,6 +185355,26 @@ interface components {
184676
185355
  [key: string]: string;
184677
185356
  };
184678
185357
  };
185358
+ /** @description The stored tenant voice (brand name + tú/usted) customer-facing WhatsApp templates are written in; absent until set. */
185359
+ voice?: {
185360
+ /** @description Brand name templates say literally ("te escribimos de Automec"). Absent = the workspace name. */
185361
+ brand_name?: string;
185362
+ /**
185363
+ * @description How templates address people. Absent = `usted` for healthcare, `tu` otherwise.
185364
+ * @enum {string}
185365
+ */
185366
+ register?: "tu" | "usted";
185367
+ };
185368
+ /** @description Read-only: the voice templates are actually written in (stored value or default), with where each part came from. Ignored on write. */
185369
+ voice_resolved?: {
185370
+ brand_name: string;
185371
+ /** @enum {string} */
185372
+ register: "tu" | "usted";
185373
+ /** @enum {string} */
185374
+ brand_name_source: "stored" | "workspace_name";
185375
+ /** @enum {string} */
185376
+ register_source: "stored" | "vertical_default";
185377
+ };
184679
185378
  /**
184680
185379
  * @description Write-only secret: the Slack incoming-webhook URL is never returned. `••••` when one is configured; absent otherwise. Read `slack_webhook_configured` instead.
184681
185380
  * @enum {string}
@@ -184719,6 +185418,15 @@ interface components {
184719
185418
  evaluation_price?: number;
184720
185419
  }[] | null;
184721
185420
  };
185421
+ voice?: {
185422
+ /** @description Brand name templates say literally ("te escribimos de Automec"). Absent = the workspace name. */
185423
+ brand_name?: string;
185424
+ /**
185425
+ * @description How templates address people. Absent = `usted` for healthcare, `tu` otherwise.
185426
+ * @enum {string}
185427
+ */
185428
+ register?: "tu" | "usted";
185429
+ } | null;
184722
185430
  };
184723
185431
  LiveUsage: {
184724
185432
  as_of: string;