@beel_es/sdk 2.5.0 → 2.6.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.
package/dist/index.d.ts CHANGED
@@ -5018,6 +5018,161 @@ interface paths {
5018
5018
  patch?: never;
5019
5019
  trace?: never;
5020
5020
  };
5021
+ "/v1/companies/{company_id}/connections": {
5022
+ parameters: {
5023
+ query?: never;
5024
+ header?: never;
5025
+ path: {
5026
+ /** @description Unique identifier (UUID) of the company the operation acts on: its identifier, not its NIF. It is the only source of context: the account that owns it is derived from it, and the `BeeL-Active-Company` header plays no part. A company you do not reach answers `403`, and so does a company that does not exist, so the existence of a company in another account is never disclosed. */
5027
+ company_id: components["parameters"]["CompanyIdPathParam"];
5028
+ };
5029
+ cookie?: never;
5030
+ };
5031
+ /**
5032
+ * List connections
5033
+ * @description Returns the connections of the company in the environment of the credential, most recent
5034
+ * first, including the disconnected ones.
5035
+ */
5036
+ get: operations["listCompanyConnections"];
5037
+ put?: never;
5038
+ /**
5039
+ * Connect a service
5040
+ * @description Connects a service that needs no authorization, with the `capabilities` you choose or the
5041
+ * provider's default. The connection is `ACTIVE` at once and `connection.connected` is delivered.
5042
+ */
5043
+ post: operations["createCompanyConnection"];
5044
+ delete?: never;
5045
+ options?: never;
5046
+ head?: never;
5047
+ patch?: never;
5048
+ trace?: never;
5049
+ };
5050
+ "/v1/companies/{company_id}/connections/{connection_id}": {
5051
+ parameters: {
5052
+ query?: never;
5053
+ header?: never;
5054
+ path: {
5055
+ /** @description Unique identifier (UUID) of the company the operation acts on: its identifier, not its NIF. It is the only source of context: the account that owns it is derived from it, and the `BeeL-Active-Company` header plays no part. A company you do not reach answers `403`, and so does a company that does not exist, so the existence of a company in another account is never disclosed. */
5056
+ company_id: components["parameters"]["CompanyIdPathParam"];
5057
+ /** @description Unique identifier (UUID) of the connection, as returned by the list, by `POST .../connections`, by the `connection.*` webhooks or as the `connection_id` of a reply. */
5058
+ connection_id: components["parameters"]["CompanyConnectionIdParam"];
5059
+ };
5060
+ cookie?: never;
5061
+ };
5062
+ /**
5063
+ * Get a connection
5064
+ * @description Returns a connection of the company, also when it is `DISCONNECTED`.
5065
+ */
5066
+ get: operations["getCompanyConnection"];
5067
+ put?: never;
5068
+ post?: never;
5069
+ /**
5070
+ * Disconnect a service
5071
+ * @description Disconnects the connection: BeeL. stops doing what its `capabilities` allowed, the
5072
+ * connection stays readable as `DISCONNECTED` and `connection.disconnected` is delivered.
5073
+ * Repeating it answers `204` and delivers nothing.
5074
+ */
5075
+ delete: operations["disconnectCompanyConnection"];
5076
+ options?: never;
5077
+ head?: never;
5078
+ patch?: never;
5079
+ trace?: never;
5080
+ };
5081
+ "/v1/companies/{company_id}/invoice-replies": {
5082
+ parameters: {
5083
+ query?: never;
5084
+ header?: never;
5085
+ path: {
5086
+ /** @description Unique identifier (UUID) of the company the operation acts on: its identifier, not its NIF. It is the only source of context: the account that owns it is derived from it, and the `BeeL-Active-Company` header plays no part. A company you do not reach answers `403`, and so does a company that does not exist, so the existence of a company in another account is never disclosed. */
5087
+ company_id: components["parameters"]["CompanyIdPathParam"];
5088
+ };
5089
+ cookie?: never;
5090
+ };
5091
+ /**
5092
+ * List invoice replies
5093
+ * @description Returns the replies of the customers of the company about its invoices, on every channel,
5094
+ * most recent first, each with a masked `excerpt`. Read one with its `text` in
5095
+ * `GET .../invoice-replies/{reply_id}`.
5096
+ */
5097
+ get: operations["listCompanyInvoiceReplies"];
5098
+ put?: never;
5099
+ /**
5100
+ * Register an invoice reply
5101
+ * @description Registers a message that a customer sent you on a channel of your own about an invoice
5102
+ * of the company. It is stored with `authenticated_by` `API_KEY` and without a `connection_id`.
5103
+ */
5104
+ post: operations["createCompanyInvoiceReply"];
5105
+ delete?: never;
5106
+ options?: never;
5107
+ head?: never;
5108
+ patch?: never;
5109
+ trace?: never;
5110
+ };
5111
+ "/v1/companies/{company_id}/invoice-replies/{reply_id}": {
5112
+ parameters: {
5113
+ query?: never;
5114
+ header?: never;
5115
+ path: {
5116
+ /** @description Unique identifier (UUID) of the company the operation acts on: its identifier, not its NIF. It is the only source of context: the account that owns it is derived from it, and the `BeeL-Active-Company` header plays no part. A company you do not reach answers `403`, and so does a company that does not exist, so the existence of a company in another account is never disclosed. */
5117
+ company_id: components["parameters"]["CompanyIdPathParam"];
5118
+ /** @description Unique identifier (UUID) of the reply, as returned by the list or by `POST .../invoice-replies`. */
5119
+ reply_id: components["parameters"]["ReplyIdParam"];
5120
+ };
5121
+ cookie?: never;
5122
+ };
5123
+ /**
5124
+ * Get an invoice reply
5125
+ * @description Returns a reply with its full `text`, without masking and without the quoted original
5126
+ * message.
5127
+ */
5128
+ get: operations["getCompanyInvoiceReply"];
5129
+ put?: never;
5130
+ post?: never;
5131
+ /**
5132
+ * Delete an invoice reply
5133
+ * @description Erases the text, subject, sender, attachments, `external_id` and `connection_id` of the reply, to answer an
5134
+ * erasure request, and delivers `invoice.reply.deleted`. Repeating it answers `204` and delivers
5135
+ * nothing. The same `channel` and `external_id` can no longer be registered: a new attempt answers
5136
+ * `409` without `reply_id`. Retrying the original registration with its same `Idempotency-Key`
5137
+ * within 24 hours still replays the original response.
5138
+ */
5139
+ delete: operations["deleteCompanyInvoiceReply"];
5140
+ options?: never;
5141
+ head?: never;
5142
+ patch?: never;
5143
+ trace?: never;
5144
+ };
5145
+ "/v1/companies/{company_id}/invoice-replies/{reply_id}/attachments/{attachment_id}": {
5146
+ parameters: {
5147
+ query?: never;
5148
+ header?: never;
5149
+ path: {
5150
+ /** @description Unique identifier (UUID) of the company the operation acts on: its identifier, not its NIF. It is the only source of context: the account that owns it is derived from it, and the `BeeL-Active-Company` header plays no part. A company you do not reach answers `403`, and so does a company that does not exist, so the existence of a company in another account is never disclosed. */
5151
+ company_id: components["parameters"]["CompanyIdPathParam"];
5152
+ /** @description Unique identifier (UUID) of the reply, as returned by the list or by `POST .../invoice-replies`. */
5153
+ reply_id: components["parameters"]["ReplyIdParam"];
5154
+ /** @description Unique identifier (UUID) of the attachment, as returned in `attachments` by the reply. */
5155
+ attachment_id: components["parameters"]["AttachmentIdParam"];
5156
+ };
5157
+ cookie?: never;
5158
+ };
5159
+ /**
5160
+ * Get an attachment of an invoice reply
5161
+ * @description Returns the attachment with a temporary `download_url` for its file. BeeL. does not store the file:
5162
+ * the link is requested when you call this operation and stays valid for about an hour, so call it again
5163
+ * for a fresh one rather than keeping it. `download_url` and `download_url_expires_at` are `null`
5164
+ * when there is no file to download: the attachment was registered with `POST .../invoice-replies`,
5165
+ * or its file is no longer available (see `file_expires_at`).
5166
+ */
5167
+ get: operations["getCompanyInvoiceReplyAttachment"];
5168
+ put?: never;
5169
+ post?: never;
5170
+ delete?: never;
5171
+ options?: never;
5172
+ head?: never;
5173
+ patch?: never;
5174
+ trace?: never;
5175
+ };
5021
5176
  "/v1/email-template-variables": {
5022
5177
  parameters: {
5023
5178
  query?: never;
@@ -5967,6 +6122,9 @@ interface paths {
5967
6122
  * - **History:** the outcome is recorded as a new entry and the original entry is kept
5968
6123
  * as it was. `attempt_number` continues the same sequence, so it can exceed the number
5969
6124
  * of automatic attempts.
6125
+ * - **Cleared payload:** an `invoice.reply.received` delivery whose `payload` is omitted because
6126
+ * its reply is past its retention or was deleted cannot be re-sent and answers `404`
6127
+ * `DELIVERY_LOG_NOT_FOUND`.
5970
6128
  *
5971
6129
  * **Retires on 9 December 2026.** See the [migration guide](https://docs.beel.es/changelog/resources-under-the-nif) for what moved where and what changes when you switch.
5972
6130
  */
@@ -6072,6 +6230,8 @@ interface paths {
6072
6230
  * field is `null` when the test could not be run at all.
6073
6231
  * - **`account_relationship`:** which accounts the subscription receives events from —
6074
6232
  * `own` (the default), `managed`, or `all`.
6233
+ * - **Read scope:** subscribing to an event requires the scope that reads what it carries:
6234
+ * `connections:read` for `connection.*`, `invoice-replies:read` for `invoice.reply.*`. Other events need only `webhooks:write`.
6075
6235
  * - **Limits:** an account holds at most **10 active subscriptions**; creating an
6076
6236
  * eleventh is rejected with `400` `WEBHOOK_ACTIVE_SUBSCRIPTION_LIMIT_REACHED`. Registering the same URL twice creates two subscriptions, and
6077
6237
  * the endpoint then receives each event twice.
@@ -6123,6 +6283,9 @@ interface paths {
6123
6283
  * successful test delivery before it can be turned back on. Turning a subscription
6124
6284
  * back on counts towards the limit of 10 active subscriptions, and is rejected with
6125
6285
  * `400` `WEBHOOK_ACTIVE_SUBSCRIPTION_LIMIT_REACHED` when ten are already active.
6286
+ * - **Read scope:** any change to a subscription to `connection.*` requires
6287
+ * `connections:read`, and to `invoice.reply.*` `invoice-replies:read`, whichever field
6288
+ * changes.
6126
6289
  * - **Signing secret:** not touched here. Rotate it with
6127
6290
  * `POST /v1/accounts/{account_id}/webhooks/{webhook_id}/secret`.
6128
6291
  */
@@ -6184,6 +6347,9 @@ interface paths {
6184
6347
  * - **History:** the outcome is recorded as a new entry and the original entry is kept
6185
6348
  * as it was. `attempt_number` continues the same sequence, so it can exceed the number
6186
6349
  * of automatic attempts.
6350
+ * - **Cleared payload:** an `invoice.reply.received` delivery whose `payload` is omitted because
6351
+ * its reply is past its retention or was deleted cannot be re-sent and answers `404`
6352
+ * `DELIVERY_LOG_NOT_FOUND`.
6187
6353
  */
6188
6354
  post: operations["retryAccountWebhookDelivery"];
6189
6355
  delete?: never;
@@ -16058,6 +16224,359 @@ interface components {
16058
16224
  /** @description The defaults of the invoice emails. Omitted keeps them; `null` removes them. */
16059
16225
  defaults?: components["schemas"]["UpdateCompanyEmailDefaults"] | null;
16060
16226
  };
16227
+ /**
16228
+ * @description The service the connection is with. More providers will be added: ignore a connection
16229
+ * whose provider you do not know.
16230
+ *
16231
+ * - `beel_email`: replies to the email of each invoice, received at an address of BeeL.
16232
+ * Supports `receive_customer_replies`; one per company and environment.
16233
+ * @example beel_email
16234
+ */
16235
+ CompanyConnectionProvider: string;
16236
+ /**
16237
+ * @description Whether the connection works. More values may be added: treat an unknown one as a
16238
+ * connection that does nothing.
16239
+ *
16240
+ * - `ACTIVE`: it works with all its `capabilities`.
16241
+ * - `DISCONNECTED`: final. It does nothing and stays readable for traceability.
16242
+ * @example ACTIVE
16243
+ */
16244
+ CompanyConnectionStatus: string;
16245
+ /**
16246
+ * @description How BeeL. authenticates on the service, set by the provider. More values will be added.
16247
+ *
16248
+ * - `NONE`: no credential; creating the connection turns it on.
16249
+ * @example NONE
16250
+ */
16251
+ CompanyConnectionAuthType: string;
16252
+ /**
16253
+ * @description Something BeeL. may do through the connection, chosen when connecting among the ones the
16254
+ * provider supports. More values will be added: ignore one you do not know.
16255
+ *
16256
+ * - `receive_customer_replies`: receive the replies of the customers of the company about
16257
+ * its invoices, listed in `.../invoice-replies` with the `connection_id`.
16258
+ * @example receive_customer_replies
16259
+ */
16260
+ CompanyConnectionCapability: string;
16261
+ /**
16262
+ * @description Details of a `beel_email` connection. It needs the `email` of the company: BeeL. adds an
16263
+ * address at `reply_domain` after it in the `Reply-To` of the email of each invoice.
16264
+ */
16265
+ CompanyConnectionBeelEmail: {
16266
+ /**
16267
+ * @description Domain of the reply address of BeeL. Allow it in any filter that checks the replies
16268
+ * of your customers.
16269
+ * @example reply.beel.es
16270
+ */
16271
+ reply_domain: string;
16272
+ };
16273
+ /**
16274
+ * @description A service the company has connected, in the environment of the credential that created
16275
+ * it. Credentials are never part of it. The details of each provider go under a property
16276
+ * named like it, present only on its connections.
16277
+ */
16278
+ CompanyConnection: {
16279
+ /**
16280
+ * Format: uuid
16281
+ * @description Unique identifier of the connection, the `{connection_id}` that addresses it.
16282
+ * @example 8c3e1f7a-2b4d-4e6f-9a1c-5d7b3e9f2a41
16283
+ */
16284
+ id: string;
16285
+ provider: components["schemas"]["CompanyConnectionProvider"];
16286
+ auth_type: components["schemas"]["CompanyConnectionAuthType"];
16287
+ /**
16288
+ * @description What BeeL. may do through the connection, as chosen when it was connected.
16289
+ * @example [
16290
+ * "receive_customer_replies"
16291
+ * ]
16292
+ */
16293
+ capabilities: components["schemas"]["CompanyConnectionCapability"][];
16294
+ status: components["schemas"]["CompanyConnectionStatus"];
16295
+ /**
16296
+ * Format: date-time
16297
+ * @description When the connection was created, in UTC.
16298
+ * @example 2026-11-03T08:00:00Z
16299
+ */
16300
+ created_at: string;
16301
+ /**
16302
+ * Format: date-time
16303
+ * @description When the connection was disconnected, in UTC; `null` while it is not `DISCONNECTED`.
16304
+ * @example null
16305
+ */
16306
+ disconnected_at: string | null;
16307
+ beel_email?: components["schemas"]["CompanyConnectionBeelEmail"];
16308
+ };
16309
+ CreateCompanyConnectionRequest: {
16310
+ provider: components["schemas"]["CompanyConnectionProvider"];
16311
+ /**
16312
+ * @description What BeeL. may do through the connection. Omit it, or send it empty, to get the
16313
+ * provider's default (`receive_customer_replies` for `beel_email`).
16314
+ * @example [
16315
+ * "receive_customer_replies"
16316
+ * ]
16317
+ */
16318
+ capabilities?: components["schemas"]["CompanyConnectionCapability"][];
16319
+ };
16320
+ /**
16321
+ * @description Where the customer wrote: the medium, not the `provider` of the connection that brought
16322
+ * it (an email is `EMAIL` whatever received it). More values may be added: treat an
16323
+ * unknown one like `OTHER`.
16324
+ *
16325
+ * - `EMAIL`: an email; `sender.address` is an email address.
16326
+ * - `WHATSAPP`: `sender.address` is a phone number in E.164 format.
16327
+ * - `TELEGRAM`: `sender.address` is the user identifier on Telegram.
16328
+ * - `SLACK`: `sender.address` is the user identifier on Slack.
16329
+ * - `SMS`: `sender.address` is a phone number in E.164 format.
16330
+ * - `OTHER`: any other channel, such as the chat of your product.
16331
+ * @example EMAIL
16332
+ */
16333
+ InvoiceReplyChannel: string;
16334
+ /**
16335
+ * @description What links the message to its invoice, never who wrote it (`sender` is not verified).
16336
+ * More values may be added: treat an unknown one like `API_KEY`.
16337
+ *
16338
+ * - `REPLY_TOKEN`: an answer to the email of one invoice, sent to the address unique to
16339
+ * that email.
16340
+ * - `API_KEY`: registered by an integrator with `POST .../invoice-replies`, who chose the
16341
+ * invoice.
16342
+ * @example REPLY_TOKEN
16343
+ */
16344
+ InvoiceReplyAuthentication: string;
16345
+ /**
16346
+ * @description Where the reply is in its lifecycle. More values will be added: treat an unknown value as
16347
+ * an open reply.
16348
+ *
16349
+ * - `RECEIVED`: the reply is stored.
16350
+ * @example RECEIVED
16351
+ */
16352
+ InvoiceReplyStatus: string;
16353
+ /**
16354
+ * @description What every view of a reply carries. 12 months after `received_at`, its content, subject,
16355
+ * sender, attachments and `external_id` become `null`; the rest stays.
16356
+ */
16357
+ InvoiceReplyBase: {
16358
+ /**
16359
+ * Format: uuid
16360
+ * @example 3f0c9a1e-6b2d-4c8f-a1e5-7d9b0c2e4f61
16361
+ */
16362
+ id: string;
16363
+ channel: components["schemas"]["InvoiceReplyChannel"];
16364
+ authenticated_by: components["schemas"]["InvoiceReplyAuthentication"];
16365
+ /**
16366
+ * Format: uuid
16367
+ * @description The connection of the company the message arrived through (`.../connections/{connection_id}`). `null` when it was registered with `POST .../invoice-replies`: you received it, not BeeL.
16368
+ * @example 8c3e1f7a-2b4d-4e6f-9a1c-5d7b3e9f2a41
16369
+ */
16370
+ connection_id: string | null;
16371
+ /**
16372
+ * Format: uuid
16373
+ * @description The invoice the message is about. Every reply has one today; channels added in the future may store a reply without it, so handle `null`.
16374
+ * @example b71d5e2a-9c3f-4a7b-8e10-2f6d4c8a9b13
16375
+ */
16376
+ invoice_id: string | null;
16377
+ /**
16378
+ * @description Number of that invoice; `null` when `invoice_id` is `null`.
16379
+ * @example F2026-0142
16380
+ */
16381
+ invoice_number: string | null;
16382
+ /**
16383
+ * Format: uuid
16384
+ * @description The customer of the invoice; `null` when the invoice has a one-off recipient or `invoice_id` is `null`.
16385
+ * @example 7a2c9e14-3b5d-4f6a-8c0e-1d2b3a4c5e6f
16386
+ */
16387
+ customer_id: string | null;
16388
+ status: components["schemas"]["InvoiceReplyStatus"];
16389
+ /**
16390
+ * Format: date-time
16391
+ * @description When the message was received, in UTC: when BeeL. received it, or the moment given when it was registered.
16392
+ * @example 2026-11-03T09:12:44Z
16393
+ */
16394
+ received_at: string;
16395
+ /**
16396
+ * @description Subject of the message, with tax IDs, IBANs, email addresses and phone numbers masked. `null` when the message has none, as on every channel but `EMAIL`, and once the reply is past its retention of 12 months after `received_at`.
16397
+ * @example RE: Factura F2026-0142
16398
+ */
16399
+ subject: string | null;
16400
+ /**
16401
+ * @description First paragraph of the text of the message, without the quoted original email, with tax IDs, IBANs, email addresses and phone numbers replaced by `[NIF]`, `[IBAN]`, `[EMAIL]` and `[PHONE]`. `null` when the message has no text, and once the reply is past its retention of 12 months after `received_at`.
16402
+ * @example Hola, el CIF que aparece no es el nuestro, es [NIF]. ¿Podéis corregirla?
16403
+ */
16404
+ excerpt: string | null;
16405
+ };
16406
+ /** @description Who the message says it comes from, with the same masking as the webhook: the address only, masked by type. It is not verified: never use it alone to authorize a change. The name is in the detail. */
16407
+ InvoiceReplySummarySender: {
16408
+ /**
16409
+ * @description Masked as `[EMAIL]`, `[PHONE]` or `[ID]` according to `channel`. `null` once the reply is past its retention of 12 months after `received_at`.
16410
+ * @example [EMAIL]
16411
+ */
16412
+ address: string | null;
16413
+ };
16414
+ /** @description An attachment of the reply. BeeL. does not store the file: a temporary download link is requested when you read the attachment at its `url`. */
16415
+ InvoiceReplyAttachmentSummary: {
16416
+ /**
16417
+ * Format: uuid
16418
+ * @description Identifier of the attachment, stable across reads.
16419
+ * @example 5b0e2c7a-91d4-4f3e-8a6b-2c1d9e0f7a34
16420
+ */
16421
+ id: string;
16422
+ /**
16423
+ * Format: uri-reference
16424
+ * @description Relative URL of the attachment resource. Relative to the API base URL (e.g., https://app.beel.es/api). Note it is a link to a link: reading it returns a temporary download link, or `download_url: null` when there is no file or it has expired.
16425
+ * @example /v1/companies/9f1c2d3e-4a5b-6c7d-8e9f-0a1b2c3d4e5f/invoice-replies/3f0c9a1e-6b2d-4c8f-a1e5-7d9b0c2e4f61/attachments/5b0e2c7a-91d4-4f3e-8a6b-2c1d9e0f7a34
16426
+ */
16427
+ url: string;
16428
+ /**
16429
+ * Format: date-time
16430
+ * @description Estimate of when the file stops being available. `null` when the attachment has no downloadable file, as with those registered with `POST .../invoice-replies`.
16431
+ * @example 2026-11-18T10:15:00Z
16432
+ */
16433
+ file_expires_at: string | null;
16434
+ /**
16435
+ * @description Media type declared by the channel.
16436
+ * @example application/pdf
16437
+ */
16438
+ content_type: string;
16439
+ /**
16440
+ * Format: int64
16441
+ * @description Size of the file; `null` when the channel does not report it.
16442
+ * @example 48213
16443
+ */
16444
+ size_bytes: number | null;
16445
+ };
16446
+ /** @description A reply as listed, with the same masking as the webhook: masked `excerpt`, `subject` and `sender.address`, no sender name, no `external_id`, and attachments without file names. */
16447
+ InvoiceReplySummary: components["schemas"]["InvoiceReplyBase"] & {
16448
+ sender: components["schemas"]["InvoiceReplySummarySender"];
16449
+ /** @description Attachments of the message. Empty when it has none; `null` once the reply is past its retention of 12 months after `received_at`. */
16450
+ attachments: components["schemas"]["InvoiceReplyAttachmentSummary"][] | null;
16451
+ };
16452
+ InvoiceReplySenderRequest: {
16453
+ /**
16454
+ * @description Identifier of the sender on the channel. With `EMAIL` it must be an email address, and with `WHATSAPP` and `SMS` a phone number in E.164 format (`+34600000000`); otherwise `422` `VALUE_OUT_OF_RANGE`. With the other channels, the user identifier the channel gives.
16455
+ * @example +34600123456
16456
+ */
16457
+ address: string;
16458
+ /**
16459
+ * @description Display name of the sender. Omit the field when there is none.
16460
+ * @example Laura Gómez
16461
+ */
16462
+ name?: string;
16463
+ };
16464
+ InvoiceReplyAttachmentRequest: {
16465
+ /**
16466
+ * @description Name of the file. Omit the field when there is none.
16467
+ * @example justificante-transferencia.pdf
16468
+ */
16469
+ filename?: string;
16470
+ /**
16471
+ * @description Media type of the file.
16472
+ * @example application/pdf
16473
+ */
16474
+ content_type: string;
16475
+ /**
16476
+ * Format: int64
16477
+ * @description Size of the file. Omit the field when you do not know it.
16478
+ * @example 48213
16479
+ */
16480
+ size_bytes?: number;
16481
+ };
16482
+ CreateInvoiceReplyRequest: {
16483
+ /**
16484
+ * Format: uuid
16485
+ * @description An invoice or proforma of the company that is not a draft or scheduled, in the environment of the credential.
16486
+ * @example b71d5e2a-9c3f-4a7b-8e10-2f6d4c8a9b13
16487
+ */
16488
+ invoice_id: string;
16489
+ channel: components["schemas"]["InvoiceReplyChannel"];
16490
+ /**
16491
+ * @description Identifier of the message on its channel: the `Message-ID` for `EMAIL`, the message identifier of the provider for messaging channels, your own for `OTHER`. A second message with the same `channel` and `external_id` answers `409` `INVOICE_REPLY_DUPLICATE`.
16492
+ * @example wamid.EXAMPLE0001
16493
+ */
16494
+ external_id: string;
16495
+ sender: components["schemas"]["InvoiceReplySenderRequest"];
16496
+ /**
16497
+ * Format: date-time
16498
+ * @description When you received the message. Omit it to use the moment of the call. A moment more than 5 minutes ahead answers `422` `VALUE_OUT_OF_RANGE`.
16499
+ * @example 2026-11-03T09:12:44Z
16500
+ */
16501
+ received_at?: string;
16502
+ /**
16503
+ * @description Subject of the message. Omit the field when the channel has none.
16504
+ * @example RE: Factura F2026-0142
16505
+ */
16506
+ subject?: string;
16507
+ /**
16508
+ * @description Text of the message, without the quoted messages it answers. Omit it when the message has no text; then `attachments` is required.
16509
+ * @example Hola, ¿podéis mandarme la factura a nombre de Distribuciones Ejemplo S.L.?
16510
+ */
16511
+ text?: string;
16512
+ /** @description Attachments to describe. Only their description is stored, never a file. */
16513
+ attachments?: components["schemas"]["InvoiceReplyAttachmentRequest"][];
16514
+ };
16515
+ /** @description Who the message says it comes from, as the channel reported it or as the integrator sent it. It is not verified: never use it alone to authorize a change. */
16516
+ InvoiceReplySender: {
16517
+ /**
16518
+ * @description Identifier of the sender on the channel: an email address for `EMAIL`, a phone number in E.164 format for `WHATSAPP` and `SMS`, the user identifier of the channel otherwise. Masked as `[EMAIL]`, `[PHONE]` or `[ID]` according to `channel`. `null` once the reply is past its retention of 12 months after `received_at`.
16519
+ * @example [EMAIL]
16520
+ */
16521
+ address: string | null;
16522
+ /**
16523
+ * @description Display name of the sender, when the channel carries one. `null` otherwise, and once the reply is past its retention of 12 months after `received_at`.
16524
+ * @example Laura Gómez
16525
+ */
16526
+ name: string | null;
16527
+ };
16528
+ /** @description An attachment of the reply, with its file name. */
16529
+ InvoiceReplyAttachment: components["schemas"]["InvoiceReplyAttachmentSummary"] & {
16530
+ /**
16531
+ * @description Name of the file; `null` when the channel gives none, as with a photo.
16532
+ * @example justificante-transferencia.pdf
16533
+ */
16534
+ filename: string | null;
16535
+ };
16536
+ /** @description A reply about an invoice, with its full text, `external_id` and file names. */
16537
+ InvoiceReply: components["schemas"]["InvoiceReplyBase"] & {
16538
+ sender: components["schemas"]["InvoiceReplySender"];
16539
+ /**
16540
+ * @description Identifier of the message on its channel: the `Message-ID` of the email, without angle brackets, or the identifier sent when it was registered. A message is stored once per `channel` and `external_id` in each company and environment. `null` once the reply is past its retention of 12 months after `received_at`; the message still cannot be registered again.
16541
+ * @example CAH7xQ2b9pLk3mZ0@mail.distribuciones-ejemplo.es
16542
+ */
16543
+ external_id: string | null;
16544
+ /** @description Attachments of the message. Empty when it has none; `null` once the reply is past its retention of 12 months after `received_at`. */
16545
+ attachments: components["schemas"]["InvoiceReplyAttachment"][] | null;
16546
+ /**
16547
+ * @description Text of the message without the quoted original email and without masking. HTML is converted to plain text. On the `EMAIL` channel, link annotations such as `<mailto:...>` that only repeat the text before them are removed. `null` when the message has no text, as a photo without a caption, and once the reply is past its retention of 12 months after `received_at`.
16548
+ * @example Hola, el CIF que aparece no es el nuestro, es B87654315. ¿Podéis corregirla?
16549
+ * Gracias,
16550
+ * Laura
16551
+ */
16552
+ text: string | null;
16553
+ /**
16554
+ * @description `true` when the text was longer than 20,000 characters and was cut.
16555
+ * @example false
16556
+ */
16557
+ is_text_truncated: boolean;
16558
+ };
16559
+ InvoiceReplyResponse: components["schemas"]["SuccessResponse"] & {
16560
+ data: components["schemas"]["InvoiceReply"];
16561
+ };
16562
+ /** @description An attachment of the reply with a temporary link to download its file. */
16563
+ InvoiceReplyAttachmentDetail: components["schemas"]["InvoiceReplyAttachment"] & {
16564
+ /**
16565
+ * Format: uri
16566
+ * @description Temporary link to the file. `null` when there is no file to download or it is no longer available.
16567
+ * @example https://files.example.com/attachments/5b0e2c7a/justificante-transferencia.pdf?signature=abc123
16568
+ */
16569
+ download_url: string | null;
16570
+ /**
16571
+ * Format: date-time
16572
+ * @description When `download_url` stops working, about an hour after the request. `null` with it.
16573
+ * @example 2026-11-09T11:15:00Z
16574
+ */
16575
+ download_url_expires_at: string | null;
16576
+ };
16577
+ InvoiceReplyAttachmentResponse: components["schemas"]["SuccessResponse"] & {
16578
+ data: components["schemas"]["InvoiceReplyAttachmentDetail"];
16579
+ };
16061
16580
  /**
16062
16581
  * @description Name of a variable of the email templates.
16063
16582
  *
@@ -16559,17 +17078,24 @@ interface components {
16559
17078
  * - `email_domain.failed` — A sending domain of the account became `FAILED`; sent once per transition
16560
17079
  * - `email_domain.removed` — A sending domain of the account was removed, with a `reason` (`EXPIRED`,
16561
17080
  * `DELETED_BY_USER` or `DELETED_AT_PROVIDER`); sent once per removal
17081
+ * - `connection.connected` — A service of a company was connected
17082
+ * - `connection.disconnected` — A service of a company was disconnected; sent once
17083
+ * - `invoice.reply.received` — A customer replied about an invoice, on any channel
17084
+ * - `invoice.reply.deleted` — The company deleted a reply about an invoice; sent once
16562
17085
  * - `invoice.email.bounced` — The email of an invoice bounced or was marked as spam, with a `reason`
16563
17086
  * (`BOUNCED` or `COMPLAINED`); sent once per email
16564
17087
  *
16565
17088
  * The `email_domain.*` events belong to the account: they are delivered only to its live
16566
17089
  * endpoints, never to the account that manages it, and `company_id` and `nif` are not set (absent or `null`).
16567
17090
  *
17091
+ * The `connection.*` and `invoice.reply.*` events are delivered only to the endpoints of the account that
17092
+ * owns the company, never to an account that manages it.
17093
+ *
16568
17094
  * The `account.*` events are delivered only to the **provisioner** that created the
16569
17095
  * account; a subscription on any other account never receives them.
16570
17096
  * @enum {string}
16571
17097
  */
16572
- WebhookEventTypeEnum: "invoice.issued" | "invoice.email.sent" | "invoice.pdf.generated" | "invoice.voided" | "recurring_invoice.paused" | "invoice.schedule_failed" | "verifactu.status.updated" | "account.claimed" | "company.created" | "representation.signed" | "email_domain.verified" | "email_domain.failed" | "email_domain.removed" | "invoice.email.bounced";
17098
+ WebhookEventTypeEnum: "invoice.issued" | "invoice.email.sent" | "invoice.pdf.generated" | "invoice.voided" | "recurring_invoice.paused" | "invoice.schedule_failed" | "verifactu.status.updated" | "account.claimed" | "company.created" | "representation.signed" | "email_domain.verified" | "email_domain.failed" | "email_domain.removed" | "connection.connected" | "connection.disconnected" | "invoice.reply.received" | "invoice.reply.deleted" | "invoice.email.bounced";
16573
17099
  CreateWebhookSubscriptionRequest: {
16574
17100
  /**
16575
17101
  * Format: uri
@@ -16895,6 +17421,49 @@ interface components {
16895
17421
  last_checked_at?: string | null;
16896
17422
  reason: components["schemas"]["EmailDomainRemovalReason"];
16897
17423
  };
17424
+ /** @description Data payload for `connection.connected` and `connection.disconnected` events: the connection as it is after the change. Credentials are never part of it. */
17425
+ WebhookEventDataConnection: {
17426
+ /** Format: uuid */
17427
+ connection_id: string;
17428
+ provider: components["schemas"]["CompanyConnectionProvider"];
17429
+ auth_type: components["schemas"]["CompanyConnectionAuthType"];
17430
+ capabilities: components["schemas"]["CompanyConnectionCapability"][];
17431
+ status: components["schemas"]["CompanyConnectionStatus"];
17432
+ /** Format: date-time */
17433
+ created_at: string;
17434
+ /** Format: date-time */
17435
+ disconnected_at: string | null;
17436
+ };
17437
+ /** @description Data payload for `invoice.reply.received` events: the reply as a summary. `subject`, `excerpt` and `sender.address` are masked, and it carries no `external_id`, sender name or file names; the full reply is in `GET /v1/companies/{company_id}/invoice-replies/{reply_id}`. */
17438
+ WebhookEventDataInvoiceReplyReceived: {
17439
+ /** Format: uuid */
17440
+ reply_id: string;
17441
+ channel: components["schemas"]["InvoiceReplyChannel"];
17442
+ /** Format: uuid */
17443
+ connection_id: string | null;
17444
+ /** Format: uuid */
17445
+ invoice_id: string | null;
17446
+ invoice_number: string | null;
17447
+ authenticated_by: components["schemas"]["InvoiceReplyAuthentication"];
17448
+ /** Format: uuid */
17449
+ customer_id: string | null;
17450
+ /** Format: date-time */
17451
+ received_at: string;
17452
+ sender: components["schemas"]["InvoiceReplySummarySender"];
17453
+ subject: string | null;
17454
+ /** @description First paragraph of the text of the message, without the quoted original email, with tax IDs, IBANs, email addresses and phone numbers replaced by `[NIF]`, `[IBAN]`, `[EMAIL]` and `[PHONE]`. `null` when the message has no text. */
17455
+ excerpt: string | null;
17456
+ attachments: components["schemas"]["InvoiceReplyAttachmentSummary"][];
17457
+ };
17458
+ /** @description Data payload for `invoice.reply.deleted` events. Identifiers only. An `invoice.reply.received` with the same `reply_id` that arrives after it is a late retry: discard it. */
17459
+ WebhookEventDataInvoiceReplyDeleted: {
17460
+ /** Format: uuid */
17461
+ reply_id: string;
17462
+ /** Format: uuid */
17463
+ invoice_id: string | null;
17464
+ /** Format: date-time */
17465
+ deleted_at: string;
17466
+ };
16898
17467
  /**
16899
17468
  * @description Why the email was not delivered: the recipient's server rejected it (`BOUNCED`) or the recipient
16900
17469
  * marked it as spam (`COMPLAINED`).
@@ -16941,7 +17510,7 @@ interface components {
16941
17510
  */
16942
17511
  company_id?: string | null;
16943
17512
  /**
16944
- * @description NIF of the company the event is about.
17513
+ * @description NIF of the company the event is about, or `null` (or absent) if the company has none.
16945
17514
  * @example B12345674
16946
17515
  */
16947
17516
  nif?: string | null;
@@ -16959,7 +17528,7 @@ interface components {
16959
17528
  */
16960
17529
  account_external_ref?: string | null;
16961
17530
  account_relationship?: components["schemas"]["WebhookEventAccountRelationship"];
16962
- data: components["schemas"]["WebhookEventDataInvoiceIssued"] | components["schemas"]["WebhookEventDataInvoiceEmailSent"] | components["schemas"]["WebhookEventDataInvoicePdfGenerated"] | components["schemas"]["WebhookEventDataInvoiceVoided"] | components["schemas"]["WebhookEventDataRecurringInvoicePaused"] | components["schemas"]["WebhookEventDataInvoiceScheduleFailed"] | components["schemas"]["WebhookEventDataVeriFactuStatusUpdated"] | components["schemas"]["WebhookEventDataAccountClaimed"] | components["schemas"]["WebhookEventDataCompanyCreated"] | components["schemas"]["WebhookEventDataRepresentationSigned"] | components["schemas"]["WebhookEventDataEmailDomain"] | components["schemas"]["WebhookEventDataEmailDomainRemoved"] | components["schemas"]["WebhookEventDataInvoiceEmailBounced"];
17531
+ data: components["schemas"]["WebhookEventDataInvoiceIssued"] | components["schemas"]["WebhookEventDataInvoiceEmailSent"] | components["schemas"]["WebhookEventDataInvoicePdfGenerated"] | components["schemas"]["WebhookEventDataInvoiceVoided"] | components["schemas"]["WebhookEventDataRecurringInvoicePaused"] | components["schemas"]["WebhookEventDataInvoiceScheduleFailed"] | components["schemas"]["WebhookEventDataVeriFactuStatusUpdated"] | components["schemas"]["WebhookEventDataAccountClaimed"] | components["schemas"]["WebhookEventDataCompanyCreated"] | components["schemas"]["WebhookEventDataRepresentationSigned"] | components["schemas"]["WebhookEventDataEmailDomain"] | components["schemas"]["WebhookEventDataEmailDomainRemoved"] | components["schemas"]["WebhookEventDataConnection"] | components["schemas"]["WebhookEventDataInvoiceReplyReceived"] | components["schemas"]["WebhookEventDataInvoiceReplyDeleted"] | components["schemas"]["WebhookEventDataInvoiceEmailBounced"];
16963
17532
  };
16964
17533
  UpdateWebhookSubscriptionRequest: {
16965
17534
  /**
@@ -16994,7 +17563,7 @@ interface components {
16994
17563
  * @example 200
16995
17564
  */
16996
17565
  http_status?: number | null;
16997
- /** @description Body returned by your endpoint, kept for troubleshooting. Stored up to 2048 characters; longer responses are cut and `response_body_truncated` is true. */
17566
+ /** @description Body returned by your endpoint, kept for troubleshooting. Stored up to 2048 characters; longer responses are cut and `response_body_truncated` is true. Omitted when your credential lacks the read scope of the event type, like `payload`, and once `payload` is cleared; `response_body_truncated` then keeps its last value. */
16998
17567
  response_body?: string | null;
16999
17568
  /** @description True when your endpoint returned more than 2048 characters and `response_body` holds only the beginning of it. */
17000
17569
  response_body_truncated?: boolean;
@@ -17006,9 +17575,9 @@ interface components {
17006
17575
  /** @description Delivery duration in milliseconds. */
17007
17576
  duration_ms?: number | null;
17008
17577
  success?: boolean;
17009
- /** @description Error description for failed deliveries (timeout, connection error, etc.) */
17578
+ /** @description Error description for failed deliveries (timeout, connection error, etc.). It starts with `EVENT_UNSUBSCRIBED` when the subscription no longer included the event type by the time it was due, so nothing was sent. */
17010
17579
  error_message?: string | null;
17011
- /** @description The JSON payload that was sent (or attempted) to your endpoint. */
17580
+ /** @description The JSON payload that was sent (or attempted) to your endpoint. Omitted when your credential lacks the read scope of the event type (`connections:read` for `connection.*`, `invoice-replies:read` for `invoice.reply.*`). For `invoice.reply.received` events, also omitted once the reply is past its retention of 12 months after `received_at`, and shortly after the reply is deleted; such a delivery can no longer be retried. `invoice.reply.deleted` deliveries carry identifiers only and are kept. */
17012
17581
  payload?: string | null;
17013
17582
  /**
17014
17583
  * @description HTTP headers sent to your endpoint with this delivery attempt.
@@ -17913,6 +18482,61 @@ interface components {
17913
18482
  "application/json": components["schemas"]["ErrorResponse"];
17914
18483
  };
17915
18484
  };
18485
+ /**
18486
+ * @description One of:
18487
+ * - `ACTIVE_COMPANY_NOT_ACCESSIBLE`: your account does not own or manage this company.
18488
+ * - `COMPANY_READ_ONLY`: only the `OWNER` and `ADMIN` members of the account that owns the
18489
+ * company read its connections.
18490
+ * - `INSUFFICIENT_SCOPE`: the credential lacks the scope of the operation, a privileged
18491
+ * `connections:*` scope.
18492
+ */
18493
+ ConnectionCompanyForbidden: {
18494
+ headers: {
18495
+ [name: string]: unknown;
18496
+ };
18497
+ content: {
18498
+ "application/json": components["schemas"]["ErrorResponse"];
18499
+ };
18500
+ };
18501
+ /**
18502
+ * @description The connection does not exist or belongs to another company or environment
18503
+ * (`COMPANY_CONNECTION_NOT_FOUND`).
18504
+ */
18505
+ CompanyConnectionNotFound: {
18506
+ headers: {
18507
+ [name: string]: unknown;
18508
+ };
18509
+ content: {
18510
+ /**
18511
+ * @example {
18512
+ * "success": false,
18513
+ * "error": {
18514
+ * "code": "COMPANY_CONNECTION_NOT_FOUND",
18515
+ * "message": "Connection not found."
18516
+ * },
18517
+ * "meta": {
18518
+ * "timestamp": "2026-11-03T09:20:03Z",
18519
+ * "request_id": "4bf92f3577b34da6a3ce929d0e0e4736"
18520
+ * }
18521
+ * }
18522
+ */
18523
+ "application/json": components["schemas"]["ErrorResponse"];
18524
+ };
18525
+ };
18526
+ /**
18527
+ * @description One of:
18528
+ * - `ACTIVE_COMPANY_NOT_ACCESSIBLE`: your account does not own or manage this company.
18529
+ * - `INSUFFICIENT_SCOPE`: the credential lacks `invoice-replies:read`, a privileged scope
18530
+ * that a key created without selecting scopes does not hold.
18531
+ */
18532
+ InvoiceReplyReadForbidden: {
18533
+ headers: {
18534
+ [name: string]: unknown;
18535
+ };
18536
+ content: {
18537
+ "application/json": components["schemas"]["ErrorResponse"];
18538
+ };
18539
+ };
17916
18540
  /** @description `CONNECTION_NOT_FOUND` — no connection of this NIF carries this `{connection_id}`. It speaks of the connection, never of the NIF: a NIF you cannot reach answers `403`, while a connection of another NIF answers this same `404` so that naming it reveals nothing. */
17917
18541
  PaymentConnectionNotFound: {
17918
18542
  headers: {
@@ -18160,6 +18784,14 @@ interface components {
18160
18784
  AccountIdPath: string;
18161
18785
  /** @description Membership unique UUID. */
18162
18786
  MemberIdPath: string;
18787
+ /** @description Unique identifier (UUID) of the company the operation acts on: its identifier, not its NIF. It is the only source of context: the account that owns it is derived from it, and the `BeeL-Active-Company` header plays no part. A company you do not reach answers `403`, and so does a company that does not exist, so the existence of a company in another account is never disclosed. */
18788
+ CompanyIdPathParam: string;
18789
+ /** @description Unique identifier (UUID) of the connection, as returned by the list, by `POST .../connections`, by the `connection.*` webhooks or as the `connection_id` of a reply. */
18790
+ CompanyConnectionIdParam: string;
18791
+ /** @description Unique identifier (UUID) of the reply, as returned by the list or by `POST .../invoice-replies`. */
18792
+ ReplyIdParam: string;
18793
+ /** @description Unique identifier (UUID) of the attachment, as returned in `attachments` by the reply. */
18794
+ AttachmentIdParam: string;
18163
18795
  /** @description Unique identifier (UUID) of the payment connection the operation acts on, as returned by `GET /v1/companies/{company_id}/payment-connections`. A NIF can hold several connections of the same provider, so the provider slug alone does not name one. A connection of another NIF answers `404`, exactly like one that does not exist. */
18164
18796
  PaymentConnectionIdParam: string;
18165
18797
  /** @description Unique identifier (UUID) of the company the events belong to — its identifier, not its NIF. It is the only source of context: the account that owns it is derived from it, and the `BeeL-Active-Company` header plays no part. A company you do not reach answers `403`, and so does a company that does not exist, so the existence of a company in another account is never disclosed. */
@@ -34217,51 +34849,586 @@ interface operations {
34217
34849
  };
34218
34850
  path: {
34219
34851
  /** @description Unique identifier (UUID) of the company the operation acts on: its identifier, not its NIF. It is the only source of context: the account that owns it is derived from it, and the `BeeL-Active-Company` header plays no part. A company you do not reach answers `403`, and so does a company that does not exist, so the existence of a company in another account is never disclosed. */
34220
- company_id: string;
34852
+ company_id: string;
34853
+ };
34854
+ cookie?: never;
34855
+ };
34856
+ requestBody: {
34857
+ content: {
34858
+ /**
34859
+ * @example {
34860
+ * "sender": {
34861
+ * "source": "EMAIL_DOMAIN",
34862
+ * "email_domain_id": "550e8400-e29b-41d4-a716-446655440000",
34863
+ * "local_part": "cobros"
34864
+ * },
34865
+ * "defaults": {
34866
+ * "subject": "Invoice {invoiceNumber}",
34867
+ * "message": "Dear {customerName}, please find attached invoice {invoiceNumber}.",
34868
+ * "cc": [
34869
+ * "administracion@ejemplo.com"
34870
+ * ]
34871
+ * }
34872
+ * }
34873
+ */
34874
+ "application/json": components["schemas"]["UpdateCompanyEmailConfigurationRequest"];
34875
+ };
34876
+ };
34877
+ responses: {
34878
+ /** @description Email configuration of the company after the change */
34879
+ 200: {
34880
+ headers: {
34881
+ [name: string]: unknown;
34882
+ };
34883
+ content: {
34884
+ "application/json": components["schemas"]["SuccessResponse"] & {
34885
+ data: components["schemas"]["CompanyEmailConfiguration"];
34886
+ };
34887
+ };
34888
+ };
34889
+ 400: components["responses"]["BadRequest"];
34890
+ 401: components["responses"]["Unauthorized"];
34891
+ /**
34892
+ * @description Your account does not own or manage this company, does not hold write access over it,
34893
+ * or the credential is a test one (`LIVE_CREDENTIAL_REQUIRED`). Not owning the company answers
34894
+ * `error.code` `ACTIVE_COMPANY_NOT_ACCESSIBLE`; a credential without the `companies:write`
34895
+ * scope answers `INSUFFICIENT_SCOPE`. Sending `defaults` without the email customization
34896
+ * plan answers `FEATURE_NOT_AVAILABLE`.
34897
+ */
34898
+ 403: {
34899
+ headers: {
34900
+ [name: string]: unknown;
34901
+ };
34902
+ content: {
34903
+ "application/json": components["schemas"]["ErrorResponse"];
34904
+ };
34905
+ };
34906
+ /**
34907
+ * @description The email domain does not exist, belongs to another account or was removed
34908
+ * (`error.code` `EMAIL_DOMAIN_NOT_FOUND`).
34909
+ */
34910
+ 404: {
34911
+ headers: {
34912
+ [name: string]: unknown;
34913
+ };
34914
+ content: {
34915
+ "application/json": components["schemas"]["ErrorResponse"];
34916
+ };
34917
+ };
34918
+ /**
34919
+ * @description The email domain is still being registered and cannot be chosen yet
34920
+ * (`error.code` `EMAIL_DOMAIN_NOT_READY`).
34921
+ */
34922
+ 409: {
34923
+ headers: {
34924
+ [name: string]: unknown;
34925
+ };
34926
+ content: {
34927
+ "application/json": components["schemas"]["ErrorResponse"];
34928
+ };
34929
+ };
34930
+ /**
34931
+ * @description A property is not valid, or the combination of `source`, `email_domain_id` and
34932
+ * `local_part` is not allowed (`error.code` `VALIDATION_ERROR`). Send values that follow
34933
+ * the format described for the operation.
34934
+ */
34935
+ 422: {
34936
+ headers: {
34937
+ [name: string]: unknown;
34938
+ };
34939
+ content: {
34940
+ "application/json": components["schemas"]["ErrorResponse"];
34941
+ };
34942
+ };
34943
+ 429: components["responses"]["TooManyRequests"];
34944
+ 500: components["responses"]["InternalServerError"];
34945
+ default: components["responses"]["UnexpectedError"];
34946
+ };
34947
+ };
34948
+ listCompanyConnections: {
34949
+ parameters: {
34950
+ query?: {
34951
+ /**
34952
+ * @description Page number, starting at 1. The response echoes it back as `pagination.current_page`.
34953
+ * @example 1
34954
+ */
34955
+ page?: components["parameters"]["PageParam"];
34956
+ /**
34957
+ * @description How many items to return per page. The response echoes it back as `pagination.items_per_page`.
34958
+ * @example 20
34959
+ */
34960
+ limit?: components["parameters"]["LimitParam"];
34961
+ /** @description Keep only the connections with these providers. Accepts a comma-separated list. */
34962
+ provider?: components["schemas"]["CompanyConnectionProvider"][];
34963
+ /**
34964
+ * @description Keep only the connections in these statuses. Accepts a comma-separated list, for
34965
+ * example `status=ACTIVE`.
34966
+ */
34967
+ status?: components["schemas"]["CompanyConnectionStatus"][];
34968
+ };
34969
+ header?: never;
34970
+ path: {
34971
+ /** @description Unique identifier (UUID) of the company the operation acts on: its identifier, not its NIF. It is the only source of context: the account that owns it is derived from it, and the `BeeL-Active-Company` header plays no part. A company you do not reach answers `403`, and so does a company that does not exist, so the existence of a company in another account is never disclosed. */
34972
+ company_id: components["parameters"]["CompanyIdPathParam"];
34973
+ };
34974
+ cookie?: never;
34975
+ };
34976
+ requestBody?: never;
34977
+ responses: {
34978
+ /** @description Connections of the company */
34979
+ 200: {
34980
+ headers: {
34981
+ [name: string]: unknown;
34982
+ };
34983
+ content: {
34984
+ /**
34985
+ * @example {
34986
+ * "success": true,
34987
+ * "data": {
34988
+ * "connections": [
34989
+ * {
34990
+ * "id": "8c3e1f7a-2b4d-4e6f-9a1c-5d7b3e9f2a41",
34991
+ * "provider": "beel_email",
34992
+ * "auth_type": "NONE",
34993
+ * "capabilities": [
34994
+ * "receive_customer_replies"
34995
+ * ],
34996
+ * "status": "ACTIVE",
34997
+ * "created_at": "2026-11-03T08:00:00Z",
34998
+ * "disconnected_at": null,
34999
+ * "beel_email": {
35000
+ * "reply_domain": "reply.beel.es"
35001
+ * }
35002
+ * }
35003
+ * ],
35004
+ * "pagination": {
35005
+ * "current_page": 1,
35006
+ * "total_pages": 1,
35007
+ * "total_items": 1,
35008
+ * "items_per_page": 20,
35009
+ * "has_next": false,
35010
+ * "has_previous": false
35011
+ * }
35012
+ * }
35013
+ * }
35014
+ */
35015
+ "application/json": components["schemas"]["SuccessResponse"] & {
35016
+ data: {
35017
+ connections: components["schemas"]["CompanyConnection"][];
35018
+ pagination: components["schemas"]["Pagination"];
35019
+ };
35020
+ };
35021
+ };
35022
+ };
35023
+ 400: components["responses"]["InvalidRequestTarget"];
35024
+ 401: components["responses"]["Unauthorized"];
35025
+ 403: components["responses"]["ConnectionCompanyForbidden"];
35026
+ 422: components["responses"]["UnprocessableQueryParameter"];
35027
+ 429: components["responses"]["TooManyRequests"];
35028
+ 500: components["responses"]["InternalServerError"];
35029
+ default: components["responses"]["UnexpectedError"];
35030
+ };
35031
+ };
35032
+ createCompanyConnection: {
35033
+ parameters: {
35034
+ query?: never;
35035
+ header?: {
35036
+ /**
35037
+ * @description Idempotency key to prevent duplicates in sensitive operations.
35038
+ *
35039
+ * - Any unique client-generated string (e.g. an order id). A UUID also works but is not required
35040
+ * - Allowed characters: letters, digits, `_` and `-` (max 255 chars)
35041
+ * - Retrying with the same key replays the first response when it was a success (2xx) or a
35042
+ * server error (5xx): same status and body, plus the header `Idempotency-Replay: true`.
35043
+ * After a 5xx other than 503, check whether the operation took effect before retrying with a **new** key
35044
+ * - After a `503`, retry first with the **same** key. If the response carries `Idempotency-Replay: true`,
35045
+ * the operation may have taken effect: check the resource before using a new key. Without that header,
35046
+ * the retry runs the operation once
35047
+ * - A 4xx is not stored: the key is released, so the corrected request can reuse it
35048
+ * - Stored responses expire 24 hours after processing
35049
+ *
35050
+ * The key is scoped per user and environment, and bound to the request body, so retrying after
35051
+ * a network timeout replays the stored response instead of repeating the operation.
35052
+ *
35053
+ * | Status | Code | When |
35054
+ * |---|---|---|
35055
+ * | `400` | `INVALID_IDEMPOTENCY_KEY` | The key breaks the format rules above. |
35056
+ * | `409` | `IDEMPOTENCY_KEY_PROCESSING` | The first request is still in flight. Wait for the `Retry-After` seconds (2) and retry with the same key. |
35057
+ * | `409` | `IDEMPOTENCY_KEY_MISMATCH` | The key was already used with a **different** body. Use a new key. |
35058
+ * @example invoice-order-12345
35059
+ */
35060
+ "Idempotency-Key"?: components["parameters"]["IdempotencyKeyHeader"];
35061
+ };
35062
+ path: {
35063
+ /** @description Unique identifier (UUID) of the company the operation acts on: its identifier, not its NIF. It is the only source of context: the account that owns it is derived from it, and the `BeeL-Active-Company` header plays no part. A company you do not reach answers `403`, and so does a company that does not exist, so the existence of a company in another account is never disclosed. */
35064
+ company_id: components["parameters"]["CompanyIdPathParam"];
35065
+ };
35066
+ cookie?: never;
35067
+ };
35068
+ requestBody: {
35069
+ content: {
35070
+ /**
35071
+ * @example {
35072
+ * "provider": "beel_email",
35073
+ * "capabilities": [
35074
+ * "receive_customer_replies"
35075
+ * ]
35076
+ * }
35077
+ */
35078
+ "application/json": components["schemas"]["CreateCompanyConnectionRequest"];
35079
+ };
35080
+ };
35081
+ responses: {
35082
+ /** @description Service connected. `Location` points at the connection. */
35083
+ 201: {
35084
+ headers: {
35085
+ Location: components["headers"]["CreatedResourceLocation"];
35086
+ [name: string]: unknown;
35087
+ };
35088
+ content: {
35089
+ /**
35090
+ * @example {
35091
+ * "success": true,
35092
+ * "data": {
35093
+ * "id": "8c3e1f7a-2b4d-4e6f-9a1c-5d7b3e9f2a41",
35094
+ * "provider": "beel_email",
35095
+ * "auth_type": "NONE",
35096
+ * "capabilities": [
35097
+ * "receive_customer_replies"
35098
+ * ],
35099
+ * "status": "ACTIVE",
35100
+ * "created_at": "2026-11-03T08:00:00Z",
35101
+ * "disconnected_at": null,
35102
+ * "beel_email": {
35103
+ * "reply_domain": "reply.beel.es"
35104
+ * }
35105
+ * }
35106
+ * }
35107
+ */
35108
+ "application/json": components["schemas"]["SuccessResponse"] & {
35109
+ data: components["schemas"]["CompanyConnection"];
35110
+ };
35111
+ };
35112
+ };
35113
+ 400: components["responses"]["BadRequest"];
35114
+ 401: components["responses"]["Unauthorized"];
35115
+ /**
35116
+ * @description One of:
35117
+ * - `ACTIVE_COMPANY_NOT_ACCESSIBLE`: your account does not own or manage this company.
35118
+ * - `COMPANY_READ_ONLY`: only the `OWNER` and `ADMIN` members of the account that owns
35119
+ * the company manage its connections.
35120
+ * - `INSUFFICIENT_SCOPE`: the credential lacks `connections:write`, a privileged
35121
+ * scope.
35122
+ */
35123
+ 403: {
35124
+ headers: {
35125
+ [name: string]: unknown;
35126
+ };
35127
+ content: {
35128
+ "application/json": components["schemas"]["ErrorResponse"];
35129
+ };
35130
+ };
35131
+ /**
35132
+ * @description One of:
35133
+ * - `CONNECTION_DUPLICATE`: the provider allows one live connection per company and
35134
+ * environment, and it exists; see `error.details.connection_id`.
35135
+ * - The idempotency conflicts of `Idempotency-Key`.
35136
+ */
35137
+ 409: {
35138
+ headers: {
35139
+ [name: string]: unknown;
35140
+ };
35141
+ content: {
35142
+ /**
35143
+ * @example {
35144
+ * "success": false,
35145
+ * "error": {
35146
+ * "code": "CONNECTION_DUPLICATE",
35147
+ * "message": "The company already has a connection with this provider.",
35148
+ * "details": {
35149
+ * "connection_id": "8c3e1f7a-2b4d-4e6f-9a1c-5d7b3e9f2a41",
35150
+ * "provider": "beel_email"
35151
+ * }
35152
+ * },
35153
+ * "meta": {
35154
+ * "timestamp": "2026-11-03T08:00:00Z",
35155
+ * "request_id": "4bf92f3577b34da6a3ce929d0e0e4736"
35156
+ * }
35157
+ * }
35158
+ */
35159
+ "application/json": components["schemas"]["ErrorResponse"];
35160
+ };
35161
+ };
35162
+ /**
35163
+ * @description One of:
35164
+ * - `CONNECTION_PROVIDER_NOT_SUPPORTED`: BeeL. does not connect that `provider`.
35165
+ * - `CONNECTION_CAPABILITY_NOT_SUPPORTED`: the provider does not support a capability;
35166
+ * see `error.details.capability`.
35167
+ * - `CONNECTION_REPLY_TO_REQUIRED`: `beel_email` needs the `email` of the company. It
35168
+ * is checked before `409`.
35169
+ * - `VALIDATION_ERROR`: the body breaks a declared constraint; see `error.details`.
35170
+ */
35171
+ 422: {
35172
+ headers: {
35173
+ [name: string]: unknown;
35174
+ };
35175
+ content: {
35176
+ /**
35177
+ * @example {
35178
+ * "success": false,
35179
+ * "error": {
35180
+ * "code": "CONNECTION_REPLY_TO_REQUIRED",
35181
+ * "message": "Set the email of the company before connecting the reply capture by email."
35182
+ * },
35183
+ * "meta": {
35184
+ * "timestamp": "2026-11-03T08:00:00Z",
35185
+ * "request_id": "4bf92f3577b34da6a3ce929d0e0e4736"
35186
+ * }
35187
+ * }
35188
+ */
35189
+ "application/json": components["schemas"]["ErrorResponse"];
35190
+ };
35191
+ };
35192
+ 429: components["responses"]["TooManyRequests"];
35193
+ 500: components["responses"]["InternalServerError"];
35194
+ default: components["responses"]["UnexpectedError"];
35195
+ };
35196
+ };
35197
+ getCompanyConnection: {
35198
+ parameters: {
35199
+ query?: never;
35200
+ header?: never;
35201
+ path: {
35202
+ /** @description Unique identifier (UUID) of the company the operation acts on: its identifier, not its NIF. It is the only source of context: the account that owns it is derived from it, and the `BeeL-Active-Company` header plays no part. A company you do not reach answers `403`, and so does a company that does not exist, so the existence of a company in another account is never disclosed. */
35203
+ company_id: components["parameters"]["CompanyIdPathParam"];
35204
+ /** @description Unique identifier (UUID) of the connection, as returned by the list, by `POST .../connections`, by the `connection.*` webhooks or as the `connection_id` of a reply. */
35205
+ connection_id: components["parameters"]["CompanyConnectionIdParam"];
35206
+ };
35207
+ cookie?: never;
35208
+ };
35209
+ requestBody?: never;
35210
+ responses: {
35211
+ /** @description The connection */
35212
+ 200: {
35213
+ headers: {
35214
+ [name: string]: unknown;
35215
+ };
35216
+ content: {
35217
+ "application/json": components["schemas"]["SuccessResponse"] & {
35218
+ data: components["schemas"]["CompanyConnection"];
35219
+ };
35220
+ };
35221
+ };
35222
+ 401: components["responses"]["Unauthorized"];
35223
+ 403: components["responses"]["ConnectionCompanyForbidden"];
35224
+ 404: components["responses"]["CompanyConnectionNotFound"];
35225
+ 429: components["responses"]["TooManyRequests"];
35226
+ 500: components["responses"]["InternalServerError"];
35227
+ default: components["responses"]["UnexpectedError"];
35228
+ };
35229
+ };
35230
+ disconnectCompanyConnection: {
35231
+ parameters: {
35232
+ query?: never;
35233
+ header?: never;
35234
+ path: {
35235
+ /** @description Unique identifier (UUID) of the company the operation acts on: its identifier, not its NIF. It is the only source of context: the account that owns it is derived from it, and the `BeeL-Active-Company` header plays no part. A company you do not reach answers `403`, and so does a company that does not exist, so the existence of a company in another account is never disclosed. */
35236
+ company_id: components["parameters"]["CompanyIdPathParam"];
35237
+ /** @description Unique identifier (UUID) of the connection, as returned by the list, by `POST .../connections`, by the `connection.*` webhooks or as the `connection_id` of a reply. */
35238
+ connection_id: components["parameters"]["CompanyConnectionIdParam"];
35239
+ };
35240
+ cookie?: never;
35241
+ };
35242
+ requestBody?: never;
35243
+ responses: {
35244
+ /** @description Service disconnected */
35245
+ 204: {
35246
+ headers: {
35247
+ [name: string]: unknown;
35248
+ };
35249
+ content?: never;
35250
+ };
35251
+ 401: components["responses"]["Unauthorized"];
35252
+ /**
35253
+ * @description One of:
35254
+ * - `ACTIVE_COMPANY_NOT_ACCESSIBLE`: your account does not own or manage this company.
35255
+ * - `COMPANY_READ_ONLY`: only the `OWNER` and `ADMIN` members of the account that owns
35256
+ * the company manage its connections.
35257
+ * - `INSUFFICIENT_SCOPE`: the credential lacks `connections:write`, a privileged
35258
+ * scope.
35259
+ */
35260
+ 403: {
35261
+ headers: {
35262
+ [name: string]: unknown;
35263
+ };
35264
+ content: {
35265
+ "application/json": components["schemas"]["ErrorResponse"];
35266
+ };
35267
+ };
35268
+ 404: components["responses"]["CompanyConnectionNotFound"];
35269
+ 429: components["responses"]["TooManyRequests"];
35270
+ 500: components["responses"]["InternalServerError"];
35271
+ default: components["responses"]["UnexpectedError"];
35272
+ };
35273
+ };
35274
+ listCompanyInvoiceReplies: {
35275
+ parameters: {
35276
+ query?: {
35277
+ /**
35278
+ * @description Page number, starting at 1. The response echoes it back as `pagination.current_page`.
35279
+ * @example 1
35280
+ */
35281
+ page?: components["parameters"]["PageParam"];
35282
+ /**
35283
+ * @description How many items to return per page. The response echoes it back as `pagination.items_per_page`.
35284
+ * @example 20
35285
+ */
35286
+ limit?: components["parameters"]["LimitParam"];
35287
+ /** @description Keep only the replies about this invoice. */
35288
+ invoice_id?: string;
35289
+ /** @description Keep only the replies that arrived through this connection. The replies registered with `POST .../invoice-replies` have no connection, so they never match. */
35290
+ connection_id?: string;
35291
+ /** @description Keep only the replies about invoices of this customer. */
35292
+ customer_id?: string;
35293
+ /**
35294
+ * @description Keep only the replies received on these channels. Accepts a comma-separated list, for
35295
+ * example `channel=WHATSAPP,SMS`. A value BeeL. does not know matches nothing.
35296
+ */
35297
+ channel?: components["schemas"]["InvoiceReplyChannel"][];
35298
+ /** @description Keep only the replies received at or after this instant. */
35299
+ from?: string;
35300
+ /** @description Keep only the replies received at or before this instant. */
35301
+ to?: string;
35302
+ /** @description Direction of the sort by `received_at`. Ties are broken by `id`. */
35303
+ sort_order?: components["schemas"]["SortOrder"];
35304
+ };
35305
+ header?: never;
35306
+ path: {
35307
+ /** @description Unique identifier (UUID) of the company the operation acts on: its identifier, not its NIF. It is the only source of context: the account that owns it is derived from it, and the `BeeL-Active-Company` header plays no part. A company you do not reach answers `403`, and so does a company that does not exist, so the existence of a company in another account is never disclosed. */
35308
+ company_id: components["parameters"]["CompanyIdPathParam"];
35309
+ };
35310
+ cookie?: never;
35311
+ };
35312
+ requestBody?: never;
35313
+ responses: {
35314
+ /** @description Replies of the company */
35315
+ 200: {
35316
+ headers: {
35317
+ [name: string]: unknown;
35318
+ };
35319
+ content: {
35320
+ /**
35321
+ * @example {
35322
+ * "success": true,
35323
+ * "data": {
35324
+ * "replies": [
35325
+ * {
35326
+ * "id": "3f0c9a1e-6b2d-4c8f-a1e5-7d9b0c2e4f61",
35327
+ * "channel": "EMAIL",
35328
+ * "authenticated_by": "REPLY_TOKEN",
35329
+ * "connection_id": "8c3e1f7a-2b4d-4e6f-9a1c-5d7b3e9f2a41",
35330
+ * "invoice_id": "b71d5e2a-9c3f-4a7b-8e10-2f6d4c8a9b13",
35331
+ * "invoice_number": "F2026-0142",
35332
+ * "customer_id": "7a2c9e14-3b5d-4f6a-8c0e-1d2b3a4c5e6f",
35333
+ * "status": "RECEIVED",
35334
+ * "received_at": "2026-11-03T09:12:44Z",
35335
+ * "sender": {
35336
+ * "address": "[EMAIL]"
35337
+ * },
35338
+ * "subject": "RE: Factura F2026-0142",
35339
+ * "excerpt": "Hola, el CIF que aparece no es el nuestro, es [NIF]. ¿Podéis corregirla?",
35340
+ * "attachments": []
35341
+ * }
35342
+ * ],
35343
+ * "pagination": {
35344
+ * "current_page": 1,
35345
+ * "total_pages": 1,
35346
+ * "total_items": 1,
35347
+ * "items_per_page": 20,
35348
+ * "has_next": false,
35349
+ * "has_previous": false
35350
+ * }
35351
+ * }
35352
+ * }
35353
+ */
35354
+ "application/json": components["schemas"]["SuccessResponse"] & {
35355
+ data: {
35356
+ replies: components["schemas"]["InvoiceReplySummary"][];
35357
+ pagination: components["schemas"]["Pagination"];
35358
+ };
35359
+ };
35360
+ };
35361
+ };
35362
+ 400: components["responses"]["InvalidRequestTarget"];
35363
+ 401: components["responses"]["Unauthorized"];
35364
+ 403: components["responses"]["InvoiceReplyReadForbidden"];
35365
+ 422: components["responses"]["UnprocessableQueryParameter"];
35366
+ 429: components["responses"]["TooManyRequests"];
35367
+ 500: components["responses"]["InternalServerError"];
35368
+ default: components["responses"]["UnexpectedError"];
35369
+ };
35370
+ };
35371
+ createCompanyInvoiceReply: {
35372
+ parameters: {
35373
+ query?: never;
35374
+ header?: {
35375
+ /**
35376
+ * @description Idempotency key to prevent duplicates in sensitive operations.
35377
+ *
35378
+ * - Any unique client-generated string (e.g. an order id). A UUID also works but is not required
35379
+ * - Allowed characters: letters, digits, `_` and `-` (max 255 chars)
35380
+ * - Retrying with the same key replays the first response when it was a success (2xx) or a
35381
+ * server error (5xx): same status and body, plus the header `Idempotency-Replay: true`.
35382
+ * After a 5xx other than 503, check whether the operation took effect before retrying with a **new** key
35383
+ * - After a `503`, retry first with the **same** key. If the response carries `Idempotency-Replay: true`,
35384
+ * the operation may have taken effect: check the resource before using a new key. Without that header,
35385
+ * the retry runs the operation once
35386
+ * - A 4xx is not stored: the key is released, so the corrected request can reuse it
35387
+ * - Stored responses expire 24 hours after processing
35388
+ *
35389
+ * The key is scoped per user and environment, and bound to the request body, so retrying after
35390
+ * a network timeout replays the stored response instead of repeating the operation.
35391
+ *
35392
+ * | Status | Code | When |
35393
+ * |---|---|---|
35394
+ * | `400` | `INVALID_IDEMPOTENCY_KEY` | The key breaks the format rules above. |
35395
+ * | `409` | `IDEMPOTENCY_KEY_PROCESSING` | The first request is still in flight. Wait for the `Retry-After` seconds (2) and retry with the same key. |
35396
+ * | `409` | `IDEMPOTENCY_KEY_MISMATCH` | The key was already used with a **different** body. Use a new key. |
35397
+ * @example invoice-order-12345
35398
+ */
35399
+ "Idempotency-Key"?: components["parameters"]["IdempotencyKeyHeader"];
35400
+ };
35401
+ path: {
35402
+ /** @description Unique identifier (UUID) of the company the operation acts on: its identifier, not its NIF. It is the only source of context: the account that owns it is derived from it, and the `BeeL-Active-Company` header plays no part. A company you do not reach answers `403`, and so does a company that does not exist, so the existence of a company in another account is never disclosed. */
35403
+ company_id: components["parameters"]["CompanyIdPathParam"];
34221
35404
  };
34222
35405
  cookie?: never;
34223
35406
  };
34224
35407
  requestBody: {
34225
35408
  content: {
34226
- /**
34227
- * @example {
34228
- * "sender": {
34229
- * "source": "EMAIL_DOMAIN",
34230
- * "email_domain_id": "550e8400-e29b-41d4-a716-446655440000",
34231
- * "local_part": "cobros"
34232
- * },
34233
- * "defaults": {
34234
- * "subject": "Invoice {invoiceNumber}",
34235
- * "message": "Dear {customerName}, please find attached invoice {invoiceNumber}.",
34236
- * "cc": [
34237
- * "administracion@ejemplo.com"
34238
- * ]
34239
- * }
34240
- * }
34241
- */
34242
- "application/json": components["schemas"]["UpdateCompanyEmailConfigurationRequest"];
35409
+ "application/json": components["schemas"]["CreateInvoiceReplyRequest"];
34243
35410
  };
34244
35411
  };
34245
35412
  responses: {
34246
- /** @description Email configuration of the company after the change */
34247
- 200: {
35413
+ /** @description Reply registered. `Location` points at the reply. */
35414
+ 201: {
34248
35415
  headers: {
35416
+ Location: components["headers"]["CreatedResourceLocation"];
34249
35417
  [name: string]: unknown;
34250
35418
  };
34251
35419
  content: {
34252
- "application/json": components["schemas"]["SuccessResponse"] & {
34253
- data: components["schemas"]["CompanyEmailConfiguration"];
34254
- };
35420
+ "application/json": components["schemas"]["InvoiceReplyResponse"];
34255
35421
  };
34256
35422
  };
34257
35423
  400: components["responses"]["BadRequest"];
34258
35424
  401: components["responses"]["Unauthorized"];
34259
35425
  /**
34260
- * @description Your account does not own or manage this company, does not hold write access over it,
34261
- * or the credential is a test one (`LIVE_CREDENTIAL_REQUIRED`). Not owning the company answers
34262
- * `error.code` `ACTIVE_COMPANY_NOT_ACCESSIBLE`; a credential without the `companies:write`
34263
- * scope answers `INSUFFICIENT_SCOPE`. Sending `defaults` without the email customization
34264
- * plan answers `FEATURE_NOT_AVAILABLE`.
35426
+ * @description One of:
35427
+ * - `ACTIVE_COMPANY_NOT_ACCESSIBLE`: your account does not own or manage this company.
35428
+ * - `COMPANY_READ_ONLY`: your account does not hold write access over it. Write access
35429
+ * is enough, also as an account that manages the company.
35430
+ * - `INSUFFICIENT_SCOPE`: the credential lacks `invoice-replies:write`, a privileged
35431
+ * scope that a key created without selecting scopes does not hold.
34265
35432
  */
34266
35433
  403: {
34267
35434
  headers: {
@@ -34271,10 +35438,7 @@ interface operations {
34271
35438
  "application/json": components["schemas"]["ErrorResponse"];
34272
35439
  };
34273
35440
  };
34274
- /**
34275
- * @description The email domain does not exist, belongs to another account or was removed
34276
- * (`error.code` `EMAIL_DOMAIN_NOT_FOUND`).
34277
- */
35441
+ /** @description The invoice does not exist or belongs to another company (`INVOICE_NOT_FOUND`). */
34278
35442
  404: {
34279
35443
  headers: {
34280
35444
  [name: string]: unknown;
@@ -34284,21 +35448,43 @@ interface operations {
34284
35448
  };
34285
35449
  };
34286
35450
  /**
34287
- * @description The email domain is still being registered and cannot be chosen yet
34288
- * (`error.code` `EMAIL_DOMAIN_NOT_READY`).
35451
+ * @description One of:
35452
+ * - `INVOICE_REPLY_DUPLICATE`: a reply with the same `channel` and `external_id` already
35453
+ * exists; its identifier is in `error.details.reply_id`, absent when that reply was
35454
+ * deleted.
35455
+ * - `INVOICE_REPLY_INVOICE_NOT_ISSUED`: the invoice is a draft or a scheduled invoice.
35456
+ * - The idempotency conflicts of `Idempotency-Key`.
34289
35457
  */
34290
35458
  409: {
34291
35459
  headers: {
34292
35460
  [name: string]: unknown;
34293
35461
  };
34294
35462
  content: {
35463
+ /**
35464
+ * @example {
35465
+ * "success": false,
35466
+ * "error": {
35467
+ * "code": "INVOICE_REPLY_DUPLICATE",
35468
+ * "message": "A reply with this channel and external identifier already exists.",
35469
+ * "details": {
35470
+ * "reply_id": "3f0c9a1e-6b2d-4c8f-a1e5-7d9b0c2e4f61"
35471
+ * }
35472
+ * },
35473
+ * "meta": {
35474
+ * "timestamp": "2026-11-03T09:12:44Z",
35475
+ * "request_id": "4bf92f3577b34da6a3ce929d0e0e4736"
35476
+ * }
35477
+ * }
35478
+ */
34295
35479
  "application/json": components["schemas"]["ErrorResponse"];
34296
35480
  };
34297
35481
  };
34298
35482
  /**
34299
- * @description A property is not valid, or the combination of `source`, `email_domain_id` and
34300
- * `local_part` is not allowed (`error.code` `VALIDATION_ERROR`). Send values that follow
34301
- * the format described for the operation.
35483
+ * @description `VALIDATION_ERROR` when the body breaks this schema, with the field in `error.details`.
35484
+ * A body that fits the schema but not the rules answers, with the field in `error.details`:
35485
+ * - `MISSING_REQUIRED_FIELD`: neither `text` nor `attachments`;
35486
+ * - `VALUE_OUT_OF_RANGE`: a `channel` BeeL. does not know, a `sender.address` that does
35487
+ * not fit its `channel`, or a `received_at` more than 5 minutes ahead.
34302
35488
  */
34303
35489
  422: {
34304
35490
  headers: {
@@ -34313,6 +35499,161 @@ interface operations {
34313
35499
  default: components["responses"]["UnexpectedError"];
34314
35500
  };
34315
35501
  };
35502
+ getCompanyInvoiceReply: {
35503
+ parameters: {
35504
+ query?: never;
35505
+ header?: never;
35506
+ path: {
35507
+ /** @description Unique identifier (UUID) of the company the operation acts on: its identifier, not its NIF. It is the only source of context: the account that owns it is derived from it, and the `BeeL-Active-Company` header plays no part. A company you do not reach answers `403`, and so does a company that does not exist, so the existence of a company in another account is never disclosed. */
35508
+ company_id: components["parameters"]["CompanyIdPathParam"];
35509
+ /** @description Unique identifier (UUID) of the reply, as returned by the list or by `POST .../invoice-replies`. */
35510
+ reply_id: components["parameters"]["ReplyIdParam"];
35511
+ };
35512
+ cookie?: never;
35513
+ };
35514
+ requestBody?: never;
35515
+ responses: {
35516
+ /** @description The reply */
35517
+ 200: {
35518
+ headers: {
35519
+ [name: string]: unknown;
35520
+ };
35521
+ content: {
35522
+ "application/json": components["schemas"]["InvoiceReplyResponse"];
35523
+ };
35524
+ };
35525
+ 401: components["responses"]["Unauthorized"];
35526
+ 403: components["responses"]["InvoiceReplyReadForbidden"];
35527
+ /**
35528
+ * @description The reply does not exist or belongs to another company or environment
35529
+ * (`INVOICE_REPLY_NOT_FOUND`).
35530
+ */
35531
+ 404: {
35532
+ headers: {
35533
+ [name: string]: unknown;
35534
+ };
35535
+ content: {
35536
+ "application/json": components["schemas"]["ErrorResponse"];
35537
+ };
35538
+ };
35539
+ 429: components["responses"]["TooManyRequests"];
35540
+ 500: components["responses"]["InternalServerError"];
35541
+ default: components["responses"]["UnexpectedError"];
35542
+ };
35543
+ };
35544
+ deleteCompanyInvoiceReply: {
35545
+ parameters: {
35546
+ query?: never;
35547
+ header?: never;
35548
+ path: {
35549
+ /** @description Unique identifier (UUID) of the company the operation acts on: its identifier, not its NIF. It is the only source of context: the account that owns it is derived from it, and the `BeeL-Active-Company` header plays no part. A company you do not reach answers `403`, and so does a company that does not exist, so the existence of a company in another account is never disclosed. */
35550
+ company_id: components["parameters"]["CompanyIdPathParam"];
35551
+ /** @description Unique identifier (UUID) of the reply, as returned by the list or by `POST .../invoice-replies`. */
35552
+ reply_id: components["parameters"]["ReplyIdParam"];
35553
+ };
35554
+ cookie?: never;
35555
+ };
35556
+ requestBody?: never;
35557
+ responses: {
35558
+ /** @description Reply deleted, or already deleted. */
35559
+ 204: {
35560
+ headers: {
35561
+ [name: string]: unknown;
35562
+ };
35563
+ content?: never;
35564
+ };
35565
+ 401: components["responses"]["Unauthorized"];
35566
+ /**
35567
+ * @description One of:
35568
+ * - `ACTIVE_COMPANY_NOT_ACCESSIBLE`: your account does not own or manage this company.
35569
+ * - `COMPANY_READ_ONLY`: your account does not hold write access over it. Write access
35570
+ * is enough, also as an account that manages the company.
35571
+ * - `INSUFFICIENT_SCOPE`: the credential lacks `invoice-replies:write`, a privileged
35572
+ * scope that a key created without selecting scopes does not hold.
35573
+ */
35574
+ 403: {
35575
+ headers: {
35576
+ [name: string]: unknown;
35577
+ };
35578
+ content: {
35579
+ "application/json": components["schemas"]["ErrorResponse"];
35580
+ };
35581
+ };
35582
+ /**
35583
+ * @description The reply never existed or belongs to another company or environment
35584
+ * (`INVOICE_REPLY_NOT_FOUND`).
35585
+ */
35586
+ 404: {
35587
+ headers: {
35588
+ [name: string]: unknown;
35589
+ };
35590
+ content: {
35591
+ "application/json": components["schemas"]["ErrorResponse"];
35592
+ };
35593
+ };
35594
+ 429: components["responses"]["TooManyRequests"];
35595
+ 500: components["responses"]["InternalServerError"];
35596
+ default: components["responses"]["UnexpectedError"];
35597
+ };
35598
+ };
35599
+ getCompanyInvoiceReplyAttachment: {
35600
+ parameters: {
35601
+ query?: never;
35602
+ header?: never;
35603
+ path: {
35604
+ /** @description Unique identifier (UUID) of the company the operation acts on: its identifier, not its NIF. It is the only source of context: the account that owns it is derived from it, and the `BeeL-Active-Company` header plays no part. A company you do not reach answers `403`, and so does a company that does not exist, so the existence of a company in another account is never disclosed. */
35605
+ company_id: components["parameters"]["CompanyIdPathParam"];
35606
+ /** @description Unique identifier (UUID) of the reply, as returned by the list or by `POST .../invoice-replies`. */
35607
+ reply_id: components["parameters"]["ReplyIdParam"];
35608
+ /** @description Unique identifier (UUID) of the attachment, as returned in `attachments` by the reply. */
35609
+ attachment_id: components["parameters"]["AttachmentIdParam"];
35610
+ };
35611
+ cookie?: never;
35612
+ };
35613
+ requestBody?: never;
35614
+ responses: {
35615
+ /** @description The attachment, with its download link when there is a file. */
35616
+ 200: {
35617
+ headers: {
35618
+ [name: string]: unknown;
35619
+ };
35620
+ content: {
35621
+ "application/json": components["schemas"]["InvoiceReplyAttachmentResponse"];
35622
+ };
35623
+ };
35624
+ 401: components["responses"]["Unauthorized"];
35625
+ 403: components["responses"]["InvoiceReplyReadForbidden"];
35626
+ /**
35627
+ * @description One of:
35628
+ * - `INVOICE_REPLY_NOT_FOUND`: the reply does not exist or belongs to another company or environment.
35629
+ * - `INVOICE_REPLY_ATTACHMENT_NOT_FOUND`: the reply has no attachment with that identifier, or it
35630
+ * has been erased.
35631
+ */
35632
+ 404: {
35633
+ headers: {
35634
+ [name: string]: unknown;
35635
+ };
35636
+ content: {
35637
+ "application/json": components["schemas"]["ErrorResponse"];
35638
+ };
35639
+ };
35640
+ 429: components["responses"]["TooManyRequests"];
35641
+ 500: components["responses"]["InternalServerError"];
35642
+ /**
35643
+ * @description `EXTERNAL_SERVICE_ERROR` — the download link could not be requested from the email service.
35644
+ * It is transient; repeat the request later.
35645
+ */
35646
+ 502: {
35647
+ headers: {
35648
+ [name: string]: unknown;
35649
+ };
35650
+ content: {
35651
+ "application/json": components["schemas"]["ErrorResponse"];
35652
+ };
35653
+ };
35654
+ default: components["responses"]["UnexpectedError"];
35655
+ };
35656
+ };
34316
35657
  listEmailTemplateVariables: {
34317
35658
  parameters: {
34318
35659
  query?: never;
@@ -36772,7 +38113,15 @@ interface operations {
36772
38113
  };
36773
38114
  400: components["responses"]["BadRequest"];
36774
38115
  401: components["responses"]["Unauthorized"];
36775
- 403: components["responses"]["Forbidden"];
38116
+ /** @description `INSUFFICIENT_SCOPE`: the credential lacks the read scope of an event of the subscription (`connections:read` for `connection.*`, `invoice-replies:read` for `invoice.reply.*`). `error.details.event_types` lists those events, comma-separated. The shared causes also apply. */
38117
+ 403: {
38118
+ headers: {
38119
+ [name: string]: unknown;
38120
+ };
38121
+ content: {
38122
+ "application/json": components["schemas"]["ErrorResponse"];
38123
+ };
38124
+ };
36776
38125
  422: components["responses"]["WebhookSubscriptionValidationError"];
36777
38126
  429: components["responses"]["TooManyRequests"];
36778
38127
  500: components["responses"]["InternalServerError"];
@@ -36872,7 +38221,15 @@ interface operations {
36872
38221
  };
36873
38222
  400: components["responses"]["BadRequest"];
36874
38223
  401: components["responses"]["Unauthorized"];
36875
- 403: components["responses"]["Forbidden"];
38224
+ /** @description `INSUFFICIENT_SCOPE`: the credential lacks the read scope of an event of the subscription (`connections:read` for `connection.*`, `invoice-replies:read` for `invoice.reply.*`). `error.details.event_types` lists those events, comma-separated. The shared causes also apply. */
38225
+ 403: {
38226
+ headers: {
38227
+ [name: string]: unknown;
38228
+ };
38229
+ content: {
38230
+ "application/json": components["schemas"]["ErrorResponse"];
38231
+ };
38232
+ };
36876
38233
  404: components["responses"]["NotFound"];
36877
38234
  422: components["responses"]["WebhookSubscriptionValidationError"];
36878
38235
  429: components["responses"]["TooManyRequests"];
@@ -38252,7 +39609,7 @@ declare function createBeeLClient(config: BeeLConfig): openapi_fetch.Client<path
38252
39609
  type BeeLClient = ReturnType<typeof createBeeLClient>;
38253
39610
 
38254
39611
  type Invoice$1 = components['schemas']['Invoice'];
38255
- type Pagination$5 = components['schemas']['Pagination'];
39612
+ type Pagination$6 = components['schemas']['Pagination'];
38256
39613
  type ListParams$2 = operations['listInvoices']['parameters']['query'];
38257
39614
  /**
38258
39615
  * Invoices of the focused company, on the flat `/v1/invoices` routes.
@@ -38273,7 +39630,7 @@ declare class InvoicesResource {
38273
39630
  */
38274
39631
  list(params?: ListParams$2): Promise<{
38275
39632
  invoices: Invoice$1[];
38276
- pagination: Pagination$5;
39633
+ pagination: Pagination$6;
38277
39634
  }>;
38278
39635
  /**
38279
39636
  * Create a new invoice. An idempotency key is automatically added.
@@ -39134,7 +40491,7 @@ declare class InvoicesResource {
39134
40491
  }
39135
40492
 
39136
40493
  type Customer$1 = components['schemas']['Customer'];
39137
- type Pagination$4 = components['schemas']['Pagination'];
40494
+ type Pagination$5 = components['schemas']['Pagination'];
39138
40495
  type ListParams$1 = operations['listCustomers']['parameters']['query'];
39139
40496
  /**
39140
40497
  * Customers of the focused company, on the flat `/v1/customers` routes.
@@ -39155,7 +40512,7 @@ declare class CustomersResource {
39155
40512
  */
39156
40513
  list(params?: ListParams$1): Promise<{
39157
40514
  customers: Customer$1[];
39158
- pagination: Pagination$4;
40515
+ pagination: Pagination$5;
39159
40516
  }>;
39160
40517
  /**
39161
40518
  * Create a new customer.
@@ -39249,7 +40606,7 @@ declare class CustomersResource {
39249
40606
  }
39250
40607
 
39251
40608
  type Product$1 = components['schemas']['Product'];
39252
- type Pagination$3 = components['schemas']['Pagination'];
40609
+ type Pagination$4 = components['schemas']['Pagination'];
39253
40610
  type ListParams = operations['listProducts']['parameters']['query'];
39254
40611
  /**
39255
40612
  * Products of the focused company, on the flat `/v1/products` routes.
@@ -39270,7 +40627,7 @@ declare class ProductsResource {
39270
40627
  */
39271
40628
  list(params?: ListParams): Promise<{
39272
40629
  products: Product$1[];
39273
- pagination: Pagination$3;
40630
+ pagination: Pagination$4;
39274
40631
  }>;
39275
40632
  /**
39276
40633
  * Create a new product or service.
@@ -39790,7 +41147,7 @@ declare class NifResource {
39790
41147
  type ManagedAccountSummary = components['schemas']['ManagedAccountSummary'];
39791
41148
  type WebhookSubscription = components['schemas']['WebhookSubscription'];
39792
41149
  type CompanyData = components['schemas']['CompanyData'];
39793
- type Pagination$2 = components['schemas']['Pagination'];
41150
+ type Pagination$3 = components['schemas']['Pagination'];
39794
41151
  /**
39795
41152
  * Accounts you provisioned and manage (multi-account provisioning for platforms and
39796
41153
  * advisory firms). Reach it as `beel.accounts`; scope one with `beel.account(accountId)`.
@@ -40115,7 +41472,7 @@ declare class AccountWebhooksResource {
40115
41472
  */
40116
41473
  list(params?: operations['listAccountWebhookSubscriptions']['parameters']['query']): Promise<{
40117
41474
  webhooks?: WebhookSubscription[];
40118
- pagination?: Pagination$2;
41475
+ pagination?: Pagination$3;
40119
41476
  }>;
40120
41477
  /**
40121
41478
  * Subscribe an HTTPS endpoint to events.
@@ -40319,7 +41676,7 @@ declare class AccountCompaniesResource {
40319
41676
  */
40320
41677
  list(params?: operations['listCompanies']['parameters']['query']): Promise<{
40321
41678
  companies: CompanyData[];
40322
- pagination: Pagination$2 | undefined;
41679
+ pagination: Pagination$3 | undefined;
40323
41680
  }>;
40324
41681
  /**
40325
41682
  * Register a new company (NIF) under the account.
@@ -40422,7 +41779,7 @@ interface RequestOptions {
40422
41779
 
40423
41780
  type ManagedPaymentConnection = components['schemas']['ManagedPaymentConnection'];
40424
41781
  type ManagedPaymentEvent = components['schemas']['ManagedPaymentEvent'];
40425
- type Pagination$1 = components['schemas']['Pagination'];
41782
+ type Pagination$2 = components['schemas']['Pagination'];
40426
41783
  type PaymentEventCounts = components['schemas']['PaymentEventCounts'];
40427
41784
  /**
40428
41785
  * Payment connections of a company (NIF): the Stripe Connect link whose charges
@@ -40527,7 +41884,7 @@ declare class CompanyPaymentEventsResource {
40527
41884
  */
40528
41885
  list(params?: operations['listCompanyPaymentEvents']['parameters']['query']): Promise<{
40529
41886
  events: ManagedPaymentEvent[];
40530
- pagination?: Pagination$1;
41887
+ pagination?: Pagination$2;
40531
41888
  counts?: PaymentEventCounts;
40532
41889
  }>;
40533
41890
  /**
@@ -40749,6 +42106,148 @@ declare class CompanyPaymentEventsResource {
40749
42106
  }>;
40750
42107
  }
40751
42108
 
42109
+ type InvoiceReplySummary = components['schemas']['InvoiceReplySummary'];
42110
+ type Pagination$1 = components['schemas']['Pagination'];
42111
+ /**
42112
+ * Replies of the customers of a company about its invoices, on any channel. Reach it as
42113
+ * `beel.company(companyId).invoiceReplies`.
42114
+ *
42115
+ * The list masks personal data; {@link get} returns the full text. An attachment is read
42116
+ * with {@link getAttachment}, which returns a temporary download link for its file.
42117
+ *
42118
+ * @example
42119
+ * ```typescript
42120
+ * const replies = beel.company('company-uuid').invoiceReplies;
42121
+ * const { replies: page } = await replies.list({ invoice_id: 'invoice-uuid' });
42122
+ * const reply = await replies.get(page[0].id);
42123
+ * const attachment = await replies.getAttachment(reply.id, reply.attachments![0].id);
42124
+ * if (attachment.download_url) console.log(attachment.download_url);
42125
+ * ```
42126
+ */
42127
+ declare class CompanyInvoiceRepliesResource {
42128
+ private client;
42129
+ private companyId;
42130
+ constructor(client: BeeLClient, companyId: string);
42131
+ private path;
42132
+ /**
42133
+ * List the replies of the company, most recent first, with masked `excerpt`, `subject`
42134
+ * and sender.
42135
+ *
42136
+ * @param params - Filters (`invoice_id`, `customer_id`, `channel`, `from`, `to`…) and pagination.
42137
+ * @param options - Per-call `idempotencyKey`, `signal` and `timeoutMs`.
42138
+ * @returns The page of `replies` and its `pagination`.
42139
+ *
42140
+ * @example
42141
+ * ```typescript
42142
+ * const { replies } = await company.invoiceReplies.list({ invoice_id: 'invoice-uuid' });
42143
+ * ```
42144
+ */
42145
+ list(params?: operations['listCompanyInvoiceReplies']['parameters']['query'], options?: RequestOptions): Promise<{
42146
+ replies: InvoiceReplySummary[];
42147
+ pagination: Pagination$1;
42148
+ }>;
42149
+ /**
42150
+ * Register a message that a customer sent you on a channel of your own about an invoice.
42151
+ *
42152
+ * @param body - The invoice, `channel`, `external_id`, sender and the text or attachments.
42153
+ * @param options - Per-call `idempotencyKey`, `signal` and `timeoutMs`.
42154
+ * @returns The registered reply.
42155
+ *
42156
+ * @example
42157
+ * ```typescript
42158
+ * await company.invoiceReplies.create({
42159
+ * invoice_id: 'invoice-uuid',
42160
+ * channel: 'WHATSAPP',
42161
+ * external_id: 'wamid.EXAMPLE0001',
42162
+ * sender: { address: '+34600123456' },
42163
+ * text: 'Can you send it to Distribuciones Ejemplo S.L.?',
42164
+ * });
42165
+ * ```
42166
+ */
42167
+ create(body: components['schemas']['CreateInvoiceReplyRequest'], options?: RequestOptions): Promise<{
42168
+ id: string;
42169
+ channel: components["schemas"]["InvoiceReplyChannel"];
42170
+ authenticated_by: components["schemas"]["InvoiceReplyAuthentication"];
42171
+ connection_id: string | null;
42172
+ invoice_id: string | null;
42173
+ invoice_number: string | null;
42174
+ customer_id: string | null;
42175
+ status: components["schemas"]["InvoiceReplyStatus"];
42176
+ received_at: string;
42177
+ subject: string | null;
42178
+ excerpt: string | null;
42179
+ } & {
42180
+ sender: components["schemas"]["InvoiceReplySender"];
42181
+ external_id: string | null;
42182
+ attachments: components["schemas"]["InvoiceReplyAttachment"][] | null;
42183
+ text: string | null;
42184
+ is_text_truncated: boolean;
42185
+ }>;
42186
+ /**
42187
+ * Get one reply with its full text and the file names of its attachments.
42188
+ *
42189
+ * @param replyId - Reply UUID, from {@link list}.
42190
+ * @param options - Per-call `idempotencyKey`, `signal` and `timeoutMs`.
42191
+ * @returns The reply.
42192
+ */
42193
+ get(replyId: string, options?: RequestOptions): Promise<{
42194
+ id: string;
42195
+ channel: components["schemas"]["InvoiceReplyChannel"];
42196
+ authenticated_by: components["schemas"]["InvoiceReplyAuthentication"];
42197
+ connection_id: string | null;
42198
+ invoice_id: string | null;
42199
+ invoice_number: string | null;
42200
+ customer_id: string | null;
42201
+ status: components["schemas"]["InvoiceReplyStatus"];
42202
+ received_at: string;
42203
+ subject: string | null;
42204
+ excerpt: string | null;
42205
+ } & {
42206
+ sender: components["schemas"]["InvoiceReplySender"];
42207
+ external_id: string | null;
42208
+ attachments: components["schemas"]["InvoiceReplyAttachment"][] | null;
42209
+ text: string | null;
42210
+ is_text_truncated: boolean;
42211
+ }>;
42212
+ /**
42213
+ * Delete a reply: its content is erased. Deleting it again also succeeds.
42214
+ *
42215
+ * @param replyId - Reply UUID.
42216
+ * @param options - Per-call `idempotencyKey`, `signal` and `timeoutMs`.
42217
+ */
42218
+ delete(replyId: string, options?: RequestOptions): Promise<void>;
42219
+ /**
42220
+ * Get an attachment of a reply with a temporary `download_url` for its file. The link is
42221
+ * requested on each call and expires at `download_url_expires_at`: call again for a fresh
42222
+ * one rather than storing it. Both are `null` when there is no file to download.
42223
+ *
42224
+ * @param replyId - Reply UUID.
42225
+ * @param attachmentId - Attachment UUID, from the `attachments` of the reply.
42226
+ * @param options - Per-call `idempotencyKey`, `signal` and `timeoutMs`.
42227
+ * @returns The attachment, with `download_url` and `download_url_expires_at`.
42228
+ *
42229
+ * @example
42230
+ * ```typescript
42231
+ * const attachment = await company.invoiceReplies.getAttachment(replyId, attachmentId);
42232
+ * if (attachment.download_url) {
42233
+ * const file = await fetch(attachment.download_url);
42234
+ * }
42235
+ * ```
42236
+ */
42237
+ getAttachment(replyId: string, attachmentId: string, options?: RequestOptions): Promise<{
42238
+ id: string;
42239
+ url: string;
42240
+ file_expires_at: string | null;
42241
+ content_type: string;
42242
+ size_bytes: number | null;
42243
+ } & {
42244
+ filename: string | null;
42245
+ } & {
42246
+ download_url: string | null;
42247
+ download_url_expires_at: string | null;
42248
+ }>;
42249
+ }
42250
+
40752
42251
  type CreateInvoiceRequest$1 = components['schemas']['CreateInvoiceRequest'];
40753
42252
  /**
40754
42253
  * Invoice types whose `external_ref` the API keeps unique: at most one live (not deleted)
@@ -40803,6 +42302,8 @@ declare class CompanyScope {
40803
42302
  readonly recurringInvoices: CompanyRecurringInvoicesResource;
40804
42303
  /** Payment provider connections (Stripe) that auto-generate invoices under this NIF. */
40805
42304
  readonly paymentConnections: CompanyPaymentConnectionsResource;
42305
+ /** Replies of the customers of this company about its invoices, and their attachments. */
42306
+ readonly invoiceReplies: CompanyInvoiceRepliesResource;
40806
42307
  /** Default taxes of this company. */
40807
42308
  readonly taxConfiguration: CompanyTaxConfigurationResource;
40808
42309
  /** Whether this NIF submits its invoices to AEAT under VeriFactu. */
@@ -43540,7 +45041,15 @@ declare enum WebhookEventType {
43540
45041
  INVOICE_SCHEDULE_FAILED = "invoice.schedule_failed",
43541
45042
  ACCOUNT_CLAIMED = "account.claimed",
43542
45043
  COMPANY_CREATED = "company.created",
43543
- REPRESENTATION_SIGNED = "representation.signed"
45044
+ REPRESENTATION_SIGNED = "representation.signed",
45045
+ EMAIL_DOMAIN_VERIFIED = "email_domain.verified",
45046
+ EMAIL_DOMAIN_FAILED = "email_domain.failed",
45047
+ EMAIL_DOMAIN_REMOVED = "email_domain.removed",
45048
+ CONNECTION_CONNECTED = "connection.connected",
45049
+ CONNECTION_DISCONNECTED = "connection.disconnected",
45050
+ INVOICE_REPLY_RECEIVED = "invoice.reply.received",
45051
+ INVOICE_REPLY_DELETED = "invoice.reply.deleted",
45052
+ INVOICE_EMAIL_BOUNCED = "invoice.email.bounced"
43544
45053
  }
43545
45054
 
43546
45055
  /**
@@ -43681,6 +45190,105 @@ type WebhookEventDataInvoicePdfGenerated = {
43681
45190
  generation?: number;
43682
45191
  };
43683
45192
 
45193
+ /**
45194
+ * Payload for `invoice.reply.deleted` events. Identifiers only. An `invoice.reply.received` with the same `reply_id` that arrives after it is a late retry: discard it.
45195
+ */
45196
+ type WebhookEventDataInvoiceReplyDeleted = {
45197
+ /**
45198
+ * The deleted reply. Reading it answers `404`.
45199
+ */
45200
+ reply_id: string;
45201
+ /**
45202
+ * The invoice the reply was about, as in `invoice.reply.received`.
45203
+ */
45204
+ invoice_id: string | null;
45205
+ /**
45206
+ * When the reply was deleted, in UTC.
45207
+ */
45208
+ deleted_at: string;
45209
+ };
45210
+
45211
+ /**
45212
+ * What links the message to its invoice; it never verifies `sender`. Same values as `authenticated_by` in the Public API. Treat an unknown value like `API_KEY`.
45213
+ */
45214
+ type WebhookInvoiceReplyAuthentication = string;
45215
+
45216
+ /**
45217
+ * Where the customer wrote the message. Same values as `channel` in the Public API. More values may be added: treat an unknown one like `OTHER`, and do not assume a subject or an email address.
45218
+ */
45219
+ type WebhookInvoiceReplyChannel = string;
45220
+
45221
+ /**
45222
+ * Payload for `invoice.reply.received` events: the reply as a summary. `subject`, `excerpt`
45223
+ * and `sender.address` are masked, and it carries no `external_id`, sender name or file
45224
+ * names. The full reply is in `GET /v1/companies/{company_id}/invoice-replies/{reply_id}`.
45225
+ *
45226
+ */
45227
+ type WebhookEventDataInvoiceReplyReceived = {
45228
+ /**
45229
+ * The reply. Read it with `GET /v1/companies/{company_id}/invoice-replies/{reply_id}`.
45230
+ */
45231
+ reply_id: string;
45232
+ channel: WebhookInvoiceReplyChannel;
45233
+ /**
45234
+ * The connection the message arrived through; `null` when it was registered with `POST .../invoice-replies`.
45235
+ */
45236
+ connection_id: string | null;
45237
+ /**
45238
+ * The invoice the message is about. Every reply has one today, so handle `null` for channels added later.
45239
+ */
45240
+ invoice_id: string | null;
45241
+ /**
45242
+ * Number of that invoice; `null` when `invoice_id` is `null`.
45243
+ */
45244
+ invoice_number: string | null;
45245
+ authenticated_by: WebhookInvoiceReplyAuthentication;
45246
+ /**
45247
+ * The customer of the invoice; `null` for a one-off recipient or when `invoice_id` is `null`.
45248
+ */
45249
+ customer_id: string | null;
45250
+ /**
45251
+ * When the message was received, in UTC.
45252
+ */
45253
+ received_at: string;
45254
+ /**
45255
+ * Who the message says it comes from. It is not verified: never use it alone to authorize a change.
45256
+ */
45257
+ sender: {
45258
+ /**
45259
+ * Identifier of the sender on the channel, masked by type as `[EMAIL]`, `[PHONE]` or `[ID]`.
45260
+ */
45261
+ address: string;
45262
+ };
45263
+ /**
45264
+ * Subject of the message, with tax IDs, IBANs, email addresses and phone numbers masked; `null` when the message has none, as on every channel but `EMAIL`.
45265
+ */
45266
+ subject: string | null;
45267
+ /**
45268
+ * First paragraph of the text, without the quoted original message, with tax IDs, IBANs, email addresses and phone numbers replaced by `[NIF]`, `[IBAN]`, `[EMAIL]` and `[PHONE]`. `null` when the message has no text.
45269
+ */
45270
+ excerpt: string | null;
45271
+ /**
45272
+ * Attachments of the message. The files are not stored; read each one at its `url` for a temporary download link.
45273
+ */
45274
+ attachments: Array<{
45275
+ /**
45276
+ * Identifier of the attachment, stable across reads.
45277
+ */
45278
+ id: string;
45279
+ /**
45280
+ * Relative URL of the attachment resource. Relative to the API base URL (e.g., https://app.beel.es/api). Note it is a link to a link: reading it returns a temporary download link, or `download_url: null` when there is no file or it has expired.
45281
+ */
45282
+ url: string;
45283
+ /**
45284
+ * Estimate of when the file stops being available. `null` when the attachment has no downloadable file, as with those registered with `POST .../invoice-replies`.
45285
+ */
45286
+ file_expires_at: string | null;
45287
+ content_type: string;
45288
+ size_bytes: number | null;
45289
+ }>;
45290
+ };
45291
+
43684
45292
  /**
43685
45293
  * Payload for `invoice.schedule_failed` events.
43686
45294
  */
@@ -44059,6 +45667,10 @@ type AccountClaimedEvent = BusinessEvent<'account.claimed', WebhookEventDataAcco
44059
45667
  type CompanyCreatedEvent = BusinessEvent<'company.created', WebhookEventDataCompanyCreated>;
44060
45668
  /** `representation.signed`: a representation document was signed. */
44061
45669
  type RepresentationSignedEvent = BusinessEvent<'representation.signed', WebhookEventDataRepresentationSigned>;
45670
+ /** `invoice.reply.received`: a customer replied about an invoice; the full reply is read with `invoiceReplies.get`. */
45671
+ type InvoiceReplyReceivedEvent = BusinessEvent<'invoice.reply.received', WebhookEventDataInvoiceReplyReceived>;
45672
+ /** `invoice.reply.deleted`: a reply was deleted; it carries identifiers only. */
45673
+ type InvoiceReplyDeletedEvent = BusinessEvent<'invoice.reply.deleted', WebhookEventDataInvoiceReplyDeleted>;
44062
45674
  /**
44063
45675
  * A delivery sent with "Send test": `test` is `true` and `data` is a synthetic message,
44064
45676
  * whatever `type` says. Check `event.test` before narrowing on `event.type`.
@@ -44071,7 +45683,7 @@ type WebhookTestEvent = Omit<WebhookEventEnvelope$1, 'type' | 'test'> & {
44071
45683
  /**
44072
45684
  * Union type of all possible webhook events
44073
45685
  */
44074
- type WebhookEvent = VeriFactuStatusUpdatedEvent | InvoiceIssuedEvent | InvoiceVoidedEvent | InvoiceEmailSentEvent | InvoicePdfGeneratedEvent | InvoiceScheduleFailedEvent | RecurringInvoicePausedEvent | AccountClaimedEvent | CompanyCreatedEvent | RepresentationSignedEvent | WebhookTestEvent;
45686
+ type WebhookEvent = VeriFactuStatusUpdatedEvent | InvoiceIssuedEvent | InvoiceVoidedEvent | InvoiceEmailSentEvent | InvoicePdfGeneratedEvent | InvoiceScheduleFailedEvent | RecurringInvoicePausedEvent | AccountClaimedEvent | CompanyCreatedEvent | RepresentationSignedEvent | InvoiceReplyReceivedEvent | InvoiceReplyDeletedEvent | WebhookTestEvent;
44075
45687
 
44076
45688
  type CreateCustomerRequest = components['schemas']['CreateCustomerRequest'];
44077
45689
  /**
@@ -44287,4 +45899,4 @@ type VeriFactuStatusUpdatedData = WebhookEventDataVeriFactuStatusUpdated;
44287
45899
  /** @deprecated Renamed in the contract — use `VeriFactuSubmissionStatus`. */
44288
45900
  type VeriFactuStatus = VeriFactuSubmissionStatus;
44289
45901
 
44290
- export { type AccountClaimedEvent, AccountCompaniesResource, AccountInvitationsResource, AccountMembersResource, AccountScope, AccountWebhooksResource, AccountsResource, BeeL, BeeLApiError, BeeLAuthError, type BeeLConfig, BeeLConflictError, type BeeLErrorCode, BeeLErrorCodes, BeeLNotFoundError, BeeLRateLimitError, BeeLValidationError, CatalogsResource, type CompanyCreatedEvent, CompanyCustomersResource, CompanyInvoiceScheduleResource, CompanyInvoicesResource, CompanyPaymentConnectionsResource, CompanyPaymentEventsResource, CompanyProductsResource, CompanyRecurringInvoicesResource, CompanyScope, CompanySeriesResource, CompanyTaxConfigurationResource, CompanyVeriFactuConfigurationResource, type CreateInvoiceOnceParams, type CreateInvoiceOnceRequest, CustomerBuilder, EXTERNAL_REF_UNIQUE_INVOICE_TYPES, type ExternalRefUniqueInvoiceType, InvoiceBuilder, type InvoiceEmailSentEvent, type InvoiceIssuedEvent, type InvoicePdfGeneratedEvent, type InvoiceScheduleFailedEvent, type InvoiceVoidedEvent, type RecurringInvoicePausedEvent, type RepresentationSignedEvent, type RequestOptions, VeriFactuRecordOperation, type VeriFactuStatus, type VeriFactuStatusUpdatedData, type VeriFactuStatusUpdatedEvent, VeriFactuSubmissionStatus, type WebhookEvent, type WebhookEventDataAccountClaimed, type WebhookEventDataCompanyCreated, type WebhookEventDataInvoiceEmailSent, type WebhookEventDataInvoiceIssued, type WebhookEventDataInvoicePdfGenerated, type WebhookEventDataInvoiceScheduleFailed, type WebhookEventDataInvoiceVoided, type WebhookEventDataRecurringInvoicePaused, type WebhookEventDataRepresentationSigned, type WebhookEventDataTest, type WebhookEventDataVeriFactuStatusUpdated, type WebhookEventEnvelope, WebhookEventType, type WebhookTestEvent, WebhookVerificationError, WebhookVerifier, type components, type operations, type paths };
45902
+ export { type AccountClaimedEvent, AccountCompaniesResource, AccountInvitationsResource, AccountMembersResource, AccountScope, AccountWebhooksResource, AccountsResource, BeeL, BeeLApiError, BeeLAuthError, type BeeLConfig, BeeLConflictError, type BeeLErrorCode, BeeLErrorCodes, BeeLNotFoundError, BeeLRateLimitError, BeeLValidationError, CatalogsResource, type CompanyCreatedEvent, CompanyCustomersResource, CompanyInvoiceRepliesResource, CompanyInvoiceScheduleResource, CompanyInvoicesResource, CompanyPaymentConnectionsResource, CompanyPaymentEventsResource, CompanyProductsResource, CompanyRecurringInvoicesResource, CompanyScope, CompanySeriesResource, CompanyTaxConfigurationResource, CompanyVeriFactuConfigurationResource, type CreateInvoiceOnceParams, type CreateInvoiceOnceRequest, CustomerBuilder, EXTERNAL_REF_UNIQUE_INVOICE_TYPES, type ExternalRefUniqueInvoiceType, InvoiceBuilder, type InvoiceEmailSentEvent, type InvoiceIssuedEvent, type InvoicePdfGeneratedEvent, type InvoiceReplyDeletedEvent, type InvoiceReplyReceivedEvent, type InvoiceScheduleFailedEvent, type InvoiceVoidedEvent, type RecurringInvoicePausedEvent, type RepresentationSignedEvent, type RequestOptions, VeriFactuRecordOperation, type VeriFactuStatus, type VeriFactuStatusUpdatedData, type VeriFactuStatusUpdatedEvent, VeriFactuSubmissionStatus, type WebhookEvent, type WebhookEventDataAccountClaimed, type WebhookEventDataCompanyCreated, type WebhookEventDataInvoiceEmailSent, type WebhookEventDataInvoiceIssued, type WebhookEventDataInvoicePdfGenerated, type WebhookEventDataInvoiceReplyDeleted, type WebhookEventDataInvoiceReplyReceived, type WebhookEventDataInvoiceScheduleFailed, type WebhookEventDataInvoiceVoided, type WebhookEventDataRecurringInvoicePaused, type WebhookEventDataRepresentationSigned, type WebhookEventDataTest, type WebhookEventDataVeriFactuStatusUpdated, type WebhookEventEnvelope, WebhookEventType, type WebhookTestEvent, WebhookVerificationError, WebhookVerifier, type components, type operations, type paths };