import { APIResource } from "../core/resource.js"; import { APIPromise } from "../core/api-promise.js"; import { RequestOptions } from "../internal/request-options.js"; export declare class App extends APIResource { /** * Create an App: the connection to one external system (a CRM, calendar, support * desk, and so on), holding its credentials and settings. Providers with * caller-managed credentials accept auth_config. Providers using OAuth must omit * auth_config and be authorized through connect-app. Providers supporting both * methods, such as Cal.com, also accept caller-managed API keys. Credentials are * stored encrypted and never returned. Up to 20 apps per provider by default, * unless a custom limit is configured for the organization. */ create(body: AppCreateParams, options?: RequestOptions): APIPromise; /** * Partially update an App. Omitted fields remain unchanged. Updating auth_config * or tenant metadata invalidates the cached provider token immediately. OAuth-only * providers reject auth_config and must be reauthorized through connect-app. * Providers supporting caller-managed credentials as well, such as Cal.com, * continue to accept those credentials. */ update(appID: string, body: AppUpdateParams, options?: RequestOptions): APIPromise; /** * List Apps in the organization (paginated). */ list(query?: AppListParams | null | undefined, options?: RequestOptions): APIPromise; /** * Delete an App. Fails when agents, knowledge bases, or alert rules still * reference it, unless force_delete is set. If a CRM config is linked to this App, * the link is cleared. */ delete(appID: string, params?: AppDeleteParams | null | undefined, options?: RequestOptions): APIPromise; /** * Get an App by id. */ get(appID: string, options?: RequestOptions): APIPromise; /** * One round of multi-step schema resolution for an app tool template against a * connected App. parameters is the input parameters resolved so far, with * properties configured by const or description, and is empty on the first call. * Returns the next input_schema to fill; complete marks the last round (it may * accompany the final input_schema) and may include an optional response_schema. * Input-schema property descriptions provide the default text for LLM inference, * and each property's default_input_mode ("const" or "description") is the input * mode to preselect for it. A property may also carry extra_info ({ text?, link? * }), guidance to render under its editor, e.g. a docs link on how to find an id. * Used by the tool config UI. enum_labels maps enum values to display labels; * forbid_literal_const allows only description or a {{variable}}. */ getToolSchema(appID: string, body: AppGetToolSchemaParams, options?: RequestOptions): APIPromise; /** * List the static catalog of available integration apps — provider, display name, * description, and the tools each exposes. Not the organization's connected Apps. */ listTemplates(query?: AppListTemplatesParams | null | undefined, options?: RequestOptions): APIPromise; /** * List the agents, knowledge bases, and alert rules referencing an App, most * recently configured first by default. */ listUsages(appID: string, query?: AppListUsagesParams | null | undefined, options?: RequestOptions): APIPromise; /** * Probe the App's stored credentials by making a minimal authenticated call to the * provider. Returns success=true on a successful round-trip, and records the * outcome on the App's connection_status either way. */ testAuth(appID: string, options?: RequestOptions): APIPromise; } export interface AppResponse { app_id: string; created_timestamp: number; org_id: string; /** * Provider name. Must be valid for the App's type; the supported providers per * type are listed by list-app-templates. */ provider: string; /** * App integration category. */ type: 'crm' | 'calendar' | 'knowledge_base' | 'support' | 'communication'; user_modified_timestamp: number; /** * Non-secret auth metadata. Encrypted secret fields are never returned by the API. */ auth_config?: AppResponse.OAuthConfigResponse | AppResponse.APIKeyAuthConfigResponse | AppResponse.AccessTokenAuthConfigResponse | AppResponse.BasicAuthConfigResponse | AppResponse.RefreshTokenAuthConfigResponse; /** * Connection health of the App, server-managed. `not_connected` after create or a * credential / tenant URL change; `connected` once verified via OAuth connect, an * auth test, or a successful live tool call; `error` when the provider rejects the * credentials (on connect, an auth test, or a live tool call). */ connection_status?: 'not_connected' | 'connected' | 'error'; crm_config?: AppResponse.CRMConfig; name?: string; /** * Sub-account id, for providers that scope requests by a sub-account id on a * shared host. Omitted by every other provider. */ tenant_id?: string; /** * Microsoft OneDrive account type discovered during OAuth. */ tenant_type?: 'business' | 'personal'; /** * Per-tenant API base URL. Set by providers with per-org hosts; omitted by * providers on a single global host. For OneDrive for Business, this is the * tenant's -my.sharepoint.com origin used by File Picker v8; personal OneDrive * omits it. */ tenant_url?: string; } export declare namespace AppResponse { interface OAuthConfigResponse { client_id: string; type: 'oauth2'; } interface APIKeyAuthConfigResponse { type: 'api_key'; } interface AccessTokenAuthConfigResponse { type: 'access_token'; } interface BasicAuthConfigResponse { type: 'basic'; username: string; } interface RefreshTokenAuthConfigResponse { type: 'refresh_token'; } interface CRMConfig { /** * Monday.com board used for contact sync. Configure after OAuth. Once phone * mappings are saved, use a new connection to change the board or primary phone * column. Not accepted by other providers. */ contact_board_id?: string; /** * Field mappings applied when syncing CRM records into Retell contacts. Must * include phone_number, which is the field the two systems are matched on. A * do_not_call mapping can mark contacts as do-not-call but never clears the flag. */ inbound_sync_mappings?: Array; /** * Field mappings applied when writing Retell contact changes back to the CRM. */ outbound_sync_mappings?: Array; /** * Whether to push call/chat activity to the external CRM. Opt-in — defaults to * false when unset. */ sync_conversation_activity?: boolean; /** * Whether to create a CRM record after a conversation when the contact is not yet * linked to one. */ sync_new_contacts?: boolean; } namespace CRMConfig { interface InboundSyncMapping { /** * Field on the CRM's contact object to map to. A name that does not exist there * surfaces as an error on the sync job rather than at configuration time. */ external_field_name: string; /** * Retell contact field, built-in or custom, to map. Types must be compatible with * the CRM field on both sides of the sync. */ field_name: string; } interface OutboundSyncMapping { /** * Field on the CRM's contact object to map to. A name that does not exist there * surfaces as an error on the sync job rather than at configuration time. */ external_field_name: string; /** * Retell contact field, built-in or custom, to map. Types must be compatible with * the CRM field on both sides of the sync. */ field_name: string; } } } export interface AppListResponse { /** * Whether more results are available. */ has_more: boolean; items: Array; /** * Pagination key for the next page. */ pagination_key?: string; } export interface AppGetToolSchemaResponse { complete: boolean; /** * The parameters the functions accepts, described as a JSON Schema object. See * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for * documentation about the format. Omitting parameters defines a function with an * empty parameter list. */ input_schema?: AppGetToolSchemaResponse.InputSchema; /** * The parameters the functions accepts, described as a JSON Schema object. See * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for * documentation about the format. Omitting parameters defines a function with an * empty parameter list. */ response_schema?: AppGetToolSchemaResponse.ResponseSchema; } export declare namespace AppGetToolSchemaResponse { /** * The parameters the functions accepts, described as a JSON Schema object. See * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for * documentation about the format. Omitting parameters defines a function with an * empty parameter list. */ interface InputSchema { /** * The value of properties is an object, where each key is the name of a property * and each value is a schema used to validate that property. */ properties: unknown; /** * Type must be "object" for a JSON Schema object. */ type: 'object'; /** * On an integration function's response schema, false means the output fields are * fixed to properties and no others can be added. */ additionalProperties?: boolean; /** * List of names of required property when generating this parameter. LLM will do * its best to generate the required properties in its function arguments. Property * must exist in properties. */ required?: Array; } /** * The parameters the functions accepts, described as a JSON Schema object. See * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for * documentation about the format. Omitting parameters defines a function with an * empty parameter list. */ interface ResponseSchema { /** * The value of properties is an object, where each key is the name of a property * and each value is a schema used to validate that property. */ properties: unknown; /** * Type must be "object" for a JSON Schema object. */ type: 'object'; /** * On an integration function's response schema, false means the output fields are * fixed to properties and no others can be added. */ additionalProperties?: boolean; /** * List of names of required property when generating this parameter. LLM will do * its best to generate the required properties in its function arguments. Property * must exist in properties. */ required?: Array; } } export interface AppListTemplatesResponse { /** * Whether more results are available. */ has_more: boolean; items: Array; /** * Pagination key for the next page. */ pagination_key?: string; } export declare namespace AppListTemplatesResponse { interface Item { description: string; display_name: string; /** * Provider name. Must be valid for the App's type; the supported providers per * type are listed by list-app-templates. */ provider: string; tools: Array; /** * App integration category. */ type: 'crm' | 'calendar' | 'knowledge_base' | 'support' | 'communication'; } namespace Item { interface Tool { /** * Also the LLM-facing description when used as a mid-call tool. */ description: string; display_name: string; /** * Unique tool name within the provider. */ name: string; /** * Privacy scope of an integration function. */ privacy_scope: 'standard' | 'pci'; /** * Per-invocation timeout for this tool, in milliseconds. */ timeout_ms: number; } } } export interface AppListUsagesResponse { /** * Whether more results are available. */ has_more: boolean; items: Array; /** * Pagination key for the next page. */ pagination_key?: string; } export declare namespace AppListUsagesResponse { interface AgentAppUsage { agent_id: string; /** * Agent versions referencing this app, largest first. */ agent_versions: Array; /** * When this reference was last recorded, in milliseconds. */ configured_timestamp: number; type: 'agent'; /** * Current agent name; omitted if the agent was deleted. */ agent_name?: string; } interface KnowledgeBaseAppUsage { /** * When this reference was last recorded, in milliseconds. */ configured_timestamp: number; knowledge_base_id: string; type: 'knowledge_base'; /** * Current knowledge base name; omitted if it was deleted. */ knowledge_base_name?: string; } interface AlertRuleAppUsage { alert_rule_id: string; /** * When this reference was last recorded, in milliseconds. */ configured_timestamp: number; type: 'alert_rule'; /** * Current alert rule name; omitted if it was deleted. */ alert_rule_name?: string; } } export interface AppTestAuthResponse { success: boolean; } export interface AppCreateParams { /** * Provider name. Must be valid for the App's type; the supported providers per * type are listed by list-app-templates. */ provider: string; /** * App integration category. */ type: 'crm' | 'calendar' | 'knowledge_base' | 'support' | 'communication'; /** * Caller-managed credentials. Providers using the OAuth callback reject * auth_config and must be authorized through connect-app. */ auth_config?: AppCreateParams.OAuthConfigRequest | AppCreateParams.APIKeyAuthConfigRequest | AppCreateParams.BasicAuthConfigRequest; crm_config?: AppCreateParams.CRMConfig; /** * Display name. */ name?: string; /** * Sub-account id, for providers that scope requests by a sub-account id on a * shared host. */ tenant_id?: string; /** * Per-tenant API base URL. */ tenant_url?: string; } export declare namespace AppCreateParams { interface OAuthConfigRequest { client_id: string; /** * Secret credential; stored encrypted at rest. */ client_secret: string; type: 'oauth2'; } interface APIKeyAuthConfigRequest { /** * API key credential; stored encrypted at rest. */ api_key: string; type: 'api_key'; } interface BasicAuthConfigRequest { /** * Password credential; stored encrypted at rest. */ password: string; type: 'basic'; username: string; } interface CRMConfig { /** * Monday.com board used for contact sync. Configure after OAuth. Once phone * mappings are saved, use a new connection to change the board or primary phone * column. Not accepted by other providers. */ contact_board_id?: string; /** * Field mappings applied when syncing CRM records into Retell contacts. Must * include phone_number, which is the field the two systems are matched on. A * do_not_call mapping can mark contacts as do-not-call but never clears the flag. */ inbound_sync_mappings?: Array; /** * Field mappings applied when writing Retell contact changes back to the CRM. */ outbound_sync_mappings?: Array; /** * Whether to push call/chat activity to the external CRM. Opt-in — defaults to * false when unset. */ sync_conversation_activity?: boolean; /** * Whether to create a CRM record after a conversation when the contact is not yet * linked to one. */ sync_new_contacts?: boolean; } namespace CRMConfig { interface InboundSyncMapping { /** * Field on the CRM's contact object to map to. A name that does not exist there * surfaces as an error on the sync job rather than at configuration time. */ external_field_name: string; /** * Retell contact field, built-in or custom, to map. Types must be compatible with * the CRM field on both sides of the sync. */ field_name: string; } interface OutboundSyncMapping { /** * Field on the CRM's contact object to map to. A name that does not exist there * surfaces as an error on the sync job rather than at configuration time. */ external_field_name: string; /** * Retell contact field, built-in or custom, to map. Types must be compatible with * the CRM field on both sides of the sync. */ field_name: string; } } } export interface AppUpdateParams { /** * Caller-managed credentials. Providers using the OAuth callback reject * auth_config and must be authorized through connect-app. */ auth_config?: AppUpdateParams.OAuthConfigRequest | AppUpdateParams.APIKeyAuthConfigRequest | AppUpdateParams.BasicAuthConfigRequest; crm_config?: AppUpdateParams.CRMConfig; name?: string; /** * Sub-account id, for providers that scope requests by a sub-account id on a * shared host. */ tenant_id?: string; /** * Per-tenant API base URL. */ tenant_url?: string; } export declare namespace AppUpdateParams { interface OAuthConfigRequest { client_id: string; /** * Secret credential; stored encrypted at rest. */ client_secret: string; type: 'oauth2'; } interface APIKeyAuthConfigRequest { /** * API key credential; stored encrypted at rest. */ api_key: string; type: 'api_key'; } interface BasicAuthConfigRequest { /** * Password credential; stored encrypted at rest. */ password: string; type: 'basic'; username: string; } interface CRMConfig { /** * Monday.com board used for contact sync. Configure after OAuth. Once phone * mappings are saved, use a new connection to change the board or primary phone * column. Not accepted by other providers. */ contact_board_id?: string; /** * Field mappings applied when syncing CRM records into Retell contacts. Must * include phone_number, which is the field the two systems are matched on. A * do_not_call mapping can mark contacts as do-not-call but never clears the flag. */ inbound_sync_mappings?: Array; /** * Field mappings applied when writing Retell contact changes back to the CRM. */ outbound_sync_mappings?: Array; /** * Whether to push call/chat activity to the external CRM. Opt-in — defaults to * false when unset. */ sync_conversation_activity?: boolean; /** * Whether to create a CRM record after a conversation when the contact is not yet * linked to one. */ sync_new_contacts?: boolean; } namespace CRMConfig { interface InboundSyncMapping { /** * Field on the CRM's contact object to map to. A name that does not exist there * surfaces as an error on the sync job rather than at configuration time. */ external_field_name: string; /** * Retell contact field, built-in or custom, to map. Types must be compatible with * the CRM field on both sides of the sync. */ field_name: string; } interface OutboundSyncMapping { /** * Field on the CRM's contact object to map to. A name that does not exist there * surfaces as an error on the sync job rather than at configuration time. */ external_field_name: string; /** * Retell contact field, built-in or custom, to map. Types must be compatible with * the CRM field on both sides of the sync. */ field_name: string; } } } export interface AppListParams { /** * Maximum number of items to return. */ limit?: number; /** * Pagination key for fetching the next page. */ pagination_key?: string; /** * Only include functions with this scope and apps providing them. Omit to include * all scopes. */ privacy_scope?: 'standard' | 'pci'; /** * Sort order for results. */ sort_order?: 'ascending' | 'descending'; } export interface AppDeleteParams { /** * Delete even when the App is still referenced. */ force_delete?: boolean; } export interface AppGetToolSchemaParams { /** * The app tool template name (the provider's catalog tool name). */ app_tool_template_name: string; /** * The input parameters resolved so far; empty on the first call. */ parameters?: Array; } export declare namespace AppGetToolSchemaParams { /** * The parameters the functions accepts, described as a JSON Schema object. See * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for * documentation about the format. Omitting parameters defines a function with an * empty parameter list. */ interface Parameter { /** * The value of properties is an object, where each key is the name of a property * and each value is a schema used to validate that property. */ properties: unknown; /** * Type must be "object" for a JSON Schema object. */ type: 'object'; /** * On an integration function's response schema, false means the output fields are * fixed to properties and no others can be added. */ additionalProperties?: boolean; /** * List of names of required property when generating this parameter. LLM will do * its best to generate the required properties in its function arguments. Property * must exist in properties. */ required?: Array; } } export interface AppListTemplatesParams { /** * Maximum number of items to return. */ limit?: number; /** * Pagination key for fetching the next page. */ pagination_key?: string; /** * Only include functions with this scope and apps providing them. Omit to include * all scopes. */ privacy_scope?: 'standard' | 'pci'; } export interface AppListUsagesParams { /** * Maximum number of items to return. */ limit?: number; /** * Pagination key for fetching the next page. */ pagination_key?: string; /** * Sort order for results. */ sort_order?: 'ascending' | 'descending'; } export declare namespace App { export { type AppResponse as AppResponse, type AppListResponse as AppListResponse, type AppGetToolSchemaResponse as AppGetToolSchemaResponse, type AppListTemplatesResponse as AppListTemplatesResponse, type AppListUsagesResponse as AppListUsagesResponse, type AppTestAuthResponse as AppTestAuthResponse, type AppCreateParams as AppCreateParams, type AppUpdateParams as AppUpdateParams, type AppListParams as AppListParams, type AppDeleteParams as AppDeleteParams, type AppGetToolSchemaParams as AppGetToolSchemaParams, type AppListTemplatesParams as AppListTemplatesParams, type AppListUsagesParams as AppListUsagesParams, }; } //# sourceMappingURL=app.d.ts.map