@zavudev/sdk 0.57.0 → 0.58.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/CHANGELOG.md +41 -0
- package/README.md +3 -3
- package/client.d.mts +39 -36
- package/client.d.mts.map +1 -1
- package/client.d.ts +39 -36
- package/client.d.ts.map +1 -1
- package/client.js +43 -40
- package/client.js.map +1 -1
- package/client.mjs +43 -40
- package/client.mjs.map +1 -1
- package/core/api-promise.d.mts.map +1 -1
- package/core/api-promise.d.ts.map +1 -1
- package/core/api-promise.js +0 -1
- package/core/api-promise.js.map +1 -1
- package/core/api-promise.mjs +0 -1
- package/core/api-promise.mjs.map +1 -1
- package/core/error.d.mts.map +1 -1
- package/core/error.d.ts.map +1 -1
- package/core/error.js +0 -1
- package/core/error.js.map +1 -1
- package/core/error.mjs +0 -1
- package/core/error.mjs.map +1 -1
- package/core/pagination.d.mts.map +1 -1
- package/core/pagination.d.ts.map +1 -1
- package/core/pagination.js +0 -1
- package/core/pagination.js.map +1 -1
- package/core/pagination.mjs +0 -1
- package/core/pagination.mjs.map +1 -1
- package/core/resource.d.mts.map +1 -1
- package/core/resource.d.ts.map +1 -1
- package/core/resource.js +0 -1
- package/core/resource.js.map +1 -1
- package/core/resource.mjs +0 -1
- package/core/resource.mjs.map +1 -1
- package/index.d.mts.map +1 -1
- package/index.d.ts.map +1 -1
- package/index.js +0 -1
- package/index.js.map +1 -1
- package/index.mjs +0 -1
- package/index.mjs.map +1 -1
- package/internal/builtin-types.d.mts.map +1 -1
- package/internal/builtin-types.d.ts.map +1 -1
- package/internal/builtin-types.js +0 -1
- package/internal/builtin-types.js.map +1 -1
- package/internal/builtin-types.mjs +0 -1
- package/internal/builtin-types.mjs.map +1 -1
- package/internal/detect-platform.d.mts.map +1 -1
- package/internal/detect-platform.d.ts.map +1 -1
- package/internal/detect-platform.js +0 -1
- package/internal/detect-platform.js.map +1 -1
- package/internal/detect-platform.mjs +0 -1
- package/internal/detect-platform.mjs.map +1 -1
- package/internal/errors.d.mts.map +1 -1
- package/internal/errors.d.ts.map +1 -1
- package/internal/errors.js +0 -1
- package/internal/errors.js.map +1 -1
- package/internal/errors.mjs +0 -1
- package/internal/errors.mjs.map +1 -1
- package/internal/headers.d.mts.map +1 -1
- package/internal/headers.d.ts.map +1 -1
- package/internal/headers.js +0 -1
- package/internal/headers.js.map +1 -1
- package/internal/headers.mjs +0 -1
- package/internal/headers.mjs.map +1 -1
- package/internal/parse.d.mts.map +1 -1
- package/internal/parse.d.ts.map +1 -1
- package/internal/parse.js +0 -1
- package/internal/parse.js.map +1 -1
- package/internal/parse.mjs +0 -1
- package/internal/parse.mjs.map +1 -1
- package/internal/request-options.d.mts.map +1 -1
- package/internal/request-options.d.ts.map +1 -1
- package/internal/request-options.js +0 -1
- package/internal/request-options.js.map +1 -1
- package/internal/request-options.mjs +0 -1
- package/internal/request-options.mjs.map +1 -1
- package/internal/shim-types.d.mts.map +1 -1
- package/internal/shim-types.d.ts.map +1 -1
- package/internal/shim-types.js +6 -1
- package/internal/shim-types.js.map +1 -1
- package/internal/shim-types.mjs +6 -1
- package/internal/shim-types.mjs.map +1 -1
- package/internal/shims.d.mts.map +1 -1
- package/internal/shims.d.ts.map +1 -1
- package/internal/shims.js +6 -1
- package/internal/shims.js.map +1 -1
- package/internal/shims.mjs +6 -1
- package/internal/shims.mjs.map +1 -1
- package/internal/types.d.mts.map +1 -1
- package/internal/types.d.ts.map +1 -1
- package/internal/types.js +0 -1
- package/internal/types.js.map +1 -1
- package/internal/types.mjs +0 -1
- package/internal/types.mjs.map +1 -1
- package/internal/utils/base64.d.mts.map +1 -1
- package/internal/utils/base64.d.ts.map +1 -1
- package/internal/utils/base64.js +0 -1
- package/internal/utils/base64.js.map +1 -1
- package/internal/utils/base64.mjs +0 -1
- package/internal/utils/base64.mjs.map +1 -1
- package/internal/utils/env.d.mts.map +1 -1
- package/internal/utils/env.d.ts.map +1 -1
- package/internal/utils/env.js +0 -1
- package/internal/utils/env.js.map +1 -1
- package/internal/utils/env.mjs +0 -1
- package/internal/utils/env.mjs.map +1 -1
- package/internal/utils/log.d.mts.map +1 -1
- package/internal/utils/log.d.ts.map +1 -1
- package/internal/utils/log.js +0 -1
- package/internal/utils/log.js.map +1 -1
- package/internal/utils/log.mjs +0 -1
- package/internal/utils/log.mjs.map +1 -1
- package/internal/utils/query.d.mts.map +1 -1
- package/internal/utils/query.d.ts.map +1 -1
- package/internal/utils/query.js +1 -2
- package/internal/utils/query.js.map +1 -1
- package/internal/utils/query.mjs +1 -2
- package/internal/utils/query.mjs.map +1 -1
- package/internal/utils/sleep.d.mts.map +1 -1
- package/internal/utils/sleep.d.ts.map +1 -1
- package/internal/utils/sleep.js +0 -1
- package/internal/utils/sleep.js.map +1 -1
- package/internal/utils/sleep.mjs +0 -1
- package/internal/utils/sleep.mjs.map +1 -1
- package/internal/utils/uuid.d.mts.map +1 -1
- package/internal/utils/uuid.d.ts.map +1 -1
- package/internal/utils/uuid.js +0 -1
- package/internal/utils/uuid.js.map +1 -1
- package/internal/utils/uuid.mjs +0 -1
- package/internal/utils/uuid.mjs.map +1 -1
- package/internal/utils/values.d.mts.map +1 -1
- package/internal/utils/values.d.ts.map +1 -1
- package/internal/utils/values.js +0 -1
- package/internal/utils/values.js.map +1 -1
- package/internal/utils/values.mjs +0 -1
- package/internal/utils/values.mjs.map +1 -1
- package/internal/utils.d.mts.map +1 -1
- package/internal/utils.d.ts.map +1 -1
- package/internal/utils.js +0 -1
- package/internal/utils.js.map +1 -1
- package/internal/utils.mjs +0 -1
- package/internal/utils.mjs.map +1 -1
- package/package.json +29 -10
- package/resources/addresses.d.mts +27 -77
- package/resources/addresses.d.mts.map +1 -1
- package/resources/addresses.d.ts +27 -77
- package/resources/addresses.d.ts.map +1 -1
- package/resources/addresses.js +19 -32
- package/resources/addresses.js.map +1 -1
- package/resources/addresses.mjs +19 -32
- package/resources/addresses.mjs.map +1 -1
- package/resources/agent-templates.d.mts +17 -71
- package/resources/agent-templates.d.mts.map +1 -1
- package/resources/agent-templates.d.ts +17 -71
- package/resources/agent-templates.d.ts.map +1 -1
- package/resources/agent-templates.js +11 -15
- package/resources/agent-templates.js.map +1 -1
- package/resources/agent-templates.mjs +11 -15
- package/resources/agent-templates.mjs.map +1 -1
- package/resources/agents/agents.d.mts +53 -395
- package/resources/agents/agents.d.mts.map +1 -1
- package/resources/agents/agents.d.ts +53 -395
- package/resources/agents/agents.d.ts.map +1 -1
- package/resources/agents/agents.js +33 -48
- package/resources/agents/agents.js.map +1 -1
- package/resources/agents/agents.mjs +33 -48
- package/resources/agents/agents.mjs.map +1 -1
- package/resources/agents/index.js +1 -1
- package/resources/agents/index.js.map +1 -1
- package/resources/agents/index.mjs +1 -1
- package/resources/agents/index.mjs.map +1 -1
- package/resources/agents/senders.d.mts +10 -32
- package/resources/agents/senders.d.mts.map +1 -1
- package/resources/agents/senders.d.ts +10 -32
- package/resources/agents/senders.d.ts.map +1 -1
- package/resources/agents/senders.js +7 -14
- package/resources/agents/senders.js.map +1 -1
- package/resources/agents/senders.mjs +7 -14
- package/resources/agents/senders.mjs.map +1 -1
- package/resources/agents.js +1 -1
- package/resources/agents.js.map +1 -1
- package/resources/agents.mjs +1 -1
- package/resources/agents.mjs.map +1 -1
- package/resources/balance.d.mts +6 -19
- package/resources/balance.d.mts.map +1 -1
- package/resources/balance.d.ts +6 -19
- package/resources/balance.d.ts.map +1 -1
- package/resources/balance.js +5 -1
- package/resources/balance.js.map +1 -1
- package/resources/balance.mjs +5 -1
- package/resources/balance.mjs.map +1 -1
- package/resources/broadcasts/broadcasts.d.mts +87 -413
- package/resources/broadcasts/broadcasts.d.mts.map +1 -1
- package/resources/broadcasts/broadcasts.d.ts +87 -413
- package/resources/broadcasts/broadcasts.d.ts.map +1 -1
- package/resources/broadcasts/broadcasts.js +59 -87
- package/resources/broadcasts/broadcasts.js.map +1 -1
- package/resources/broadcasts/broadcasts.mjs +59 -87
- package/resources/broadcasts/broadcasts.mjs.map +1 -1
- package/resources/broadcasts/contacts.d.mts +19 -109
- package/resources/broadcasts/contacts.d.mts.map +1 -1
- package/resources/broadcasts/contacts.d.ts +19 -109
- package/resources/broadcasts/contacts.d.ts.map +1 -1
- package/resources/broadcasts/contacts.js +10 -40
- package/resources/broadcasts/contacts.js.map +1 -1
- package/resources/broadcasts/contacts.mjs +10 -40
- package/resources/broadcasts/contacts.mjs.map +1 -1
- package/resources/broadcasts/index.js +1 -1
- package/resources/broadcasts/index.js.map +1 -1
- package/resources/broadcasts/index.mjs +1 -1
- package/resources/broadcasts/index.mjs.map +1 -1
- package/resources/broadcasts.js +1 -1
- package/resources/broadcasts.js.map +1 -1
- package/resources/broadcasts.mjs +1 -1
- package/resources/broadcasts.mjs.map +1 -1
- package/resources/calls.d.mts +40 -484
- package/resources/calls.d.mts.map +1 -1
- package/resources/calls.d.ts +40 -484
- package/resources/calls.d.ts.map +1 -1
- package/resources/calls.js +25 -35
- package/resources/calls.js.map +1 -1
- package/resources/calls.mjs +25 -35
- package/resources/calls.mjs.map +1 -1
- package/resources/contacts/channels.d.mts +20 -98
- package/resources/contacts/channels.d.mts.map +1 -1
- package/resources/contacts/channels.d.ts +20 -98
- package/resources/contacts/channels.d.ts.map +1 -1
- package/resources/contacts/channels.js +13 -32
- package/resources/contacts/channels.js.map +1 -1
- package/resources/contacts/channels.mjs +13 -32
- package/resources/contacts/channels.mjs.map +1 -1
- package/resources/contacts/contacts.d.mts +33 -244
- package/resources/contacts/contacts.d.mts.map +1 -1
- package/resources/contacts/contacts.d.ts +33 -244
- package/resources/contacts/contacts.d.ts.map +1 -1
- package/resources/contacts/contacts.js +21 -52
- package/resources/contacts/contacts.js.map +1 -1
- package/resources/contacts/contacts.mjs +21 -52
- package/resources/contacts/contacts.mjs.map +1 -1
- package/resources/contacts/index.js +1 -1
- package/resources/contacts/index.js.map +1 -1
- package/resources/contacts/index.mjs +1 -1
- package/resources/contacts/index.mjs.map +1 -1
- package/resources/contacts.js +1 -1
- package/resources/contacts.js.map +1 -1
- package/resources/contacts.mjs +1 -1
- package/resources/contacts.mjs.map +1 -1
- package/resources/conversations.d.mts +32 -316
- package/resources/conversations.d.mts.map +1 -1
- package/resources/conversations.d.ts +32 -316
- package/resources/conversations.d.ts.map +1 -1
- package/resources/conversations.js +15 -1
- package/resources/conversations.js.map +1 -1
- package/resources/conversations.mjs +15 -1
- package/resources/conversations.mjs.map +1 -1
- package/resources/email-domains.d.mts +25 -208
- package/resources/email-domains.d.mts.map +1 -1
- package/resources/email-domains.d.ts +25 -208
- package/resources/email-domains.d.ts.map +1 -1
- package/resources/email-domains.js +12 -27
- package/resources/email-domains.js.map +1 -1
- package/resources/email-domains.mjs +12 -27
- package/resources/email-domains.mjs.map +1 -1
- package/resources/functions/functions.d.mts +67 -553
- package/resources/functions/functions.d.mts.map +1 -1
- package/resources/functions/functions.d.ts +67 -553
- package/resources/functions/functions.d.ts.map +1 -1
- package/resources/functions/functions.js +39 -82
- package/resources/functions/functions.js.map +1 -1
- package/resources/functions/functions.mjs +39 -82
- package/resources/functions/functions.mjs.map +1 -1
- package/resources/functions/git-link.d.mts +25 -240
- package/resources/functions/git-link.d.mts.map +1 -1
- package/resources/functions/git-link.d.ts +25 -240
- package/resources/functions/git-link.d.ts.map +1 -1
- package/resources/functions/git-link.js +16 -34
- package/resources/functions/git-link.js.map +1 -1
- package/resources/functions/git-link.mjs +16 -34
- package/resources/functions/git-link.mjs.map +1 -1
- package/resources/functions/index.js +1 -1
- package/resources/functions/index.js.map +1 -1
- package/resources/functions/index.mjs +1 -1
- package/resources/functions/index.mjs.map +1 -1
- package/resources/functions/secrets.d.mts +15 -47
- package/resources/functions/secrets.d.mts.map +1 -1
- package/resources/functions/secrets.d.ts +15 -47
- package/resources/functions/secrets.d.ts.map +1 -1
- package/resources/functions/secrets.js +11 -21
- package/resources/functions/secrets.js.map +1 -1
- package/resources/functions/secrets.mjs +11 -21
- package/resources/functions/secrets.mjs.map +1 -1
- package/resources/functions/triggers.d.mts +14 -123
- package/resources/functions/triggers.d.mts.map +1 -1
- package/resources/functions/triggers.d.ts +14 -123
- package/resources/functions/triggers.d.ts.map +1 -1
- package/resources/functions/triggers.js +7 -25
- package/resources/functions/triggers.js.map +1 -1
- package/resources/functions/triggers.mjs +7 -25
- package/resources/functions/triggers.mjs.map +1 -1
- package/resources/functions.js +1 -1
- package/resources/functions.js.map +1 -1
- package/resources/functions.mjs +1 -1
- package/resources/functions.mjs.map +1 -1
- package/resources/index.d.mts +1 -0
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -0
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +4 -2
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +2 -1
- package/resources/index.mjs.map +1 -1
- package/resources/introspect.d.mts +15 -105
- package/resources/introspect.d.mts.map +1 -1
- package/resources/introspect.d.ts +15 -105
- package/resources/introspect.d.ts.map +1 -1
- package/resources/introspect.js +7 -13
- package/resources/introspect.js.map +1 -1
- package/resources/introspect.mjs +7 -13
- package/resources/introspect.mjs.map +1 -1
- package/resources/invitations/webhook.d.mts +57 -0
- package/resources/invitations/webhook.d.mts.map +1 -0
- package/resources/invitations/webhook.d.ts +57 -0
- package/resources/invitations/webhook.d.ts.map +1 -0
- package/resources/invitations/webhook.js +61 -0
- package/resources/invitations/webhook.js.map +1 -0
- package/resources/invitations/webhook.mjs +57 -0
- package/resources/invitations/webhook.mjs.map +1 -0
- package/resources/invitations.d.mts +27 -174
- package/resources/invitations.d.mts.map +1 -1
- package/resources/invitations.d.ts +27 -174
- package/resources/invitations.d.ts.map +1 -1
- package/resources/invitations.js +20 -30
- package/resources/invitations.js.map +1 -1
- package/resources/invitations.mjs +19 -30
- package/resources/invitations.mjs.map +1 -1
- package/resources/me.d.mts +9 -18
- package/resources/me.d.mts.map +1 -1
- package/resources/me.d.ts +9 -18
- package/resources/me.d.ts.map +1 -1
- package/resources/me.js +5 -1
- package/resources/me.js.map +1 -1
- package/resources/me.mjs +5 -1
- package/resources/me.mjs.map +1 -1
- package/resources/memory/collections/collections.d.mts +75 -0
- package/resources/memory/collections/collections.d.mts.map +1 -0
- package/resources/memory/collections/collections.d.ts +75 -0
- package/resources/memory/collections/collections.d.ts.map +1 -0
- package/resources/memory/collections/collections.js +79 -0
- package/resources/memory/collections/collections.js.map +1 -0
- package/resources/memory/collections/collections.mjs +74 -0
- package/resources/memory/collections/collections.mjs.map +1 -0
- package/resources/memory/collections/index.d.mts +3 -0
- package/resources/memory/collections/index.d.mts.map +1 -0
- package/resources/memory/collections/index.d.ts +3 -0
- package/resources/memory/collections/index.d.ts.map +1 -0
- package/resources/memory/collections/index.js +9 -0
- package/resources/memory/collections/index.js.map +1 -0
- package/resources/memory/collections/index.mjs +4 -0
- package/resources/memory/collections/index.mjs.map +1 -0
- package/resources/memory/collections/items.d.mts +88 -0
- package/resources/memory/collections/items.d.mts.map +1 -0
- package/resources/memory/collections/items.d.ts +88 -0
- package/resources/memory/collections/items.d.ts.map +1 -0
- package/resources/memory/collections/items.js +120 -0
- package/resources/memory/collections/items.js.map +1 -0
- package/resources/memory/collections/items.mjs +116 -0
- package/resources/memory/collections/items.mjs.map +1 -0
- package/resources/memory/collections.d.mts +2 -0
- package/resources/memory/collections.d.mts.map +1 -0
- package/resources/memory/collections.d.ts +2 -0
- package/resources/memory/collections.d.ts.map +1 -0
- package/resources/memory/collections.js +6 -0
- package/resources/memory/collections.js.map +1 -0
- package/resources/memory/collections.mjs +3 -0
- package/resources/memory/collections.mjs.map +1 -0
- package/resources/memory/index.d.mts +3 -0
- package/resources/memory/index.d.mts.map +1 -0
- package/resources/memory/index.d.ts +3 -0
- package/resources/memory/index.d.ts.map +1 -0
- package/resources/memory/index.js +9 -0
- package/resources/memory/index.js.map +1 -0
- package/resources/memory/index.mjs +4 -0
- package/resources/memory/index.mjs.map +1 -0
- package/resources/memory/memory.d.mts +111 -0
- package/resources/memory/memory.d.mts.map +1 -0
- package/resources/memory/memory.d.ts +111 -0
- package/resources/memory/memory.d.ts.map +1 -0
- package/resources/memory/memory.js +116 -0
- package/resources/memory/memory.js.map +1 -0
- package/resources/memory/memory.mjs +111 -0
- package/resources/memory/memory.mjs.map +1 -0
- package/resources/memory.d.mts +2 -0
- package/resources/memory.d.mts.map +1 -0
- package/resources/memory.d.ts +2 -0
- package/resources/memory.d.ts.map +1 -0
- package/resources/memory.js +6 -0
- package/resources/memory.js.map +1 -0
- package/resources/memory.mjs +3 -0
- package/resources/memory.mjs.map +1 -0
- package/resources/messages.d.mts +106 -583
- package/resources/messages.d.mts.map +1 -1
- package/resources/messages.d.ts +106 -583
- package/resources/messages.d.ts.map +1 -1
- package/resources/messages.js +85 -75
- package/resources/messages.js.map +1 -1
- package/resources/messages.mjs +85 -75
- package/resources/messages.mjs.map +1 -1
- package/resources/number-10dlc/brands.d.mts +34 -204
- package/resources/number-10dlc/brands.d.mts.map +1 -1
- package/resources/number-10dlc/brands.d.ts +34 -204
- package/resources/number-10dlc/brands.d.ts.map +1 -1
- package/resources/number-10dlc/brands.js +21 -59
- package/resources/number-10dlc/brands.js.map +1 -1
- package/resources/number-10dlc/brands.mjs +21 -59
- package/resources/number-10dlc/brands.mjs.map +1 -1
- package/resources/number-10dlc/campaigns/campaigns.d.mts +32 -176
- package/resources/number-10dlc/campaigns/campaigns.d.mts.map +1 -1
- package/resources/number-10dlc/campaigns/campaigns.d.ts +32 -176
- package/resources/number-10dlc/campaigns/campaigns.d.ts.map +1 -1
- package/resources/number-10dlc/campaigns/campaigns.js +19 -62
- package/resources/number-10dlc/campaigns/campaigns.js.map +1 -1
- package/resources/number-10dlc/campaigns/campaigns.mjs +19 -62
- package/resources/number-10dlc/campaigns/campaigns.mjs.map +1 -1
- package/resources/number-10dlc/campaigns/index.js +1 -1
- package/resources/number-10dlc/campaigns/index.js.map +1 -1
- package/resources/number-10dlc/campaigns/index.mjs +1 -1
- package/resources/number-10dlc/campaigns/index.mjs.map +1 -1
- package/resources/number-10dlc/campaigns/phone-numbers.d.mts +21 -56
- package/resources/number-10dlc/campaigns/phone-numbers.d.mts.map +1 -1
- package/resources/number-10dlc/campaigns/phone-numbers.d.ts +21 -56
- package/resources/number-10dlc/campaigns/phone-numbers.d.ts.map +1 -1
- package/resources/number-10dlc/campaigns/phone-numbers.js +15 -26
- package/resources/number-10dlc/campaigns/phone-numbers.js.map +1 -1
- package/resources/number-10dlc/campaigns/phone-numbers.mjs +15 -26
- package/resources/number-10dlc/campaigns/phone-numbers.mjs.map +1 -1
- package/resources/number-10dlc/campaigns.js +1 -1
- package/resources/number-10dlc/campaigns.js.map +1 -1
- package/resources/number-10dlc/campaigns.mjs +1 -1
- package/resources/number-10dlc/campaigns.mjs.map +1 -1
- package/resources/number-10dlc/index.js +1 -1
- package/resources/number-10dlc/index.js.map +1 -1
- package/resources/number-10dlc/index.mjs +1 -1
- package/resources/number-10dlc/index.mjs.map +1 -1
- package/resources/number-10dlc/number-10dlc.d.mts +3 -4
- package/resources/number-10dlc/number-10dlc.d.mts.map +1 -1
- package/resources/number-10dlc/number-10dlc.d.ts +3 -4
- package/resources/number-10dlc/number-10dlc.d.ts.map +1 -1
- package/resources/number-10dlc/number-10dlc.js +1 -5
- package/resources/number-10dlc/number-10dlc.js.map +1 -1
- package/resources/number-10dlc/number-10dlc.mjs +1 -5
- package/resources/number-10dlc/number-10dlc.mjs.map +1 -1
- package/resources/number-10dlc.js +1 -1
- package/resources/number-10dlc.js.map +1 -1
- package/resources/number-10dlc.mjs +1 -1
- package/resources/number-10dlc.mjs.map +1 -1
- package/resources/phone-numbers.d.mts +95 -239
- package/resources/phone-numbers.d.mts.map +1 -1
- package/resources/phone-numbers.d.ts +95 -239
- package/resources/phone-numbers.d.ts.map +1 -1
- package/resources/phone-numbers.js +74 -54
- package/resources/phone-numbers.js.map +1 -1
- package/resources/phone-numbers.mjs +74 -54
- package/resources/phone-numbers.mjs.map +1 -1
- package/resources/regulatory-documents.d.mts +24 -78
- package/resources/regulatory-documents.d.mts.map +1 -1
- package/resources/regulatory-documents.d.ts +24 -78
- package/resources/regulatory-documents.d.ts.map +1 -1
- package/resources/regulatory-documents.js +16 -33
- package/resources/regulatory-documents.js.map +1 -1
- package/resources/regulatory-documents.mjs +16 -33
- package/resources/regulatory-documents.mjs.map +1 -1
- package/resources/senders/agent/agent.d.mts +44 -496
- package/resources/senders/agent/agent.d.mts.map +1 -1
- package/resources/senders/agent/agent.d.ts +44 -496
- package/resources/senders/agent/agent.d.ts.map +1 -1
- package/resources/senders/agent/agent.js +24 -49
- package/resources/senders/agent/agent.js.map +1 -1
- package/resources/senders/agent/agent.mjs +24 -49
- package/resources/senders/agent/agent.mjs.map +1 -1
- package/resources/senders/agent/executions.d.mts +13 -33
- package/resources/senders/agent/executions.d.mts.map +1 -1
- package/resources/senders/agent/executions.d.ts +13 -33
- package/resources/senders/agent/executions.d.ts.map +1 -1
- package/resources/senders/agent/executions.js +7 -18
- package/resources/senders/agent/executions.js.map +1 -1
- package/resources/senders/agent/executions.mjs +7 -18
- package/resources/senders/agent/executions.mjs.map +1 -1
- package/resources/senders/agent/flows.d.mts +34 -188
- package/resources/senders/agent/flows.d.mts.map +1 -1
- package/resources/senders/agent/flows.d.ts +34 -188
- package/resources/senders/agent/flows.d.ts.map +1 -1
- package/resources/senders/agent/flows.js +19 -69
- package/resources/senders/agent/flows.js.map +1 -1
- package/resources/senders/agent/flows.mjs +19 -69
- package/resources/senders/agent/flows.mjs.map +1 -1
- package/resources/senders/agent/index.js +1 -1
- package/resources/senders/agent/index.js.map +1 -1
- package/resources/senders/agent/index.mjs +1 -1
- package/resources/senders/agent/index.mjs.map +1 -1
- package/resources/senders/agent/knowledge-bases/documents.d.mts +27 -105
- package/resources/senders/agent/knowledge-bases/documents.d.mts.map +1 -1
- package/resources/senders/agent/knowledge-bases/documents.d.ts +27 -105
- package/resources/senders/agent/knowledge-bases/documents.d.ts.map +1 -1
- package/resources/senders/agent/knowledge-bases/documents.js +16 -47
- package/resources/senders/agent/knowledge-bases/documents.js.map +1 -1
- package/resources/senders/agent/knowledge-bases/documents.mjs +16 -47
- package/resources/senders/agent/knowledge-bases/documents.mjs.map +1 -1
- package/resources/senders/agent/knowledge-bases/index.js +1 -1
- package/resources/senders/agent/knowledge-bases/index.js.map +1 -1
- package/resources/senders/agent/knowledge-bases/index.mjs +1 -1
- package/resources/senders/agent/knowledge-bases/index.mjs.map +1 -1
- package/resources/senders/agent/knowledge-bases/knowledge-bases.d.mts +32 -113
- package/resources/senders/agent/knowledge-bases/knowledge-bases.d.mts.map +1 -1
- package/resources/senders/agent/knowledge-bases/knowledge-bases.d.ts +32 -113
- package/resources/senders/agent/knowledge-bases/knowledge-bases.d.ts.map +1 -1
- package/resources/senders/agent/knowledge-bases/knowledge-bases.js +17 -46
- package/resources/senders/agent/knowledge-bases/knowledge-bases.js.map +1 -1
- package/resources/senders/agent/knowledge-bases/knowledge-bases.mjs +17 -46
- package/resources/senders/agent/knowledge-bases/knowledge-bases.mjs.map +1 -1
- package/resources/senders/agent/knowledge-bases.js +1 -1
- package/resources/senders/agent/knowledge-bases.js.map +1 -1
- package/resources/senders/agent/knowledge-bases.mjs +1 -1
- package/resources/senders/agent/knowledge-bases.mjs.map +1 -1
- package/resources/senders/agent/tools/index.js +1 -1
- package/resources/senders/agent/tools/index.js.map +1 -1
- package/resources/senders/agent/tools/index.mjs +1 -1
- package/resources/senders/agent/tools/index.mjs.map +1 -1
- package/resources/senders/agent/tools/tools.d.mts +47 -280
- package/resources/senders/agent/tools/tools.d.mts.map +1 -1
- package/resources/senders/agent/tools/tools.d.ts +47 -280
- package/resources/senders/agent/tools/tools.d.ts.map +1 -1
- package/resources/senders/agent/tools/tools.js +25 -75
- package/resources/senders/agent/tools/tools.js.map +1 -1
- package/resources/senders/agent/tools/tools.mjs +25 -75
- package/resources/senders/agent/tools/tools.mjs.map +1 -1
- package/resources/senders/agent/tools/webhook.d.mts +6 -12
- package/resources/senders/agent/tools/webhook.d.mts.map +1 -1
- package/resources/senders/agent/tools/webhook.d.ts +6 -12
- package/resources/senders/agent/tools/webhook.d.ts.map +1 -1
- package/resources/senders/agent/tools/webhook.js +4 -9
- package/resources/senders/agent/tools/webhook.js.map +1 -1
- package/resources/senders/agent/tools/webhook.mjs +4 -9
- package/resources/senders/agent/tools/webhook.mjs.map +1 -1
- package/resources/senders/agent/tools.js +1 -1
- package/resources/senders/agent/tools.js.map +1 -1
- package/resources/senders/agent/tools.mjs +1 -1
- package/resources/senders/agent/tools.mjs.map +1 -1
- package/resources/senders/agent.js +1 -1
- package/resources/senders/agent.js.map +1 -1
- package/resources/senders/agent.mjs +1 -1
- package/resources/senders/agent.mjs.map +1 -1
- package/resources/senders/channels.d.mts +61 -0
- package/resources/senders/channels.d.mts.map +1 -0
- package/resources/senders/channels.d.ts +61 -0
- package/resources/senders/channels.d.ts.map +1 -0
- package/resources/senders/channels.js +60 -0
- package/resources/senders/channels.js.map +1 -0
- package/resources/senders/channels.mjs +56 -0
- package/resources/senders/channels.mjs.map +1 -0
- package/resources/senders/index.d.mts +1 -0
- package/resources/senders/index.d.mts.map +1 -1
- package/resources/senders/index.d.ts +1 -0
- package/resources/senders/index.d.ts.map +1 -1
- package/resources/senders/index.js +4 -2
- package/resources/senders/index.js.map +1 -1
- package/resources/senders/index.mjs +2 -1
- package/resources/senders/index.mjs.map +1 -1
- package/resources/senders/senders.d.mts +53 -514
- package/resources/senders/senders.d.mts.map +1 -1
- package/resources/senders/senders.d.ts +53 -514
- package/resources/senders/senders.d.ts.map +1 -1
- package/resources/senders/senders.js +30 -70
- package/resources/senders/senders.js.map +1 -1
- package/resources/senders/senders.mjs +30 -70
- package/resources/senders/senders.mjs.map +1 -1
- package/resources/senders/telegram.d.mts +10 -25
- package/resources/senders/telegram.d.mts.map +1 -1
- package/resources/senders/telegram.d.ts +10 -25
- package/resources/senders/telegram.d.ts.map +1 -1
- package/resources/senders/telegram.js +7 -12
- package/resources/senders/telegram.js.map +1 -1
- package/resources/senders/telegram.mjs +7 -12
- package/resources/senders/telegram.mjs.map +1 -1
- package/resources/senders/whatsapp-sync.d.mts +16 -104
- package/resources/senders/whatsapp-sync.d.mts.map +1 -1
- package/resources/senders/whatsapp-sync.d.ts +16 -104
- package/resources/senders/whatsapp-sync.d.ts.map +1 -1
- package/resources/senders/whatsapp-sync.js +10 -20
- package/resources/senders/whatsapp-sync.js.map +1 -1
- package/resources/senders/whatsapp-sync.mjs +10 -20
- package/resources/senders/whatsapp-sync.mjs.map +1 -1
- package/resources/senders.js +1 -1
- package/resources/senders.js.map +1 -1
- package/resources/senders.mjs +1 -1
- package/resources/senders.mjs.map +1 -1
- package/resources/sub-accounts/api-keys.d.mts +16 -57
- package/resources/sub-accounts/api-keys.d.mts.map +1 -1
- package/resources/sub-accounts/api-keys.d.ts +16 -57
- package/resources/sub-accounts/api-keys.d.ts.map +1 -1
- package/resources/sub-accounts/api-keys.js +10 -18
- package/resources/sub-accounts/api-keys.js.map +1 -1
- package/resources/sub-accounts/api-keys.mjs +10 -18
- package/resources/sub-accounts/api-keys.mjs.map +1 -1
- package/resources/sub-accounts/index.js +1 -1
- package/resources/sub-accounts/index.js.map +1 -1
- package/resources/sub-accounts/index.mjs +1 -1
- package/resources/sub-accounts/index.mjs.map +1 -1
- package/resources/sub-accounts/sub-accounts.d.mts +33 -125
- package/resources/sub-accounts/sub-accounts.d.mts.map +1 -1
- package/resources/sub-accounts/sub-accounts.d.ts +33 -125
- package/resources/sub-accounts/sub-accounts.d.ts.map +1 -1
- package/resources/sub-accounts/sub-accounts.js +20 -33
- package/resources/sub-accounts/sub-accounts.js.map +1 -1
- package/resources/sub-accounts/sub-accounts.mjs +20 -33
- package/resources/sub-accounts/sub-accounts.mjs.map +1 -1
- package/resources/sub-accounts.js +1 -1
- package/resources/sub-accounts.js.map +1 -1
- package/resources/sub-accounts.mjs +1 -1
- package/resources/sub-accounts.mjs.map +1 -1
- package/resources/templates.d.mts +46 -302
- package/resources/templates.d.mts.map +1 -1
- package/resources/templates.d.ts +46 -302
- package/resources/templates.d.ts.map +1 -1
- package/resources/templates.js +34 -51
- package/resources/templates.js.map +1 -1
- package/resources/templates.mjs +34 -51
- package/resources/templates.mjs.map +1 -1
- package/resources/urls.d.mts +27 -78
- package/resources/urls.d.mts.map +1 -1
- package/resources/urls.d.ts +27 -78
- package/resources/urls.d.ts.map +1 -1
- package/resources/urls.js +18 -28
- package/resources/urls.js.map +1 -1
- package/resources/urls.mjs +18 -28
- package/resources/urls.mjs.map +1 -1
- package/resources.d.mts.map +1 -1
- package/resources.d.ts.map +1 -1
- package/resources.js +1 -0
- package/resources.js.map +1 -1
- package/resources.mjs +1 -0
- package/resources.mjs.map +1 -1
- package/src/client.ts +273 -230
- package/src/core/api-promise.ts +0 -2
- package/src/core/error.ts +0 -2
- package/src/core/pagination.ts +0 -2
- package/src/core/resource.ts +0 -2
- package/src/index.ts +0 -2
- package/src/internal/builtin-types.ts +0 -2
- package/src/internal/detect-platform.ts +0 -2
- package/src/internal/errors.ts +0 -2
- package/src/internal/headers.ts +0 -2
- package/src/internal/parse.ts +0 -2
- package/src/internal/request-options.ts +0 -2
- package/src/internal/shim-types.ts +0 -2
- package/src/internal/shims.ts +0 -2
- package/src/internal/types.ts +0 -2
- package/src/internal/utils/base64.ts +0 -2
- package/src/internal/utils/env.ts +0 -2
- package/src/internal/utils/log.ts +0 -2
- package/src/internal/utils/query.ts +1 -3
- package/src/internal/utils/sleep.ts +0 -2
- package/src/internal/utils/uuid.ts +0 -2
- package/src/internal/utils/values.ts +0 -2
- package/src/internal/utils.ts +0 -2
- package/src/resources/addresses.ts +28 -97
- package/src/resources/agent-templates.ts +18 -89
- package/src/resources/agents/agents.ts +58 -472
- package/src/resources/agents/index.ts +1 -1
- package/src/resources/agents/senders.ts +11 -33
- package/src/resources/agents.ts +1 -1
- package/src/resources/balance.ts +7 -24
- package/src/resources/broadcasts/broadcasts.ts +92 -492
- package/src/resources/broadcasts/contacts.ts +20 -114
- package/src/resources/broadcasts/index.ts +1 -1
- package/src/resources/broadcasts.ts +1 -1
- package/src/resources/calls.ts +41 -560
- package/src/resources/contacts/channels.ts +21 -104
- package/src/resources/contacts/contacts.ts +42 -289
- package/src/resources/contacts/index.ts +1 -1
- package/src/resources/contacts.ts +1 -1
- package/src/resources/conversations.ts +33 -387
- package/src/resources/email-domains.ts +26 -253
- package/src/resources/functions/functions.ts +83 -669
- package/src/resources/functions/git-link.ts +26 -301
- package/src/resources/functions/index.ts +1 -1
- package/src/resources/functions/secrets.ts +16 -55
- package/src/resources/functions/triggers.ts +15 -149
- package/src/resources/functions.ts +1 -1
- package/src/resources/index.ts +21 -1
- package/src/resources/introspect.ts +16 -136
- package/src/resources/invitations/webhook.ts +93 -0
- package/src/resources/invitations.ts +45 -201
- package/src/resources/me.ts +10 -28
- package/src/resources/memory/collections/collections.ts +149 -0
- package/src/resources/memory/collections/index.ts +30 -0
- package/src/resources/memory/collections/items.ts +185 -0
- package/src/resources/memory/collections.ts +3 -0
- package/src/resources/memory/index.ts +34 -0
- package/src/resources/memory/memory.ts +211 -0
- package/src/resources/memory.ts +3 -0
- package/src/resources/messages.ts +106 -701
- package/src/resources/number-10dlc/brands.ts +35 -263
- package/src/resources/number-10dlc/campaigns/campaigns.ts +39 -239
- package/src/resources/number-10dlc/campaigns/index.ts +1 -1
- package/src/resources/number-10dlc/campaigns/phone-numbers.ts +31 -64
- package/src/resources/number-10dlc/campaigns.ts +1 -1
- package/src/resources/number-10dlc/index.ts +1 -1
- package/src/resources/number-10dlc/number-10dlc.ts +23 -29
- package/src/resources/number-10dlc.ts +1 -1
- package/src/resources/phone-numbers.ts +96 -280
- package/src/resources/regulatory-documents.ts +25 -106
- package/src/resources/senders/agent/agent.ts +91 -662
- package/src/resources/senders/agent/executions.ts +14 -35
- package/src/resources/senders/agent/flows.ts +35 -213
- package/src/resources/senders/agent/index.ts +1 -1
- package/src/resources/senders/agent/knowledge-bases/documents.ts +28 -114
- package/src/resources/senders/agent/knowledge-bases/index.ts +1 -1
- package/src/resources/senders/agent/knowledge-bases/knowledge-bases.ts +42 -143
- package/src/resources/senders/agent/knowledge-bases.ts +1 -1
- package/src/resources/senders/agent/tools/index.ts +1 -1
- package/src/resources/senders/agent/tools/tools.ts +48 -318
- package/src/resources/senders/agent/tools/webhook.ts +7 -13
- package/src/resources/senders/agent/tools.ts +1 -1
- package/src/resources/senders/agent.ts +1 -1
- package/src/resources/senders/channels.ts +95 -0
- package/src/resources/senders/index.ts +11 -1
- package/src/resources/senders/senders.ts +86 -634
- package/src/resources/senders/telegram.ts +11 -29
- package/src/resources/senders/whatsapp-sync.ts +17 -115
- package/src/resources/senders.ts +1 -1
- package/src/resources/sub-accounts/api-keys.ts +17 -73
- package/src/resources/sub-accounts/index.ts +1 -1
- package/src/resources/sub-accounts/sub-accounts.ts +38 -147
- package/src/resources/sub-accounts.ts +1 -1
- package/src/resources/templates.ts +47 -358
- package/src/resources/urls.ts +28 -86
- package/src/resources.ts +2 -0
- package/src/types.ts +5464 -0
- package/src/version.ts +3 -1
- package/types.d.mts +4901 -0
- package/types.d.mts.map +1 -0
- package/types.d.ts +4901 -0
- package/types.d.ts.map +1 -0
- package/types.js +4 -0
- package/types.js.map +1 -0
- package/types.mjs +3 -0
- package/types.mjs.map +1 -0
- package/version.d.mts +1 -1
- package/version.d.mts.map +1 -1
- package/version.d.ts +1 -1
- package/version.d.ts.map +1 -1
- package/version.js +2 -1
- package/version.js.map +1 -1
- package/version.mjs +2 -1
- package/version.mjs.map +1 -1
- package/src/lib/.keep +0 -4
package/types.d.mts
ADDED
|
@@ -0,0 +1,4901 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which namespace a memory belongs to. Scopes are isolated: a search in one never
|
|
3
|
+
* returns a memory from another.
|
|
4
|
+
*
|
|
5
|
+
* - `project`: shared by the whole project. What the agent knows in general.
|
|
6
|
+
* - `contact`: what the agent knows about one person, across every conversation
|
|
7
|
+
* with them.
|
|
8
|
+
* - `conversation`: what the agent knows about one inbox thread.
|
|
9
|
+
*
|
|
10
|
+
* Defaults to `project` everywhere. `contact` and `conversation` require the
|
|
11
|
+
* matching id.
|
|
12
|
+
*/
|
|
13
|
+
export type MemoryScope = 'project' | 'contact' | 'conversation';
|
|
14
|
+
/**
|
|
15
|
+
* Scope as a query-string value: `contact:<contactId>`,
|
|
16
|
+
* `conversation:<conversationId>`, the literal `project`, or omitted for project
|
|
17
|
+
* scope.
|
|
18
|
+
*
|
|
19
|
+
* Only the SHAPE of the id is validated, never its existence — the partition
|
|
20
|
+
* already carries your project, so an id that matches nothing simply addresses an
|
|
21
|
+
* empty scope rather than returning 404.
|
|
22
|
+
*/
|
|
23
|
+
export type MemoryScopeQuery = string;
|
|
24
|
+
/** A stored fact, as returned when it is created. */
|
|
25
|
+
export interface MemoryRecord {
|
|
26
|
+
id: string;
|
|
27
|
+
scope: MemoryScope;
|
|
28
|
+
createdAt: string;
|
|
29
|
+
/**
|
|
30
|
+
* When the fact self-deletes. Present only when it was stored with `ttlSeconds`,
|
|
31
|
+
* or when the key is a test-mode key (forced to 30 days).
|
|
32
|
+
*/
|
|
33
|
+
expiresAt?: string;
|
|
34
|
+
}
|
|
35
|
+
/** A stored fact as returned by a read. `score` appears only on search results. */
|
|
36
|
+
export interface Memory {
|
|
37
|
+
id: string;
|
|
38
|
+
/** The remembered text. */
|
|
39
|
+
text?: string;
|
|
40
|
+
metadata?: {
|
|
41
|
+
[key: string]: string;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Cosine similarity to the query, 0 to 1, higher being closer. Present on search
|
|
45
|
+
* results only — a list or a single read has no query to score against.
|
|
46
|
+
*/
|
|
47
|
+
score?: number;
|
|
48
|
+
createdAt: string;
|
|
49
|
+
expiresAt?: string;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Store one fact. It is embedded on write, so it becomes searchable by meaning
|
|
53
|
+
* rather than by keyword.
|
|
54
|
+
*/
|
|
55
|
+
export interface MemoryAddRequest {
|
|
56
|
+
/**
|
|
57
|
+
* What to remember. Max 8,192 bytes of UTF-8. Write one fact per call: a paragraph
|
|
58
|
+
* holding five unrelated facts embeds as an average of all five and is retrieved
|
|
59
|
+
* well by none of them.
|
|
60
|
+
*/
|
|
61
|
+
text: string;
|
|
62
|
+
scope?: MemoryScope;
|
|
63
|
+
/** Required when `scope` is `contact`. */
|
|
64
|
+
contactId?: string;
|
|
65
|
+
/** Required when `scope` is `conversation`. */
|
|
66
|
+
conversationId?: string;
|
|
67
|
+
/**
|
|
68
|
+
* Arbitrary string tags stored alongside the fact and returned with it. Keys max
|
|
69
|
+
* 64 chars, values max 512, whole object max 2,048 bytes. Not searchable —
|
|
70
|
+
* search matches `text` only.
|
|
71
|
+
*/
|
|
72
|
+
metadata?: {
|
|
73
|
+
[key: string]: string;
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* Delete the fact after this many seconds. 60 to 63,072,000 (2 years). Omit to
|
|
77
|
+
* keep it until deleted.
|
|
78
|
+
*/
|
|
79
|
+
ttlSeconds?: number;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Retrieve facts by meaning. The query is embedded and compared against every fact
|
|
83
|
+
* in the scope.
|
|
84
|
+
*/
|
|
85
|
+
export interface MemorySearchRequest {
|
|
86
|
+
/**
|
|
87
|
+
* What to recall. Max 8,192 bytes. Phrase it as the fact you hope to find, not as
|
|
88
|
+
* a keyword: the match is semantic.
|
|
89
|
+
*/
|
|
90
|
+
query: string;
|
|
91
|
+
scope?: MemoryScope;
|
|
92
|
+
/** Required when `scope` is `contact`. */
|
|
93
|
+
contactId?: string;
|
|
94
|
+
/** Required when `scope` is `conversation`. */
|
|
95
|
+
conversationId?: string;
|
|
96
|
+
/**
|
|
97
|
+
* Maximum hits to return, closest first.
|
|
98
|
+
*
|
|
99
|
+
* @defaultValue `5`
|
|
100
|
+
*/
|
|
101
|
+
limit?: number;
|
|
102
|
+
/**
|
|
103
|
+
* Drop hits below this similarity. Without it every scope returns its `limit`
|
|
104
|
+
* closest facts, however far away they are — an empty-handed search still
|
|
105
|
+
* answers with something. Set it (0.3 or above is a reasonable floor) when
|
|
106
|
+
* "nothing relevant" must be distinguishable from "the least irrelevant thing I
|
|
107
|
+
* hold".
|
|
108
|
+
*/
|
|
109
|
+
minScore?: number;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* This month's Memory consumption for the project, with the quota it is measured
|
|
113
|
+
* against.
|
|
114
|
+
*/
|
|
115
|
+
export interface MemoryUsage {
|
|
116
|
+
/** The month these counters cover. They reset on the 1st. */
|
|
117
|
+
monthKey: string;
|
|
118
|
+
/** Plan tier the quotas come from. */
|
|
119
|
+
tier: string;
|
|
120
|
+
/**
|
|
121
|
+
* Billable units consumed this month. Units are metered from real capacity, and a
|
|
122
|
+
* write costs 5x a read.
|
|
123
|
+
*/
|
|
124
|
+
units: number;
|
|
125
|
+
reads: number;
|
|
126
|
+
writes: number;
|
|
127
|
+
/** Facts stored this month. */
|
|
128
|
+
memAdds: number;
|
|
129
|
+
/** Semantic searches run this month. */
|
|
130
|
+
memSearches: number;
|
|
131
|
+
/**
|
|
132
|
+
* Whether the plan's unit quota is exhausted. While true, writes are refused with
|
|
133
|
+
* `429`; reads and deletes keep working, so stored data is never locked away.
|
|
134
|
+
*/
|
|
135
|
+
capReached: boolean;
|
|
136
|
+
/** Units included in the plan. Null means unlimited. */
|
|
137
|
+
quotaUnits?: number | null;
|
|
138
|
+
/**
|
|
139
|
+
* Bytes currently stored across facts and collections. Items with a TTL count as
|
|
140
|
+
* zero.
|
|
141
|
+
*/
|
|
142
|
+
memoryBytes: number;
|
|
143
|
+
/** Storage included in the plan, in GB. Null means unlimited. */
|
|
144
|
+
quotaStorageGB?: number | null;
|
|
145
|
+
}
|
|
146
|
+
/** A namespace of JSON documents addressed by key. */
|
|
147
|
+
export interface MemoryCollection {
|
|
148
|
+
name: string;
|
|
149
|
+
/**
|
|
150
|
+
* Fields that `POST /v1/memory/collections/{collection}/query` can filter on.
|
|
151
|
+
* Immutable after creation.
|
|
152
|
+
*/
|
|
153
|
+
indexes: Array<MemoryCollectionIndexesItem>;
|
|
154
|
+
/**
|
|
155
|
+
* TTL applied to items written without their own `ttlSeconds`. Null means items
|
|
156
|
+
* are kept until deleted.
|
|
157
|
+
*/
|
|
158
|
+
defaultTtlSeconds: number | null;
|
|
159
|
+
/** `active`, or `deleting` while a delete drains in the background. */
|
|
160
|
+
status: string;
|
|
161
|
+
createdAt: string;
|
|
162
|
+
updatedAt: string;
|
|
163
|
+
}
|
|
164
|
+
export interface MemoryCollectionIndexesItem {
|
|
165
|
+
field: string;
|
|
166
|
+
}
|
|
167
|
+
export interface MemoryCollectionCreateRequest {
|
|
168
|
+
/**
|
|
169
|
+
* 1-63 chars: lowercase letters, digits, `-` and `_`, starting with a letter or
|
|
170
|
+
* digit.
|
|
171
|
+
*/
|
|
172
|
+
name: string;
|
|
173
|
+
/**
|
|
174
|
+
* Up to 2 fields to index for `query`. **This is the only way to declare them**
|
|
175
|
+
* — a collection created implicitly by its first write has none, and querying an
|
|
176
|
+
* unindexed field returns `400 field_not_indexed`. Indexes cannot be added later,
|
|
177
|
+
* so declare them here before the first write.
|
|
178
|
+
*/
|
|
179
|
+
indexes?: Array<MemoryCollectionCreateRequestIndexesItem>;
|
|
180
|
+
defaultTtlSeconds?: number;
|
|
181
|
+
}
|
|
182
|
+
export interface MemoryCollectionCreateRequestIndexesItem {
|
|
183
|
+
/**
|
|
184
|
+
* 1-64 chars: letters, digits and `_`, starting with a letter. Top-level field of
|
|
185
|
+
* the stored document.
|
|
186
|
+
*/
|
|
187
|
+
field: string;
|
|
188
|
+
}
|
|
189
|
+
/** Only the default TTL is mutable. Indexes are fixed at creation. */
|
|
190
|
+
export interface MemoryCollectionUpdateRequest {
|
|
191
|
+
/** New default TTL, or null to clear it. */
|
|
192
|
+
defaultTtlSeconds: number | null;
|
|
193
|
+
}
|
|
194
|
+
/** One JSON document in a collection. */
|
|
195
|
+
export interface MemoryItem {
|
|
196
|
+
key: string;
|
|
197
|
+
/** The stored JSON. Any JSON value. */
|
|
198
|
+
value?: unknown;
|
|
199
|
+
/**
|
|
200
|
+
* Revision, incremented on every write. Pass it as `If-Match` on a later write to
|
|
201
|
+
* make that write conditional.
|
|
202
|
+
*/
|
|
203
|
+
rev: number;
|
|
204
|
+
createdAt: string;
|
|
205
|
+
updatedAt: string;
|
|
206
|
+
expiresAt?: string;
|
|
207
|
+
}
|
|
208
|
+
export interface MemoryItemPutRequest {
|
|
209
|
+
/**
|
|
210
|
+
* The document to store. Any JSON value, max 200KB serialized and 32 levels deep.
|
|
211
|
+
* This is a whole-document write, not a merge: it replaces whatever the key held.
|
|
212
|
+
*/
|
|
213
|
+
value: unknown;
|
|
214
|
+
/** Overrides the collection's `defaultTtlSeconds` for this item. */
|
|
215
|
+
ttlSeconds?: number;
|
|
216
|
+
}
|
|
217
|
+
/** Look items up by an indexed field instead of by key. */
|
|
218
|
+
export interface MemoryItemQueryRequest {
|
|
219
|
+
/**
|
|
220
|
+
* One condition on one indexed field. `between` bounds are inclusive and must be
|
|
221
|
+
* the same type.
|
|
222
|
+
*/
|
|
223
|
+
where: MemoryItemQueryRequestWhere;
|
|
224
|
+
/** @defaultValue `50` */
|
|
225
|
+
limit?: number;
|
|
226
|
+
cursor?: string;
|
|
227
|
+
}
|
|
228
|
+
export interface MemoryItemQueryRequestWhere {
|
|
229
|
+
field: string;
|
|
230
|
+
op: MemoryItemQueryRequestWhereOp;
|
|
231
|
+
/**
|
|
232
|
+
* The value to match. Used by `eq` (string, number or boolean) and `beginsWith`
|
|
233
|
+
* (string).
|
|
234
|
+
*/
|
|
235
|
+
value?: unknown;
|
|
236
|
+
/** Lower bound, for `between`. */
|
|
237
|
+
from?: unknown;
|
|
238
|
+
/** Upper bound, for `between`. */
|
|
239
|
+
to?: unknown;
|
|
240
|
+
}
|
|
241
|
+
export type MemoryItemQueryRequestWhereOp = 'eq' | 'beginsWith' | 'between';
|
|
242
|
+
/**
|
|
243
|
+
* Up to 25 writes and deletes in one call. Operations are NOT atomic: each is
|
|
244
|
+
* reported on its own, and a failure in one does not roll the others back.
|
|
245
|
+
*/
|
|
246
|
+
export interface MemoryItemBatchRequest {
|
|
247
|
+
ops: Array<MemoryItemBatchRequestOpsItem>;
|
|
248
|
+
}
|
|
249
|
+
export interface MemoryItemBatchRequestOpsItem {
|
|
250
|
+
op: MemoryItemBatchRequestOpsItemOp;
|
|
251
|
+
key: string;
|
|
252
|
+
/** The document, for `set`. */
|
|
253
|
+
value?: unknown;
|
|
254
|
+
ttlSeconds?: number;
|
|
255
|
+
}
|
|
256
|
+
export type MemoryItemBatchRequestOpsItemOp = 'set' | 'delete';
|
|
257
|
+
export interface MemoryItemBatchResponse {
|
|
258
|
+
/**
|
|
259
|
+
* One entry per submitted operation, in order. Check every `ok`: the call returns
|
|
260
|
+
* 200 even when some operations failed.
|
|
261
|
+
*/
|
|
262
|
+
results: Array<MemoryItemBatchResponseResultsItem>;
|
|
263
|
+
}
|
|
264
|
+
export interface MemoryItemBatchResponseResultsItem {
|
|
265
|
+
key: string;
|
|
266
|
+
ok: boolean;
|
|
267
|
+
/** New revision, on a successful `set`. */
|
|
268
|
+
rev?: number;
|
|
269
|
+
/** Why this operation failed. Present when `ok` is false. */
|
|
270
|
+
error?: string;
|
|
271
|
+
}
|
|
272
|
+
/** A subscription that runs a Zavu Function when a messaging event fires. */
|
|
273
|
+
export interface FunctionTrigger {
|
|
274
|
+
id: string;
|
|
275
|
+
functionId: string;
|
|
276
|
+
/**
|
|
277
|
+
* Event type that fires the function. See GET /v1/functions/event-types for the
|
|
278
|
+
* supported list. The special type `cron` fires on a schedule instead of a
|
|
279
|
+
* messaging event and carries a `cron` expression.
|
|
280
|
+
*/
|
|
281
|
+
eventType: string;
|
|
282
|
+
/** Restrict the trigger to a single sender. Null means all senders in the project. */
|
|
283
|
+
senderId?: string | null;
|
|
284
|
+
active: boolean;
|
|
285
|
+
createdAt: string;
|
|
286
|
+
updatedAt: string;
|
|
287
|
+
/**
|
|
288
|
+
* 5-field cron expression (minute hour day-of-month month day-of-week), evaluated
|
|
289
|
+
* in UTC. Present only on `cron` triggers.
|
|
290
|
+
*/
|
|
291
|
+
cron?: string | null;
|
|
292
|
+
/** Next scheduled fire time. Present only on `cron` triggers. */
|
|
293
|
+
nextRunAt?: string | null;
|
|
294
|
+
/** Last time the schedule fired. Null until the first fire. */
|
|
295
|
+
lastRunAt?: string | null;
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* Fields to update on a knowledge base document. Updating content reprocesses the
|
|
299
|
+
* document for RAG.
|
|
300
|
+
*/
|
|
301
|
+
export interface DocumentUpdateRequest {
|
|
302
|
+
title?: string;
|
|
303
|
+
content?: string;
|
|
304
|
+
}
|
|
305
|
+
export interface Error {
|
|
306
|
+
code: string;
|
|
307
|
+
message: string;
|
|
308
|
+
details?: {
|
|
309
|
+
[key: string]: unknown;
|
|
310
|
+
};
|
|
311
|
+
}
|
|
312
|
+
export type MessageStatus = 'queued' | 'sending' | 'sent' | 'delivered' | 'read' | 'failed' | 'received' | 'pending_url_verification';
|
|
313
|
+
/** Delivery channel. Use 'auto' for intelligent routing. */
|
|
314
|
+
export type Channel = 'auto' | 'sms' | 'sms_oneway' | 'whatsapp' | 'telegram' | 'email' | 'instagram' | 'messenger' | 'voice';
|
|
315
|
+
/**
|
|
316
|
+
* Type of message. Non-text types are supported by WhatsApp and Telegram (varies
|
|
317
|
+
* by type).
|
|
318
|
+
*
|
|
319
|
+
* `location_request` asks the recipient to share their location and is
|
|
320
|
+
* WhatsApp-only. It takes no `content` object — the prompt goes in `text` (max
|
|
321
|
+
* 1024 characters) and the button label is fixed by WhatsApp. The recipient's
|
|
322
|
+
* answer arrives as an inbound `location` message whose `content.replyToMessageId`
|
|
323
|
+
* is the ID of the request.
|
|
324
|
+
*
|
|
325
|
+
* `request_contact_info` asks the recipient to share their phone number and is
|
|
326
|
+
* WhatsApp-only. Like `location_request` it takes no `content` object — the
|
|
327
|
+
* prompt goes in `text` (max 1024 characters) and WhatsApp renders a fixed **Share
|
|
328
|
+
* Contact Info** button. The answer arrives as an inbound `contact` message. Use
|
|
329
|
+
* it to recover the phone number of a contact who adopted a WhatsApp username and
|
|
330
|
+
* is only known by their business-scoped user ID (BSUID); when they share it, Zavu
|
|
331
|
+
* automatically links the phone number to that contact.
|
|
332
|
+
*/
|
|
333
|
+
export type MessageType = 'text' | 'image' | 'video' | 'audio' | 'document' | 'sticker' | 'location' | 'contact' | 'buttons' | 'list' | 'cta_url' | 'request_contact_info' | 'location_request' | 'reaction' | 'template';
|
|
334
|
+
/** Content for non-text message types (WhatsApp and Telegram). */
|
|
335
|
+
export interface MessageContent {
|
|
336
|
+
/** URL of the media file (for image, video, audio, document, sticker). */
|
|
337
|
+
mediaUrl?: string;
|
|
338
|
+
/** WhatsApp media ID if already uploaded. */
|
|
339
|
+
mediaId?: string;
|
|
340
|
+
/** MIME type of the media. */
|
|
341
|
+
mimeType?: string;
|
|
342
|
+
/** Filename for documents. */
|
|
343
|
+
filename?: string;
|
|
344
|
+
/** Latitude for location messages. */
|
|
345
|
+
latitude?: number;
|
|
346
|
+
/** Longitude for location messages. */
|
|
347
|
+
longitude?: number;
|
|
348
|
+
/** Name of the location. */
|
|
349
|
+
locationName?: string;
|
|
350
|
+
/** Address of the location. */
|
|
351
|
+
locationAddress?: string;
|
|
352
|
+
/** Contact cards for contact messages. */
|
|
353
|
+
contacts?: Array<MessageContentContactsItem>;
|
|
354
|
+
/** Interactive buttons (max 3). */
|
|
355
|
+
buttons?: Array<MessageContentButtonsItem>;
|
|
356
|
+
/** Button text for list messages. */
|
|
357
|
+
listButton?: string;
|
|
358
|
+
/** Sections for list messages. */
|
|
359
|
+
sections?: Array<MessageContentSectionsItem>;
|
|
360
|
+
/** Button label for cta_url messages. */
|
|
361
|
+
ctaDisplayText?: string;
|
|
362
|
+
/**
|
|
363
|
+
* Destination URL opened in the device's default browser when the button is
|
|
364
|
+
* tapped. Used with messageType=cta_url. WhatsApp requires HTTPS in production.
|
|
365
|
+
*/
|
|
366
|
+
ctaUrl?: string;
|
|
367
|
+
/** Optional header type for cta_url messages. */
|
|
368
|
+
ctaHeaderType?: MessageContentCtaHeaderType;
|
|
369
|
+
/** Header text when ctaHeaderType is 'text'. */
|
|
370
|
+
ctaHeaderText?: string;
|
|
371
|
+
/**
|
|
372
|
+
* Public HTTPS URL of the header media when ctaHeaderType is 'image', 'video', or
|
|
373
|
+
* 'document'. WhatsApp fetches this URL — it must be publicly reachable and
|
|
374
|
+
* return the declared content type.
|
|
375
|
+
*/
|
|
376
|
+
ctaHeaderMediaUrl?: string;
|
|
377
|
+
/** Optional footer text for cta_url messages. */
|
|
378
|
+
footerText?: string;
|
|
379
|
+
/** Emoji for reaction messages. */
|
|
380
|
+
emoji?: string;
|
|
381
|
+
/** Message ID to react to. */
|
|
382
|
+
reactToMessageId?: string;
|
|
383
|
+
/**
|
|
384
|
+
* Zavu message ID of the quoted message this message replies to. Present on
|
|
385
|
+
* inbound messages that quote an earlier message. Omitted when the quoted message
|
|
386
|
+
* is not found in Zavu (e.g. an old or unknown message) — use
|
|
387
|
+
* replyToProviderMessageId in that case.
|
|
388
|
+
*/
|
|
389
|
+
replyToMessageId?: string;
|
|
390
|
+
/**
|
|
391
|
+
* Provider message ID (WhatsApp WAMID) of the quoted message. Present whenever an
|
|
392
|
+
* inbound message is a reply, even if the quoted message is not stored in Zavu.
|
|
393
|
+
*/
|
|
394
|
+
replyToProviderMessageId?: string;
|
|
395
|
+
/** Sender of the quoted message (phone number in E.164 format). */
|
|
396
|
+
replyToFrom?: string;
|
|
397
|
+
/**
|
|
398
|
+
* Truncated snippet of the quoted message's text, for display. Empty when the
|
|
399
|
+
* quoted message has no text (e.g. media).
|
|
400
|
+
*/
|
|
401
|
+
replyToText?: string;
|
|
402
|
+
/** Type of the quoted message (text, image, video, etc.). */
|
|
403
|
+
replyToMessageType?: string;
|
|
404
|
+
/** Template ID for template messages. */
|
|
405
|
+
templateId?: string;
|
|
406
|
+
/**
|
|
407
|
+
* Variables for body placeholders. Key them to match the template body: by
|
|
408
|
+
* position (`1`, `2`, ...) for positional templates, or by name (e.g.
|
|
409
|
+
* `customer_name`) for named templates. Zavu detects the template's format and
|
|
410
|
+
* sends the correct payload to Meta. Named keys also resolve a named text-header
|
|
411
|
+
* variable. Do not mix positional and named keys in the same request.
|
|
412
|
+
*/
|
|
413
|
+
templateVariables?: {
|
|
414
|
+
[key: string]: string;
|
|
415
|
+
};
|
|
416
|
+
/**
|
|
417
|
+
* Variables for dynamic button placeholders (URL buttons and OTP buttons). Keys
|
|
418
|
+
* are the button index (0, 1, 2) in the template's `buttons` array — not the
|
|
419
|
+
* placeholder name. Values substitute the `{{1}}` placeholder inside that button's
|
|
420
|
+
* URL.
|
|
421
|
+
*
|
|
422
|
+
* **WhatsApp constraints:**
|
|
423
|
+
* - URL buttons only accept `{{1}}` — positional, numeric, no whitespace, no
|
|
424
|
+
* name. Named placeholders like `{{token}}` are stored as literal URL text by
|
|
425
|
+
* Meta and cannot be substituted.
|
|
426
|
+
* - At most one placeholder per URL button.
|
|
427
|
+
* - A template may have at most three buttons.
|
|
428
|
+
* - Static URL buttons (no placeholder) and `quick_reply` buttons are not included
|
|
429
|
+
* here.
|
|
430
|
+
*/
|
|
431
|
+
templateButtonVariables?: {
|
|
432
|
+
[key: string]: string;
|
|
433
|
+
};
|
|
434
|
+
/**
|
|
435
|
+
* Value for a text-header variable, keyed by `1` (WhatsApp text headers allow at
|
|
436
|
+
* most one variable). Optional override. If omitted, Zavu resolves the header from
|
|
437
|
+
* `templateVariables` using the header placeholder's name (e.g. `novios`). Static
|
|
438
|
+
* text headers need no value.
|
|
439
|
+
*/
|
|
440
|
+
templateHeaderVariables?: {
|
|
441
|
+
[key: string]: string;
|
|
442
|
+
};
|
|
443
|
+
referral?: AdReferral;
|
|
444
|
+
}
|
|
445
|
+
export interface MessageContentContactsItem {
|
|
446
|
+
name?: string;
|
|
447
|
+
phones?: Array<string>;
|
|
448
|
+
}
|
|
449
|
+
export interface MessageContentButtonsItem {
|
|
450
|
+
id: string;
|
|
451
|
+
title: string;
|
|
452
|
+
}
|
|
453
|
+
export interface MessageContentSectionsItem {
|
|
454
|
+
title: string;
|
|
455
|
+
rows: Array<MessageContentSectionsItemRowsItem>;
|
|
456
|
+
}
|
|
457
|
+
export interface MessageContentSectionsItemRowsItem {
|
|
458
|
+
id: string;
|
|
459
|
+
title: string;
|
|
460
|
+
description?: string;
|
|
461
|
+
}
|
|
462
|
+
export type MessageContentCtaHeaderType = 'text' | 'image' | 'video' | 'document';
|
|
463
|
+
/**
|
|
464
|
+
* Click-to-WhatsApp (CTWA) ad attribution: where an inbound conversation came
|
|
465
|
+
* from.
|
|
466
|
+
*
|
|
467
|
+
* WhatsApp only. Present on the **first inbound message** of a conversation opened
|
|
468
|
+
* from a Meta ad or post, and on no message after it — so store it when it
|
|
469
|
+
* arrives rather than expecting it again. Organic conversations never carry it.
|
|
470
|
+
*
|
|
471
|
+
* Field names are camelCased to match the rest of this API; Meta sends them as
|
|
472
|
+
* snake_case (`ctwa_clid`, `source_id`, ...). Fields that do not apply are
|
|
473
|
+
* omitted: a `post` source has no click id, and an image ad has no `videoUrl`.
|
|
474
|
+
*/
|
|
475
|
+
export interface AdReferral {
|
|
476
|
+
/** Where the click came from. */
|
|
477
|
+
sourceType?: AdReferralSourceType;
|
|
478
|
+
/** Identifier of the ad or post that produced the click. */
|
|
479
|
+
sourceId?: string;
|
|
480
|
+
/** Meta permalink to the ad or post. */
|
|
481
|
+
sourceUrl?: string;
|
|
482
|
+
/** Headline of the ad or post. */
|
|
483
|
+
headline?: string;
|
|
484
|
+
/** Body copy of the ad or post. */
|
|
485
|
+
body?: string;
|
|
486
|
+
/** Type of media on the ad, when it had any. */
|
|
487
|
+
mediaType?: AdReferralMediaType;
|
|
488
|
+
/** Image of the ad. Present when `mediaType` is `image`. */
|
|
489
|
+
imageUrl?: string;
|
|
490
|
+
/** Video of the ad. Present when `mediaType` is `video`. */
|
|
491
|
+
videoUrl?: string;
|
|
492
|
+
/** Thumbnail of the ad media. */
|
|
493
|
+
thumbnailUrl?: string;
|
|
494
|
+
/**
|
|
495
|
+
* Click-to-WhatsApp click identifier. This is the value Meta's Conversions API
|
|
496
|
+
* needs to credit a conversion back to the ad that produced the conversation.
|
|
497
|
+
* Present on `ad` sources; a `post` source has none.
|
|
498
|
+
*/
|
|
499
|
+
ctwaClid?: string;
|
|
500
|
+
}
|
|
501
|
+
export type AdReferralSourceType = 'ad' | 'post';
|
|
502
|
+
export type AdReferralMediaType = 'image' | 'video';
|
|
503
|
+
/** Email attachment. Provide either `content` (base64) or `path` (URL), not both. */
|
|
504
|
+
export interface EmailAttachmentInput {
|
|
505
|
+
/** Name of the attached file. */
|
|
506
|
+
filename: string;
|
|
507
|
+
/** Content of the attached file as a Base64-encoded string. */
|
|
508
|
+
content?: string;
|
|
509
|
+
/** URL where the attachment file is hosted. The server will fetch the file. */
|
|
510
|
+
path?: string;
|
|
511
|
+
/** MIME type of the attachment. If not set, will be derived from the filename. */
|
|
512
|
+
content_type?: string;
|
|
513
|
+
/**
|
|
514
|
+
* Content ID for inline images. Reference in HTML as `<img
|
|
515
|
+
* src="cid:your_content_id">`.
|
|
516
|
+
*/
|
|
517
|
+
content_id?: string;
|
|
518
|
+
}
|
|
519
|
+
/** Request body to send a message. */
|
|
520
|
+
export interface MessageRequest {
|
|
521
|
+
/**
|
|
522
|
+
* Recipient phone number in E.164 format, email address, WhatsApp business-scoped
|
|
523
|
+
* user ID (BSUID, e.g. `US.13491208655302741918`), or numeric chat ID (for
|
|
524
|
+
* Telegram/Instagram/Messenger). A BSUID is routed to WhatsApp and sent via the
|
|
525
|
+
* `recipient` field; use it to message a contact who adopted a username and whose
|
|
526
|
+
* phone number is hidden.
|
|
527
|
+
*/
|
|
528
|
+
to: string;
|
|
529
|
+
/**
|
|
530
|
+
* Delivery channel. Use 'auto' for intelligent routing. If omitted, channel is
|
|
531
|
+
* auto-selected based on sender capabilities and recipient type. For email
|
|
532
|
+
* recipients, defaults to 'email'.
|
|
533
|
+
*
|
|
534
|
+
* @defaultValue `"auto"`
|
|
535
|
+
*/
|
|
536
|
+
channel?: Channel;
|
|
537
|
+
/**
|
|
538
|
+
* Type of message. Defaults to 'text'.
|
|
539
|
+
*
|
|
540
|
+
* @defaultValue `"text"`
|
|
541
|
+
*/
|
|
542
|
+
messageType?: MessageType;
|
|
543
|
+
/** Text body for text messages or caption for media messages. */
|
|
544
|
+
text?: string;
|
|
545
|
+
/** Additional content for non-text message types. */
|
|
546
|
+
content?: MessageContent;
|
|
547
|
+
/**
|
|
548
|
+
* Email subject line. Required when channel is 'email' or recipient is an email
|
|
549
|
+
* address.
|
|
550
|
+
*/
|
|
551
|
+
subject?: string;
|
|
552
|
+
/**
|
|
553
|
+
* HTML body for email messages. If provided, email will be sent as multipart with
|
|
554
|
+
* both text and HTML.
|
|
555
|
+
*/
|
|
556
|
+
htmlBody?: string;
|
|
557
|
+
/** Reply-To email address for email messages. */
|
|
558
|
+
replyTo?: string;
|
|
559
|
+
/** Optional idempotency key to avoid duplicate sends. */
|
|
560
|
+
idempotencyKey?: string;
|
|
561
|
+
/** Arbitrary metadata to associate with the message. */
|
|
562
|
+
metadata?: {
|
|
563
|
+
[key: string]: string;
|
|
564
|
+
};
|
|
565
|
+
/**
|
|
566
|
+
* Whether a failed WhatsApp text or template message is retried over SMS, when the
|
|
567
|
+
* sender also has SMS. When omitted, it is on if `channel` is omitted or `auto`,
|
|
568
|
+
* and off if a channel is set explicitly: a send with `channel: "whatsapp"` does
|
|
569
|
+
* not fall back unless this is `true`. Media, buttons, lists and other
|
|
570
|
+
* WhatsApp-only types never fall back.
|
|
571
|
+
*/
|
|
572
|
+
fallbackEnabled?: boolean;
|
|
573
|
+
/**
|
|
574
|
+
* Language code for voice text-to-speech (e.g., 'en-US', 'es-ES', 'pt-BR'). If
|
|
575
|
+
* omitted, language is auto-detected from recipient's country code.
|
|
576
|
+
*/
|
|
577
|
+
voiceLanguage?: string;
|
|
578
|
+
/**
|
|
579
|
+
* Email attachments. Only supported when channel is 'email'. Maximum 40MB total
|
|
580
|
+
* size.
|
|
581
|
+
*/
|
|
582
|
+
attachments?: Array<EmailAttachmentInput>;
|
|
583
|
+
}
|
|
584
|
+
export interface Message {
|
|
585
|
+
id: string;
|
|
586
|
+
to: string;
|
|
587
|
+
from?: string;
|
|
588
|
+
senderId?: string;
|
|
589
|
+
channel: Channel;
|
|
590
|
+
/**
|
|
591
|
+
* Who sent the message. Needed to render a thread: `status` cannot tell the two
|
|
592
|
+
* apart, because an inbound message is also stored as `delivered`.
|
|
593
|
+
*/
|
|
594
|
+
direction: MessageDirection;
|
|
595
|
+
messageType: MessageType;
|
|
596
|
+
status: MessageStatus;
|
|
597
|
+
/** Text content or caption. */
|
|
598
|
+
text?: string;
|
|
599
|
+
content?: MessageContent;
|
|
600
|
+
/**
|
|
601
|
+
* ID of the conversation (inbox thread) this message belongs to. Use it to build a
|
|
602
|
+
* direct dashboard link:
|
|
603
|
+
* `https://dashboard.zavu.dev/{locale}/inbox?conv={conversationId}`. Omitted only
|
|
604
|
+
* on legacy messages created before conversation threading.
|
|
605
|
+
*/
|
|
606
|
+
conversationId?: string;
|
|
607
|
+
/** Message ID from the delivery provider. */
|
|
608
|
+
providerMessageId?: string;
|
|
609
|
+
errorCode?: string | null;
|
|
610
|
+
errorMessage?: string | null;
|
|
611
|
+
/**
|
|
612
|
+
* Zavu platform charge in USD for this message. Messaging is billed against your
|
|
613
|
+
* plan's monthly limits plus usage-based overage.
|
|
614
|
+
*/
|
|
615
|
+
cost?: number | null;
|
|
616
|
+
/** Carrier and delivery cost in USD. */
|
|
617
|
+
costProvider?: number | null;
|
|
618
|
+
/** Total cost in USD (platform charge + delivery cost). */
|
|
619
|
+
costTotal?: number | null;
|
|
620
|
+
metadata?: {
|
|
621
|
+
[key: string]: string;
|
|
622
|
+
};
|
|
623
|
+
createdAt: string;
|
|
624
|
+
updatedAt?: string;
|
|
625
|
+
}
|
|
626
|
+
export type MessageDirection = 'inbound' | 'outbound';
|
|
627
|
+
export interface MessageResponse {
|
|
628
|
+
message: Message;
|
|
629
|
+
}
|
|
630
|
+
/** A stored file attachment for an email message (inbound or outbound). */
|
|
631
|
+
export interface MessageAttachment {
|
|
632
|
+
id: string;
|
|
633
|
+
filename: string;
|
|
634
|
+
/** MIME type of the attachment. */
|
|
635
|
+
mimeType: string;
|
|
636
|
+
/** Size of the attachment in bytes. */
|
|
637
|
+
size: number;
|
|
638
|
+
/**
|
|
639
|
+
* Content-ID for inline attachments (referenced in the HTML body as
|
|
640
|
+
* `cid:<contentId>`). Null for regular attachments.
|
|
641
|
+
*/
|
|
642
|
+
contentId: string | null;
|
|
643
|
+
/**
|
|
644
|
+
* Whether the attachment is inline (embedded in the HTML body) rather than a
|
|
645
|
+
* regular attachment.
|
|
646
|
+
*/
|
|
647
|
+
isInline: boolean;
|
|
648
|
+
/**
|
|
649
|
+
* Short-lived signed URL to download the attachment bytes. Freshly generated on
|
|
650
|
+
* each request and expires; do not cache it. Null if the stored file is no longer
|
|
651
|
+
* available.
|
|
652
|
+
*/
|
|
653
|
+
downloadUrl: string | null;
|
|
654
|
+
createdAt: string;
|
|
655
|
+
}
|
|
656
|
+
export interface MessageAttachmentsResponse {
|
|
657
|
+
items: Array<MessageAttachment>;
|
|
658
|
+
}
|
|
659
|
+
/** WhatsApp template category. */
|
|
660
|
+
export type WhatsAppCategory = 'UTILITY' | 'MARKETING' | 'AUTHENTICATION';
|
|
661
|
+
export interface Template {
|
|
662
|
+
id: string;
|
|
663
|
+
/** Template name. For WhatsApp, must match the approved template name in Meta. */
|
|
664
|
+
name: string;
|
|
665
|
+
/** Language code. */
|
|
666
|
+
language: string;
|
|
667
|
+
/**
|
|
668
|
+
* Default template body with variables: positional ({{1}}, {{2}}) or named
|
|
669
|
+
* ({{customer_name}}, {{contact.first_name}}). Templates created in Zavu are
|
|
670
|
+
* submitted to Meta as positional; templates imported from a WhatsApp Business
|
|
671
|
+
* Account keep their original format (named or positional). Used when no
|
|
672
|
+
* channel-specific body is set.
|
|
673
|
+
*/
|
|
674
|
+
body: string;
|
|
675
|
+
/** Channel-specific body for SMS messages. Falls back to `body` if not set. */
|
|
676
|
+
smsBody?: string;
|
|
677
|
+
/** Channel-specific body for Telegram messages. Falls back to `body` if not set. */
|
|
678
|
+
telegramBody?: string;
|
|
679
|
+
/** Channel-specific body for Instagram messages. Falls back to `body` if not set. */
|
|
680
|
+
instagramBody?: string;
|
|
681
|
+
/**
|
|
682
|
+
* The category the template is billed under. For a template linked to WhatsApp
|
|
683
|
+
* this is the category **Meta currently assigns**, not the one it was submitted
|
|
684
|
+
* with: Meta can recategorize a template at approval or at any point afterwards,
|
|
685
|
+
* and that changes what the message costs.
|
|
686
|
+
*
|
|
687
|
+
* A recategorization reaches this field through the `template.status_changed`
|
|
688
|
+
* webhook, which carries `data.category`, and through `POST /v1/templates/sync`,
|
|
689
|
+
* which reconciles it against Meta. Read one of those rather than assuming the
|
|
690
|
+
* category you sent is the one in force.
|
|
691
|
+
*
|
|
692
|
+
* For a template that was never submitted to WhatsApp, this is the category stored
|
|
693
|
+
* locally, defaulting to `UTILITY`.
|
|
694
|
+
*/
|
|
695
|
+
category: WhatsAppCategory;
|
|
696
|
+
/** @defaultValue `"draft"` */
|
|
697
|
+
status?: TemplateStatus;
|
|
698
|
+
/** List of variable names for documentation. */
|
|
699
|
+
variables?: Array<string>;
|
|
700
|
+
/** Type of header (text, image, video, document). */
|
|
701
|
+
headerType?: string;
|
|
702
|
+
/** Header content (text or media URL). */
|
|
703
|
+
headerContent?: string;
|
|
704
|
+
/** Footer text for the template. */
|
|
705
|
+
footer?: string;
|
|
706
|
+
/** Template buttons. */
|
|
707
|
+
buttons?: Array<TemplateButtonsItem>;
|
|
708
|
+
/** Add 'Do not share this code' disclaimer. Only for AUTHENTICATION templates. */
|
|
709
|
+
addSecurityRecommendation?: boolean;
|
|
710
|
+
/** Code expiration time in minutes. Only for AUTHENTICATION templates. */
|
|
711
|
+
codeExpirationMinutes?: number;
|
|
712
|
+
/** WhatsApp-specific template information. */
|
|
713
|
+
whatsapp?: TemplateWhatsapp;
|
|
714
|
+
createdAt?: string;
|
|
715
|
+
updatedAt?: string;
|
|
716
|
+
}
|
|
717
|
+
export type TemplateStatus = 'draft' | 'pending' | 'approved' | 'rejected';
|
|
718
|
+
export interface TemplateButtonsItem {
|
|
719
|
+
type?: TemplateButtonsItemType;
|
|
720
|
+
text?: string;
|
|
721
|
+
url?: string;
|
|
722
|
+
/**
|
|
723
|
+
* Sample value used to substitute `{{1}}` in the URL when submitting the template
|
|
724
|
+
* to Meta for review. Only present for dynamic URL buttons.
|
|
725
|
+
*/
|
|
726
|
+
example?: string;
|
|
727
|
+
phoneNumber?: string;
|
|
728
|
+
/** OTP button type. Required when type is 'otp'. */
|
|
729
|
+
otpType?: TemplateButtonsItemOtpType;
|
|
730
|
+
/** Android package name. Required for ONE_TAP buttons. */
|
|
731
|
+
packageName?: string;
|
|
732
|
+
/** Android app signature hash. Required for ONE_TAP buttons. */
|
|
733
|
+
signatureHash?: string;
|
|
734
|
+
}
|
|
735
|
+
export type TemplateButtonsItemType = 'quick_reply' | 'url' | 'phone' | 'otp' | 'request_contact_info';
|
|
736
|
+
export type TemplateButtonsItemOtpType = 'COPY_CODE' | 'ONE_TAP';
|
|
737
|
+
export interface TemplateWhatsapp {
|
|
738
|
+
/** WhatsApp template name. */
|
|
739
|
+
templateName?: string;
|
|
740
|
+
/** WhatsApp Business Account namespace. */
|
|
741
|
+
namespace?: string;
|
|
742
|
+
/** WhatsApp approval status. */
|
|
743
|
+
status?: string;
|
|
744
|
+
}
|
|
745
|
+
export interface TemplateCreateRequest {
|
|
746
|
+
name: string;
|
|
747
|
+
/** @defaultValue `"en"` */
|
|
748
|
+
language: string;
|
|
749
|
+
/** Default template body. Used when no channel-specific body is set. */
|
|
750
|
+
body: string;
|
|
751
|
+
/** Channel-specific body for SMS. Falls back to `body` if not set. */
|
|
752
|
+
smsBody?: string;
|
|
753
|
+
/** Channel-specific body for Telegram. Falls back to `body` if not set. */
|
|
754
|
+
telegramBody?: string;
|
|
755
|
+
/** Channel-specific body for Instagram. Falls back to `body` if not set. */
|
|
756
|
+
instagramBody?: string;
|
|
757
|
+
whatsappCategory?: WhatsAppCategory;
|
|
758
|
+
/** Type of header for the template. */
|
|
759
|
+
headerType?: TemplateCreateRequestHeaderType;
|
|
760
|
+
/** Header content (text string or media URL). */
|
|
761
|
+
headerContent?: string;
|
|
762
|
+
/** Footer text for the template. */
|
|
763
|
+
footer?: string;
|
|
764
|
+
variables?: Array<string>;
|
|
765
|
+
/** Template buttons (max 3). */
|
|
766
|
+
buttons?: Array<TemplateCreateRequestButtonsItem>;
|
|
767
|
+
/** Add 'Do not share this code' disclaimer. Only for AUTHENTICATION templates. */
|
|
768
|
+
addSecurityRecommendation?: boolean;
|
|
769
|
+
/** Code expiration time in minutes. Only for AUTHENTICATION templates. */
|
|
770
|
+
codeExpirationMinutes?: number;
|
|
771
|
+
}
|
|
772
|
+
export type TemplateCreateRequestHeaderType = 'text' | 'image' | 'video' | 'document';
|
|
773
|
+
export interface TemplateCreateRequestButtonsItem {
|
|
774
|
+
/**
|
|
775
|
+
* `request_contact_info` renders a fixed **Share Contact Info** button that asks
|
|
776
|
+
* the recipient to share their phone number — useful when a contact adopted a
|
|
777
|
+
* WhatsApp username and you only know their BSUID. It takes no other fields.
|
|
778
|
+
*/
|
|
779
|
+
type: TemplateCreateRequestButtonsItemType;
|
|
780
|
+
/**
|
|
781
|
+
* Button label. Required for every type except `request_contact_info`, whose label
|
|
782
|
+
* is fixed by WhatsApp.
|
|
783
|
+
*/
|
|
784
|
+
text?: string;
|
|
785
|
+
/**
|
|
786
|
+
* Button destination. Use `{{1}}` exactly once for a dynamic URL (e.g.
|
|
787
|
+
* `https://example.com/orders/{{1}}`); WhatsApp only accepts the strict `{{1}}`
|
|
788
|
+
* form. Static URLs must not contain any `{{...}}` placeholder.
|
|
789
|
+
*/
|
|
790
|
+
url?: string;
|
|
791
|
+
/**
|
|
792
|
+
* Sample value Meta uses to review templates with a dynamic URL button.
|
|
793
|
+
* Substituted into `{{1}}` of the URL when the template is submitted to Meta. Only
|
|
794
|
+
* meaningful when `url` contains `{{1}}`; ignored for static URLs.
|
|
795
|
+
*/
|
|
796
|
+
example?: string;
|
|
797
|
+
phoneNumber?: string;
|
|
798
|
+
/**
|
|
799
|
+
* Required when type is 'otp'. COPY_CODE shows copy button, ONE_TAP enables
|
|
800
|
+
* Android autofill.
|
|
801
|
+
*/
|
|
802
|
+
otpType?: TemplateCreateRequestButtonsItemOtpType;
|
|
803
|
+
/** Android package name. Required for ONE_TAP buttons. */
|
|
804
|
+
packageName?: string;
|
|
805
|
+
/** Android app signature hash. Required for ONE_TAP buttons. */
|
|
806
|
+
signatureHash?: string;
|
|
807
|
+
}
|
|
808
|
+
export type TemplateCreateRequestButtonsItemType = 'quick_reply' | 'url' | 'phone' | 'otp' | 'request_contact_info';
|
|
809
|
+
export type TemplateCreateRequestButtonsItemOtpType = 'COPY_CODE' | 'ONE_TAP';
|
|
810
|
+
/**
|
|
811
|
+
* Type of event that triggers the webhook.
|
|
812
|
+
*
|
|
813
|
+
* **Message lifecycle events:**
|
|
814
|
+
* - `message.queued`: Message created and queued for sending. `data.status` =
|
|
815
|
+
* `queued`
|
|
816
|
+
* - `message.sent`: Message accepted by the provider. `data.status` = `sent`
|
|
817
|
+
* - `message.delivered`: Message delivered to recipient. `data.status` =
|
|
818
|
+
* `delivered`
|
|
819
|
+
* - `message.read`: Message was read by the recipient (WhatsApp only).
|
|
820
|
+
* `data.status` = `read`
|
|
821
|
+
* - `message.failed`: Message failed to send. `data.status` = `failed`
|
|
822
|
+
*
|
|
823
|
+
* **Inbound events:**
|
|
824
|
+
* - `message.inbound`: New message received from a contact. `data.conversationId`,
|
|
825
|
+
* the inbox thread id (deep-link with
|
|
826
|
+
* `https://dashboard.zavu.dev/{locale}/inbox?conv={conversationId}`), is sent on
|
|
827
|
+
* **email** messages only, and is `null` there on the first message of a
|
|
828
|
+
* brand-new thread. On every other channel it is absent: read it from `GET
|
|
829
|
+
* /v1/messages/{messageId}`, which always has it, or from `conversation.new` for
|
|
830
|
+
* a new contact. Reactions are delivered as `message.inbound` with
|
|
831
|
+
* `messageType='reaction'`. When the contact replied to (quoted) an earlier
|
|
832
|
+
* message, `data.content` carries the reply context: `replyToMessageId`,
|
|
833
|
+
* `replyToProviderMessageId`, `replyToFrom`, `replyToText`, and
|
|
834
|
+
* `replyToMessageType`. `data.providerTimestamp` is the provider's original
|
|
835
|
+
* receive time in Unix milliseconds (the moment the channel received the message
|
|
836
|
+
* from the contact — WhatsApp, Telegram, Instagram, Messenger; `null` for SMS
|
|
837
|
+
* and email). Compare it against the top-level `timestamp` (when Zavu dispatched
|
|
838
|
+
* the webhook) to detect and ignore delayed deliveries. When the conversation
|
|
839
|
+
* was opened from a Click-to-WhatsApp ad or post, `data.referral` carries the ad
|
|
840
|
+
* attribution — including `ctwaClid`, the identifier Meta's Conversions API
|
|
841
|
+
* needs to credit a conversion back to that ad. WhatsApp only, and only on the
|
|
842
|
+
* first message of the thread: it is absent from every later message, so persist
|
|
843
|
+
* it when it arrives.
|
|
844
|
+
* - `message.unsupported`: Received a message type that is not supported
|
|
845
|
+
*
|
|
846
|
+
* **Broadcast events:**
|
|
847
|
+
* - `broadcast.status_changed`: Broadcast status changed (pending_review,
|
|
848
|
+
* approved, rejected, sending, completed, cancelled)
|
|
849
|
+
*
|
|
850
|
+
* **Other events:**
|
|
851
|
+
* - `conversation.new`: New conversation started with a contact. `data` carries
|
|
852
|
+
* `conversationId` (the inbox thread id — deep-link with
|
|
853
|
+
* `https://dashboard.zavu.dev/{locale}/inbox?conv={conversationId}`), the
|
|
854
|
+
* `phoneNumber` or `email` key, `channel`, `firstMessageId`, `firstMessageText`,
|
|
855
|
+
* and `profileName`.
|
|
856
|
+
* - `template.status_changed`: WhatsApp template approval status changed. `data`
|
|
857
|
+
* carries `templateId`, `name`, `previousStatus`, `currentStatus`,
|
|
858
|
+
* `rejectionReason`, and `category` — the category Meta currently bills the
|
|
859
|
+
* template under. Meta can recategorize a template (typically `UTILITY` to
|
|
860
|
+
* `MARKETING`) at approval or long afterwards, which changes what each message
|
|
861
|
+
* costs; `category` is how that reaches you. A recategorization with no status
|
|
862
|
+
* change is delivered as this same event, so compare `category` against what you
|
|
863
|
+
* hold rather than only reacting to `currentStatus`.
|
|
864
|
+
*
|
|
865
|
+
* **Partner events:**
|
|
866
|
+
* - `invitation.status_changed`: A partner invitation's stored status changed: to
|
|
867
|
+
* `in_progress`, `completed`, `failed`, `cancelled`, or back to `pending` when
|
|
868
|
+
* it is resent from the dashboard. A change to the same status sends nothing,
|
|
869
|
+
* and expiry is not a stored change, so no event is sent when an invitation
|
|
870
|
+
* expires. Delivered to the project webhook (`POST /v1/invitations/webhook`) of
|
|
871
|
+
* the project that created the invitation; a parent project does not receive its
|
|
872
|
+
* sub-accounts' events. `data` carries `invitationId`, `clientName`,
|
|
873
|
+
* `clientEmail`, `connectionType` (`whatsapp_waba` or `messenger`),
|
|
874
|
+
* `previousStatus`, and `currentStatus`. On `completed` it also carries
|
|
875
|
+
* `senderId`, `connectedAccount` (`channel`, `id`, `name`) — the WhatsApp
|
|
876
|
+
* number or Facebook Page that was linked — and, for WhatsApp,
|
|
877
|
+
* `wabaAccountId`. On `failed` it carries `failureReason`; the invitation link
|
|
878
|
+
* stays usable, so a client can retry it.
|
|
879
|
+
*
|
|
880
|
+
* **Voice Agent events:**
|
|
881
|
+
* For every voice event, `data` carries `callId`, `direction`, `from`, `to`,
|
|
882
|
+
* `status`, `durationSeconds`, `endReason`, and `transcriptAvailable`. The
|
|
883
|
+
* terminal events (`call.completed`, `call.failed`) additionally carry `cost` —
|
|
884
|
+
* what the call was billed, in USD, combining telephony and the managed voice
|
|
885
|
+
* pipeline — and `currency`. They are dispatched after the call is charged, so
|
|
886
|
+
* `cost` is populated rather than zero; telephony can still be settling on an
|
|
887
|
+
* outbound call, in which case `GET /v1/calls/{callId}` holds the reconciled
|
|
888
|
+
* figure.
|
|
889
|
+
* - `call.initiated`: An outbound call was created and is dialing, or an inbound
|
|
890
|
+
* call was received. `data.status` = `ringing`
|
|
891
|
+
* - `call.answered`: The call was answered and the voice agent is connected.
|
|
892
|
+
* `data.status` = `in_progress`
|
|
893
|
+
* - `call.completed`: The call ended after a conversation. `data.status` =
|
|
894
|
+
* `completed`; `durationSeconds` and `endReason` describe how it ended, and
|
|
895
|
+
* `transcriptAvailable` indicates whether a transcript can be fetched.
|
|
896
|
+
* - `call.failed`: The call could not be completed (busy, no answer, canceled, or
|
|
897
|
+
* an error). `data.status` is the terminal status and `endReason` explains the
|
|
898
|
+
* cause.
|
|
899
|
+
*
|
|
900
|
+
* **Custom domain events:**
|
|
901
|
+
* - `domain.verified`: A custom email domain passed verification (DKIM, and
|
|
902
|
+
* SPF/DMARC/MAIL FROM if enhanced records are enabled)
|
|
903
|
+
* - `domain.failed`: A custom email domain failed verification or is partially
|
|
904
|
+
* verified
|
|
905
|
+
*/
|
|
906
|
+
export type WebhookEvent = 'message.queued' | 'message.sent' | 'message.delivered' | 'message.read' | 'message.status' | 'message.failed' | 'message.inbound' | 'message.unsupported' | 'broadcast.status_changed' | 'conversation.new' | 'template.status_changed' | 'invitation.status_changed' | 'call.initiated' | 'call.answered' | 'call.completed' | 'call.failed' | 'domain.verified' | 'domain.failed';
|
|
907
|
+
/** Webhook payload structure sent to your endpoint. */
|
|
908
|
+
export interface WebhookPayload {
|
|
909
|
+
/** Unique event identifier. */
|
|
910
|
+
id: string;
|
|
911
|
+
type: WebhookEvent;
|
|
912
|
+
/** Unix timestamp in milliseconds when the event was created. */
|
|
913
|
+
timestamp: number;
|
|
914
|
+
/** ID of the sender associated with this event. */
|
|
915
|
+
senderId: string;
|
|
916
|
+
/** ID of the project. */
|
|
917
|
+
projectId: string;
|
|
918
|
+
/**
|
|
919
|
+
* Event-specific data. For message events, contains messageId, to, channel,
|
|
920
|
+
* status, errorCode, and errorMessage.
|
|
921
|
+
*/
|
|
922
|
+
data: {
|
|
923
|
+
[key: string]: unknown;
|
|
924
|
+
};
|
|
925
|
+
}
|
|
926
|
+
/**
|
|
927
|
+
* Data payload for message webhook events (queued, sent, delivered, failed,
|
|
928
|
+
* inbound).
|
|
929
|
+
*/
|
|
930
|
+
export interface WebhookMessageData {
|
|
931
|
+
/** ID of the message. */
|
|
932
|
+
messageId: string;
|
|
933
|
+
/**
|
|
934
|
+
* Recipient phone number or email. On `message.inbound` this is your own number
|
|
935
|
+
* (the message's destination).
|
|
936
|
+
*/
|
|
937
|
+
to: string;
|
|
938
|
+
/**
|
|
939
|
+
* Sender of the message. Present on `message.inbound`: the contact who sent the
|
|
940
|
+
* message.
|
|
941
|
+
*/
|
|
942
|
+
from?: string;
|
|
943
|
+
channel: Channel;
|
|
944
|
+
status: MessageStatus;
|
|
945
|
+
/** Type of the message. Present on `message.inbound`. */
|
|
946
|
+
messageType?: MessageType;
|
|
947
|
+
/**
|
|
948
|
+
* ID of the conversation (inbox thread) this message belongs to. Sent on
|
|
949
|
+
* `message.inbound` for **email** messages only; on SMS, WhatsApp, Telegram,
|
|
950
|
+
* Instagram and Messenger it is absent. Use it to deep-link to the dashboard
|
|
951
|
+
* inbox: `https://dashboard.zavu.dev/{locale}/inbox?conv={conversationId}`. On
|
|
952
|
+
* email it is `null` on the first message of a brand-new thread. In every case,
|
|
953
|
+
* fetch it via `GET /v1/messages/{messageId}`, whose `conversationId` is always
|
|
954
|
+
* populated, or take it from the `conversation.new` event for a new contact.
|
|
955
|
+
*/
|
|
956
|
+
conversationId?: string | null;
|
|
957
|
+
/**
|
|
958
|
+
* Text body or media caption. Present on `message.inbound` when the message has
|
|
959
|
+
* text.
|
|
960
|
+
*/
|
|
961
|
+
text?: string;
|
|
962
|
+
/** Error code if the message failed. */
|
|
963
|
+
errorCode?: string | null;
|
|
964
|
+
/** Error message if the message failed. */
|
|
965
|
+
errorMessage?: string | null;
|
|
966
|
+
/**
|
|
967
|
+
* The provider's original receive time in Unix milliseconds (when the channel
|
|
968
|
+
* received the message from the contact). Present on `message.inbound` for
|
|
969
|
+
* channels that report it (WhatsApp, Telegram, Instagram, Messenger); null for SMS
|
|
970
|
+
* and email.
|
|
971
|
+
*/
|
|
972
|
+
providerTimestamp?: number | null;
|
|
973
|
+
/**
|
|
974
|
+
* Click-to-WhatsApp ad attribution. Present on `message.inbound` only when this is
|
|
975
|
+
* the first message of a conversation opened from a Meta ad or post — absent on
|
|
976
|
+
* every later message in that same thread, and on organic conversations. Read
|
|
977
|
+
* `referral.ctwaClid` here to attribute the conversation, and persist it on your
|
|
978
|
+
* side: this webhook is the only delivery. `GET /v1/messages/{messageId}` also
|
|
979
|
+
* returns it, under `content.referral`.
|
|
980
|
+
*/
|
|
981
|
+
referral?: AdReferral;
|
|
982
|
+
}
|
|
983
|
+
/** Webhook configuration for the sender. */
|
|
984
|
+
export interface SenderWebhook {
|
|
985
|
+
/** HTTPS URL that will receive webhook events. */
|
|
986
|
+
url: string;
|
|
987
|
+
/** List of events the webhook is subscribed to. */
|
|
988
|
+
events: Array<WebhookEvent>;
|
|
989
|
+
/**
|
|
990
|
+
* Webhook secret for signature verification. Only returned on create or
|
|
991
|
+
* regenerate.
|
|
992
|
+
*/
|
|
993
|
+
secret?: string;
|
|
994
|
+
/**
|
|
995
|
+
* Whether the webhook is active.
|
|
996
|
+
*
|
|
997
|
+
* @defaultValue `true`
|
|
998
|
+
*/
|
|
999
|
+
active: boolean;
|
|
1000
|
+
signatureVersion: WebhookSignatureVersion;
|
|
1001
|
+
}
|
|
1002
|
+
export interface Sender {
|
|
1003
|
+
id: string;
|
|
1004
|
+
name: string;
|
|
1005
|
+
/**
|
|
1006
|
+
* Phone number in E.164 format. Absent on a sender that has none: an email-only
|
|
1007
|
+
* sender, or one created with only `enableSmsOneway`.
|
|
1008
|
+
*/
|
|
1009
|
+
phoneNumber?: string;
|
|
1010
|
+
/**
|
|
1011
|
+
* Channels this sender can actually send on right now: configured AND activated.
|
|
1012
|
+
* Empty means the sender cannot send or receive anything yet: a phoneNumber alone
|
|
1013
|
+
* does not enable SMS or voice, and a connected account that is not activated is
|
|
1014
|
+
* left out, because every send on it is refused. Check this rather than inferring
|
|
1015
|
+
* capability from phoneNumber or emailAddress, and turn a connected channel on
|
|
1016
|
+
* with `POST /v1/senders/{senderId}/channels/{channel}/activate`.
|
|
1017
|
+
*/
|
|
1018
|
+
channels?: Array<string>;
|
|
1019
|
+
/**
|
|
1020
|
+
* Whether this sender is the project's default.
|
|
1021
|
+
*
|
|
1022
|
+
* @defaultValue `false`
|
|
1023
|
+
*/
|
|
1024
|
+
isDefault?: boolean;
|
|
1025
|
+
webhook?: SenderWebhook;
|
|
1026
|
+
/** WhatsApp Business Account information. Only present if a WABA is connected. */
|
|
1027
|
+
whatsapp?: SenderWhatsapp;
|
|
1028
|
+
/** From-address for the email channel, if configured. */
|
|
1029
|
+
emailAddress?: string;
|
|
1030
|
+
/**
|
|
1031
|
+
* Whether inbound email receiving is enabled for this sender.
|
|
1032
|
+
*
|
|
1033
|
+
* @defaultValue `false`
|
|
1034
|
+
*/
|
|
1035
|
+
emailReceivingEnabled?: boolean;
|
|
1036
|
+
/**
|
|
1037
|
+
* Whether catch-all receiving is enabled. When true (and emailReceivingEnabled is
|
|
1038
|
+
* true), this sender receives email addressed to any local part at its domain, not
|
|
1039
|
+
* just its own address. The original recipient is delivered in the message.inbound
|
|
1040
|
+
* webhook's data.to.
|
|
1041
|
+
*
|
|
1042
|
+
* @defaultValue `false`
|
|
1043
|
+
*/
|
|
1044
|
+
emailCatchAllEnabled?: boolean;
|
|
1045
|
+
createdAt?: string;
|
|
1046
|
+
updatedAt?: string;
|
|
1047
|
+
}
|
|
1048
|
+
export interface SenderWhatsapp {
|
|
1049
|
+
/** WhatsApp phone number ID from Meta. */
|
|
1050
|
+
phoneNumberId?: string;
|
|
1051
|
+
/** Display phone number. */
|
|
1052
|
+
displayPhoneNumber?: string;
|
|
1053
|
+
/** Payment configuration status from Meta. */
|
|
1054
|
+
paymentStatus?: SenderWhatsappPaymentStatus;
|
|
1055
|
+
}
|
|
1056
|
+
export interface SenderWhatsappPaymentStatus {
|
|
1057
|
+
/** Payment setup status (COMPLETE, NOT_STARTED, etc.). */
|
|
1058
|
+
setupStatus?: string;
|
|
1059
|
+
/** Payment method status (VALID, NONE, etc.). */
|
|
1060
|
+
methodStatus?: string;
|
|
1061
|
+
/**
|
|
1062
|
+
* Whether template messages can be sent. Requires setupStatus=COMPLETE and
|
|
1063
|
+
* methodStatus=VALID.
|
|
1064
|
+
*/
|
|
1065
|
+
canSendTemplates?: boolean;
|
|
1066
|
+
}
|
|
1067
|
+
/**
|
|
1068
|
+
* Create a sender. Provide `phoneNumber` for an SMS/WhatsApp sender,
|
|
1069
|
+
* `emailAddress` (with a verified email domain) for an email sender, or
|
|
1070
|
+
* `enableSmsOneway: true` for a zero-setup one-way SMS sender — at least one is
|
|
1071
|
+
* required.
|
|
1072
|
+
*/
|
|
1073
|
+
export interface SenderCreateRequest {
|
|
1074
|
+
name: string;
|
|
1075
|
+
/**
|
|
1076
|
+
* Phone number in E.164 format, and it must be a number your project already owns
|
|
1077
|
+
* (see `GET /v1/phone-numbers`). The number is routed to the sender as part of
|
|
1078
|
+
* this call, which is what turns the SMS channel on. Passing a number the project
|
|
1079
|
+
* does not own, one already attached to another sender, or one rejected in
|
|
1080
|
+
* regulatory review returns 400 rather than creating a sender that cannot send. A
|
|
1081
|
+
* number still under review is attached and starts carrying messages when it is
|
|
1082
|
+
* approved. Omit for an email-only sender.
|
|
1083
|
+
*/
|
|
1084
|
+
phoneNumber?: string;
|
|
1085
|
+
/**
|
|
1086
|
+
* Let this sender place and answer phone calls. Requires `phoneNumber`; enabling
|
|
1087
|
+
* it without one returns 400. Check the `channels` array on the response to
|
|
1088
|
+
* confirm `voice` is on.
|
|
1089
|
+
*
|
|
1090
|
+
* @defaultValue `false`
|
|
1091
|
+
*/
|
|
1092
|
+
enableVoice?: boolean;
|
|
1093
|
+
/**
|
|
1094
|
+
* Enable the one-way SMS channel (`sms_oneway`). No phone number and no
|
|
1095
|
+
* credential, so it is the fastest way to get a sender that can send. Recipients
|
|
1096
|
+
* cannot reply. Sending to a US or Canadian (+1) number still needs an approved
|
|
1097
|
+
* 10DLC campaign, and is refused with `403 ten_dlc_required` until then. Confirm
|
|
1098
|
+
* with `sms_oneway` in the `channels` array on the response.
|
|
1099
|
+
*
|
|
1100
|
+
* @defaultValue `false`
|
|
1101
|
+
*/
|
|
1102
|
+
enableSmsOneway?: boolean;
|
|
1103
|
+
/** @defaultValue `false` */
|
|
1104
|
+
setAsDefault?: boolean;
|
|
1105
|
+
/** HTTPS URL for webhook events. */
|
|
1106
|
+
webhookUrl?: string;
|
|
1107
|
+
/** Events to subscribe to. */
|
|
1108
|
+
webhookEvents?: Array<WebhookEvent>;
|
|
1109
|
+
/**
|
|
1110
|
+
* From-address for the email channel (e.g. noreply@yourdomain.com). The address's
|
|
1111
|
+
* domain must be a verified email domain in your project. Setting this attaches
|
|
1112
|
+
* the email channel to the sender.
|
|
1113
|
+
*/
|
|
1114
|
+
emailAddress?: string;
|
|
1115
|
+
/**
|
|
1116
|
+
* ID of the verified email domain to attach. Optional — resolved from
|
|
1117
|
+
* `emailAddress`'s domain when omitted.
|
|
1118
|
+
*/
|
|
1119
|
+
emailDomainId?: string;
|
|
1120
|
+
/** Display name shown in the recipient's inbox for the email channel. */
|
|
1121
|
+
emailFromName?: string;
|
|
1122
|
+
/**
|
|
1123
|
+
* Enable inbound email receiving on this sender. Requires a verified inbound MX
|
|
1124
|
+
* record on the domain; the request is ignored otherwise. Read
|
|
1125
|
+
* `emailReceivingEnabled` back off the response to see whether it was applied —
|
|
1126
|
+
* it comes back `false` when the MX has not verified.
|
|
1127
|
+
*/
|
|
1128
|
+
emailReceivingEnabled?: boolean;
|
|
1129
|
+
/**
|
|
1130
|
+
* Signature scheme for this sender's webhook. Defaults to `v2`, which is correct
|
|
1131
|
+
* for a new receiver. Pass `v1+v2` when this sender points at an endpoint that
|
|
1132
|
+
* already serves an older sender still verifying `v1`.
|
|
1133
|
+
*/
|
|
1134
|
+
webhookSignatureVersion?: WebhookSignatureVersion;
|
|
1135
|
+
}
|
|
1136
|
+
export interface SenderUpdateRequest {
|
|
1137
|
+
name?: string;
|
|
1138
|
+
/**
|
|
1139
|
+
* Turn the voice channel on or off. The sender must already have a phone number
|
|
1140
|
+
* provisioned for calls; enabling it otherwise returns 400 instead of storing a
|
|
1141
|
+
* flag that changes nothing. Confirm with the `channels` array on the response.
|
|
1142
|
+
*/
|
|
1143
|
+
enableVoice?: boolean;
|
|
1144
|
+
/**
|
|
1145
|
+
* Turn the one-way SMS channel on or off. Enabling needs no number or credential
|
|
1146
|
+
* and takes effect immediately (US and Canadian destinations still need an
|
|
1147
|
+
* approved 10DLC campaign); disabling removes the channel from the sender. Confirm
|
|
1148
|
+
* with the `channels` array on the response.
|
|
1149
|
+
*/
|
|
1150
|
+
enableSmsOneway?: boolean;
|
|
1151
|
+
setAsDefault?: boolean;
|
|
1152
|
+
/** HTTPS URL for webhook events. Set to null to remove webhook. */
|
|
1153
|
+
webhookUrl?: string | null;
|
|
1154
|
+
/** Events to subscribe to. */
|
|
1155
|
+
webhookEvents?: Array<WebhookEvent>;
|
|
1156
|
+
/** Whether the webhook is active. */
|
|
1157
|
+
webhookActive?: boolean;
|
|
1158
|
+
/**
|
|
1159
|
+
* Enable or disable inbound email receiving for this sender. Enabling requires a
|
|
1160
|
+
* verified inbound MX record on the domain; the request is ignored otherwise, and
|
|
1161
|
+
* `emailReceivingEnabled` comes back `false` on the response. Disabling always
|
|
1162
|
+
* applies.
|
|
1163
|
+
*/
|
|
1164
|
+
emailReceivingEnabled?: boolean;
|
|
1165
|
+
/**
|
|
1166
|
+
* Enable or disable domain catch-all. When enabled (with emailReceivingEnabled
|
|
1167
|
+
* true), this sender receives email for any address at its domain. Ignored
|
|
1168
|
+
* (treated as false) if receiving is not enabled.
|
|
1169
|
+
*/
|
|
1170
|
+
emailCatchAllEnabled?: boolean;
|
|
1171
|
+
/**
|
|
1172
|
+
* Attach or change the sender's email from-address (e.g. noreply@yourdomain.com).
|
|
1173
|
+
* The domain must be a verified email domain in your project.
|
|
1174
|
+
*/
|
|
1175
|
+
emailAddress?: string;
|
|
1176
|
+
/**
|
|
1177
|
+
* ID of the verified email domain to attach. Optional — resolved from
|
|
1178
|
+
* `emailAddress`'s domain when omitted.
|
|
1179
|
+
*/
|
|
1180
|
+
emailDomainId?: string;
|
|
1181
|
+
/** Display name shown in the recipient's inbox for the email channel. */
|
|
1182
|
+
emailFromName?: string;
|
|
1183
|
+
/**
|
|
1184
|
+
* Move this webhook between signature schemes. `v1` -> `v2` directly returns
|
|
1185
|
+
* `400`; go through `v1+v2` first. See
|
|
1186
|
+
* https://docs.zavu.dev/guides/receiving-messages/signature-migration
|
|
1187
|
+
*/
|
|
1188
|
+
webhookSignatureVersion?: WebhookSignatureVersion;
|
|
1189
|
+
}
|
|
1190
|
+
export interface WebhookSecretResponse {
|
|
1191
|
+
/** The new webhook secret. */
|
|
1192
|
+
secret: string;
|
|
1193
|
+
}
|
|
1194
|
+
/** A communication channel for a contact. */
|
|
1195
|
+
export interface ContactChannel {
|
|
1196
|
+
id: string;
|
|
1197
|
+
/** Channel type. */
|
|
1198
|
+
channel: ContactChannelChannel;
|
|
1199
|
+
/** Channel identifier (phone number or email address). */
|
|
1200
|
+
identifier: string;
|
|
1201
|
+
/** ISO country code for phone numbers. */
|
|
1202
|
+
countryCode?: string;
|
|
1203
|
+
/** Optional label for the channel. */
|
|
1204
|
+
label?: string;
|
|
1205
|
+
/** Whether this is the primary channel for its type. */
|
|
1206
|
+
isPrimary: boolean;
|
|
1207
|
+
/** Whether this channel has been verified. */
|
|
1208
|
+
verified: boolean;
|
|
1209
|
+
/** Delivery metrics for this channel. */
|
|
1210
|
+
metrics?: ContactChannelMetrics;
|
|
1211
|
+
/** Last time a message was received on this channel. */
|
|
1212
|
+
lastInboundAt?: string;
|
|
1213
|
+
metadata?: {
|
|
1214
|
+
[key: string]: string;
|
|
1215
|
+
};
|
|
1216
|
+
createdAt: string;
|
|
1217
|
+
updatedAt?: string;
|
|
1218
|
+
}
|
|
1219
|
+
export type ContactChannelChannel = 'sms' | 'whatsapp' | 'email' | 'telegram' | 'instagram' | 'messenger' | 'voice';
|
|
1220
|
+
export interface ContactChannelMetrics {
|
|
1221
|
+
successCount?: number;
|
|
1222
|
+
failureCount?: number;
|
|
1223
|
+
totalAttempts?: number;
|
|
1224
|
+
avgDeliveryTimeMs?: number;
|
|
1225
|
+
lastSuccessAt?: string;
|
|
1226
|
+
}
|
|
1227
|
+
export interface Contact {
|
|
1228
|
+
id: string;
|
|
1229
|
+
/** Display name for the contact. */
|
|
1230
|
+
displayName?: string;
|
|
1231
|
+
/** DEPRECATED: Use primaryPhone instead. Primary phone number in E.164 format. */
|
|
1232
|
+
phoneNumber?: string;
|
|
1233
|
+
/** Primary phone number in E.164 format. */
|
|
1234
|
+
primaryPhone?: string;
|
|
1235
|
+
/** Primary email address. */
|
|
1236
|
+
primaryEmail?: string;
|
|
1237
|
+
countryCode?: string;
|
|
1238
|
+
/** Contact's WhatsApp profile name. Only available for WhatsApp contacts. */
|
|
1239
|
+
profileName?: string | null;
|
|
1240
|
+
/** List of available messaging channels for this contact. */
|
|
1241
|
+
availableChannels: Array<string>;
|
|
1242
|
+
/** Preferred channel for this contact. */
|
|
1243
|
+
defaultChannel?: ContactDefaultChannel;
|
|
1244
|
+
/** Whether this contact has been verified. */
|
|
1245
|
+
verified: boolean;
|
|
1246
|
+
/** All communication channels for this contact. */
|
|
1247
|
+
channels?: Array<ContactChannel>;
|
|
1248
|
+
metadata: {
|
|
1249
|
+
[key: string]: string;
|
|
1250
|
+
};
|
|
1251
|
+
createdAt: string;
|
|
1252
|
+
updatedAt?: string;
|
|
1253
|
+
}
|
|
1254
|
+
export type ContactDefaultChannel = 'sms' | 'whatsapp' | 'telegram' | 'email' | 'instagram' | 'messenger' | 'voice';
|
|
1255
|
+
export interface ContactUpdateRequest {
|
|
1256
|
+
/**
|
|
1257
|
+
* Human-readable name for this contact. Set to null to clear it and fall back to
|
|
1258
|
+
* the contact's identifier. Contacts created automatically from an inbound message
|
|
1259
|
+
* have no display name until you set one.
|
|
1260
|
+
*/
|
|
1261
|
+
displayName?: string | null;
|
|
1262
|
+
/** Preferred channel for this contact. Set to null to clear. */
|
|
1263
|
+
defaultChannel?: ContactUpdateRequestDefaultChannel | null;
|
|
1264
|
+
metadata?: {
|
|
1265
|
+
[key: string]: string;
|
|
1266
|
+
};
|
|
1267
|
+
}
|
|
1268
|
+
export type ContactUpdateRequestDefaultChannel = 'sms' | 'whatsapp' | 'telegram' | 'email' | 'instagram' | 'messenger' | 'voice';
|
|
1269
|
+
/** Input for creating a contact channel. */
|
|
1270
|
+
export interface ContactChannelInput {
|
|
1271
|
+
/** Channel type. */
|
|
1272
|
+
channel: ContactChannelInputChannel;
|
|
1273
|
+
/** Channel identifier (phone number in E.164 format or email address). */
|
|
1274
|
+
identifier: string;
|
|
1275
|
+
/** ISO country code for phone numbers. */
|
|
1276
|
+
countryCode?: string;
|
|
1277
|
+
/** Optional label for the channel. */
|
|
1278
|
+
label?: string;
|
|
1279
|
+
/**
|
|
1280
|
+
* Whether this should be the primary channel for its type.
|
|
1281
|
+
*
|
|
1282
|
+
* @defaultValue `false`
|
|
1283
|
+
*/
|
|
1284
|
+
isPrimary?: boolean;
|
|
1285
|
+
}
|
|
1286
|
+
export type ContactChannelInputChannel = 'sms' | 'whatsapp' | 'email' | 'telegram' | 'instagram' | 'messenger' | 'voice';
|
|
1287
|
+
/** Request body to create a contact with channels. */
|
|
1288
|
+
export interface ContactCreateRequest {
|
|
1289
|
+
/** Display name for the contact. */
|
|
1290
|
+
displayName?: string;
|
|
1291
|
+
/** Communication channels for the contact. */
|
|
1292
|
+
channels: Array<ContactChannelInput>;
|
|
1293
|
+
/** Arbitrary metadata to associate with the contact. */
|
|
1294
|
+
metadata?: {
|
|
1295
|
+
[key: string]: string;
|
|
1296
|
+
};
|
|
1297
|
+
}
|
|
1298
|
+
/** Request body to add a channel to a contact. */
|
|
1299
|
+
export interface AddChannelRequest {
|
|
1300
|
+
/** Channel type. */
|
|
1301
|
+
channel: AddChannelRequestChannel;
|
|
1302
|
+
/** Channel identifier (phone number in E.164 format or email address). */
|
|
1303
|
+
identifier: string;
|
|
1304
|
+
/** ISO country code for phone numbers. */
|
|
1305
|
+
countryCode?: string;
|
|
1306
|
+
/** Optional label for the channel. */
|
|
1307
|
+
label?: string;
|
|
1308
|
+
/**
|
|
1309
|
+
* Whether this should be the primary channel for its type.
|
|
1310
|
+
*
|
|
1311
|
+
* @defaultValue `false`
|
|
1312
|
+
*/
|
|
1313
|
+
isPrimary?: boolean;
|
|
1314
|
+
}
|
|
1315
|
+
export type AddChannelRequestChannel = 'sms' | 'whatsapp' | 'email' | 'telegram' | 'instagram' | 'messenger' | 'voice';
|
|
1316
|
+
/** Request body to update a channel. */
|
|
1317
|
+
export interface UpdateChannelRequest {
|
|
1318
|
+
/** Optional label for the channel. Set to null to clear. */
|
|
1319
|
+
label?: string | null;
|
|
1320
|
+
/** Whether the channel is verified. */
|
|
1321
|
+
verified?: boolean;
|
|
1322
|
+
metadata?: {
|
|
1323
|
+
[key: string]: string;
|
|
1324
|
+
};
|
|
1325
|
+
}
|
|
1326
|
+
/** Request body to merge contacts. */
|
|
1327
|
+
export interface MergeContactsRequest {
|
|
1328
|
+
/**
|
|
1329
|
+
* ID of the contact to merge into the target contact. The source contact will be
|
|
1330
|
+
* marked as merged.
|
|
1331
|
+
*/
|
|
1332
|
+
sourceContactId: string;
|
|
1333
|
+
}
|
|
1334
|
+
export interface ContactChannelResponse {
|
|
1335
|
+
channel: ContactChannel;
|
|
1336
|
+
}
|
|
1337
|
+
/**
|
|
1338
|
+
* An inbox thread with one contact. A conversation groups every message exchanged
|
|
1339
|
+
* with that contact across channels, so a contact who writes on WhatsApp and later
|
|
1340
|
+
* by email stays in one thread.
|
|
1341
|
+
*/
|
|
1342
|
+
export interface Conversation {
|
|
1343
|
+
id: string;
|
|
1344
|
+
/**
|
|
1345
|
+
* ID of the contact this thread belongs to. Absent on group threads and on threads
|
|
1346
|
+
* whose contact has not been resolved yet.
|
|
1347
|
+
*/
|
|
1348
|
+
contactId?: string;
|
|
1349
|
+
/**
|
|
1350
|
+
* The key this thread is filed under: a phone number in E.164, a WhatsApp
|
|
1351
|
+
* business-scoped user ID (BSUID), or a numeric chat ID
|
|
1352
|
+
* (Telegram/Instagram/Messenger). It is not always a phone number, so do not parse
|
|
1353
|
+
* it as one.
|
|
1354
|
+
*/
|
|
1355
|
+
contactIdentifier: string;
|
|
1356
|
+
/** Email address of the thread, when the contact was reached by email. */
|
|
1357
|
+
email?: string;
|
|
1358
|
+
/** Every channel this thread has carried messages on. */
|
|
1359
|
+
channels: Array<string>;
|
|
1360
|
+
/**
|
|
1361
|
+
* Denormalized preview of the most recent message, so a thread list needs no extra
|
|
1362
|
+
* fetch.
|
|
1363
|
+
*/
|
|
1364
|
+
lastMessage: ConversationLastMessage;
|
|
1365
|
+
/**
|
|
1366
|
+
* Sender that last handled this thread. Use it as the `Zavu-Sender` header when
|
|
1367
|
+
* replying so the answer leaves from the same number the contact knows.
|
|
1368
|
+
*/
|
|
1369
|
+
senderId?: string;
|
|
1370
|
+
messageCount: number;
|
|
1371
|
+
/**
|
|
1372
|
+
* Inbound messages not yet marked read. Reset with POST
|
|
1373
|
+
* /v1/conversations/{conversationId}/read.
|
|
1374
|
+
*/
|
|
1375
|
+
unreadCount: number;
|
|
1376
|
+
/** WhatsApp identity, present when the contact adopted a username. */
|
|
1377
|
+
whatsapp?: ConversationWhatsapp;
|
|
1378
|
+
createdAt: string;
|
|
1379
|
+
updatedAt: string;
|
|
1380
|
+
}
|
|
1381
|
+
export interface ConversationLastMessage {
|
|
1382
|
+
id: string;
|
|
1383
|
+
/** Text or caption. Empty when the last message carried no text (e.g. media). */
|
|
1384
|
+
text: string;
|
|
1385
|
+
channel: Channel;
|
|
1386
|
+
direction: ConversationLastMessageDirection;
|
|
1387
|
+
at: string;
|
|
1388
|
+
}
|
|
1389
|
+
export type ConversationLastMessageDirection = 'inbound' | 'outbound';
|
|
1390
|
+
export interface ConversationWhatsapp {
|
|
1391
|
+
/** Business-scoped user ID. Can be used as `to` when sending. */
|
|
1392
|
+
bsuid?: string;
|
|
1393
|
+
username?: string;
|
|
1394
|
+
}
|
|
1395
|
+
export interface ConversationResponse {
|
|
1396
|
+
conversation: Conversation;
|
|
1397
|
+
}
|
|
1398
|
+
export interface PhoneIntrospectionRequest {
|
|
1399
|
+
phoneNumber: string;
|
|
1400
|
+
}
|
|
1401
|
+
/** Type of phone line. */
|
|
1402
|
+
export type LineType = 'mobile' | 'landline' | 'voip' | 'toll_free' | 'unknown';
|
|
1403
|
+
/** Carrier information for the phone number. */
|
|
1404
|
+
export interface Carrier {
|
|
1405
|
+
/** Carrier name. */
|
|
1406
|
+
name?: string | null;
|
|
1407
|
+
type?: LineType;
|
|
1408
|
+
}
|
|
1409
|
+
export interface PhoneIntrospectionResponse {
|
|
1410
|
+
phoneNumber: string;
|
|
1411
|
+
countryCode: string;
|
|
1412
|
+
validNumber: boolean;
|
|
1413
|
+
/** Phone number in national format. */
|
|
1414
|
+
nationalFormat?: string;
|
|
1415
|
+
lineType?: LineType;
|
|
1416
|
+
carrier?: Carrier;
|
|
1417
|
+
/** List of available messaging channels for this phone number. */
|
|
1418
|
+
availableChannels?: Array<string>;
|
|
1419
|
+
}
|
|
1420
|
+
/**
|
|
1421
|
+
* Validate one email (`email`) or a batch (`emails`). At most 100 addresses per
|
|
1422
|
+
* request across both fields.
|
|
1423
|
+
*/
|
|
1424
|
+
export interface EmailIntrospectionRequest {
|
|
1425
|
+
/** Single email address to validate. */
|
|
1426
|
+
email?: string;
|
|
1427
|
+
/** Batch of email addresses to validate (max 100). */
|
|
1428
|
+
emails?: Array<string>;
|
|
1429
|
+
}
|
|
1430
|
+
export interface EmailValidationResult {
|
|
1431
|
+
/** The address exactly as submitted. */
|
|
1432
|
+
email: string;
|
|
1433
|
+
/** Lowercased, trimmed form of the address. Null when the syntax is invalid. */
|
|
1434
|
+
normalized: string | null;
|
|
1435
|
+
/** Domain part of the address. Null when the syntax is invalid. */
|
|
1436
|
+
domain: string | null;
|
|
1437
|
+
/**
|
|
1438
|
+
* Validation verdict.
|
|
1439
|
+
* - `deliverable`: nothing suggests the address will bounce.
|
|
1440
|
+
* - `risky`: sendable, but a signal predicts elevated bounce/complaint odds (role
|
|
1441
|
+
* address, disposable domain, MX-less domain, prior soft bounce).
|
|
1442
|
+
* - `undeliverable`: will bounce or is blocked (invalid syntax, dead domain, or
|
|
1443
|
+
* the address is on your suppression list after a hard bounce/complaint).
|
|
1444
|
+
*/
|
|
1445
|
+
verdict: EmailValidationResultVerdict;
|
|
1446
|
+
/** Signals behind the verdict. Empty for a clean `deliverable` address. */
|
|
1447
|
+
reasons: Array<EmailValidationResultReasonsItem>;
|
|
1448
|
+
}
|
|
1449
|
+
export type EmailValidationResultVerdict = 'deliverable' | 'risky' | 'undeliverable';
|
|
1450
|
+
export type EmailValidationResultReasonsItem = 'invalid_syntax' | 'domain_not_found' | 'domain_no_mx' | 'disposable_domain' | 'role_address' | 'suppressed_hard_bounce' | 'suppressed_soft_bounce' | 'suppressed_complaint' | 'suppressed_manual' | 'suppressed_unsubscribe';
|
|
1451
|
+
export interface EmailIntrospectionResponse {
|
|
1452
|
+
/** One result per submitted address, in the same order. */
|
|
1453
|
+
results: Array<EmailValidationResult>;
|
|
1454
|
+
summary: EmailIntrospectionResponseSummary;
|
|
1455
|
+
}
|
|
1456
|
+
export interface EmailIntrospectionResponseSummary {
|
|
1457
|
+
total: number;
|
|
1458
|
+
deliverable: number;
|
|
1459
|
+
risky: number;
|
|
1460
|
+
undeliverable: number;
|
|
1461
|
+
}
|
|
1462
|
+
export interface InteractiveButton {
|
|
1463
|
+
/** Unique button identifier returned in webhook when clicked. */
|
|
1464
|
+
id: string;
|
|
1465
|
+
/** Button text displayed to user. */
|
|
1466
|
+
title: string;
|
|
1467
|
+
}
|
|
1468
|
+
export interface ListSection {
|
|
1469
|
+
/** Section title. */
|
|
1470
|
+
title: string;
|
|
1471
|
+
rows: Array<ListRow>;
|
|
1472
|
+
}
|
|
1473
|
+
export interface ListRow {
|
|
1474
|
+
/** Unique row identifier. */
|
|
1475
|
+
id: string;
|
|
1476
|
+
/** Row title. */
|
|
1477
|
+
title: string;
|
|
1478
|
+
/** Optional row description. */
|
|
1479
|
+
description?: string;
|
|
1480
|
+
}
|
|
1481
|
+
export interface ContactCard {
|
|
1482
|
+
name: ContactCardName;
|
|
1483
|
+
phones?: Array<ContactCardPhonesItem>;
|
|
1484
|
+
emails?: Array<ContactCardEmailsItem>;
|
|
1485
|
+
}
|
|
1486
|
+
export interface ContactCardName {
|
|
1487
|
+
formatted_name: string;
|
|
1488
|
+
first_name?: string;
|
|
1489
|
+
last_name?: string;
|
|
1490
|
+
}
|
|
1491
|
+
export interface ContactCardPhonesItem {
|
|
1492
|
+
phone?: string;
|
|
1493
|
+
type?: ContactCardPhonesItemType;
|
|
1494
|
+
}
|
|
1495
|
+
export type ContactCardPhonesItemType = 'MOBILE' | 'HOME' | 'WORK';
|
|
1496
|
+
export interface ContactCardEmailsItem {
|
|
1497
|
+
email?: string;
|
|
1498
|
+
type?: ContactCardEmailsItemType;
|
|
1499
|
+
}
|
|
1500
|
+
export type ContactCardEmailsItemType = 'HOME' | 'WORK';
|
|
1501
|
+
export interface ReactionRequest {
|
|
1502
|
+
/** Single emoji character to react with. */
|
|
1503
|
+
emoji: string;
|
|
1504
|
+
}
|
|
1505
|
+
/** Broadcast delivery channel. Use 'smart' for per-contact intelligent routing. */
|
|
1506
|
+
export type BroadcastChannel = 'smart' | 'sms' | 'sms_oneway' | 'whatsapp' | 'telegram' | 'email';
|
|
1507
|
+
/**
|
|
1508
|
+
* Current status of the broadcast. `pending_review`: in the automated content
|
|
1509
|
+
* review. `pending_admin_review`: the automated review passed and it waits for a
|
|
1510
|
+
* person, which is where every channel but a WhatsApp broadcast on an approved
|
|
1511
|
+
* template goes. `rejected`: the review refused it; edit it and retry the review,
|
|
1512
|
+
* or escalate. `scheduled` and `sending` follow approval.
|
|
1513
|
+
*/
|
|
1514
|
+
export type BroadcastStatus = 'draft' | 'pending_review' | 'pending_admin_review' | 'approved' | 'rejected' | 'escalated' | 'rejected_final' | 'scheduled' | 'sending' | 'paused' | 'completed' | 'cancelled' | 'failed';
|
|
1515
|
+
/**
|
|
1516
|
+
* Status of a contact within a broadcast.
|
|
1517
|
+
*
|
|
1518
|
+
* - `pending`, `queued`, `sending`: not handed to the provider yet.
|
|
1519
|
+
* - `sent`: accepted by the provider; delivery is not confirmed yet. Channels that
|
|
1520
|
+
* never report delivery leave the recipient here.
|
|
1521
|
+
* - `delivered`: the channel confirmed delivery to the device. A WhatsApp read
|
|
1522
|
+
* receipt also counts as delivered.
|
|
1523
|
+
* - `failed`: not delivered. A recipient can move from `sent` or `delivered` to
|
|
1524
|
+
* `failed` when the provider reports a failure late.
|
|
1525
|
+
* - `skipped`: not sent, because the recipient opted out of the channel or the
|
|
1526
|
+
* broadcast was cancelled before reaching it.
|
|
1527
|
+
*/
|
|
1528
|
+
export type BroadcastContactStatus = 'pending' | 'queued' | 'sending' | 'sent' | 'delivered' | 'failed' | 'skipped';
|
|
1529
|
+
/** Type of message for broadcast. */
|
|
1530
|
+
export type BroadcastMessageType = 'text' | 'image' | 'video' | 'audio' | 'document' | 'template';
|
|
1531
|
+
/** Content for non-text broadcast message types. */
|
|
1532
|
+
export interface BroadcastContent {
|
|
1533
|
+
/** URL of the media file. */
|
|
1534
|
+
mediaUrl?: string;
|
|
1535
|
+
/** Media ID if already uploaded. */
|
|
1536
|
+
mediaId?: string;
|
|
1537
|
+
/** MIME type of the media. */
|
|
1538
|
+
mimeType?: string;
|
|
1539
|
+
/** Filename for documents. */
|
|
1540
|
+
filename?: string;
|
|
1541
|
+
/** Template ID for template messages. */
|
|
1542
|
+
templateId?: string;
|
|
1543
|
+
/**
|
|
1544
|
+
* Default body variables (can be overridden per contact). Key them to match the
|
|
1545
|
+
* template body: by position (`1`, `2`, ...) for positional templates, or by name
|
|
1546
|
+
* (e.g. `customer_name`) for named templates. Zavu detects the template's format
|
|
1547
|
+
* and sends the correct payload to Meta. Do not mix positional and named keys.
|
|
1548
|
+
*/
|
|
1549
|
+
templateVariables?: {
|
|
1550
|
+
[key: string]: string;
|
|
1551
|
+
};
|
|
1552
|
+
/**
|
|
1553
|
+
* Default button variables for dynamic URL/OTP buttons. Keys are the button index
|
|
1554
|
+
* (0, 1, 2). Per-contact values override these.
|
|
1555
|
+
*/
|
|
1556
|
+
templateButtonVariables?: {
|
|
1557
|
+
[key: string]: string;
|
|
1558
|
+
};
|
|
1559
|
+
/**
|
|
1560
|
+
* Default value for a text-header variable, keyed by `1` (can be overridden per
|
|
1561
|
+
* contact). If omitted, Zavu resolves the header from `templateVariables` by the
|
|
1562
|
+
* header placeholder's name.
|
|
1563
|
+
*/
|
|
1564
|
+
templateHeaderVariables?: {
|
|
1565
|
+
[key: string]: string;
|
|
1566
|
+
};
|
|
1567
|
+
}
|
|
1568
|
+
export interface BroadcastCreateRequest {
|
|
1569
|
+
/** Name of the broadcast campaign. */
|
|
1570
|
+
name: string;
|
|
1571
|
+
channel: BroadcastChannel;
|
|
1572
|
+
/** @defaultValue `"text"` */
|
|
1573
|
+
messageType?: BroadcastMessageType;
|
|
1574
|
+
/** Text content or caption. Supports template variables: {{name}}, {{1}}, etc. */
|
|
1575
|
+
text?: string;
|
|
1576
|
+
content?: BroadcastContent;
|
|
1577
|
+
/** Sender profile ID. Uses default sender if omitted. */
|
|
1578
|
+
senderId?: string;
|
|
1579
|
+
/** Email subject line. Required for email broadcasts. */
|
|
1580
|
+
emailSubject?: string;
|
|
1581
|
+
/** HTML body for email broadcasts. */
|
|
1582
|
+
emailHtmlBody?: string;
|
|
1583
|
+
/** Schedule the broadcast for future delivery. */
|
|
1584
|
+
scheduledAt?: string;
|
|
1585
|
+
metadata?: {
|
|
1586
|
+
[key: string]: string;
|
|
1587
|
+
};
|
|
1588
|
+
/** Idempotency key to prevent duplicate broadcasts. */
|
|
1589
|
+
idempotencyKey?: string;
|
|
1590
|
+
}
|
|
1591
|
+
export interface BroadcastUpdateRequest {
|
|
1592
|
+
name?: string;
|
|
1593
|
+
text?: string;
|
|
1594
|
+
content?: BroadcastContent;
|
|
1595
|
+
emailSubject?: string;
|
|
1596
|
+
emailHtmlBody?: string;
|
|
1597
|
+
metadata?: {
|
|
1598
|
+
[key: string]: string;
|
|
1599
|
+
};
|
|
1600
|
+
}
|
|
1601
|
+
export interface BroadcastContactInput {
|
|
1602
|
+
/**
|
|
1603
|
+
* Phone number (E.164) or email address. On a `telegram` broadcast, the numeric
|
|
1604
|
+
* chat ID of someone who has already written to your bot (`838360395`, or
|
|
1605
|
+
* `telegram:838360395`); a phone number is rejected there, because a bot cannot
|
|
1606
|
+
* start a chat.
|
|
1607
|
+
*/
|
|
1608
|
+
recipient: string;
|
|
1609
|
+
/**
|
|
1610
|
+
* Per-contact body variables. Key them to match the template body: by position
|
|
1611
|
+
* (`1`, `2`, ...) for positional templates, or by name (e.g. `customer_name`) for
|
|
1612
|
+
* named templates. Zavu detects the template's format and sends the correct
|
|
1613
|
+
* payload to Meta. Do not mix positional and named keys.
|
|
1614
|
+
*/
|
|
1615
|
+
templateVariables?: {
|
|
1616
|
+
[key: string]: string;
|
|
1617
|
+
};
|
|
1618
|
+
/**
|
|
1619
|
+
* Per-contact button variables for dynamic URL/OTP buttons. Keys are the button
|
|
1620
|
+
* index (0, 1, 2).
|
|
1621
|
+
*/
|
|
1622
|
+
templateButtonVariables?: {
|
|
1623
|
+
[key: string]: string;
|
|
1624
|
+
};
|
|
1625
|
+
/**
|
|
1626
|
+
* Per-contact value for a text-header variable, keyed by `1`. If omitted, Zavu
|
|
1627
|
+
* resolves the header from `templateVariables` by the header placeholder's name.
|
|
1628
|
+
*/
|
|
1629
|
+
templateHeaderVariables?: {
|
|
1630
|
+
[key: string]: string;
|
|
1631
|
+
};
|
|
1632
|
+
}
|
|
1633
|
+
export interface BroadcastContactsAddRequest {
|
|
1634
|
+
/** List of contacts to add (max 1000 per request). */
|
|
1635
|
+
contacts: Array<BroadcastContactInput>;
|
|
1636
|
+
}
|
|
1637
|
+
export interface BroadcastContactsAddResponse {
|
|
1638
|
+
/** Number of contacts successfully added. */
|
|
1639
|
+
added: number;
|
|
1640
|
+
/** Number of duplicate contacts skipped. */
|
|
1641
|
+
duplicates: number;
|
|
1642
|
+
/** Number of invalid contacts rejected. */
|
|
1643
|
+
invalid: number;
|
|
1644
|
+
/** Details about invalid contacts. */
|
|
1645
|
+
errors?: Array<BroadcastContactsAddResponseErrorsItem>;
|
|
1646
|
+
}
|
|
1647
|
+
export interface BroadcastContactsAddResponseErrorsItem {
|
|
1648
|
+
recipient?: string;
|
|
1649
|
+
reason?: string;
|
|
1650
|
+
}
|
|
1651
|
+
export interface BroadcastSendRequest {
|
|
1652
|
+
/** Schedule for future delivery. Omit to send immediately. */
|
|
1653
|
+
scheduledAt?: string;
|
|
1654
|
+
}
|
|
1655
|
+
export interface BroadcastRescheduleRequest {
|
|
1656
|
+
/** New scheduled time for the broadcast. */
|
|
1657
|
+
scheduledAt: string;
|
|
1658
|
+
}
|
|
1659
|
+
export interface Broadcast {
|
|
1660
|
+
id: string;
|
|
1661
|
+
name: string;
|
|
1662
|
+
status: BroadcastStatus;
|
|
1663
|
+
channel: BroadcastChannel;
|
|
1664
|
+
messageType: BroadcastMessageType;
|
|
1665
|
+
text?: string;
|
|
1666
|
+
content?: BroadcastContent;
|
|
1667
|
+
senderId?: string;
|
|
1668
|
+
emailSubject?: string;
|
|
1669
|
+
/** Total number of contacts in the broadcast. */
|
|
1670
|
+
totalContacts: number;
|
|
1671
|
+
pendingCount?: number;
|
|
1672
|
+
sendingCount?: number;
|
|
1673
|
+
/**
|
|
1674
|
+
* Recipients whose message the provider accepted, without a confirmed delivery
|
|
1675
|
+
* yet. Channels that never report delivery keep their recipients here.
|
|
1676
|
+
*/
|
|
1677
|
+
sentCount?: number;
|
|
1678
|
+
/** Recipients with confirmed delivery to the device. */
|
|
1679
|
+
deliveredCount?: number;
|
|
1680
|
+
failedCount?: number;
|
|
1681
|
+
/** Estimated total cost in USD. */
|
|
1682
|
+
estimatedCost?: number | null;
|
|
1683
|
+
/** Amount reserved from balance in USD. */
|
|
1684
|
+
reservedAmount?: number | null;
|
|
1685
|
+
/** Actual cost so far in USD. */
|
|
1686
|
+
actualCost?: number | null;
|
|
1687
|
+
scheduledAt?: string;
|
|
1688
|
+
startedAt?: string;
|
|
1689
|
+
completedAt?: string;
|
|
1690
|
+
metadata?: {
|
|
1691
|
+
[key: string]: string;
|
|
1692
|
+
};
|
|
1693
|
+
createdAt: string;
|
|
1694
|
+
updatedAt?: string;
|
|
1695
|
+
/** AI content review result. */
|
|
1696
|
+
reviewResult?: BroadcastReviewResult | null;
|
|
1697
|
+
/** Number of review attempts (max 3). */
|
|
1698
|
+
reviewAttempts?: number | null;
|
|
1699
|
+
}
|
|
1700
|
+
export interface BroadcastReviewResult {
|
|
1701
|
+
/** Content safety score from 0.0 to 1.0, where 1.0 is completely safe. */
|
|
1702
|
+
score?: number;
|
|
1703
|
+
/** Policy categories violated, if any. */
|
|
1704
|
+
categories?: Array<string>;
|
|
1705
|
+
/** Explanation of the review decision. */
|
|
1706
|
+
reasoning?: string;
|
|
1707
|
+
reviewedAt?: string;
|
|
1708
|
+
/** Problematic text fragments, if any. */
|
|
1709
|
+
flaggedContent?: Array<string> | null;
|
|
1710
|
+
}
|
|
1711
|
+
export interface BroadcastResponse {
|
|
1712
|
+
broadcast: Broadcast;
|
|
1713
|
+
}
|
|
1714
|
+
export interface BroadcastContact {
|
|
1715
|
+
id: string;
|
|
1716
|
+
recipient: string;
|
|
1717
|
+
recipientType: BroadcastContactRecipientType;
|
|
1718
|
+
status: BroadcastContactStatus;
|
|
1719
|
+
templateVariables?: {
|
|
1720
|
+
[key: string]: string;
|
|
1721
|
+
};
|
|
1722
|
+
templateButtonVariables?: {
|
|
1723
|
+
[key: string]: string;
|
|
1724
|
+
};
|
|
1725
|
+
templateHeaderVariables?: {
|
|
1726
|
+
[key: string]: string;
|
|
1727
|
+
};
|
|
1728
|
+
/** Associated message ID after processing. */
|
|
1729
|
+
messageId?: string;
|
|
1730
|
+
errorCode?: string;
|
|
1731
|
+
errorMessage?: string;
|
|
1732
|
+
cost?: number | null;
|
|
1733
|
+
processedAt?: string;
|
|
1734
|
+
createdAt: string;
|
|
1735
|
+
}
|
|
1736
|
+
export type BroadcastContactRecipientType = 'phone' | 'email';
|
|
1737
|
+
export interface BroadcastProgress {
|
|
1738
|
+
broadcastId: string;
|
|
1739
|
+
status: BroadcastStatus;
|
|
1740
|
+
/** Total contacts in broadcast. */
|
|
1741
|
+
total: number;
|
|
1742
|
+
/** Not yet queued for sending. */
|
|
1743
|
+
pending: number;
|
|
1744
|
+
/** Currently being sent. */
|
|
1745
|
+
sending: number;
|
|
1746
|
+
/** Accepted by the provider, delivery not confirmed yet. */
|
|
1747
|
+
sent?: number;
|
|
1748
|
+
/** Confirmed delivered to the device. */
|
|
1749
|
+
delivered: number;
|
|
1750
|
+
/** Failed to deliver. */
|
|
1751
|
+
failed: number;
|
|
1752
|
+
/** Skipped (broadcast cancelled). */
|
|
1753
|
+
skipped: number;
|
|
1754
|
+
/** Percentage complete (0-100). */
|
|
1755
|
+
percentComplete: number;
|
|
1756
|
+
/** Estimated total cost in USD. */
|
|
1757
|
+
estimatedCost?: number | null;
|
|
1758
|
+
/** Amount reserved from balance in USD. */
|
|
1759
|
+
reservedAmount?: number | null;
|
|
1760
|
+
/** Actual cost so far in USD. */
|
|
1761
|
+
actualCost?: number | null;
|
|
1762
|
+
startedAt?: string;
|
|
1763
|
+
estimatedCompletionAt?: string;
|
|
1764
|
+
}
|
|
1765
|
+
/**
|
|
1766
|
+
* Billing state of an owned number, separate from `regulatoryStatus`. `pending` is
|
|
1767
|
+
* legacy and is not written to numbers today. The SDKs carry `active`, `suspended`
|
|
1768
|
+
* and `pending` only; `releasing` and `released` are returned by the REST API
|
|
1769
|
+
* until their next release.
|
|
1770
|
+
*/
|
|
1771
|
+
export type PhoneNumberStatus = 'active' | 'suspended' | 'pending' | 'releasing' | 'released';
|
|
1772
|
+
/**
|
|
1773
|
+
* Type of phone number. `mobile` is stocked in countries where no geographic
|
|
1774
|
+
* (`local`) or non-geographic (`national`) inventory exists, and in several
|
|
1775
|
+
* markets it is the only type that can receive SMS.
|
|
1776
|
+
*/
|
|
1777
|
+
export type PhoneNumberType = 'local' | 'national' | 'tollFree' | 'mobile';
|
|
1778
|
+
export interface PhoneNumberCapabilities {
|
|
1779
|
+
sms?: boolean;
|
|
1780
|
+
voice?: boolean;
|
|
1781
|
+
mms?: boolean;
|
|
1782
|
+
}
|
|
1783
|
+
export interface PhoneNumberPricing {
|
|
1784
|
+
/** Monthly price in USD. */
|
|
1785
|
+
monthlyPrice?: number;
|
|
1786
|
+
/** One-time purchase price in USD. */
|
|
1787
|
+
upfrontPrice?: number;
|
|
1788
|
+
/**
|
|
1789
|
+
* Whether this number qualifies as the plan-included number: a US or Canadian
|
|
1790
|
+
* number (a +1 number) costing $20 a month or less. The benefit is one per
|
|
1791
|
+
* account: it is never offered again once claimed, not even after the number is
|
|
1792
|
+
* released.
|
|
1793
|
+
*/
|
|
1794
|
+
isFreeEligible?: boolean;
|
|
1795
|
+
}
|
|
1796
|
+
export interface AvailablePhoneNumber {
|
|
1797
|
+
phoneNumber: string;
|
|
1798
|
+
friendlyName?: string;
|
|
1799
|
+
locality?: string;
|
|
1800
|
+
region?: string;
|
|
1801
|
+
capabilities: PhoneNumberCapabilities;
|
|
1802
|
+
pricing: PhoneNumberPricing;
|
|
1803
|
+
}
|
|
1804
|
+
export interface OwnedPhoneNumberPricing {
|
|
1805
|
+
/** Monthly price in USD. */
|
|
1806
|
+
monthlyPrice?: number;
|
|
1807
|
+
/** One-time purchase cost in cents. */
|
|
1808
|
+
upfrontCost?: number;
|
|
1809
|
+
/** Monthly cost in cents. */
|
|
1810
|
+
monthlyCost?: number;
|
|
1811
|
+
/** Whether this is a free number. */
|
|
1812
|
+
isFreeNumber?: boolean;
|
|
1813
|
+
}
|
|
1814
|
+
export interface OwnedPhoneNumber {
|
|
1815
|
+
id: string;
|
|
1816
|
+
phoneNumber: string;
|
|
1817
|
+
/** Optional custom name for the phone number. */
|
|
1818
|
+
name?: string;
|
|
1819
|
+
capabilities: Array<string>;
|
|
1820
|
+
status: PhoneNumberStatus;
|
|
1821
|
+
/** Sender ID if the phone number is assigned to a sender. */
|
|
1822
|
+
senderId?: string;
|
|
1823
|
+
pricing: OwnedPhoneNumberPricing;
|
|
1824
|
+
/**
|
|
1825
|
+
* Regulatory review state. Numbers that need no review are `approved` immediately.
|
|
1826
|
+
* A number bought with regulatory information is owned and billed from purchase
|
|
1827
|
+
* and starts `pending_review`; it cannot send messages or place calls until this
|
|
1828
|
+
* is `approved`. The state is re-checked every 6 hours: poll `GET
|
|
1829
|
+
* /v1/phone-numbers/{phoneNumberId}` to follow it.
|
|
1830
|
+
*
|
|
1831
|
+
* Assign it to a sender with `PATCH /v1/phone-numbers/{phoneNumberId}`
|
|
1832
|
+
* (`senderId`) before or after approval. A number assigned while under review is
|
|
1833
|
+
* recorded and connected to that sender when it is approved; the connection is
|
|
1834
|
+
* retried until it succeeds. A sender created over the API is set up for SMS as
|
|
1835
|
+
* part of the assignment. `rejected` means review refused the information: the
|
|
1836
|
+
* number cannot be assigned to a sender. A number that stays `pending_review` may
|
|
1837
|
+
* be waiting on information the API cannot supply; contact support.
|
|
1838
|
+
*/
|
|
1839
|
+
regulatoryStatus: OwnedPhoneNumberRegulatoryStatus;
|
|
1840
|
+
nextRenewalDate?: string;
|
|
1841
|
+
createdAt: string;
|
|
1842
|
+
updatedAt?: string;
|
|
1843
|
+
}
|
|
1844
|
+
export type OwnedPhoneNumberRegulatoryStatus = 'approved' | 'pending_review' | 'rejected';
|
|
1845
|
+
export interface PhoneNumberPurchaseRequest {
|
|
1846
|
+
/** Phone number in E.164 format. */
|
|
1847
|
+
phoneNumber: string;
|
|
1848
|
+
/** Optional custom name for the phone number. */
|
|
1849
|
+
name?: string;
|
|
1850
|
+
/**
|
|
1851
|
+
* Type the number was found under in `GET /v1/phone-numbers/available`. Used to
|
|
1852
|
+
* look the number up and to keep regulatory information for reuse. Required when
|
|
1853
|
+
* `regulatoryRequirements` is sent. `toll_free` is accepted as an alias of
|
|
1854
|
+
* `tollFree`. A number not listed under this type is refused with `400
|
|
1855
|
+
* number_unavailable` saying so.
|
|
1856
|
+
*/
|
|
1857
|
+
type?: PhoneNumberType;
|
|
1858
|
+
/**
|
|
1859
|
+
* Regulatory information, for numbers whose requirements list is not empty. Get
|
|
1860
|
+
* the list with `GET /v1/phone-numbers/requirements?phoneNumber=...` and send one
|
|
1861
|
+
* entry per requirement id, except `action` requirements, which take no value.
|
|
1862
|
+
* Every required id must be present, once, and no unknown id may be sent;
|
|
1863
|
+
* otherwise the purchase is refused with `400 invalid_request` before anything is
|
|
1864
|
+
* charged.
|
|
1865
|
+
*
|
|
1866
|
+
* The information is kept for your project under the number's country and `type`.
|
|
1867
|
+
* A later purchase there may omit this field if what is kept still covers that
|
|
1868
|
+
* number's requirements. Omit it for numbers without requirements.
|
|
1869
|
+
*/
|
|
1870
|
+
regulatoryRequirements?: Array<PhoneNumberPurchaseRequestRegulatoryRequirementsItem>;
|
|
1871
|
+
}
|
|
1872
|
+
export interface PhoneNumberPurchaseRequestRegulatoryRequirementsItem {
|
|
1873
|
+
/**
|
|
1874
|
+
* A `requirementTypes[].id` from `GET /v1/phone-numbers/requirements`. Each id may
|
|
1875
|
+
* appear only once.
|
|
1876
|
+
*/
|
|
1877
|
+
requirementType: string;
|
|
1878
|
+
/**
|
|
1879
|
+
* Depends on the requirement's `type`: the text itself for `textual`; for
|
|
1880
|
+
* `address`, the `id` of an address created in this project with `POST
|
|
1881
|
+
* /v1/addresses`; for `document`, the `id` of a document created with `POST
|
|
1882
|
+
* /v1/documents`. An address or document from another project, or one rejected in
|
|
1883
|
+
* review, is refused.
|
|
1884
|
+
*/
|
|
1885
|
+
fieldValue: string;
|
|
1886
|
+
}
|
|
1887
|
+
export interface PhoneNumberUpdateRequest {
|
|
1888
|
+
/** Custom name for the phone number. Set to null to clear. */
|
|
1889
|
+
name?: string | null;
|
|
1890
|
+
/**
|
|
1891
|
+
* Sender ID to assign the phone number to. Set to null to unassign. A number under
|
|
1892
|
+
* regulatory review is recorded now and connected to the sender when approved; a
|
|
1893
|
+
* rejected number is refused.
|
|
1894
|
+
*/
|
|
1895
|
+
senderId?: string | null;
|
|
1896
|
+
}
|
|
1897
|
+
export interface PhoneNumberResponse {
|
|
1898
|
+
phoneNumber: OwnedPhoneNumber;
|
|
1899
|
+
}
|
|
1900
|
+
/**
|
|
1901
|
+
* Current status of the partner invitation.
|
|
1902
|
+
*
|
|
1903
|
+
* `failed` means the client started the connection and it did not finish (they
|
|
1904
|
+
* cancelled Meta's dialog, denied a permission, or abandoned the tab). A failed
|
|
1905
|
+
* invitation is still usable: the same link can be retried, and it moves back to
|
|
1906
|
+
* `in_progress` when the client tries again.
|
|
1907
|
+
*/
|
|
1908
|
+
export type InvitationStatus = 'pending' | 'in_progress' | 'completed' | 'expired' | 'cancelled' | 'failed';
|
|
1909
|
+
export interface InvitationCreateRequest {
|
|
1910
|
+
/** Name of the client being invited. */
|
|
1911
|
+
clientName?: string;
|
|
1912
|
+
/** Email of the client being invited. */
|
|
1913
|
+
clientEmail?: string;
|
|
1914
|
+
/** Phone number of the client in E.164 format. */
|
|
1915
|
+
clientPhone?: string;
|
|
1916
|
+
/**
|
|
1917
|
+
* ID of a Zavu phone number to pre-assign for WhatsApp registration. If provided,
|
|
1918
|
+
* the client will use this number instead of their own. Only valid when
|
|
1919
|
+
* `connectionType` is `whatsapp_waba` — sending it with `messenger` returns 400,
|
|
1920
|
+
* since a Facebook Page has no phone number.
|
|
1921
|
+
*/
|
|
1922
|
+
phoneNumberId?: string;
|
|
1923
|
+
/**
|
|
1924
|
+
* Number of days until the invitation expires.
|
|
1925
|
+
*
|
|
1926
|
+
* @defaultValue `7`
|
|
1927
|
+
*/
|
|
1928
|
+
expiresInDays?: number;
|
|
1929
|
+
/**
|
|
1930
|
+
* ISO country codes for allowed phone numbers. Only valid when `connectionType` is
|
|
1931
|
+
* `whatsapp_waba` — sending it with `messenger` returns 400.
|
|
1932
|
+
*/
|
|
1933
|
+
allowedPhoneCountries?: Array<string>;
|
|
1934
|
+
/**
|
|
1935
|
+
* Which Meta channel the client connects, and how.
|
|
1936
|
+
* - `whatsapp_waba` (default): Meta's embedded signup links an official WhatsApp
|
|
1937
|
+
* Business Account. Accepts `phoneNumberId` and `allowedPhoneCountries`.
|
|
1938
|
+
* - `messenger`: the client authorizes with Facebook and picks a Facebook Page
|
|
1939
|
+
* they administer. The Page's Messenger inbox — including Marketplace chats
|
|
1940
|
+
* — is routed to Zavu. They must be an admin of at least one Page. A Page can
|
|
1941
|
+
* only be connected to one Zavu project at a time: if the client picks a Page
|
|
1942
|
+
* that another project already connected, the newer connection wins and the
|
|
1943
|
+
* older one is disconnected.
|
|
1944
|
+
*
|
|
1945
|
+
* One invitation connects one channel. To onboard a client on several channels,
|
|
1946
|
+
* create one invitation per channel; each completes into its own sender.
|
|
1947
|
+
*
|
|
1948
|
+
* @defaultValue `"whatsapp_waba"`
|
|
1949
|
+
*/
|
|
1950
|
+
connectionType?: InvitationCreateRequestConnectionType;
|
|
1951
|
+
}
|
|
1952
|
+
export type InvitationCreateRequestConnectionType = 'whatsapp_waba' | 'messenger';
|
|
1953
|
+
export interface Invitation {
|
|
1954
|
+
id: string;
|
|
1955
|
+
/** Full URL to share with the client. */
|
|
1956
|
+
url: string;
|
|
1957
|
+
/** Unique invitation token. */
|
|
1958
|
+
token: string;
|
|
1959
|
+
clientName?: string | null;
|
|
1960
|
+
clientEmail?: string | null;
|
|
1961
|
+
clientPhone?: string | null;
|
|
1962
|
+
/**
|
|
1963
|
+
* ID of a pre-assigned Zavu phone number for WhatsApp registration. Always null
|
|
1964
|
+
* for `messenger` invitations.
|
|
1965
|
+
*/
|
|
1966
|
+
phoneNumberId?: string | null;
|
|
1967
|
+
/**
|
|
1968
|
+
* Which Meta channel the client connects: `whatsapp_waba` (official WhatsApp Cloud
|
|
1969
|
+
* API via embedded signup) or `messenger` (a Facebook Page's Messenger inbox,
|
|
1970
|
+
* including Marketplace chats).
|
|
1971
|
+
*/
|
|
1972
|
+
connectionType?: InvitationConnectionType;
|
|
1973
|
+
status: InvitationStatus;
|
|
1974
|
+
/** ID of the sender created when invitation is completed. */
|
|
1975
|
+
senderId?: string | null;
|
|
1976
|
+
/**
|
|
1977
|
+
* The account the client linked, populated once the invitation is `completed`.
|
|
1978
|
+
* Null before that. Use it to show the partner what was connected without fetching
|
|
1979
|
+
* the sender.
|
|
1980
|
+
*/
|
|
1981
|
+
connectedAccount?: InvitationConnectedAccount | null;
|
|
1982
|
+
/**
|
|
1983
|
+
* Stable code for why the last attempt failed, present when `status` is `failed`.
|
|
1984
|
+
* Values include `fb_cancelled` (client closed Meta's dialog), `fb_not_authorized`
|
|
1985
|
+
* (permission denied), `signup_abandoned` (started but never finished),
|
|
1986
|
+
* `meta_no_pages` (the client administers no Facebook Page), and `internal_error`.
|
|
1987
|
+
* Treat unknown codes as a generic failure.
|
|
1988
|
+
*/
|
|
1989
|
+
failureReason?: string | null;
|
|
1990
|
+
failedAt?: string | null;
|
|
1991
|
+
expiresAt: string;
|
|
1992
|
+
viewedAt?: string | null;
|
|
1993
|
+
startedAt?: string | null;
|
|
1994
|
+
completedAt?: string | null;
|
|
1995
|
+
createdAt: string;
|
|
1996
|
+
updatedAt: string;
|
|
1997
|
+
}
|
|
1998
|
+
export type InvitationConnectionType = 'whatsapp_waba' | 'messenger';
|
|
1999
|
+
export interface InvitationConnectedAccount {
|
|
2000
|
+
channel: InvitationConnectedAccountChannel;
|
|
2001
|
+
/** Provider-side identifier: the WhatsApp phone number ID, or the Facebook Page ID. */
|
|
2002
|
+
id: string;
|
|
2003
|
+
/**
|
|
2004
|
+
* Display name of the connected account: the WhatsApp verified name, or the
|
|
2005
|
+
* Facebook Page name.
|
|
2006
|
+
*/
|
|
2007
|
+
name?: string | null;
|
|
2008
|
+
}
|
|
2009
|
+
export type InvitationConnectedAccountChannel = 'whatsapp' | 'messenger';
|
|
2010
|
+
export interface InvitationResponse {
|
|
2011
|
+
invitation: Invitation;
|
|
2012
|
+
}
|
|
2013
|
+
/** Business category for WhatsApp Business profile. */
|
|
2014
|
+
export type WhatsAppBusinessProfileVertical = 'UNDEFINED' | 'OTHER' | 'AUTO' | 'BEAUTY' | 'APPAREL' | 'EDU' | 'ENTERTAIN' | 'EVENT_PLAN' | 'FINANCE' | 'GROCERY' | 'GOVT' | 'HOTEL' | 'HEALTH' | 'NONPROFIT' | 'PROF_SERVICES' | 'RETAIL' | 'TRAVEL' | 'RESTAURANT' | 'NOT_A_BIZ';
|
|
2015
|
+
/** WhatsApp Business profile information. */
|
|
2016
|
+
export interface WhatsAppBusinessProfile {
|
|
2017
|
+
/** Short description of the business (max 139 characters). */
|
|
2018
|
+
about?: string;
|
|
2019
|
+
/** Physical address of the business (max 256 characters). */
|
|
2020
|
+
address?: string;
|
|
2021
|
+
/** Extended description of the business (max 512 characters). */
|
|
2022
|
+
description?: string;
|
|
2023
|
+
/** Business email address. */
|
|
2024
|
+
email?: string;
|
|
2025
|
+
/** URL of the business profile picture. */
|
|
2026
|
+
profilePictureUrl?: string;
|
|
2027
|
+
/** Business website URLs (maximum 2). */
|
|
2028
|
+
websites?: Array<string>;
|
|
2029
|
+
vertical?: WhatsAppBusinessProfileVertical;
|
|
2030
|
+
}
|
|
2031
|
+
/** Request body to update WhatsApp Business profile. */
|
|
2032
|
+
export interface WhatsAppBusinessProfileUpdateRequest {
|
|
2033
|
+
/** Short description of the business (max 139 characters). */
|
|
2034
|
+
about?: string;
|
|
2035
|
+
/** Physical address of the business (max 256 characters). */
|
|
2036
|
+
address?: string;
|
|
2037
|
+
/** Extended description of the business (max 512 characters). */
|
|
2038
|
+
description?: string;
|
|
2039
|
+
/** Business email address. */
|
|
2040
|
+
email?: string;
|
|
2041
|
+
/** Business website URLs (maximum 2). */
|
|
2042
|
+
websites?: Array<string>;
|
|
2043
|
+
vertical?: WhatsAppBusinessProfileVertical;
|
|
2044
|
+
}
|
|
2045
|
+
export interface WhatsAppBusinessProfileResponse {
|
|
2046
|
+
profile: WhatsAppBusinessProfile;
|
|
2047
|
+
}
|
|
2048
|
+
/** Request body to upload a profile picture. */
|
|
2049
|
+
export interface WhatsAppBusinessProfilePictureRequest {
|
|
2050
|
+
/** URL of the image to upload. */
|
|
2051
|
+
imageUrl: string;
|
|
2052
|
+
/** MIME type of the image. */
|
|
2053
|
+
mimeType: WhatsAppBusinessProfilePictureRequestMimeType;
|
|
2054
|
+
}
|
|
2055
|
+
export type WhatsAppBusinessProfilePictureRequestMimeType = 'image/jpeg' | 'image/png';
|
|
2056
|
+
/** Status of WhatsApp message history sync. */
|
|
2057
|
+
export type WhatsAppSyncHistoryStatus = 'not_requested' | 'pending' | 'syncing' | 'completed' | 'rejected';
|
|
2058
|
+
/** Status of WhatsApp contacts sync. */
|
|
2059
|
+
export type WhatsAppSyncContactsStatus = 'not_requested' | 'pending' | 'syncing' | 'completed';
|
|
2060
|
+
/** History sync status details. */
|
|
2061
|
+
export interface WhatsAppSyncHistory {
|
|
2062
|
+
status: WhatsAppSyncHistoryStatus;
|
|
2063
|
+
/** Whether history sync can be initiated. */
|
|
2064
|
+
canSync: boolean;
|
|
2065
|
+
/** When the sync was last requested. */
|
|
2066
|
+
requestedAt?: string | null;
|
|
2067
|
+
/** When the sync was completed. */
|
|
2068
|
+
completedAt?: string | null;
|
|
2069
|
+
}
|
|
2070
|
+
/** Contacts sync status details. */
|
|
2071
|
+
export interface WhatsAppSyncContacts {
|
|
2072
|
+
status: WhatsAppSyncContactsStatus;
|
|
2073
|
+
/** Whether contacts sync can be initiated. */
|
|
2074
|
+
canSync: boolean;
|
|
2075
|
+
/** When the sync was last requested. */
|
|
2076
|
+
requestedAt?: string | null;
|
|
2077
|
+
}
|
|
2078
|
+
/** WhatsApp coexistence sync status. */
|
|
2079
|
+
export interface WhatsAppSyncStatus {
|
|
2080
|
+
/** Whether the account is in coexistence mode. */
|
|
2081
|
+
isCoexistence: boolean;
|
|
2082
|
+
/** WhatsApp account status. */
|
|
2083
|
+
status: WhatsAppSyncStatusStatus;
|
|
2084
|
+
history: WhatsAppSyncHistory;
|
|
2085
|
+
contacts: WhatsAppSyncContacts;
|
|
2086
|
+
}
|
|
2087
|
+
export type WhatsAppSyncStatusStatus = 'pending_verification' | 'pending_registration' | 'active' | 'disconnected' | 'error';
|
|
2088
|
+
export interface WhatsAppSyncStatusResponse {
|
|
2089
|
+
sync: WhatsAppSyncStatus;
|
|
2090
|
+
}
|
|
2091
|
+
export interface WhatsAppSyncStartResponse {
|
|
2092
|
+
/** Success message. */
|
|
2093
|
+
message: string;
|
|
2094
|
+
sync: WhatsAppSyncStatus;
|
|
2095
|
+
}
|
|
2096
|
+
/** LLM provider for the AI agent. */
|
|
2097
|
+
export type AgentProvider = 'openai' | 'anthropic' | 'google' | 'mistral' | 'zavu';
|
|
2098
|
+
/** Status of an agent execution. */
|
|
2099
|
+
export type AgentExecutionStatus = 'success' | 'error' | 'filtered' | 'rate_limited' | 'balance_insufficient';
|
|
2100
|
+
/** AI Agent configuration for a sender. */
|
|
2101
|
+
export interface Agent {
|
|
2102
|
+
id: string;
|
|
2103
|
+
/**
|
|
2104
|
+
* The sender the agent was created on, its primary. Absent on an agent created
|
|
2105
|
+
* with `POST /v1/agents`, which has no primary even after senders are connected to
|
|
2106
|
+
* it. `senderIds` lists every sender the agent answers on.
|
|
2107
|
+
*/
|
|
2108
|
+
senderId?: string;
|
|
2109
|
+
name: string;
|
|
2110
|
+
/** Whether the agent is active. */
|
|
2111
|
+
enabled: boolean;
|
|
2112
|
+
provider: AgentProvider;
|
|
2113
|
+
/** Model ID (e.g., gpt-4o-mini, claude-3-5-sonnet). */
|
|
2114
|
+
model: string;
|
|
2115
|
+
/** System prompt for the agent. */
|
|
2116
|
+
systemPrompt: string;
|
|
2117
|
+
/**
|
|
2118
|
+
* Number of previous messages to include as context.
|
|
2119
|
+
*
|
|
2120
|
+
* @defaultValue `10`
|
|
2121
|
+
*/
|
|
2122
|
+
contextWindowMessages?: number;
|
|
2123
|
+
/**
|
|
2124
|
+
* Whether to include contact metadata in context.
|
|
2125
|
+
*
|
|
2126
|
+
* @defaultValue `true`
|
|
2127
|
+
*/
|
|
2128
|
+
includeContactMetadata?: boolean;
|
|
2129
|
+
/** Maximum tokens for LLM response. */
|
|
2130
|
+
maxTokens?: number | null;
|
|
2131
|
+
/** LLM temperature (0-2). */
|
|
2132
|
+
temperature?: number | null;
|
|
2133
|
+
/** Channels that trigger the agent. */
|
|
2134
|
+
triggerOnChannels?: Array<string>;
|
|
2135
|
+
/** Message types that trigger the agent. */
|
|
2136
|
+
triggerOnMessageTypes?: Array<string>;
|
|
2137
|
+
stats?: AgentStatsTotals;
|
|
2138
|
+
createdAt: string;
|
|
2139
|
+
updatedAt: string;
|
|
2140
|
+
/**
|
|
2141
|
+
* Voice Agent configuration. When present and enabled, the agent can answer
|
|
2142
|
+
* inbound phone calls and place outbound calls with Zavu's managed voice pipeline.
|
|
2143
|
+
*/
|
|
2144
|
+
voice?: AgentVoiceConfig;
|
|
2145
|
+
/**
|
|
2146
|
+
* Senders this agent answers on. An agent can serve several; `senderId` remains
|
|
2147
|
+
* the primary one, for compatibility.
|
|
2148
|
+
*/
|
|
2149
|
+
senderIds?: Array<string>;
|
|
2150
|
+
}
|
|
2151
|
+
export interface AgentStatsTotals {
|
|
2152
|
+
totalInvocations?: number;
|
|
2153
|
+
totalTokensUsed?: number;
|
|
2154
|
+
/** Total cost in USD. */
|
|
2155
|
+
totalCost?: number;
|
|
2156
|
+
}
|
|
2157
|
+
export interface AgentCreateRequest {
|
|
2158
|
+
name: string;
|
|
2159
|
+
provider: AgentProvider;
|
|
2160
|
+
model: string;
|
|
2161
|
+
systemPrompt: string;
|
|
2162
|
+
/** API key for the LLM provider. Required unless provider is 'zavu'. */
|
|
2163
|
+
apiKey?: string;
|
|
2164
|
+
/** @defaultValue `10` */
|
|
2165
|
+
contextWindowMessages?: number;
|
|
2166
|
+
/** @defaultValue `true` */
|
|
2167
|
+
includeContactMetadata?: boolean;
|
|
2168
|
+
maxTokens?: number;
|
|
2169
|
+
temperature?: number;
|
|
2170
|
+
/** @defaultValue `["*"]` */
|
|
2171
|
+
triggerOnChannels?: Array<string>;
|
|
2172
|
+
/** @defaultValue `["text"]` */
|
|
2173
|
+
triggerOnMessageTypes?: Array<string>;
|
|
2174
|
+
/**
|
|
2175
|
+
* Voice Agent configuration. Enable this to let the agent answer and place phone
|
|
2176
|
+
* calls with Zavu's managed voice pipeline.
|
|
2177
|
+
*/
|
|
2178
|
+
voice?: AgentVoiceConfig;
|
|
2179
|
+
}
|
|
2180
|
+
export interface AgentUpdateRequest {
|
|
2181
|
+
name?: string;
|
|
2182
|
+
enabled?: boolean;
|
|
2183
|
+
provider?: AgentProvider;
|
|
2184
|
+
model?: string;
|
|
2185
|
+
systemPrompt?: string;
|
|
2186
|
+
/**
|
|
2187
|
+
* API key for the LLM provider, stored and attached to the agent. Send it with
|
|
2188
|
+
* `provider` when the agent does not already hold a key for that provider: an
|
|
2189
|
+
* update that would leave the agent on a key for a different provider is refused
|
|
2190
|
+
* with `400 invalid_request`, and one that leaves it with no key at all is refused
|
|
2191
|
+
* too. Moving to `zavu` needs no key.
|
|
2192
|
+
*/
|
|
2193
|
+
apiKey?: string;
|
|
2194
|
+
contextWindowMessages?: number;
|
|
2195
|
+
includeContactMetadata?: boolean;
|
|
2196
|
+
maxTokens?: number | null;
|
|
2197
|
+
temperature?: number | null;
|
|
2198
|
+
triggerOnChannels?: Array<string>;
|
|
2199
|
+
triggerOnMessageTypes?: Array<string>;
|
|
2200
|
+
/**
|
|
2201
|
+
* Voice Agent configuration. Patch this object to enable voice, change the
|
|
2202
|
+
* greeting, or adjust call limits.
|
|
2203
|
+
*/
|
|
2204
|
+
voice?: AgentVoiceConfig;
|
|
2205
|
+
}
|
|
2206
|
+
export interface AgentResponse {
|
|
2207
|
+
agent: Agent;
|
|
2208
|
+
}
|
|
2209
|
+
export interface AgentStats {
|
|
2210
|
+
totalInvocations: number;
|
|
2211
|
+
totalTokensUsed: number;
|
|
2212
|
+
/** Total cost in USD. */
|
|
2213
|
+
totalCost: number;
|
|
2214
|
+
/**
|
|
2215
|
+
* Successful executions among the agent's 100 most recent. Executions with status
|
|
2216
|
+
* `filtered` (messages the agent never ran on) are not counted here, in
|
|
2217
|
+
* `errorCount` or in `avgLatencyMs`.
|
|
2218
|
+
*/
|
|
2219
|
+
successCount: number;
|
|
2220
|
+
/** Failed executions among the agent's 100 most recent. */
|
|
2221
|
+
errorCount: number;
|
|
2222
|
+
/**
|
|
2223
|
+
* Average latency of the agent's 100 most recent executions, `filtered` excluded.
|
|
2224
|
+
* Null when there are none.
|
|
2225
|
+
*/
|
|
2226
|
+
avgLatencyMs?: number | null;
|
|
2227
|
+
}
|
|
2228
|
+
export interface AgentExecution {
|
|
2229
|
+
id: string;
|
|
2230
|
+
agentId: string;
|
|
2231
|
+
inboundMessageId?: string;
|
|
2232
|
+
responseMessageId?: string | null;
|
|
2233
|
+
responseText?: string | null;
|
|
2234
|
+
status: AgentExecutionStatus;
|
|
2235
|
+
errorMessage?: string | null;
|
|
2236
|
+
inputTokens: number;
|
|
2237
|
+
outputTokens: number;
|
|
2238
|
+
latencyMs: number;
|
|
2239
|
+
/** Cost in USD. */
|
|
2240
|
+
cost: number;
|
|
2241
|
+
createdAt: string;
|
|
2242
|
+
/**
|
|
2243
|
+
* Knowledge-base chunks retrieved for this answer. Zero on an agent that has
|
|
2244
|
+
* documents attached means the reply was not grounded in them, which is otherwise
|
|
2245
|
+
* indistinguishable from a correct answer in this record. Absent on executions
|
|
2246
|
+
* recorded before this field existed, which is not the same as zero.
|
|
2247
|
+
*/
|
|
2248
|
+
knowledgeChunksUsed?: number | null;
|
|
2249
|
+
/**
|
|
2250
|
+
* Tools the agent called while producing this reply. Zero on an agent that has
|
|
2251
|
+
* tools configured means it answered without calling any — the case where a
|
|
2252
|
+
* reply says it will look something up and nothing ever reaches your endpoint.
|
|
2253
|
+
* Absent on executions recorded before this field existed, which is not the same
|
|
2254
|
+
* as zero.
|
|
2255
|
+
*/
|
|
2256
|
+
toolCalls?: number | null;
|
|
2257
|
+
}
|
|
2258
|
+
/**
|
|
2259
|
+
* What starts a flow.
|
|
2260
|
+
*
|
|
2261
|
+
* - `keyword`: the message contains one of the words listed in `keywords`. Plain
|
|
2262
|
+
* substring matching, so a word inside another word still counts.
|
|
2263
|
+
* - `intent`: the message MEANS what `intent` describes, whatever words it uses.
|
|
2264
|
+
* - `always`: any message starts it.
|
|
2265
|
+
* - `manual`: reserved. Nothing starts a `manual` flow today — it is accepted
|
|
2266
|
+
* and stored, and no message or endpoint runs it.
|
|
2267
|
+
*/
|
|
2268
|
+
export type FlowTriggerType = 'keyword' | 'intent' | 'always' | 'manual';
|
|
2269
|
+
/** Type of flow step. */
|
|
2270
|
+
export type FlowStepType = 'message' | 'collect' | 'condition' | 'tool' | 'llm' | 'transfer';
|
|
2271
|
+
export interface FlowTrigger {
|
|
2272
|
+
type: FlowTriggerType;
|
|
2273
|
+
/**
|
|
2274
|
+
* Words that start the flow, for `keyword` triggers. Matched as substrings,
|
|
2275
|
+
* case-insensitively, against the whole message: a flow on `info` also starts on
|
|
2276
|
+
* "no quiero info". Use `intent` when that matters.
|
|
2277
|
+
*/
|
|
2278
|
+
keywords?: Array<string>;
|
|
2279
|
+
/**
|
|
2280
|
+
* One plain sentence describing what the contact wants, for `intent` triggers. Any
|
|
2281
|
+
* language.
|
|
2282
|
+
*
|
|
2283
|
+
* The message is judged for meaning, not for words, so "kiero saber el presio"
|
|
2284
|
+
* starts a flow whose intent is "quiere saber precios o cotizar", and "no quiero
|
|
2285
|
+
* info de precios" starts nothing.
|
|
2286
|
+
*
|
|
2287
|
+
* A `keyword` or `always` flow with a higher `priority` is matched first and wins.
|
|
2288
|
+
* At most 12 intent flows are considered per message, highest priority first. When
|
|
2289
|
+
* the classification is unavailable or uncertain, the message is handled as if no
|
|
2290
|
+
* intent matched, so a flow never starts on a guess.
|
|
2291
|
+
*/
|
|
2292
|
+
intent?: string;
|
|
2293
|
+
}
|
|
2294
|
+
export interface FlowStep {
|
|
2295
|
+
/** Unique step identifier. */
|
|
2296
|
+
id: string;
|
|
2297
|
+
type: FlowStepType;
|
|
2298
|
+
/** Step configuration (varies by type). */
|
|
2299
|
+
config: {
|
|
2300
|
+
[key: string]: unknown;
|
|
2301
|
+
};
|
|
2302
|
+
/** ID of the next step to execute. */
|
|
2303
|
+
nextStepId?: string | null;
|
|
2304
|
+
}
|
|
2305
|
+
export interface AgentFlow {
|
|
2306
|
+
id: string;
|
|
2307
|
+
agentId: string;
|
|
2308
|
+
name: string;
|
|
2309
|
+
description?: string | null;
|
|
2310
|
+
trigger: FlowTrigger;
|
|
2311
|
+
steps: Array<FlowStep>;
|
|
2312
|
+
enabled: boolean;
|
|
2313
|
+
/** Priority when multiple flows match (higher = more priority). */
|
|
2314
|
+
priority: number;
|
|
2315
|
+
createdAt: string;
|
|
2316
|
+
updatedAt: string;
|
|
2317
|
+
}
|
|
2318
|
+
export interface FlowCreateRequest {
|
|
2319
|
+
name: string;
|
|
2320
|
+
description?: string;
|
|
2321
|
+
trigger: FlowTrigger;
|
|
2322
|
+
/**
|
|
2323
|
+
* The first step runs on the message that started the flow. It cannot be a
|
|
2324
|
+
* `condition` without a `defaultGoto`: nothing has been collected yet, so its
|
|
2325
|
+
* conditions evaluate the same way on every message, and the request is refused
|
|
2326
|
+
* with `400 invalid_request`.
|
|
2327
|
+
*
|
|
2328
|
+
* A flow that ends on that first message without replying hands the message to the
|
|
2329
|
+
* agent, which answers it. A `transfer` step stays silent.
|
|
2330
|
+
*/
|
|
2331
|
+
steps: Array<FlowStep>;
|
|
2332
|
+
/** @defaultValue `false` */
|
|
2333
|
+
enabled?: boolean;
|
|
2334
|
+
/** @defaultValue `0` */
|
|
2335
|
+
priority?: number;
|
|
2336
|
+
}
|
|
2337
|
+
export interface FlowUpdateRequest {
|
|
2338
|
+
name?: string;
|
|
2339
|
+
description?: string;
|
|
2340
|
+
trigger?: FlowTrigger;
|
|
2341
|
+
/**
|
|
2342
|
+
* The first step runs on the message that started the flow. It cannot be a
|
|
2343
|
+
* `condition` without a `defaultGoto`: nothing has been collected yet, so its
|
|
2344
|
+
* conditions evaluate the same way on every message, and the request is refused
|
|
2345
|
+
* with `400 invalid_request`.
|
|
2346
|
+
*
|
|
2347
|
+
* A flow that ends on that first message without replying hands the message to the
|
|
2348
|
+
* agent, which answers it. A `transfer` step stays silent.
|
|
2349
|
+
*/
|
|
2350
|
+
steps?: Array<FlowStep>;
|
|
2351
|
+
enabled?: boolean;
|
|
2352
|
+
priority?: number;
|
|
2353
|
+
}
|
|
2354
|
+
export interface FlowResponse {
|
|
2355
|
+
flow: AgentFlow;
|
|
2356
|
+
}
|
|
2357
|
+
export interface FlowDuplicateRequest {
|
|
2358
|
+
newName: string;
|
|
2359
|
+
}
|
|
2360
|
+
export interface ToolParameters {
|
|
2361
|
+
type: 'object';
|
|
2362
|
+
properties: {
|
|
2363
|
+
[key: string]: ToolParametersPropertiesValue;
|
|
2364
|
+
};
|
|
2365
|
+
required: Array<string>;
|
|
2366
|
+
}
|
|
2367
|
+
export interface ToolParametersPropertiesValue {
|
|
2368
|
+
type?: string;
|
|
2369
|
+
description?: string;
|
|
2370
|
+
}
|
|
2371
|
+
export interface AgentTool {
|
|
2372
|
+
id: string;
|
|
2373
|
+
agentId: string;
|
|
2374
|
+
name: string;
|
|
2375
|
+
/** Description for the LLM to understand when to use this tool. */
|
|
2376
|
+
description: string;
|
|
2377
|
+
parameters: ToolParameters;
|
|
2378
|
+
/** HTTPS URL to call when the tool is executed. */
|
|
2379
|
+
webhookUrl: string;
|
|
2380
|
+
enabled: boolean;
|
|
2381
|
+
createdAt: string;
|
|
2382
|
+
updatedAt: string;
|
|
2383
|
+
/**
|
|
2384
|
+
* Signing secret for this tool's webhook. **Returned only when the tool is
|
|
2385
|
+
* created**, never on a later read.
|
|
2386
|
+
*
|
|
2387
|
+
* Zavu generates one if you do not supply it, and signs every call to this tool
|
|
2388
|
+
* with it: `X-Zavu-Signature: <hex>`, the HMAC-SHA256 of the request body. Verify
|
|
2389
|
+
* it before trusting the call. Lost it? Rotate with `POST
|
|
2390
|
+
* /v1/senders/{senderId}/agent/tools/{toolId}/webhook/secret`.
|
|
2391
|
+
*/
|
|
2392
|
+
webhookSecret?: string;
|
|
2393
|
+
}
|
|
2394
|
+
export interface ToolCreateRequest {
|
|
2395
|
+
name: string;
|
|
2396
|
+
description: string;
|
|
2397
|
+
parameters: ToolParameters;
|
|
2398
|
+
/** Must be HTTPS. */
|
|
2399
|
+
webhookUrl: string;
|
|
2400
|
+
/**
|
|
2401
|
+
* Signing secret for the webhook. Optional: Zavu generates one when omitted and
|
|
2402
|
+
* returns it on this response only. Supply your own if you already have a secret
|
|
2403
|
+
* you want reused.
|
|
2404
|
+
*/
|
|
2405
|
+
webhookSecret?: string;
|
|
2406
|
+
/** @defaultValue `true` */
|
|
2407
|
+
enabled?: boolean;
|
|
2408
|
+
}
|
|
2409
|
+
export interface ToolUpdateRequest {
|
|
2410
|
+
name?: string;
|
|
2411
|
+
description?: string;
|
|
2412
|
+
parameters?: ToolParameters;
|
|
2413
|
+
webhookUrl?: string;
|
|
2414
|
+
webhookSecret?: string | null;
|
|
2415
|
+
enabled?: boolean;
|
|
2416
|
+
}
|
|
2417
|
+
export interface ToolResponse {
|
|
2418
|
+
tool: AgentTool;
|
|
2419
|
+
}
|
|
2420
|
+
export interface ToolTestRequest {
|
|
2421
|
+
/** Parameters to pass to the tool for testing. */
|
|
2422
|
+
testParams: {
|
|
2423
|
+
[key: string]: unknown;
|
|
2424
|
+
};
|
|
2425
|
+
}
|
|
2426
|
+
/**
|
|
2427
|
+
* One run of a tool triggered from the test endpoint. Recorded so a test is
|
|
2428
|
+
* verifiable after the fact rather than only visible in the response.
|
|
2429
|
+
*/
|
|
2430
|
+
export interface AgentToolTestRun {
|
|
2431
|
+
id: string;
|
|
2432
|
+
toolId: string;
|
|
2433
|
+
/** The parameters the tool was called with. */
|
|
2434
|
+
params?: {
|
|
2435
|
+
[key: string]: unknown;
|
|
2436
|
+
};
|
|
2437
|
+
/**
|
|
2438
|
+
* Whether the tool returned without error. A tool that answered with a non-2xx
|
|
2439
|
+
* status is a failed run, not an error of this endpoint.
|
|
2440
|
+
*/
|
|
2441
|
+
success: boolean;
|
|
2442
|
+
/**
|
|
2443
|
+
* HTTP status the tool's webhook returned. Absent for tools that do not go over
|
|
2444
|
+
* HTTP.
|
|
2445
|
+
*/
|
|
2446
|
+
statusCode?: number | null;
|
|
2447
|
+
/** The tool's response body, truncated. */
|
|
2448
|
+
response?: string | null;
|
|
2449
|
+
/** Why the run failed, when it did. */
|
|
2450
|
+
error?: string | null;
|
|
2451
|
+
durationMs: number;
|
|
2452
|
+
createdAt: string;
|
|
2453
|
+
}
|
|
2454
|
+
export interface ToolTestResponse {
|
|
2455
|
+
run: AgentToolTestRun;
|
|
2456
|
+
}
|
|
2457
|
+
export interface AgentKnowledgeBase {
|
|
2458
|
+
id: string;
|
|
2459
|
+
agentId: string;
|
|
2460
|
+
name: string;
|
|
2461
|
+
description?: string | null;
|
|
2462
|
+
documentCount: number;
|
|
2463
|
+
totalChunks: number;
|
|
2464
|
+
createdAt: string;
|
|
2465
|
+
updatedAt: string;
|
|
2466
|
+
}
|
|
2467
|
+
export interface KnowledgeBaseCreateRequest {
|
|
2468
|
+
name: string;
|
|
2469
|
+
description?: string;
|
|
2470
|
+
}
|
|
2471
|
+
export interface KnowledgeBaseUpdateRequest {
|
|
2472
|
+
name?: string;
|
|
2473
|
+
description?: string | null;
|
|
2474
|
+
}
|
|
2475
|
+
export interface KnowledgeBaseResponse {
|
|
2476
|
+
knowledgeBase: AgentKnowledgeBase;
|
|
2477
|
+
}
|
|
2478
|
+
export interface AgentDocument {
|
|
2479
|
+
id: string;
|
|
2480
|
+
knowledgeBaseId: string;
|
|
2481
|
+
title: string;
|
|
2482
|
+
/** Length of the document content in characters. */
|
|
2483
|
+
contentLength: number;
|
|
2484
|
+
/** Number of chunks created from this document. */
|
|
2485
|
+
chunkCount: number;
|
|
2486
|
+
/** Whether the document has been processed for RAG. */
|
|
2487
|
+
isProcessed: boolean;
|
|
2488
|
+
createdAt: string;
|
|
2489
|
+
updatedAt: string;
|
|
2490
|
+
}
|
|
2491
|
+
export interface DocumentCreateRequest {
|
|
2492
|
+
title: string;
|
|
2493
|
+
content: string;
|
|
2494
|
+
}
|
|
2495
|
+
export interface DocumentResponse {
|
|
2496
|
+
document: AgentDocument;
|
|
2497
|
+
}
|
|
2498
|
+
/** Type of requirement field. */
|
|
2499
|
+
export type RequirementFieldType = 'textual' | 'address' | 'document' | 'action';
|
|
2500
|
+
/** Acceptance criteria for a requirement. */
|
|
2501
|
+
export interface RequirementAcceptanceCriteria {
|
|
2502
|
+
minLength?: number | null;
|
|
2503
|
+
maxLength?: number | null;
|
|
2504
|
+
allowedValues?: Array<string> | null;
|
|
2505
|
+
regexPattern?: string | null;
|
|
2506
|
+
}
|
|
2507
|
+
/** A specific requirement type within a requirement group. */
|
|
2508
|
+
export interface RequirementType {
|
|
2509
|
+
/** Send this as `requirementType` in `regulatoryRequirements` when purchasing. */
|
|
2510
|
+
id: string;
|
|
2511
|
+
name: string;
|
|
2512
|
+
description: string;
|
|
2513
|
+
type: RequirementFieldType;
|
|
2514
|
+
example?: string | null;
|
|
2515
|
+
acceptanceCriteria?: RequirementAcceptanceCriteria;
|
|
2516
|
+
}
|
|
2517
|
+
/**
|
|
2518
|
+
* The requirements for ordering a number: for a country and number type, or for
|
|
2519
|
+
* one specific number when requested with `phoneNumber` (then `id` is that phone
|
|
2520
|
+
* number and `countryCode` is taken from it).
|
|
2521
|
+
*/
|
|
2522
|
+
export interface Requirement {
|
|
2523
|
+
id: string;
|
|
2524
|
+
countryCode: string;
|
|
2525
|
+
phoneNumberType: string;
|
|
2526
|
+
action: string;
|
|
2527
|
+
requirementTypes: Array<RequirementType>;
|
|
2528
|
+
}
|
|
2529
|
+
export type AddressStatus = 'pending' | 'verified' | 'rejected';
|
|
2530
|
+
/** A regulatory address for phone number requirements. */
|
|
2531
|
+
export interface Address {
|
|
2532
|
+
id: string;
|
|
2533
|
+
firstName?: string | null;
|
|
2534
|
+
lastName?: string | null;
|
|
2535
|
+
businessName?: string | null;
|
|
2536
|
+
streetAddress: string;
|
|
2537
|
+
extendedAddress?: string | null;
|
|
2538
|
+
locality: string;
|
|
2539
|
+
administrativeArea?: string | null;
|
|
2540
|
+
postalCode: string;
|
|
2541
|
+
countryCode: string;
|
|
2542
|
+
status: AddressStatus;
|
|
2543
|
+
createdAt: string;
|
|
2544
|
+
updatedAt?: string;
|
|
2545
|
+
}
|
|
2546
|
+
/**
|
|
2547
|
+
* A regulatory address. `firstName` and `lastName` are required: the carrier will
|
|
2548
|
+
* not register an address without a named person. Requests that omit them are
|
|
2549
|
+
* refused with `400 invalid_request`, and the SDKs still type them as optional
|
|
2550
|
+
* until their next release.
|
|
2551
|
+
*/
|
|
2552
|
+
export interface AddressCreateRequest {
|
|
2553
|
+
/** First name of the person the address is registered to. */
|
|
2554
|
+
firstName: string;
|
|
2555
|
+
/** Last name of the person the address is registered to. */
|
|
2556
|
+
lastName: string;
|
|
2557
|
+
/**
|
|
2558
|
+
* Business name, when the address belongs to a business. Defaults to the person's
|
|
2559
|
+
* full name.
|
|
2560
|
+
*/
|
|
2561
|
+
businessName?: string;
|
|
2562
|
+
streetAddress: string;
|
|
2563
|
+
extendedAddress?: string;
|
|
2564
|
+
locality: string;
|
|
2565
|
+
administrativeArea?: string;
|
|
2566
|
+
postalCode: string;
|
|
2567
|
+
countryCode: string;
|
|
2568
|
+
}
|
|
2569
|
+
export interface AddressResponse {
|
|
2570
|
+
address: Address;
|
|
2571
|
+
}
|
|
2572
|
+
export type RegulatoryDocumentStatus = 'pending' | 'uploaded' | 'verified' | 'rejected';
|
|
2573
|
+
export type RegulatoryDocumentType = 'passport' | 'national_id' | 'drivers_license' | 'utility_bill' | 'tax_id' | 'business_registration' | 'proof_of_address' | 'other';
|
|
2574
|
+
/** A regulatory document for phone number requirements. */
|
|
2575
|
+
export interface RegulatoryDocument {
|
|
2576
|
+
id: string;
|
|
2577
|
+
name: string;
|
|
2578
|
+
documentType: RegulatoryDocumentType;
|
|
2579
|
+
mimeType?: string;
|
|
2580
|
+
fileSize?: number;
|
|
2581
|
+
status: RegulatoryDocumentStatus;
|
|
2582
|
+
rejectionReason?: string | null;
|
|
2583
|
+
createdAt: string;
|
|
2584
|
+
updatedAt?: string;
|
|
2585
|
+
}
|
|
2586
|
+
export interface RegulatoryDocumentCreateRequest {
|
|
2587
|
+
name: string;
|
|
2588
|
+
documentType: RegulatoryDocumentType;
|
|
2589
|
+
/** Storage ID from the upload-url endpoint. */
|
|
2590
|
+
storageId: string;
|
|
2591
|
+
mimeType: string;
|
|
2592
|
+
fileSize: number;
|
|
2593
|
+
}
|
|
2594
|
+
export interface RegulatoryDocumentResponse {
|
|
2595
|
+
document: RegulatoryDocument;
|
|
2596
|
+
}
|
|
2597
|
+
export interface UploadUrlResponse {
|
|
2598
|
+
/** Pre-signed URL for uploading the file. */
|
|
2599
|
+
uploadUrl: string;
|
|
2600
|
+
}
|
|
2601
|
+
/** Status of a verified URL. */
|
|
2602
|
+
export type VerifiedUrlStatus = 'pending' | 'approved' | 'rejected' | 'escalated' | 'malicious';
|
|
2603
|
+
/** How the URL was approved or rejected. */
|
|
2604
|
+
export type VerifiedUrlApprovalType = 'manual' | 'auto_web_risk';
|
|
2605
|
+
export interface VerifiedUrl {
|
|
2606
|
+
id: string;
|
|
2607
|
+
/** The verified URL. */
|
|
2608
|
+
url: string;
|
|
2609
|
+
/** Domain extracted from the URL. */
|
|
2610
|
+
domain: string;
|
|
2611
|
+
status: VerifiedUrlStatus;
|
|
2612
|
+
approvalType?: VerifiedUrlApprovalType;
|
|
2613
|
+
createdAt: string;
|
|
2614
|
+
updatedAt?: string;
|
|
2615
|
+
}
|
|
2616
|
+
export interface VerifiedUrlSubmitRequest {
|
|
2617
|
+
/** The URL to submit for verification. */
|
|
2618
|
+
url: string;
|
|
2619
|
+
}
|
|
2620
|
+
export interface VerifiedUrlResponse {
|
|
2621
|
+
url: VerifiedUrl;
|
|
2622
|
+
}
|
|
2623
|
+
/**
|
|
2624
|
+
* `active` and `inactive` are set with PATCH. `pending_deletion` is read-only: the
|
|
2625
|
+
* sub-account was deactivated with DELETE, its API keys are revoked, and it is
|
|
2626
|
+
* removed after 14 days.
|
|
2627
|
+
*/
|
|
2628
|
+
export type SubAccountStatus = 'active' | 'inactive' | 'pending_deletion';
|
|
2629
|
+
export interface SubAccount {
|
|
2630
|
+
id: string;
|
|
2631
|
+
name: string;
|
|
2632
|
+
/** External reference ID set by the parent account. */
|
|
2633
|
+
externalId?: string | null;
|
|
2634
|
+
status: SubAccountStatus;
|
|
2635
|
+
/** Total amount spent by this sub-account in cents. */
|
|
2636
|
+
totalSpent: number;
|
|
2637
|
+
/**
|
|
2638
|
+
* Spending cap in cents. When reached, messages from this sub-account will be
|
|
2639
|
+
* blocked.
|
|
2640
|
+
*/
|
|
2641
|
+
creditLimit?: number | null;
|
|
2642
|
+
metadata?: {
|
|
2643
|
+
[key: string]: unknown;
|
|
2644
|
+
} | null;
|
|
2645
|
+
/** API key for the sub-account. Only returned on creation. */
|
|
2646
|
+
apiKey?: string;
|
|
2647
|
+
createdAt: string;
|
|
2648
|
+
}
|
|
2649
|
+
export interface SubAccountCreateRequest {
|
|
2650
|
+
/** Name of the sub-account. */
|
|
2651
|
+
name: string;
|
|
2652
|
+
/** External reference ID for your own tracking. */
|
|
2653
|
+
externalId?: string;
|
|
2654
|
+
/**
|
|
2655
|
+
* Spending cap in cents. When reached, messages from this sub-account will be
|
|
2656
|
+
* blocked. Omit or set to 0 for no limit.
|
|
2657
|
+
*/
|
|
2658
|
+
creditLimit?: number;
|
|
2659
|
+
metadata?: {
|
|
2660
|
+
[key: string]: unknown;
|
|
2661
|
+
};
|
|
2662
|
+
}
|
|
2663
|
+
export interface SubAccountUpdateRequest {
|
|
2664
|
+
name?: string;
|
|
2665
|
+
externalId?: string;
|
|
2666
|
+
creditLimit?: number | null;
|
|
2667
|
+
metadata?: {
|
|
2668
|
+
[key: string]: unknown;
|
|
2669
|
+
};
|
|
2670
|
+
status?: SubAccountStatus;
|
|
2671
|
+
}
|
|
2672
|
+
export interface SubAccountResponse {
|
|
2673
|
+
subAccount: SubAccount;
|
|
2674
|
+
}
|
|
2675
|
+
export interface BalanceResponse {
|
|
2676
|
+
/** Team balance in cents. All charges are billed to the parent team. */
|
|
2677
|
+
balance: number;
|
|
2678
|
+
currency: string;
|
|
2679
|
+
/** Spending cap in cents (only for sub-accounts). */
|
|
2680
|
+
creditLimit?: number | null;
|
|
2681
|
+
/** Total amount spent by this sub-account in cents (only for sub-accounts). */
|
|
2682
|
+
totalSpent?: number | null;
|
|
2683
|
+
/** Whether this API key belongs to a sub-account. */
|
|
2684
|
+
isSubAccount?: boolean;
|
|
2685
|
+
}
|
|
2686
|
+
export interface SubAccountApiKey {
|
|
2687
|
+
id: string;
|
|
2688
|
+
name: string;
|
|
2689
|
+
/** Full API key. Only returned on creation. */
|
|
2690
|
+
key?: string;
|
|
2691
|
+
/** First characters of the key for identification. */
|
|
2692
|
+
keyPrefix: string;
|
|
2693
|
+
environment: SubAccountApiKeyEnvironment;
|
|
2694
|
+
permissions?: Array<string>;
|
|
2695
|
+
lastUsedAt?: number | null;
|
|
2696
|
+
revokedAt?: number | null;
|
|
2697
|
+
createdAt: number;
|
|
2698
|
+
}
|
|
2699
|
+
export type SubAccountApiKeyEnvironment = 'live' | 'test';
|
|
2700
|
+
export interface SubAccountApiKeyCreateRequest {
|
|
2701
|
+
name: string;
|
|
2702
|
+
/** @defaultValue `"live"` */
|
|
2703
|
+
environment?: SubAccountApiKeyCreateRequestEnvironment;
|
|
2704
|
+
permissions?: Array<string>;
|
|
2705
|
+
}
|
|
2706
|
+
export type SubAccountApiKeyCreateRequestEnvironment = 'live' | 'test';
|
|
2707
|
+
/** Business entity type for 10DLC brand registration. */
|
|
2708
|
+
export type TenDlcEntityType = 'PRIVATE_PROFIT' | 'PUBLIC_PROFIT' | 'NON_PROFIT' | 'GOVERNMENT' | 'SOLE_PROPRIETOR';
|
|
2709
|
+
/**
|
|
2710
|
+
* Status of a 10DLC brand registration.
|
|
2711
|
+
*
|
|
2712
|
+
* - `draft`: created, not yet submitted to the carrier.
|
|
2713
|
+
* - `pending`: submitted, awaiting the carrier's answer.
|
|
2714
|
+
* - `verified`: the carrier registered the brand AND verified the business behind
|
|
2715
|
+
* it.
|
|
2716
|
+
* - `unverified`: the carrier registered the brand but did not verify the business
|
|
2717
|
+
* — the registration exists, the identity check did not pass or has not been
|
|
2718
|
+
* resolved. Campaigns are allowed, with lower daily limits. Read
|
|
2719
|
+
* `identityStatus` for the carrier's own wording.
|
|
2720
|
+
* - `rejected`: refused by the carrier.
|
|
2721
|
+
* - `failed`: the registration never reached the carrier; the fee is refunded.
|
|
2722
|
+
*/
|
|
2723
|
+
export type TenDlcBrandStatus = 'draft' | 'pending' | 'verified' | 'unverified' | 'rejected' | 'failed';
|
|
2724
|
+
export interface TenDlcBrand {
|
|
2725
|
+
id: string;
|
|
2726
|
+
entityType: TenDlcEntityType;
|
|
2727
|
+
/** Display name of the brand. */
|
|
2728
|
+
displayName: string;
|
|
2729
|
+
/** Legal company name. */
|
|
2730
|
+
companyName?: string | null;
|
|
2731
|
+
/** Employer Identification Number (EIN). */
|
|
2732
|
+
ein?: string | null;
|
|
2733
|
+
firstName?: string | null;
|
|
2734
|
+
lastName?: string | null;
|
|
2735
|
+
email: string;
|
|
2736
|
+
/** Contact phone number in E.164 format. */
|
|
2737
|
+
phone: string;
|
|
2738
|
+
street: string;
|
|
2739
|
+
city: string;
|
|
2740
|
+
state: string;
|
|
2741
|
+
postalCode: string;
|
|
2742
|
+
/** Two-letter ISO country code. */
|
|
2743
|
+
country: string;
|
|
2744
|
+
website?: string | null;
|
|
2745
|
+
/** Industry vertical. */
|
|
2746
|
+
vertical: string;
|
|
2747
|
+
stockSymbol?: string | null;
|
|
2748
|
+
stockExchange?: string | null;
|
|
2749
|
+
status: TenDlcBrandStatus;
|
|
2750
|
+
/**
|
|
2751
|
+
* The carrier's raw identity verdict on the business, as the carrier spells it
|
|
2752
|
+
* (`VERIFIED`, `VETTED_VERIFIED`, `SELF_DECLARED`, `UNVERIFIED`). Null while the
|
|
2753
|
+
* identity has not been resolved — which is not the same as verified, and is why
|
|
2754
|
+
* such a brand reports `status: unverified`.
|
|
2755
|
+
*/
|
|
2756
|
+
identityStatus?: string | null;
|
|
2757
|
+
/** Trust score assigned by TCR after vetting. */
|
|
2758
|
+
brandScore?: number | null;
|
|
2759
|
+
brandRelationship?: string | null;
|
|
2760
|
+
/** Reason for rejection, if applicable. */
|
|
2761
|
+
failureReason?: string | null;
|
|
2762
|
+
submittedAt?: string | null;
|
|
2763
|
+
verifiedAt?: string | null;
|
|
2764
|
+
createdAt: string;
|
|
2765
|
+
updatedAt: string;
|
|
2766
|
+
}
|
|
2767
|
+
export interface TenDlcBrandCreateRequest {
|
|
2768
|
+
entityType: TenDlcEntityType;
|
|
2769
|
+
/** Display name of the brand. */
|
|
2770
|
+
displayName: string;
|
|
2771
|
+
/** Legal company name. */
|
|
2772
|
+
companyName?: string;
|
|
2773
|
+
/** Employer Identification Number (format: XX-XXXXXXX). */
|
|
2774
|
+
ein?: string;
|
|
2775
|
+
firstName?: string;
|
|
2776
|
+
lastName?: string;
|
|
2777
|
+
email: string;
|
|
2778
|
+
/** Contact phone in E.164 format. */
|
|
2779
|
+
phone: string;
|
|
2780
|
+
street: string;
|
|
2781
|
+
city: string;
|
|
2782
|
+
state: string;
|
|
2783
|
+
postalCode: string;
|
|
2784
|
+
/** Two-letter ISO country code. */
|
|
2785
|
+
country: string;
|
|
2786
|
+
website?: string;
|
|
2787
|
+
/** Industry vertical. */
|
|
2788
|
+
vertical: string;
|
|
2789
|
+
stockSymbol?: string;
|
|
2790
|
+
stockExchange?: string;
|
|
2791
|
+
}
|
|
2792
|
+
export interface TenDlcBrandUpdateRequest {
|
|
2793
|
+
entityType?: TenDlcEntityType;
|
|
2794
|
+
displayName?: string;
|
|
2795
|
+
companyName?: string;
|
|
2796
|
+
ein?: string;
|
|
2797
|
+
firstName?: string;
|
|
2798
|
+
lastName?: string;
|
|
2799
|
+
email?: string;
|
|
2800
|
+
phone?: string;
|
|
2801
|
+
street?: string;
|
|
2802
|
+
city?: string;
|
|
2803
|
+
state?: string;
|
|
2804
|
+
postalCode?: string;
|
|
2805
|
+
country?: string;
|
|
2806
|
+
website?: string;
|
|
2807
|
+
vertical?: string;
|
|
2808
|
+
stockSymbol?: string;
|
|
2809
|
+
stockExchange?: string;
|
|
2810
|
+
}
|
|
2811
|
+
export interface TenDlcBrandResponse {
|
|
2812
|
+
brand: TenDlcBrand;
|
|
2813
|
+
}
|
|
2814
|
+
/**
|
|
2815
|
+
* Status of a 10DLC campaign registration.
|
|
2816
|
+
*
|
|
2817
|
+
* - `draft`: created, not yet submitted.
|
|
2818
|
+
* - `pending`: submitted, awaiting the carriers. Re-read from the carrier every 30
|
|
2819
|
+
* minutes, so it moves on its own.
|
|
2820
|
+
* - `approved`: SMS to +1 numbers can go out from numbers assigned to it. The
|
|
2821
|
+
* monthly fee is charged while it is approved.
|
|
2822
|
+
* - `rejected`: refused by the carriers. The one-time registration fee is
|
|
2823
|
+
* refunded.
|
|
2824
|
+
* - `failed`: the registration did not reach the carriers. The fee is refunded.
|
|
2825
|
+
* - `expired`: was approved and has lapsed.
|
|
2826
|
+
*/
|
|
2827
|
+
export type TenDlcCampaignStatus = 'draft' | 'pending' | 'approved' | 'rejected' | 'expired' | 'failed';
|
|
2828
|
+
export interface TenDlcCampaign {
|
|
2829
|
+
id: string;
|
|
2830
|
+
/** ID of the brand this campaign belongs to. */
|
|
2831
|
+
brandId: string;
|
|
2832
|
+
name: string;
|
|
2833
|
+
/** Campaign use case type. */
|
|
2834
|
+
useCase: string;
|
|
2835
|
+
subUseCases?: Array<string> | null;
|
|
2836
|
+
/** Description of the messaging campaign. */
|
|
2837
|
+
description: string;
|
|
2838
|
+
/** Sample messages representative of campaign content. */
|
|
2839
|
+
sampleMessages: Array<string>;
|
|
2840
|
+
subscriberOptIn: boolean;
|
|
2841
|
+
subscriberOptOut: boolean;
|
|
2842
|
+
subscriberHelp: boolean;
|
|
2843
|
+
numberPooling: boolean;
|
|
2844
|
+
directLending: boolean;
|
|
2845
|
+
embeddedLink: boolean;
|
|
2846
|
+
embeddedPhone: boolean;
|
|
2847
|
+
affiliateMarketing: boolean;
|
|
2848
|
+
ageGated: boolean;
|
|
2849
|
+
messageFlow?: string | null;
|
|
2850
|
+
helpMessage?: string | null;
|
|
2851
|
+
optInKeywords?: Array<string> | null;
|
|
2852
|
+
optOutKeywords?: Array<string> | null;
|
|
2853
|
+
status: TenDlcCampaignStatus;
|
|
2854
|
+
/** Daily message limit based on brand trust score. */
|
|
2855
|
+
dailyLimit?: number | null;
|
|
2856
|
+
failureReason?: string | null;
|
|
2857
|
+
/** One-time registration cost in cents. */
|
|
2858
|
+
registrationCostCents?: number | null;
|
|
2859
|
+
/** Recurring monthly fee in cents. */
|
|
2860
|
+
monthlyFeeCents?: number | null;
|
|
2861
|
+
submittedAt?: string | null;
|
|
2862
|
+
approvedAt?: string | null;
|
|
2863
|
+
createdAt: string;
|
|
2864
|
+
updatedAt: string;
|
|
2865
|
+
}
|
|
2866
|
+
export interface TenDlcCampaignCreateRequest {
|
|
2867
|
+
/** ID of the brand to create this campaign under. */
|
|
2868
|
+
brandId: string;
|
|
2869
|
+
name: string;
|
|
2870
|
+
/** Campaign use case (e.g., ACCOUNT_NOTIFICATION, MARKETING, 2FA). */
|
|
2871
|
+
useCase: string;
|
|
2872
|
+
subUseCases?: Array<string>;
|
|
2873
|
+
description: string;
|
|
2874
|
+
sampleMessages: Array<string>;
|
|
2875
|
+
subscriberOptIn: boolean;
|
|
2876
|
+
subscriberOptOut: boolean;
|
|
2877
|
+
subscriberHelp: boolean;
|
|
2878
|
+
numberPooling: boolean;
|
|
2879
|
+
directLending: boolean;
|
|
2880
|
+
embeddedLink: boolean;
|
|
2881
|
+
embeddedPhone: boolean;
|
|
2882
|
+
affiliateMarketing: boolean;
|
|
2883
|
+
ageGated: boolean;
|
|
2884
|
+
messageFlow?: string;
|
|
2885
|
+
helpMessage?: string;
|
|
2886
|
+
optInKeywords?: Array<string>;
|
|
2887
|
+
optOutKeywords?: Array<string>;
|
|
2888
|
+
}
|
|
2889
|
+
export interface TenDlcCampaignUpdateRequest {
|
|
2890
|
+
name?: string;
|
|
2891
|
+
description?: string;
|
|
2892
|
+
sampleMessages?: Array<string>;
|
|
2893
|
+
messageFlow?: string;
|
|
2894
|
+
helpMessage?: string;
|
|
2895
|
+
optInKeywords?: Array<string>;
|
|
2896
|
+
optOutKeywords?: Array<string>;
|
|
2897
|
+
}
|
|
2898
|
+
export interface TenDlcCampaignResponse {
|
|
2899
|
+
campaign: TenDlcCampaign;
|
|
2900
|
+
}
|
|
2901
|
+
export interface TenDlcPhoneNumberAssignment {
|
|
2902
|
+
id: string;
|
|
2903
|
+
campaignId: string;
|
|
2904
|
+
phoneNumberId: string;
|
|
2905
|
+
/**
|
|
2906
|
+
* Assignment status. `pending`: sent to the carrier, not confirmed yet. `active`:
|
|
2907
|
+
* the number is on the campaign and can send. `failed`: the carrier refused it;
|
|
2908
|
+
* see `failureReason`. The number is free to be assigned again.
|
|
2909
|
+
*/
|
|
2910
|
+
status: TenDlcPhoneNumberAssignmentStatus;
|
|
2911
|
+
failureReason?: string | null;
|
|
2912
|
+
assignedAt?: string | null;
|
|
2913
|
+
createdAt: string;
|
|
2914
|
+
updatedAt: string;
|
|
2915
|
+
}
|
|
2916
|
+
export type TenDlcPhoneNumberAssignmentStatus = 'pending' | 'active' | 'failed';
|
|
2917
|
+
export interface TenDlcPhoneNumberAssignRequest {
|
|
2918
|
+
/** ID of the phone number to assign. */
|
|
2919
|
+
phoneNumberId: string;
|
|
2920
|
+
}
|
|
2921
|
+
export interface TenDlcAssignmentResponse {
|
|
2922
|
+
assignment: TenDlcPhoneNumberAssignment;
|
|
2923
|
+
}
|
|
2924
|
+
/** Lifecycle status of a Zavu Function. */
|
|
2925
|
+
export type ZavuFunctionStatus = 'draft' | 'bundling' | 'deploying' | 'active' | 'failed' | 'disabled';
|
|
2926
|
+
/** Runtime the function is deployed on. */
|
|
2927
|
+
export type ZavuFunctionRuntime = 'nodejs24';
|
|
2928
|
+
/**
|
|
2929
|
+
* A Zavu Function — user-supplied TypeScript that runs in Zavu Cloud and reacts
|
|
2930
|
+
* to messaging events or HTTP requests.
|
|
2931
|
+
*/
|
|
2932
|
+
export interface ZavuFunction {
|
|
2933
|
+
id: string;
|
|
2934
|
+
/** URL-safe identifier, unique per project. */
|
|
2935
|
+
slug: string;
|
|
2936
|
+
name: string;
|
|
2937
|
+
description?: string | null;
|
|
2938
|
+
runtime: ZavuFunctionRuntime;
|
|
2939
|
+
status: ZavuFunctionStatus;
|
|
2940
|
+
/** Per-invocation timeout in seconds. */
|
|
2941
|
+
timeoutSec: number;
|
|
2942
|
+
/** Memory allocation in MB. */
|
|
2943
|
+
memoryMb: number;
|
|
2944
|
+
/** Whether the function can be invoked over HTTPS via its public URL. */
|
|
2945
|
+
httpEnabled: boolean;
|
|
2946
|
+
/**
|
|
2947
|
+
* HTTPS endpoint, present only while httpEnabled is true. Null otherwise,
|
|
2948
|
+
* including for a function that was previously exposed — the stored URL stops
|
|
2949
|
+
* serving the moment HTTP is turned off, so it is never returned.
|
|
2950
|
+
*/
|
|
2951
|
+
publicUrl?: string | null;
|
|
2952
|
+
/**
|
|
2953
|
+
* npm dependencies installed in the function bundle. Keys are package names,
|
|
2954
|
+
* values are semver ranges.
|
|
2955
|
+
*/
|
|
2956
|
+
dependencies: {
|
|
2957
|
+
[key: string]: string;
|
|
2958
|
+
};
|
|
2959
|
+
/** ID of the deployment currently serving traffic. */
|
|
2960
|
+
activeDeploymentId?: string | null;
|
|
2961
|
+
createdAt: string;
|
|
2962
|
+
updatedAt: string;
|
|
2963
|
+
}
|
|
2964
|
+
export interface ZavuFunctionResponse {
|
|
2965
|
+
function: ZavuFunction;
|
|
2966
|
+
}
|
|
2967
|
+
export interface FunctionCreateRequest {
|
|
2968
|
+
/** URL-safe identifier (lowercase, digits, hyphens). Must be unique per project. */
|
|
2969
|
+
slug: string;
|
|
2970
|
+
name: string;
|
|
2971
|
+
description?: string;
|
|
2972
|
+
runtime?: ZavuFunctionRuntime;
|
|
2973
|
+
/**
|
|
2974
|
+
* Per-invocation timeout in seconds. Event and cron invocations are asynchronous,
|
|
2975
|
+
* so a long timeout only bounds cost; a tool called during a live conversation
|
|
2976
|
+
* holds up the reply, and a function exposed over HTTP is additionally bounded by
|
|
2977
|
+
* the platform's HTTP response limit.
|
|
2978
|
+
*
|
|
2979
|
+
* @defaultValue `30`
|
|
2980
|
+
*/
|
|
2981
|
+
timeoutSec?: number;
|
|
2982
|
+
/** @defaultValue `256` */
|
|
2983
|
+
memoryMb?: FunctionCreateRequestMemoryMb;
|
|
2984
|
+
/**
|
|
2985
|
+
* Whether to expose a public HTTPS URL for this function.
|
|
2986
|
+
*
|
|
2987
|
+
* @defaultValue `false`
|
|
2988
|
+
*/
|
|
2989
|
+
httpEnabled?: boolean;
|
|
2990
|
+
/**
|
|
2991
|
+
* The project's source files, keyed by path relative to the project root (e.g.
|
|
2992
|
+
* `index.ts`, `lib/orders.ts`). Imports between them are resolved when the
|
|
2993
|
+
* function is built, so a function can be split across as many files as it needs.
|
|
2994
|
+
*
|
|
2995
|
+
* Paths must be relative and use forward slashes; `..`, `node_modules/` and
|
|
2996
|
+
* `package.json` are rejected. npm packages are not uploaded here — declare them
|
|
2997
|
+
* under `dependencies` and Zavu installs them. Limits: 200 files and 900,000 bytes
|
|
2998
|
+
* for the whole tree.
|
|
2999
|
+
*/
|
|
3000
|
+
files?: {
|
|
3001
|
+
[key: string]: string;
|
|
3002
|
+
};
|
|
3003
|
+
/**
|
|
3004
|
+
* Which file in `files` is the entry point. Defaults to `index.ts`.
|
|
3005
|
+
*
|
|
3006
|
+
* @defaultValue `"index.ts"`
|
|
3007
|
+
*/
|
|
3008
|
+
entrypoint?: string;
|
|
3009
|
+
/**
|
|
3010
|
+
* Shortcut for a single-file function: exactly equivalent to sending `files` with
|
|
3011
|
+
* one entry named after `entrypoint` (`index.ts` by default). Fully supported —
|
|
3012
|
+
* use whichever fits. If both are sent, `files` wins.
|
|
3013
|
+
*/
|
|
3014
|
+
sourceCode?: string;
|
|
3015
|
+
/** npm dependencies. Keys are package names, values are semver ranges. */
|
|
3016
|
+
dependencies?: {
|
|
3017
|
+
[key: string]: string;
|
|
3018
|
+
};
|
|
3019
|
+
}
|
|
3020
|
+
export type FunctionCreateRequestMemoryMb = 128 | 256 | 512 | 1024;
|
|
3021
|
+
/**
|
|
3022
|
+
* Optional source/dependencies update applied before deploying. Omit every field
|
|
3023
|
+
* to redeploy the current draft as-is.
|
|
3024
|
+
*/
|
|
3025
|
+
export interface FunctionDeployRequest {
|
|
3026
|
+
/**
|
|
3027
|
+
* The project's source files, keyed by path relative to the project root (e.g.
|
|
3028
|
+
* `index.ts`, `lib/orders.ts`). Imports between them are resolved when the
|
|
3029
|
+
* function is built, so a function can be split across as many files as it needs.
|
|
3030
|
+
*
|
|
3031
|
+
* Paths must be relative and use forward slashes; `..`, `node_modules/` and
|
|
3032
|
+
* `package.json` are rejected. npm packages are not uploaded here — declare them
|
|
3033
|
+
* under `dependencies` and Zavu installs them. Limits: 200 files and 900,000 bytes
|
|
3034
|
+
* for the whole tree.
|
|
3035
|
+
*/
|
|
3036
|
+
files?: {
|
|
3037
|
+
[key: string]: string;
|
|
3038
|
+
};
|
|
3039
|
+
/**
|
|
3040
|
+
* Which file in `files` is the entry point. Defaults to `index.ts`.
|
|
3041
|
+
*
|
|
3042
|
+
* @defaultValue `"index.ts"`
|
|
3043
|
+
*/
|
|
3044
|
+
entrypoint?: string;
|
|
3045
|
+
/**
|
|
3046
|
+
* Shortcut for a single-file function: exactly equivalent to sending `files` with
|
|
3047
|
+
* one entry named after `entrypoint` (`index.ts` by default). Fully supported —
|
|
3048
|
+
* use whichever fits. If both are sent, `files` wins.
|
|
3049
|
+
*/
|
|
3050
|
+
sourceCode?: string;
|
|
3051
|
+
/** New dependency map (replaces existing dependencies). */
|
|
3052
|
+
dependencies?: {
|
|
3053
|
+
[key: string]: string;
|
|
3054
|
+
};
|
|
3055
|
+
}
|
|
3056
|
+
/** Stage of a function deployment. */
|
|
3057
|
+
export type FunctionDeploymentStatus = 'pending' | 'bundling' | 'uploading' | 'publishing' | 'active' | 'failed' | 'superseded';
|
|
3058
|
+
export interface FunctionDeployment {
|
|
3059
|
+
id: string;
|
|
3060
|
+
functionId: string;
|
|
3061
|
+
/** Monotonically increasing deployment version, starting at 1. */
|
|
3062
|
+
version: number;
|
|
3063
|
+
status: FunctionDeploymentStatus;
|
|
3064
|
+
/** Total size of the deployed source tree in bytes. */
|
|
3065
|
+
sourceCodeBytes?: number | null;
|
|
3066
|
+
/** Size of the built bundle in bytes. Null until the build finishes. */
|
|
3067
|
+
bundleBytes?: number | null;
|
|
3068
|
+
/** Failure reason when status is 'failed'. */
|
|
3069
|
+
errorMessage?: string | null;
|
|
3070
|
+
/**
|
|
3071
|
+
* What the build printed: dependency installation, the bundler's output, and the
|
|
3072
|
+
* compiler's message when it failed. Returned when fetching a single deployment,
|
|
3073
|
+
* omitted from the list. Read this first when a deploy fails — `errorMessage` is
|
|
3074
|
+
* often the outer wrapper's summary, and the line that names the broken import or
|
|
3075
|
+
* the syntax error is here.
|
|
3076
|
+
*/
|
|
3077
|
+
buildLogs?: string | null;
|
|
3078
|
+
deployedAt?: string | null;
|
|
3079
|
+
createdAt: string;
|
|
3080
|
+
}
|
|
3081
|
+
export interface FunctionDeploymentResponse {
|
|
3082
|
+
deployment: FunctionDeployment;
|
|
3083
|
+
}
|
|
3084
|
+
export interface FunctionLogEvent {
|
|
3085
|
+
timestamp: string;
|
|
3086
|
+
message: string;
|
|
3087
|
+
}
|
|
3088
|
+
export interface FunctionLogsResponse {
|
|
3089
|
+
events: Array<FunctionLogEvent>;
|
|
3090
|
+
/** Pass to the next request to fetch the following page of logs. */
|
|
3091
|
+
nextToken?: string | null;
|
|
3092
|
+
}
|
|
3093
|
+
/**
|
|
3094
|
+
* A GitHub repository bound to a function. A push to `branch` deploys the
|
|
3095
|
+
* function. A function holds at most one link.
|
|
3096
|
+
*/
|
|
3097
|
+
export interface GitRepoLink {
|
|
3098
|
+
id: string;
|
|
3099
|
+
functionId: string;
|
|
3100
|
+
provider: 'github';
|
|
3101
|
+
owner: string;
|
|
3102
|
+
repo: string;
|
|
3103
|
+
/** Only pushes to this branch deploy. */
|
|
3104
|
+
branch: string;
|
|
3105
|
+
/**
|
|
3106
|
+
* Subdirectory holding the project, for monorepos. Null when the project is at the
|
|
3107
|
+
* repository root.
|
|
3108
|
+
*/
|
|
3109
|
+
rootDir?: string | null;
|
|
3110
|
+
/** When false the link is kept and pushes are ignored. */
|
|
3111
|
+
autoDeploy: boolean;
|
|
3112
|
+
/**
|
|
3113
|
+
* How this link authenticates, decided by the server rather than by the caller.
|
|
3114
|
+
* - `app`: the Zavu GitHub App is installed on the account. Pushes arrive on the
|
|
3115
|
+
* app's webhook and private repositories work. Nothing to configure in the
|
|
3116
|
+
* repository.
|
|
3117
|
+
* - `manual`: no installation. The link carries its own secret and you add the
|
|
3118
|
+
* webhook to the repository yourself.
|
|
3119
|
+
*/
|
|
3120
|
+
connection: GitRepoLinkConnection;
|
|
3121
|
+
lastStatus?: GitRepoLinkLastStatus | null;
|
|
3122
|
+
lastCommitSha?: string | null;
|
|
3123
|
+
lastCommitMessage?: string | null;
|
|
3124
|
+
/** Why the last deploy failed. Null otherwise. */
|
|
3125
|
+
lastError?: string | null;
|
|
3126
|
+
lastDeployAt?: string | null;
|
|
3127
|
+
createdAt: string;
|
|
3128
|
+
updatedAt: string;
|
|
3129
|
+
}
|
|
3130
|
+
export type GitRepoLinkConnection = 'app' | 'manual';
|
|
3131
|
+
export type GitRepoLinkLastStatus = 'deploying' | 'deployed' | 'failed';
|
|
3132
|
+
export interface GitRepoLinkResponse {
|
|
3133
|
+
link: GitRepoLink;
|
|
3134
|
+
/**
|
|
3135
|
+
* Endpoint that receives GitHub's push deliveries. Only needed on a `manual` link,
|
|
3136
|
+
* where you add it to the repository yourself.
|
|
3137
|
+
*/
|
|
3138
|
+
webhookUrl: string;
|
|
3139
|
+
/**
|
|
3140
|
+
* Shared secret for the repository's webhook. **Returned only when creating a
|
|
3141
|
+
* `manual` link, and only there** — every later read strips it, and re-linking
|
|
3142
|
+
* mints a new one. Absent entirely on an `app` link, which needs no secret of its
|
|
3143
|
+
* own.
|
|
3144
|
+
*/
|
|
3145
|
+
webhookSecret?: string;
|
|
3146
|
+
}
|
|
3147
|
+
/**
|
|
3148
|
+
* Voice Agent configuration on a sender's AI agent. Controls how the agent behaves
|
|
3149
|
+
* on inbound and outbound phone calls through Zavu's managed voice pipeline
|
|
3150
|
+
* (speech recognition, the agent's LLM, and speech synthesis, with real-time
|
|
3151
|
+
* interruption handling).
|
|
3152
|
+
*/
|
|
3153
|
+
export interface AgentVoiceConfig {
|
|
3154
|
+
/**
|
|
3155
|
+
* Whether the agent handles voice calls. When false, the sender's number is not
|
|
3156
|
+
* answered by the voice agent and outbound calls are rejected.
|
|
3157
|
+
*/
|
|
3158
|
+
enabled: boolean;
|
|
3159
|
+
/**
|
|
3160
|
+
* Opening line the agent speaks when the call connects. If omitted, the agent
|
|
3161
|
+
* waits for the caller to speak first.
|
|
3162
|
+
*/
|
|
3163
|
+
greeting?: string;
|
|
3164
|
+
/**
|
|
3165
|
+
* Greeting per language, keyed by language code. Used when the caller's language
|
|
3166
|
+
* differs from the one `greeting` is written in.
|
|
3167
|
+
*/
|
|
3168
|
+
greetings?: {
|
|
3169
|
+
[key: string]: string;
|
|
3170
|
+
};
|
|
3171
|
+
/**
|
|
3172
|
+
* BCP-47 language code used for both speech recognition and speech synthesis (e.g.
|
|
3173
|
+
* `en`, `es`, `pt-BR`). Auto-detected from the recipient when omitted.
|
|
3174
|
+
*/
|
|
3175
|
+
language?: string;
|
|
3176
|
+
/**
|
|
3177
|
+
* Model that runs the conversation, co-located in the voice network for lowest
|
|
3178
|
+
* latency. Independent of the model used for text messaging. Derived from the
|
|
3179
|
+
* agent's text model when omitted.
|
|
3180
|
+
*/
|
|
3181
|
+
model?: string;
|
|
3182
|
+
/** Speech-recognition provider. Uses the default when omitted. */
|
|
3183
|
+
sttProvider?: string;
|
|
3184
|
+
/** Speech-recognition model. Uses the default when omitted. */
|
|
3185
|
+
sttModel?: string;
|
|
3186
|
+
/** Speech-synthesis provider. Uses the default when omitted. */
|
|
3187
|
+
ttsProvider?: string;
|
|
3188
|
+
/**
|
|
3189
|
+
* Identifier of the synthesized voice that speaks. Choose from the voices
|
|
3190
|
+
* available in the dashboard. Uses a neutral default when omitted.
|
|
3191
|
+
*/
|
|
3192
|
+
ttsVoiceId?: string;
|
|
3193
|
+
/**
|
|
3194
|
+
* Speech rate. 1.0 is natural. Only honoured by voices that support rate control;
|
|
3195
|
+
* ignored by the others.
|
|
3196
|
+
*
|
|
3197
|
+
* @defaultValue `1.0`
|
|
3198
|
+
*/
|
|
3199
|
+
voiceSpeed?: number;
|
|
3200
|
+
/**
|
|
3201
|
+
* Whether the caller can interrupt the agent while it is speaking (barge-in). When
|
|
3202
|
+
* true, the agent stops talking as soon as the caller starts.
|
|
3203
|
+
*
|
|
3204
|
+
* @defaultValue `true`
|
|
3205
|
+
*/
|
|
3206
|
+
interruptible?: boolean;
|
|
3207
|
+
/**
|
|
3208
|
+
* Hard limit on call length in minutes. The call ends automatically when reached.
|
|
3209
|
+
*
|
|
3210
|
+
* @defaultValue `15`
|
|
3211
|
+
*/
|
|
3212
|
+
maxCallDurationMinutes?: number;
|
|
3213
|
+
/**
|
|
3214
|
+
* How long the agent waits during silence before ending the call.
|
|
3215
|
+
*
|
|
3216
|
+
* @defaultValue `30`
|
|
3217
|
+
*/
|
|
3218
|
+
maxIdleSeconds?: number;
|
|
3219
|
+
/** Whether the call audio is recorded. */
|
|
3220
|
+
recordCalls?: boolean;
|
|
3221
|
+
/**
|
|
3222
|
+
* What the agent does when an answering machine or voicemail is detected on an
|
|
3223
|
+
* outbound call.
|
|
3224
|
+
*
|
|
3225
|
+
* @defaultValue `"hangup"`
|
|
3226
|
+
*/
|
|
3227
|
+
voicemailAction?: AgentVoiceConfigVoicemailAction;
|
|
3228
|
+
/**
|
|
3229
|
+
* Message spoken when `voicemailAction` is `leave_message`. Falls back to
|
|
3230
|
+
* `greeting` when omitted.
|
|
3231
|
+
*/
|
|
3232
|
+
voicemailMessage?: string;
|
|
3233
|
+
/**
|
|
3234
|
+
* E.164 phone number the agent can transfer the call to. When set, the agent is
|
|
3235
|
+
* given a transfer tool it can use to hand the call to a human.
|
|
3236
|
+
*/
|
|
3237
|
+
transferPhoneNumber?: string;
|
|
3238
|
+
}
|
|
3239
|
+
export type AgentVoiceConfigVoicemailAction = 'hangup' | 'leave_message';
|
|
3240
|
+
export interface VoiceCall {
|
|
3241
|
+
id: string;
|
|
3242
|
+
direction: VoiceCallDirection;
|
|
3243
|
+
/**
|
|
3244
|
+
* Caller phone number in E.164 format. Your sender's number for outbound calls;
|
|
3245
|
+
* the caller's number for inbound calls.
|
|
3246
|
+
*/
|
|
3247
|
+
from: string;
|
|
3248
|
+
/** Callee phone number in E.164 format. */
|
|
3249
|
+
to: string;
|
|
3250
|
+
status: VoiceCallStatus;
|
|
3251
|
+
/**
|
|
3252
|
+
* Why the call ended (e.g. `agent_ended`, `max_duration`, `transfer`, `hangup`).
|
|
3253
|
+
* Present once the call is no longer active.
|
|
3254
|
+
*/
|
|
3255
|
+
endReason?: string | null;
|
|
3256
|
+
/** When the call was answered. */
|
|
3257
|
+
answeredAt?: string | null;
|
|
3258
|
+
/** When the call ended. */
|
|
3259
|
+
endedAt?: string | null;
|
|
3260
|
+
/** Billable talk time in seconds, measured from answer to hangup. */
|
|
3261
|
+
durationSeconds?: number | null;
|
|
3262
|
+
/** Number of conversation turns exchanged during the call. */
|
|
3263
|
+
turnCount?: number | null;
|
|
3264
|
+
/**
|
|
3265
|
+
* Ordered transcript of the call. Included when retrieving a single call; omitted
|
|
3266
|
+
* from list responses.
|
|
3267
|
+
*/
|
|
3268
|
+
transcript?: Array<VoiceCallTurn>;
|
|
3269
|
+
/**
|
|
3270
|
+
* Total cost of the call in USD, combining the managed voice pipeline per-minute
|
|
3271
|
+
* charge and telephony. Available once the call has ended.
|
|
3272
|
+
*/
|
|
3273
|
+
cost?: number | null;
|
|
3274
|
+
/** Arbitrary metadata you attached when creating the call. */
|
|
3275
|
+
metadata?: {
|
|
3276
|
+
[key: string]: string;
|
|
3277
|
+
};
|
|
3278
|
+
createdAt: string;
|
|
3279
|
+
updatedAt?: string;
|
|
3280
|
+
}
|
|
3281
|
+
/**
|
|
3282
|
+
* Request body to place an outbound voice call. The call is answered by the voice
|
|
3283
|
+
* agent configured on the sender.
|
|
3284
|
+
*/
|
|
3285
|
+
export interface VoiceCallCreateRequest {
|
|
3286
|
+
/** Recipient phone number in E.164 format. */
|
|
3287
|
+
to: string;
|
|
3288
|
+
/**
|
|
3289
|
+
* Sender profile that places the call. Uses the project's default sender if
|
|
3290
|
+
* omitted. The sender's agent must have voice enabled.
|
|
3291
|
+
*/
|
|
3292
|
+
senderId?: string;
|
|
3293
|
+
/** Overrides the agent's configured greeting for this call only. */
|
|
3294
|
+
greeting?: string;
|
|
3295
|
+
/**
|
|
3296
|
+
* Language the agent speaks on this call only, as a BCP-47 tag (`en`, `es`,
|
|
3297
|
+
* `es-ES`, `pt-BR`), or `auto` to detect the caller's language and follow it.
|
|
3298
|
+
* Overrides the agent's configured language for speech recognition, the agent's
|
|
3299
|
+
* replies, and the synthesized voice. If the agent uses a custom voice you
|
|
3300
|
+
* supplied, that voice is kept and only the language changes. When omitted, the
|
|
3301
|
+
* agent's configured language is used.
|
|
3302
|
+
*/
|
|
3303
|
+
language?: string;
|
|
3304
|
+
/** Overrides the agent's maximum call duration for this call only. */
|
|
3305
|
+
maxDurationMinutes?: number;
|
|
3306
|
+
/**
|
|
3307
|
+
* Arbitrary metadata to associate with the call. Returned on the call object and
|
|
3308
|
+
* included in voice webhooks.
|
|
3309
|
+
*/
|
|
3310
|
+
metadata?: {
|
|
3311
|
+
[key: string]: string;
|
|
3312
|
+
};
|
|
3313
|
+
}
|
|
3314
|
+
/**
|
|
3315
|
+
* Whether the call was placed by Zavu (outbound) or received from a caller
|
|
3316
|
+
* (inbound).
|
|
3317
|
+
*/
|
|
3318
|
+
export type VoiceCallDirection = 'inbound' | 'outbound';
|
|
3319
|
+
export interface VoiceCallResponse {
|
|
3320
|
+
call: VoiceCall;
|
|
3321
|
+
}
|
|
3322
|
+
/**
|
|
3323
|
+
* Lifecycle status of a voice call.
|
|
3324
|
+
* - `queued`: outbound call created, not yet dialing.
|
|
3325
|
+
* - `ringing`: dialing (outbound) or received and ringing (inbound).
|
|
3326
|
+
* - `in_progress`: answered, the agent is connected.
|
|
3327
|
+
* - `completed`: ended after a conversation.
|
|
3328
|
+
* - `failed`: could not be completed.
|
|
3329
|
+
* - `busy`: the line was busy.
|
|
3330
|
+
* - `no_answer`: rang but was not answered.
|
|
3331
|
+
* - `canceled`: canceled before it was answered.
|
|
3332
|
+
*/
|
|
3333
|
+
export type VoiceCallStatus = 'queued' | 'ringing' | 'in_progress' | 'completed' | 'failed' | 'busy' | 'no_answer' | 'canceled';
|
|
3334
|
+
/** A single turn in a voice call transcript. */
|
|
3335
|
+
export interface VoiceCallTurn {
|
|
3336
|
+
/** Ordinal position of the turn within the call, starting at 0. */
|
|
3337
|
+
seq: number;
|
|
3338
|
+
/**
|
|
3339
|
+
* Who produced the turn. `tool` records a tool call the agent made during the
|
|
3340
|
+
* conversation.
|
|
3341
|
+
*/
|
|
3342
|
+
role: VoiceCallTurnRole;
|
|
3343
|
+
/**
|
|
3344
|
+
* Transcribed speech for `user` and `assistant` turns, or a JSON summary of the
|
|
3345
|
+
* tool call for `tool` turns.
|
|
3346
|
+
*/
|
|
3347
|
+
text: string;
|
|
3348
|
+
/** When the turn started. */
|
|
3349
|
+
startedAt?: string | null;
|
|
3350
|
+
/** When the turn ended. */
|
|
3351
|
+
endedAt?: string | null;
|
|
3352
|
+
}
|
|
3353
|
+
export type VoiceCallTurnRole = 'user' | 'assistant' | 'tool';
|
|
3354
|
+
/**
|
|
3355
|
+
* A fully rendered factory agent: the function files to scaffold plus the secrets
|
|
3356
|
+
* it needs. Returned by GET /v1/agent-templates/{templateId} and consumed by `npx
|
|
3357
|
+
* zavudev agents pull`.
|
|
3358
|
+
*/
|
|
3359
|
+
export interface AgentTemplate {
|
|
3360
|
+
id: string;
|
|
3361
|
+
name: string;
|
|
3362
|
+
summary: string;
|
|
3363
|
+
category: AgentTemplateCategory;
|
|
3364
|
+
voice: boolean;
|
|
3365
|
+
defaultSlug: string;
|
|
3366
|
+
files: Array<AgentTemplateFile>;
|
|
3367
|
+
/** npm dependencies for the scaffolded function. */
|
|
3368
|
+
dependencies: {
|
|
3369
|
+
[key: string]: string;
|
|
3370
|
+
};
|
|
3371
|
+
requiredSecrets: Array<AgentTemplateRequiredSecretsItem>;
|
|
3372
|
+
}
|
|
3373
|
+
export type AgentTemplateCategory = 'sales' | 'support' | 'frontDesk' | 'ops';
|
|
3374
|
+
export interface AgentTemplateRequiredSecretsItem {
|
|
3375
|
+
key: string;
|
|
3376
|
+
hint: string;
|
|
3377
|
+
}
|
|
3378
|
+
export interface AgentTemplateFile {
|
|
3379
|
+
path: string;
|
|
3380
|
+
/** File contents to write verbatim. */
|
|
3381
|
+
content: string;
|
|
3382
|
+
}
|
|
3383
|
+
/** Compact catalog entry for a factory agent. */
|
|
3384
|
+
export interface AgentTemplateSummary {
|
|
3385
|
+
id: string;
|
|
3386
|
+
name: string;
|
|
3387
|
+
summary: string;
|
|
3388
|
+
category: AgentTemplateSummaryCategory;
|
|
3389
|
+
/** Whether this agent answers phone calls. */
|
|
3390
|
+
voice: boolean;
|
|
3391
|
+
toolCount: number;
|
|
3392
|
+
}
|
|
3393
|
+
export type AgentTemplateSummaryCategory = 'sales' | 'support' | 'frontDesk' | 'ops';
|
|
3394
|
+
export interface EmailDomain {
|
|
3395
|
+
id: string;
|
|
3396
|
+
domain: string;
|
|
3397
|
+
/** Overall verification status. */
|
|
3398
|
+
status: string;
|
|
3399
|
+
dkimStatus: string;
|
|
3400
|
+
/**
|
|
3401
|
+
* DNS records to publish. Present when fetching a single domain or after adding
|
|
3402
|
+
* one.
|
|
3403
|
+
*/
|
|
3404
|
+
dnsRecords?: Array<EmailDomainDnsRecord>;
|
|
3405
|
+
}
|
|
3406
|
+
export interface EmailDomainDnsRecord {
|
|
3407
|
+
/** DNS record type. */
|
|
3408
|
+
type: string;
|
|
3409
|
+
/** Record host/name to create. */
|
|
3410
|
+
name: string;
|
|
3411
|
+
/** Record value. */
|
|
3412
|
+
value: string;
|
|
3413
|
+
/** Priority (MX records only). */
|
|
3414
|
+
priority?: number;
|
|
3415
|
+
/**
|
|
3416
|
+
* What the record is for. `ownership` is a TXT at `_zavu-verification.<domain>`,
|
|
3417
|
+
* returned only when another Zavu account also added this domain and neither has
|
|
3418
|
+
* verified it: DKIM records are the same for everyone, so the domain verifies only
|
|
3419
|
+
* once this account's own token is published.
|
|
3420
|
+
*/
|
|
3421
|
+
purpose: EmailDomainDnsRecordPurpose;
|
|
3422
|
+
/**
|
|
3423
|
+
* Whether the record is required to verify + send (DKIM) or recommended for
|
|
3424
|
+
* deliverability.
|
|
3425
|
+
*/
|
|
3426
|
+
required: boolean;
|
|
3427
|
+
}
|
|
3428
|
+
export type EmailDomainDnsRecordPurpose = 'dkim' | 'spf' | 'dmarc' | 'mail_from' | 'ownership';
|
|
3429
|
+
/**
|
|
3430
|
+
* Run the agent and return what it would say. Nothing is delivered to anyone and
|
|
3431
|
+
* no execution is recorded.
|
|
3432
|
+
*
|
|
3433
|
+
* A run is **billed like a live reply**: on an agent with the `zavu` provider it
|
|
3434
|
+
* is charged to your balance at the same price per token, and refused with `402
|
|
3435
|
+
* insufficient_balance` at a balance of zero. On a bring-your-own-key agent it
|
|
3436
|
+
* costs your provider, not Zavu. `cost` on the response is what this run charged.
|
|
3437
|
+
*/
|
|
3438
|
+
export interface AgentTestRequest {
|
|
3439
|
+
/** What to say to the agent. */
|
|
3440
|
+
message: string;
|
|
3441
|
+
/**
|
|
3442
|
+
* Prior turns, oldest first, to exercise multi-turn behaviour without persisting a
|
|
3443
|
+
* thread. Trimmed to the agent's context window.
|
|
3444
|
+
*/
|
|
3445
|
+
history?: Array<AgentTestRequestHistoryItem>;
|
|
3446
|
+
/**
|
|
3447
|
+
* Set false to skip retrieval and isolate prompt behaviour from the knowledge
|
|
3448
|
+
* base.
|
|
3449
|
+
*
|
|
3450
|
+
* @defaultValue `true`
|
|
3451
|
+
*/
|
|
3452
|
+
useKnowledgeBase?: boolean;
|
|
3453
|
+
/**
|
|
3454
|
+
* Run the tools the agent calls instead of reporting the choice and stopping.
|
|
3455
|
+
*
|
|
3456
|
+
* Off by default because a tool handler talks to the outside world: a rehearsal
|
|
3457
|
+
* that charges a card is not a rehearsal. Turn it on to exercise the loop that
|
|
3458
|
+
* actually matters — the model picks a tool, the handler answers, the model
|
|
3459
|
+
* replies with the result — without sending a message to anyone. What ran comes
|
|
3460
|
+
* back in `executedToolCalls`.
|
|
3461
|
+
*
|
|
3462
|
+
* @defaultValue `false`
|
|
3463
|
+
*/
|
|
3464
|
+
executeTools?: boolean;
|
|
3465
|
+
}
|
|
3466
|
+
export interface AgentTestRequestHistoryItem {
|
|
3467
|
+
role: AgentTestRequestHistoryItemRole;
|
|
3468
|
+
content: string;
|
|
3469
|
+
}
|
|
3470
|
+
export type AgentTestRequestHistoryItemRole = 'user' | 'assistant';
|
|
3471
|
+
export interface AgentTestResponse {
|
|
3472
|
+
success: boolean;
|
|
3473
|
+
/** What the agent would reply. */
|
|
3474
|
+
text: string | null;
|
|
3475
|
+
error: string | null;
|
|
3476
|
+
inputTokens: number;
|
|
3477
|
+
outputTokens: number;
|
|
3478
|
+
latencyMs: number;
|
|
3479
|
+
/**
|
|
3480
|
+
* Knowledge-base chunks retrieved for this message. Zero means the answer was not
|
|
3481
|
+
* grounded in your documents.
|
|
3482
|
+
*/
|
|
3483
|
+
knowledgeChunksUsed: number;
|
|
3484
|
+
/**
|
|
3485
|
+
* Tools that actually ran, in order, when the request set `executeTools`. Empty on
|
|
3486
|
+
* a normal dry run, where nothing is executed. An entry with `ok: false` means the
|
|
3487
|
+
* agent saw an error and answered around it, which is what a customer would have
|
|
3488
|
+
* received.
|
|
3489
|
+
*/
|
|
3490
|
+
executedToolCalls?: Array<AgentTestResponseExecutedToolCallsItem>;
|
|
3491
|
+
/**
|
|
3492
|
+
* Things that are true of this agent but that a dry run cannot prove. Surfaced so
|
|
3493
|
+
* a passing dry run is never mistaken for proof that the agent works live.
|
|
3494
|
+
*
|
|
3495
|
+
* - The agent being disabled.
|
|
3496
|
+
* - Enabled tools that were offered to the model but not run: if the agent picks
|
|
3497
|
+
* one, the reply stops at that choice (see `plannedToolCalls`). Pass
|
|
3498
|
+
* `executeTools` to run them.
|
|
3499
|
+
* - Tools that ran for real, when `executeTools` was set, and any that failed.
|
|
3500
|
+
* - An agent whose sender has none of the channels it triggers on, which answers
|
|
3501
|
+
* every dry run and no real message.
|
|
3502
|
+
* - Contact metadata that exists on a real conversation but not here, and memory
|
|
3503
|
+
* tools (`remember`, `recall`, `save_record`), which have no contact to write
|
|
3504
|
+
* about on a test run.
|
|
3505
|
+
*/
|
|
3506
|
+
warnings: Array<string>;
|
|
3507
|
+
/**
|
|
3508
|
+
* USD charged to your balance for this run. 0 on a bring-your-own-key agent. When
|
|
3509
|
+
* the balance covers only part of a run, that part is charged and the next run is
|
|
3510
|
+
* refused with `402`.
|
|
3511
|
+
*/
|
|
3512
|
+
cost: number;
|
|
3513
|
+
/**
|
|
3514
|
+
* Tools the model chose to call, with the arguments it chose, on a run without
|
|
3515
|
+
* `executeTools`. Nothing was executed: the reply stops at the choice. Empty when
|
|
3516
|
+
* it answered without reaching for a tool, and on a run that executed tools (see
|
|
3517
|
+
* `executedToolCalls`).
|
|
3518
|
+
*/
|
|
3519
|
+
plannedToolCalls: Array<AgentTestResponsePlannedToolCallsItem>;
|
|
3520
|
+
}
|
|
3521
|
+
export interface AgentTestResponseExecutedToolCallsItem {
|
|
3522
|
+
name: string;
|
|
3523
|
+
ok: boolean;
|
|
3524
|
+
error?: string | null;
|
|
3525
|
+
}
|
|
3526
|
+
export interface AgentTestResponsePlannedToolCallsItem {
|
|
3527
|
+
name: string;
|
|
3528
|
+
/** The arguments as a JSON string. */
|
|
3529
|
+
arguments: string;
|
|
3530
|
+
}
|
|
3531
|
+
/**
|
|
3532
|
+
* Create an agent that exists on its own. Connect senders afterwards; an agent
|
|
3533
|
+
* answers on any number of them.
|
|
3534
|
+
*
|
|
3535
|
+
* **Sub-resources.** An agent's tools, flows and knowledge bases are reachable at
|
|
3536
|
+
* `/v1/agents/{agentId}/tools`, `/v1/agents/{agentId}/flows` and
|
|
3537
|
+
* `/v1/agents/{agentId}/knowledge-bases`, mirroring the sender-scoped routes
|
|
3538
|
+
* documented under `/v1/senders/{senderId}/agent/...` exactly. Use the
|
|
3539
|
+
* agent-scoped form while the agent has no sender: the sender-scoped one cannot
|
|
3540
|
+
* address it.
|
|
3541
|
+
*/
|
|
3542
|
+
export interface AgentCreateStandaloneRequest {
|
|
3543
|
+
name: string;
|
|
3544
|
+
provider: AgentProvider;
|
|
3545
|
+
model: string;
|
|
3546
|
+
systemPrompt: string;
|
|
3547
|
+
/**
|
|
3548
|
+
* API key for the LLM provider. Required unless provider is 'zavu'. Stored
|
|
3549
|
+
* encrypted and never returned.
|
|
3550
|
+
*/
|
|
3551
|
+
apiKey?: string;
|
|
3552
|
+
/** @defaultValue `10` */
|
|
3553
|
+
contextWindowMessages?: number;
|
|
3554
|
+
/** @defaultValue `true` */
|
|
3555
|
+
includeContactMetadata?: boolean;
|
|
3556
|
+
/** @defaultValue `["*"]` */
|
|
3557
|
+
triggerOnChannels?: Array<string>;
|
|
3558
|
+
/** @defaultValue `["text"]` */
|
|
3559
|
+
triggerOnMessageTypes?: Array<string>;
|
|
3560
|
+
maxTokens?: number;
|
|
3561
|
+
temperature?: number;
|
|
3562
|
+
voice?: AgentVoiceConfig;
|
|
3563
|
+
}
|
|
3564
|
+
/**
|
|
3565
|
+
* Fields to update on an existing function. Provide at least one. `files` /
|
|
3566
|
+
* `sourceCode` and `dependencies` edit the draft and take effect on the next
|
|
3567
|
+
* deploy; `httpEnabled` applies immediately to the deployed function.
|
|
3568
|
+
*/
|
|
3569
|
+
export interface FunctionUpdateRequest {
|
|
3570
|
+
/**
|
|
3571
|
+
* The project's source files, keyed by path relative to the project root (e.g.
|
|
3572
|
+
* `index.ts`, `lib/orders.ts`). Imports between them are resolved when the
|
|
3573
|
+
* function is built, so a function can be split across as many files as it needs.
|
|
3574
|
+
*
|
|
3575
|
+
* Paths must be relative and use forward slashes; `..`, `node_modules/` and
|
|
3576
|
+
* `package.json` are rejected. npm packages are not uploaded here — declare them
|
|
3577
|
+
* under `dependencies` and Zavu installs them. Limits: 200 files and 900,000 bytes
|
|
3578
|
+
* for the whole tree.
|
|
3579
|
+
*/
|
|
3580
|
+
files?: {
|
|
3581
|
+
[key: string]: string;
|
|
3582
|
+
};
|
|
3583
|
+
/**
|
|
3584
|
+
* Which file in `files` is the entry point. Defaults to `index.ts`.
|
|
3585
|
+
*
|
|
3586
|
+
* @defaultValue `"index.ts"`
|
|
3587
|
+
*/
|
|
3588
|
+
entrypoint?: string;
|
|
3589
|
+
/**
|
|
3590
|
+
* Shortcut for a single-file function: exactly equivalent to sending `files` with
|
|
3591
|
+
* one entry named after `entrypoint` (`index.ts` by default). Fully supported —
|
|
3592
|
+
* use whichever fits. If both are sent, `files` wins.
|
|
3593
|
+
*/
|
|
3594
|
+
sourceCode?: string;
|
|
3595
|
+
/** New dependency map (replaces existing dependencies). */
|
|
3596
|
+
dependencies?: {
|
|
3597
|
+
[key: string]: string;
|
|
3598
|
+
};
|
|
3599
|
+
/**
|
|
3600
|
+
* Expose the function on its public HTTPS URL, or take it down. Applies to the
|
|
3601
|
+
* already-deployed function without redeploying; the URL is returned as
|
|
3602
|
+
* `publicUrl`.
|
|
3603
|
+
*/
|
|
3604
|
+
httpEnabled?: boolean;
|
|
3605
|
+
}
|
|
3606
|
+
/**
|
|
3607
|
+
* Which `X-Zavu-Signature` scheme this receiver is sent.
|
|
3608
|
+
*
|
|
3609
|
+
* - `v1`: `v1=HMAC_SHA256(secret, body)`. The scheme used before this was
|
|
3610
|
+
* configurable. Existing webhooks stay on it until you move them.
|
|
3611
|
+
* - `v2`: `v2=HMAC_SHA256(secret, "{t}.{body}")`. The current scheme, and the
|
|
3612
|
+
* default for new senders. It signs the timestamp together with the body.
|
|
3613
|
+
* - `v1+v2`: both signatures, sharing one `t`. The migration setting: a receiver
|
|
3614
|
+
* reading either one works, so you can deploy and confirm your new verifier
|
|
3615
|
+
* before switching over.
|
|
3616
|
+
*
|
|
3617
|
+
* Moving from `v1` straight to `v2` returns `400`. Set `v1+v2` first. See
|
|
3618
|
+
* https://docs.zavu.dev/guides/receiving-messages/signature-migration
|
|
3619
|
+
*/
|
|
3620
|
+
export type WebhookSignatureVersion = 'v1' | 'v1+v2' | 'v2';
|
|
3621
|
+
/**
|
|
3622
|
+
* The project-level webhook. It receives project events such as
|
|
3623
|
+
* `invitation.status_changed` for this project only: a parent project does not
|
|
3624
|
+
* receive its sub-accounts' events, so configure one per sub-account with that
|
|
3625
|
+
* sub-account's API key.
|
|
3626
|
+
*/
|
|
3627
|
+
export interface ProjectWebhook {
|
|
3628
|
+
url: string;
|
|
3629
|
+
events: Array<ProjectWebhookEvent>;
|
|
3630
|
+
/**
|
|
3631
|
+
* Signing secret for `X-Zavu-Signature`. Returned only by `POST
|
|
3632
|
+
* /v1/invitations/webhook`.
|
|
3633
|
+
*/
|
|
3634
|
+
secret?: string;
|
|
3635
|
+
active: boolean;
|
|
3636
|
+
}
|
|
3637
|
+
/**
|
|
3638
|
+
* Events a project webhook can subscribe to. Any other value is refused with
|
|
3639
|
+
* `400`.
|
|
3640
|
+
*/
|
|
3641
|
+
export type ProjectWebhookEvent = 'invitation.status_changed' | 'broadcast.status_changed' | 'domain.verified' | 'domain.failed';
|
|
3642
|
+
export interface ProjectWebhookCreateRequest {
|
|
3643
|
+
url: string;
|
|
3644
|
+
events: Array<ProjectWebhookEvent>;
|
|
3645
|
+
}
|
|
3646
|
+
/**
|
|
3647
|
+
* Only valid on a webhook created with `POST /v1/invitations/webhook`; updating
|
|
3648
|
+
* one that does not exist returns `400`.
|
|
3649
|
+
*/
|
|
3650
|
+
export interface ProjectWebhookUpdateRequest {
|
|
3651
|
+
url?: string;
|
|
3652
|
+
events?: Array<ProjectWebhookEvent>;
|
|
3653
|
+
active?: boolean;
|
|
3654
|
+
}
|
|
3655
|
+
/**
|
|
3656
|
+
* A channel whose connection has an on/off switch. `sms`, `sms_oneway` and `voice`
|
|
3657
|
+
* are billed per message and per phone number, are always on, and have nothing to
|
|
3658
|
+
* activate.
|
|
3659
|
+
*/
|
|
3660
|
+
export type ActivatableChannel = 'whatsapp' | 'telegram' | 'instagram' | 'messenger' | 'email';
|
|
3661
|
+
export interface SenderChannelActivationResponse {
|
|
3662
|
+
/** The sender after the change. `channels` includes the channel once it is active. */
|
|
3663
|
+
sender: Sender;
|
|
3664
|
+
channel: ActivatableChannel;
|
|
3665
|
+
/**
|
|
3666
|
+
* True when this call switched the channel on. False when it was already active;
|
|
3667
|
+
* nothing was charged.
|
|
3668
|
+
*/
|
|
3669
|
+
activated: boolean;
|
|
3670
|
+
/**
|
|
3671
|
+
* Cents taken from the balance by this call. Zero when the channel was already
|
|
3672
|
+
* active, its month is already paid, or the plan includes it.
|
|
3673
|
+
*/
|
|
3674
|
+
chargedCents: number;
|
|
3675
|
+
/**
|
|
3676
|
+
* Cents this connection adds to each month while it stays active. Zero when the
|
|
3677
|
+
* plan includes it.
|
|
3678
|
+
*/
|
|
3679
|
+
monthlyCents: number;
|
|
3680
|
+
}
|
|
3681
|
+
export interface SenderChannelDeactivationResponse {
|
|
3682
|
+
sender: Sender;
|
|
3683
|
+
channel: ActivatableChannel;
|
|
3684
|
+
/**
|
|
3685
|
+
* True when this call switched the channel off. False when it was already
|
|
3686
|
+
* inactive.
|
|
3687
|
+
*/
|
|
3688
|
+
deactivated: boolean;
|
|
3689
|
+
}
|
|
3690
|
+
export interface CreateMemoryCollectionResponse {
|
|
3691
|
+
collection: MemoryCollection;
|
|
3692
|
+
}
|
|
3693
|
+
export interface ListMemoryCollectionsResponse {
|
|
3694
|
+
items: Array<MemoryCollection>;
|
|
3695
|
+
nextCursor?: string | null;
|
|
3696
|
+
}
|
|
3697
|
+
export interface GetMemoryCollectionResponse {
|
|
3698
|
+
collection: MemoryCollection;
|
|
3699
|
+
}
|
|
3700
|
+
export interface UpdateMemoryCollectionResponse {
|
|
3701
|
+
collection: MemoryCollection;
|
|
3702
|
+
}
|
|
3703
|
+
export interface DeleteMemoryCollectionResponse {
|
|
3704
|
+
status: string;
|
|
3705
|
+
}
|
|
3706
|
+
export interface ListMemoryItemsResponse {
|
|
3707
|
+
items: Array<MemoryItem>;
|
|
3708
|
+
nextCursor?: string | null;
|
|
3709
|
+
}
|
|
3710
|
+
export interface PutMemoryItemResponse {
|
|
3711
|
+
item: MemoryItem;
|
|
3712
|
+
}
|
|
3713
|
+
export interface GetMemoryItemResponse {
|
|
3714
|
+
item: MemoryItem;
|
|
3715
|
+
}
|
|
3716
|
+
export interface QueryMemoryItemsResponse {
|
|
3717
|
+
items: Array<MemoryItem>;
|
|
3718
|
+
nextCursor?: string | null;
|
|
3719
|
+
}
|
|
3720
|
+
export interface AddMemoryResponse {
|
|
3721
|
+
memory: MemoryRecord;
|
|
3722
|
+
}
|
|
3723
|
+
export interface ListMemoriesResponse {
|
|
3724
|
+
items: Array<Memory>;
|
|
3725
|
+
nextCursor?: string | null;
|
|
3726
|
+
}
|
|
3727
|
+
export interface WipeMemoryScopeResponse {
|
|
3728
|
+
status: string;
|
|
3729
|
+
}
|
|
3730
|
+
export interface SearchMemoriesResponse {
|
|
3731
|
+
items: Array<Memory>;
|
|
3732
|
+
}
|
|
3733
|
+
export interface GetMemoryUsageResponse {
|
|
3734
|
+
usage: MemoryUsage;
|
|
3735
|
+
}
|
|
3736
|
+
export interface GetMemoryResponse {
|
|
3737
|
+
memory: Memory;
|
|
3738
|
+
}
|
|
3739
|
+
export interface ListFunctionEventTypesResponse {
|
|
3740
|
+
events: Array<string>;
|
|
3741
|
+
}
|
|
3742
|
+
export interface ListFunctionTriggersResponse {
|
|
3743
|
+
triggers: Array<FunctionTrigger>;
|
|
3744
|
+
}
|
|
3745
|
+
export interface CreateFunctionTriggersBody {
|
|
3746
|
+
/** Event types to subscribe to. */
|
|
3747
|
+
eventTypes: Array<string>;
|
|
3748
|
+
/** Senders to scope the triggers to. Use null for all senders. */
|
|
3749
|
+
senderIds: Array<string | null>;
|
|
3750
|
+
/**
|
|
3751
|
+
* Required when eventTypes includes `cron`: a 5-field cron expression (minute hour
|
|
3752
|
+
* day-of-month month day-of-week), evaluated in UTC.
|
|
3753
|
+
*/
|
|
3754
|
+
cron?: string;
|
|
3755
|
+
}
|
|
3756
|
+
export interface CreateFunctionTriggersResponse {
|
|
3757
|
+
added: number;
|
|
3758
|
+
/** Number of triggers that already existed. */
|
|
3759
|
+
skipped: number;
|
|
3760
|
+
triggers: Array<FunctionTrigger>;
|
|
3761
|
+
}
|
|
3762
|
+
export interface UpdateFunctionTriggerBody {
|
|
3763
|
+
active: boolean;
|
|
3764
|
+
}
|
|
3765
|
+
export interface UpdateFunctionTriggerResponse {
|
|
3766
|
+
ok: boolean;
|
|
3767
|
+
active: boolean;
|
|
3768
|
+
}
|
|
3769
|
+
export interface ListFunctionDeploymentsResponse {
|
|
3770
|
+
deployments: Array<ListFunctionDeploymentsResponseDeploymentsItem>;
|
|
3771
|
+
}
|
|
3772
|
+
export interface ListFunctionDeploymentsResponseDeploymentsItem {
|
|
3773
|
+
id?: string;
|
|
3774
|
+
version?: number;
|
|
3775
|
+
status?: FunctionDeploymentStatus;
|
|
3776
|
+
bundleSizeBytes?: number | null;
|
|
3777
|
+
errorMessage?: string | null;
|
|
3778
|
+
isActive?: boolean;
|
|
3779
|
+
/**
|
|
3780
|
+
* When the deployment went live. Null for a deployment that failed or is still
|
|
3781
|
+
* building.
|
|
3782
|
+
*/
|
|
3783
|
+
deployedAt?: string | null;
|
|
3784
|
+
createdAt?: string;
|
|
3785
|
+
}
|
|
3786
|
+
export interface RollbackFunctionBody {
|
|
3787
|
+
/** ID of the deployment to roll back to. */
|
|
3788
|
+
deploymentId: string;
|
|
3789
|
+
}
|
|
3790
|
+
export interface RollbackFunctionResponse {
|
|
3791
|
+
deployment: FunctionDeployment;
|
|
3792
|
+
rolledBackToVersion?: number;
|
|
3793
|
+
/** The draft that was replaced, so a UI can offer to restore it. */
|
|
3794
|
+
previousDraft?: {
|
|
3795
|
+
[key: string]: unknown;
|
|
3796
|
+
} | null;
|
|
3797
|
+
}
|
|
3798
|
+
export interface EscalateUrlBody {
|
|
3799
|
+
/** Why the URL should be reviewed manually. */
|
|
3800
|
+
reason: string;
|
|
3801
|
+
}
|
|
3802
|
+
export interface EscalateUrlResponse {
|
|
3803
|
+
url: VerifiedUrl;
|
|
3804
|
+
message: string;
|
|
3805
|
+
}
|
|
3806
|
+
export interface SendMessageError429 {
|
|
3807
|
+
code?: string;
|
|
3808
|
+
message?: string;
|
|
3809
|
+
details?: {
|
|
3810
|
+
[key: string]: unknown;
|
|
3811
|
+
};
|
|
3812
|
+
error?: Error;
|
|
3813
|
+
}
|
|
3814
|
+
export type ListMessagesStatus = 'queued' | 'sending' | 'sent' | 'delivered' | 'failed' | 'received';
|
|
3815
|
+
export type ListMessagesChannel = 'sms' | 'sms_oneway' | 'whatsapp' | 'email' | 'telegram' | 'instagram' | 'messenger' | 'voice';
|
|
3816
|
+
export interface ListMessagesResponse {
|
|
3817
|
+
items: Array<Message>;
|
|
3818
|
+
nextCursor?: string | null;
|
|
3819
|
+
}
|
|
3820
|
+
export interface ShowTypingIndicatorResponse {
|
|
3821
|
+
success: boolean;
|
|
3822
|
+
}
|
|
3823
|
+
export interface ListTemplatesResponse {
|
|
3824
|
+
items: Array<Template>;
|
|
3825
|
+
nextCursor?: string | null;
|
|
3826
|
+
}
|
|
3827
|
+
export interface SyncTemplatesBody {
|
|
3828
|
+
/**
|
|
3829
|
+
* Sync only the WhatsApp Business Account attached to this sender. If omitted,
|
|
3830
|
+
* every WhatsApp sender in the project is synced.
|
|
3831
|
+
*/
|
|
3832
|
+
senderId?: string;
|
|
3833
|
+
}
|
|
3834
|
+
export interface SyncTemplatesResponse {
|
|
3835
|
+
/** WhatsApp Business Accounts reconciled in this call. */
|
|
3836
|
+
accountsSynced: number;
|
|
3837
|
+
/** Templates that existed on Meta and were created in Zavu by this call. */
|
|
3838
|
+
imported: number;
|
|
3839
|
+
/**
|
|
3840
|
+
* Existing Zavu templates that were matched to a Meta template by name and bound
|
|
3841
|
+
* to its Meta ID.
|
|
3842
|
+
*/
|
|
3843
|
+
linked: number;
|
|
3844
|
+
/**
|
|
3845
|
+
* Templates brought back in line with Meta — approval status, category, or both.
|
|
3846
|
+
* A template whose status and category both moved is counted once.
|
|
3847
|
+
*/
|
|
3848
|
+
updated: number;
|
|
3849
|
+
/**
|
|
3850
|
+
* Meta templates left alone: already linked to a Zavu template, or
|
|
3851
|
+
* rejected/disabled on Meta.
|
|
3852
|
+
*/
|
|
3853
|
+
skipped: number;
|
|
3854
|
+
/**
|
|
3855
|
+
* Problems hit while syncing. Non-empty with a 200 means part of the sync did not
|
|
3856
|
+
* complete — the rest still did.
|
|
3857
|
+
*/
|
|
3858
|
+
errors: Array<string>;
|
|
3859
|
+
}
|
|
3860
|
+
export interface SubmitTemplateBody {
|
|
3861
|
+
/** The sender ID with the WhatsApp Business Account to submit the template to. */
|
|
3862
|
+
senderId: string;
|
|
3863
|
+
/** Template category. If not provided, uses the category set on the template. */
|
|
3864
|
+
category?: WhatsAppCategory;
|
|
3865
|
+
/**
|
|
3866
|
+
* Sample value for each body variable, sent to Meta as the example it reviews the
|
|
3867
|
+
* template with. Key a named variable (`{{customer_name}}`) by its name, and a
|
|
3868
|
+
* positional one (`{{1}}`, `{{2}}`) as `var1`, `var2`.
|
|
3869
|
+
*
|
|
3870
|
+
* Any variable left out gets a generic placeholder: a stock value for a few common
|
|
3871
|
+
* names (`name`, `order_id`, `code`, ...) and `Sample <variable>` for the rest.
|
|
3872
|
+
* Meta reviews those less favourably, so send a realistic value for every
|
|
3873
|
+
* variable.
|
|
3874
|
+
*/
|
|
3875
|
+
variableExamples?: {
|
|
3876
|
+
[key: string]: string;
|
|
3877
|
+
};
|
|
3878
|
+
}
|
|
3879
|
+
export interface ListSendersResponse {
|
|
3880
|
+
items: Array<Sender>;
|
|
3881
|
+
nextCursor?: string | null;
|
|
3882
|
+
}
|
|
3883
|
+
export interface UpdateSenderProfileResponse {
|
|
3884
|
+
success: boolean;
|
|
3885
|
+
profile: WhatsAppBusinessProfile;
|
|
3886
|
+
}
|
|
3887
|
+
export interface UploadSenderProfilePictureResponse {
|
|
3888
|
+
success: boolean;
|
|
3889
|
+
profile: WhatsAppBusinessProfile;
|
|
3890
|
+
}
|
|
3891
|
+
export interface ListContactsResponse {
|
|
3892
|
+
items: Array<Contact>;
|
|
3893
|
+
nextCursor?: string | null;
|
|
3894
|
+
}
|
|
3895
|
+
export type ListConversationsChannel = 'sms' | 'sms_oneway' | 'whatsapp' | 'email' | 'telegram' | 'instagram' | 'messenger' | 'voice';
|
|
3896
|
+
export interface ListConversationsResponse {
|
|
3897
|
+
items: Array<Conversation>;
|
|
3898
|
+
nextCursor?: string | null;
|
|
3899
|
+
}
|
|
3900
|
+
export interface ListConversationMessagesResponse {
|
|
3901
|
+
items: Array<Message>;
|
|
3902
|
+
nextCursor?: string | null;
|
|
3903
|
+
}
|
|
3904
|
+
export interface ListBroadcastsResponse {
|
|
3905
|
+
items: Array<Broadcast>;
|
|
3906
|
+
nextCursor?: string | null;
|
|
3907
|
+
}
|
|
3908
|
+
export interface ListBroadcastContactsResponse {
|
|
3909
|
+
items: Array<BroadcastContact>;
|
|
3910
|
+
nextCursor?: string | null;
|
|
3911
|
+
}
|
|
3912
|
+
export interface GetPhoneNumberRequirementsResponse {
|
|
3913
|
+
items: Array<Requirement>;
|
|
3914
|
+
}
|
|
3915
|
+
export interface SearchAvailablePhoneNumbersResponse {
|
|
3916
|
+
items: Array<AvailablePhoneNumber>;
|
|
3917
|
+
}
|
|
3918
|
+
export interface ListPhoneNumbersResponse {
|
|
3919
|
+
items: Array<OwnedPhoneNumber>;
|
|
3920
|
+
nextCursor?: string | null;
|
|
3921
|
+
}
|
|
3922
|
+
export interface ListInvitationsResponse {
|
|
3923
|
+
items: Array<Invitation>;
|
|
3924
|
+
nextCursor?: string | null;
|
|
3925
|
+
}
|
|
3926
|
+
export interface GetProjectWebhookResponse {
|
|
3927
|
+
webhook: ProjectWebhook | null;
|
|
3928
|
+
}
|
|
3929
|
+
export interface ConfigureProjectWebhookResponse {
|
|
3930
|
+
webhook: ProjectWebhook;
|
|
3931
|
+
}
|
|
3932
|
+
export interface UpdateProjectWebhookResponse {
|
|
3933
|
+
webhook: ProjectWebhook;
|
|
3934
|
+
}
|
|
3935
|
+
export interface ListAddressesResponse {
|
|
3936
|
+
items: Array<Address>;
|
|
3937
|
+
nextCursor?: string | null;
|
|
3938
|
+
}
|
|
3939
|
+
export interface ListRegulatoryDocumentsResponse {
|
|
3940
|
+
items: Array<RegulatoryDocument>;
|
|
3941
|
+
nextCursor?: string | null;
|
|
3942
|
+
}
|
|
3943
|
+
export interface ListAgentExecutionsResponse {
|
|
3944
|
+
items: Array<AgentExecution>;
|
|
3945
|
+
nextCursor?: string | null;
|
|
3946
|
+
}
|
|
3947
|
+
export interface GetAgentExecutionResponse {
|
|
3948
|
+
execution: AgentExecution;
|
|
3949
|
+
}
|
|
3950
|
+
export interface ListAgentFlowsResponse {
|
|
3951
|
+
items: Array<AgentFlow>;
|
|
3952
|
+
nextCursor?: string | null;
|
|
3953
|
+
}
|
|
3954
|
+
export interface ListAgentToolsResponse {
|
|
3955
|
+
items: Array<AgentTool>;
|
|
3956
|
+
nextCursor?: string | null;
|
|
3957
|
+
}
|
|
3958
|
+
export interface ListAgentToolTestRunsResponse {
|
|
3959
|
+
items: Array<AgentToolTestRun>;
|
|
3960
|
+
}
|
|
3961
|
+
export interface ListAgentKnowledgeBasesResponse {
|
|
3962
|
+
items: Array<AgentKnowledgeBase>;
|
|
3963
|
+
nextCursor?: string | null;
|
|
3964
|
+
}
|
|
3965
|
+
export interface ListAgentDocumentsResponse {
|
|
3966
|
+
items: Array<AgentDocument>;
|
|
3967
|
+
nextCursor?: string | null;
|
|
3968
|
+
}
|
|
3969
|
+
export interface ListUrlsResponse {
|
|
3970
|
+
items: Array<VerifiedUrl>;
|
|
3971
|
+
nextCursor?: string | null;
|
|
3972
|
+
}
|
|
3973
|
+
export interface GetMeResponse {
|
|
3974
|
+
project: GetMeResponseProject;
|
|
3975
|
+
team: GetMeResponseTeam;
|
|
3976
|
+
apiKey: GetMeResponseApiKey;
|
|
3977
|
+
isTestMode: boolean;
|
|
3978
|
+
}
|
|
3979
|
+
export interface GetMeResponseProject {
|
|
3980
|
+
id: string;
|
|
3981
|
+
name: string | null;
|
|
3982
|
+
isSubAccount: boolean;
|
|
3983
|
+
}
|
|
3984
|
+
export interface GetMeResponseTeam {
|
|
3985
|
+
id: string;
|
|
3986
|
+
name: string | null;
|
|
3987
|
+
}
|
|
3988
|
+
export interface GetMeResponseApiKey {
|
|
3989
|
+
id: string;
|
|
3990
|
+
}
|
|
3991
|
+
export interface ListSubAccountsResponse {
|
|
3992
|
+
items: Array<SubAccount>;
|
|
3993
|
+
nextCursor?: string | null;
|
|
3994
|
+
}
|
|
3995
|
+
export interface DeactivateSubAccountResponse {
|
|
3996
|
+
message: string;
|
|
3997
|
+
/** Number of API keys revoked. */
|
|
3998
|
+
keysRevoked: number;
|
|
3999
|
+
}
|
|
4000
|
+
export interface ListSubAccountApiKeysResponse {
|
|
4001
|
+
items: Array<SubAccountApiKey>;
|
|
4002
|
+
}
|
|
4003
|
+
export interface CreateSubAccountApiKeyResponse {
|
|
4004
|
+
apiKey: CreateSubAccountApiKeyResponseApiKey;
|
|
4005
|
+
}
|
|
4006
|
+
export interface CreateSubAccountApiKeyResponseApiKey {
|
|
4007
|
+
id: string;
|
|
4008
|
+
key: string;
|
|
4009
|
+
name: string;
|
|
4010
|
+
environment: CreateSubAccountApiKeyResponseApiKeyEnvironment;
|
|
4011
|
+
}
|
|
4012
|
+
export type CreateSubAccountApiKeyResponseApiKeyEnvironment = 'live' | 'test';
|
|
4013
|
+
export interface ListTenDlcBrandsResponse {
|
|
4014
|
+
items: Array<TenDlcBrand>;
|
|
4015
|
+
nextCursor?: string | null;
|
|
4016
|
+
}
|
|
4017
|
+
export interface ListTenDlcUseCasesResponse {
|
|
4018
|
+
useCases: Array<ListTenDlcUseCasesResponseUseCasesItem>;
|
|
4019
|
+
}
|
|
4020
|
+
export interface ListTenDlcUseCasesResponseUseCasesItem {
|
|
4021
|
+
/** Use case identifier. Pass it as `useCase` when creating a campaign. */
|
|
4022
|
+
name?: string;
|
|
4023
|
+
description?: string;
|
|
4024
|
+
}
|
|
4025
|
+
export interface ListTenDlcCampaignsResponse {
|
|
4026
|
+
items: Array<TenDlcCampaign>;
|
|
4027
|
+
nextCursor?: string | null;
|
|
4028
|
+
}
|
|
4029
|
+
export interface ListTenDlcCampaignPhoneNumbersResponse {
|
|
4030
|
+
items: Array<TenDlcPhoneNumberAssignment>;
|
|
4031
|
+
nextCursor?: string | null;
|
|
4032
|
+
}
|
|
4033
|
+
export interface DeleteFunctionResponse {
|
|
4034
|
+
deleted: boolean;
|
|
4035
|
+
name?: string;
|
|
4036
|
+
slug?: string;
|
|
4037
|
+
}
|
|
4038
|
+
export interface ListFunctionSecretsResponse {
|
|
4039
|
+
secrets: Array<ListFunctionSecretsResponseSecretsItem>;
|
|
4040
|
+
}
|
|
4041
|
+
export interface ListFunctionSecretsResponseSecretsItem {
|
|
4042
|
+
id: string;
|
|
4043
|
+
key: string;
|
|
4044
|
+
valueLast4: string;
|
|
4045
|
+
syncedToAws?: boolean;
|
|
4046
|
+
createdAt?: number;
|
|
4047
|
+
updatedAt?: number;
|
|
4048
|
+
}
|
|
4049
|
+
export interface SetFunctionSecretBody {
|
|
4050
|
+
value: string;
|
|
4051
|
+
}
|
|
4052
|
+
export interface CreateFunctionGitLinkBody {
|
|
4053
|
+
owner: string;
|
|
4054
|
+
repo: string;
|
|
4055
|
+
/** @defaultValue `"main"` */
|
|
4056
|
+
branch?: string;
|
|
4057
|
+
/** Subdirectory holding the project, for monorepos. */
|
|
4058
|
+
rootDir?: string;
|
|
4059
|
+
/** @defaultValue `true` */
|
|
4060
|
+
autoDeploy?: boolean;
|
|
4061
|
+
}
|
|
4062
|
+
export interface UpdateFunctionGitLinkBody {
|
|
4063
|
+
branch?: string;
|
|
4064
|
+
rootDir?: string | null;
|
|
4065
|
+
autoDeploy?: boolean;
|
|
4066
|
+
}
|
|
4067
|
+
export interface DeployFunctionGitLinkResponse {
|
|
4068
|
+
scheduled: boolean;
|
|
4069
|
+
}
|
|
4070
|
+
export interface ListCallsResponse {
|
|
4071
|
+
items: Array<VoiceCall>;
|
|
4072
|
+
nextCursor?: string | null;
|
|
4073
|
+
}
|
|
4074
|
+
export interface ListAgentTemplatesResponse {
|
|
4075
|
+
items: Array<AgentTemplateSummary>;
|
|
4076
|
+
}
|
|
4077
|
+
export interface GetAgentTemplateResponse {
|
|
4078
|
+
template: AgentTemplate;
|
|
4079
|
+
}
|
|
4080
|
+
export interface AddEmailDomainBody {
|
|
4081
|
+
/** Bare domain, e.g. example.com. */
|
|
4082
|
+
domain: string;
|
|
4083
|
+
}
|
|
4084
|
+
export interface AddEmailDomainResponse {
|
|
4085
|
+
domain: EmailDomain;
|
|
4086
|
+
}
|
|
4087
|
+
export interface ListEmailDomainsResponse {
|
|
4088
|
+
items: Array<EmailDomain>;
|
|
4089
|
+
}
|
|
4090
|
+
export interface GetEmailDomainResponse {
|
|
4091
|
+
domain: EmailDomain;
|
|
4092
|
+
}
|
|
4093
|
+
export interface VerifyEmailDomainResponse {
|
|
4094
|
+
domain: EmailDomain;
|
|
4095
|
+
}
|
|
4096
|
+
export interface ConnectSenderTelegramBody {
|
|
4097
|
+
/** Bot token from @BotFather. */
|
|
4098
|
+
botToken: string;
|
|
4099
|
+
}
|
|
4100
|
+
export interface ConnectSenderTelegramResponse {
|
|
4101
|
+
telegram: ConnectSenderTelegramResponseTelegram;
|
|
4102
|
+
}
|
|
4103
|
+
export interface ConnectSenderTelegramResponseTelegram {
|
|
4104
|
+
connected: boolean;
|
|
4105
|
+
botUsername?: string;
|
|
4106
|
+
botId?: string;
|
|
4107
|
+
}
|
|
4108
|
+
export interface ListAgentsResponse {
|
|
4109
|
+
items: Array<Agent>;
|
|
4110
|
+
nextCursor?: string | null;
|
|
4111
|
+
}
|
|
4112
|
+
export interface CreateStandaloneAgentResponse {
|
|
4113
|
+
agent: Agent;
|
|
4114
|
+
}
|
|
4115
|
+
export interface GetAgentByIdResponse {
|
|
4116
|
+
agent: Agent;
|
|
4117
|
+
}
|
|
4118
|
+
export interface UpdateAgentByIdResponse {
|
|
4119
|
+
agent: Agent;
|
|
4120
|
+
}
|
|
4121
|
+
export interface AttachAgentSenderBody {
|
|
4122
|
+
/** Sender to connect. */
|
|
4123
|
+
senderId: string;
|
|
4124
|
+
}
|
|
4125
|
+
export interface AttachAgentSenderResponse {
|
|
4126
|
+
agent: Agent;
|
|
4127
|
+
}
|
|
4128
|
+
export interface ListAgentVoicesResponse {
|
|
4129
|
+
items: Array<ListAgentVoicesResponseItemsItem>;
|
|
4130
|
+
/** Languages an agent can be pinned to. `auto` follows the caller. */
|
|
4131
|
+
languages: Array<string>;
|
|
4132
|
+
/** Voices in the catalog, before filtering. */
|
|
4133
|
+
total?: number;
|
|
4134
|
+
}
|
|
4135
|
+
export interface ListAgentVoicesResponseItemsItem {
|
|
4136
|
+
/** Value for `voice.ttsVoiceId`. */
|
|
4137
|
+
id: string;
|
|
4138
|
+
name: string;
|
|
4139
|
+
language: string;
|
|
4140
|
+
}
|
|
4141
|
+
/** Params for `addresses.create`. */
|
|
4142
|
+
export interface AddressesCreateParams extends AddressCreateRequest {
|
|
4143
|
+
}
|
|
4144
|
+
/** Params for `addresses.list`. */
|
|
4145
|
+
export interface AddressesListParams {
|
|
4146
|
+
/** @defaultValue `50` */
|
|
4147
|
+
limit?: number;
|
|
4148
|
+
cursor?: string;
|
|
4149
|
+
}
|
|
4150
|
+
/** Params for `agents.create`. */
|
|
4151
|
+
export interface AgentsCreateParams extends AgentCreateStandaloneRequest {
|
|
4152
|
+
}
|
|
4153
|
+
/** Params for `agents.update`. */
|
|
4154
|
+
export interface AgentsUpdateParams extends AgentUpdateRequest {
|
|
4155
|
+
}
|
|
4156
|
+
/** Params for `agents.list`. */
|
|
4157
|
+
export interface AgentsListParams {
|
|
4158
|
+
/** @defaultValue `50` */
|
|
4159
|
+
limit?: number;
|
|
4160
|
+
cursor?: string;
|
|
4161
|
+
}
|
|
4162
|
+
/** Params for `agents.listVoices`. */
|
|
4163
|
+
export interface AgentsListVoicesParams {
|
|
4164
|
+
/** BCP-47 tag (`en`, `es`, `pt-BR`). Omit, or pass `auto`, for every voice. */
|
|
4165
|
+
language?: string;
|
|
4166
|
+
}
|
|
4167
|
+
/** Params for `agents.test`. */
|
|
4168
|
+
export interface AgentsTestParams extends AgentTestRequest {
|
|
4169
|
+
}
|
|
4170
|
+
/** Params for `agents.senders.connect`. */
|
|
4171
|
+
export interface AgentsSendersConnectParams extends AttachAgentSenderBody {
|
|
4172
|
+
}
|
|
4173
|
+
/** Params for `agents.senders.disconnect`. */
|
|
4174
|
+
export interface AgentsSendersDisconnectParams {
|
|
4175
|
+
/** Agent ID. */
|
|
4176
|
+
agentId: string;
|
|
4177
|
+
}
|
|
4178
|
+
/** Params for `broadcasts.create`. */
|
|
4179
|
+
export interface BroadcastsCreateParams extends BroadcastCreateRequest {
|
|
4180
|
+
}
|
|
4181
|
+
/** Params for `broadcasts.update`. */
|
|
4182
|
+
export interface BroadcastsUpdateParams extends BroadcastUpdateRequest {
|
|
4183
|
+
}
|
|
4184
|
+
/** Params for `broadcasts.list`. */
|
|
4185
|
+
export interface BroadcastsListParams {
|
|
4186
|
+
status?: BroadcastStatus;
|
|
4187
|
+
/** @defaultValue `50` */
|
|
4188
|
+
limit?: number;
|
|
4189
|
+
cursor?: string;
|
|
4190
|
+
}
|
|
4191
|
+
/** Params for `broadcasts.reschedule`. */
|
|
4192
|
+
export interface BroadcastsRescheduleParams extends BroadcastRescheduleRequest {
|
|
4193
|
+
}
|
|
4194
|
+
/** Params for `broadcasts.send`. */
|
|
4195
|
+
export interface BroadcastsSendParams extends BroadcastSendRequest {
|
|
4196
|
+
}
|
|
4197
|
+
/** Params for `broadcasts.contacts.list`. */
|
|
4198
|
+
export interface BroadcastsContactsListParams {
|
|
4199
|
+
status?: BroadcastContactStatus;
|
|
4200
|
+
/** @defaultValue `50` */
|
|
4201
|
+
limit?: number;
|
|
4202
|
+
cursor?: string;
|
|
4203
|
+
}
|
|
4204
|
+
/** Params for `broadcasts.contacts.add`. */
|
|
4205
|
+
export interface BroadcastsContactsAddParams extends BroadcastContactsAddRequest {
|
|
4206
|
+
}
|
|
4207
|
+
/** Params for `broadcasts.contacts.remove`. */
|
|
4208
|
+
export interface BroadcastsContactsRemoveParams {
|
|
4209
|
+
broadcastId: string;
|
|
4210
|
+
}
|
|
4211
|
+
/** Params for `calls.create`. */
|
|
4212
|
+
export interface CallsCreateParams extends VoiceCallCreateRequest {
|
|
4213
|
+
}
|
|
4214
|
+
/** Params for `calls.list`. */
|
|
4215
|
+
export interface CallsListParams {
|
|
4216
|
+
status?: VoiceCallStatus;
|
|
4217
|
+
direction?: VoiceCallDirection;
|
|
4218
|
+
/** Keep only calls placed or received by this sender. */
|
|
4219
|
+
senderId?: string;
|
|
4220
|
+
/** @defaultValue `50` */
|
|
4221
|
+
limit?: number;
|
|
4222
|
+
cursor?: string;
|
|
4223
|
+
}
|
|
4224
|
+
/** Params for `contacts.create`. */
|
|
4225
|
+
export interface ContactsCreateParams extends ContactCreateRequest {
|
|
4226
|
+
}
|
|
4227
|
+
/** Params for `contacts.update`. */
|
|
4228
|
+
export interface ContactsUpdateParams extends ContactUpdateRequest {
|
|
4229
|
+
}
|
|
4230
|
+
/** Params for `contacts.list`. */
|
|
4231
|
+
export interface ContactsListParams {
|
|
4232
|
+
/** Exact match on the contact's primary phone number, in E.164. */
|
|
4233
|
+
phoneNumber?: string;
|
|
4234
|
+
/**
|
|
4235
|
+
* Free-text match over the contact's name (`displayName` and the WhatsApp profile
|
|
4236
|
+
* name), phone numbers and email addresses. Case- and accent-insensitive. A phone
|
|
4237
|
+
* number matches on a trailing fragment too, so `5551234` finds `+14155551234`.
|
|
4238
|
+
*
|
|
4239
|
+
* Contacts created automatically from an inbound message have no `displayName` —
|
|
4240
|
+
* they are matched by their identifier until you set one with `PATCH
|
|
4241
|
+
* /v1/contacts/{contactId}`.
|
|
4242
|
+
*
|
|
4243
|
+
* Results come back in relevance order rather than newest-first. `cursor` is
|
|
4244
|
+
* opaque in both modes; pass back exactly what the previous response returned, and
|
|
4245
|
+
* start a new pagination run when the search term changes.
|
|
4246
|
+
*/
|
|
4247
|
+
search?: string;
|
|
4248
|
+
/**
|
|
4249
|
+
* Tag name. Repeatable: `?tag=vip&tag=chile` returns contacts carrying **every**
|
|
4250
|
+
* tag given, not any of them — the same rule the dashboard filter applies.
|
|
4251
|
+
*
|
|
4252
|
+
* Tags are matched by name, case-insensitively. An unknown tag returns 400 rather
|
|
4253
|
+
* than being ignored, because a typo that silently matched every contact would be
|
|
4254
|
+
* a worse answer than an error.
|
|
4255
|
+
*/
|
|
4256
|
+
tag?: Array<string>;
|
|
4257
|
+
/** @defaultValue `50` */
|
|
4258
|
+
limit?: number;
|
|
4259
|
+
/** Opaque cursor from a previous response's `nextCursor`. Do not construct it. */
|
|
4260
|
+
cursor?: string;
|
|
4261
|
+
}
|
|
4262
|
+
/** Params for `contacts.merge`. */
|
|
4263
|
+
export interface ContactsMergeParams extends MergeContactsRequest {
|
|
4264
|
+
}
|
|
4265
|
+
/** Params for `contacts.channels.update`. */
|
|
4266
|
+
export interface ContactsChannelsUpdateParams extends UpdateChannelRequest {
|
|
4267
|
+
contactId: string;
|
|
4268
|
+
}
|
|
4269
|
+
/** Params for `contacts.channels.add`. */
|
|
4270
|
+
export interface ContactsChannelsAddParams extends AddChannelRequest {
|
|
4271
|
+
}
|
|
4272
|
+
/** Params for `contacts.channels.remove`. */
|
|
4273
|
+
export interface ContactsChannelsRemoveParams {
|
|
4274
|
+
contactId: string;
|
|
4275
|
+
}
|
|
4276
|
+
/** Params for `contacts.channels.setPrimary`. */
|
|
4277
|
+
export interface ContactsChannelsSetPrimaryParams {
|
|
4278
|
+
contactId: string;
|
|
4279
|
+
}
|
|
4280
|
+
/** Params for `conversations.list`. */
|
|
4281
|
+
export interface ConversationsListParams {
|
|
4282
|
+
/** Keep only threads that have carried this channel. */
|
|
4283
|
+
channel?: ListConversationsChannel;
|
|
4284
|
+
/** Keep only threads last handled by this sender. */
|
|
4285
|
+
senderId?: string;
|
|
4286
|
+
/**
|
|
4287
|
+
* Search threads by identity: phone number (any format — `+1 (555) 123-4567` and
|
|
4288
|
+
* `15551234567` both match), email address (full or local part), WhatsApp
|
|
4289
|
+
* username, or BSUID. Matching is by whole word, with prefix matching on the last
|
|
4290
|
+
* term, so `mar` finds `maria@example.com` and `+1555` finds `+15551234567`; a
|
|
4291
|
+
* fragment from the middle or end of a number (`4567`) does not match.
|
|
4292
|
+
*
|
|
4293
|
+
* It does **not** search message bodies — only who the thread is with.
|
|
4294
|
+
*
|
|
4295
|
+
* Results come back ranked by relevance rather than by recency, so the usual "most
|
|
4296
|
+
* recently active first" ordering does not apply while `q` is set. `senderId` and
|
|
4297
|
+
* `channel` still narrow the results, and `cursor` paginates them as usual. An
|
|
4298
|
+
* empty or whitespace-only `q` returns no items rather than the full list.
|
|
4299
|
+
*/
|
|
4300
|
+
search?: string;
|
|
4301
|
+
/** @defaultValue `50` */
|
|
4302
|
+
limit?: number;
|
|
4303
|
+
/** Opaque cursor from a previous response's `nextCursor`. Do not construct it. */
|
|
4304
|
+
cursor?: string;
|
|
4305
|
+
}
|
|
4306
|
+
/** Params for `conversations.listMessages`. */
|
|
4307
|
+
export interface ConversationsListMessagesParams {
|
|
4308
|
+
/** @defaultValue `50` */
|
|
4309
|
+
limit?: number;
|
|
4310
|
+
/** Opaque cursor from a previous response's `nextCursor`. */
|
|
4311
|
+
cursor?: string;
|
|
4312
|
+
}
|
|
4313
|
+
/** Params for `emailDomains.create`. */
|
|
4314
|
+
export interface EmailDomainsCreateParams extends AddEmailDomainBody {
|
|
4315
|
+
}
|
|
4316
|
+
/** Params for `functions.create`. */
|
|
4317
|
+
export interface FunctionsCreateParams extends FunctionCreateRequest {
|
|
4318
|
+
}
|
|
4319
|
+
/** Params for `functions.update`. */
|
|
4320
|
+
export interface FunctionsUpdateParams extends FunctionUpdateRequest {
|
|
4321
|
+
}
|
|
4322
|
+
/** Params for `functions.deploy`. */
|
|
4323
|
+
export interface FunctionsDeployParams extends FunctionDeployRequest {
|
|
4324
|
+
}
|
|
4325
|
+
/** Params for `functions.listDeployments`. */
|
|
4326
|
+
export interface FunctionsListDeploymentsParams {
|
|
4327
|
+
/** @defaultValue `50` */
|
|
4328
|
+
limit?: number;
|
|
4329
|
+
}
|
|
4330
|
+
/** Params for `functions.rollbackDeployment`. */
|
|
4331
|
+
export interface FunctionsRollbackDeploymentParams extends RollbackFunctionBody {
|
|
4332
|
+
}
|
|
4333
|
+
/** Params for `functions.tailLogs`. */
|
|
4334
|
+
export interface FunctionsTailLogsParams {
|
|
4335
|
+
/** @defaultValue `100` */
|
|
4336
|
+
limit?: number;
|
|
4337
|
+
nextToken?: string;
|
|
4338
|
+
/** Start of the log window in Unix epoch milliseconds. */
|
|
4339
|
+
startTime?: number;
|
|
4340
|
+
/** End of the log window in Unix epoch milliseconds. */
|
|
4341
|
+
endTime?: number;
|
|
4342
|
+
filterPattern?: string;
|
|
4343
|
+
}
|
|
4344
|
+
/** Params for `functions.gitLink.update`. */
|
|
4345
|
+
export interface FunctionsGitLinkUpdateParams extends UpdateFunctionGitLinkBody {
|
|
4346
|
+
}
|
|
4347
|
+
/** Params for `functions.gitLink.link`. */
|
|
4348
|
+
export interface FunctionsGitLinkLinkParams extends CreateFunctionGitLinkBody {
|
|
4349
|
+
}
|
|
4350
|
+
/** Params for `functions.secrets.set`. */
|
|
4351
|
+
export interface FunctionsSecretsSetParams extends SetFunctionSecretBody {
|
|
4352
|
+
/** Zavu Function ID. */
|
|
4353
|
+
functionId: string;
|
|
4354
|
+
}
|
|
4355
|
+
/** Params for `functions.secrets.unset`. */
|
|
4356
|
+
export interface FunctionsSecretsUnsetParams {
|
|
4357
|
+
/** Zavu Function ID. */
|
|
4358
|
+
functionId: string;
|
|
4359
|
+
}
|
|
4360
|
+
/** Params for `functions.triggers.create`. */
|
|
4361
|
+
export interface FunctionsTriggersCreateParams extends CreateFunctionTriggersBody {
|
|
4362
|
+
}
|
|
4363
|
+
/** Params for `functions.triggers.update`. */
|
|
4364
|
+
export interface FunctionsTriggersUpdateParams extends UpdateFunctionTriggerBody {
|
|
4365
|
+
}
|
|
4366
|
+
/** Params for `introspect.validateEmail`. */
|
|
4367
|
+
export interface IntrospectValidateEmailParams extends EmailIntrospectionRequest {
|
|
4368
|
+
}
|
|
4369
|
+
/** Params for `introspect.validatePhone`. */
|
|
4370
|
+
export interface IntrospectValidatePhoneParams extends PhoneIntrospectionRequest {
|
|
4371
|
+
}
|
|
4372
|
+
/** Params for `invitations.create`. */
|
|
4373
|
+
export interface InvitationsCreateParams extends InvitationCreateRequest {
|
|
4374
|
+
}
|
|
4375
|
+
/** Params for `invitations.list`. */
|
|
4376
|
+
export interface InvitationsListParams {
|
|
4377
|
+
status?: InvitationStatus;
|
|
4378
|
+
/** @defaultValue `50` */
|
|
4379
|
+
limit?: number;
|
|
4380
|
+
cursor?: string;
|
|
4381
|
+
}
|
|
4382
|
+
/** Params for `invitations.webhook.configure`. */
|
|
4383
|
+
export interface InvitationsWebhookConfigureParams extends ProjectWebhookCreateRequest {
|
|
4384
|
+
}
|
|
4385
|
+
/** Params for `invitations.webhook.update`. */
|
|
4386
|
+
export interface InvitationsWebhookUpdateParams extends ProjectWebhookUpdateRequest {
|
|
4387
|
+
}
|
|
4388
|
+
/** Params for `messages.list`. */
|
|
4389
|
+
export interface MessagesListParams {
|
|
4390
|
+
/**
|
|
4391
|
+
* Filter by status. Not all stored statuses are filterable. `received` returns
|
|
4392
|
+
* inbound messages only (messages your contacts sent you). Inbound messages report
|
|
4393
|
+
* `status: delivered`, so `delivered` returns them together with delivered
|
|
4394
|
+
* outbound messages; use `received` to list inbound messages alone.
|
|
4395
|
+
*/
|
|
4396
|
+
status?: ListMessagesStatus;
|
|
4397
|
+
to?: string;
|
|
4398
|
+
/** Filter by delivery channel. */
|
|
4399
|
+
channel?: ListMessagesChannel;
|
|
4400
|
+
/** @defaultValue `50` */
|
|
4401
|
+
limit?: number;
|
|
4402
|
+
cursor?: string;
|
|
4403
|
+
}
|
|
4404
|
+
/** Params for `messages.react`. */
|
|
4405
|
+
export interface MessagesReactParams extends ReactionRequest {
|
|
4406
|
+
/**
|
|
4407
|
+
* Optional sender profile ID. If omitted, the project's default sender will be
|
|
4408
|
+
* used.
|
|
4409
|
+
*/
|
|
4410
|
+
'Zavu-Sender'?: string;
|
|
4411
|
+
}
|
|
4412
|
+
/** Params for `messages.send`. */
|
|
4413
|
+
export interface MessagesSendParams extends MessageRequest {
|
|
4414
|
+
/**
|
|
4415
|
+
* Optional sender profile ID. If omitted, the project's default sender will be
|
|
4416
|
+
* used.
|
|
4417
|
+
*/
|
|
4418
|
+
'Zavu-Sender'?: string;
|
|
4419
|
+
}
|
|
4420
|
+
/** Params for `messages.showTyping`. */
|
|
4421
|
+
export interface MessagesShowTypingParams {
|
|
4422
|
+
/**
|
|
4423
|
+
* Optional sender profile ID. If omitted, the project's default sender will be
|
|
4424
|
+
* used.
|
|
4425
|
+
*/
|
|
4426
|
+
'Zavu-Sender'?: string;
|
|
4427
|
+
}
|
|
4428
|
+
/** Params for `number10dlc.brands.create`. */
|
|
4429
|
+
export interface Number10dlcBrandsCreateParams extends TenDlcBrandCreateRequest {
|
|
4430
|
+
}
|
|
4431
|
+
/** Params for `number10dlc.brands.update`. */
|
|
4432
|
+
export interface Number10dlcBrandsUpdateParams extends TenDlcBrandUpdateRequest {
|
|
4433
|
+
}
|
|
4434
|
+
/** Params for `number10dlc.brands.list`. */
|
|
4435
|
+
export interface Number10dlcBrandsListParams {
|
|
4436
|
+
/** @defaultValue `50` */
|
|
4437
|
+
limit?: number;
|
|
4438
|
+
cursor?: string;
|
|
4439
|
+
}
|
|
4440
|
+
/** Params for `number10dlc.campaigns.create`. */
|
|
4441
|
+
export interface Number10dlcCampaignsCreateParams extends TenDlcCampaignCreateRequest {
|
|
4442
|
+
}
|
|
4443
|
+
/** Params for `number10dlc.campaigns.update`. */
|
|
4444
|
+
export interface Number10dlcCampaignsUpdateParams extends TenDlcCampaignUpdateRequest {
|
|
4445
|
+
}
|
|
4446
|
+
/** Params for `number10dlc.campaigns.list`. */
|
|
4447
|
+
export interface Number10dlcCampaignsListParams {
|
|
4448
|
+
/** Filter campaigns by brand ID. */
|
|
4449
|
+
brandId?: string;
|
|
4450
|
+
/** @defaultValue `50` */
|
|
4451
|
+
limit?: number;
|
|
4452
|
+
cursor?: string;
|
|
4453
|
+
}
|
|
4454
|
+
/** Params for `number10dlc.campaigns.phoneNumbers.list`. */
|
|
4455
|
+
export interface Number10dlcCampaignsPhoneNumbersListParams {
|
|
4456
|
+
/** @defaultValue `50` */
|
|
4457
|
+
limit?: number;
|
|
4458
|
+
/** Opaque cursor from a previous response's `nextCursor`. */
|
|
4459
|
+
cursor?: string;
|
|
4460
|
+
}
|
|
4461
|
+
/** Params for `number10dlc.campaigns.phoneNumbers.assign`. */
|
|
4462
|
+
export interface Number10dlcCampaignsPhoneNumbersAssignParams extends TenDlcPhoneNumberAssignRequest {
|
|
4463
|
+
}
|
|
4464
|
+
/** Params for `number10dlc.campaigns.phoneNumbers.unassign`. */
|
|
4465
|
+
export interface Number10dlcCampaignsPhoneNumbersUnassignParams {
|
|
4466
|
+
/** 10DLC campaign ID. */
|
|
4467
|
+
campaignId: string;
|
|
4468
|
+
}
|
|
4469
|
+
/** Params for `phoneNumbers.update`. */
|
|
4470
|
+
export interface PhoneNumbersUpdateParams extends PhoneNumberUpdateRequest {
|
|
4471
|
+
}
|
|
4472
|
+
/** Params for `phoneNumbers.list`. */
|
|
4473
|
+
export interface PhoneNumbersListParams {
|
|
4474
|
+
/** Filter by phone number status. */
|
|
4475
|
+
status?: PhoneNumberStatus;
|
|
4476
|
+
/** @defaultValue `50` */
|
|
4477
|
+
limit?: number;
|
|
4478
|
+
/** Pagination cursor. */
|
|
4479
|
+
cursor?: string;
|
|
4480
|
+
}
|
|
4481
|
+
/** Params for `phoneNumbers.purchase`. */
|
|
4482
|
+
export interface PhoneNumbersPurchaseParams extends PhoneNumberPurchaseRequest {
|
|
4483
|
+
}
|
|
4484
|
+
/** Params for `phoneNumbers.requirements`. */
|
|
4485
|
+
export interface PhoneNumbersRequirementsParams {
|
|
4486
|
+
/** Two-letter ISO country code. Required unless `phoneNumber` is given. */
|
|
4487
|
+
countryCode?: string;
|
|
4488
|
+
/**
|
|
4489
|
+
* Type of phone number (local, national, mobile, tollFree). Defaults to `local`.
|
|
4490
|
+
* With `phoneNumber`, used only when the number's own requirements cannot be
|
|
4491
|
+
* resolved and the country list is returned.
|
|
4492
|
+
*/
|
|
4493
|
+
type?: PhoneNumberType;
|
|
4494
|
+
/**
|
|
4495
|
+
* E.164 number from `GET /v1/phone-numbers/available`, with `+` encoded as `%2B`.
|
|
4496
|
+
* Returns the requirements the purchase of that number checks. Takes precedence
|
|
4497
|
+
* over `countryCode`.
|
|
4498
|
+
*/
|
|
4499
|
+
phoneNumber?: string;
|
|
4500
|
+
}
|
|
4501
|
+
/** Params for `phoneNumbers.searchAvailable`. */
|
|
4502
|
+
export interface PhoneNumbersSearchAvailableParams {
|
|
4503
|
+
/** Two-letter ISO country code. */
|
|
4504
|
+
countryCode: string;
|
|
4505
|
+
/** Type of phone number to search for. */
|
|
4506
|
+
type?: PhoneNumberType;
|
|
4507
|
+
/** Search for numbers containing this string. */
|
|
4508
|
+
contains?: string;
|
|
4509
|
+
/**
|
|
4510
|
+
* Comma-separated capabilities the number must have: `sms`, `voice`, `mms`.
|
|
4511
|
+
* Numbers missing any of them are dropped.
|
|
4512
|
+
*/
|
|
4513
|
+
capabilities?: string;
|
|
4514
|
+
/**
|
|
4515
|
+
* Maximum number of results to return.
|
|
4516
|
+
*
|
|
4517
|
+
* @defaultValue `10`
|
|
4518
|
+
*/
|
|
4519
|
+
limit?: number;
|
|
4520
|
+
}
|
|
4521
|
+
/** Params for `regulatoryDocuments.create`. */
|
|
4522
|
+
export interface RegulatoryDocumentsCreateParams extends RegulatoryDocumentCreateRequest {
|
|
4523
|
+
}
|
|
4524
|
+
/** Params for `regulatoryDocuments.list`. */
|
|
4525
|
+
export interface RegulatoryDocumentsListParams {
|
|
4526
|
+
/** @defaultValue `50` */
|
|
4527
|
+
limit?: number;
|
|
4528
|
+
cursor?: string;
|
|
4529
|
+
}
|
|
4530
|
+
/** Params for `senders.create`. */
|
|
4531
|
+
export interface SendersCreateParams extends SenderCreateRequest {
|
|
4532
|
+
}
|
|
4533
|
+
/** Params for `senders.update`. */
|
|
4534
|
+
export interface SendersUpdateParams extends SenderUpdateRequest {
|
|
4535
|
+
}
|
|
4536
|
+
/** Params for `senders.list`. */
|
|
4537
|
+
export interface SendersListParams {
|
|
4538
|
+
/** @defaultValue `50` */
|
|
4539
|
+
limit?: number;
|
|
4540
|
+
cursor?: string;
|
|
4541
|
+
}
|
|
4542
|
+
/** Params for `senders.updateProfile`. */
|
|
4543
|
+
export interface SendersUpdateProfileParams extends WhatsAppBusinessProfileUpdateRequest {
|
|
4544
|
+
}
|
|
4545
|
+
/** Params for `senders.uploadProfilePicture`. */
|
|
4546
|
+
export interface SendersUploadProfilePictureParams extends WhatsAppBusinessProfilePictureRequest {
|
|
4547
|
+
}
|
|
4548
|
+
/** Params for `senders.agent.create`. */
|
|
4549
|
+
export interface SendersAgentCreateParams extends AgentCreateRequest {
|
|
4550
|
+
}
|
|
4551
|
+
/** Params for `senders.agent.update`. */
|
|
4552
|
+
export interface SendersAgentUpdateParams extends AgentUpdateRequest {
|
|
4553
|
+
}
|
|
4554
|
+
/** Params for `senders.agent.executions.retrieve`. */
|
|
4555
|
+
export interface SendersAgentExecutionsRetrieveParams {
|
|
4556
|
+
senderId: string;
|
|
4557
|
+
}
|
|
4558
|
+
/** Params for `senders.agent.executions.list`. */
|
|
4559
|
+
export interface SendersAgentExecutionsListParams {
|
|
4560
|
+
status?: AgentExecutionStatus;
|
|
4561
|
+
/** @defaultValue `50` */
|
|
4562
|
+
limit?: number;
|
|
4563
|
+
cursor?: string;
|
|
4564
|
+
}
|
|
4565
|
+
/** Params for `senders.agent.flows.create`. */
|
|
4566
|
+
export interface SendersAgentFlowsCreateParams extends FlowCreateRequest {
|
|
4567
|
+
}
|
|
4568
|
+
/** Params for `senders.agent.flows.retrieve`. */
|
|
4569
|
+
export interface SendersAgentFlowsRetrieveParams {
|
|
4570
|
+
senderId: string;
|
|
4571
|
+
}
|
|
4572
|
+
/** Params for `senders.agent.flows.update`. */
|
|
4573
|
+
export interface SendersAgentFlowsUpdateParams extends FlowUpdateRequest {
|
|
4574
|
+
senderId: string;
|
|
4575
|
+
}
|
|
4576
|
+
/** Params for `senders.agent.flows.list`. */
|
|
4577
|
+
export interface SendersAgentFlowsListParams {
|
|
4578
|
+
enabled?: boolean;
|
|
4579
|
+
/** @defaultValue `50` */
|
|
4580
|
+
limit?: number;
|
|
4581
|
+
cursor?: string;
|
|
4582
|
+
}
|
|
4583
|
+
/** Params for `senders.agent.flows.delete`. */
|
|
4584
|
+
export interface SendersAgentFlowsDeleteParams {
|
|
4585
|
+
senderId: string;
|
|
4586
|
+
}
|
|
4587
|
+
/** Params for `senders.agent.flows.duplicate`. */
|
|
4588
|
+
export interface SendersAgentFlowsDuplicateParams extends FlowDuplicateRequest {
|
|
4589
|
+
senderId: string;
|
|
4590
|
+
}
|
|
4591
|
+
/** Params for `senders.agent.knowledgeBases.create`. */
|
|
4592
|
+
export interface SendersAgentKnowledgeBasesCreateParams extends KnowledgeBaseCreateRequest {
|
|
4593
|
+
}
|
|
4594
|
+
/** Params for `senders.agent.knowledgeBases.retrieve`. */
|
|
4595
|
+
export interface SendersAgentKnowledgeBasesRetrieveParams {
|
|
4596
|
+
senderId: string;
|
|
4597
|
+
}
|
|
4598
|
+
/** Params for `senders.agent.knowledgeBases.update`. */
|
|
4599
|
+
export interface SendersAgentKnowledgeBasesUpdateParams extends KnowledgeBaseUpdateRequest {
|
|
4600
|
+
senderId: string;
|
|
4601
|
+
}
|
|
4602
|
+
/** Params for `senders.agent.knowledgeBases.list`. */
|
|
4603
|
+
export interface SendersAgentKnowledgeBasesListParams {
|
|
4604
|
+
/** @defaultValue `50` */
|
|
4605
|
+
limit?: number;
|
|
4606
|
+
cursor?: string;
|
|
4607
|
+
}
|
|
4608
|
+
/** Params for `senders.agent.knowledgeBases.delete`. */
|
|
4609
|
+
export interface SendersAgentKnowledgeBasesDeleteParams {
|
|
4610
|
+
senderId: string;
|
|
4611
|
+
}
|
|
4612
|
+
/** Params for `senders.agent.knowledgeBases.documents.create`. */
|
|
4613
|
+
export interface SendersAgentKnowledgeBasesDocumentsCreateParams extends DocumentCreateRequest {
|
|
4614
|
+
senderId: string;
|
|
4615
|
+
}
|
|
4616
|
+
/** Params for `senders.agent.knowledgeBases.documents.list`. */
|
|
4617
|
+
export interface SendersAgentKnowledgeBasesDocumentsListParams {
|
|
4618
|
+
senderId: string;
|
|
4619
|
+
/** @defaultValue `50` */
|
|
4620
|
+
limit?: number;
|
|
4621
|
+
cursor?: string;
|
|
4622
|
+
}
|
|
4623
|
+
/** Params for `senders.agent.knowledgeBases.documents.delete`. */
|
|
4624
|
+
export interface SendersAgentKnowledgeBasesDocumentsDeleteParams {
|
|
4625
|
+
senderId: string;
|
|
4626
|
+
kbId: string;
|
|
4627
|
+
}
|
|
4628
|
+
/** Params for `senders.agent.knowledgeBases.documents.retrieveDocument`. */
|
|
4629
|
+
export interface SendersAgentKnowledgeBasesDocumentsRetrieveDocumentParams {
|
|
4630
|
+
senderId: string;
|
|
4631
|
+
kbId: string;
|
|
4632
|
+
}
|
|
4633
|
+
/** Params for `senders.agent.knowledgeBases.documents.updateDocument`. */
|
|
4634
|
+
export interface SendersAgentKnowledgeBasesDocumentsUpdateDocumentParams extends DocumentUpdateRequest {
|
|
4635
|
+
senderId: string;
|
|
4636
|
+
kbId: string;
|
|
4637
|
+
}
|
|
4638
|
+
/** Params for `senders.agent.tools.create`. */
|
|
4639
|
+
export interface SendersAgentToolsCreateParams extends ToolCreateRequest {
|
|
4640
|
+
}
|
|
4641
|
+
/** Params for `senders.agent.tools.retrieve`. */
|
|
4642
|
+
export interface SendersAgentToolsRetrieveParams {
|
|
4643
|
+
senderId: string;
|
|
4644
|
+
}
|
|
4645
|
+
/** Params for `senders.agent.tools.update`. */
|
|
4646
|
+
export interface SendersAgentToolsUpdateParams extends ToolUpdateRequest {
|
|
4647
|
+
senderId: string;
|
|
4648
|
+
}
|
|
4649
|
+
/** Params for `senders.agent.tools.list`. */
|
|
4650
|
+
export interface SendersAgentToolsListParams {
|
|
4651
|
+
enabled?: boolean;
|
|
4652
|
+
/** @defaultValue `50` */
|
|
4653
|
+
limit?: number;
|
|
4654
|
+
cursor?: string;
|
|
4655
|
+
}
|
|
4656
|
+
/** Params for `senders.agent.tools.delete`. */
|
|
4657
|
+
export interface SendersAgentToolsDeleteParams {
|
|
4658
|
+
senderId: string;
|
|
4659
|
+
}
|
|
4660
|
+
/** Params for `senders.agent.tools.listTestRuns`. */
|
|
4661
|
+
export interface SendersAgentToolsListTestRunsParams {
|
|
4662
|
+
senderId: string;
|
|
4663
|
+
/** @defaultValue `20` */
|
|
4664
|
+
limit?: number;
|
|
4665
|
+
}
|
|
4666
|
+
/** Params for `senders.agent.tools.test`. */
|
|
4667
|
+
export interface SendersAgentToolsTestParams extends ToolTestRequest {
|
|
4668
|
+
senderId: string;
|
|
4669
|
+
}
|
|
4670
|
+
/** Params for `senders.agent.tools.webhook.rotateSecret`. */
|
|
4671
|
+
export interface SendersAgentToolsWebhookRotateSecretParams {
|
|
4672
|
+
senderId: string;
|
|
4673
|
+
}
|
|
4674
|
+
/** Params for `senders.telegram.connect`. */
|
|
4675
|
+
export interface SendersTelegramConnectParams extends ConnectSenderTelegramBody {
|
|
4676
|
+
}
|
|
4677
|
+
/** Params for `senders.channels.activate`. */
|
|
4678
|
+
export interface SendersChannelsActivateParams {
|
|
4679
|
+
senderId: string;
|
|
4680
|
+
}
|
|
4681
|
+
/** Params for `senders.channels.deactivate`. */
|
|
4682
|
+
export interface SendersChannelsDeactivateParams {
|
|
4683
|
+
senderId: string;
|
|
4684
|
+
}
|
|
4685
|
+
/** Params for `subAccounts.create`. */
|
|
4686
|
+
export interface SubAccountsCreateParams extends SubAccountCreateRequest {
|
|
4687
|
+
}
|
|
4688
|
+
/** Params for `subAccounts.update`. */
|
|
4689
|
+
export interface SubAccountsUpdateParams extends SubAccountUpdateRequest {
|
|
4690
|
+
}
|
|
4691
|
+
/** Params for `subAccounts.list`. */
|
|
4692
|
+
export interface SubAccountsListParams {
|
|
4693
|
+
/** @defaultValue `50` */
|
|
4694
|
+
limit?: number;
|
|
4695
|
+
cursor?: string;
|
|
4696
|
+
}
|
|
4697
|
+
/** Params for `subAccounts.apiKeys.create`. */
|
|
4698
|
+
export interface SubAccountsApiKeysCreateParams extends SubAccountApiKeyCreateRequest {
|
|
4699
|
+
}
|
|
4700
|
+
/** Params for `subAccounts.apiKeys.revoke`. */
|
|
4701
|
+
export interface SubAccountsApiKeysRevokeParams {
|
|
4702
|
+
/** Sub-account ID. */
|
|
4703
|
+
id: string;
|
|
4704
|
+
}
|
|
4705
|
+
/** Params for `templates.create`. */
|
|
4706
|
+
export interface TemplatesCreateParams extends TemplateCreateRequest {
|
|
4707
|
+
}
|
|
4708
|
+
/** Params for `templates.list`. */
|
|
4709
|
+
export interface TemplatesListParams {
|
|
4710
|
+
/** @defaultValue `50` */
|
|
4711
|
+
limit?: number;
|
|
4712
|
+
cursor?: string;
|
|
4713
|
+
}
|
|
4714
|
+
/** Params for `templates.submit`. */
|
|
4715
|
+
export interface TemplatesSubmitParams extends SubmitTemplateBody {
|
|
4716
|
+
}
|
|
4717
|
+
/** Params for `templates.sync`. */
|
|
4718
|
+
export interface TemplatesSyncParams extends SyncTemplatesBody {
|
|
4719
|
+
}
|
|
4720
|
+
/** Params for `urls.escalate`. */
|
|
4721
|
+
export interface UrlsEscalateParams extends EscalateUrlBody {
|
|
4722
|
+
}
|
|
4723
|
+
/** Params for `urls.listVerified`. */
|
|
4724
|
+
export interface UrlsListVerifiedParams {
|
|
4725
|
+
/** Filter by verification status. */
|
|
4726
|
+
status?: VerifiedUrlStatus;
|
|
4727
|
+
/** @defaultValue `50` */
|
|
4728
|
+
limit?: number;
|
|
4729
|
+
cursor?: string;
|
|
4730
|
+
}
|
|
4731
|
+
/** Params for `urls.submitForVerification`. */
|
|
4732
|
+
export interface UrlsSubmitForVerificationParams extends VerifiedUrlSubmitRequest {
|
|
4733
|
+
}
|
|
4734
|
+
/** Params for `memory.add`. */
|
|
4735
|
+
export interface MemoryAddParams extends MemoryAddRequest {
|
|
4736
|
+
}
|
|
4737
|
+
/** Params for `memory.list`. */
|
|
4738
|
+
export interface MemoryListParams {
|
|
4739
|
+
/**
|
|
4740
|
+
* Which scope to address: `contact:<contactId>`, `conversation:<conversationId>`,
|
|
4741
|
+
* or omitted for the project scope.
|
|
4742
|
+
*
|
|
4743
|
+
* Note the asymmetry with `POST /v1/memory` and `POST /v1/memory/search`, which
|
|
4744
|
+
* take the scope in the request BODY as `scope` plus `contactId`/`conversationId`.
|
|
4745
|
+
* Every other Memory endpoint takes it here.
|
|
4746
|
+
*/
|
|
4747
|
+
scope?: MemoryScopeQuery;
|
|
4748
|
+
/** @defaultValue `50` */
|
|
4749
|
+
limit?: number;
|
|
4750
|
+
/** Opaque cursor from a previous response's `nextCursor`. Do not construct it. */
|
|
4751
|
+
cursor?: string;
|
|
4752
|
+
}
|
|
4753
|
+
/** Params for `memory.wipe`. */
|
|
4754
|
+
export interface MemoryWipeParams {
|
|
4755
|
+
/**
|
|
4756
|
+
* Which scope to address: `contact:<contactId>`, `conversation:<conversationId>`,
|
|
4757
|
+
* or omitted for the project scope.
|
|
4758
|
+
*
|
|
4759
|
+
* Note the asymmetry with `POST /v1/memory` and `POST /v1/memory/search`, which
|
|
4760
|
+
* take the scope in the request BODY as `scope` plus `contactId`/`conversationId`.
|
|
4761
|
+
* Every other Memory endpoint takes it here.
|
|
4762
|
+
*/
|
|
4763
|
+
scope?: MemoryScopeQuery;
|
|
4764
|
+
}
|
|
4765
|
+
/** Params for `memory.search`. */
|
|
4766
|
+
export interface MemorySearchParams extends MemorySearchRequest {
|
|
4767
|
+
}
|
|
4768
|
+
/** Params for `memory.retrieve`. */
|
|
4769
|
+
export interface MemoryRetrieveParams {
|
|
4770
|
+
/**
|
|
4771
|
+
* Which scope to address: `contact:<contactId>`, `conversation:<conversationId>`,
|
|
4772
|
+
* or omitted for the project scope.
|
|
4773
|
+
*
|
|
4774
|
+
* Note the asymmetry with `POST /v1/memory` and `POST /v1/memory/search`, which
|
|
4775
|
+
* take the scope in the request BODY as `scope` plus `contactId`/`conversationId`.
|
|
4776
|
+
* Every other Memory endpoint takes it here.
|
|
4777
|
+
*/
|
|
4778
|
+
scope?: MemoryScopeQuery;
|
|
4779
|
+
}
|
|
4780
|
+
/** Params for `memory.delete`. */
|
|
4781
|
+
export interface MemoryDeleteParams {
|
|
4782
|
+
/**
|
|
4783
|
+
* Which scope to address: `contact:<contactId>`, `conversation:<conversationId>`,
|
|
4784
|
+
* or omitted for the project scope.
|
|
4785
|
+
*
|
|
4786
|
+
* Note the asymmetry with `POST /v1/memory` and `POST /v1/memory/search`, which
|
|
4787
|
+
* take the scope in the request BODY as `scope` plus `contactId`/`conversationId`.
|
|
4788
|
+
* Every other Memory endpoint takes it here.
|
|
4789
|
+
*/
|
|
4790
|
+
scope?: MemoryScopeQuery;
|
|
4791
|
+
}
|
|
4792
|
+
/** Params for `memory.collections.create`. */
|
|
4793
|
+
export interface MemoryCollectionsCreateParams extends MemoryCollectionCreateRequest {
|
|
4794
|
+
}
|
|
4795
|
+
/** Params for `memory.collections.list`. */
|
|
4796
|
+
export interface MemoryCollectionsListParams {
|
|
4797
|
+
/** @defaultValue `50` */
|
|
4798
|
+
limit?: number;
|
|
4799
|
+
cursor?: string;
|
|
4800
|
+
}
|
|
4801
|
+
/** Params for `memory.collections.update`. */
|
|
4802
|
+
export interface MemoryCollectionsUpdateParams extends MemoryCollectionUpdateRequest {
|
|
4803
|
+
}
|
|
4804
|
+
/** Params for `memory.collections.items.list`. */
|
|
4805
|
+
export interface MemoryCollectionsItemsListParams {
|
|
4806
|
+
/**
|
|
4807
|
+
* Which scope to address: `contact:<contactId>`, `conversation:<conversationId>`,
|
|
4808
|
+
* or omitted for the project scope.
|
|
4809
|
+
*
|
|
4810
|
+
* Note the asymmetry with `POST /v1/memory` and `POST /v1/memory/search`, which
|
|
4811
|
+
* take the scope in the request BODY as `scope` plus `contactId`/`conversationId`.
|
|
4812
|
+
* Every other Memory endpoint takes it here.
|
|
4813
|
+
*/
|
|
4814
|
+
scope?: MemoryScopeQuery;
|
|
4815
|
+
/** Only keys starting with this string. */
|
|
4816
|
+
prefix?: string;
|
|
4817
|
+
/** @defaultValue `50` */
|
|
4818
|
+
limit?: number;
|
|
4819
|
+
cursor?: string;
|
|
4820
|
+
}
|
|
4821
|
+
/** Params for `memory.collections.items.batch`. */
|
|
4822
|
+
export interface MemoryCollectionsItemsBatchParams extends MemoryItemBatchRequest {
|
|
4823
|
+
/**
|
|
4824
|
+
* Which scope to address: `contact:<contactId>`, `conversation:<conversationId>`,
|
|
4825
|
+
* or omitted for the project scope.
|
|
4826
|
+
*
|
|
4827
|
+
* Note the asymmetry with `POST /v1/memory` and `POST /v1/memory/search`, which
|
|
4828
|
+
* take the scope in the request BODY as `scope` plus `contactId`/`conversationId`.
|
|
4829
|
+
* Every other Memory endpoint takes it here.
|
|
4830
|
+
*/
|
|
4831
|
+
scope?: MemoryScopeQuery;
|
|
4832
|
+
}
|
|
4833
|
+
/** Params for `memory.collections.items.put`. */
|
|
4834
|
+
export interface MemoryCollectionsItemsPutParams extends MemoryItemPutRequest {
|
|
4835
|
+
/** Collection name. */
|
|
4836
|
+
collection: string;
|
|
4837
|
+
/**
|
|
4838
|
+
* Make the write conditional on the item's current revision, as returned by a
|
|
4839
|
+
* previous read or write (plain `3` or ETag-quoted `"3"`). The write is refused
|
|
4840
|
+
* with `409 revision_conflict` if the item moved on in between. Without it, the
|
|
4841
|
+
* write always wins and silently overwrites a concurrent one.
|
|
4842
|
+
*/
|
|
4843
|
+
'If-Match'?: string;
|
|
4844
|
+
/**
|
|
4845
|
+
* Which scope to address: `contact:<contactId>`, `conversation:<conversationId>`,
|
|
4846
|
+
* or omitted for the project scope.
|
|
4847
|
+
*
|
|
4848
|
+
* Note the asymmetry with `POST /v1/memory` and `POST /v1/memory/search`, which
|
|
4849
|
+
* take the scope in the request BODY as `scope` plus `contactId`/`conversationId`.
|
|
4850
|
+
* Every other Memory endpoint takes it here.
|
|
4851
|
+
*/
|
|
4852
|
+
scope?: MemoryScopeQuery;
|
|
4853
|
+
}
|
|
4854
|
+
/** Params for `memory.collections.items.retrieve`. */
|
|
4855
|
+
export interface MemoryCollectionsItemsRetrieveParams {
|
|
4856
|
+
/** Collection name. */
|
|
4857
|
+
collection: string;
|
|
4858
|
+
/**
|
|
4859
|
+
* Which scope to address: `contact:<contactId>`, `conversation:<conversationId>`,
|
|
4860
|
+
* or omitted for the project scope.
|
|
4861
|
+
*
|
|
4862
|
+
* Note the asymmetry with `POST /v1/memory` and `POST /v1/memory/search`, which
|
|
4863
|
+
* take the scope in the request BODY as `scope` plus `contactId`/`conversationId`.
|
|
4864
|
+
* Every other Memory endpoint takes it here.
|
|
4865
|
+
*/
|
|
4866
|
+
scope?: MemoryScopeQuery;
|
|
4867
|
+
}
|
|
4868
|
+
/** Params for `memory.collections.items.delete`. */
|
|
4869
|
+
export interface MemoryCollectionsItemsDeleteParams {
|
|
4870
|
+
/** Collection name. */
|
|
4871
|
+
collection: string;
|
|
4872
|
+
/**
|
|
4873
|
+
* Make the write conditional on the item's current revision, as returned by a
|
|
4874
|
+
* previous read or write (plain `3` or ETag-quoted `"3"`). The write is refused
|
|
4875
|
+
* with `409 revision_conflict` if the item moved on in between. Without it, the
|
|
4876
|
+
* write always wins and silently overwrites a concurrent one.
|
|
4877
|
+
*/
|
|
4878
|
+
'If-Match'?: string;
|
|
4879
|
+
/**
|
|
4880
|
+
* Which scope to address: `contact:<contactId>`, `conversation:<conversationId>`,
|
|
4881
|
+
* or omitted for the project scope.
|
|
4882
|
+
*
|
|
4883
|
+
* Note the asymmetry with `POST /v1/memory` and `POST /v1/memory/search`, which
|
|
4884
|
+
* take the scope in the request BODY as `scope` plus `contactId`/`conversationId`.
|
|
4885
|
+
* Every other Memory endpoint takes it here.
|
|
4886
|
+
*/
|
|
4887
|
+
scope?: MemoryScopeQuery;
|
|
4888
|
+
}
|
|
4889
|
+
/** Params for `memory.collections.items.query`. */
|
|
4890
|
+
export interface MemoryCollectionsItemsQueryParams extends MemoryItemQueryRequest {
|
|
4891
|
+
/**
|
|
4892
|
+
* Which scope to address: `contact:<contactId>`, `conversation:<conversationId>`,
|
|
4893
|
+
* or omitted for the project scope.
|
|
4894
|
+
*
|
|
4895
|
+
* Note the asymmetry with `POST /v1/memory` and `POST /v1/memory/search`, which
|
|
4896
|
+
* take the scope in the request BODY as `scope` plus `contactId`/`conversationId`.
|
|
4897
|
+
* Every other Memory endpoint takes it here.
|
|
4898
|
+
*/
|
|
4899
|
+
scope?: MemoryScopeQuery;
|
|
4900
|
+
}
|
|
4901
|
+
//# sourceMappingURL=types.d.mts.map
|