@vitrina/api 11.33.1 → 11.33.3

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 +1464 -154
  2. package/dist/index.d.ts +1464 -154
  3. package/package.json +1 -1
package/dist/index.d.cts CHANGED
@@ -9143,7 +9143,7 @@ interface paths {
9143
9143
  name: string;
9144
9144
  /** Format: uuid */
9145
9145
  tenant_id?: string;
9146
- scopes: ("ai_agents:read" | "ai_agents:write" | "ai_agents:simulate" | "conversations:read" | "conversations:write" | "contacts:read" | "contacts:write" | "tickets:read" | "tickets:write" | "tickets:claim" | "leads:read" | "leads:write" | "leads:intake" | "pipelines:read" | "pipelines:write" | "stages:read" | "stages:write" | "functions:read" | "functions:write" | "kb:read" | "kb:write" | "messages:read" | "messages:write" | "messages:send" | "tools:read" | "tags:read" | "tags:write" | "api_keys:read" | "api_keys:write" | "personal_tokens:read" | "personal_tokens:write" | "audit:read" | "analytics:read" | "analytics:write" | "tenant:read" | "tenant:write" | "tenant:delete" | "webhooks:read" | "webhooks:write" | "messaging_accounts:read" | "messaging_accounts:write" | "provisioning:read" | "provisioning:write" | "voice_drift:read" | "worker_failures:read" | "worker_failures:write" | "dealer_sites:read" | "dealer_sites:write" | "mcp_servers:read" | "mcp_servers:write" | "memberships:read" | "memberships:write" | "teams:read" | "teams:write" | "help_centers:read" | "help_centers:write" | "labels:read" | "labels:write" | "macros:read" | "macros:write" | "slas:read" | "slas:write" | "routing:read" | "routing:write" | "triggers:read" | "triggers:write" | "followups:read" | "followups:write" | "followups:manage" | "custom_attributes:read" | "custom_attributes:write" | "companies:read" | "companies:write" | "roles:read" | "roles:write" | "integrations:read" | "integrations:write" | "clinic:read" | "clinic:write" | "clinic_patients:read" | "clinic_patients:write" | "clinic_record:read" | "clinic_record:write" | "clinic_money:read" | "clinic_money:write" | "clinic_admin:write" | "clinic_insights:read" | "sandbox:read" | "sandbox:write" | "ads:read" | "ads:write" | "healthatom:read" | "healthatom:write" | "reservo:read" | "reservo:write" | "rexplus:read" | "rexplus:write" | "billing:read" | "billing:write" | "copilot:read" | "copilot:write" | "erp_copilot:use" | "tool_credentials:read" | "tool_credentials:write" | "tool_invocations:read" | "corrections:read" | "corrections:write" | "marketplace:read" | "marketplace:write" | "stock:read" | "storefront_events:write" | "pricing:read" | "pricing:write" | "appointments:read" | "appointments:write" | "appointments:delete" | "schedule_config:write" | "appointments:intake" | "appointment_types:read" | "appointment_types:write" | "service_lifecycle:read" | "service_lifecycle:write" | "outbound_approvals:read" | "outbound_approvals:write" | "outbound_holds:read" | "outbound_holds:write" | "campaigns:read" | "campaigns:write" | "consignments:read" | "consignments:write" | "stock_dedup:read" | "stock_dedup:write" | "stock_photo_mirror:read" | "stock_photo_mirror:write" | "stock_retirement:read" | "stock_retirement:write" | "dealership_economics:read" | "dealership_economics:write" | "document_templates:read" | "document_templates:write" | "vehicle_registry:read" | "vehicle_registry:write" | "vehicle_pipeline:read" | "vehicle_pipeline:write" | "sale_notes:read" | "sale_notes:write" | "sale_notes:void" | "transfer_cases:read" | "transfer_cases:write" | "credit_applications:read" | "credit_applications:write" | "seller_compensation:read" | "seller_compensation:write" | "sales_leaderboard:read" | "quotes:read" | "quotes:write" | "quotes:void" | "reservations:read" | "reservations:write" | "reservations:void" | "reservations:dispose_abono" | "organization_legal:read" | "organization_legal:write" | "purchase_notes:read" | "purchase_notes:write" | "purchase_notes:void" | "document_payments:read" | "document_payments:write" | "tenant_bank_accounts:read" | "tenant_bank_accounts:write" | "bank_movements:read" | "bank_movements:write" | "payments:read" | "payments:write" | "payments:reverse" | "price_approval:read" | "price_approval:request" | "price_approval:approve" | "legal:read" | "legal:write")[];
9146
+ scopes: ("ai_agents:read" | "ai_agents:write" | "ai_agents:simulate" | "conversations:read" | "conversations:write" | "contacts:read" | "contacts:write" | "tickets:read" | "tickets:write" | "tickets:claim" | "leads:read" | "leads:write" | "leads:intake" | "pipelines:read" | "pipelines:write" | "stages:read" | "stages:write" | "functions:read" | "functions:write" | "kb:read" | "kb:write" | "messages:read" | "messages:write" | "messages:send" | "tools:read" | "tags:read" | "tags:write" | "api_keys:read" | "api_keys:write" | "personal_tokens:read" | "personal_tokens:write" | "audit:read" | "analytics:read" | "analytics:write" | "tenant:read" | "tenant:write" | "tenant:delete" | "webhooks:read" | "webhooks:write" | "messaging_accounts:read" | "messaging_accounts:write" | "provisioning:read" | "provisioning:write" | "voice_drift:read" | "worker_failures:read" | "worker_failures:write" | "dealer_sites:read" | "dealer_sites:write" | "mcp_servers:read" | "mcp_servers:write" | "memberships:read" | "memberships:write" | "teams:read" | "teams:write" | "help_centers:read" | "help_centers:write" | "labels:read" | "labels:write" | "macros:read" | "macros:write" | "slas:read" | "slas:write" | "routing:read" | "routing:write" | "triggers:read" | "triggers:write" | "followups:read" | "followups:write" | "followups:manage" | "custom_attributes:read" | "custom_attributes:write" | "companies:read" | "companies:write" | "roles:read" | "roles:write" | "integrations:read" | "integrations:write" | "clinic:read" | "clinic:write" | "clinic_patients:read" | "clinic_patients:write" | "clinic_record:read" | "clinic_record:write" | "clinic_money:read" | "clinic_money:write" | "clinic_admin:write" | "clinic_insights:read" | "sandbox:read" | "sandbox:write" | "ads:read" | "ads:write" | "healthatom:read" | "healthatom:write" | "reservo:read" | "reservo:write" | "rexplus:read" | "rexplus:write" | "billing:read" | "billing:write" | "copilot:read" | "copilot:write" | "erp_copilot:use" | "tool_credentials:read" | "tool_credentials:write" | "tool_invocations:read" | "corrections:read" | "corrections:write" | "marketplace:read" | "marketplace:write" | "stock:read" | "storefront_events:write" | "pricing:read" | "pricing:write" | "roi:read" | "appointments:read" | "appointments:write" | "appointments:delete" | "schedule_config:write" | "appointments:intake" | "appointment_types:read" | "appointment_types:write" | "service_lifecycle:read" | "service_lifecycle:write" | "outbound_approvals:read" | "outbound_approvals:write" | "outbound_holds:read" | "outbound_holds:write" | "campaigns:read" | "campaigns:write" | "consignments:read" | "consignments:write" | "stock_dedup:read" | "stock_dedup:write" | "stock_photo_mirror:read" | "stock_photo_mirror:write" | "stock_retirement:read" | "stock_retirement:write" | "dealership_economics:read" | "dealership_economics:write" | "document_templates:read" | "document_templates:write" | "vehicle_registry:read" | "vehicle_registry:write" | "vehicle_pipeline:read" | "vehicle_pipeline:write" | "sale_notes:read" | "sale_notes:write" | "sale_notes:void" | "transfer_cases:read" | "transfer_cases:write" | "credit_applications:read" | "credit_applications:write" | "seller_compensation:read" | "seller_compensation:write" | "sales_leaderboard:read" | "quotes:read" | "quotes:write" | "quotes:void" | "reservations:read" | "reservations:write" | "reservations:void" | "reservations:dispose_abono" | "organization_legal:read" | "organization_legal:write" | "purchase_notes:read" | "purchase_notes:write" | "purchase_notes:void" | "document_payments:read" | "document_payments:write" | "tenant_bank_accounts:read" | "tenant_bank_accounts:write" | "bank_movements:read" | "bank_movements:write" | "payments:read" | "payments:write" | "payments:reverse" | "price_approval:read" | "price_approval:request" | "price_approval:approve" | "legal:read" | "legal:write")[];
9147
9147
  /** Format: date-time */
9148
9148
  expires_at?: string;
9149
9149
  /** @description false mints an `sk_test_` key bound to this workspace's sandbox (409 SANDBOX_NOT_PROVISIONED when it has none yet). Default true. */
@@ -30654,6 +30654,333 @@ interface paths {
30654
30654
  patch?: never;
30655
30655
  trace?: never;
30656
30656
  };
30657
+ "/sale-notes/{id}/buyer": {
30658
+ parameters: {
30659
+ query?: never;
30660
+ header?: never;
30661
+ path?: never;
30662
+ cookie?: never;
30663
+ };
30664
+ get?: never;
30665
+ put?: never;
30666
+ post?: never;
30667
+ delete?: never;
30668
+ options?: never;
30669
+ head?: never;
30670
+ /**
30671
+ * Assign or change the buyer of a nota de venta
30672
+ * @description Sets `buyer_contact_id` on a live (issued or approved) nota de venta — the fix for a note issued without its comprador, without voiding it. The contact must belong to this workspace (404 otherwise, or when it was merged away). Responds with the same read as `GET /sale-notes/{id}`. Setting the buyer it already has is a no-op 200.
30673
+ *
30674
+ * **409** with `details.blocked_reason` and a Spanish message when the buyer is already written into something else: `sale_note_voided`, `compraventa_issued` (the contract names the buyer), `trade_ins_recorded` (a retoma came from the current buyer) or `credit_attached` (the credit’s borrower is the current buyer). The way out for those is void + re-issue. Requires `sale_notes:write`.
30675
+ */
30676
+ patch: {
30677
+ parameters: {
30678
+ query?: never;
30679
+ header?: never;
30680
+ path: {
30681
+ id: string;
30682
+ };
30683
+ cookie?: never;
30684
+ };
30685
+ requestBody?: {
30686
+ content: {
30687
+ /**
30688
+ * @example {
30689
+ * "buyer_contact_id": "22222222-0000-4000-8000-000000000002"
30690
+ * }
30691
+ */
30692
+ "application/json": {
30693
+ /** Format: uuid */
30694
+ buyer_contact_id: string;
30695
+ };
30696
+ };
30697
+ };
30698
+ responses: {
30699
+ /** @description The nota de venta, as GET /sale-notes/{id} reads it */
30700
+ 200: {
30701
+ headers: {
30702
+ [name: string]: unknown;
30703
+ };
30704
+ content: {
30705
+ /**
30706
+ * @example {
30707
+ * "data": {
30708
+ * "id": "d4d4d4d4-0000-4000-8000-000000000001",
30709
+ * "tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
30710
+ * "display_id": "V-118",
30711
+ * "display_seq": 118,
30712
+ * "vehicle_id": "e1e1e1e1-0000-4000-8000-000000000002",
30713
+ * "buyer_contact_id": "22222222-0000-4000-8000-000000000002",
30714
+ * "lead_id": null,
30715
+ * "converted_from_reservation_id": null,
30716
+ * "seller_of_record": "automotora",
30717
+ * "salesperson_id": "11111111-0000-4000-8000-000000000001",
30718
+ * "net_clp": 11900000,
30719
+ * "tax_clp": 1900000,
30720
+ * "tax_treatment": "afecto",
30721
+ * "status": "issued",
30722
+ * "issued_at": "2026-09-19T13:00:00.000Z",
30723
+ * "approved_by": null,
30724
+ * "approved_at": null,
30725
+ * "voided_at": null,
30726
+ * "void_reason": null,
30727
+ * "voided_by": null,
30728
+ * "created_at": "2026-09-19T13:00:00.000Z",
30729
+ * "updated_at": "2026-09-19T13:00:00.000Z",
30730
+ * "payments": [
30731
+ * {
30732
+ * "id": "d6d6d6d6-0000-4000-8000-000000000002",
30733
+ * "tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
30734
+ * "reservation_id": null,
30735
+ * "sale_note_id": "d4d4d4d4-0000-4000-8000-000000000001",
30736
+ * "carried_from_reservation_id": null,
30737
+ * "instrument": "transferencia",
30738
+ * "amount_clp": 13800000,
30739
+ * "paid_on": "2026-09-19",
30740
+ * "bank": "Banco de Chile",
30741
+ * "account_number": null,
30742
+ * "document_number": null,
30743
+ * "note": null,
30744
+ * "card_fee_bps": null,
30745
+ * "card_surcharge_clp": null,
30746
+ * "card_surcharge_source": null,
30747
+ * "created_at": "2026-09-19T13:05:00.000Z"
30748
+ * }
30749
+ * ],
30750
+ * "totals": {
30751
+ * "total_a_pagar_clp": 13800000,
30752
+ * "total_pagos_clp": 13800000,
30753
+ * "saldo_clp": 0,
30754
+ * "recargo_tarjeta_clp": 0,
30755
+ * "total_a_cobrar_clp": 13800000,
30756
+ * "payment_count": 1,
30757
+ * "complete": true,
30758
+ * "gaps": []
30759
+ * },
30760
+ * "funding": {
30761
+ * "standing": "funded",
30762
+ * "balanced": true,
30763
+ * "terms": {
30764
+ * "price_clp": 13800000,
30765
+ * "add_on_charges_clp": 0,
30766
+ * "payments_clp": 13800000,
30767
+ * "retoma_clp": 0,
30768
+ * "credit_clp": 0
30769
+ * },
30770
+ * "total_a_pagar_clp": 13800000,
30771
+ * "total_consideration_clp": 13800000,
30772
+ * "saldo_clp": 0,
30773
+ * "gap_clp": null,
30774
+ * "saldo_a_favor_del_cliente_clp": null,
30775
+ * "payment_count": 1,
30776
+ * "complete": true,
30777
+ * "gaps": []
30778
+ * },
30779
+ * "trade_ins": [],
30780
+ * "credit": null
30781
+ * }
30782
+ * }
30783
+ */
30784
+ "application/json": {
30785
+ data?: unknown;
30786
+ meta?: {
30787
+ [key: string]: unknown;
30788
+ };
30789
+ };
30790
+ };
30791
+ };
30792
+ /** @description Validation error */
30793
+ 400: {
30794
+ headers: {
30795
+ [name: string]: unknown;
30796
+ };
30797
+ content: {
30798
+ "application/json": components["schemas"]["Error"];
30799
+ };
30800
+ };
30801
+ /** @description Unauthorized */
30802
+ 401: {
30803
+ headers: {
30804
+ [name: string]: unknown;
30805
+ };
30806
+ content: {
30807
+ "application/json": components["schemas"]["Error"];
30808
+ };
30809
+ };
30810
+ /** @description Forbidden */
30811
+ 403: {
30812
+ headers: {
30813
+ [name: string]: unknown;
30814
+ };
30815
+ content: {
30816
+ "application/json": components["schemas"]["Error"];
30817
+ };
30818
+ };
30819
+ /** @description Not found */
30820
+ 404: {
30821
+ headers: {
30822
+ [name: string]: unknown;
30823
+ };
30824
+ content: {
30825
+ "application/json": components["schemas"]["Error"];
30826
+ };
30827
+ };
30828
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
30829
+ 409: {
30830
+ headers: {
30831
+ [name: string]: unknown;
30832
+ };
30833
+ content: {
30834
+ "application/json": components["schemas"]["Error"];
30835
+ };
30836
+ };
30837
+ /** @description Rate limited */
30838
+ 429: {
30839
+ headers: {
30840
+ [name: string]: unknown;
30841
+ };
30842
+ content: {
30843
+ "application/json": components["schemas"]["Error"];
30844
+ };
30845
+ };
30846
+ };
30847
+ };
30848
+ trace?: never;
30849
+ };
30850
+ "/sale-notes/{id}/pdf": {
30851
+ parameters: {
30852
+ query?: never;
30853
+ header?: never;
30854
+ path?: never;
30855
+ cookie?: never;
30856
+ };
30857
+ /**
30858
+ * Print the nota de venta
30859
+ * @description The nota de venta as a printable PDF (`application/pdf`, served `inline`): the workspace’s default `sale_note` template — or `template_id` — filled with this sale’s facts (dealership legal identity, folio, ejecutivo, buyer, seller, vehicle, price, payments). With no live template it prints the standard text. Rendered on demand and not stored (the frozen legal instrument is the compraventa). Any status prints; a voided note carries an «ANULADA» banner. The `X-Template-Version` header names the prose used.
30860
+ *
30861
+ * **409** when a fact the template needs is missing — nothing is printed with a blank. `details.blocked_reason` is `sale_note_print_incomplete` (or the legal-seller code when the seller is what is missing), `details.missing` lists Spanish labels (e.g. «RUT de la automotora», «RUT del comprador») and `details.missing_fields[]` carries `{ variable, label, fix, contact_id? }` where `fix` is `organization_legal` | `buyer_contact` | `sale_note` | `legal_seller` — the form to open. Requires `sale_notes:read`.
30862
+ */
30863
+ get: {
30864
+ parameters: {
30865
+ query?: {
30866
+ template_id?: string;
30867
+ };
30868
+ header?: never;
30869
+ path: {
30870
+ id: string;
30871
+ };
30872
+ cookie?: never;
30873
+ };
30874
+ requestBody?: never;
30875
+ responses: {
30876
+ /** @description The printable nota de venta */
30877
+ 200: {
30878
+ headers: {
30879
+ [name: string]: unknown;
30880
+ };
30881
+ content: {
30882
+ "application/pdf": string;
30883
+ };
30884
+ };
30885
+ /** @description Validation error */
30886
+ 400: {
30887
+ headers: {
30888
+ [name: string]: unknown;
30889
+ };
30890
+ content: {
30891
+ "application/json": components["schemas"]["Error"];
30892
+ };
30893
+ };
30894
+ /** @description Unauthorized */
30895
+ 401: {
30896
+ headers: {
30897
+ [name: string]: unknown;
30898
+ };
30899
+ content: {
30900
+ "application/json": components["schemas"]["Error"];
30901
+ };
30902
+ };
30903
+ /** @description Forbidden */
30904
+ 403: {
30905
+ headers: {
30906
+ [name: string]: unknown;
30907
+ };
30908
+ content: {
30909
+ "application/json": components["schemas"]["Error"];
30910
+ };
30911
+ };
30912
+ /** @description Not found */
30913
+ 404: {
30914
+ headers: {
30915
+ [name: string]: unknown;
30916
+ };
30917
+ content: {
30918
+ "application/json": components["schemas"]["Error"];
30919
+ };
30920
+ };
30921
+ /** @description A fact the template needs is missing */
30922
+ 409: {
30923
+ headers: {
30924
+ [name: string]: unknown;
30925
+ };
30926
+ content: {
30927
+ /**
30928
+ * @example {
30929
+ * "error": {
30930
+ * "code": "CONFLICT",
30931
+ * "message": "No se puede imprimir la nota de venta V-1: faltan datos. Falta: Razón social de la automotora, RUT de la automotora, RUT del comprador.",
30932
+ * "details": {
30933
+ * "blocked_reason": "sale_note_print_incomplete",
30934
+ * "sale_note_id": "7c1e9a52-3b4d-4f6a-9e21-5d8b0c4f2a17",
30935
+ * "missing": [
30936
+ * "Razón social de la automotora",
30937
+ * "RUT de la automotora",
30938
+ * "RUT del comprador"
30939
+ * ],
30940
+ * "missing_fields": [
30941
+ * {
30942
+ * "variable": "MANDATARIA_RAZON_SOCIAL",
30943
+ * "label": "Razón social de la automotora",
30944
+ * "fix": "organization_legal"
30945
+ * },
30946
+ * {
30947
+ * "variable": "MANDATARIA_RUT",
30948
+ * "label": "RUT de la automotora",
30949
+ * "fix": "organization_legal"
30950
+ * },
30951
+ * {
30952
+ * "variable": "COMPRADOR_RUT",
30953
+ * "label": "RUT del comprador",
30954
+ * "fix": "buyer_contact",
30955
+ * "contact_id": "2f6d8b14-9c3a-4e57-a0b2-6e1f7d3c9a48"
30956
+ * }
30957
+ * ]
30958
+ * }
30959
+ * }
30960
+ * }
30961
+ */
30962
+ "application/json": components["schemas"]["Error"];
30963
+ };
30964
+ };
30965
+ /** @description Rate limited */
30966
+ 429: {
30967
+ headers: {
30968
+ [name: string]: unknown;
30969
+ };
30970
+ content: {
30971
+ "application/json": components["schemas"]["Error"];
30972
+ };
30973
+ };
30974
+ };
30975
+ };
30976
+ put?: never;
30977
+ post?: never;
30978
+ delete?: never;
30979
+ options?: never;
30980
+ head?: never;
30981
+ patch?: never;
30982
+ trace?: never;
30983
+ };
30657
30984
  "/sale-notes/{id}/approve": {
30658
30985
  parameters: {
30659
30986
  query?: never;
@@ -32619,6 +32946,130 @@ interface paths {
32619
32946
  patch?: never;
32620
32947
  trace?: never;
32621
32948
  };
32949
+ "/document-templates/starters": {
32950
+ parameters: {
32951
+ query?: never;
32952
+ header?: never;
32953
+ path?: never;
32954
+ cookie?: never;
32955
+ };
32956
+ /**
32957
+ * The standard text of each document family
32958
+ * @description The starter Spanish body of every document family (nota de venta, comprobante de reserva, cotización, mandato de consignación, nota de compra, ficha técnica) — the text an authoring screen opens with when the dealer starts a template, and what «volver al texto estándar» appends as a new version (`PUT /document-templates/{id}`). Every body uses only variables the family’s vocabulary registers, so it saves as-is. Every automotive workspace is seeded with these as its default templates (one per family it had none for). `kind` narrows to one family; `placeholders` lists the `{{NAMES}}` the body uses. Requires `document_templates:read`.
32959
+ */
32960
+ get: {
32961
+ parameters: {
32962
+ query?: {
32963
+ kind?: string;
32964
+ };
32965
+ header?: never;
32966
+ path?: never;
32967
+ cookie?: never;
32968
+ };
32969
+ requestBody?: never;
32970
+ responses: {
32971
+ /** @description Starter templates */
32972
+ 200: {
32973
+ headers: {
32974
+ [name: string]: unknown;
32975
+ };
32976
+ content: {
32977
+ /**
32978
+ * @example {
32979
+ * "data": [
32980
+ * {
32981
+ * "document_kind": "quote",
32982
+ * "label": "Cotización",
32983
+ * "key": "cotizacion",
32984
+ * "name": "Cotización",
32985
+ * "body": "COTIZACIÓN N° {{FOLIO}}\n\n{{MANDATARIA_RAZON_SOCIAL}}\nRUT {{MANDATARIA_RUT}}\n\nCLIENTE\n{{CLIENTE_NOMBRE}}, RUT {{CLIENTE_RUT}}.\n\nPRECIO\nPrecio ofrecido: {{PRECIO_OFERTADO}}",
32986
+ * "placeholders": [
32987
+ * "FOLIO",
32988
+ * "MANDATARIA_RAZON_SOCIAL",
32989
+ * "MANDATARIA_RUT",
32990
+ * "CLIENTE_NOMBRE",
32991
+ * "CLIENTE_RUT",
32992
+ * "PRECIO_OFERTADO"
32993
+ * ]
32994
+ * }
32995
+ * ],
32996
+ * "meta": {
32997
+ * "total": 1
32998
+ * }
32999
+ * }
33000
+ */
33001
+ "application/json": {
33002
+ data?: unknown;
33003
+ meta?: {
33004
+ [key: string]: unknown;
33005
+ };
33006
+ };
33007
+ };
33008
+ };
33009
+ /** @description Validation error */
33010
+ 400: {
33011
+ headers: {
33012
+ [name: string]: unknown;
33013
+ };
33014
+ content: {
33015
+ "application/json": components["schemas"]["Error"];
33016
+ };
33017
+ };
33018
+ /** @description Unauthorized */
33019
+ 401: {
33020
+ headers: {
33021
+ [name: string]: unknown;
33022
+ };
33023
+ content: {
33024
+ "application/json": components["schemas"]["Error"];
33025
+ };
33026
+ };
33027
+ /** @description Forbidden */
33028
+ 403: {
33029
+ headers: {
33030
+ [name: string]: unknown;
33031
+ };
33032
+ content: {
33033
+ "application/json": components["schemas"]["Error"];
33034
+ };
33035
+ };
33036
+ /** @description Not found */
33037
+ 404: {
33038
+ headers: {
33039
+ [name: string]: unknown;
33040
+ };
33041
+ content: {
33042
+ "application/json": components["schemas"]["Error"];
33043
+ };
33044
+ };
33045
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
33046
+ 409: {
33047
+ headers: {
33048
+ [name: string]: unknown;
33049
+ };
33050
+ content: {
33051
+ "application/json": components["schemas"]["Error"];
33052
+ };
33053
+ };
33054
+ /** @description Rate limited */
33055
+ 429: {
33056
+ headers: {
33057
+ [name: string]: unknown;
33058
+ };
33059
+ content: {
33060
+ "application/json": components["schemas"]["Error"];
33061
+ };
33062
+ };
33063
+ };
33064
+ };
33065
+ put?: never;
33066
+ post?: never;
33067
+ delete?: never;
33068
+ options?: never;
33069
+ head?: never;
33070
+ patch?: never;
33071
+ trace?: never;
33072
+ };
32622
33073
  "/credit-applications": {
32623
33074
  parameters: {
32624
33075
  query?: never;
@@ -33712,159 +34163,900 @@ interface paths {
33712
34163
  };
33713
34164
  };
33714
34165
  };
33715
- delete?: never;
33716
- options?: never;
33717
- head?: never;
33718
- patch?: never;
33719
- trace?: never;
33720
- };
33721
- "/credit-applications/{id}/contact": {
33722
- parameters: {
33723
- query?: never;
33724
- header?: never;
33725
- path?: never;
33726
- cookie?: never;
33727
- };
33728
- get?: never;
34166
+ delete?: never;
34167
+ options?: never;
34168
+ head?: never;
34169
+ patch?: never;
34170
+ trace?: never;
34171
+ };
34172
+ "/credit-applications/{id}/contact": {
34173
+ parameters: {
34174
+ query?: never;
34175
+ header?: never;
34176
+ path?: never;
34177
+ cookie?: never;
34178
+ };
34179
+ get?: never;
34180
+ put?: never;
34181
+ /**
34182
+ * "We called the bank about this file" (ERP S11-4, BR-1053)
34183
+ * @description The ONE act that resets the ageing clock. Repeatable, unlike submission, decision and withdrawal, which each happen once. Empty body.
34184
+ */
34185
+ post: {
34186
+ parameters: {
34187
+ query?: never;
34188
+ header?: {
34189
+ /** @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. */
34190
+ "Idempotency-Key"?: string;
34191
+ };
34192
+ path: {
34193
+ id: string;
34194
+ };
34195
+ cookie?: never;
34196
+ };
34197
+ requestBody?: {
34198
+ content: {
34199
+ /** @example {} */
34200
+ "application/json": Record<string, never>;
34201
+ };
34202
+ };
34203
+ responses: {
34204
+ /** @description The updated application */
34205
+ 200: {
34206
+ headers: {
34207
+ [name: string]: unknown;
34208
+ };
34209
+ content: {
34210
+ /**
34211
+ * @example {
34212
+ * "data": {
34213
+ * "id": "d9d9d9d9-0000-4000-8000-000000000001",
34214
+ * "tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
34215
+ * "display_id": "F-12",
34216
+ * "display_seq": 12,
34217
+ * "vehicle_id": "e1e1e1e1-0000-4000-8000-000000000001",
34218
+ * "buyer_contact_id": "22222222-0000-4000-8000-000000000002",
34219
+ * "institution_id": "dadadada-0000-4000-8000-000000000001",
34220
+ * "requested_amount_clp": 9500000,
34221
+ * "vehicle_price_clp": 11900000,
34222
+ * "declared_income_clp": 1200000,
34223
+ * "fee_clp": null,
34224
+ * "term_months": 48,
34225
+ * "financed_total_clp": null,
34226
+ * "submitted_at": "2026-09-10T14:00:00.000Z",
34227
+ * "submitted_by": "11111111-0000-4000-8000-000000000001",
34228
+ * "decided_at": null,
34229
+ * "decided_by": null,
34230
+ * "outcome": null,
34231
+ * "decision_reason": null,
34232
+ * "approved_amount_clp": null,
34233
+ * "withdrawn_at": null,
34234
+ * "withdrawn_by": null,
34235
+ * "withdrawn_reason": null,
34236
+ * "last_contact_at": "2026-09-19T15:30:00.000Z",
34237
+ * "last_contact_by": "11111111-0000-4000-8000-000000000001",
34238
+ * "chased_at": null,
34239
+ * "state": "submitted",
34240
+ * "created_at": "2026-09-08T11:00:00.000Z",
34241
+ * "updated_at": "2026-09-10T14:00:00.000Z",
34242
+ * "taken": false,
34243
+ * "taken_sale_note_id": null,
34244
+ * "taken_sale_note_folio": null,
34245
+ * "institution_name": "Banco Estado",
34246
+ * "taken_credit_state": null,
34247
+ * "taken_disbursed_at": null,
34248
+ * "vehicle_label": "Toyota Corolla 2023",
34249
+ * "vehicle_plate": "RJKL48",
34250
+ * "buyer_name": "María José Soto",
34251
+ * "buyer_rut": "12.345.678-9"
34252
+ * }
34253
+ * }
34254
+ */
34255
+ "application/json": {
34256
+ data?: unknown;
34257
+ meta?: {
34258
+ [key: string]: unknown;
34259
+ };
34260
+ };
34261
+ };
34262
+ };
34263
+ /** @description Validation error */
34264
+ 400: {
34265
+ headers: {
34266
+ [name: string]: unknown;
34267
+ };
34268
+ content: {
34269
+ "application/json": components["schemas"]["Error"];
34270
+ };
34271
+ };
34272
+ /** @description Unauthorized */
34273
+ 401: {
34274
+ headers: {
34275
+ [name: string]: unknown;
34276
+ };
34277
+ content: {
34278
+ "application/json": components["schemas"]["Error"];
34279
+ };
34280
+ };
34281
+ /** @description Forbidden */
34282
+ 403: {
34283
+ headers: {
34284
+ [name: string]: unknown;
34285
+ };
34286
+ content: {
34287
+ "application/json": components["schemas"]["Error"];
34288
+ };
34289
+ };
34290
+ /** @description Not found */
34291
+ 404: {
34292
+ headers: {
34293
+ [name: string]: unknown;
34294
+ };
34295
+ content: {
34296
+ "application/json": components["schemas"]["Error"];
34297
+ };
34298
+ };
34299
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
34300
+ 409: {
34301
+ headers: {
34302
+ [name: string]: unknown;
34303
+ };
34304
+ content: {
34305
+ "application/json": components["schemas"]["Error"];
34306
+ };
34307
+ };
34308
+ /** @description Rate limited */
34309
+ 429: {
34310
+ headers: {
34311
+ [name: string]: unknown;
34312
+ };
34313
+ content: {
34314
+ "application/json": components["schemas"]["Error"];
34315
+ };
34316
+ };
34317
+ };
34318
+ };
34319
+ delete?: never;
34320
+ options?: never;
34321
+ head?: never;
34322
+ patch?: never;
34323
+ trace?: never;
34324
+ };
34325
+ "/organization-legal": {
34326
+ parameters: {
34327
+ query?: never;
34328
+ header?: never;
34329
+ path?: never;
34330
+ cookie?: never;
34331
+ };
34332
+ /**
34333
+ * This workspace’s legal entities
34334
+ * @description The dealership’s legal identity — razón social, RUT, giro, domicilio, representante legal and (optionally) the escritura de personería — the facts every printed document states about the house (nota de venta, compraventa, mandato de consignación). A LIST, 0 or 1 entries in practice: an empty list is what makes printing answer 409 `automotora_identity_missing` / «Falta la identidad legal de la automotora». Requires `organization_legal:read`.
34335
+ */
34336
+ get: {
34337
+ parameters: {
34338
+ query?: never;
34339
+ header?: never;
34340
+ path?: never;
34341
+ cookie?: never;
34342
+ };
34343
+ requestBody?: never;
34344
+ responses: {
34345
+ /** @description Legal entities */
34346
+ 200: {
34347
+ headers: {
34348
+ [name: string]: unknown;
34349
+ };
34350
+ content: {
34351
+ /**
34352
+ * @example {
34353
+ * "data": [
34354
+ * {
34355
+ * "id": "4e2a9c71-8b3d-4f5e-a1c6-2d7b9e0f3a58",
34356
+ * "tenant_id": "6c3f1a2b-9d8e-4b7a-8c5d-1e2f3a4b5c6d",
34357
+ * "legal_name": "Comercial Autos del Sur SpA",
34358
+ * "tax_id": "76543210-3",
34359
+ * "tax_id_kind": "rut",
34360
+ * "giro": "Compraventa de vehículos motorizados",
34361
+ * "address_street": "Av. Apoquindo",
34362
+ * "address_number": "5400",
34363
+ * "address_unit": null,
34364
+ * "comuna_code": "13114",
34365
+ * "region_code": "13",
34366
+ * "address_source": "manual",
34367
+ * "representative_name": "María Fernanda Rojas",
34368
+ * "representative_tax_id": "13456789-0",
34369
+ * "representative_tax_id_kind": "rut",
34370
+ * "escritura_date": "2019-03-12",
34371
+ * "escritura_notary": "Notaría de Santiago de don Patricio Zaldívar Mackenna",
34372
+ * "escritura_comuna_code": "13101",
34373
+ * "created_at": "2026-09-28T13:00:00.000Z",
34374
+ * "updated_at": "2026-09-28T13:00:00.000Z"
34375
+ * }
34376
+ * ],
34377
+ * "meta": {
34378
+ * "total": 1
34379
+ * }
34380
+ * }
34381
+ */
34382
+ "application/json": {
34383
+ data?: unknown;
34384
+ meta?: {
34385
+ [key: string]: unknown;
34386
+ };
34387
+ };
34388
+ };
34389
+ };
34390
+ /** @description Validation error */
34391
+ 400: {
34392
+ headers: {
34393
+ [name: string]: unknown;
34394
+ };
34395
+ content: {
34396
+ "application/json": components["schemas"]["Error"];
34397
+ };
34398
+ };
34399
+ /** @description Unauthorized */
34400
+ 401: {
34401
+ headers: {
34402
+ [name: string]: unknown;
34403
+ };
34404
+ content: {
34405
+ "application/json": components["schemas"]["Error"];
34406
+ };
34407
+ };
34408
+ /** @description Forbidden */
34409
+ 403: {
34410
+ headers: {
34411
+ [name: string]: unknown;
34412
+ };
34413
+ content: {
34414
+ "application/json": components["schemas"]["Error"];
34415
+ };
34416
+ };
34417
+ /** @description Not found */
34418
+ 404: {
34419
+ headers: {
34420
+ [name: string]: unknown;
34421
+ };
34422
+ content: {
34423
+ "application/json": components["schemas"]["Error"];
34424
+ };
34425
+ };
34426
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
34427
+ 409: {
34428
+ headers: {
34429
+ [name: string]: unknown;
34430
+ };
34431
+ content: {
34432
+ "application/json": components["schemas"]["Error"];
34433
+ };
34434
+ };
34435
+ /** @description Rate limited */
34436
+ 429: {
34437
+ headers: {
34438
+ [name: string]: unknown;
34439
+ };
34440
+ content: {
34441
+ "application/json": components["schemas"]["Error"];
34442
+ };
34443
+ };
34444
+ };
34445
+ };
34446
+ put?: never;
34447
+ /**
34448
+ * Record the house’s legal identity
34449
+ * @description Records the dealership’s legal identity. RUTs are accepted formatted or bare and stored normalised; the region is derived from the comuna. The escritura trio (`escritura_date`, `escritura_notary`, `escritura_comuna_code`) is all-or-nothing, and the representative’s RUT travels with its kind. With this row in place the nota de venta prints; the compraventa additionally needs the representative’s RUT and the escritura (or a poder). Requires `organization_legal:write`.
34450
+ */
34451
+ post: {
34452
+ parameters: {
34453
+ query?: never;
34454
+ header?: {
34455
+ /** @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. */
34456
+ "Idempotency-Key"?: string;
34457
+ };
34458
+ path?: never;
34459
+ cookie?: never;
34460
+ };
34461
+ requestBody?: {
34462
+ content: {
34463
+ /**
34464
+ * @example {
34465
+ * "legal_name": "Comercial Autos del Sur SpA",
34466
+ * "tax_id": "76.543.210-3",
34467
+ * "giro": "Compraventa de vehículos motorizados",
34468
+ * "address_street": "Av. Apoquindo",
34469
+ * "address_number": "5400",
34470
+ * "comuna_code": "13114",
34471
+ * "representative_name": "María Fernanda Rojas",
34472
+ * "representative_tax_id": "13.456.789-0",
34473
+ * "representative_tax_id_kind": "rut",
34474
+ * "escritura_date": "2019-03-12",
34475
+ * "escritura_notary": "Notaría de Santiago de don Patricio Zaldívar Mackenna",
34476
+ * "escritura_comuna_code": "13101"
34477
+ * }
34478
+ */
34479
+ "application/json": {
34480
+ legal_name: string;
34481
+ tax_id: string;
34482
+ /** @enum {string} */
34483
+ tax_id_kind?: "rut" | "passport" | "foreign_tax_id";
34484
+ giro: string;
34485
+ address_street: string;
34486
+ address_number?: string | null;
34487
+ address_unit?: string | null;
34488
+ comuna_code: string;
34489
+ representative_name: string;
34490
+ representative_tax_id?: string | null;
34491
+ /** @enum {string|null} */
34492
+ representative_tax_id_kind?: "rut" | "passport" | "foreign_tax_id" | null;
34493
+ escritura_date?: string | null;
34494
+ escritura_notary?: string | null;
34495
+ escritura_comuna_code?: string | null;
34496
+ };
34497
+ };
34498
+ };
34499
+ responses: {
34500
+ /** @description The recorded entity */
34501
+ 201: {
34502
+ headers: {
34503
+ [name: string]: unknown;
34504
+ };
34505
+ content: {
34506
+ /**
34507
+ * @example {
34508
+ * "data": {
34509
+ * "id": "4e2a9c71-8b3d-4f5e-a1c6-2d7b9e0f3a58",
34510
+ * "tenant_id": "6c3f1a2b-9d8e-4b7a-8c5d-1e2f3a4b5c6d",
34511
+ * "legal_name": "Comercial Autos del Sur SpA",
34512
+ * "tax_id": "76543210-3",
34513
+ * "tax_id_kind": "rut",
34514
+ * "giro": "Compraventa de vehículos motorizados",
34515
+ * "address_street": "Av. Apoquindo",
34516
+ * "address_number": "5400",
34517
+ * "address_unit": null,
34518
+ * "comuna_code": "13114",
34519
+ * "region_code": "13",
34520
+ * "address_source": "manual",
34521
+ * "representative_name": "María Fernanda Rojas",
34522
+ * "representative_tax_id": "13456789-0",
34523
+ * "representative_tax_id_kind": "rut",
34524
+ * "escritura_date": "2019-03-12",
34525
+ * "escritura_notary": "Notaría de Santiago de don Patricio Zaldívar Mackenna",
34526
+ * "escritura_comuna_code": "13101",
34527
+ * "created_at": "2026-09-28T13:00:00.000Z",
34528
+ * "updated_at": "2026-09-28T13:00:00.000Z"
34529
+ * }
34530
+ * }
34531
+ */
34532
+ "application/json": {
34533
+ data?: unknown;
34534
+ };
34535
+ };
34536
+ };
34537
+ /** @description Validation error */
34538
+ 400: {
34539
+ headers: {
34540
+ [name: string]: unknown;
34541
+ };
34542
+ content: {
34543
+ "application/json": components["schemas"]["Error"];
34544
+ };
34545
+ };
34546
+ /** @description Unauthorized */
34547
+ 401: {
34548
+ headers: {
34549
+ [name: string]: unknown;
34550
+ };
34551
+ content: {
34552
+ "application/json": components["schemas"]["Error"];
34553
+ };
34554
+ };
34555
+ /** @description Forbidden */
34556
+ 403: {
34557
+ headers: {
34558
+ [name: string]: unknown;
34559
+ };
34560
+ content: {
34561
+ "application/json": components["schemas"]["Error"];
34562
+ };
34563
+ };
34564
+ /** @description Not found */
34565
+ 404: {
34566
+ headers: {
34567
+ [name: string]: unknown;
34568
+ };
34569
+ content: {
34570
+ "application/json": components["schemas"]["Error"];
34571
+ };
34572
+ };
34573
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
34574
+ 409: {
34575
+ headers: {
34576
+ [name: string]: unknown;
34577
+ };
34578
+ content: {
34579
+ "application/json": components["schemas"]["Error"];
34580
+ };
34581
+ };
34582
+ /** @description Rate limited */
34583
+ 429: {
34584
+ headers: {
34585
+ [name: string]: unknown;
34586
+ };
34587
+ content: {
34588
+ "application/json": components["schemas"]["Error"];
34589
+ };
34590
+ };
34591
+ };
34592
+ };
34593
+ delete?: never;
34594
+ options?: never;
34595
+ head?: never;
34596
+ patch?: never;
34597
+ trace?: never;
34598
+ };
34599
+ "/organization-legal/{id}": {
34600
+ parameters: {
34601
+ query?: never;
34602
+ header?: never;
34603
+ path?: never;
34604
+ cookie?: never;
34605
+ };
34606
+ /**
34607
+ * Fetch one legal entity
34608
+ * @description One of this workspace’s legal entities by id. Another workspace’s is a 404. Requires `organization_legal:read`.
34609
+ */
34610
+ get: {
34611
+ parameters: {
34612
+ query?: never;
34613
+ header?: never;
34614
+ path: {
34615
+ id: string;
34616
+ };
34617
+ cookie?: never;
34618
+ };
34619
+ requestBody?: never;
34620
+ responses: {
34621
+ /** @description The legal entity */
34622
+ 200: {
34623
+ headers: {
34624
+ [name: string]: unknown;
34625
+ };
34626
+ content: {
34627
+ /**
34628
+ * @example {
34629
+ * "data": {
34630
+ * "id": "4e2a9c71-8b3d-4f5e-a1c6-2d7b9e0f3a58",
34631
+ * "tenant_id": "6c3f1a2b-9d8e-4b7a-8c5d-1e2f3a4b5c6d",
34632
+ * "legal_name": "Comercial Autos del Sur SpA",
34633
+ * "tax_id": "76543210-3",
34634
+ * "tax_id_kind": "rut",
34635
+ * "giro": "Compraventa de vehículos motorizados",
34636
+ * "address_street": "Av. Apoquindo",
34637
+ * "address_number": "5400",
34638
+ * "address_unit": null,
34639
+ * "comuna_code": "13114",
34640
+ * "region_code": "13",
34641
+ * "address_source": "manual",
34642
+ * "representative_name": "María Fernanda Rojas",
34643
+ * "representative_tax_id": "13456789-0",
34644
+ * "representative_tax_id_kind": "rut",
34645
+ * "escritura_date": "2019-03-12",
34646
+ * "escritura_notary": "Notaría de Santiago de don Patricio Zaldívar Mackenna",
34647
+ * "escritura_comuna_code": "13101",
34648
+ * "created_at": "2026-09-28T13:00:00.000Z",
34649
+ * "updated_at": "2026-09-28T13:00:00.000Z"
34650
+ * }
34651
+ * }
34652
+ */
34653
+ "application/json": {
34654
+ data?: unknown;
34655
+ meta?: {
34656
+ [key: string]: unknown;
34657
+ };
34658
+ };
34659
+ };
34660
+ };
34661
+ /** @description Validation error */
34662
+ 400: {
34663
+ headers: {
34664
+ [name: string]: unknown;
34665
+ };
34666
+ content: {
34667
+ "application/json": components["schemas"]["Error"];
34668
+ };
34669
+ };
34670
+ /** @description Unauthorized */
34671
+ 401: {
34672
+ headers: {
34673
+ [name: string]: unknown;
34674
+ };
34675
+ content: {
34676
+ "application/json": components["schemas"]["Error"];
34677
+ };
34678
+ };
34679
+ /** @description Forbidden */
34680
+ 403: {
34681
+ headers: {
34682
+ [name: string]: unknown;
34683
+ };
34684
+ content: {
34685
+ "application/json": components["schemas"]["Error"];
34686
+ };
34687
+ };
34688
+ /** @description Not found */
34689
+ 404: {
34690
+ headers: {
34691
+ [name: string]: unknown;
34692
+ };
34693
+ content: {
34694
+ "application/json": components["schemas"]["Error"];
34695
+ };
34696
+ };
34697
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
34698
+ 409: {
34699
+ headers: {
34700
+ [name: string]: unknown;
34701
+ };
34702
+ content: {
34703
+ "application/json": components["schemas"]["Error"];
34704
+ };
34705
+ };
34706
+ /** @description Rate limited */
34707
+ 429: {
34708
+ headers: {
34709
+ [name: string]: unknown;
34710
+ };
34711
+ content: {
34712
+ "application/json": components["schemas"]["Error"];
34713
+ };
34714
+ };
34715
+ };
34716
+ };
34717
+ put?: never;
34718
+ post?: never;
34719
+ /**
34720
+ * Remove a legal entity
34721
+ * @description Costs nothing today (nothing references this table by id yet), but is on a clock: the day a document records which entity it named, this starts refusing for a named entity. Cascades to its powers of attorney.
34722
+ */
34723
+ delete: {
34724
+ parameters: {
34725
+ query?: never;
34726
+ header?: never;
34727
+ path: {
34728
+ id: string;
34729
+ };
34730
+ cookie?: never;
34731
+ };
34732
+ requestBody?: never;
34733
+ responses: {
34734
+ /** @description No content */
34735
+ 204: {
34736
+ headers: {
34737
+ [name: string]: unknown;
34738
+ };
34739
+ content?: never;
34740
+ };
34741
+ /** @description Validation error */
34742
+ 400: {
34743
+ headers: {
34744
+ [name: string]: unknown;
34745
+ };
34746
+ content: {
34747
+ "application/json": components["schemas"]["Error"];
34748
+ };
34749
+ };
34750
+ /** @description Unauthorized */
34751
+ 401: {
34752
+ headers: {
34753
+ [name: string]: unknown;
34754
+ };
34755
+ content: {
34756
+ "application/json": components["schemas"]["Error"];
34757
+ };
34758
+ };
34759
+ /** @description Forbidden */
34760
+ 403: {
34761
+ headers: {
34762
+ [name: string]: unknown;
34763
+ };
34764
+ content: {
34765
+ "application/json": components["schemas"]["Error"];
34766
+ };
34767
+ };
34768
+ /** @description Not found */
34769
+ 404: {
34770
+ headers: {
34771
+ [name: string]: unknown;
34772
+ };
34773
+ content: {
34774
+ "application/json": components["schemas"]["Error"];
34775
+ };
34776
+ };
34777
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
34778
+ 409: {
34779
+ headers: {
34780
+ [name: string]: unknown;
34781
+ };
34782
+ content: {
34783
+ "application/json": components["schemas"]["Error"];
34784
+ };
34785
+ };
34786
+ /** @description Rate limited */
34787
+ 429: {
34788
+ headers: {
34789
+ [name: string]: unknown;
34790
+ };
34791
+ content: {
34792
+ "application/json": components["schemas"]["Error"];
34793
+ };
34794
+ };
34795
+ };
34796
+ };
34797
+ options?: never;
34798
+ head?: never;
34799
+ /**
34800
+ * Edit a legal entity
34801
+ * @description Sparse. The NOT NULL columns are optional but not nullable — sending `null` for one is a 400, not a clear.
34802
+ */
34803
+ patch: {
34804
+ parameters: {
34805
+ query?: never;
34806
+ header?: never;
34807
+ path: {
34808
+ id: string;
34809
+ };
34810
+ cookie?: never;
34811
+ };
34812
+ requestBody?: {
34813
+ content: {
34814
+ /**
34815
+ * @example {
34816
+ * "giro": "Compraventa y consignación de vehículos motorizados"
34817
+ * }
34818
+ */
34819
+ "application/json": {
34820
+ legal_name?: string;
34821
+ tax_id?: string;
34822
+ /** @enum {string} */
34823
+ tax_id_kind?: "rut" | "passport" | "foreign_tax_id";
34824
+ giro?: string;
34825
+ address_street?: string;
34826
+ address_number?: string | null;
34827
+ address_unit?: string | null;
34828
+ comuna_code?: string;
34829
+ representative_name?: string;
34830
+ representative_tax_id?: string | null;
34831
+ /** @enum {string|null} */
34832
+ representative_tax_id_kind?: "rut" | "passport" | "foreign_tax_id" | null;
34833
+ escritura_date?: string | null;
34834
+ escritura_notary?: string | null;
34835
+ escritura_comuna_code?: string | null;
34836
+ };
34837
+ };
34838
+ };
34839
+ responses: {
34840
+ /** @description The updated entity */
34841
+ 200: {
34842
+ headers: {
34843
+ [name: string]: unknown;
34844
+ };
34845
+ content: {
34846
+ /**
34847
+ * @example {
34848
+ * "data": {
34849
+ * "id": "4e2a9c71-8b3d-4f5e-a1c6-2d7b9e0f3a58",
34850
+ * "tenant_id": "6c3f1a2b-9d8e-4b7a-8c5d-1e2f3a4b5c6d",
34851
+ * "legal_name": "Comercial Autos del Sur SpA",
34852
+ * "tax_id": "76543210-3",
34853
+ * "tax_id_kind": "rut",
34854
+ * "giro": "Compraventa y consignación de vehículos motorizados",
34855
+ * "address_street": "Av. Apoquindo",
34856
+ * "address_number": "5400",
34857
+ * "address_unit": null,
34858
+ * "comuna_code": "13114",
34859
+ * "region_code": "13",
34860
+ * "address_source": "manual",
34861
+ * "representative_name": "María Fernanda Rojas",
34862
+ * "representative_tax_id": "13456789-0",
34863
+ * "representative_tax_id_kind": "rut",
34864
+ * "escritura_date": "2019-03-12",
34865
+ * "escritura_notary": "Notaría de Santiago de don Patricio Zaldívar Mackenna",
34866
+ * "escritura_comuna_code": "13101",
34867
+ * "created_at": "2026-09-28T13:00:00.000Z",
34868
+ * "updated_at": "2026-09-28T14:10:00.000Z"
34869
+ * }
34870
+ * }
34871
+ */
34872
+ "application/json": {
34873
+ data?: unknown;
34874
+ meta?: {
34875
+ [key: string]: unknown;
34876
+ };
34877
+ };
34878
+ };
34879
+ };
34880
+ /** @description Validation error */
34881
+ 400: {
34882
+ headers: {
34883
+ [name: string]: unknown;
34884
+ };
34885
+ content: {
34886
+ "application/json": components["schemas"]["Error"];
34887
+ };
34888
+ };
34889
+ /** @description Unauthorized */
34890
+ 401: {
34891
+ headers: {
34892
+ [name: string]: unknown;
34893
+ };
34894
+ content: {
34895
+ "application/json": components["schemas"]["Error"];
34896
+ };
34897
+ };
34898
+ /** @description Forbidden */
34899
+ 403: {
34900
+ headers: {
34901
+ [name: string]: unknown;
34902
+ };
34903
+ content: {
34904
+ "application/json": components["schemas"]["Error"];
34905
+ };
34906
+ };
34907
+ /** @description Not found */
34908
+ 404: {
34909
+ headers: {
34910
+ [name: string]: unknown;
34911
+ };
34912
+ content: {
34913
+ "application/json": components["schemas"]["Error"];
34914
+ };
34915
+ };
34916
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
34917
+ 409: {
34918
+ headers: {
34919
+ [name: string]: unknown;
34920
+ };
34921
+ content: {
34922
+ "application/json": components["schemas"]["Error"];
34923
+ };
34924
+ };
34925
+ /** @description Rate limited */
34926
+ 429: {
34927
+ headers: {
34928
+ [name: string]: unknown;
34929
+ };
34930
+ content: {
34931
+ "application/json": components["schemas"]["Error"];
34932
+ };
34933
+ };
34934
+ };
34935
+ };
34936
+ trace?: never;
34937
+ };
34938
+ "/organization-legal/{organizationLegalId}/powers-of-attorney": {
34939
+ parameters: {
34940
+ query?: never;
34941
+ header?: never;
34942
+ path?: never;
34943
+ cookie?: never;
34944
+ };
34945
+ /**
34946
+ * List the poderes granted for this legal entity
34947
+ * @description The powers of attorney (poderes) on file for one of this workspace’s legal entities, revoked and expired ones included. When a poder is in force on the signing date, printing names its delegate as the representative, so the entity’s own representante RUT and escritura are no longer required. Requires `organization_legal:read`.
34948
+ */
34949
+ get: {
34950
+ parameters: {
34951
+ query?: never;
34952
+ header?: never;
34953
+ path: {
34954
+ organizationLegalId: string;
34955
+ };
34956
+ cookie?: never;
34957
+ };
34958
+ requestBody?: never;
34959
+ responses: {
34960
+ /** @description Powers of attorney */
34961
+ 200: {
34962
+ headers: {
34963
+ [name: string]: unknown;
34964
+ };
34965
+ content: {
34966
+ /**
34967
+ * @example {
34968
+ * "data": [
34969
+ * {
34970
+ * "id": "9b1d4c7e-2f3a-4e5b-8c6d-7a8b9c0d1e2f",
34971
+ * "tenant_id": "6c3f1a2b-9d8e-4b7a-8c5d-1e2f3a4b5c6d",
34972
+ * "organization_legal_id": "4e2a9c71-8b3d-4f5e-a1c6-2d7b9e0f3a58",
34973
+ * "delegate_name": "Andrea Soto Reyes",
34974
+ * "delegate_tax_id": "12345678-5",
34975
+ * "delegate_tax_id_kind": "rut",
34976
+ * "escritura_date": "2024-03-12",
34977
+ * "escritura_notary": "Notaría de ejemplo",
34978
+ * "escritura_comuna_code": "13132",
34979
+ * "escritura_comuna_name": "Vitacura",
34980
+ * "valid_from": "2024-03-12",
34981
+ * "valid_until": null,
34982
+ * "revoked_at": null,
34983
+ * "revoked_by": null,
34984
+ * "revoked_reason": null,
34985
+ * "created_at": "2024-03-14T15:02:11.000Z",
34986
+ * "updated_at": "2024-03-14T15:02:11.000Z"
34987
+ * }
34988
+ * ],
34989
+ * "meta": {
34990
+ * "total": 1
34991
+ * }
34992
+ * }
34993
+ */
34994
+ "application/json": {
34995
+ data?: unknown;
34996
+ meta?: {
34997
+ [key: string]: unknown;
34998
+ };
34999
+ };
35000
+ };
35001
+ };
35002
+ /** @description Validation error */
35003
+ 400: {
35004
+ headers: {
35005
+ [name: string]: unknown;
35006
+ };
35007
+ content: {
35008
+ "application/json": components["schemas"]["Error"];
35009
+ };
35010
+ };
35011
+ /** @description Unauthorized */
35012
+ 401: {
35013
+ headers: {
35014
+ [name: string]: unknown;
35015
+ };
35016
+ content: {
35017
+ "application/json": components["schemas"]["Error"];
35018
+ };
35019
+ };
35020
+ /** @description Forbidden */
35021
+ 403: {
35022
+ headers: {
35023
+ [name: string]: unknown;
35024
+ };
35025
+ content: {
35026
+ "application/json": components["schemas"]["Error"];
35027
+ };
35028
+ };
35029
+ /** @description Not found */
35030
+ 404: {
35031
+ headers: {
35032
+ [name: string]: unknown;
35033
+ };
35034
+ content: {
35035
+ "application/json": components["schemas"]["Error"];
35036
+ };
35037
+ };
35038
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
35039
+ 409: {
35040
+ headers: {
35041
+ [name: string]: unknown;
35042
+ };
35043
+ content: {
35044
+ "application/json": components["schemas"]["Error"];
35045
+ };
35046
+ };
35047
+ /** @description Rate limited */
35048
+ 429: {
35049
+ headers: {
35050
+ [name: string]: unknown;
35051
+ };
35052
+ content: {
35053
+ "application/json": components["schemas"]["Error"];
35054
+ };
35055
+ };
35056
+ };
35057
+ };
33729
35058
  put?: never;
33730
- /**
33731
- * "We called the bank about this file" (ERP S11-4, BR-1053)
33732
- * @description The ONE act that resets the ageing clock. Repeatable, unlike submission, decision and withdrawal, which each happen once. Empty body.
33733
- */
33734
- post: {
33735
- parameters: {
33736
- query?: never;
33737
- header?: {
33738
- /** @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. */
33739
- "Idempotency-Key"?: string;
33740
- };
33741
- path: {
33742
- id: string;
33743
- };
33744
- cookie?: never;
33745
- };
33746
- requestBody?: {
33747
- content: {
33748
- /** @example {} */
33749
- "application/json": Record<string, never>;
33750
- };
33751
- };
33752
- responses: {
33753
- /** @description The updated application */
33754
- 200: {
33755
- headers: {
33756
- [name: string]: unknown;
33757
- };
33758
- content: {
33759
- /**
33760
- * @example {
33761
- * "data": {
33762
- * "id": "d9d9d9d9-0000-4000-8000-000000000001",
33763
- * "tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
33764
- * "display_id": "F-12",
33765
- * "display_seq": 12,
33766
- * "vehicle_id": "e1e1e1e1-0000-4000-8000-000000000001",
33767
- * "buyer_contact_id": "22222222-0000-4000-8000-000000000002",
33768
- * "institution_id": "dadadada-0000-4000-8000-000000000001",
33769
- * "requested_amount_clp": 9500000,
33770
- * "vehicle_price_clp": 11900000,
33771
- * "declared_income_clp": 1200000,
33772
- * "fee_clp": null,
33773
- * "term_months": 48,
33774
- * "financed_total_clp": null,
33775
- * "submitted_at": "2026-09-10T14:00:00.000Z",
33776
- * "submitted_by": "11111111-0000-4000-8000-000000000001",
33777
- * "decided_at": null,
33778
- * "decided_by": null,
33779
- * "outcome": null,
33780
- * "decision_reason": null,
33781
- * "approved_amount_clp": null,
33782
- * "withdrawn_at": null,
33783
- * "withdrawn_by": null,
33784
- * "withdrawn_reason": null,
33785
- * "last_contact_at": "2026-09-19T15:30:00.000Z",
33786
- * "last_contact_by": "11111111-0000-4000-8000-000000000001",
33787
- * "chased_at": null,
33788
- * "state": "submitted",
33789
- * "created_at": "2026-09-08T11:00:00.000Z",
33790
- * "updated_at": "2026-09-10T14:00:00.000Z",
33791
- * "taken": false,
33792
- * "taken_sale_note_id": null,
33793
- * "taken_sale_note_folio": null,
33794
- * "institution_name": "Banco Estado",
33795
- * "taken_credit_state": null,
33796
- * "taken_disbursed_at": null,
33797
- * "vehicle_label": "Toyota Corolla 2023",
33798
- * "vehicle_plate": "RJKL48",
33799
- * "buyer_name": "María José Soto",
33800
- * "buyer_rut": "12.345.678-9"
33801
- * }
33802
- * }
33803
- */
33804
- "application/json": {
33805
- data?: unknown;
33806
- meta?: {
33807
- [key: string]: unknown;
33808
- };
33809
- };
33810
- };
33811
- };
33812
- /** @description Validation error */
33813
- 400: {
33814
- headers: {
33815
- [name: string]: unknown;
33816
- };
33817
- content: {
33818
- "application/json": components["schemas"]["Error"];
33819
- };
33820
- };
33821
- /** @description Unauthorized */
33822
- 401: {
33823
- headers: {
33824
- [name: string]: unknown;
33825
- };
33826
- content: {
33827
- "application/json": components["schemas"]["Error"];
33828
- };
33829
- };
33830
- /** @description Forbidden */
33831
- 403: {
33832
- headers: {
33833
- [name: string]: unknown;
33834
- };
33835
- content: {
33836
- "application/json": components["schemas"]["Error"];
33837
- };
33838
- };
33839
- /** @description Not found */
33840
- 404: {
33841
- headers: {
33842
- [name: string]: unknown;
33843
- };
33844
- content: {
33845
- "application/json": components["schemas"]["Error"];
33846
- };
33847
- };
33848
- /** @description Conflict (incl. Idempotency-Key reuse with different body) */
33849
- 409: {
33850
- headers: {
33851
- [name: string]: unknown;
33852
- };
33853
- content: {
33854
- "application/json": components["schemas"]["Error"];
33855
- };
33856
- };
33857
- /** @description Rate limited */
33858
- 429: {
33859
- headers: {
33860
- [name: string]: unknown;
33861
- };
33862
- content: {
33863
- "application/json": components["schemas"]["Error"];
33864
- };
33865
- };
33866
- };
33867
- };
35059
+ post?: never;
33868
35060
  delete?: never;
33869
35061
  options?: never;
33870
35062
  head?: never;
@@ -35326,6 +36518,124 @@ interface paths {
35326
36518
  patch?: never;
35327
36519
  trace?: never;
35328
36520
  };
36521
+ "/price-approvals/evaluate": {
36522
+ parameters: {
36523
+ query?: never;
36524
+ header?: never;
36525
+ path?: never;
36526
+ cookie?: never;
36527
+ };
36528
+ /**
36529
+ * Would this price need approval?
36530
+ * @description Evaluates `price_clp` against the unit named by exactly one of `vehicle_id` / `quote_id` / `reservation_id` / `sale_note_id` (UUID or folio), with the same policy `POST /price-approvals` enforces — so a screen that hides «Pedir aprobación» on `needs_approval: false` hides exactly the request the POST would refuse. `reason` is the stable code (`below_reference` | `within_tolerance` | `at_or_above_reference` | `no_reference`); `message` is a ready-to-show Spanish sentence. When the reference is the unit floor, `reference_clp` and `shortfall_clp` are ABSENT unless the caller holds `dealership_economics:read`. Requires `price_approval:read` or `price_approval:request`.
36531
+ */
36532
+ get: {
36533
+ parameters: {
36534
+ query: {
36535
+ vehicle_id?: string;
36536
+ quote_id?: string;
36537
+ reservation_id?: string;
36538
+ sale_note_id?: string;
36539
+ price_clp: string;
36540
+ };
36541
+ header?: never;
36542
+ path?: never;
36543
+ cookie?: never;
36544
+ };
36545
+ requestBody?: never;
36546
+ responses: {
36547
+ /** @description The verdict */
36548
+ 200: {
36549
+ headers: {
36550
+ [name: string]: unknown;
36551
+ };
36552
+ content: {
36553
+ /**
36554
+ * @example {
36555
+ * "data": {
36556
+ * "needs_approval": true,
36557
+ * "reason": "below_reference",
36558
+ * "message": "El precio está $500.000 bajo el precio publicado ($12.990.000). Requiere la aprobación de otra persona.",
36559
+ * "reference_kind": "list",
36560
+ * "reference_clp": 12990000,
36561
+ * "shortfall_clp": 500000,
36562
+ * "tolerance_clp": 0,
36563
+ * "vehicle_id": "5b0c7a7e-2f3d-4c1e-9a4b-7d2e8f1c3a60"
36564
+ * }
36565
+ * }
36566
+ */
36567
+ "application/json": {
36568
+ data?: unknown;
36569
+ meta?: {
36570
+ [key: string]: unknown;
36571
+ };
36572
+ };
36573
+ };
36574
+ };
36575
+ /** @description Validation error */
36576
+ 400: {
36577
+ headers: {
36578
+ [name: string]: unknown;
36579
+ };
36580
+ content: {
36581
+ "application/json": components["schemas"]["Error"];
36582
+ };
36583
+ };
36584
+ /** @description Unauthorized */
36585
+ 401: {
36586
+ headers: {
36587
+ [name: string]: unknown;
36588
+ };
36589
+ content: {
36590
+ "application/json": components["schemas"]["Error"];
36591
+ };
36592
+ };
36593
+ /** @description Forbidden */
36594
+ 403: {
36595
+ headers: {
36596
+ [name: string]: unknown;
36597
+ };
36598
+ content: {
36599
+ "application/json": components["schemas"]["Error"];
36600
+ };
36601
+ };
36602
+ /** @description Not found */
36603
+ 404: {
36604
+ headers: {
36605
+ [name: string]: unknown;
36606
+ };
36607
+ content: {
36608
+ "application/json": components["schemas"]["Error"];
36609
+ };
36610
+ };
36611
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
36612
+ 409: {
36613
+ headers: {
36614
+ [name: string]: unknown;
36615
+ };
36616
+ content: {
36617
+ "application/json": components["schemas"]["Error"];
36618
+ };
36619
+ };
36620
+ /** @description Rate limited */
36621
+ 429: {
36622
+ headers: {
36623
+ [name: string]: unknown;
36624
+ };
36625
+ content: {
36626
+ "application/json": components["schemas"]["Error"];
36627
+ };
36628
+ };
36629
+ };
36630
+ };
36631
+ put?: never;
36632
+ post?: never;
36633
+ delete?: never;
36634
+ options?: never;
36635
+ head?: never;
36636
+ patch?: never;
36637
+ trace?: never;
36638
+ };
35329
36639
  "/price-approvals/{id}": {
35330
36640
  parameters: {
35331
36641
  query?: never;
@@ -72570,7 +73880,7 @@ interface paths {
72570
73880
  */
72571
73881
  "application/json": {
72572
73882
  name: string;
72573
- scopes?: ("ai_agents:read" | "ai_agents:write" | "ai_agents:simulate" | "conversations:read" | "conversations:write" | "contacts:read" | "contacts:write" | "tickets:read" | "tickets:write" | "tickets:claim" | "leads:read" | "leads:write" | "leads:intake" | "pipelines:read" | "pipelines:write" | "stages:read" | "stages:write" | "functions:read" | "functions:write" | "kb:read" | "kb:write" | "messages:read" | "messages:write" | "messages:send" | "tools:read" | "tags:read" | "tags:write" | "api_keys:read" | "api_keys:write" | "personal_tokens:read" | "personal_tokens:write" | "audit:read" | "analytics:read" | "analytics:write" | "tenant:read" | "tenant:write" | "tenant:delete" | "webhooks:read" | "webhooks:write" | "messaging_accounts:read" | "messaging_accounts:write" | "provisioning:read" | "provisioning:write" | "voice_drift:read" | "worker_failures:read" | "worker_failures:write" | "dealer_sites:read" | "dealer_sites:write" | "mcp_servers:read" | "mcp_servers:write" | "memberships:read" | "memberships:write" | "teams:read" | "teams:write" | "help_centers:read" | "help_centers:write" | "labels:read" | "labels:write" | "macros:read" | "macros:write" | "slas:read" | "slas:write" | "routing:read" | "routing:write" | "triggers:read" | "triggers:write" | "followups:read" | "followups:write" | "followups:manage" | "custom_attributes:read" | "custom_attributes:write" | "companies:read" | "companies:write" | "roles:read" | "roles:write" | "integrations:read" | "integrations:write" | "clinic:read" | "clinic:write" | "clinic_patients:read" | "clinic_patients:write" | "clinic_record:read" | "clinic_record:write" | "clinic_money:read" | "clinic_money:write" | "clinic_admin:write" | "clinic_insights:read" | "sandbox:read" | "sandbox:write" | "ads:read" | "ads:write" | "healthatom:read" | "healthatom:write" | "reservo:read" | "reservo:write" | "rexplus:read" | "rexplus:write" | "billing:read" | "billing:write" | "copilot:read" | "copilot:write" | "erp_copilot:use" | "tool_credentials:read" | "tool_credentials:write" | "tool_invocations:read" | "corrections:read" | "corrections:write" | "marketplace:read" | "marketplace:write" | "stock:read" | "storefront_events:write" | "pricing:read" | "pricing:write" | "appointments:read" | "appointments:write" | "appointments:delete" | "schedule_config:write" | "appointments:intake" | "appointment_types:read" | "appointment_types:write" | "service_lifecycle:read" | "service_lifecycle:write" | "outbound_approvals:read" | "outbound_approvals:write" | "outbound_holds:read" | "outbound_holds:write" | "campaigns:read" | "campaigns:write" | "consignments:read" | "consignments:write" | "stock_dedup:read" | "stock_dedup:write" | "stock_photo_mirror:read" | "stock_photo_mirror:write" | "stock_retirement:read" | "stock_retirement:write" | "dealership_economics:read" | "dealership_economics:write" | "document_templates:read" | "document_templates:write" | "vehicle_registry:read" | "vehicle_registry:write" | "vehicle_pipeline:read" | "vehicle_pipeline:write" | "sale_notes:read" | "sale_notes:write" | "sale_notes:void" | "transfer_cases:read" | "transfer_cases:write" | "credit_applications:read" | "credit_applications:write" | "seller_compensation:read" | "seller_compensation:write" | "sales_leaderboard:read" | "quotes:read" | "quotes:write" | "quotes:void" | "reservations:read" | "reservations:write" | "reservations:void" | "reservations:dispose_abono" | "organization_legal:read" | "organization_legal:write" | "purchase_notes:read" | "purchase_notes:write" | "purchase_notes:void" | "document_payments:read" | "document_payments:write" | "tenant_bank_accounts:read" | "tenant_bank_accounts:write" | "bank_movements:read" | "bank_movements:write" | "payments:read" | "payments:write" | "payments:reverse" | "price_approval:read" | "price_approval:request" | "price_approval:approve" | "legal:read" | "legal:write")[];
73883
+ scopes?: ("ai_agents:read" | "ai_agents:write" | "ai_agents:simulate" | "conversations:read" | "conversations:write" | "contacts:read" | "contacts:write" | "tickets:read" | "tickets:write" | "tickets:claim" | "leads:read" | "leads:write" | "leads:intake" | "pipelines:read" | "pipelines:write" | "stages:read" | "stages:write" | "functions:read" | "functions:write" | "kb:read" | "kb:write" | "messages:read" | "messages:write" | "messages:send" | "tools:read" | "tags:read" | "tags:write" | "api_keys:read" | "api_keys:write" | "personal_tokens:read" | "personal_tokens:write" | "audit:read" | "analytics:read" | "analytics:write" | "tenant:read" | "tenant:write" | "tenant:delete" | "webhooks:read" | "webhooks:write" | "messaging_accounts:read" | "messaging_accounts:write" | "provisioning:read" | "provisioning:write" | "voice_drift:read" | "worker_failures:read" | "worker_failures:write" | "dealer_sites:read" | "dealer_sites:write" | "mcp_servers:read" | "mcp_servers:write" | "memberships:read" | "memberships:write" | "teams:read" | "teams:write" | "help_centers:read" | "help_centers:write" | "labels:read" | "labels:write" | "macros:read" | "macros:write" | "slas:read" | "slas:write" | "routing:read" | "routing:write" | "triggers:read" | "triggers:write" | "followups:read" | "followups:write" | "followups:manage" | "custom_attributes:read" | "custom_attributes:write" | "companies:read" | "companies:write" | "roles:read" | "roles:write" | "integrations:read" | "integrations:write" | "clinic:read" | "clinic:write" | "clinic_patients:read" | "clinic_patients:write" | "clinic_record:read" | "clinic_record:write" | "clinic_money:read" | "clinic_money:write" | "clinic_admin:write" | "clinic_insights:read" | "sandbox:read" | "sandbox:write" | "ads:read" | "ads:write" | "healthatom:read" | "healthatom:write" | "reservo:read" | "reservo:write" | "rexplus:read" | "rexplus:write" | "billing:read" | "billing:write" | "copilot:read" | "copilot:write" | "erp_copilot:use" | "tool_credentials:read" | "tool_credentials:write" | "tool_invocations:read" | "corrections:read" | "corrections:write" | "marketplace:read" | "marketplace:write" | "stock:read" | "storefront_events:write" | "pricing:read" | "pricing:write" | "roi:read" | "appointments:read" | "appointments:write" | "appointments:delete" | "schedule_config:write" | "appointments:intake" | "appointment_types:read" | "appointment_types:write" | "service_lifecycle:read" | "service_lifecycle:write" | "outbound_approvals:read" | "outbound_approvals:write" | "outbound_holds:read" | "outbound_holds:write" | "campaigns:read" | "campaigns:write" | "consignments:read" | "consignments:write" | "stock_dedup:read" | "stock_dedup:write" | "stock_photo_mirror:read" | "stock_photo_mirror:write" | "stock_retirement:read" | "stock_retirement:write" | "dealership_economics:read" | "dealership_economics:write" | "document_templates:read" | "document_templates:write" | "vehicle_registry:read" | "vehicle_registry:write" | "vehicle_pipeline:read" | "vehicle_pipeline:write" | "sale_notes:read" | "sale_notes:write" | "sale_notes:void" | "transfer_cases:read" | "transfer_cases:write" | "credit_applications:read" | "credit_applications:write" | "seller_compensation:read" | "seller_compensation:write" | "sales_leaderboard:read" | "quotes:read" | "quotes:write" | "quotes:void" | "reservations:read" | "reservations:write" | "reservations:void" | "reservations:dispose_abono" | "organization_legal:read" | "organization_legal:write" | "purchase_notes:read" | "purchase_notes:write" | "purchase_notes:void" | "document_payments:read" | "document_payments:write" | "tenant_bank_accounts:read" | "tenant_bank_accounts:write" | "bank_movements:read" | "bank_movements:write" | "payments:read" | "payments:write" | "payments:reverse" | "price_approval:read" | "price_approval:request" | "price_approval:approve" | "legal:read" | "legal:write")[];
72574
73884
  /** Format: date-time */
72575
73885
  expires_at?: string | null;
72576
73886
  };