diff --git a/.changeset/erp-imports-integration-toolkit.md b/.changeset/erp-imports-integration-toolkit.md new file mode 100644 index 00000000..e3bc73a4 --- /dev/null +++ b/.changeset/erp-imports-integration-toolkit.md @@ -0,0 +1,12 @@ +--- +"@epilot/integration-toolkit-client": minor +"@epilot/sdk": minor +--- + +Add the pricing-file import operations to the integration-toolkit client + +- `createErpImport` (`POST /v2/erp/imports`) — create a pricing-file import job from an uploaded file, starts the validate phase +- `listErpImports` (`GET /v2/erp/imports`) — list recent import jobs for the org, cursor-paginated +- `getErpImport` (`GET /v2/erp/imports/{importId}`) — poll a job's status, validation summary, and progress +- `executeErpImport` (`POST /v2/erp/imports/{importId}:execute`) — confirm and run the write phase of a validated (`READY`) job +- `abortErpImport` (`POST /v2/erp/imports/{importId}:abort`) — cooperatively stop a running job diff --git a/clients/integration-toolkit-client/src/openapi-runtime.json b/clients/integration-toolkit-client/src/openapi-runtime.json index 882ff463..0a24288d 100644 --- a/clients/integration-toolkit-client/src/openapi-runtime.json +++ b/clients/integration-toolkit-client/src/openapi-runtime.json @@ -923,6 +923,73 @@ }, "responses": {} } + }, + "/v2/erp/imports": { + "post": { + "operationId": "createErpImport", + "requestBody": { + "required": true, + "content": { + "application/json": {} + } + }, + "responses": {} + }, + "get": { + "operationId": "listErpImports", + "parameters": [ + { + "name": "limit", + "in": "query", + "required": false + }, + { + "name": "cursor", + "in": "query", + "required": false + } + ], + "responses": {} + } + }, + "/v2/erp/imports/{importId}": { + "get": { + "operationId": "getErpImport", + "parameters": [ + { + "name": "importId", + "in": "path", + "required": true + } + ], + "responses": {} + } + }, + "/v2/erp/imports/{importId}:execute": { + "post": { + "operationId": "executeErpImport", + "parameters": [ + { + "name": "importId", + "in": "path", + "required": true + } + ], + "responses": {} + } + }, + "/v2/erp/imports/{importId}:abort": { + "post": { + "operationId": "abortErpImport", + "parameters": [ + { + "name": "importId", + "in": "path", + "required": true + } + ], + "responses": {} + } } }, "components": { @@ -947,6 +1014,11 @@ "application/json": {} } }, + "Conflict": { + "content": { + "application/json": {} + } + }, "InternalServerError": { "content": { "application/json": {} diff --git a/clients/integration-toolkit-client/src/openapi.d.ts b/clients/integration-toolkit-client/src/openapi.d.ts index 29dffe96..625ba17e 100644 --- a/clients/integration-toolkit-client/src/openapi.d.ts +++ b/clients/integration-toolkit-client/src/openapi.d.ts @@ -9,6 +9,7 @@ import type { declare namespace Components { namespace Responses { export type BadRequest = Schemas.ErrorResponseBase; + export type Conflict = Schemas.ErrorResponseBase; export interface ERPUpdatesResponse { results?: { /** @@ -162,6 +163,35 @@ declare namespace Components { has_more?: boolean; } export interface ReplayEventsResponse { + /** + * Number of events actually queued for re-processing. + * example: + * 2 + */ + replayed: number; + /** + * One entry per requested event id, in request order. + */ + results: { + /** + * The requested (source) event ID. + */ + event_id: string; + /** + * Outcome for this event. `success`/`queued` means it was enqueued for re-processing. `not_found` means no inbound event with that ID exists for the organization. `skipped` means it was deduplicated, `ignored` means no enabled use case matched it, and `error` means it could not be queued (see `message`). + * + */ + status: "success" | "queued" | "skipped" | "ignored" | "not_found" | "error"; + /** + * The new event ID assigned to the replayed event. Use it to follow the replay in monitoring. + * + */ + replay_event_id?: string; + /** + * Human-readable detail for this outcome. + */ + message?: string; + }[]; /** * List of event IDs for which replay was requested */ @@ -1311,6 +1341,17 @@ declare namespace Components { */ latest_types_package_name?: string; } + export interface CreateErpImportRequest { + s3_reference: S3Reference; + integration_id: string; + use_case_slug?: string; + } + export interface CreateErpImportResponse { + /** + * `imp_{ULID}` — time-ordered, also used as the job's correlation_id. + */ + import_id: string; + } export interface CreateFileProxyUseCaseRequest { /** * Use case name @@ -1923,6 +1964,93 @@ declare namespace Components { */ group_id?: string; }; + /** + * Why the import failed — present if and only if status = FAILED. + */ + export interface ErpImportError { + /** + * VALIDATION_BLOCKED = blocking row issues (see `validation`); PROCESSING_ERROR = a named, deterministic failure — retrying the same file cannot help; INTERNAL_ERROR = crashed or never started, so retry. + */ + type: "VALIDATION_BLOCKED" | "PROCESSING_ERROR" | "INTERNAL_ERROR"; + /** + * User-facing explanation of `type`. + */ + message: string; + } + export interface ErpImportJob { + /** + * `imp_{ULID}` — time-ordered, also used as the job's correlation_id. + */ + import_id: string; + org_id: string; + created_by?: string; + integration_id: string; + /** + * The inbound use case whose mapping drives both phases. + */ + use_case_slug?: string; + format: "csv" | "xlsx"; + /** + * PENDING → VALIDATING → READY → PROCESSING → IMPORTED, with FAILED reachable from any working status, and CANCELLING → CANCELLED reachable from VALIDATING or PROCESSING via :abort. IMPORTED, FAILED and CANCELLED are terminal and final. + * IMPORTED means every row was handed to the platform, not that the platform finished — per-row outcomes live in monitoring, filtered by correlation_id. A file that fails validation is FAILED with error.type = VALIDATION_BLOCKED. + * READY is legitimately idle for as long as the user takes to confirm, so it carries no running work and never goes stale. + * CANCELLING is transient and cooperative: the abort has been recorded but the worker only notices at its next batch boundary. Rows already published stay published — a stop is not a rollback. + */ + status: "PENDING" | "VALIDATING" | "READY" | "PROCESSING" | "IMPORTED" | "FAILED" | "CANCELLING" | "CANCELLED"; + s3_input_ref: S3Reference; + validation?: /* Validate-phase summary: what the file will create, and whether it may be confirmed. Absent until the validate phase completes. No per-row detail is kept — a rejected file is corrected and imported again. */ ErpImportValidation; + progress?: /** + * How far the currently running phase has got. Written at every batch boundary, so it advances during long runs rather than only at the end. + * `total_rows` is ABSENT during the validate phase until the file has been read to the end — there is deliberately no counting pass, since that would be a second unbounded read of the whole file. Render an indeterminate indicator while it is missing: dividing by a missing total yields a determinate bar pinned at 0%, which reads as a hung import. + */ + ErpImportProgress; + error?: /* Why the import failed — present if and only if status = FAILED. */ ErpImportError; + /** + * Scopes this run in monitoring. Always equal to `import_id`. + */ + correlation_id?: string; + activity_id?: string; + created_at: string; // date-time + updated_at: string; // date-time + } + export interface ErpImportList { + results: ErpImportJob[]; + /** + * Cursor for the next page, or null when there are no more rows. + */ + next_cursor?: string | null; + } + /** + * How far the currently running phase has got. Written at every batch boundary, so it advances during long runs rather than only at the end. + * `total_rows` is ABSENT during the validate phase until the file has been read to the end — there is deliberately no counting pass, since that would be a second unbounded read of the whole file. Render an indeterminate indicator while it is missing: dividing by a missing total yields a determinate bar pinned at 0%, which reads as a hung import. + */ + export interface ErpImportProgress { + /** + * Rows fully processed. An exact "the first N rows are done" watermark, not an estimate — it only advances once a batch has been completely handled. + */ + processed_rows: number; + /** + * Rows in the file. Known only once a phase has read to EOF; the execute phase has it from the start, because validate recorded it first. + */ + total_rows?: number; + } + /** + * Validate-phase summary: what the file will create, and whether it may be confirmed. Absent until the validate phase completes. No per-row detail is kept — a rejected file is corrected and imported again. + */ + export interface ErpImportValidation { + /** + * Data rows read from the file. + */ + total_rows: number; + blocking: number; + warnings: number; + /** + * Distinct entities the file expresses, keyed by entity slug. + */ + entities: { + [name: string]: number; + }; + } export interface ErpUpdatesEventsV2Request { /** * UUID that identifies the integration configuration to use @@ -5611,6 +5739,10 @@ declare namespace Components { */ buckets?: RuleBaselineBucket[] | null; } + export interface S3Reference { + bucket: string; + key: string; + } export interface SecureProxyRequest { /** * Integration ID that owns the secure_proxy use case @@ -6458,6 +6590,21 @@ declare namespace Components { } } declare namespace Paths { + namespace AbortErpImport { + namespace Parameters { + export type ImportId = string; + } + export interface PathParameters { + importId: Parameters.ImportId; + } + namespace Responses { + export type $202 = Components.Schemas.ErpImportJob; + export type $403 = Components.Responses.Forbidden; + export type $404 = Components.Responses.NotFound; + export type $409 = Components.Responses.Conflict; + export type $500 = Components.Responses.InternalServerError; + } + } namespace AckOutboundMessages { namespace Parameters { export type IntegrationId = string; // uuid @@ -6512,6 +6659,15 @@ declare namespace Paths { export type $500 = Components.Responses.InternalServerError; } } + namespace CreateErpImport { + export type RequestBody = Components.Schemas.CreateErpImportRequest; + namespace Responses { + export type $202 = Components.Schemas.CreateErpImportResponse; + export type $400 = Components.Responses.BadRequest; + export type $403 = Components.Responses.Forbidden; + export type $500 = Components.Responses.InternalServerError; + } + } namespace CreateIntegration { export type RequestBody = Components.Schemas.CreateIntegrationRequest; namespace Responses { @@ -6624,6 +6780,21 @@ declare namespace Paths { export type $500 = Components.Responses.InternalServerError; } } + namespace ExecuteErpImport { + namespace Parameters { + export type ImportId = string; + } + export interface PathParameters { + importId: Parameters.ImportId; + } + namespace Responses { + export type $200 = Components.Schemas.ErpImportJob; + export type $403 = Components.Responses.Forbidden; + export type $404 = Components.Responses.NotFound; + export type $409 = Components.Responses.Conflict; + export type $500 = Components.Responses.InternalServerError; + } + } namespace GenerateTypes { namespace Parameters { export type IntegrationId = string; // uuid @@ -6671,6 +6842,20 @@ declare namespace Paths { export type $500 = Components.Responses.InternalServerError; } } + namespace GetErpImport { + namespace Parameters { + export type ImportId = string; + } + export interface PathParameters { + importId: Parameters.ImportId; + } + namespace Responses { + export type $200 = Components.Schemas.ErpImportJob; + export type $403 = Components.Responses.Forbidden; + export type $404 = Components.Responses.NotFound; + export type $500 = Components.Responses.InternalServerError; + } + } namespace GetIntegration { namespace Parameters { export type IntegrationId = string; // uuid @@ -6873,6 +7058,22 @@ declare namespace Paths { export type $500 = Components.Responses.InternalServerError; } } + namespace ListErpImports { + namespace Parameters { + export type Cursor = string; + export type Limit = number; + } + export interface QueryParameters { + limit?: Parameters.Limit; + cursor?: Parameters.Cursor; + } + namespace Responses { + export type $200 = Components.Schemas.ErpImportList; + export type $400 = Components.Responses.BadRequest; + export type $403 = Components.Responses.Forbidden; + export type $500 = Components.Responses.InternalServerError; + } + } namespace ListIntegrations { namespace Responses { export interface $200 { @@ -8156,6 +8357,63 @@ export interface OperationMethods { data?: Paths.CommitTypes.RequestBody, config?: AxiosRequestConfig ): OperationResponse + /** + * listErpImports - listErpImports + * + * List recent pricing-file import jobs for the org, newest first. + * + * Pass `next_cursor` back as `cursor` for the next page. A page can be + * shorter than `limit` and still have more behind it, so stop on + * `next_cursor: null`. + * + */ + 'listErpImports'( + parameters?: Parameters | null, + data?: any, + config?: AxiosRequestConfig + ): OperationResponse + /** + * createErpImport - createErpImport + * + * Create a pricing-file import job from an already-uploaded file (S3 ref). Returns a job id and starts the validate phase asynchronously — poll GET /v2/erp/imports/{importId}. + */ + 'createErpImport'( + parameters?: Parameters | null, + data?: Paths.CreateErpImport.RequestBody, + config?: AxiosRequestConfig + ): OperationResponse + /** + * getErpImport - getErpImport + * + * Get a pricing-file import job (status, counts, result links). + */ + 'getErpImport'( + parameters?: Parameters | null, + data?: any, + config?: AxiosRequestConfig + ): OperationResponse + /** + * executeErpImport - executeErpImport + * + * Confirm and run the write phase of a validated import. Only a READY job may be executed; any other status returns 409. + */ + 'executeErpImport'( + parameters?: Parameters | null, + data?: any, + config?: AxiosRequestConfig + ): OperationResponse + /** + * abortErpImport - abortErpImport + * + * Ask a running import to stop. Valid while the job is VALIDATING or PROCESSING; any other status returns 409. + * The stop is cooperative: the job passes through CANCELLING and typically reaches CANCELLED within seconds. + * Rows already published to the platform are **kept**: this is a stop, not a rollback. Aborting during VALIDATING has published nothing, so it is always clean; aborting during PROCESSING leaves a partial import, and the rows that landed are visible in monitoring under the job's correlation_id. + */ + 'abortErpImport'( + parameters?: Parameters | null, + data?: any, + config?: AxiosRequestConfig + ): OperationResponse } export interface PathsDictionary { @@ -8976,6 +9234,71 @@ export interface PathsDictionary { config?: AxiosRequestConfig ): OperationResponse } + ['/v2/erp/imports']: { + /** + * createErpImport - createErpImport + * + * Create a pricing-file import job from an already-uploaded file (S3 ref). Returns a job id and starts the validate phase asynchronously — poll GET /v2/erp/imports/{importId}. + */ + 'post'( + parameters?: Parameters | null, + data?: Paths.CreateErpImport.RequestBody, + config?: AxiosRequestConfig + ): OperationResponse + /** + * listErpImports - listErpImports + * + * List recent pricing-file import jobs for the org, newest first. + * + * Pass `next_cursor` back as `cursor` for the next page. A page can be + * shorter than `limit` and still have more behind it, so stop on + * `next_cursor: null`. + * + */ + 'get'( + parameters?: Parameters | null, + data?: any, + config?: AxiosRequestConfig + ): OperationResponse + } + ['/v2/erp/imports/{importId}']: { + /** + * getErpImport - getErpImport + * + * Get a pricing-file import job (status, counts, result links). + */ + 'get'( + parameters?: Parameters | null, + data?: any, + config?: AxiosRequestConfig + ): OperationResponse + } + ['/v2/erp/imports/{importId}:execute']: { + /** + * executeErpImport - executeErpImport + * + * Confirm and run the write phase of a validated import. Only a READY job may be executed; any other status returns 409. + */ + 'post'( + parameters?: Parameters | null, + data?: any, + config?: AxiosRequestConfig + ): OperationResponse + } + ['/v2/erp/imports/{importId}:abort']: { + /** + * abortErpImport - abortErpImport + * + * Ask a running import to stop. Valid while the job is VALIDATING or PROCESSING; any other status returns 409. + * The stop is cooperative: the job passes through CANCELLING and typically reaches CANCELLED within seconds. + * Rows already published to the platform are **kept**: this is a stop, not a rollback. Aborting during VALIDATING has published nothing, so it is always clean; aborting during PROCESSING leaves a partial import, and the rows that landed are visible in monitoring under the job's correlation_id. + */ + 'post'( + parameters?: Parameters | null, + data?: any, + config?: AxiosRequestConfig + ): OperationResponse + } } export type Client = OpenAPIClient @@ -8989,6 +9312,8 @@ export type AutoRefreshSettings = Components.Schemas.AutoRefreshSettings; export type CommitTypesRequest = Components.Schemas.CommitTypesRequest; export type CommitTypesResponse = Components.Schemas.CommitTypesResponse; export type ConnectorConfig = Components.Schemas.ConnectorConfig; +export type CreateErpImportRequest = Components.Schemas.CreateErpImportRequest; +export type CreateErpImportResponse = Components.Schemas.CreateErpImportResponse; export type CreateFileProxyUseCaseRequest = Components.Schemas.CreateFileProxyUseCaseRequest; export type CreateInboundUseCaseRequest = Components.Schemas.CreateInboundUseCaseRequest; export type CreateIntegrationRequest = Components.Schemas.CreateIntegrationRequest; @@ -9011,6 +9336,11 @@ export type EnvVarRefConfig = Components.Schemas.EnvVarRefConfig; export type EnvironmentFieldConfig = Components.Schemas.EnvironmentFieldConfig; export type ErpEvent = Components.Schemas.ErpEvent; export type ErpEventV3 = Components.Schemas.ErpEventV3; +export type ErpImportError = Components.Schemas.ErpImportError; +export type ErpImportJob = Components.Schemas.ErpImportJob; +export type ErpImportList = Components.Schemas.ErpImportList; +export type ErpImportProgress = Components.Schemas.ErpImportProgress; +export type ErpImportValidation = Components.Schemas.ErpImportValidation; export type ErpUpdatesEventsV2Request = Components.Schemas.ErpUpdatesEventsV2Request; export type ErpUpdatesEventsV3Request = Components.Schemas.ErpUpdatesEventsV3Request; export type ErrorResponseBase = Components.Schemas.ErrorResponseBase; @@ -9116,6 +9446,7 @@ export type RepeatableFieldType = Components.Schemas.RepeatableFieldType; export type ReplayEventsRequest = Components.Schemas.ReplayEventsRequest; export type RuleBaselineBucket = Components.Schemas.RuleBaselineBucket; export type RuleBaselineStatus = Components.Schemas.RuleBaselineStatus; +export type S3Reference = Components.Schemas.S3Reference; export type SecureProxyRequest = Components.Schemas.SecureProxyRequest; export type SecureProxyResponse = Components.Schemas.SecureProxyResponse; export type SecureProxySummary = Components.Schemas.SecureProxySummary; diff --git a/clients/integration-toolkit-client/src/openapi.json b/clients/integration-toolkit-client/src/openapi.json index 27542fcb..8d94132d 100644 --- a/clients/integration-toolkit-client/src/openapi.json +++ b/clients/integration-toolkit-client/src/openapi.json @@ -2,7 +2,7 @@ "openapi": "3.0.3", "info": { "title": "Integration Toolkit API", - "version": "1.5.12", + "version": "1.7.0", "description": "API for integrating with external systems in a standardised way." }, "tags": [ @@ -10,6 +10,10 @@ "name": "erp", "description": "ERP integration endpoints" }, + { + "name": "erp-imports", + "description": "ERP pricing file import endpoints" + }, { "name": "trigger", "description": "Endpoints to trigger ERP related actions" @@ -3735,6 +3739,227 @@ } } } + }, + "/v2/erp/imports": { + "post": { + "operationId": "createErpImport", + "summary": "createErpImport", + "description": "Create a pricing-file import job from an already-uploaded file (S3 ref). Returns a job id and starts the validate phase asynchronously — poll GET /v2/erp/imports/{importId}.", + "tags": [ + "erp-imports" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateErpImportRequest" + } + } + } + }, + "responses": { + "202": { + "description": "Import job accepted", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateErpImportResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + }, + "get": { + "operationId": "listErpImports", + "summary": "listErpImports", + "description": "List recent pricing-file import jobs for the org, newest first.\n\nPass `next_cursor` back as `cursor` for the next page. A page can be\nshorter than `limit` and still have more behind it, so stop on\n`next_cursor: null`.\n", + "tags": [ + "erp-imports" + ], + "parameters": [ + { + "name": "limit", + "in": "query", + "required": false, + "description": "Page size. Values above 100 are clamped to 100.", + "schema": { + "type": "integer", + "minimum": 1, + "default": 50 + } + }, + { + "name": "cursor", + "in": "query", + "required": false, + "description": "Opaque cursor from a prior page's `next_cursor`.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Import jobs", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErpImportList" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/v2/erp/imports/{importId}": { + "get": { + "operationId": "getErpImport", + "summary": "getErpImport", + "description": "Get a pricing-file import job (status, counts, result links).", + "tags": [ + "erp-imports" + ], + "parameters": [ + { + "name": "importId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The import job", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErpImportJob" + } + } + } + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/v2/erp/imports/{importId}:execute": { + "post": { + "operationId": "executeErpImport", + "summary": "executeErpImport", + "description": "Confirm and run the write phase of a validated import. Only a READY job may be executed; any other status returns 409.", + "tags": [ + "erp-imports" + ], + "parameters": [ + { + "name": "importId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Execution started", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErpImportJob" + } + } + } + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "409": { + "$ref": "#/components/responses/Conflict" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/v2/erp/imports/{importId}:abort": { + "post": { + "operationId": "abortErpImport", + "summary": "abortErpImport", + "description": "Ask a running import to stop. Valid while the job is VALIDATING or PROCESSING; any other status returns 409.\nThe stop is cooperative: the job passes through CANCELLING and typically reaches CANCELLED within seconds.\nRows already published to the platform are **kept**: this is a stop, not a rollback. Aborting during VALIDATING has published nothing, so it is always clean; aborting during PROCESSING leaves a partial import, and the rows that landed are visible in monitoring under the job's correlation_id.", + "tags": [ + "erp-imports" + ], + "parameters": [ + { + "name": "importId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "202": { + "description": "The stop was recorded. The job is still finishing up — poll GET /v2/erp/imports/{importId} to observe CANCELLED.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErpImportJob" + } + } + } + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "409": { + "$ref": "#/components/responses/Conflict" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } } }, "components": { @@ -3747,6 +3972,219 @@ } }, "schemas": { + "S3Reference": { + "type": "object", + "required": [ + "bucket", + "key" + ], + "properties": { + "bucket": { + "type": "string" + }, + "key": { + "type": "string" + } + } + }, + "CreateErpImportRequest": { + "type": "object", + "required": [ + "s3_reference", + "integration_id" + ], + "properties": { + "s3_reference": { + "$ref": "#/components/schemas/S3Reference" + }, + "integration_id": { + "type": "string" + }, + "use_case_slug": { + "type": "string" + } + } + }, + "ErpImportValidation": { + "type": "object", + "description": "Validate-phase summary: what the file will create, and whether it may be confirmed. Absent until the validate phase completes. No per-row detail is kept — a rejected file is corrected and imported again.", + "required": [ + "total_rows", + "blocking", + "warnings", + "entities" + ], + "properties": { + "total_rows": { + "type": "integer", + "description": "Data rows read from the file." + }, + "blocking": { + "type": "integer" + }, + "warnings": { + "type": "integer" + }, + "entities": { + "type": "object", + "additionalProperties": { + "type": "integer" + }, + "description": "Distinct entities the file expresses, keyed by entity slug." + } + } + }, + "ErpImportProgress": { + "type": "object", + "description": "How far the currently running phase has got. Written at every batch boundary, so it advances during long runs rather than only at the end.\n`total_rows` is ABSENT during the validate phase until the file has been read to the end — there is deliberately no counting pass, since that would be a second unbounded read of the whole file. Render an indeterminate indicator while it is missing: dividing by a missing total yields a determinate bar pinned at 0%, which reads as a hung import.", + "required": [ + "processed_rows" + ], + "properties": { + "processed_rows": { + "type": "integer", + "description": "Rows fully processed. An exact \"the first N rows are done\" watermark, not an estimate — it only advances once a batch has been completely handled." + }, + "total_rows": { + "type": "integer", + "description": "Rows in the file. Known only once a phase has read to EOF; the execute phase has it from the start, because validate recorded it first." + } + } + }, + "ErpImportError": { + "type": "object", + "description": "Why the import failed — present if and only if status = FAILED.", + "required": [ + "type", + "message" + ], + "properties": { + "type": { + "type": "string", + "description": "VALIDATION_BLOCKED = blocking row issues (see `validation`); PROCESSING_ERROR = a named, deterministic failure — retrying the same file cannot help; INTERNAL_ERROR = crashed or never started, so retry.", + "enum": [ + "VALIDATION_BLOCKED", + "PROCESSING_ERROR", + "INTERNAL_ERROR" + ] + }, + "message": { + "type": "string", + "description": "User-facing explanation of `type`." + } + } + }, + "CreateErpImportResponse": { + "type": "object", + "required": [ + "import_id" + ], + "properties": { + "import_id": { + "type": "string", + "description": "`imp_{ULID}` — time-ordered, also used as the job's correlation_id." + } + } + }, + "ErpImportJob": { + "type": "object", + "required": [ + "import_id", + "org_id", + "integration_id", + "format", + "status", + "s3_input_ref", + "created_at", + "updated_at" + ], + "properties": { + "import_id": { + "type": "string", + "description": "`imp_{ULID}` — time-ordered, also used as the job's correlation_id." + }, + "org_id": { + "type": "string" + }, + "created_by": { + "type": "string" + }, + "integration_id": { + "type": "string" + }, + "use_case_slug": { + "type": "string", + "description": "The inbound use case whose mapping drives both phases." + }, + "format": { + "type": "string", + "enum": [ + "csv", + "xlsx" + ] + }, + "status": { + "type": "string", + "description": "PENDING → VALIDATING → READY → PROCESSING → IMPORTED, with FAILED reachable from any working status, and CANCELLING → CANCELLED reachable from VALIDATING or PROCESSING via :abort. IMPORTED, FAILED and CANCELLED are terminal and final.\nIMPORTED means every row was handed to the platform, not that the platform finished — per-row outcomes live in monitoring, filtered by correlation_id. A file that fails validation is FAILED with error.type = VALIDATION_BLOCKED.\nREADY is legitimately idle for as long as the user takes to confirm, so it carries no running work and never goes stale.\nCANCELLING is transient and cooperative: the abort has been recorded but the worker only notices at its next batch boundary. Rows already published stay published — a stop is not a rollback.", + "enum": [ + "PENDING", + "VALIDATING", + "READY", + "PROCESSING", + "IMPORTED", + "FAILED", + "CANCELLING", + "CANCELLED" + ] + }, + "s3_input_ref": { + "$ref": "#/components/schemas/S3Reference" + }, + "validation": { + "$ref": "#/components/schemas/ErpImportValidation" + }, + "progress": { + "$ref": "#/components/schemas/ErpImportProgress" + }, + "error": { + "$ref": "#/components/schemas/ErpImportError" + }, + "correlation_id": { + "type": "string", + "description": "Scopes this run in monitoring. Always equal to `import_id`." + }, + "activity_id": { + "type": "string" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "format": "date-time" + } + } + }, + "ErpImportList": { + "type": "object", + "required": [ + "results" + ], + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ErpImportJob" + } + }, + "next_cursor": { + "type": "string", + "nullable": true, + "description": "Cursor for the next page, or null when there are no more rows." + } + } + }, "NotificationHistoryItem": { "type": "object", "description": "A single notification-history row (one real notification decision).", @@ -9921,6 +10359,16 @@ } } }, + "Conflict": { + "description": "Conflict - the resource is not in a state that allows this operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseBase" + } + } + } + }, "InternalServerError": { "description": "Internal Server Error", "content": { @@ -10100,7 +10548,7 @@ } }, "ReplayEventsResponse": { - "description": "Events replay initiated", + "description": "Events replay initiated. Always 200 — per-event outcomes are reported in `results`, so inspect it (or compare `replayed` against the number of requested ids) rather than treating the status code as success.\n", "content": { "application/json": { "schema": { @@ -10110,6 +10558,48 @@ "results" ], "properties": { + "replayed": { + "type": "integer", + "description": "Number of events actually queued for re-processing.", + "example": 2 + }, + "results": { + "type": "array", + "description": "One entry per requested event id, in request order.", + "items": { + "type": "object", + "required": [ + "event_id", + "status" + ], + "properties": { + "event_id": { + "type": "string", + "description": "The requested (source) event ID." + }, + "status": { + "type": "string", + "enum": [ + "success", + "queued", + "skipped", + "ignored", + "not_found", + "error" + ], + "description": "Outcome for this event. `success`/`queued` means it was enqueued for re-processing. `not_found` means no inbound event with that ID exists for the organization. `skipped` means it was deduplicated, `ignored` means no enabled use case matched it, and `error` means it could not be queued (see `message`).\n" + }, + "replay_event_id": { + "type": "string", + "description": "The new event ID assigned to the replayed event. Use it to follow the replay in monitoring.\n" + }, + "message": { + "type": "string", + "description": "Human-readable detail for this outcome." + } + } + } + }, "event_ids": { "type": "array", "items": { diff --git a/packages/epilot-sdk-v2/docs/integration-toolkit.md b/packages/epilot-sdk-v2/docs/integration-toolkit.md index 446f4fd1..9edd2f93 100644 --- a/packages/epilot-sdk-v2/docs/integration-toolkit.md +++ b/packages/epilot-sdk-v2/docs/integration-toolkit.md @@ -88,7 +88,22 @@ const { data } = await integrationToolkitClient.acknowledgeTracking(...) **managed-call** - [`managedCallExecute`](#managedcallexecute) +**erp-imports** +- [`createErpImport`](#createerpimport) +- [`listErpImports`](#listerpimports) +- [`getErpImport`](#geterpimport) +- [`executeErpImport`](#executeerpimport) +- [`abortErpImport`](#aborterpimport) + **Schemas** +- [`S3Reference`](#s3reference) +- [`CreateErpImportRequest`](#createerpimportrequest) +- [`ErpImportValidation`](#erpimportvalidation) +- [`ErpImportProgress`](#erpimportprogress) +- [`ErpImportError`](#erpimporterror) +- [`CreateErpImportResponse`](#createerpimportresponse) +- [`ErpImportJob`](#erpimportjob) +- [`ErpImportList`](#erpimportlist) - [`NotificationHistoryItem`](#notificationhistoryitem) - [`NotificationHistoryResponse`](#notificationhistoryresponse) - [`TestNotificationRequest`](#testnotificationrequest) @@ -953,6 +968,15 @@ const { data } = await client.replayEvents( ```json { + "replayed": 2, + "results": [ + { + "event_id": "string", + "status": "success", + "replay_event_id": "string", + "message": "string" + } + ], "event_ids": ["string"] } ``` @@ -3075,8 +3099,351 @@ const { data } = await client.commitTypes( --- +### `createErpImport` + +Create a pricing-file import job from an already-uploaded file (S3 ref). Returns a job id and starts the validate phase asynchronously — poll GET /v2/erp/imports/{importId}. + +`POST /v2/erp/imports` + +```ts +const { data } = await client.createErpImport( + null, + { + s3_reference: { + bucket: 'string', + key: 'string' + }, + integration_id: 'string', + use_case_slug: 'string' + }, +) +``` + +--- + +### `listErpImports` + +List recent pricing-file import jobs for the org, newest first. + +`GET /v2/erp/imports` + +```ts +const { data } = await client.listErpImports({ + limit: 1, + cursor: 'example', +}) +``` + +
+Response + +```json +{ + "results": [ + { + "import_id": "string", + "org_id": "string", + "created_by": "string", + "integration_id": "string", + "use_case_slug": "string", + "format": "csv", + "status": "PENDING", + "s3_input_ref": { + "bucket": "string", + "key": "string" + }, + "validation": { + "total_rows": 0, + "blocking": 0, + "warnings": 0, + "entities": {} + }, + "progress": { + "processed_rows": 0, + "total_rows": 0 + }, + "error": { + "type": "VALIDATION_BLOCKED", + "message": "string" + }, + "correlation_id": "string", + "activity_id": "string", + "created_at": "1970-01-01T00:00:00.000Z", + "updated_at": "1970-01-01T00:00:00.000Z" + } + ], + "next_cursor": "string" +} +``` + +
+ +--- + +### `getErpImport` + +Get a pricing-file import job (status, counts, result links). + +`GET /v2/erp/imports/{importId}` + +```ts +const { data } = await client.getErpImport({ + importId: 'example', +}) +``` + +
+Response + +```json +{ + "import_id": "string", + "org_id": "string", + "created_by": "string", + "integration_id": "string", + "use_case_slug": "string", + "format": "csv", + "status": "PENDING", + "s3_input_ref": { + "bucket": "string", + "key": "string" + }, + "validation": { + "total_rows": 0, + "blocking": 0, + "warnings": 0, + "entities": {} + }, + "progress": { + "processed_rows": 0, + "total_rows": 0 + }, + "error": { + "type": "VALIDATION_BLOCKED", + "message": "string" + }, + "correlation_id": "string", + "activity_id": "string", + "created_at": "1970-01-01T00:00:00.000Z", + "updated_at": "1970-01-01T00:00:00.000Z" +} +``` + +
+ +--- + +### `executeErpImport` + +Confirm and run the write phase of a validated import. Only a READY job may be executed; any other status returns 409. + +`POST /v2/erp/imports/{importId}:execute` + +```ts +const { data } = await client.executeErpImport({ + importId: 'example', +}) +``` + +
+Response + +```json +{ + "import_id": "string", + "org_id": "string", + "created_by": "string", + "integration_id": "string", + "use_case_slug": "string", + "format": "csv", + "status": "PENDING", + "s3_input_ref": { + "bucket": "string", + "key": "string" + }, + "validation": { + "total_rows": 0, + "blocking": 0, + "warnings": 0, + "entities": {} + }, + "progress": { + "processed_rows": 0, + "total_rows": 0 + }, + "error": { + "type": "VALIDATION_BLOCKED", + "message": "string" + }, + "correlation_id": "string", + "activity_id": "string", + "created_at": "1970-01-01T00:00:00.000Z", + "updated_at": "1970-01-01T00:00:00.000Z" +} +``` + +
+ +--- + +### `abortErpImport` + +Ask a running import to stop. Valid while the job is VALIDATING or PROCESSING; any other status returns 409. +The stop is cooperative: the job passes through CANCELLING and typically reaches CANCELLED + +`POST /v2/erp/imports/{importId}:abort` + +```ts +const { data } = await client.abortErpImport({ + importId: 'example', +}) +``` + +--- + ## Schemas +### `S3Reference` + +```ts +type S3Reference = { + bucket: string + key: string +} +``` + +### `CreateErpImportRequest` + +```ts +type CreateErpImportRequest = { + s3_reference: { + bucket: string + key: string + } + integration_id: string + use_case_slug?: string +} +``` + +### `ErpImportValidation` + +Validate-phase summary: what the file will create, and whether it may be confirmed. Absent until the validate phase completes. No per-row detail is kept — a rejected file is corrected and imported again. + +```ts +type ErpImportValidation = { + total_rows: number + blocking: number + warnings: number + entities: Record +} +``` + +### `ErpImportProgress` + +How far the currently running phase has got. Written at every batch boundary, so it advances during long runs rather than only at the end. +`total_rows` is ABSENT during the validate phase until the file has been read to the end — there is deliberately no counting pass, since that would be a second u + +```ts +type ErpImportProgress = { + processed_rows: number + total_rows?: number +} +``` + +### `ErpImportError` + +Why the import failed — present if and only if status = FAILED. + +```ts +type ErpImportError = { + type: "VALIDATION_BLOCKED" | "PROCESSING_ERROR" | "INTERNAL_ERROR" + message: string +} +``` + +### `CreateErpImportResponse` + +```ts +type CreateErpImportResponse = { + import_id: string +} +``` + +### `ErpImportJob` + +```ts +type ErpImportJob = { + import_id: string + org_id: string + created_by?: string + integration_id: string + use_case_slug?: string + format: "csv" | "xlsx" + status: "PENDING" | "VALIDATING" | "READY" | "PROCESSING" | "IMPORTED" | "FAILED" | "CANCELLING" | "CANCELLED" + s3_input_ref: { + bucket: string + key: string + } + validation?: { + total_rows: number + blocking: number + warnings: number + entities: Record + } + progress?: { + processed_rows: number + total_rows?: number + } + error?: { + type: "VALIDATION_BLOCKED" | "PROCESSING_ERROR" | "INTERNAL_ERROR" + message: string + } + correlation_id?: string + activity_id?: string + created_at: string // date-time + updated_at: string // date-time +} +``` + +### `ErpImportList` + +```ts +type ErpImportList = { + results: Array<{ + import_id: string + org_id: string + created_by?: string + integration_id: string + use_case_slug?: string + format: "csv" | "xlsx" + status: "PENDING" | "VALIDATING" | "READY" | "PROCESSING" | "IMPORTED" | "FAILED" | "CANCELLING" | "CANCELLED" + s3_input_ref: { + bucket: { ... } + key: { ... } + } + validation?: { + total_rows: { ... } + blocking: { ... } + warnings: { ... } + entities: { ... } + } + progress?: { + processed_rows: { ... } + total_rows?: { ... } + } + error?: { + type: { ... } + message: { ... } + } + correlation_id?: string + activity_id?: string + created_at: string // date-time + updated_at: string // date-time + }> + next_cursor?: string +} +``` + ### `NotificationHistoryItem` A single notification-history row (one real notification decision). diff --git a/packages/epilot-sdk-v2/src/definitions/integration-toolkit-runtime.json b/packages/epilot-sdk-v2/src/definitions/integration-toolkit-runtime.json index d37ac0d0..e19fd654 100644 --- a/packages/epilot-sdk-v2/src/definitions/integration-toolkit-runtime.json +++ b/packages/epilot-sdk-v2/src/definitions/integration-toolkit-runtime.json @@ -1 +1 @@ -{"s":"https://integration-toolkit.sls.epilot.io","o":[["acknowledgeTracking","post","/v1/erp/tracking/acknowledgement",null,1],["triggerErp","post","/v1/erp/trigger",null,1],["processErpUpdatesEvents","post","/v1/erp/updates/events",null,1],["processErpUpdatesEventsV2","post","/v2/erp/updates/events",null,1],["processErpUpdatesEventsV3","post","/v3/erp/updates/events",null,1],["simulateMappingV2","post","/v2/erp/updates/mapping_simulation",null,1],["simulateMapping","post","/v1/erp/updates/mapping_simulation",null,1],["listIntegrations","get","/v1/integrations"],["createIntegration","post","/v1/integrations",null,1],["getIntegration","get","/v1/integrations/{integrationId}",[["integrationId","p",true]]],["updateIntegration","put","/v1/integrations/{integrationId}",[["integrationId","p",true]],1],["deleteIntegration","delete","/v1/integrations/{integrationId}",[["integrationId","p",true]]],["queryEvents","post","/v1/integrations/{integrationId}/events",[["integrationId","p",true]],1],["replayEvents","post","/v1/integrations/{integrationId}/events/replay",[["integrationId","p",true]],1],["listUseCases","get","/v1/integrations/{integrationId}/use-cases",[["integrationId","p",true]]],["createUseCase","post","/v1/integrations/{integrationId}/use-cases",[["integrationId","p",true]],1],["getUseCase","get","/v1/integrations/{integrationId}/use-cases/{useCaseId}",[["integrationId","p",true],["useCaseId","p",true]]],["updateUseCase","put","/v1/integrations/{integrationId}/use-cases/{useCaseId}",[["integrationId","p",true],["useCaseId","p",true]],1],["deleteUseCase","delete","/v1/integrations/{integrationId}/use-cases/{useCaseId}",[["integrationId","p",true],["useCaseId","p",true]]],["listUseCaseHistory","get","/v1/integrations/{integrationId}/use-cases/{useCaseId}/history",[["integrationId","p",true],["useCaseId","p",true],["cursor","q"]]],["listIntegrationsV2","get","/v2/integrations"],["createIntegrationV2","post","/v2/integrations",null,1],["getIntegrationV2","get","/v2/integrations/{integrationId}",[["integrationId","p",true]]],["updateIntegrationV2","put","/v2/integrations/{integrationId}",[["integrationId","p",true]],1],["deleteIntegrationV2","delete","/v2/integrations/{integrationId}",[["integrationId","p",true]]],["listNotificationHistory","get","/v2/integrations/{integrationId}/notifications/history",[["integrationId","p",true],["cursor","q"],["limit","q"],["type","q"]]],["testSendNotification","post","/v2/integrations/{integrationId}/notifications/test",[["integrationId","p",true]],1],["getNotificationStatus","get","/v2/integrations/{integrationId}/notifications/status",[["integrationId","p",true],["include","q"]]],["getSecureProxyWhitelist","get","/v2/integrations/{integrationId}/use-cases/{useCaseId}/secure-proxy-whitelist",[["integrationId","p",true],["useCaseId","p",true]]],["updateSecureProxyWhitelist","put","/v2/integrations/{integrationId}/use-cases/{useCaseId}/secure-proxy-whitelist",[["integrationId","p",true],["useCaseId","p",true]],1],["listSecureProxyWhitelistHistory","get","/v2/integrations/{integrationId}/use-cases/{useCaseId}/secure-proxy-whitelist/history",[["integrationId","p",true],["useCaseId","p",true],["limit","q"]]],["setIntegrationAppMapping","put","/v1/integrations/{integrationId}/app-mapping",[["integrationId","p",true]],1],["deleteIntegrationAppMapping","delete","/v1/integrations/{integrationId}/app-mapping",[["integrationId","p",true]],1],["queryInboundMonitoringEvents","post","/v1/integrations/{integrationId}/monitoring/inbound-events",[["integrationId","p",true]],1],["getMonitoringStats","post","/v1/integrations/{integrationId}/monitoring/stats",[["integrationId","p",true]],1],["getMonitoringTimeSeries","post","/v1/integrations/{integrationId}/monitoring/timeseries",[["integrationId","p",true]],1],["getOutboundStatus","get","/v1/integrations/{integrationId}/outbound-status",[["integrationId","p",true]]],["pollOutboundMessages","post","/v1/integrations/{integrationId}/outbound/messages/poll",[["integrationId","p",true]],1],["ackOutboundMessages","post","/v1/integrations/{integrationId}/outbound/messages/ack",[["integrationId","p",true]],1],["listOutboundDlqMessages","get","/v1/integrations/{integrationId}/outbound/messages/dlq",[["integrationId","p",true],["limit","q"],["next_token","q"]]],["redriveOutboundDlqMessages","post","/v1/integrations/{integrationId}/outbound/messages/dlq/redrive",[["integrationId","p",true]],1],["unblockOutboundStream","post","/v1/integrations/{integrationId}/outbound/messages/unblock",[["integrationId","p",true]],1],["queryAccessLogs","post","/v1/integrations/{integrationId}/monitoring/access-logs",[["integrationId","p",true]],1],["queryOutboundMonitoringEvents","post","/v1/integrations/{integrationId}/monitoring/outbound-events",[["integrationId","p",true]],1],["queryMonitoringEventsV2","post","/v2/integrations/{integrationId}/monitoring/events",[["integrationId","p",true]],1],["getMonitoringStatsV2","post","/v2/integrations/{integrationId}/monitoring/stats",[["integrationId","p",true]],1],["getMonitoringTimeSeriesV2","post","/v2/integrations/{integrationId}/monitoring/time-series",[["integrationId","p",true]],1],["getAssociatedMonitoringEvents","get","/v2/integrations/{integrationId}/monitoring/events/{eventId}/associated",[["integrationId","p",true],["eventId","p",true]]],["ingestExternalMonitoringEvents","post","/v2/integrations/{integrationId}/monitoring/external-events",[["integrationId","p",true]],1],["getMonitoringTraceByCorrelation","get","/v2/integrations/{integrationId}/monitoring/traces/{correlationId}",[["integrationId","p",true],["correlationId","p",true]]],["listSecureProxies","get","/v1/integrations/secure-proxies"],["secureProxy","post","/v1/secure-proxy",null,1],["managedCallExecute","post","/v1/managed-call/{slug}/execute",[["slug","p",true]],1],["generateTypesPreview","post","/v1/integrations/{integrationId}/generate-types-preview",[["integrationId","p",true]]],["generateTypes","post","/v1/integrations/{integrationId}/generate-types",[["integrationId","p",true]],1],["commitTypes","post","/v1/integrations/{integrationId}/commit-types",[["integrationId","p",true]],1]],"v":"3.0.3"} \ No newline at end of file +{"s":"https://integration-toolkit.sls.epilot.io","o":[["acknowledgeTracking","post","/v1/erp/tracking/acknowledgement",null,1],["triggerErp","post","/v1/erp/trigger",null,1],["processErpUpdatesEvents","post","/v1/erp/updates/events",null,1],["processErpUpdatesEventsV2","post","/v2/erp/updates/events",null,1],["processErpUpdatesEventsV3","post","/v3/erp/updates/events",null,1],["simulateMappingV2","post","/v2/erp/updates/mapping_simulation",null,1],["simulateMapping","post","/v1/erp/updates/mapping_simulation",null,1],["listIntegrations","get","/v1/integrations"],["createIntegration","post","/v1/integrations",null,1],["getIntegration","get","/v1/integrations/{integrationId}",[["integrationId","p",true]]],["updateIntegration","put","/v1/integrations/{integrationId}",[["integrationId","p",true]],1],["deleteIntegration","delete","/v1/integrations/{integrationId}",[["integrationId","p",true]]],["queryEvents","post","/v1/integrations/{integrationId}/events",[["integrationId","p",true]],1],["replayEvents","post","/v1/integrations/{integrationId}/events/replay",[["integrationId","p",true]],1],["listUseCases","get","/v1/integrations/{integrationId}/use-cases",[["integrationId","p",true]]],["createUseCase","post","/v1/integrations/{integrationId}/use-cases",[["integrationId","p",true]],1],["getUseCase","get","/v1/integrations/{integrationId}/use-cases/{useCaseId}",[["integrationId","p",true],["useCaseId","p",true]]],["updateUseCase","put","/v1/integrations/{integrationId}/use-cases/{useCaseId}",[["integrationId","p",true],["useCaseId","p",true]],1],["deleteUseCase","delete","/v1/integrations/{integrationId}/use-cases/{useCaseId}",[["integrationId","p",true],["useCaseId","p",true]]],["listUseCaseHistory","get","/v1/integrations/{integrationId}/use-cases/{useCaseId}/history",[["integrationId","p",true],["useCaseId","p",true],["cursor","q"]]],["listIntegrationsV2","get","/v2/integrations"],["createIntegrationV2","post","/v2/integrations",null,1],["getIntegrationV2","get","/v2/integrations/{integrationId}",[["integrationId","p",true]]],["updateIntegrationV2","put","/v2/integrations/{integrationId}",[["integrationId","p",true]],1],["deleteIntegrationV2","delete","/v2/integrations/{integrationId}",[["integrationId","p",true]]],["listNotificationHistory","get","/v2/integrations/{integrationId}/notifications/history",[["integrationId","p",true],["cursor","q"],["limit","q"],["type","q"]]],["testSendNotification","post","/v2/integrations/{integrationId}/notifications/test",[["integrationId","p",true]],1],["getNotificationStatus","get","/v2/integrations/{integrationId}/notifications/status",[["integrationId","p",true],["include","q"]]],["getSecureProxyWhitelist","get","/v2/integrations/{integrationId}/use-cases/{useCaseId}/secure-proxy-whitelist",[["integrationId","p",true],["useCaseId","p",true]]],["updateSecureProxyWhitelist","put","/v2/integrations/{integrationId}/use-cases/{useCaseId}/secure-proxy-whitelist",[["integrationId","p",true],["useCaseId","p",true]],1],["listSecureProxyWhitelistHistory","get","/v2/integrations/{integrationId}/use-cases/{useCaseId}/secure-proxy-whitelist/history",[["integrationId","p",true],["useCaseId","p",true],["limit","q"]]],["setIntegrationAppMapping","put","/v1/integrations/{integrationId}/app-mapping",[["integrationId","p",true]],1],["deleteIntegrationAppMapping","delete","/v1/integrations/{integrationId}/app-mapping",[["integrationId","p",true]],1],["queryInboundMonitoringEvents","post","/v1/integrations/{integrationId}/monitoring/inbound-events",[["integrationId","p",true]],1],["getMonitoringStats","post","/v1/integrations/{integrationId}/monitoring/stats",[["integrationId","p",true]],1],["getMonitoringTimeSeries","post","/v1/integrations/{integrationId}/monitoring/timeseries",[["integrationId","p",true]],1],["getOutboundStatus","get","/v1/integrations/{integrationId}/outbound-status",[["integrationId","p",true]]],["pollOutboundMessages","post","/v1/integrations/{integrationId}/outbound/messages/poll",[["integrationId","p",true]],1],["ackOutboundMessages","post","/v1/integrations/{integrationId}/outbound/messages/ack",[["integrationId","p",true]],1],["listOutboundDlqMessages","get","/v1/integrations/{integrationId}/outbound/messages/dlq",[["integrationId","p",true],["limit","q"],["next_token","q"]]],["redriveOutboundDlqMessages","post","/v1/integrations/{integrationId}/outbound/messages/dlq/redrive",[["integrationId","p",true]],1],["unblockOutboundStream","post","/v1/integrations/{integrationId}/outbound/messages/unblock",[["integrationId","p",true]],1],["queryAccessLogs","post","/v1/integrations/{integrationId}/monitoring/access-logs",[["integrationId","p",true]],1],["queryOutboundMonitoringEvents","post","/v1/integrations/{integrationId}/monitoring/outbound-events",[["integrationId","p",true]],1],["queryMonitoringEventsV2","post","/v2/integrations/{integrationId}/monitoring/events",[["integrationId","p",true]],1],["getMonitoringStatsV2","post","/v2/integrations/{integrationId}/monitoring/stats",[["integrationId","p",true]],1],["getMonitoringTimeSeriesV2","post","/v2/integrations/{integrationId}/monitoring/time-series",[["integrationId","p",true]],1],["getAssociatedMonitoringEvents","get","/v2/integrations/{integrationId}/monitoring/events/{eventId}/associated",[["integrationId","p",true],["eventId","p",true]]],["ingestExternalMonitoringEvents","post","/v2/integrations/{integrationId}/monitoring/external-events",[["integrationId","p",true]],1],["getMonitoringTraceByCorrelation","get","/v2/integrations/{integrationId}/monitoring/traces/{correlationId}",[["integrationId","p",true],["correlationId","p",true]]],["listSecureProxies","get","/v1/integrations/secure-proxies"],["secureProxy","post","/v1/secure-proxy",null,1],["managedCallExecute","post","/v1/managed-call/{slug}/execute",[["slug","p",true]],1],["generateTypesPreview","post","/v1/integrations/{integrationId}/generate-types-preview",[["integrationId","p",true]]],["generateTypes","post","/v1/integrations/{integrationId}/generate-types",[["integrationId","p",true]],1],["commitTypes","post","/v1/integrations/{integrationId}/commit-types",[["integrationId","p",true]],1],["createErpImport","post","/v2/erp/imports",null,1],["listErpImports","get","/v2/erp/imports",[["limit","q"],["cursor","q"]]],["getErpImport","get","/v2/erp/imports/{importId}",[["importId","p",true]]],["executeErpImport","post","/v2/erp/imports/{importId}:execute",[["importId","p",true]]],["abortErpImport","post","/v2/erp/imports/{importId}:abort",[["importId","p",true]]]],"v":"3.0.3"} \ No newline at end of file diff --git a/packages/epilot-sdk-v2/src/docs/integration-toolkit.json b/packages/epilot-sdk-v2/src/docs/integration-toolkit.json index 947f7c97..b1a0205f 100644 --- a/packages/epilot-sdk-v2/src/docs/integration-toolkit.json +++ b/packages/epilot-sdk-v2/src/docs/integration-toolkit.json @@ -1 +1 @@ -"# Integration Toolkit API\n\n- **Base URL:** `https://integration-toolkit.sls.epilot.io`\n- **Full API Docs:** [https://docs.epilot.io/api/integration-toolkit](https://docs.epilot.io/api/integration-toolkit)\n\n## Usage\n\n```ts\nimport { epilot } from '@epilot/sdk'\n\nepilot.authorize(() => '')\nconst { data } = await epilot.integrationToolkit.acknowledgeTracking(...)\n```\n\n### Tree-shakeable import\n\n```ts\nimport { getClient, authorize } from '@epilot/sdk/integration-toolkit'\n\nconst integrationToolkitClient = getClient()\nauthorize(integrationToolkitClient, () => '')\nconst { data } = await integrationToolkitClient.acknowledgeTracking(...)\n```\n\n## Operations\n\n**erp**\n- [`acknowledgeTracking`](#acknowledgetracking)\n- [`triggerErp`](#triggererp)\n- [`processErpUpdatesEventsV3`](#processerpupdateseventsv3)\n- [`simulateMappingV2`](#simulatemappingv2)\n- [`simulateMapping`](#simulatemapping)\n\n**integrations**\n- [`listIntegrations`](#listintegrations)\n- [`createIntegration`](#createintegration)\n- [`getIntegration`](#getintegration)\n- [`updateIntegration`](#updateintegration)\n- [`deleteIntegration`](#deleteintegration)\n- [`queryEvents`](#queryevents)\n- [`replayEvents`](#replayevents)\n- [`listUseCases`](#listusecases)\n- [`createUseCase`](#createusecase)\n- [`getUseCase`](#getusecase)\n- [`updateUseCase`](#updateusecase)\n- [`deleteUseCase`](#deleteusecase)\n- [`listUseCaseHistory`](#listusecasehistory)\n- [`listIntegrationsV2`](#listintegrationsv2)\n- [`createIntegrationV2`](#createintegrationv2)\n- [`getIntegrationV2`](#getintegrationv2)\n- [`updateIntegrationV2`](#updateintegrationv2)\n- [`deleteIntegrationV2`](#deleteintegrationv2)\n- [`listNotificationHistory`](#listnotificationhistory)\n- [`testSendNotification`](#testsendnotification)\n- [`getNotificationStatus`](#getnotificationstatus)\n- [`getSecureProxyWhitelist`](#getsecureproxywhitelist)\n- [`updateSecureProxyWhitelist`](#updatesecureproxywhitelist)\n- [`listSecureProxyWhitelistHistory`](#listsecureproxywhitelisthistory)\n- [`setIntegrationAppMapping`](#setintegrationappmapping)\n- [`deleteIntegrationAppMapping`](#deleteintegrationappmapping)\n- [`getOutboundStatus`](#getoutboundstatus)\n- [`pollOutboundMessages`](#polloutboundmessages)\n- [`ackOutboundMessages`](#ackoutboundmessages)\n- [`listOutboundDlqMessages`](#listoutbounddlqmessages)\n- [`redriveOutboundDlqMessages`](#redriveoutbounddlqmessages)\n- [`unblockOutboundStream`](#unblockoutboundstream)\n- [`listSecureProxies`](#listsecureproxies)\n- [`generateTypesPreview`](#generatetypespreview)\n- [`generateTypes`](#generatetypes)\n- [`commitTypes`](#committypes)\n\n**monitoring**\n- [`queryInboundMonitoringEvents`](#queryinboundmonitoringevents)\n- [`getMonitoringStats`](#getmonitoringstats)\n- [`getMonitoringTimeSeries`](#getmonitoringtimeseries)\n- [`queryAccessLogs`](#queryaccesslogs)\n- [`queryOutboundMonitoringEvents`](#queryoutboundmonitoringevents)\n- [`queryMonitoringEventsV2`](#querymonitoringeventsv2)\n- [`getMonitoringStatsV2`](#getmonitoringstatsv2)\n- [`getMonitoringTimeSeriesV2`](#getmonitoringtimeseriesv2)\n- [`getAssociatedMonitoringEvents`](#getassociatedmonitoringevents)\n- [`ingestExternalMonitoringEvents`](#ingestexternalmonitoringevents)\n- [`getMonitoringTraceByCorrelation`](#getmonitoringtracebycorrelation)\n\n**proxy**\n- [`secureProxy`](#secureproxy)\n\n**managed-call**\n- [`managedCallExecute`](#managedcallexecute)\n\n**Schemas**\n- [`NotificationHistoryItem`](#notificationhistoryitem)\n- [`NotificationHistoryResponse`](#notificationhistoryresponse)\n- [`TestNotificationRequest`](#testnotificationrequest)\n- [`TestNotificationResponse`](#testnotificationresponse)\n- [`NotificationStatusResponse`](#notificationstatusresponse)\n- [`NotificationRuleStatus`](#notificationrulestatus)\n- [`RuleBaselineStatus`](#rulebaselinestatus)\n- [`RuleBaselineBucket`](#rulebaselinebucket)\n- [`ErrorResponseBase`](#errorresponsebase)\n- [`ErpEvent`](#erpevent)\n- [`ErpUpdatesEventsV2Request`](#erpupdateseventsv2request)\n- [`ErpEventV3`](#erpeventv3)\n- [`ErpUpdatesEventsV3Request`](#erpupdateseventsv3request)\n- [`TriggerErpActionRequest`](#triggererpactionrequest)\n- [`TriggerWebhookResp`](#triggerwebhookresp)\n- [`IntegrationEditableFields`](#integrationeditablefields)\n- [`ConnectorConfig`](#connectorconfig)\n- [`ManagedCallAuth`](#managedcallauth)\n- [`Integration`](#integration)\n- [`CreateIntegrationRequest`](#createintegrationrequest)\n- [`UpdateIntegrationRequest`](#updateintegrationrequest)\n- [`EnvironmentFieldConfig`](#environmentfieldconfig)\n- [`IntegrationSettings`](#integrationsettings)\n- [`AutoRefreshSettings`](#autorefreshsettings)\n- [`IntegrationNotificationConfig`](#integrationnotificationconfig)\n- [`NotificationRecipient`](#notificationrecipient)\n- [`NotificationChannelSet`](#notificationchannelset)\n- [`NotificationRule`](#notificationrule)\n- [`NotificationDigestConfig`](#notificationdigestconfig)\n- [`SetIntegrationAppMappingRequest`](#setintegrationappmappingrequest)\n- [`DeleteIntegrationAppMappingRequest`](#deleteintegrationappmappingrequest)\n- [`IntegrationAppMapping`](#integrationappmapping)\n- [`IntegrationWithUseCases`](#integrationwithusecases)\n- [`UpsertIntegrationWithUseCasesRequest`](#upsertintegrationwithusecasesrequest)\n- [`InboundIntegrationEventConfiguration`](#inboundintegrationeventconfiguration)\n- [`OutboundIntegrationEventConfiguration`](#outboundintegrationeventconfiguration)\n- [`IntegrationEntity`](#integrationentity)\n- [`IntegrationMeterReading`](#integrationmeterreading)\n- [`PruneScopeConfig`](#prunescopeconfig)\n- [`MeterReadingPruneScopeConfig`](#meterreadingprunescopeconfig)\n- [`MeterUniqueIdsConfig`](#meteruniqueidsconfig)\n- [`IntegrationEntityField`](#integrationentityfield)\n- [`FileProxyUrlParam`](#fileproxyurlparam)\n- [`FileProxyUrlParams`](#fileproxyurlparams)\n- [`FileProxyUrlConfig`](#fileproxyurlconfig)\n- [`PortalOrigin`](#portalorigin)\n- [`PortalRefFilter`](#portalreffilter)\n- [`PortalRefConfig`](#portalrefconfig)\n- [`EnvVarRefConfig`](#envvarrefconfig)\n- [`EmbeddedUseCaseRequest`](#embeddedusecaserequest)\n- [`EmbeddedUseCaseRequestBase`](#embeddedusecaserequestbase)\n- [`EmbeddedInboundUseCaseRequest`](#embeddedinboundusecaserequest)\n- [`EmbeddedOutboundUseCaseRequest`](#embeddedoutboundusecaserequest)\n- [`EmbeddedFileProxyUseCaseRequest`](#embeddedfileproxyusecaserequest)\n- [`EmbeddedManagedCallUseCaseRequest`](#embeddedmanagedcallusecaserequest)\n- [`EmbeddedSecureProxyUseCaseRequest`](#embeddedsecureproxyusecaserequest)\n- [`UseCaseBase`](#usecasebase)\n- [`InboundUseCase`](#inboundusecase)\n- [`OutboundUseCase`](#outboundusecase)\n- [`FileProxyUseCase`](#fileproxyusecase)\n- [`ManagedCallUseCase`](#managedcallusecase)\n- [`SecureProxyUseCase`](#secureproxyusecase)\n- [`UseCase`](#usecase)\n- [`CreateUseCaseRequest`](#createusecaserequest)\n- [`CreateUseCaseRequestBase`](#createusecaserequestbase)\n- [`CreateInboundUseCaseRequest`](#createinboundusecaserequest)\n- [`CreateOutboundUseCaseRequest`](#createoutboundusecaserequest)\n- [`CreateFileProxyUseCaseRequest`](#createfileproxyusecaserequest)\n- [`CreateManagedCallUseCaseRequest`](#createmanagedcallusecaserequest)\n- [`CreateSecureProxyUseCaseRequest`](#createsecureproxyusecaserequest)\n- [`UpdateUseCaseRequest`](#updateusecaserequest)\n- [`UpdateUseCaseRequestBase`](#updateusecaserequestbase)\n- [`UpdateInboundUseCaseRequest`](#updateinboundusecaserequest)\n- [`UpdateOutboundUseCaseRequest`](#updateoutboundusecaserequest)\n- [`UpdateFileProxyUseCaseRequest`](#updatefileproxyusecaserequest)\n- [`UpdateManagedCallUseCaseRequest`](#updatemanagedcallusecaserequest)\n- [`UpdateSecureProxyUseCaseRequest`](#updatesecureproxyusecaserequest)\n- [`UseCaseHistoryEntry`](#usecasehistoryentry)\n- [`UseCaseHistoryEntryBase`](#usecasehistoryentrybase)\n- [`InboundUseCaseHistoryEntry`](#inboundusecasehistoryentry)\n- [`OutboundUseCaseHistoryEntry`](#outboundusecasehistoryentry)\n- [`FileProxyUseCaseHistoryEntry`](#fileproxyusecasehistoryentry)\n- [`ManagedCallUseCaseHistoryEntry`](#managedcallusecasehistoryentry)\n- [`SecureProxyUseCaseHistoryEntry`](#secureproxyusecasehistoryentry)\n- [`SecureProxyUseCaseConfiguration`](#secureproxyusecaseconfiguration)\n- [`SecureProxyWhitelist`](#secureproxywhitelist)\n- [`SecureProxyWhitelistUpdate`](#secureproxywhitelistupdate)\n- [`SecureProxySummary`](#secureproxysummary)\n- [`SecureProxyRequest`](#secureproxyrequest)\n- [`SecureProxyResponse`](#secureproxyresponse)\n- [`SecureProxyUpstreamError`](#secureproxyupstreamerror)\n- [`ManagedCallOperationConfig`](#managedcalloperationconfig)\n- [`ManagedCallOperation`](#managedcalloperation)\n- [`ManagedCallExecuteRequest`](#managedcallexecuterequest)\n- [`ManagedCallExecuteResponse`](#managedcallexecuteresponse)\n- [`ManagedCallErrorResponse`](#managedcallerrorresponse)\n- [`TypeAnnotations`](#typeannotations)\n- [`TypeDescriptor`](#typedescriptor)\n- [`UseCaseTypePreview`](#usecasetypepreview)\n- [`GenerateTypesPreviewResponse`](#generatetypespreviewresponse)\n- [`GenerateTypesRequest`](#generatetypesrequest)\n- [`GenerateTypesResponse`](#generatetypesresponse)\n- [`CommitTypesRequest`](#committypesrequest)\n- [`CommitTypesResponse`](#committypesresponse)\n- [`FileProxyUseCaseConfiguration`](#fileproxyusecaseconfiguration)\n- [`FileProxySecureProxyAttachment`](#fileproxysecureproxyattachment)\n- [`FileProxyAuth`](#fileproxyauth)\n- [`FileProxyParam`](#fileproxyparam)\n- [`FileProxyStep`](#fileproxystep)\n- [`FileProxyResponseConfig`](#fileproxyresponseconfig)\n- [`MappingSimulationRequest`](#mappingsimulationrequest)\n- [`MappingSimulationV2Request`](#mappingsimulationv2request)\n- [`MappingSimulationResponse`](#mappingsimulationresponse)\n- [`MappingSimulationWarning`](#mappingsimulationwarning)\n- [`EntityUpdate`](#entityupdate)\n- [`MeterReadingUpdate`](#meterreadingupdate)\n- [`IntegrationConfigurationV1`](#integrationconfigurationv1)\n- [`IntegrationObjectV1`](#integrationobjectv1)\n- [`IntegrationFieldV1`](#integrationfieldv1)\n- [`IntegrationConfigurationV2`](#integrationconfigurationv2)\n- [`OutboundMapping`](#outboundmapping)\n- [`DeliveryConfig`](#deliveryconfig)\n- [`WebhookDeliveryConfig`](#webhookdeliveryconfig)\n- [`PollDeliveryConfig`](#polldeliveryconfig)\n- [`OutboundStatusResponse`](#outboundstatusresponse)\n- [`OutboundUseCaseStatus`](#outboundusecasestatus)\n- [`OutboundPollStatus`](#outboundpollstatus)\n- [`WebhookStatus`](#webhookstatus)\n- [`OutboundConflict`](#outboundconflict)\n- [`PollOutboundMessagesRequest`](#polloutboundmessagesrequest)\n- [`OutboundMessage`](#outboundmessage)\n- [`PollOutboundMessagesResponse`](#polloutboundmessagesresponse)\n- [`AckOutboundMessagesRequest`](#ackoutboundmessagesrequest)\n- [`AckResult`](#ackresult)\n- [`AckOutboundMessagesResponse`](#ackoutboundmessagesresponse)\n- [`OutboundDlqMessage`](#outbounddlqmessage)\n- [`OutboundDlqListResponse`](#outbounddlqlistresponse)\n- [`RedriveOutboundDlqRequest`](#redriveoutbounddlqrequest)\n- [`RedriveOutboundDlqResult`](#redriveoutbounddlqresult)\n- [`RedriveOutboundDlqResponse`](#redriveoutbounddlqresponse)\n- [`UnblockOutboundStreamRequest`](#unblockoutboundstreamrequest)\n- [`UnblockOutboundStreamResponse`](#unblockoutboundstreamresponse)\n- [`RelationConfig`](#relationconfig)\n- [`RelationItemConfig`](#relationitemconfig)\n- [`RelationUniqueIdField`](#relationuniqueidfield)\n- [`RelationRefsConfig`](#relationrefsconfig)\n- [`RelationRefItemConfig`](#relationrefitemconfig)\n- [`RelationRefValueConfig`](#relationrefvalueconfig)\n- [`RepeatableFieldType`](#repeatablefieldtype)\n- [`ReplayEventsRequest`](#replayeventsrequest)\n- [`QueryEventsRequest`](#queryeventsrequest)\n- [`QueryInboundMonitoringEventsRequest`](#queryinboundmonitoringeventsrequest)\n- [`QueryAccessLogsRequest`](#queryaccesslogsrequest)\n- [`AccessLogEntry`](#accesslogentry)\n- [`GetMonitoringStatsRequest`](#getmonitoringstatsrequest)\n- [`GetMonitoringTimeSeriesRequest`](#getmonitoringtimeseriesrequest)\n- [`TimeSeriesBucket`](#timeseriesbucket)\n- [`QueryOutboundMonitoringEventsRequest`](#queryoutboundmonitoringeventsrequest)\n- [`OutboundMonitoringEvent`](#outboundmonitoringevent)\n- [`MonitoringStats`](#monitoringstats)\n- [`InboundMonitoringEvent`](#inboundmonitoringevent)\n- [`QueryMonitoringEventsV2Request`](#querymonitoringeventsv2request)\n- [`ExternalMonitoringSpan`](#externalmonitoringspan)\n- [`IngestExternalMonitoringEventsRequest`](#ingestexternalmonitoringeventsrequest)\n- [`IngestExternalMonitoringEventsResponse`](#ingestexternalmonitoringeventsresponse)\n- [`MonitoringTraceResponse`](#monitoringtraceresponse)\n- [`MonitoringEventV2`](#monitoringeventv2)\n- [`GetMonitoringStatsV2Request`](#getmonitoringstatsv2request)\n- [`MonitoringStatsV2`](#monitoringstatsv2)\n- [`GetMonitoringTimeSeriesV2Request`](#getmonitoringtimeseriesv2request)\n- [`TimeSeriesBreakdownItemV2`](#timeseriesbreakdownitemv2)\n- [`TimeSeriesBucketV2`](#timeseriesbucketv2)\n\n### `acknowledgeTracking`\n\nAcknowledges an ERP tracking record by removing it from the tracking table, requires public authentication\n\n`POST /v1/erp/tracking/acknowledgement`\n\n```ts\nconst { data } = await client.acknowledgeTracking(\n null,\n {\n ack_id: 'string'\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"message\": \"string\"\n}\n```\n\n
\n\n---\n\n### `triggerErp`\n\nTriggers the ERP integration process\n\n`POST /v1/erp/trigger`\n\n```ts\nconst { data } = await client.triggerErp(\n null,\n {\n execution_id: 'string',\n org_id: 'string',\n webhook_id: 'string',\n flow_id: 'string',\n created_at: '1970-01-01T00:00:00.000Z',\n action_id: 'string',\n flow_action_id: 'string',\n flow_name: 'string',\n activity_id: 'string',\n entity_id: 'string'\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"status_code\": \"string\",\n \"message\": \"string\",\n \"body\": {},\n \"code\": \"string\",\n \"status\": \"succeeded\",\n \"start_date\": \"string\",\n \"end_date\": \"string\",\n \"event_id\": \"string\"\n}\n```\n\n
\n\n---\n\n### `processErpUpdatesEventsV3`\n\nHandles updates from ERP systems using integration_id directly.\nThis is the v3 version that removes the unused event_type field and renames object_type to event_name\nto align with the integration UI n\n\n`POST /v3/erp/updates/events`\n\n```ts\nconst { data } = await client.processErpUpdatesEventsV3(\n null,\n {\n integration_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',\n correlation_id: 'string',\n group_id: 'customer-42',\n events: [\n {},\n {}\n ]\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"results\": [\n {\n \"event_id\": \"string\",\n \"status\": \"success\",\n \"message\": \"string\"\n }\n ]\n}\n```\n\n
\n\n---\n\n### `simulateMappingV2`\n\nTest v2.0 mapping configuration by transforming a payload using the provided mapping rules without persisting data.\n\n`POST /v2/erp/updates/mapping_simulation`\n\n```ts\nconst { data } = await client.simulateMappingV2(\n null,\n {\n event_configuration: {\n entities: [\n { /* ... */ }\n ],\n meter_readings: [\n { /* ... */ }\n ]\n },\n format: 'json',\n payload: 'string'\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"entity_updates\": [\n {\n \"entity_slug\": \"string\",\n \"unique_identifiers\": {},\n \"attributes\": {}\n }\n ],\n \"meter_readings_updates\": [\n {\n \"meter\": {\n \"$entity_unique_ids\": {}\n },\n \"meter_counter\": {\n \"$entity_unique_ids\": {}\n },\n \"attributes\": {}\n }\n ],\n \"warnings\": [\n {\n \"entity_schema\": \"string\",\n \"field\": \"string\",\n \"message\": \"string\"\n }\n ]\n}\n```\n\n
\n\n---\n\n### `simulateMapping`\n\nTest mapping configuration by transforming a payload using the provided mapping rules without persisting data.\n\n`POST /v1/erp/updates/mapping_simulation`\n\n```ts\nconst { data } = await client.simulateMapping(\n null,\n {\n mapping_configuration: {\n version: '1.0',\n mapping: {\n objects: {}\n }\n },\n object_type: 'string',\n format: 'json',\n payload: 'string'\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"entity_updates\": [\n {\n \"entity_slug\": \"string\",\n \"unique_identifiers\": {},\n \"attributes\": {}\n }\n ],\n \"meter_readings_updates\": [\n {\n \"meter\": {\n \"$entity_unique_ids\": {}\n },\n \"meter_counter\": {\n \"$entity_unique_ids\": {}\n },\n \"attributes\": {}\n }\n ],\n \"warnings\": [\n {\n \"entity_schema\": \"string\",\n \"field\": \"string\",\n \"message\": \"string\"\n }\n ]\n}\n```\n\n
\n\n---\n\n### `listIntegrations`\n\nRetrieve all integrations for the authenticated organization\n\n`GET /v1/integrations`\n\n```ts\nconst { data } = await client.listIntegrations()\n```\n\n
\nResponse\n\n```json\n{\n \"integrations\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"orgId\": \"string\",\n \"created_at\": \"1970-01-01T00:00:00.000Z\",\n \"updated_at\": \"1970-01-01T00:00:00.000Z\",\n \"name\": \"string\",\n \"description\": \"string\",\n \"access_token_ids\": [\"string\"],\n \"app_ids\": [\"string\"],\n \"environment_config\": [],\n \"settings\": {},\n \"integration_type\": \"erp\",\n \"connector_config\": {},\n \"protected\": true,\n \"_manifest\": [\"string\"]\n }\n ]\n}\n```\n\n
\n\n---\n\n### `createIntegration`\n\nCreate a new integration configuration\n\n`POST /v1/integrations`\n\n```ts\nconst { data } = await client.createIntegration(\n null,\n {\n name: 'string',\n description: 'string',\n access_token_ids: ['string'],\n app_ids: ['string'],\n environment_config: [\n {\n key: 'string',\n label: 'string',\n type: 'String',\n description: 'string',\n required: false,\n order: 0\n }\n ],\n settings: {\n autoRefresh: {\n enabled: false,\n freshnessThresholdMinutes: 1\n },\n notifications: {\n enabled: true,\n recipients: [ /* ... */ ],\n defaultChannels: { /* ... */ },\n monitoredUseCases: ['string'],\n monitoredCodes: ['string'],\n rules: [ /* ... */ ],\n digest: { /* ... */ },\n muteUntil: '1970-01-01T00:00:00.000Z'\n }\n },\n integration_type: 'erp',\n connector_config: {\n base_url: 'string',\n auth: {\n type: 'oauth2_client_credentials',\n token_url: 'string',\n client_id: 'string',\n client_secret: 'string',\n scope: 'string',\n audience: 'string',\n resource: 'string',\n body_params: {},\n headers: {},\n query_params: {},\n api_key_header: 'string',\n api_key: 'string',\n token: 'string'\n },\n types_versions: [\n { /* ... */ }\n ],\n latest_types_version: 'string',\n latest_types_package_name: 'string'\n },\n protected: true,\n _manifest: ['string']\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"orgId\": \"string\",\n \"created_at\": \"1970-01-01T00:00:00.000Z\",\n \"updated_at\": \"1970-01-01T00:00:00.000Z\",\n \"name\": \"string\",\n \"description\": \"string\",\n \"access_token_ids\": [\"string\"],\n \"app_ids\": [\"string\"],\n \"environment_config\": [\n {\n \"key\": \"string\",\n \"label\": \"string\",\n \"type\": \"String\",\n \"description\": \"string\",\n \"required\": false,\n \"order\": 0\n }\n ],\n \"settings\": {\n \"autoRefresh\": {\n \"enabled\": false,\n \"freshnessThresholdMinutes\": 1\n },\n \"notifications\": {\n \"enabled\": true,\n \"recipients\": [],\n \"defaultChannels\": {},\n \"monitoredUseCases\": [\"string\"],\n \"monitoredCodes\": [\"string\"],\n \"rules\": [],\n \"digest\": {},\n \"muteUntil\": \"1970-01-01T00:00:00.000Z\"\n }\n },\n \"integration_type\": \"erp\",\n \"connector_config\": {\n \"base_url\": \"string\",\n \"auth\": {\n \"type\": \"oauth2_client_credentials\",\n \"token_url\": \"string\",\n \"client_id\": \"string\",\n \"client_secret\": \"string\",\n \"scope\": \"string\",\n \"audience\": \"string\",\n \"resource\": \"string\",\n \"body_params\": {},\n \"headers\": {},\n \"query_params\": {},\n \"api_key_header\": \"string\",\n \"api_key\": \"string\",\n \"token\": \"string\"\n },\n \"types_versions\": [\n {}\n ],\n \"latest_types_version\": \"string\",\n \"latest_types_package_name\": \"string\"\n },\n \"protected\": true,\n \"_manifest\": [\"string\"]\n}\n```\n\n
\n\n---\n\n### `getIntegration`\n\nRetrieve a specific integration by its ID\n\n`GET /v1/integrations/{integrationId}`\n\n```ts\nconst { data } = await client.getIntegration({\n integrationId: 'example',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"orgId\": \"string\",\n \"created_at\": \"1970-01-01T00:00:00.000Z\",\n \"updated_at\": \"1970-01-01T00:00:00.000Z\",\n \"name\": \"string\",\n \"description\": \"string\",\n \"access_token_ids\": [\"string\"],\n \"app_ids\": [\"string\"],\n \"environment_config\": [\n {\n \"key\": \"string\",\n \"label\": \"string\",\n \"type\": \"String\",\n \"description\": \"string\",\n \"required\": false,\n \"order\": 0\n }\n ],\n \"settings\": {\n \"autoRefresh\": {\n \"enabled\": false,\n \"freshnessThresholdMinutes\": 1\n },\n \"notifications\": {\n \"enabled\": true,\n \"recipients\": [],\n \"defaultChannels\": {},\n \"monitoredUseCases\": [\"string\"],\n \"monitoredCodes\": [\"string\"],\n \"rules\": [],\n \"digest\": {},\n \"muteUntil\": \"1970-01-01T00:00:00.000Z\"\n }\n },\n \"integration_type\": \"erp\",\n \"connector_config\": {\n \"base_url\": \"string\",\n \"auth\": {\n \"type\": \"oauth2_client_credentials\",\n \"token_url\": \"string\",\n \"client_id\": \"string\",\n \"client_secret\": \"string\",\n \"scope\": \"string\",\n \"audience\": \"string\",\n \"resource\": \"string\",\n \"body_params\": {},\n \"headers\": {},\n \"query_params\": {},\n \"api_key_header\": \"string\",\n \"api_key\": \"string\",\n \"token\": \"string\"\n },\n \"types_versions\": [\n {}\n ],\n \"latest_types_version\": \"string\",\n \"latest_types_package_name\": \"string\"\n },\n \"protected\": true,\n \"_manifest\": [\"string\"]\n}\n```\n\n
\n\n---\n\n### `updateIntegration`\n\nUpdate an existing integration configuration\n\n`PUT /v1/integrations/{integrationId}`\n\n```ts\nconst { data } = await client.updateIntegration(\n {\n integrationId: 'example',\n },\n {},\n)\n```\n\n
\nResponse\n\n```json\n{\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"orgId\": \"string\",\n \"created_at\": \"1970-01-01T00:00:00.000Z\",\n \"updated_at\": \"1970-01-01T00:00:00.000Z\",\n \"name\": \"string\",\n \"description\": \"string\",\n \"access_token_ids\": [\"string\"],\n \"app_ids\": [\"string\"],\n \"environment_config\": [\n {\n \"key\": \"string\",\n \"label\": \"string\",\n \"type\": \"String\",\n \"description\": \"string\",\n \"required\": false,\n \"order\": 0\n }\n ],\n \"settings\": {\n \"autoRefresh\": {\n \"enabled\": false,\n \"freshnessThresholdMinutes\": 1\n },\n \"notifications\": {\n \"enabled\": true,\n \"recipients\": [],\n \"defaultChannels\": {},\n \"monitoredUseCases\": [\"string\"],\n \"monitoredCodes\": [\"string\"],\n \"rules\": [],\n \"digest\": {},\n \"muteUntil\": \"1970-01-01T00:00:00.000Z\"\n }\n },\n \"integration_type\": \"erp\",\n \"connector_config\": {\n \"base_url\": \"string\",\n \"auth\": {\n \"type\": \"oauth2_client_credentials\",\n \"token_url\": \"string\",\n \"client_id\": \"string\",\n \"client_secret\": \"string\",\n \"scope\": \"string\",\n \"audience\": \"string\",\n \"resource\": \"string\",\n \"body_params\": {},\n \"headers\": {},\n \"query_params\": {},\n \"api_key_header\": \"string\",\n \"api_key\": \"string\",\n \"token\": \"string\"\n },\n \"types_versions\": [\n {}\n ],\n \"latest_types_version\": \"string\",\n \"latest_types_package_name\": \"string\"\n },\n \"protected\": true,\n \"_manifest\": [\"string\"]\n}\n```\n\n
\n\n---\n\n### `deleteIntegration`\n\nDelete an integration and all its use cases\n\n`DELETE /v1/integrations/{integrationId}`\n\n```ts\nconst { data } = await client.deleteIntegration({\n integrationId: 'example',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"message\": \"string\"\n}\n```\n\n
\n\n---\n\n### `queryEvents`\n\nQuery events for a specific integration\n\n`POST /v1/integrations/{integrationId}/events`\n\n```ts\nconst { data } = await client.queryEvents(\n {\n integrationId: 'example',\n },\n {\n event_id: 'string',\n event_type: 'CREATE',\n correlation_id: 'string',\n object_type: 'string',\n event_name: 'string',\n use_case_id: 'string',\n limit: 25,\n cursor: {\n event_time: '2025-10-31T12:34:56Z',\n event_id: 'evt_1234567890abcdef'\n }\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"data\": [\n {\n \"event_type\": \"CREATE\",\n \"object_type\": \"string\",\n \"timestamp\": \"1970-01-01T00:00:00.000Z\",\n \"format\": \"json\",\n \"payload\": \"string\",\n \"deduplication_id\": \"evt-2025-05-01-12345-create-bp\",\n \"correlation_id\": \"bp-8f3a2c-7d4e-4b1a-9c2f-1e6d5a4b3c21\",\n \"use_case_id\": \"string\"\n }\n ],\n \"next_cursor\": {\n \"event_time\": \"2025-10-31T12:34:56Z\",\n \"event_id\": \"evt_1234567890abcdef\"\n },\n \"has_more\": true\n}\n```\n\n
\n\n---\n\n### `replayEvents`\n\nReplay one or more events for a specific integration. Events will be re-processed with their original payloads but with a new correlation ID for traceability.\n\n`POST /v1/integrations/{integrationId}/events/replay`\n\n```ts\nconst { data } = await client.replayEvents(\n {\n integrationId: 'example',\n },\n {\n event_ids: ['string']\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"event_ids\": [\"string\"]\n}\n```\n\n
\n\n---\n\n### `listUseCases`\n\nRetrieve all use cases for a specific integration\n\n`GET /v1/integrations/{integrationId}/use-cases`\n\n```ts\nconst { data } = await client.listUseCases({\n integrationId: 'example',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"use_cases\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"integrationId\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"name\": \"string\",\n \"slug\": \"string\",\n \"type\": \"inbound\",\n \"enabled\": true,\n \"change_description\": \"string\",\n \"created_at\": \"1970-01-01T00:00:00.000Z\",\n \"updated_at\": \"1970-01-01T00:00:00.000Z\",\n \"configuration\": {}\n }\n ]\n}\n```\n\n
\n\n---\n\n### `createUseCase`\n\nCreate a new use case for an integration\n\n`POST /v1/integrations/{integrationId}/use-cases`\n\n```ts\nconst { data } = await client.createUseCase(\n {\n integrationId: 'example',\n },\n {\n name: 'string',\n slug: 'string',\n enabled: true,\n type: 'inbound',\n configuration: {\n entities: [\n { /* ... */ }\n ],\n meter_readings: [\n { /* ... */ }\n ]\n }\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"integrationId\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"name\": \"string\",\n \"slug\": \"string\",\n \"type\": \"inbound\",\n \"enabled\": true,\n \"change_description\": \"string\",\n \"created_at\": \"1970-01-01T00:00:00.000Z\",\n \"updated_at\": \"1970-01-01T00:00:00.000Z\",\n \"configuration\": {\n \"entities\": [\n {}\n ],\n \"meter_readings\": [\n {}\n ]\n }\n}\n```\n\n
\n\n---\n\n### `getUseCase`\n\nRetrieve a specific use case by its ID\n\n`GET /v1/integrations/{integrationId}/use-cases/{useCaseId}`\n\n```ts\nconst { data } = await client.getUseCase({\n integrationId: 'example',\n useCaseId: 'example',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"integrationId\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"name\": \"string\",\n \"slug\": \"string\",\n \"type\": \"inbound\",\n \"enabled\": true,\n \"change_description\": \"string\",\n \"created_at\": \"1970-01-01T00:00:00.000Z\",\n \"updated_at\": \"1970-01-01T00:00:00.000Z\",\n \"configuration\": {\n \"entities\": [\n {}\n ],\n \"meter_readings\": [\n {}\n ]\n }\n}\n```\n\n
\n\n---\n\n### `updateUseCase`\n\nUpdate an existing use case configuration\n\n`PUT /v1/integrations/{integrationId}/use-cases/{useCaseId}`\n\n```ts\nconst { data } = await client.updateUseCase(\n {\n integrationId: 'example',\n useCaseId: 'example',\n },\n {\n name: 'string',\n slug: 'string',\n enabled: true,\n change_description: 'string',\n type: 'inbound',\n configuration: {\n entities: [\n { /* ... */ }\n ],\n meter_readings: [\n { /* ... */ }\n ]\n }\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"integrationId\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"name\": \"string\",\n \"slug\": \"string\",\n \"type\": \"inbound\",\n \"enabled\": true,\n \"change_description\": \"string\",\n \"created_at\": \"1970-01-01T00:00:00.000Z\",\n \"updated_at\": \"1970-01-01T00:00:00.000Z\",\n \"configuration\": {\n \"entities\": [\n {}\n ],\n \"meter_readings\": [\n {}\n ]\n }\n}\n```\n\n
\n\n---\n\n### `deleteUseCase`\n\nDelete a use case from an integration\n\n`DELETE /v1/integrations/{integrationId}/use-cases/{useCaseId}`\n\n```ts\nconst { data } = await client.deleteUseCase({\n integrationId: 'example',\n useCaseId: 'example',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"message\": \"string\"\n}\n```\n\n
\n\n---\n\n### `listUseCaseHistory`\n\nRetrieve historical versions of a use case's configuration.\nHistory entries are returned in reverse chronological order (newest first).\nUse the 'cursor' parameter for pagination to fetch additional en\n\n`GET /v1/integrations/{integrationId}/use-cases/{useCaseId}/history`\n\n```ts\nconst { data } = await client.listUseCaseHistory({\n integrationId: 'example',\n useCaseId: 'example',\n cursor: 'example',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"history\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"useCaseId\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"integrationId\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"name\": \"string\",\n \"slug\": \"string\",\n \"enabled\": true,\n \"change_description\": \"string\",\n \"changed_by\": \"string\",\n \"created_at\": \"1970-01-01T00:00:00.000Z\",\n \"updated_at\": \"1970-01-01T00:00:00.000Z\",\n \"history_created_at\": \"1970-01-01T00:00:00.000Z\",\n \"type\": \"inbound\",\n \"configuration\": {}\n }\n ],\n \"next_cursor\": \"string\"\n}\n```\n\n
\n\n---\n\n### `listIntegrationsV2`\n\nRetrieve all integrations with embedded use cases for the authenticated organization\n\n`GET /v2/integrations`\n\n```ts\nconst { data } = await client.listIntegrationsV2()\n```\n\n
\nResponse\n\n```json\n{\n \"integrations\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"orgId\": \"string\",\n \"created_at\": \"1970-01-01T00:00:00.000Z\",\n \"updated_at\": \"1970-01-01T00:00:00.000Z\",\n \"name\": \"string\",\n \"description\": \"string\",\n \"access_token_ids\": [\"string\"],\n \"app_ids\": [\"string\"],\n \"environment_config\": [],\n \"settings\": {},\n \"integration_type\": \"erp\",\n \"connector_config\": {},\n \"protected\": true,\n \"_manifest\": [\"string\"],\n \"use_cases\": []\n }\n ]\n}\n```\n\n
\n\n---\n\n### `createIntegrationV2`\n\nCreate a new integration with embedded use cases.\n\n`POST /v2/integrations`\n\n```ts\nconst { data } = await client.createIntegrationV2(\n null,\n {\n name: 'string',\n description: 'string',\n access_token_ids: ['string'],\n app_ids: ['string'],\n environment_config: [\n {\n key: 'string',\n label: 'string',\n type: 'String',\n description: 'string',\n required: false,\n order: 0\n }\n ],\n settings: {\n autoRefresh: {\n enabled: false,\n freshnessThresholdMinutes: 1\n },\n notifications: {\n enabled: true,\n recipients: [ /* ... */ ],\n defaultChannels: { /* ... */ },\n monitoredUseCases: ['string'],\n monitoredCodes: ['string'],\n rules: [ /* ... */ ],\n digest: { /* ... */ },\n muteUntil: '1970-01-01T00:00:00.000Z'\n }\n },\n integration_type: 'erp',\n connector_config: {\n base_url: 'string',\n auth: {\n type: 'oauth2_client_credentials',\n token_url: 'string',\n client_id: 'string',\n client_secret: 'string',\n scope: 'string',\n audience: 'string',\n resource: 'string',\n body_params: {},\n headers: {},\n query_params: {},\n api_key_header: 'string',\n api_key: 'string',\n token: 'string'\n },\n types_versions: [\n { /* ... */ }\n ],\n latest_types_version: 'string',\n latest_types_package_name: 'string'\n },\n protected: true,\n _manifest: ['string'],\n use_cases: [\n {\n id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',\n name: 'string',\n slug: 'string',\n enabled: true,\n change_description: 'string',\n type: 'inbound',\n configuration: { /* ... */ }\n }\n ]\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"orgId\": \"string\",\n \"created_at\": \"1970-01-01T00:00:00.000Z\",\n \"updated_at\": \"1970-01-01T00:00:00.000Z\",\n \"name\": \"string\",\n \"description\": \"string\",\n \"access_token_ids\": [\"string\"],\n \"app_ids\": [\"string\"],\n \"environment_config\": [\n {\n \"key\": \"string\",\n \"label\": \"string\",\n \"type\": \"String\",\n \"description\": \"string\",\n \"required\": false,\n \"order\": 0\n }\n ],\n \"settings\": {\n \"autoRefresh\": {\n \"enabled\": false,\n \"freshnessThresholdMinutes\": 1\n },\n \"notifications\": {\n \"enabled\": true,\n \"recipients\": [],\n \"defaultChannels\": {},\n \"monitoredUseCases\": [\"string\"],\n \"monitoredCodes\": [\"string\"],\n \"rules\": [],\n \"digest\": {},\n \"muteUntil\": \"1970-01-01T00:00:00.000Z\"\n }\n },\n \"integration_type\": \"erp\",\n \"connector_config\": {\n \"base_url\": \"string\",\n \"auth\": {\n \"type\": \"oauth2_client_credentials\",\n \"token_url\": \"string\",\n \"client_id\": \"string\",\n \"client_secret\": \"string\",\n \"scope\": \"string\",\n \"audience\": \"string\",\n \"resource\": \"string\",\n \"body_params\": {},\n \"headers\": {},\n \"query_params\": {},\n \"api_key_header\": \"string\",\n \"api_key\": \"string\",\n \"token\": \"string\"\n },\n \"types_versions\": [\n {}\n ],\n \"latest_types_version\": \"string\",\n \"latest_types_package_name\": \"string\"\n },\n \"protected\": true,\n \"_manifest\": [\"string\"],\n \"use_cases\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"integrationId\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"name\": \"string\",\n \"slug\": \"string\",\n \"type\": \"inbound\",\n \"enabled\": true,\n \"change_description\": \"string\",\n \"created_at\": \"1970-01-01T00:00:00.000Z\",\n \"updated_at\": \"1970-01-01T00:00:00.000Z\",\n \"configuration\": {}\n }\n ]\n}\n```\n\n
\n\n---\n\n### `getIntegrationV2`\n\nRetrieve a specific integration with all its embedded use cases\n\n`GET /v2/integrations/{integrationId}`\n\n```ts\nconst { data } = await client.getIntegrationV2({\n integrationId: 'example',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"orgId\": \"string\",\n \"created_at\": \"1970-01-01T00:00:00.000Z\",\n \"updated_at\": \"1970-01-01T00:00:00.000Z\",\n \"name\": \"string\",\n \"description\": \"string\",\n \"access_token_ids\": [\"string\"],\n \"app_ids\": [\"string\"],\n \"environment_config\": [\n {\n \"key\": \"string\",\n \"label\": \"string\",\n \"type\": \"String\",\n \"description\": \"string\",\n \"required\": false,\n \"order\": 0\n }\n ],\n \"settings\": {\n \"autoRefresh\": {\n \"enabled\": false,\n \"freshnessThresholdMinutes\": 1\n },\n \"notifications\": {\n \"enabled\": true,\n \"recipients\": [],\n \"defaultChannels\": {},\n \"monitoredUseCases\": [\"string\"],\n \"monitoredCodes\": [\"string\"],\n \"rules\": [],\n \"digest\": {},\n \"muteUntil\": \"1970-01-01T00:00:00.000Z\"\n }\n },\n \"integration_type\": \"erp\",\n \"connector_config\": {\n \"base_url\": \"string\",\n \"auth\": {\n \"type\": \"oauth2_client_credentials\",\n \"token_url\": \"string\",\n \"client_id\": \"string\",\n \"client_secret\": \"string\",\n \"scope\": \"string\",\n \"audience\": \"string\",\n \"resource\": \"string\",\n \"body_params\": {},\n \"headers\": {},\n \"query_params\": {},\n \"api_key_header\": \"string\",\n \"api_key\": \"string\",\n \"token\": \"string\"\n },\n \"types_versions\": [\n {}\n ],\n \"latest_types_version\": \"string\",\n \"latest_types_package_name\": \"string\"\n },\n \"protected\": true,\n \"_manifest\": [\"string\"],\n \"use_cases\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"integrationId\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"name\": \"string\",\n \"slug\": \"string\",\n \"type\": \"inbound\",\n \"enabled\": true,\n \"change_description\": \"string\",\n \"created_at\": \"1970-01-01T00:00:00.000Z\",\n \"updated_at\": \"1970-01-01T00:00:00.000Z\",\n \"configuration\": {}\n }\n ]\n}\n```\n\n
\n\n---\n\n### `updateIntegrationV2`\n\nUpdate an existing integration with embedded use cases.\nThe integration must already exist.\nUse cases are updated declaratively:\n- Use cases in the request with matching IDs are updated\n- Use cases in\n\n`PUT /v2/integrations/{integrationId}`\n\n```ts\nconst { data } = await client.updateIntegrationV2(\n {\n integrationId: 'example',\n },\n {\n name: 'string',\n description: 'string',\n access_token_ids: ['string'],\n app_ids: ['string'],\n environment_config: [\n {\n key: 'string',\n label: 'string',\n type: 'String',\n description: 'string',\n required: false,\n order: 0\n }\n ],\n settings: {\n autoRefresh: {\n enabled: false,\n freshnessThresholdMinutes: 1\n },\n notifications: {\n enabled: true,\n recipients: [ /* ... */ ],\n defaultChannels: { /* ... */ },\n monitoredUseCases: ['string'],\n monitoredCodes: ['string'],\n rules: [ /* ... */ ],\n digest: { /* ... */ },\n muteUntil: '1970-01-01T00:00:00.000Z'\n }\n },\n integration_type: 'erp',\n connector_config: {\n base_url: 'string',\n auth: {\n type: 'oauth2_client_credentials',\n token_url: 'string',\n client_id: 'string',\n client_secret: 'string',\n scope: 'string',\n audience: 'string',\n resource: 'string',\n body_params: {},\n headers: {},\n query_params: {},\n api_key_header: 'string',\n api_key: 'string',\n token: 'string'\n },\n types_versions: [\n { /* ... */ }\n ],\n latest_types_version: 'string',\n latest_types_package_name: 'string'\n },\n protected: true,\n _manifest: ['string'],\n use_cases: [\n {\n id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',\n name: 'string',\n slug: 'string',\n enabled: true,\n change_description: 'string',\n type: 'inbound',\n configuration: { /* ... */ }\n }\n ]\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"orgId\": \"string\",\n \"created_at\": \"1970-01-01T00:00:00.000Z\",\n \"updated_at\": \"1970-01-01T00:00:00.000Z\",\n \"name\": \"string\",\n \"description\": \"string\",\n \"access_token_ids\": [\"string\"],\n \"app_ids\": [\"string\"],\n \"environment_config\": [\n {\n \"key\": \"string\",\n \"label\": \"string\",\n \"type\": \"String\",\n \"description\": \"string\",\n \"required\": false,\n \"order\": 0\n }\n ],\n \"settings\": {\n \"autoRefresh\": {\n \"enabled\": false,\n \"freshnessThresholdMinutes\": 1\n },\n \"notifications\": {\n \"enabled\": true,\n \"recipients\": [],\n \"defaultChannels\": {},\n \"monitoredUseCases\": [\"string\"],\n \"monitoredCodes\": [\"string\"],\n \"rules\": [],\n \"digest\": {},\n \"muteUntil\": \"1970-01-01T00:00:00.000Z\"\n }\n },\n \"integration_type\": \"erp\",\n \"connector_config\": {\n \"base_url\": \"string\",\n \"auth\": {\n \"type\": \"oauth2_client_credentials\",\n \"token_url\": \"string\",\n \"client_id\": \"string\",\n \"client_secret\": \"string\",\n \"scope\": \"string\",\n \"audience\": \"string\",\n \"resource\": \"string\",\n \"body_params\": {},\n \"headers\": {},\n \"query_params\": {},\n \"api_key_header\": \"string\",\n \"api_key\": \"string\",\n \"token\": \"string\"\n },\n \"types_versions\": [\n {}\n ],\n \"latest_types_version\": \"string\",\n \"latest_types_package_name\": \"string\"\n },\n \"protected\": true,\n \"_manifest\": [\"string\"],\n \"use_cases\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"integrationId\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"name\": \"string\",\n \"slug\": \"string\",\n \"type\": \"inbound\",\n \"enabled\": true,\n \"change_description\": \"string\",\n \"created_at\": \"1970-01-01T00:00:00.000Z\",\n \"updated_at\": \"1970-01-01T00:00:00.000Z\",\n \"configuration\": {}\n }\n ]\n}\n```\n\n
\n\n---\n\n### `deleteIntegrationV2`\n\nDelete an integration and all its use cases\n\n`DELETE /v2/integrations/{integrationId}`\n\n```ts\nconst { data } = await client.deleteIntegrationV2({\n integrationId: 'example',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"message\": \"string\"\n}\n```\n\n
\n\n---\n\n### `listNotificationHistory`\n\nReturns the cursor-paginated, newest-first notification history for an\nintegration (every real notification decision — both fired and suppressed).\nRequires the `integration:view` permission on the int\n\n`GET /v2/integrations/{integrationId}/notifications/history`\n\n```ts\nconst { data } = await client.listNotificationHistory({\n integrationId: 'example',\n cursor: 'example',\n limit: 1,\n type: 'example',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"history\": [\n {\n \"id\": \"string\",\n \"type\": \"string\",\n \"state_transition\": \"string\",\n \"severity\": \"error\",\n \"title\": \"string\",\n \"occurred_at\": \"1970-01-01T00:00:00.000Z\",\n \"notified\": true,\n \"suppressed_reason\": \"muted\",\n \"recipients\": [\"string\"],\n \"context\": {},\n \"created_at\": \"1970-01-01T00:00:00.000Z\"\n }\n ],\n \"next_cursor\": \"string\"\n}\n```\n\n
\n\n---\n\n### `testSendNotification`\n\nRenders and sends ONE representative notification of the requested kind/type to\nthe CALLING USER ONLY (never any other recipient), so an operator can preview how\na notification looks. A test send does\n\n`POST /v2/integrations/{integrationId}/notifications/test`\n\n```ts\nconst { data } = await client.testSendNotification(\n {\n integrationId: 'example',\n },\n {\n kind: 'alert',\n type: 'string',\n channels: ['email']\n },\n)\n```\n\n---\n\n### `getNotificationStatus`\n\nReturns the live per-rule alert state and (for 'auto' rules) the current\nhour-of-week baseline band for an integration's notification monitoring.\nReflects the latest 5-minute sweep — near-real-time, n\n\n`GET /v2/integrations/{integrationId}/notifications/status`\n\n```ts\nconst { data } = await client.getNotificationStatus({\n integrationId: 'example',\n include: 'example',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"health\": \"healthy\",\n \"evaluated_at\": \"1970-01-01T00:00:00.000Z\",\n \"rules\": [\n {\n \"rule_id\": \"string\",\n \"state\": \"ok\",\n \"last_fired_at\": \"1970-01-01T00:00:00.000Z\",\n \"last_cleared_at\": \"1970-01-01T00:00:00.000Z\",\n \"baseline\": {\n \"is_mature\": true,\n \"computed_at\": \"1970-01-01T00:00:00.000Z\",\n \"median\": 0,\n \"mad\": 0,\n \"upper\": 0,\n \"buckets\": [\n {\n \"dow\": 1,\n \"hour\": 0,\n \"median\": 0,\n \"mad\": 0\n }\n ]\n }\n }\n ]\n}\n```\n\n
\n\n---\n\n### `getSecureProxyWhitelist`\n\nGet secure_proxy whitelist (admin portal only)\n\n`GET /v2/integrations/{integrationId}/use-cases/{useCaseId}/secure-proxy-whitelist`\n\n```ts\nconst { data } = await client.getSecureProxyWhitelist({\n integrationId: 'example',\n useCaseId: 'example',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"vpc_mode\": \"static_ip\",\n \"allowed_domains\": [\"string\"],\n \"allowed_ips\": [\"string\"]\n}\n```\n\n
\n\n---\n\n### `updateSecureProxyWhitelist`\n\nUpdate secure_proxy whitelist (admin portal only)\n\n`PUT /v2/integrations/{integrationId}/use-cases/{useCaseId}/secure-proxy-whitelist`\n\n```ts\nconst { data } = await client.updateSecureProxyWhitelist(\n {\n integrationId: 'example',\n useCaseId: 'example',\n },\n {\n allowed_domains: ['string'],\n allowed_ips: ['string']\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"vpc_mode\": \"static_ip\",\n \"allowed_domains\": [\"string\"],\n \"allowed_ips\": [\"string\"]\n}\n```\n\n
\n\n---\n\n### `listSecureProxyWhitelistHistory`\n\nList secure_proxy whitelist change history (admin portal only)\n\n`GET /v2/integrations/{integrationId}/use-cases/{useCaseId}/secure-proxy-whitelist/history`\n\n```ts\nconst { data } = await client.listSecureProxyWhitelistHistory({\n integrationId: 'example',\n useCaseId: 'example',\n limit: 1,\n})\n```\n\n
\nResponse\n\n```json\n{\n \"history\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"useCaseId\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"integrationId\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"name\": \"string\",\n \"slug\": \"string\",\n \"enabled\": true,\n \"change_description\": \"string\",\n \"changed_by\": \"string\",\n \"created_at\": \"1970-01-01T00:00:00.000Z\",\n \"updated_at\": \"1970-01-01T00:00:00.000Z\",\n \"history_created_at\": \"1970-01-01T00:00:00.000Z\",\n \"type\": \"secure_proxy\",\n \"configuration\": {\n \"vpc_mode\": \"static_ip\",\n \"allowed_domains\": [\"string\"],\n \"allowed_ips\": [\"string\"]\n }\n }\n ]\n}\n```\n\n
\n\n---\n\n### `setIntegrationAppMapping`\n\nCreates or updates a mapping from an app/component to an integration.\nThis allows ERP updates sent via app_id and component_id to be associated\nwith a specific integration configuration.\n\n`PUT /v1/integrations/{integrationId}/app-mapping`\n\n```ts\nconst { data } = await client.setIntegrationAppMapping(\n {\n integrationId: 'example',\n },\n {\n app_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',\n component_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',\n overwrite: false\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"integration_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\"\n}\n```\n\n
\n\n---\n\n### `deleteIntegrationAppMapping`\n\nRemoves a mapping from an app/component to an integration.\n\n`DELETE /v1/integrations/{integrationId}/app-mapping`\n\n```ts\nconst { data } = await client.deleteIntegrationAppMapping(\n {\n integrationId: 'example',\n },\n {\n app_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',\n component_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6'\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"message\": \"string\"\n}\n```\n\n
\n\n---\n\n### `queryInboundMonitoringEvents`\n\nQuery inbound monitoring events for a specific integration.\nReturns detailed information about inbound sync events from ERP systems,\nincluding success rates, error breakdowns, and processing metrics.\n\n`POST /v1/integrations/{integrationId}/monitoring/inbound-events`\n\n```ts\nconst { data } = await client.queryInboundMonitoringEvents(\n {\n integrationId: 'example',\n },\n {\n use_case_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',\n event_type: 'CREATE',\n sync_type: 'entity',\n status: 'success',\n error_category: 'validation',\n correlation_id: 'string',\n object_type: 'string',\n event_name: 'string',\n event_id: 'string',\n from_date: '2025-01-01T00:00:00Z',\n to_date: '2025-01-31T23:59:59Z',\n limit: 50,\n cursor: {\n completed_at: '1970-01-01T00:00:00.000Z',\n event_id: 'string'\n }\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"data\": [\n {\n \"org_id\": \"string\",\n \"event_id\": \"string\",\n \"correlation_id\": \"string\",\n \"integration_id\": \"string\",\n \"use_case_id\": \"string\",\n \"event_type\": \"CREATE\",\n \"object_type\": \"string\",\n \"sync_type\": \"entity\",\n \"status\": \"success\",\n \"error_code\": \"string\",\n \"error_message\": \"string\",\n \"error_category\": \"validation\",\n \"processing_duration_ms\": 0,\n \"received_at\": \"1970-01-01T00:00:00.000Z\",\n \"completed_at\": \"1970-01-01T00:00:00.000Z\"\n }\n ],\n \"next_cursor\": {\n \"completed_at\": \"1970-01-01T00:00:00.000Z\",\n \"event_id\": \"string\"\n },\n \"has_more\": true\n}\n```\n\n
\n\n---\n\n### `getMonitoringStats`\n\nGet aggregated statistics for both inbound and outbound monitoring events for a specific integration.\nReturns summary metrics for inbound (ERP sync) and outbound (webhook delivery) events,\nincluding s\n\n`POST /v1/integrations/{integrationId}/monitoring/stats`\n\n```ts\nconst { data } = await client.getMonitoringStats(\n {\n integrationId: 'example',\n },\n {\n from_date: '2025-01-01T00:00:00Z',\n to_date: '2025-01-31T23:59:59Z',\n inbound_group_by: ['use_case_id', 'status'],\n outbound_group_by: ['event_name', 'status']\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"inbound\": {\n \"total_events\": 0,\n \"total_correlations\": 0,\n \"success_count\": 0,\n \"error_count\": 0,\n \"skipped_count\": 0,\n \"warning_count\": 0,\n \"success_rate\": 0,\n \"last_error_at\": \"1970-01-01T00:00:00.000Z\",\n \"breakdown\": [\n {}\n ]\n },\n \"outbound\": {\n \"total_events\": 0,\n \"success_count\": 0,\n \"error_count\": 0,\n \"pending_count\": 0,\n \"success_rate\": 0,\n \"last_error_at\": \"1970-01-01T00:00:00.000Z\",\n \"breakdown\": [\n {}\n ]\n }\n}\n```\n\n
\n\n---\n\n### `getMonitoringTimeSeries`\n\nGet time-series aggregated event counts for monitoring charts.\nReturns pre-bucketed counts at configurable intervals for both inbound and outbound events.\nMaximum of 200 buckets per request. Returns 4\n\n`POST /v1/integrations/{integrationId}/monitoring/timeseries`\n\n```ts\nconst { data } = await client.getMonitoringTimeSeries(\n {\n integrationId: 'example',\n },\n {\n from_date: '2025-01-01T00:00:00Z',\n to_date: '2025-01-31T23:59:59Z',\n interval: '1h',\n direction: 'both'\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"interval\": \"5m\",\n \"from_date\": \"1970-01-01T00:00:00.000Z\",\n \"to_date\": \"1970-01-01T00:00:00.000Z\",\n \"buckets\": [\n {\n \"timestamp\": \"1970-01-01T00:00:00.000Z\",\n \"inbound\": {\n \"success_count\": 0,\n \"error_count\": 0,\n \"warning_count\": 0,\n \"skipped_count\": 0,\n \"total_count\": 0\n },\n \"outbound\": {\n \"success_count\": 0,\n \"error_count\": 0,\n \"pending_count\": 0,\n \"total_count\": 0\n }\n }\n ]\n}\n```\n\n
\n\n---\n\n### `getOutboundStatus`\n\nGet the status of all outbound use cases for a specific integration.\nReturns conflict information when events or webhooks are disabled but the use case is enabled.\n\n`GET /v1/integrations/{integrationId}/outbound-status`\n\n```ts\nconst { data } = await client.getOutboundStatus({\n integrationId: 'example',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"useCases\": [\n {\n \"useCaseId\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"name\": \"string\",\n \"useCaseEnabled\": true,\n \"eventCatalogEvent\": \"contract.created\",\n \"eventEnabled\": true,\n \"webhooks\": [\n {\n \"webhookId\": \"string\",\n \"webhookName\": \"string\",\n \"enabled\": true\n }\n ],\n \"status\": \"ok\",\n \"conflicts\": [\n {\n \"type\": \"event_disabled\",\n \"webhookId\": \"string\",\n \"message\": \"string\"\n }\n ],\n \"poll\": {\n \"queue_depth\": 0,\n \"oldest_unconsumed_age_seconds\": 0,\n \"last_poll_at\": \"1970-01-01T00:00:00.000Z\",\n \"last_ack_at\": \"1970-01-01T00:00:00.000Z\",\n \"blocked\": true,\n \"dlq_count\": 0\n }\n }\n ]\n}\n```\n\n
\n\n---\n\n### `pollOutboundMessages`\n\nPoll outbound messages for an integration's poll-mode use cases.\nTakes a lease on the head-of-line batch of the integration's FIFO stream:\nthe returned messages stay invisible to subsequent polls unti\n\n`POST /v1/integrations/{integrationId}/outbound/messages/poll`\n\n```ts\nconst { data } = await client.pollOutboundMessages(\n {\n integrationId: 'example',\n },\n {\n limit: 10\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"messages\": [\n {\n \"id\": \"string\",\n \"lease_token\": \"string\",\n \"use_case_id\": \"string\",\n \"event_name\": \"string\",\n \"event_id\": \"string\",\n \"group\": \"string\",\n \"payload\": {},\n \"enqueued_at\": \"1970-01-01T00:00:00.000Z\"\n }\n ],\n \"visibility_timeout_seconds\": 0,\n \"has_more\": true\n}\n```\n\n
\n\n---\n\n### `ackOutboundMessages`\n\nAcknowledge polled outbound messages. Acks are validated against the\nactive lease and committed as a prefix-contiguous cursor advance:\nmessages must be acknowledged in stream order. Out-of-order acks \n\n`POST /v1/integrations/{integrationId}/outbound/messages/ack`\n\n```ts\nconst { data } = await client.ackOutboundMessages(\n {\n integrationId: 'example',\n },\n {\n acks: [\n {\n id: 'string',\n lease_token: 'string'\n }\n ]\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"results\": [\n {\n \"id\": \"string\",\n \"status\": \"accepted\",\n \"reason\": \"stale_lease\"\n }\n ]\n}\n```\n\n
\n\n---\n\n### `listOutboundDlqMessages`\n\nList an integration's dead-lettered outbound queue messages\n(poison_policy enforcement and operator skips move messages here).\nOperator endpoint — requires the `integration:manage` grant. Message\npayl\n\n`GET /v1/integrations/{integrationId}/outbound/messages/dlq`\n\n```ts\nconst { data } = await client.listOutboundDlqMessages({\n integrationId: 'example',\n limit: 1,\n next_token: 'example',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"items\": [\n {\n \"id\": \"string\",\n \"use_case_id\": \"string\",\n \"event_name\": \"string\",\n \"event_id\": \"string\",\n \"enqueued_at\": \"1970-01-01T00:00:00.000Z\",\n \"dead_lettered_at\": \"1970-01-01T00:00:00.000Z\",\n \"delivery_attempts\": 0,\n \"reason\": \"string\",\n \"expires_at\": \"1970-01-01T00:00:00.000Z\"\n }\n ],\n \"next_token\": \"string\"\n}\n```\n\n
\n\n---\n\n### `redriveOutboundDlqMessages`\n\nRedrive selected dead-lettered messages back into the live stream.\nOperator endpoint — requires the `integration:manage` grant.\nA redriven message is re-enqueued at the tail with a new id and\nsequence\n\n`POST /v1/integrations/{integrationId}/outbound/messages/dlq/redrive`\n\n```ts\nconst { data } = await client.redriveOutboundDlqMessages(\n {\n integrationId: 'example',\n },\n {\n ids: ['string']\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"results\": [\n {\n \"id\": \"string\",\n \"status\": \"redriven\"\n }\n ]\n}\n```\n\n
\n\n---\n\n### `unblockOutboundStream`\n\nUnblock an integration's outbound stream halted by the `block`\npoison policy: skips (dead-letters) the current blocked head message,\nemitting MSG_DEAD_LETTERED and letting the next message become the\n\n\n`POST /v1/integrations/{integrationId}/outbound/messages/unblock`\n\n```ts\nconst { data } = await client.unblockOutboundStream(\n {\n integrationId: 'example',\n },\n {\n reason: 'string'\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"unblocked\": true,\n \"dead_lettered_id\": \"string\"\n}\n```\n\n
\n\n---\n\n### `queryAccessLogs`\n\nQuery API access logs for a specific integration's organization.\nReturns access token usage analytics filtered by user_id (access token).\nSupports infinite scroll pagination with cursor-based navigati\n\n`POST /v1/integrations/{integrationId}/monitoring/access-logs`\n\n```ts\nconst { data } = await client.queryAccessLogs(\n {\n integrationId: 'example',\n },\n {\n token_id: 'api_5ZugdRXasLfWBypHi93Fk',\n service: 'entity',\n method: 'GET',\n path: '/v1/entity',\n status: 200,\n from_date: '2025-01-01T00:00:00Z',\n to_date: '2025-01-31T23:59:59Z',\n limit: 50,\n cursor: {\n timestamp: '1970-01-01T00:00:00.000Z',\n request_id: 'string'\n }\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"data\": [\n {\n \"timestamp\": \"1970-01-01T00:00:00.000Z\",\n \"environment\": \"string\",\n \"service\": \"string\",\n \"request_id\": \"string\",\n \"method\": \"string\",\n \"path\": \"string\",\n \"status\": 0,\n \"response_latency_ms\": 0,\n \"response_length\": 0,\n \"token_id\": \"string\",\n \"org_id\": \"string\",\n \"origin\": \"string\",\n \"source_ip\": \"string\"\n }\n ],\n \"next_cursor\": {\n \"timestamp\": \"1970-01-01T00:00:00.000Z\",\n \"request_id\": \"string\"\n },\n \"has_more\": true\n}\n```\n\n
\n\n---\n\n### `queryOutboundMonitoringEvents`\n\nQuery outbound monitoring events for a specific integration.\nReturns detailed information about outbound event deliveries,\nfiltered by event_name (event_catalog_event) linked to the integration's outb\n\n`POST /v1/integrations/{integrationId}/monitoring/outbound-events`\n\n```ts\nconst { data } = await client.queryOutboundMonitoringEvents(\n {\n integrationId: 'example',\n },\n {\n event_name: 'automation_flow_target',\n status: 'succeeded',\n webhook_config_id: 'string',\n from_date: '2025-01-01T00:00:00Z',\n to_date: '2025-01-31T23:59:59Z',\n limit: 50,\n cursor: {\n created_at: '1970-01-01T00:00:00.000Z',\n event_id: 'string'\n }\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"data\": [\n {\n \"org_id\": \"string\",\n \"event_id\": \"string\",\n \"event_name\": \"string\",\n \"status\": \"succeeded\",\n \"url\": \"string\",\n \"http_method\": \"string\",\n \"http_response\": {},\n \"webhook_config_id\": \"string\",\n \"metadata\": {},\n \"execution_context\": {},\n \"payload\": {},\n \"created_at\": \"1970-01-01T00:00:00.000Z\",\n \"updated_at\": \"1970-01-01T00:00:00.000Z\"\n }\n ],\n \"next_cursor\": {\n \"created_at\": \"1970-01-01T00:00:00.000Z\",\n \"event_id\": \"string\"\n },\n \"has_more\": true\n}\n```\n\n
\n\n---\n\n### `queryMonitoringEventsV2`\n\nQuery monitoring events from the unified erp_monitoring_v2 table.\nReturns all event types (inbound, outbound, file_proxy, etc.) in a single list.\nReplaces the separate v1 inbound-events and outbound-e\n\n`POST /v2/integrations/{integrationId}/monitoring/events`\n\n```ts\nconst { data } = await client.queryMonitoringEventsV2(\n {\n integrationId: 'example',\n },\n {\n use_case_id: 'string',\n use_case_type: 'inbound',\n level: 'success',\n code: 'string',\n event_id: 'string',\n correlation_id: 'string',\n from_date: '2025-01-01T00:00:00Z',\n to_date: '2025-01-31T23:59:59Z',\n limit: 50,\n cursor: {\n created_at: '1970-01-01T00:00:00.000Z',\n id: '3fa85f64-5717-4562-b3fc-2c963f66afa6'\n }\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"data\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"org_id\": \"string\",\n \"integration_id\": \"string\",\n \"event_id\": \"string\",\n \"correlation_id\": \"string\",\n \"use_case_id\": \"string\",\n \"use_case_type\": \"inbound\",\n \"level\": \"success\",\n \"code\": \"string\",\n \"message\": \"string\",\n \"detail\": {},\n \"created_at\": \"1970-01-01T00:00:00.000Z\"\n }\n ],\n \"next_cursor\": {\n \"created_at\": \"1970-01-01T00:00:00.000Z\",\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\"\n },\n \"has_more\": true\n}\n```\n\n
\n\n---\n\n### `getMonitoringStatsV2`\n\nGet aggregated statistics from the unified erp_monitoring_v2 table.\nReturns combined metrics for all event types with optional breakdowns.\n\n`POST /v2/integrations/{integrationId}/monitoring/stats`\n\n```ts\nconst { data } = await client.getMonitoringStatsV2(\n {\n integrationId: 'example',\n },\n {\n from_date: '2025-01-01T00:00:00Z',\n to_date: '2025-01-31T23:59:59Z',\n use_case_type: 'inbound',\n use_case_types: ['inbound'],\n group_by: 'use_case_id',\n source: 'monitoring'\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"total_events\": 0,\n \"success_count\": 0,\n \"error_count\": 0,\n \"warning_count\": 0,\n \"skipped_count\": 0,\n \"ack_timeout_count\": 0,\n \"success_rate\": 0,\n \"last_error_at\": \"1970-01-01T00:00:00.000Z\",\n \"breakdown\": [\n {}\n ]\n}\n```\n\n
\n\n---\n\n### `getMonitoringTimeSeriesV2`\n\nGet time-series aggregated event counts from the unified erp_monitoring_v2 table.\nReturns bucketed counts for chart rendering.\n\n`POST /v2/integrations/{integrationId}/monitoring/time-series`\n\n```ts\nconst { data } = await client.getMonitoringTimeSeriesV2(\n {\n integrationId: 'example',\n },\n {\n from_date: '2025-01-01T00:00:00Z',\n to_date: '2025-01-31T23:59:59Z',\n interval: '5m',\n use_case_type: 'inbound',\n group_by: 'use_case_type'\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"interval\": \"5m\",\n \"from_date\": \"1970-01-01T00:00:00.000Z\",\n \"to_date\": \"1970-01-01T00:00:00.000Z\",\n \"buckets\": [\n {\n \"timestamp\": \"1970-01-01T00:00:00.000Z\",\n \"success_count\": 0,\n \"error_count\": 0,\n \"warning_count\": 0,\n \"skipped_count\": 0,\n \"total_count\": 0,\n \"breakdown\": [\n {\n \"use_case_type\": \"inbound\",\n \"use_case_id\": \"string\",\n \"success_count\": 0,\n \"error_count\": 0,\n \"warning_count\": 0,\n \"skipped_count\": 0,\n \"total_count\": 0\n }\n ]\n }\n ]\n}\n```\n\n
\n\n---\n\n### `getAssociatedMonitoringEvents`\n\nReturns all monitoring events sharing the same event_id, ordered chronologically.\nAlso includes the original inbound event payload from erp_incoming_events if available.\nUsed to display a full event t\n\n`GET /v2/integrations/{integrationId}/monitoring/events/{eventId}/associated`\n\n```ts\nconst { data } = await client.getAssociatedMonitoringEvents({\n integrationId: 'example',\n eventId: 'example',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"monitoring_events\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"org_id\": \"string\",\n \"integration_id\": \"string\",\n \"event_id\": \"string\",\n \"correlation_id\": \"string\",\n \"use_case_id\": \"string\",\n \"use_case_type\": \"inbound\",\n \"level\": \"success\",\n \"code\": \"string\",\n \"message\": \"string\",\n \"detail\": {},\n \"created_at\": \"1970-01-01T00:00:00.000Z\"\n }\n ],\n \"inbound_event\": {}\n}\n```\n\n
\n\n---\n\n### `ingestExternalMonitoringEvents`\n\nIngest monitoring spans produced by an EXTERNAL system (e.g. an integration\nmiddleware), so the Integration Hub is the central monitoring point and the\ncross-system event trace spans both the external\n\n`POST /v2/integrations/{integrationId}/monitoring/external-events`\n\n```ts\nconst { data } = await client.ingestExternalMonitoringEvents(\n {\n integrationId: 'example',\n },\n {\n events: [\n {\n correlation_id: 'string',\n level: 'string',\n use_case_slug: 'string',\n occurred_at: '1970-01-01T00:00:00.000Z',\n message: 'string',\n detail: {}\n }\n ]\n },\n)\n```\n\n---\n\n### `getMonitoringTraceByCorrelation`\n\nReturns the cross-system event trace for a `correlation_id`: every monitoring\nspan sharing it — external spans (middleware) plus epilot's own processing spans\n— ordered chronologically, with a rolled-\n\n`GET /v2/integrations/{integrationId}/monitoring/traces/{correlationId}`\n\n```ts\nconst { data } = await client.getMonitoringTraceByCorrelation({\n integrationId: 'example',\n correlationId: 'example',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"correlation_id\": \"string\",\n \"status\": \"success\",\n \"started_at\": \"1970-01-01T00:00:00.000Z\",\n \"ended_at\": \"1970-01-01T00:00:00.000Z\",\n \"span_count\": 0,\n \"truncated\": true,\n \"spans\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"org_id\": \"string\",\n \"integration_id\": \"string\",\n \"event_id\": \"string\",\n \"correlation_id\": \"string\",\n \"use_case_id\": \"string\",\n \"use_case_type\": \"inbound\",\n \"level\": \"success\",\n \"code\": \"string\",\n \"message\": \"string\",\n \"detail\": {},\n \"created_at\": \"1970-01-01T00:00:00.000Z\"\n }\n ],\n \"inbound_event\": {}\n}\n```\n\n
\n\n---\n\n### `listSecureProxies`\n\nList all secure proxy use cases\n\n`GET /v1/integrations/secure-proxies`\n\n```ts\nconst { data } = await client.listSecureProxies()\n```\n\n
\nResponse\n\n```json\n{\n \"secure_proxies\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"name\": \"string\",\n \"slug\": \"string\",\n \"enabled\": true,\n \"vpc_mode\": \"static_ip\",\n \"allowed_domains\": [\"string\"],\n \"allowed_ips\": [\"string\"],\n \"integration_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"integration_name\": \"string\"\n }\n ]\n}\n```\n\n
\n\n---\n\n### `secureProxy`\n\nProxy HTTP request through secure VPC\n\n`POST /v1/secure-proxy`\n\n```ts\nconst { data } = await client.secureProxy(\n null,\n {\n integration_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',\n use_case_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',\n use_case_slug: 'string',\n url: 'https://example.com/path',\n method: 'GET',\n headers: {},\n body: {},\n response_type: 'json'\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"status_code\": 0,\n \"headers\": {},\n \"body\": {}\n}\n```\n\n
\n\n---\n\n### `managedCallExecute`\n\nExecute a managed call operation\n\n`POST /v1/managed-call/{slug}/execute`\n\n```ts\nconst { data } = await client.managedCallExecute(\n {\n slug: 'example',\n },\n {\n integration_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',\n payload: {},\n correlation_id: 'string'\n },\n)\n```\n\n
\nResponse\n\n```json\n{}\n```\n\n
\n\n---\n\n### `generateTypesPreview`\n\nPreview scaffolded types for a connector integration\n\n`POST /v1/integrations/{integrationId}/generate-types-preview`\n\n```ts\nconst { data } = await client.generateTypesPreview({\n integrationId: 'example',\n})\n```\n\n---\n\n### `generateTypes`\n\nGenerate a TypeScript npm package for a connector integration\n\n`POST /v1/integrations/{integrationId}/generate-types`\n\n```ts\nconst { data } = await client.generateTypes(\n {\n integrationId: 'example',\n },\n {\n package_name: '@epilot/hems-cleverpv',\n version: '1.0.0',\n description: 'string',\n domain_package: '@epilot/hems',\n domain_map_name: 'HemsUseCaseMap',\n annotations: {}\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"package_name\": \"string\",\n \"version\": \"string\",\n \"files\": {},\n \"warnings\": [\"string\"]\n}\n```\n\n
\n\n---\n\n### `commitTypes`\n\nCommit generated types and lock use case configurations\n\n`POST /v1/integrations/{integrationId}/commit-types`\n\n```ts\nconst { data } = await client.commitTypes(\n {\n integrationId: 'example',\n },\n {\n package_name: '@epilot/hems-cleverpv',\n version: '1.0.0',\n annotations: {}\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"committed\": true,\n \"warnings\": [\"string\"]\n}\n```\n\n
\n\n---\n\n## Schemas\n\n### `NotificationHistoryItem`\n\nA single notification-history row (one real notification decision).\n\n```ts\ntype NotificationHistoryItem = {\n id: string\n type: string\n state_transition?: string\n severity: \"error\" | \"warning\" | \"info\"\n title: string\n occurred_at: string // date-time\n notified: boolean\n suppressed_reason?: \"muted\" | \"debounced\" | \"recipient_opt_out\"\n recipients: string[]\n context: Record\n created_at: string // date-time\n}\n```\n\n### `NotificationHistoryResponse`\n\n```ts\ntype NotificationHistoryResponse = {\n history: Array<{\n id: string\n type: string\n state_transition?: string\n severity: \"error\" | \"warning\" | \"info\"\n title: string\n occurred_at: string // date-time\n notified: boolean\n suppressed_reason?: \"muted\" | \"debounced\" | \"recipient_opt_out\"\n recipients: string[]\n context: Record\n created_at: string // date-time\n }>\n next_cursor?: string\n}\n```\n\n### `TestNotificationRequest`\n\n```ts\ntype TestNotificationRequest = {\n kind: \"alert\" | \"digest\"\n type?: string\n channels?: \"email\" | \"in_app\"[]\n}\n```\n\n### `TestNotificationResponse`\n\n```ts\ntype TestNotificationResponse = {\n sent: boolean\n recipient: string\n channels: string[]\n notification_id?: string\n}\n```\n\n### `NotificationStatusResponse`\n\n```ts\ntype NotificationStatusResponse = {\n health: \"healthy\" | \"alerting\" | \"muted\"\n evaluated_at?: string // date-time\n rules: Array<{\n rule_id: string\n state: \"ok\" | \"alerting\" | \"recovered\"\n last_fired_at?: string // date-time\n last_cleared_at?: string // date-time\n baseline?: {\n is_mature: { ... }\n computed_at?: { ... }\n median?: { ... }\n mad?: { ... }\n upper?: { ... }\n buckets?: { ... }\n }\n }>\n}\n```\n\n### `NotificationRuleStatus`\n\n```ts\ntype NotificationRuleStatus = {\n rule_id: string\n state: \"ok\" | \"alerting\" | \"recovered\"\n last_fired_at?: string // date-time\n last_cleared_at?: string // date-time\n baseline?: {\n is_mature: boolean\n computed_at?: string // date-time\n median?: number\n mad?: number\n upper?: number\n buckets?: Array<{\n dow: { ... }\n hour: { ... }\n median: { ... }\n mad: { ... }\n }>\n }\n}\n```\n\n### `RuleBaselineStatus`\n\n```ts\ntype RuleBaselineStatus = {\n is_mature: boolean\n computed_at?: string // date-time\n median?: number\n mad?: number\n upper?: number\n buckets?: Array<{\n dow: number\n hour: number\n median: number\n mad: number\n }>\n}\n```\n\n### `RuleBaselineBucket`\n\n```ts\ntype RuleBaselineBucket = {\n dow: number\n hour: number\n median: number\n mad: number\n}\n```\n\n### `ErrorResponseBase`\n\n```ts\ntype ErrorResponseBase = {\n code?: string\n message?: string\n}\n```\n\n### `ErpEvent`\n\n```ts\ntype ErpEvent = {\n event_type: \"CREATE\" | \"UPDATE\" | \"DELETE\"\n object_type: string\n timestamp: string // date-time\n format: \"json\" | \"xml\"\n payload: string | Record\n deduplication_id?: string\n correlation_id?: string\n use_case_id?: string\n}\n```\n\n### `ErpUpdatesEventsV2Request`\n\n```ts\ntype ErpUpdatesEventsV2Request = {\n integration_id: string // uuid\n correlation_id?: string\n events: Array<{\n event_type: \"CREATE\" | \"UPDATE\" | \"DELETE\"\n object_type: string\n timestamp: string // date-time\n format: \"json\" | \"xml\"\n payload: string | Record\n deduplication_id?: string\n correlation_id?: string\n use_case_id?: string\n }>\n}\n```\n\n### `ErpEventV3`\n\n```ts\ntype ErpEventV3 = unknown | unknown\n```\n\n### `ErpUpdatesEventsV3Request`\n\n```ts\ntype ErpUpdatesEventsV3Request = {\n integration_id: string // uuid\n correlation_id?: string\n group_id?: string\n events: unknown | unknown[]\n}\n```\n\n### `TriggerErpActionRequest`\n\n```ts\ntype TriggerErpActionRequest = {\n execution_id: string\n org_id: string\n webhook_id: string\n flow_id: string\n created_at: string // date-time\n action_id: string\n flow_action_id: string\n flow_name: string\n activity_id: string\n entity_id: string\n}\n```\n\n### `TriggerWebhookResp`\n\n```ts\ntype TriggerWebhookResp = {\n status_code?: string\n message?: string\n body?: object\n code?: string\n status?: \"succeeded\" | \"failed\"\n start_date?: string\n end_date?: string\n event_id?: string\n}\n```\n\n### `IntegrationEditableFields`\n\n```ts\ntype IntegrationEditableFields = {\n name?: string\n description?: string\n access_token_ids?: string[]\n app_ids?: string[]\n environment_config?: Array<{\n key: string\n label: string\n type: \"String\" | \"SecretString\"\n description?: string\n required?: boolean\n order?: number\n }>\n settings?: {\n autoRefresh?: {\n enabled?: { ... }\n freshnessThresholdMinutes?: { ... }\n }\n notifications?: {\n enabled: { ... }\n recipients: { ... }\n defaultChannels: { ... }\n monitoredUseCases?: { ... }\n monitoredCodes?: { ... }\n rules: { ... }\n digest: { ... }\n muteUntil?: { ... }\n }\n }\n integration_type?: \"erp\" | \"connector\"\n connector_config?: {\n base_url?: string\n auth?: {\n type?: { ... }\n token_url?: { ... }\n client_id?: { ... }\n client_secret?: { ... }\n scope?: { ... }\n audience?: { ... }\n resource?: { ... }\n body_params?: { ... }\n headers?: { ... }\n query_params?: { ... }\n api_key_header?: { ... }\n api_key?: { ... }\n token?: { ... }\n }\n types_versions?: Array<{\n version: { ... }\n package_name: { ... }\n generated_at: { ... }\n generated_by: { ... }\n status: { ... }\n }>\n latest_types_version?: string\n latest_types_package_name?: string\n }\n protected?: boolean\n _manifest?: string[]\n}\n```\n\n### `ConnectorConfig`\n\nShared configuration for connector-type integrations\n\n```ts\ntype ConnectorConfig = {\n base_url?: string\n auth?: {\n type?: \"oauth2_client_credentials\" | \"api_key\" | \"bearer\"\n token_url?: string\n client_id?: string\n client_secret?: string\n scope?: string\n audience?: string\n resource?: string\n body_params?: Record\n headers?: Record\n query_params?: Record\n api_key_header?: string\n api_key?: string\n token?: string\n }\n types_versions?: Array<{\n version: string\n package_name: string\n generated_at: string // date-time\n generated_by: string\n status: \"active\" | \"deprecated\"\n }>\n latest_types_version?: string\n latest_types_package_name?: string\n}\n```\n\n### `ManagedCallAuth`\n\nAuthentication configuration for managed call requests\n\n```ts\ntype ManagedCallAuth = {\n type?: \"oauth2_client_credentials\" | \"api_key\" | \"bearer\"\n token_url?: string\n client_id?: string\n client_secret?: string\n scope?: string\n audience?: string\n resource?: string\n body_params?: Record\n headers?: Record\n query_params?: Record\n api_key_header?: string\n api_key?: string\n token?: string\n}\n```\n\n### `Integration`\n\n```ts\ntype Integration = {\n id: string // uuid\n orgId: string\n created_at: string // date-time\n updated_at: string // date-time\n name: string\n description?: string\n access_token_ids?: string[]\n app_ids?: string[]\n environment_config?: Array<{\n key: string\n label: string\n type: \"String\" | \"SecretString\"\n description?: string\n required?: boolean\n order?: number\n }>\n settings?: {\n autoRefresh?: {\n enabled?: { ... }\n freshnessThresholdMinutes?: { ... }\n }\n notifications?: {\n enabled: { ... }\n recipients: { ... }\n defaultChannels: { ... }\n monitoredUseCases?: { ... }\n monitoredCodes?: { ... }\n rules: { ... }\n digest: { ... }\n muteUntil?: { ... }\n }\n }\n integration_type?: \"erp\" | \"connector\"\n connector_config?: {\n base_url?: string\n auth?: {\n type?: { ... }\n token_url?: { ... }\n client_id?: { ... }\n client_secret?: { ... }\n scope?: { ... }\n audience?: { ... }\n resource?: { ... }\n body_params?: { ... }\n headers?: { ... }\n query_params?: { ... }\n api_key_header?: { ... }\n api_key?: { ... }\n token?: { ... }\n }\n types_versions?: Array<{\n version: { ... }\n package_name: { ... }\n generated_at: { ... }\n generated_by: { ... }\n status: { ... }\n }>\n latest_types_version?: string\n latest_types_package_name?: string\n }\n protected?: boolean\n _manifest?: string[]\n}\n```\n\n### `CreateIntegrationRequest`\n\n```ts\ntype CreateIntegrationRequest = {\n name: string\n description?: string\n access_token_ids?: string[]\n app_ids?: string[]\n environment_config?: Array<{\n key: string\n label: string\n type: \"String\" | \"SecretString\"\n description?: string\n required?: boolean\n order?: number\n }>\n settings?: {\n autoRefresh?: {\n enabled?: { ... }\n freshnessThresholdMinutes?: { ... }\n }\n notifications?: {\n enabled: { ... }\n recipients: { ... }\n defaultChannels: { ... }\n monitoredUseCases?: { ... }\n monitoredCodes?: { ... }\n rules: { ... }\n digest: { ... }\n muteUntil?: { ... }\n }\n }\n integration_type?: \"erp\" | \"connector\"\n connector_config?: {\n base_url?: string\n auth?: {\n type?: { ... }\n token_url?: { ... }\n client_id?: { ... }\n client_secret?: { ... }\n scope?: { ... }\n audience?: { ... }\n resource?: { ... }\n body_params?: { ... }\n headers?: { ... }\n query_params?: { ... }\n api_key_header?: { ... }\n api_key?: { ... }\n token?: { ... }\n }\n types_versions?: Array<{\n version: { ... }\n package_name: { ... }\n generated_at: { ... }\n generated_by: { ... }\n status: { ... }\n }>\n latest_types_version?: string\n latest_types_package_name?: string\n }\n protected?: boolean\n _manifest?: string[]\n}\n```\n\n### `UpdateIntegrationRequest`\n\n```ts\ntype UpdateIntegrationRequest = {\n name?: string\n description?: string\n access_token_ids?: string[]\n app_ids?: string[]\n environment_config?: Array<{\n key: string\n label: string\n type: \"String\" | \"SecretString\"\n description?: string\n required?: boolean\n order?: number\n }>\n settings?: {\n autoRefresh?: {\n enabled?: { ... }\n freshnessThresholdMinutes?: { ... }\n }\n notifications?: {\n enabled: { ... }\n recipients: { ... }\n defaultChannels: { ... }\n monitoredUseCases?: { ... }\n monitoredCodes?: { ... }\n rules: { ... }\n digest: { ... }\n muteUntil?: { ... }\n }\n }\n integration_type?: \"erp\" | \"connector\"\n connector_config?: {\n base_url?: string\n auth?: {\n type?: { ... }\n token_url?: { ... }\n client_id?: { ... }\n client_secret?: { ... }\n scope?: { ... }\n audience?: { ... }\n resource?: { ... }\n body_params?: { ... }\n headers?: { ... }\n query_params?: { ... }\n api_key_header?: { ... }\n api_key?: { ... }\n token?: { ... }\n }\n types_versions?: Array<{\n version: { ... }\n package_name: { ... }\n generated_at: { ... }\n generated_by: { ... }\n status: { ... }\n }>\n latest_types_version?: string\n latest_types_package_name?: string\n }\n protected?: boolean\n _manifest?: string[]\n}\n```\n\n### `EnvironmentFieldConfig`\n\n```ts\ntype EnvironmentFieldConfig = {\n key: string\n label: string\n type: \"String\" | \"SecretString\"\n description?: string\n required?: boolean\n order?: number\n}\n```\n\n### `IntegrationSettings`\n\nSettings for the integration\n\n```ts\ntype IntegrationSettings = {\n autoRefresh?: {\n enabled?: boolean\n freshnessThresholdMinutes?: number\n }\n notifications?: {\n enabled: boolean\n recipients: Array<{\n user_id: { ... }\n }>\n defaultChannels: {\n email: { ... }\n in_app: { ... }\n }\n monitoredUseCases?: string[]\n monitoredCodes?: string[]\n rules: Array<{\n id?: { ... }\n name?: { ... }\n type: { ... }\n enabled: { ... }\n channels?: { ... }\n codes?: { ... }\n threshold?: { ... }\n sensitivity?: { ... }\n fallbackThreshold?: { ... }\n window?: { ... }\n minSampleSize?: { ... }\n quietPeriod?: { ... }\n }>\n digest: {\n enabled: { ... }\n frequency: { ... }\n dayOfWeek?: { ... }\n timeOfDay: { ... }\n timezone: { ... }\n channels: { ... }\n includeHealthy: { ... }\n skipIfEmpty: { ... }\n }\n muteUntil?: string // date-time\n }\n}\n```\n\n### `AutoRefreshSettings`\n\nAuto-refresh settings for keeping integration data fresh\n\n```ts\ntype AutoRefreshSettings = {\n enabled?: boolean\n freshnessThresholdMinutes?: number\n}\n```\n\n### `IntegrationNotificationConfig`\n\nIntegration monitoring notification configuration. Rides Integration.settings.notifications (camelCase) and surfaces on both v1 and v2 GET/PUT. Unknown keys are stripped server-side to stay forward-compatible with deferred (V2) rule types.\n\n```ts\ntype IntegrationNotificationConfig = {\n enabled: boolean\n recipients: Array<{\n user_id: string\n }>\n defaultChannels: {\n email: boolean\n in_app: boolean\n }\n monitoredUseCases?: string[]\n monitoredCodes?: string[]\n rules: Array<{\n id?: string\n name?: string\n type: \"critical_error\" | \"error_threshold\" | \"warning_threshold\" | \"success_rate_drop\" | \"recovery\" | \"silence\"\n enabled: boolean\n channels?: {\n email: { ... }\n in_app: { ... }\n }\n codes?: string[]\n threshold?: number | \"auto\"\n sensitivity?: \"low\" | \"medium\" | \"high\"\n fallbackThreshold?: number\n window?: string\n minSampleSize?: number\n quietPeriod?: string\n }>\n digest: {\n enabled: boolean\n frequency: \"daily\" | \"weekly\"\n dayOfWeek?: 0 | 1 | 2 | 3 | 4 | 5 | 6\n timeOfDay: string\n timezone: string\n channels: {\n email: { ... }\n in_app: { ... }\n }\n includeHealthy: boolean\n skipIfEmpty: boolean\n }\n muteUntil?: string // date-time\n}\n```\n\n### `NotificationRecipient`\n\nA configured recipient. Only the epilot user_id is stored.\n\n```ts\ntype NotificationRecipient = {\n user_id: string\n}\n```\n\n### `NotificationChannelSet`\n\nDelivery channel toggles. New channels added in svc-notification-api inherit here.\n\n```ts\ntype NotificationChannelSet = {\n email: boolean\n in_app: boolean\n}\n```\n\n### `NotificationRule`\n\nA single notification rule. Only the params relevant to a given type are set. The id is optional on write: the server mints a ULID when omitted and preserves a supplied id verbatim (a stable id keeps a rule's AlertState across config saves).\n\n```ts\ntype NotificationRule = {\n id?: string\n name?: string\n type: \"critical_error\" | \"error_threshold\" | \"warning_threshold\" | \"success_rate_drop\" | \"recovery\" | \"silence\"\n enabled: boolean\n channels?: {\n email: boolean\n in_app: boolean\n }\n codes?: string[]\n threshold?: number | \"auto\"\n sensitivity?: \"low\" | \"medium\" | \"high\"\n fallbackThreshold?: number\n window?: string\n minSampleSize?: number\n quietPeriod?: string\n}\n```\n\n### `NotificationDigestConfig`\n\nDigest schedule and content configuration.\n\n```ts\ntype NotificationDigestConfig = {\n enabled: boolean\n frequency: \"daily\" | \"weekly\"\n dayOfWeek?: 0 | 1 | 2 | 3 | 4 | 5 | 6\n timeOfDay: string\n timezone: string\n channels: {\n email: boolean\n in_app: boolean\n }\n includeHealthy: boolean\n skipIfEmpty: boolean\n}\n```\n\n### `SetIntegrationAppMappingRequest`\n\n```ts\ntype SetIntegrationAppMappingRequest = {\n app_id: string // uuid\n component_id: string // uuid\n overwrite?: boolean\n}\n```\n\n### `DeleteIntegrationAppMappingRequest`\n\n```ts\ntype DeleteIntegrationAppMappingRequest = {\n app_id: string // uuid\n component_id: string // uuid\n}\n```\n\n### `IntegrationAppMapping`\n\n```ts\ntype IntegrationAppMapping = {\n integration_id: string // uuid\n}\n```\n\n### `IntegrationWithUseCases`\n\n```ts\ntype IntegrationWithUseCases = {\n use_cases: Array<{\n id: string // uuid\n integrationId: string // uuid\n name: string\n slug?: string\n type: \"inbound\"\n enabled: boolean\n change_description?: string\n created_at: string // date-time\n updated_at: string // date-time\n configuration?: {\n entities?: { ... }\n meter_readings?: { ... }\n }\n } | {\n id: string // uuid\n integrationId: string // uuid\n name: string\n slug?: string\n type: \"outbound\"\n enabled: boolean\n change_description?: string\n created_at: string // date-time\n updated_at: string // date-time\n configuration?: {\n event_catalog_event: { ... }\n mappings: { ... }\n }\n } | {\n id: string // uuid\n integrationId: string // uuid\n name: string\n slug?: string\n type: \"file_proxy\"\n enabled: boolean\n change_description?: string\n created_at: string // date-time\n updated_at: string // date-time\n configuration?: {\n secure_proxy?: { ... }\n auth?: { ... }\n params?: { ... }\n allowed_origins?: { ... }\n steps: { ... }\n response: { ... }\n prevent_indirect_serving?: { ... }\n }\n } | {\n id: string // uuid\n integrationId: string // uuid\n name: string\n slug?: string\n type: \"managed_call\"\n enabled: boolean\n change_description?: string\n created_at: string // date-time\n updated_at: string // date-time\n configuration?: {\n operation: { ... }\n request_mapping?: { ... }\n response_mapping?: { ... }\n inbound_use_case_slug?: { ... }\n }\n type_annotations?: {\n request?: { ... }\n response?: { ... }\n }\n types_locked?: boolean\n } | {\n id: string // uuid\n integrationId: string // uuid\n name: string\n slug?: string\n type: \"secure_proxy\"\n enabled: boolean\n change_description?: string\n created_at: string // date-time\n updated_at: string // date-time\n configuration?: {\n vpc_mode: { ... }\n allowed_domains?: { ... }\n allowed_ips?: { ... }\n }\n }>\n}\n```\n\n### `UpsertIntegrationWithUseCasesRequest`\n\n```ts\ntype UpsertIntegrationWithUseCasesRequest = {\n name: string\n description?: string\n access_token_ids?: string[]\n app_ids?: string[]\n environment_config?: Array<{\n key: string\n label: string\n type: \"String\" | \"SecretString\"\n description?: string\n required?: boolean\n order?: number\n }>\n settings?: {\n autoRefresh?: {\n enabled?: { ... }\n freshnessThresholdMinutes?: { ... }\n }\n notifications?: {\n enabled: { ... }\n recipients: { ... }\n defaultChannels: { ... }\n monitoredUseCases?: { ... }\n monitoredCodes?: { ... }\n rules: { ... }\n digest: { ... }\n muteUntil?: { ... }\n }\n }\n integration_type?: \"erp\" | \"connector\"\n connector_config?: {\n base_url?: string\n auth?: {\n type?: { ... }\n token_url?: { ... }\n client_id?: { ... }\n client_secret?: { ... }\n scope?: { ... }\n audience?: { ... }\n resource?: { ... }\n body_params?: { ... }\n headers?: { ... }\n query_params?: { ... }\n api_key_header?: { ... }\n api_key?: { ... }\n token?: { ... }\n }\n types_versions?: Array<{\n version: { ... }\n package_name: { ... }\n generated_at: { ... }\n generated_by: { ... }\n status: { ... }\n }>\n latest_types_version?: string\n latest_types_package_name?: string\n }\n protected?: boolean\n _manifest?: string[]\n use_cases?: Array<{\n id?: string // uuid\n name: string\n slug?: string\n enabled: boolean\n change_description?: string\n type: \"inbound\"\n configuration?: {\n entities?: { ... }\n meter_readings?: { ... }\n }\n } | {\n id?: string // uuid\n name: string\n slug?: string\n enabled: boolean\n change_description?: string\n type: \"outbound\"\n configuration?: {\n event_catalog_event: { ... }\n mappings: { ... }\n }\n } | {\n id?: string // uuid\n name: string\n slug?: string\n enabled: boolean\n change_description?: string\n type: \"file_proxy\"\n configuration?: {\n secure_proxy?: { ... }\n auth?: { ... }\n params?: { ... }\n allowed_origins?: { ... }\n steps: { ... }\n response: { ... }\n prevent_indirect_serving?: { ... }\n }\n } | {\n id?: string // uuid\n name: string\n // ...\n}\n```\n\n### `InboundIntegrationEventConfiguration`\n\nConfiguration for inbound use cases (ERP to epilot)\n\n```ts\ntype InboundIntegrationEventConfiguration = {\n entities?: Array<{\n entity_schema: string\n unique_ids: string[]\n jsonataExpression?: string\n enabled?: boolean | string\n mode?: \"upsert\" | \"delete\" | \"purge\" | \"upsert-prune-scope-purge\" | \"upsert-prune-scope-delete\"\n scope?: {\n scope_mode: { ... }\n schema?: { ... }\n unique_ids?: { ... }\n query?: { ... }\n }\n fields: Array<{\n attribute: { ... }\n field?: { ... }\n jsonataExpression?: { ... }\n constant?: { ... }\n _type?: { ... }\n enabled?: { ... }\n relations?: { ... }\n relation_refs?: { ... }\n file_proxy_url?: { ... }\n portal_ref?: { ... }\n env_var_ref?: { ... }\n }>\n }>\n meter_readings?: Array<{\n jsonataExpression?: string\n reading_matching?: \"external_id\" | \"strict-date\"\n mode?: \"upsert\" | \"delete\" | \"upsert-prune-scope\"\n scope?: {\n source?: { ... }\n }\n meter: {\n unique_ids: { ... }\n }\n meter_counter?: {\n unique_ids: { ... }\n }\n fields: Array<{\n attribute: { ... }\n field?: { ... }\n jsonataExpression?: { ... }\n constant?: { ... }\n _type?: { ... }\n enabled?: { ... }\n relations?: { ... }\n relation_refs?: { ... }\n file_proxy_url?: { ... }\n portal_ref?: { ... }\n env_var_ref?: { ... }\n }>\n }>\n}\n```\n\n### `OutboundIntegrationEventConfiguration`\n\nConfiguration for outbound use cases. Defines the event that triggers the flow and the webhook mappings.\n\n```ts\ntype OutboundIntegrationEventConfiguration = {\n event_catalog_event: string\n mappings: Array<{\n id?: string // uuid\n name: string\n jsonata_expression?: string\n enabled: boolean\n delivery: {\n type: { ... }\n webhook_id: { ... }\n webhook_name?: { ... }\n webhook_url?: { ... }\n } | {\n type: { ... }\n retention_days?: { ... }\n poison_policy?: { ... }\n max_delivery_attempts?: { ... }\n }\n created_at?: string // date-time\n updated_at?: string // date-time\n }>\n}\n```\n\n### `IntegrationEntity`\n\n```ts\ntype IntegrationEntity = {\n entity_schema: string\n unique_ids: string[]\n jsonataExpression?: string\n enabled?: boolean | string\n mode?: \"upsert\" | \"delete\" | \"purge\" | \"upsert-prune-scope-purge\" | \"upsert-prune-scope-delete\"\n scope?: {\n scope_mode: \"relations\" | \"query\"\n schema?: string\n unique_ids?: Array<{\n attribute: { ... }\n _type?: { ... }\n field?: { ... }\n jsonataExpression?: { ... }\n constant?: { ... }\n }>\n query?: Array<{\n attribute: { ... }\n _type?: { ... }\n field?: { ... }\n jsonataExpression?: { ... }\n constant?: { ... }\n }>\n }\n fields: Array<{\n attribute: string\n field?: string\n jsonataExpression?: string\n constant?: unknown\n _type?: \"email\" | \"phone\"\n enabled?: boolean | string\n relations?: {\n operation: { ... }\n items?: { ... }\n jsonataExpression?: { ... }\n }\n relation_refs?: {\n operation: { ... }\n items?: { ... }\n jsonataExpression?: { ... }\n }\n file_proxy_url?: {\n use_case_slug: { ... }\n params?: { ... }\n } | {\n use_case_id: { ... }\n params?: { ... }\n }\n portal_ref?: {\n filter?: { ... }\n select?: { ... }\n return?: { ... }\n } | {\n filter?: { ... }\n select?: { ... }\n return: { ... }\n jsonataExpression: { ... }\n }\n env_var_ref?: {\n key: { ... }\n default?: { ... }\n return?: { ... }\n } | {\n key: { ... }\n default?: { ... }\n return: { ... }\n jsonataExpression: { ... }\n }\n }>\n}\n```\n\n### `IntegrationMeterReading`\n\n```ts\ntype IntegrationMeterReading = {\n jsonataExpression?: string\n reading_matching?: \"external_id\" | \"strict-date\"\n mode?: \"upsert\" | \"delete\" | \"upsert-prune-scope\"\n scope?: {\n source?: string\n }\n meter: {\n unique_ids: Array<{\n attribute: { ... }\n _type?: { ... }\n field?: { ... }\n jsonataExpression?: { ... }\n constant?: { ... }\n }>\n }\n meter_counter?: {\n unique_ids: Array<{\n attribute: { ... }\n _type?: { ... }\n field?: { ... }\n jsonataExpression?: { ... }\n constant?: { ... }\n }>\n }\n fields: Array<{\n attribute: string\n field?: string\n jsonataExpression?: string\n constant?: unknown\n _type?: \"email\" | \"phone\"\n enabled?: boolean | string\n relations?: {\n operation: { ... }\n items?: { ... }\n jsonataExpression?: { ... }\n }\n relation_refs?: {\n operation: { ... }\n items?: { ... }\n jsonataExpression?: { ... }\n }\n file_proxy_url?: {\n use_case_slug: { ... }\n params?: { ... }\n } | {\n use_case_id: { ... }\n params?: { ... }\n }\n portal_ref?: {\n filter?: { ... }\n select?: { ... }\n return?: { ... }\n } | {\n filter?: { ... }\n select?: { ... }\n return: { ... }\n jsonataExpression: { ... }\n }\n env_var_ref?: {\n key: { ... }\n default?: { ... }\n return?: { ... }\n } | {\n key: { ... }\n default?: { ... }\n return: { ... }\n jsonataExpression: { ... }\n }\n }>\n}\n```\n\n### `PruneScopeConfig`\n\nScope configuration for upsert-prune-scope modes.\nDefines how to find entities that should be pruned if not in the upsert payload.\nThe scope is resolved against the original event payload (not individual array items).\n\n\n```ts\ntype PruneScopeConfig = {\n scope_mode: \"relations\" | \"query\"\n schema?: string\n unique_ids?: Array<{\n attribute: string\n _type?: \"email\" | \"phone\"\n field?: string\n jsonataExpression?: string\n constant?: unknown\n }>\n query?: Array<{\n attribute: string\n _type?: \"email\" | \"phone\"\n field?: string\n jsonataExpression?: string\n constant?: unknown\n }>\n}\n```\n\n### `MeterReadingPruneScopeConfig`\n\nScope configuration for meter reading upsert-prune-scope mode.\nThe scope is all readings for the same meter + counter.\n\n\n```ts\ntype MeterReadingPruneScopeConfig = {\n source?: string\n}\n```\n\n### `MeterUniqueIdsConfig`\n\n```ts\ntype MeterUniqueIdsConfig = {\n unique_ids: Array<{\n attribute: string\n _type?: \"email\" | \"phone\"\n field?: string\n jsonataExpression?: string\n constant?: unknown\n }>\n}\n```\n\n### `IntegrationEntityField`\n\n```ts\ntype IntegrationEntityField = {\n attribute: string\n field?: string\n jsonataExpression?: string\n constant?: unknown\n _type?: \"email\" | \"phone\"\n enabled?: boolean | string\n relations?: {\n operation: \"_set\" | \"_append\" | \"_append_all\"\n items?: Array<{\n entity_schema: { ... }\n _tags?: { ... }\n unique_ids: { ... }\n }>\n jsonataExpression?: string\n }\n relation_refs?: {\n operation: \"_set\" | \"_append\" | \"_append_all\"\n items?: Array<{\n entity_schema: { ... }\n unique_ids: { ... }\n path: { ... }\n value: { ... }\n }>\n jsonataExpression?: string\n }\n file_proxy_url?: {\n use_case_slug: string\n params?: Record\n } | {\n use_case_id: string\n params?: Record\n }\n portal_ref?: {\n filter?: {\n origin?: { ... }\n enabled?: { ... }\n is_dummy?: { ... }\n is_epilot_domain?: { ... }\n name?: { ... }\n domain?: { ... }\n }\n select?: \"single\" | \"all\"\n return?: \"portal_id\" | \"origin\" | \"domain\" | \"name\"\n } | {\n filter?: {\n origin?: { ... }\n enabled?: { ... }\n is_dummy?: { ... }\n is_epilot_domain?: { ... }\n name?: { ... }\n domain?: { ... }\n }\n select?: \"single\" | \"all\"\n return: \"jsonata\"\n jsonataExpression: string\n }\n env_var_ref?: {\n key: string\n default?: string\n return?: \"value\"\n } | {\n key: string\n default?: string\n return: \"jsonata\"\n jsonataExpression: string\n }\n}\n```\n\n### `FileProxyUrlParam`\n\nParameter for file proxy URL. Exactly one of field, constant, or jsonataExpression must be set.\n\n```ts\ntype FileProxyUrlParam = {\n field: string\n} | {\n constant: unknown\n} | {\n jsonataExpression: string\n}\n```\n\n### `FileProxyUrlParams`\n\nCustom query parameters. Keys become URL param names, values resolved from payload.\n\n```ts\ntype FileProxyUrlParams = Record\n```\n\n### `FileProxyUrlConfig`\n\nAuto-constructs a file proxy download URL. orgId and integrationId are injected from context. Exactly one of use_case_id or use_case_slug must be provided. Using use_case_slug is recommended as it is portable across environments.\n\n\n```ts\ntype FileProxyUrlConfig = {\n use_case_slug: string\n params?: Record\n} | {\n use_case_id: string\n params?: Record\n}\n```\n\n### `PortalOrigin`\n\nOrigin/type of an epilot portal configuration.\n\n```ts\ntype PortalOrigin = \"END_CUSTOMER_PORTAL\" | \"INSTALLER_PORTAL\" | \"B2B_PORTAL\" | \"ADDITIONAL_PORTAL\"\n```\n\n### `PortalRefFilter`\n\nFilter applied to the org's portal configurations before selection. All filters default to \"match any\" except `enabled` (default `true`) and `is_dummy` (default `false`). Set `enabled` or `is_dummy` to `null` to opt out of the default.\n\n\n```ts\ntype PortalRefFilter = {\n origin?: \"END_CUSTOMER_PORTAL\" | \"INSTALLER_PORTAL\" | \"B2B_PORTAL\" | \"ADDITIONAL_PORTAL\" | \"END_CUSTOMER_PORTAL\" | \"INSTALLER_PORTAL\" | \"B2B_PORTAL\" | \"ADDITIONAL_PORTAL\"[]\n enabled?: boolean\n is_dummy?: boolean\n is_epilot_domain?: boolean\n name?: string\n domain?: string\n}\n```\n\n### `PortalRefConfig`\n\nResolves to a property of one of the calling organization's epilot portal configurations at runtime, replacing hard-coded environment-specific portal UUIDs in inbound mappings. Matched portals are sorted ascending by `(_created_at, portal_id)`; portals without `_created_at` sort first (treated as ol\n\n```ts\ntype PortalRefConfig = {\n filter?: {\n origin?: \"END_CUSTOMER_PORTAL\" | \"INSTALLER_PORTAL\" | \"B2B_PORTAL\" | \"ADDITIONAL_PORTAL\" | \"END_CUSTOMER_PORTAL\" | \"INSTALLER_PORTAL\" | \"B2B_PORTAL\" | \"ADDITIONAL_PORTAL\"[]\n enabled?: boolean\n is_dummy?: boolean\n is_epilot_domain?: boolean\n name?: string\n domain?: string\n }\n select?: \"single\" | \"all\"\n return?: \"portal_id\" | \"origin\" | \"domain\" | \"name\"\n} | {\n filter?: {\n origin?: \"END_CUSTOMER_PORTAL\" | \"INSTALLER_PORTAL\" | \"B2B_PORTAL\" | \"ADDITIONAL_PORTAL\" | \"END_CUSTOMER_PORTAL\" | \"INSTALLER_PORTAL\" | \"B2B_PORTAL\" | \"ADDITIONAL_PORTAL\"[]\n enabled?: boolean\n is_dummy?: boolean\n is_epilot_domain?: boolean\n name?: string\n domain?: string\n }\n select?: \"single\" | \"all\"\n return: \"jsonata\"\n jsonataExpression: string\n}\n```\n\n### `EnvVarRefConfig`\n\nResolves to an org-scoped environment variable from the epilot environments-api service at runtime, replacing hard-coded environment-specific values (URLs, prefixes, identifiers) in inbound mappings. Secrets (`SecretString` values) are never exposed; the runtime treats both \"missing key\" and \"secret\n\n```ts\ntype EnvVarRefConfig = {\n key: string\n default?: string\n return?: \"value\"\n} | {\n key: string\n default?: string\n return: \"jsonata\"\n jsonataExpression: string\n}\n```\n\n### `EmbeddedUseCaseRequest`\n\n```ts\ntype EmbeddedUseCaseRequest = {\n id?: string // uuid\n name: string\n slug?: string\n enabled: boolean\n change_description?: string\n type: \"inbound\"\n configuration?: {\n entities?: Array<{\n entity_schema: { ... }\n unique_ids: { ... }\n jsonataExpression?: { ... }\n enabled?: { ... }\n mode?: { ... }\n scope?: { ... }\n fields: { ... }\n }>\n meter_readings?: Array<{\n jsonataExpression?: { ... }\n reading_matching?: { ... }\n mode?: { ... }\n scope?: { ... }\n meter: { ... }\n meter_counter?: { ... }\n fields: { ... }\n }>\n }\n} | {\n id?: string // uuid\n name: string\n slug?: string\n enabled: boolean\n change_description?: string\n type: \"outbound\"\n configuration?: {\n event_catalog_event: string\n mappings: Array<{\n id?: { ... }\n name: { ... }\n jsonata_expression?: { ... }\n enabled: { ... }\n delivery: { ... }\n created_at?: { ... }\n updated_at?: { ... }\n }>\n }\n} | {\n id?: string // uuid\n name: string\n slug?: string\n enabled: boolean\n change_description?: string\n type: \"file_proxy\"\n configuration?: {\n secure_proxy?: {\n use_case_slug: { ... }\n }\n auth?: {\n type: { ... }\n token_url: { ... }\n client_id: { ... }\n client_secret: { ... }\n scope?: { ... }\n audience?: { ... }\n resource?: { ... }\n username?: { ... }\n password?: { ... }\n body_params?: { ... }\n headers?: { ... }\n query_params?: { ... }\n }\n params?: Array<{\n name: { ... }\n required: { ... }\n description?: { ... }\n }>\n allowed_origins?: string // uri[]\n steps: Array<{\n url: { ... }\n method: { ... }\n headers?: { ... }\n body?: { ... }\n response_type: { ... }\n }>\n response: {\n body: { ... }\n encoding: { ... }\n filename?: { ... }\n content_type?: { ... }\n }\n prevent_indirect_serving?: boolean\n }\n} | {\n id?: string // uuid\n name: string\n slug?: string\n enabled: boolean\n change_description?: string\n type: \"managed_call\"\n configuration?: {\n // ...\n}\n```\n\n### `EmbeddedUseCaseRequestBase`\n\n```ts\ntype EmbeddedUseCaseRequestBase = {\n id?: string // uuid\n name: string\n slug?: string\n enabled: boolean\n change_description?: string\n}\n```\n\n### `EmbeddedInboundUseCaseRequest`\n\n```ts\ntype EmbeddedInboundUseCaseRequest = {\n id?: string // uuid\n name: string\n slug?: string\n enabled: boolean\n change_description?: string\n type: \"inbound\"\n configuration?: {\n entities?: Array<{\n entity_schema: { ... }\n unique_ids: { ... }\n jsonataExpression?: { ... }\n enabled?: { ... }\n mode?: { ... }\n scope?: { ... }\n fields: { ... }\n }>\n meter_readings?: Array<{\n jsonataExpression?: { ... }\n reading_matching?: { ... }\n mode?: { ... }\n scope?: { ... }\n meter: { ... }\n meter_counter?: { ... }\n fields: { ... }\n }>\n }\n}\n```\n\n### `EmbeddedOutboundUseCaseRequest`\n\n```ts\ntype EmbeddedOutboundUseCaseRequest = {\n id?: string // uuid\n name: string\n slug?: string\n enabled: boolean\n change_description?: string\n type: \"outbound\"\n configuration?: {\n event_catalog_event: string\n mappings: Array<{\n id?: { ... }\n name: { ... }\n jsonata_expression?: { ... }\n enabled: { ... }\n delivery: { ... }\n created_at?: { ... }\n updated_at?: { ... }\n }>\n }\n}\n```\n\n### `EmbeddedFileProxyUseCaseRequest`\n\n```ts\ntype EmbeddedFileProxyUseCaseRequest = {\n id?: string // uuid\n name: string\n slug?: string\n enabled: boolean\n change_description?: string\n type: \"file_proxy\"\n configuration?: {\n secure_proxy?: {\n use_case_slug: { ... }\n }\n auth?: {\n type: { ... }\n token_url: { ... }\n client_id: { ... }\n client_secret: { ... }\n scope?: { ... }\n audience?: { ... }\n resource?: { ... }\n username?: { ... }\n password?: { ... }\n body_params?: { ... }\n headers?: { ... }\n query_params?: { ... }\n }\n params?: Array<{\n name: { ... }\n required: { ... }\n description?: { ... }\n }>\n allowed_origins?: string // uri[]\n steps: Array<{\n url: { ... }\n method: { ... }\n headers?: { ... }\n body?: { ... }\n response_type: { ... }\n }>\n response: {\n body: { ... }\n encoding: { ... }\n filename?: { ... }\n content_type?: { ... }\n }\n prevent_indirect_serving?: boolean\n }\n}\n```\n\n### `EmbeddedManagedCallUseCaseRequest`\n\n```ts\ntype EmbeddedManagedCallUseCaseRequest = {\n id?: string // uuid\n name: string\n slug?: string\n enabled: boolean\n change_description?: string\n type: \"managed_call\"\n configuration?: {\n operation: {\n method: { ... }\n path: { ... }\n headers?: { ... }\n query_params?: { ... }\n }\n request_mapping?: string\n response_mapping?: string\n inbound_use_case_slug?: string\n }\n}\n```\n\n### `EmbeddedSecureProxyUseCaseRequest`\n\n```ts\ntype EmbeddedSecureProxyUseCaseRequest = {\n id?: string // uuid\n name: string\n slug?: string\n enabled: boolean\n change_description?: string\n type: \"secure_proxy\"\n configuration?: {\n vpc_mode: \"static_ip\" | \"secure_link\"\n allowed_domains?: string[]\n allowed_ips?: string[]\n }\n}\n```\n\n### `UseCaseBase`\n\n```ts\ntype UseCaseBase = {\n id: string // uuid\n integrationId: string // uuid\n name: string\n slug?: string\n type: \"inbound\" | \"outbound\" | \"file_proxy\" | \"managed_call\" | \"secure_proxy\"\n enabled: boolean\n change_description?: string\n created_at: string // date-time\n updated_at: string // date-time\n}\n```\n\n### `InboundUseCase`\n\n```ts\ntype InboundUseCase = {\n id: string // uuid\n integrationId: string // uuid\n name: string\n slug?: string\n type: \"inbound\"\n enabled: boolean\n change_description?: string\n created_at: string // date-time\n updated_at: string // date-time\n configuration?: {\n entities?: Array<{\n entity_schema: { ... }\n unique_ids: { ... }\n jsonataExpression?: { ... }\n enabled?: { ... }\n mode?: { ... }\n scope?: { ... }\n fields: { ... }\n }>\n meter_readings?: Array<{\n jsonataExpression?: { ... }\n reading_matching?: { ... }\n mode?: { ... }\n scope?: { ... }\n meter: { ... }\n meter_counter?: { ... }\n fields: { ... }\n }>\n }\n}\n```\n\n### `OutboundUseCase`\n\n```ts\ntype OutboundUseCase = {\n id: string // uuid\n integrationId: string // uuid\n name: string\n slug?: string\n type: \"outbound\"\n enabled: boolean\n change_description?: string\n created_at: string // date-time\n updated_at: string // date-time\n configuration?: {\n event_catalog_event: string\n mappings: Array<{\n id?: { ... }\n name: { ... }\n jsonata_expression?: { ... }\n enabled: { ... }\n delivery: { ... }\n created_at?: { ... }\n updated_at?: { ... }\n }>\n }\n}\n```\n\n### `FileProxyUseCase`\n\n```ts\ntype FileProxyUseCase = {\n id: string // uuid\n integrationId: string // uuid\n name: string\n slug?: string\n type: \"file_proxy\"\n enabled: boolean\n change_description?: string\n created_at: string // date-time\n updated_at: string // date-time\n configuration?: {\n secure_proxy?: {\n use_case_slug: { ... }\n }\n auth?: {\n type: { ... }\n token_url: { ... }\n client_id: { ... }\n client_secret: { ... }\n scope?: { ... }\n audience?: { ... }\n resource?: { ... }\n username?: { ... }\n password?: { ... }\n body_params?: { ... }\n headers?: { ... }\n query_params?: { ... }\n }\n params?: Array<{\n name: { ... }\n required: { ... }\n description?: { ... }\n }>\n allowed_origins?: string // uri[]\n steps: Array<{\n url: { ... }\n method: { ... }\n headers?: { ... }\n body?: { ... }\n response_type: { ... }\n }>\n response: {\n body: { ... }\n encoding: { ... }\n filename?: { ... }\n content_type?: { ... }\n }\n prevent_indirect_serving?: boolean\n }\n}\n```\n\n### `ManagedCallUseCase`\n\n```ts\ntype ManagedCallUseCase = {\n id: string // uuid\n integrationId: string // uuid\n name: string\n slug?: string\n type: \"managed_call\"\n enabled: boolean\n change_description?: string\n created_at: string // date-time\n updated_at: string // date-time\n configuration?: {\n operation: {\n method: { ... }\n path: { ... }\n headers?: { ... }\n query_params?: { ... }\n }\n request_mapping?: string\n response_mapping?: string\n inbound_use_case_slug?: string\n }\n type_annotations?: {\n request?: Record\n response?: Record\n }\n types_locked?: boolean\n}\n```\n\n### `SecureProxyUseCase`\n\n```ts\ntype SecureProxyUseCase = {\n id: string // uuid\n integrationId: string // uuid\n name: string\n slug?: string\n type: \"secure_proxy\"\n enabled: boolean\n change_description?: string\n created_at: string // date-time\n updated_at: string // date-time\n configuration?: {\n vpc_mode: \"static_ip\" | \"secure_link\"\n allowed_domains?: string[]\n allowed_ips?: string[]\n }\n}\n```\n\n### `UseCase`\n\n```ts\ntype UseCase = {\n id: string // uuid\n integrationId: string // uuid\n name: string\n slug?: string\n type: \"inbound\"\n enabled: boolean\n change_description?: string\n created_at: string // date-time\n updated_at: string // date-time\n configuration?: {\n entities?: Array<{\n entity_schema: { ... }\n unique_ids: { ... }\n jsonataExpression?: { ... }\n enabled?: { ... }\n mode?: { ... }\n scope?: { ... }\n fields: { ... }\n }>\n meter_readings?: Array<{\n jsonataExpression?: { ... }\n reading_matching?: { ... }\n mode?: { ... }\n scope?: { ... }\n meter: { ... }\n meter_counter?: { ... }\n fields: { ... }\n }>\n }\n} | {\n id: string // uuid\n integrationId: string // uuid\n name: string\n slug?: string\n type: \"outbound\"\n enabled: boolean\n change_description?: string\n created_at: string // date-time\n updated_at: string // date-time\n configuration?: {\n event_catalog_event: string\n mappings: Array<{\n id?: { ... }\n name: { ... }\n jsonata_expression?: { ... }\n enabled: { ... }\n delivery: { ... }\n created_at?: { ... }\n updated_at?: { ... }\n }>\n }\n} | {\n id: string // uuid\n integrationId: string // uuid\n name: string\n slug?: string\n type: \"file_proxy\"\n enabled: boolean\n change_description?: string\n created_at: string // date-time\n updated_at: string // date-time\n configuration?: {\n secure_proxy?: {\n use_case_slug: { ... }\n }\n auth?: {\n type: { ... }\n token_url: { ... }\n client_id: { ... }\n client_secret: { ... }\n scope?: { ... }\n audience?: { ... }\n resource?: { ... }\n username?: { ... }\n password?: { ... }\n body_params?: { ... }\n headers?: { ... }\n query_params?: { ... }\n }\n params?: Array<{\n name: { ... }\n required: { ... }\n description?: { ... }\n }>\n allowed_origins?: string // uri[]\n steps: Array<{\n url: { ... }\n method: { ... }\n headers?: { ... }\n body?: { ... }\n response_type: { ... }\n }>\n response: {\n body: { ... }\n encoding: { ... }\n filename?: { ... }\n content_type?: { ... }\n }\n prevent_indirect_serving?: boolean\n // ...\n}\n```\n\n### `CreateUseCaseRequest`\n\n```ts\ntype CreateUseCaseRequest = {\n name: string\n slug: string\n enabled: boolean\n type: \"inbound\"\n configuration?: {\n entities?: Array<{\n entity_schema: { ... }\n unique_ids: { ... }\n jsonataExpression?: { ... }\n enabled?: { ... }\n mode?: { ... }\n scope?: { ... }\n fields: { ... }\n }>\n meter_readings?: Array<{\n jsonataExpression?: { ... }\n reading_matching?: { ... }\n mode?: { ... }\n scope?: { ... }\n meter: { ... }\n meter_counter?: { ... }\n fields: { ... }\n }>\n }\n} | {\n name: string\n slug: string\n enabled: boolean\n type: \"outbound\"\n configuration?: {\n event_catalog_event: string\n mappings: Array<{\n id?: { ... }\n name: { ... }\n jsonata_expression?: { ... }\n enabled: { ... }\n delivery: { ... }\n created_at?: { ... }\n updated_at?: { ... }\n }>\n }\n} | {\n name: string\n slug: string\n enabled: boolean\n type: \"file_proxy\"\n configuration?: {\n secure_proxy?: {\n use_case_slug: { ... }\n }\n auth?: {\n type: { ... }\n token_url: { ... }\n client_id: { ... }\n client_secret: { ... }\n scope?: { ... }\n audience?: { ... }\n resource?: { ... }\n username?: { ... }\n password?: { ... }\n body_params?: { ... }\n headers?: { ... }\n query_params?: { ... }\n }\n params?: Array<{\n name: { ... }\n required: { ... }\n description?: { ... }\n }>\n allowed_origins?: string // uri[]\n steps: Array<{\n url: { ... }\n method: { ... }\n headers?: { ... }\n body?: { ... }\n response_type: { ... }\n }>\n response: {\n body: { ... }\n encoding: { ... }\n filename?: { ... }\n content_type?: { ... }\n }\n prevent_indirect_serving?: boolean\n }\n} | {\n name: string\n slug: string\n enabled: boolean\n type: \"managed_call\"\n configuration?: {\n operation: {\n method: { ... }\n path: { ... }\n headers?: { ... }\n query_params?: { ... }\n }\n request_mapping?: string\n response_mapping?: string\n // ...\n}\n```\n\n### `CreateUseCaseRequestBase`\n\n```ts\ntype CreateUseCaseRequestBase = {\n name: string\n slug: string\n enabled: boolean\n}\n```\n\n### `CreateInboundUseCaseRequest`\n\n```ts\ntype CreateInboundUseCaseRequest = {\n name: string\n slug: string\n enabled: boolean\n type: \"inbound\"\n configuration?: {\n entities?: Array<{\n entity_schema: { ... }\n unique_ids: { ... }\n jsonataExpression?: { ... }\n enabled?: { ... }\n mode?: { ... }\n scope?: { ... }\n fields: { ... }\n }>\n meter_readings?: Array<{\n jsonataExpression?: { ... }\n reading_matching?: { ... }\n mode?: { ... }\n scope?: { ... }\n meter: { ... }\n meter_counter?: { ... }\n fields: { ... }\n }>\n }\n}\n```\n\n### `CreateOutboundUseCaseRequest`\n\n```ts\ntype CreateOutboundUseCaseRequest = {\n name: string\n slug: string\n enabled: boolean\n type: \"outbound\"\n configuration?: {\n event_catalog_event: string\n mappings: Array<{\n id?: { ... }\n name: { ... }\n jsonata_expression?: { ... }\n enabled: { ... }\n delivery: { ... }\n created_at?: { ... }\n updated_at?: { ... }\n }>\n }\n}\n```\n\n### `CreateFileProxyUseCaseRequest`\n\n```ts\ntype CreateFileProxyUseCaseRequest = {\n name: string\n slug: string\n enabled: boolean\n type: \"file_proxy\"\n configuration?: {\n secure_proxy?: {\n use_case_slug: { ... }\n }\n auth?: {\n type: { ... }\n token_url: { ... }\n client_id: { ... }\n client_secret: { ... }\n scope?: { ... }\n audience?: { ... }\n resource?: { ... }\n username?: { ... }\n password?: { ... }\n body_params?: { ... }\n headers?: { ... }\n query_params?: { ... }\n }\n params?: Array<{\n name: { ... }\n required: { ... }\n description?: { ... }\n }>\n allowed_origins?: string // uri[]\n steps: Array<{\n url: { ... }\n method: { ... }\n headers?: { ... }\n body?: { ... }\n response_type: { ... }\n }>\n response: {\n body: { ... }\n encoding: { ... }\n filename?: { ... }\n content_type?: { ... }\n }\n prevent_indirect_serving?: boolean\n }\n}\n```\n\n### `CreateManagedCallUseCaseRequest`\n\n```ts\ntype CreateManagedCallUseCaseRequest = {\n name: string\n slug: string\n enabled: boolean\n type: \"managed_call\"\n configuration?: {\n operation: {\n method: { ... }\n path: { ... }\n headers?: { ... }\n query_params?: { ... }\n }\n request_mapping?: string\n response_mapping?: string\n inbound_use_case_slug?: string\n }\n}\n```\n\n### `CreateSecureProxyUseCaseRequest`\n\n```ts\ntype CreateSecureProxyUseCaseRequest = {\n name: string\n slug: string\n enabled: boolean\n type: \"secure_proxy\"\n configuration?: {\n vpc_mode: \"static_ip\" | \"secure_link\"\n allowed_domains?: string[]\n allowed_ips?: string[]\n }\n}\n```\n\n### `UpdateUseCaseRequest`\n\n```ts\ntype UpdateUseCaseRequest = {\n name?: string\n slug?: string\n enabled?: boolean\n change_description?: string\n type?: \"inbound\"\n configuration?: {\n entities?: Array<{\n entity_schema: { ... }\n unique_ids: { ... }\n jsonataExpression?: { ... }\n enabled?: { ... }\n mode?: { ... }\n scope?: { ... }\n fields: { ... }\n }>\n meter_readings?: Array<{\n jsonataExpression?: { ... }\n reading_matching?: { ... }\n mode?: { ... }\n scope?: { ... }\n meter: { ... }\n meter_counter?: { ... }\n fields: { ... }\n }>\n }\n} | {\n name?: string\n slug?: string\n enabled?: boolean\n change_description?: string\n type?: \"outbound\"\n configuration?: {\n event_catalog_event: string\n mappings: Array<{\n id?: { ... }\n name: { ... }\n jsonata_expression?: { ... }\n enabled: { ... }\n delivery: { ... }\n created_at?: { ... }\n updated_at?: { ... }\n }>\n }\n} | {\n name?: string\n slug?: string\n enabled?: boolean\n change_description?: string\n type?: \"file_proxy\"\n configuration?: {\n secure_proxy?: {\n use_case_slug: { ... }\n }\n auth?: {\n type: { ... }\n token_url: { ... }\n client_id: { ... }\n client_secret: { ... }\n scope?: { ... }\n audience?: { ... }\n resource?: { ... }\n username?: { ... }\n password?: { ... }\n body_params?: { ... }\n headers?: { ... }\n query_params?: { ... }\n }\n params?: Array<{\n name: { ... }\n required: { ... }\n description?: { ... }\n }>\n allowed_origins?: string // uri[]\n steps: Array<{\n url: { ... }\n method: { ... }\n headers?: { ... }\n body?: { ... }\n response_type: { ... }\n }>\n response: {\n body: { ... }\n encoding: { ... }\n filename?: { ... }\n content_type?: { ... }\n }\n prevent_indirect_serving?: boolean\n }\n} | {\n name?: string\n slug?: string\n enabled?: boolean\n change_description?: string\n type?: \"managed_call\"\n configuration?: {\n operation: {\n method: { ... }\n path: { ... }\n headers?: { ... }\n // ...\n}\n```\n\n### `UpdateUseCaseRequestBase`\n\n```ts\ntype UpdateUseCaseRequestBase = {\n name?: string\n slug?: string\n enabled?: boolean\n change_description?: string\n}\n```\n\n### `UpdateInboundUseCaseRequest`\n\n```ts\ntype UpdateInboundUseCaseRequest = {\n name?: string\n slug?: string\n enabled?: boolean\n change_description?: string\n type?: \"inbound\"\n configuration?: {\n entities?: Array<{\n entity_schema: { ... }\n unique_ids: { ... }\n jsonataExpression?: { ... }\n enabled?: { ... }\n mode?: { ... }\n scope?: { ... }\n fields: { ... }\n }>\n meter_readings?: Array<{\n jsonataExpression?: { ... }\n reading_matching?: { ... }\n mode?: { ... }\n scope?: { ... }\n meter: { ... }\n meter_counter?: { ... }\n fields: { ... }\n }>\n }\n}\n```\n\n### `UpdateOutboundUseCaseRequest`\n\n```ts\ntype UpdateOutboundUseCaseRequest = {\n name?: string\n slug?: string\n enabled?: boolean\n change_description?: string\n type?: \"outbound\"\n configuration?: {\n event_catalog_event: string\n mappings: Array<{\n id?: { ... }\n name: { ... }\n jsonata_expression?: { ... }\n enabled: { ... }\n delivery: { ... }\n created_at?: { ... }\n updated_at?: { ... }\n }>\n }\n}\n```\n\n### `UpdateFileProxyUseCaseRequest`\n\n```ts\ntype UpdateFileProxyUseCaseRequest = {\n name?: string\n slug?: string\n enabled?: boolean\n change_description?: string\n type?: \"file_proxy\"\n configuration?: {\n secure_proxy?: {\n use_case_slug: { ... }\n }\n auth?: {\n type: { ... }\n token_url: { ... }\n client_id: { ... }\n client_secret: { ... }\n scope?: { ... }\n audience?: { ... }\n resource?: { ... }\n username?: { ... }\n password?: { ... }\n body_params?: { ... }\n headers?: { ... }\n query_params?: { ... }\n }\n params?: Array<{\n name: { ... }\n required: { ... }\n description?: { ... }\n }>\n allowed_origins?: string // uri[]\n steps: Array<{\n url: { ... }\n method: { ... }\n headers?: { ... }\n body?: { ... }\n response_type: { ... }\n }>\n response: {\n body: { ... }\n encoding: { ... }\n filename?: { ... }\n content_type?: { ... }\n }\n prevent_indirect_serving?: boolean\n }\n}\n```\n\n### `UpdateManagedCallUseCaseRequest`\n\n```ts\ntype UpdateManagedCallUseCaseRequest = {\n name?: string\n slug?: string\n enabled?: boolean\n change_description?: string\n type?: \"managed_call\"\n configuration?: {\n operation: {\n method: { ... }\n path: { ... }\n headers?: { ... }\n query_params?: { ... }\n }\n request_mapping?: string\n response_mapping?: string\n inbound_use_case_slug?: string\n }\n type_annotations?: {\n request?: Record\n response?: Record\n }\n}\n```\n\n### `UpdateSecureProxyUseCaseRequest`\n\n```ts\ntype UpdateSecureProxyUseCaseRequest = {\n name?: string\n slug?: string\n enabled?: boolean\n change_description?: string\n type?: \"secure_proxy\"\n configuration?: {\n vpc_mode: \"static_ip\" | \"secure_link\"\n allowed_domains?: string[]\n allowed_ips?: string[]\n }\n}\n```\n\n### `UseCaseHistoryEntry`\n\n```ts\ntype UseCaseHistoryEntry = {\n id: string // uuid\n useCaseId: string // uuid\n integrationId: string // uuid\n name: string\n slug?: string\n enabled: boolean\n change_description?: string\n changed_by?: string\n created_at: string // date-time\n updated_at: string // date-time\n history_created_at: string // date-time\n type: \"inbound\"\n configuration?: {\n entities?: Array<{\n entity_schema: { ... }\n unique_ids: { ... }\n jsonataExpression?: { ... }\n enabled?: { ... }\n mode?: { ... }\n scope?: { ... }\n fields: { ... }\n }>\n meter_readings?: Array<{\n jsonataExpression?: { ... }\n reading_matching?: { ... }\n mode?: { ... }\n scope?: { ... }\n meter: { ... }\n meter_counter?: { ... }\n fields: { ... }\n }>\n }\n} | {\n id: string // uuid\n useCaseId: string // uuid\n integrationId: string // uuid\n name: string\n slug?: string\n enabled: boolean\n change_description?: string\n changed_by?: string\n created_at: string // date-time\n updated_at: string // date-time\n history_created_at: string // date-time\n type: \"outbound\"\n configuration?: {\n event_catalog_event: string\n mappings: Array<{\n id?: { ... }\n name: { ... }\n jsonata_expression?: { ... }\n enabled: { ... }\n delivery: { ... }\n created_at?: { ... }\n updated_at?: { ... }\n }>\n }\n} | {\n id: string // uuid\n useCaseId: string // uuid\n integrationId: string // uuid\n name: string\n slug?: string\n enabled: boolean\n change_description?: string\n changed_by?: string\n created_at: string // date-time\n updated_at: string // date-time\n history_created_at: string // date-time\n type: \"file_proxy\"\n configuration?: {\n secure_proxy?: {\n use_case_slug: { ... }\n }\n auth?: {\n type: { ... }\n token_url: { ... }\n client_id: { ... }\n client_secret: { ... }\n scope?: { ... }\n audience?: { ... }\n resource?: { ... }\n username?: { ... }\n password?: { ... }\n body_params?: { ... }\n headers?: { ... }\n query_params?: { ... }\n }\n params?: Array<{\n name: { ... }\n required: { ... }\n description?: { ... }\n }>\n allowed_origins?: string // uri[]\n steps: Array<{\n url: { ... }\n method: { ... }\n headers?: { ... }\n body?: { ... }\n // ...\n}\n```\n\n### `UseCaseHistoryEntryBase`\n\n```ts\ntype UseCaseHistoryEntryBase = {\n id: string // uuid\n useCaseId: string // uuid\n integrationId: string // uuid\n name: string\n slug?: string\n enabled: boolean\n change_description?: string\n changed_by?: string\n created_at: string // date-time\n updated_at: string // date-time\n history_created_at: string // date-time\n}\n```\n\n### `InboundUseCaseHistoryEntry`\n\n```ts\ntype InboundUseCaseHistoryEntry = {\n id: string // uuid\n useCaseId: string // uuid\n integrationId: string // uuid\n name: string\n slug?: string\n enabled: boolean\n change_description?: string\n changed_by?: string\n created_at: string // date-time\n updated_at: string // date-time\n history_created_at: string // date-time\n type: \"inbound\"\n configuration?: {\n entities?: Array<{\n entity_schema: { ... }\n unique_ids: { ... }\n jsonataExpression?: { ... }\n enabled?: { ... }\n mode?: { ... }\n scope?: { ... }\n fields: { ... }\n }>\n meter_readings?: Array<{\n jsonataExpression?: { ... }\n reading_matching?: { ... }\n mode?: { ... }\n scope?: { ... }\n meter: { ... }\n meter_counter?: { ... }\n fields: { ... }\n }>\n }\n}\n```\n\n### `OutboundUseCaseHistoryEntry`\n\n```ts\ntype OutboundUseCaseHistoryEntry = {\n id: string // uuid\n useCaseId: string // uuid\n integrationId: string // uuid\n name: string\n slug?: string\n enabled: boolean\n change_description?: string\n changed_by?: string\n created_at: string // date-time\n updated_at: string // date-time\n history_created_at: string // date-time\n type: \"outbound\"\n configuration?: {\n event_catalog_event: string\n mappings: Array<{\n id?: { ... }\n name: { ... }\n jsonata_expression?: { ... }\n enabled: { ... }\n delivery: { ... }\n created_at?: { ... }\n updated_at?: { ... }\n }>\n }\n}\n```\n\n### `FileProxyUseCaseHistoryEntry`\n\n```ts\ntype FileProxyUseCaseHistoryEntry = {\n id: string // uuid\n useCaseId: string // uuid\n integrationId: string // uuid\n name: string\n slug?: string\n enabled: boolean\n change_description?: string\n changed_by?: string\n created_at: string // date-time\n updated_at: string // date-time\n history_created_at: string // date-time\n type: \"file_proxy\"\n configuration?: {\n secure_proxy?: {\n use_case_slug: { ... }\n }\n auth?: {\n type: { ... }\n token_url: { ... }\n client_id: { ... }\n client_secret: { ... }\n scope?: { ... }\n audience?: { ... }\n resource?: { ... }\n username?: { ... }\n password?: { ... }\n body_params?: { ... }\n headers?: { ... }\n query_params?: { ... }\n }\n params?: Array<{\n name: { ... }\n required: { ... }\n description?: { ... }\n }>\n allowed_origins?: string // uri[]\n steps: Array<{\n url: { ... }\n method: { ... }\n headers?: { ... }\n body?: { ... }\n response_type: { ... }\n }>\n response: {\n body: { ... }\n encoding: { ... }\n filename?: { ... }\n content_type?: { ... }\n }\n prevent_indirect_serving?: boolean\n }\n}\n```\n\n### `ManagedCallUseCaseHistoryEntry`\n\n```ts\ntype ManagedCallUseCaseHistoryEntry = {\n id: string // uuid\n useCaseId: string // uuid\n integrationId: string // uuid\n name: string\n slug?: string\n enabled: boolean\n change_description?: string\n changed_by?: string\n created_at: string // date-time\n updated_at: string // date-time\n history_created_at: string // date-time\n type: \"managed_call\"\n configuration?: {\n operation: {\n method: { ... }\n path: { ... }\n headers?: { ... }\n query_params?: { ... }\n }\n request_mapping?: string\n response_mapping?: string\n inbound_use_case_slug?: string\n }\n type_annotations?: {\n request?: Record\n response?: Record\n }\n types_locked?: boolean\n}\n```\n\n### `SecureProxyUseCaseHistoryEntry`\n\n```ts\ntype SecureProxyUseCaseHistoryEntry = {\n id: string // uuid\n useCaseId: string // uuid\n integrationId: string // uuid\n name: string\n slug?: string\n enabled: boolean\n change_description?: string\n changed_by?: string\n created_at: string // date-time\n updated_at: string // date-time\n history_created_at: string // date-time\n type: \"secure_proxy\"\n configuration?: {\n vpc_mode: \"static_ip\" | \"secure_link\"\n allowed_domains?: string[]\n allowed_ips?: string[]\n }\n}\n```\n\n### `SecureProxyUseCaseConfiguration`\n\nConfiguration for secure_proxy use cases. Defines how to route requests through a secure VPC.\n\n\n```ts\ntype SecureProxyUseCaseConfiguration = {\n vpc_mode: \"static_ip\" | \"secure_link\"\n allowed_domains?: string[]\n allowed_ips?: string[]\n}\n```\n\n### `SecureProxyWhitelist`\n\nCurrent whitelist state for a secure_proxy use case. vpc_mode is read-only\ncontext so the UI can show the user what mode the pool is in.\n\n\n```ts\ntype SecureProxyWhitelist = {\n vpc_mode: \"static_ip\" | \"secure_link\"\n allowed_domains: string[]\n allowed_ips: string[]\n}\n```\n\n### `SecureProxyWhitelistUpdate`\n\nPartial update for a secure_proxy whitelist. At least one of\n`allowed_domains` or `allowed_ips` must be provided.\n\nPer-field semantics:\n - **omitted** — the field is not modified; the stored value is preserved.\n - **non-empty array** — the stored value is replaced with the supplied list.\n - **emp\n\n```ts\ntype SecureProxyWhitelistUpdate = {\n allowed_domains?: string[]\n allowed_ips?: string[]\n}\n```\n\n### `SecureProxySummary`\n\n```ts\ntype SecureProxySummary = {\n id: string // uuid\n name: string\n slug?: string\n enabled: boolean\n vpc_mode: \"static_ip\" | \"secure_link\"\n allowed_domains?: string[]\n allowed_ips?: string[]\n integration_id: string // uuid\n integration_name: string\n}\n```\n\n### `SecureProxyRequest`\n\n```ts\ntype SecureProxyRequest = {\n integration_id: string // uuid\n use_case_id?: string // uuid\n use_case_slug?: string\n url: string // uri\n method: \"GET\" | \"POST\" | \"PUT\" | \"PATCH\" | \"DELETE\"\n headers?: Record\n body?: unknown\n response_type?: \"json\" | \"binary\"\n}\n```\n\n### `SecureProxyResponse`\n\n```ts\ntype SecureProxyResponse = {\n status_code?: number\n headers?: Record\n body?: unknown\n}\n```\n\n### `SecureProxyUpstreamError`\n\nError payload returned when epilot could not obtain an HTTP response from the proxied target. The failure is epilot-generated (HTTP 502) but the cause is usually remote-side; `code`/`reason` make that attributable.\n\n```ts\ntype SecureProxyUpstreamError = {\n message: \"Upstream network error\" | \"Upstream error\"\n code?: string\n reason?: string\n}\n```\n\n### `ManagedCallOperationConfig`\n\nConfiguration for managed_call use cases. Defines a single API operation with JSONata mapping.\n\n```ts\ntype ManagedCallOperationConfig = {\n operation: {\n method: \"GET\" | \"POST\" | \"PUT\" | \"PATCH\" | \"DELETE\"\n path: string\n headers?: Record\n query_params?: Record\n }\n request_mapping?: string\n response_mapping?: string\n inbound_use_case_slug?: string\n}\n```\n\n### `ManagedCallOperation`\n\nHTTP operation configuration for managed calls\n\n```ts\ntype ManagedCallOperation = {\n method: \"GET\" | \"POST\" | \"PUT\" | \"PATCH\" | \"DELETE\"\n path: string\n headers?: Record\n query_params?: Record\n}\n```\n\n### `ManagedCallExecuteRequest`\n\n```ts\ntype ManagedCallExecuteRequest = {\n integration_id: string // uuid\n payload?: Record\n correlation_id?: string\n}\n```\n\n### `ManagedCallExecuteResponse`\n\nThe response from a managed call execution.\nOn success, returns the JSONata-mapped response data directly (no wrapper).\nThe shape is entirely defined by your response_mapping JSONata expression.\nIf no response_mapping is configured, returns the raw external API response.\nCheck the X-Inbound-Event-Id\n\n```ts\ntype ManagedCallExecuteResponse = unknown\n```\n\n### `ManagedCallErrorResponse`\n\n```ts\ntype ManagedCallErrorResponse = {\n error: {\n code: string\n message: string\n details?: Record\n }\n}\n```\n\n### `TypeAnnotations`\n\nDeveloper-provided type annotations for a use case's request and response fields\n\n```ts\ntype TypeAnnotations = {\n request?: Record\n response?: Record\n}\n```\n\n### `TypeDescriptor`\n\nDescribes the inferred type shape of a JSONata expression\n\n```ts\ntype TypeDescriptor = {\n kind: \"object\" | \"array\" | \"string\" | \"number\" | \"boolean\" | \"null\" | \"unknown\" | \"union\"\n properties?: Record\n items?: {\n kind: { ... }\n properties?: { ... }\n items?: { ... }\n source?: { ... }\n variants?: { ... }\n }\n source?: string\n variants?: Array<{\n kind: { ... }\n properties?: { ... }\n items?: { ... }\n source?: { ... }\n variants?: { ... }\n }>\n }>\n items?: {\n kind: \"object\" | \"array\" | \"string\" | \"number\" | \"boolean\" | \"null\" | \"unknown\" | \"union\"\n properties?: Record\n items?: {\n kind: { ... }\n properties?: { ... }\n items?: { ... }\n source?: { ... }\n variants?: { ... }\n }\n source?: string\n variants?: Array<{\n kind: { ... }\n properties?: { ... }\n items?: { ... }\n source?: { ... }\n variants?: { ... }\n }>\n }\n source?: string\n variants?: Array<{\n kind: \"object\" | \"array\" | \"string\" | \"number\" | \"boolean\" | \"null\" | \"unknown\" | \"union\"\n properties?: Record\n items?: {\n kind: { ... }\n properties?: { ... }\n items?: { ... }\n source?: { ... }\n variants?: { ... }\n }\n source?: string\n variants?: Array<{\n kind: { ... }\n properties?: { ... }\n items?: { ... }\n source?: { ... }\n variants?: { ... }\n }>\n }>\n}\n```\n\n### `UseCaseTypePreview`\n\nScaffolded type descriptors for a single use case\n\n```ts\ntype UseCaseTypePreview = {\n slug: string\n name?: string\n request_shape: {\n kind: \"object\" | \"array\" | \"string\" | \"number\" | \"boolean\" | \"null\" | \"unknown\" | \"union\"\n properties?: Record\n items?: {\n kind: { ... }\n properties?: { ... }\n items?: { ... }\n source?: { ... }\n variants?: { ... }\n }\n source?: string\n variants?: Array<{\n kind: { ... }\n properties?: { ... }\n items?: { ... }\n source?: { ... }\n variants?: { ... }\n }>\n }\n response_shape: {\n kind: \"object\" | \"array\" | \"string\" | \"number\" | \"boolean\" | \"null\" | \"unknown\" | \"union\"\n properties?: Record\n items?: {\n kind: { ... }\n properties?: { ... }\n items?: { ... }\n source?: { ... }\n variants?: { ... }\n }\n source?: string\n variants?: Array<{\n kind: { ... }\n properties?: { ... }\n items?: { ... }\n source?: { ... }\n variants?: { ... }\n }>\n }\n existing_annotations?: {\n request?: Record\n response?: Record\n }\n}\n```\n\n### `GenerateTypesPreviewResponse`\n\n```ts\ntype GenerateTypesPreviewResponse = {\n integration_name?: string\n use_cases: Array<{\n slug: string\n name?: string\n request_shape: {\n kind: { ... }\n properties?: { ... }\n items?: { ... }\n source?: { ... }\n variants?: { ... }\n }\n response_shape: {\n kind: { ... }\n properties?: { ... }\n items?: { ... }\n source?: { ... }\n variants?: { ... }\n }\n existing_annotations?: {\n request?: { ... }\n response?: { ... }\n }\n }>\n previous_version?: string\n suggested_version?: string\n suggested_bump?: \"major\" | \"minor\"\n detected_changes?: Array<{\n slug: string\n field: string\n type: \"breaking\" | \"non-breaking\"\n description: string\n }>\n}\n```\n\n### `GenerateTypesRequest`\n\n```ts\ntype GenerateTypesRequest = {\n package_name: string\n version: string\n description?: string\n domain_package?: string\n domain_map_name?: string\n annotations?: Record\n response?: Record\n }>\n}\n```\n\n### `GenerateTypesResponse`\n\n```ts\ntype GenerateTypesResponse = {\n package_name: string\n version: string\n files: Record\n warnings?: string[]\n}\n```\n\n### `CommitTypesRequest`\n\n```ts\ntype CommitTypesRequest = {\n package_name: string\n version: string\n annotations?: Record\n response?: Record\n }>\n}\n```\n\n### `CommitTypesResponse`\n\n```ts\ntype CommitTypesResponse = {\n committed: boolean\n warnings?: string[]\n}\n```\n\n### `FileProxyUseCaseConfiguration`\n\nConfiguration for file_proxy use cases. Defines how to authenticate and fetch files from external document systems.\n\nThe file proxy download URL always requires `orgId`, `integrationId`, and either `useCaseSlug` (recommended) or `useCaseId` (legacy UUID) as query parameters.\nThe `orgId` is included \n\n```ts\ntype FileProxyUseCaseConfiguration = {\n secure_proxy?: {\n use_case_slug: string\n }\n auth?: {\n type: \"oauth2_client_credentials\" | \"oauth2_password\"\n token_url: string\n client_id: string\n client_secret: string\n scope?: string\n audience?: string\n resource?: string\n username?: string\n password?: string\n body_params?: Record\n headers?: Record\n query_params?: Record\n }\n params?: Array<{\n name: string\n required: boolean\n description?: string\n }>\n allowed_origins?: string // uri[]\n steps: Array<{\n url: string\n method: \"GET\" | \"POST\"\n headers?: Record\n body?: string\n response_type: \"json\" | \"binary\"\n }>\n response: {\n body: string\n encoding: \"base64\" | \"binary\"\n filename?: string\n content_type?: string\n }\n prevent_indirect_serving?: boolean\n}\n```\n\n### `FileProxySecureProxyAttachment`\n\n```ts\ntype FileProxySecureProxyAttachment = {\n use_case_slug: string\n}\n```\n\n### `FileProxyAuth`\n\n```ts\ntype FileProxyAuth = {\n type: \"oauth2_client_credentials\" | \"oauth2_password\"\n token_url: string\n client_id: string\n client_secret: string\n scope?: string\n audience?: string\n resource?: string\n username?: string\n password?: string\n body_params?: Record\n headers?: Record\n query_params?: Record\n}\n```\n\n### `FileProxyParam`\n\n```ts\ntype FileProxyParam = {\n name: string\n required: boolean\n description?: string\n}\n```\n\n### `FileProxyStep`\n\n```ts\ntype FileProxyStep = {\n url: string\n method: \"GET\" | \"POST\"\n headers?: Record\n body?: string\n response_type: \"json\" | \"binary\"\n}\n```\n\n### `FileProxyResponseConfig`\n\n```ts\ntype FileProxyResponseConfig = {\n body: string\n encoding: \"base64\" | \"binary\"\n filename?: string\n content_type?: string\n}\n```\n\n### `MappingSimulationRequest`\n\n```ts\ntype MappingSimulationRequest = {\n mapping_configuration: {\n version?: \"1.0\"\n mapping: {\n objects: { ... }\n }\n } | {\n version: \"2.0\"\n mapping: {\n events: { ... }\n }\n }\n object_type: string\n format: \"json\" | \"xml\"\n payload: string | Record\n}\n```\n\n### `MappingSimulationV2Request`\n\nRequest for v2 mapping simulation. Uses the same configuration format stored in integration use case resources,\nmaking it easier to test configurations before saving them.\n\n\n```ts\ntype MappingSimulationV2Request = {\n event_configuration: {\n entities?: Array<{\n entity_schema: { ... }\n unique_ids: { ... }\n jsonataExpression?: { ... }\n enabled?: { ... }\n mode?: { ... }\n scope?: { ... }\n fields: { ... }\n }>\n meter_readings?: Array<{\n jsonataExpression?: { ... }\n reading_matching?: { ... }\n mode?: { ... }\n scope?: { ... }\n meter: { ... }\n meter_counter?: { ... }\n fields: { ... }\n }>\n }\n format: \"json\" | \"xml\"\n payload: string | Record\n}\n```\n\n### `MappingSimulationResponse`\n\n```ts\ntype MappingSimulationResponse = {\n entity_updates: Array<{\n entity_slug: string\n unique_identifiers: Record\n attributes: Record\n }>\n meter_readings_updates?: Array<{\n meter: {\n $entity_unique_ids: { ... }\n }\n meter_counter?: {\n $entity_unique_ids?: { ... }\n }\n attributes: Record\n }>\n warnings?: Array<{\n entity_schema: string\n field: string\n message: string\n }>\n}\n```\n\n### `MappingSimulationWarning`\n\n```ts\ntype MappingSimulationWarning = {\n entity_schema: string\n field: string\n message: string\n}\n```\n\n### `EntityUpdate`\n\n```ts\ntype EntityUpdate = {\n entity_slug: string\n unique_identifiers: Record\n attributes: Record\n}\n```\n\n### `MeterReadingUpdate`\n\n```ts\ntype MeterReadingUpdate = {\n meter: {\n $entity_unique_ids: Record\n }\n meter_counter?: {\n $entity_unique_ids?: Record\n }\n attributes: Record\n}\n```\n\n### `IntegrationConfigurationV1`\n\n```ts\ntype IntegrationConfigurationV1 = {\n version?: \"1.0\"\n mapping: {\n objects: Record\n }\n}\n```\n\n### `IntegrationObjectV1`\n\n```ts\ntype IntegrationObjectV1 = {\n unique_ids: Record>\n fields: Array<{\n entity: string\n attribute: string\n field?: string\n jsonataExpression?: string\n }>\n}\n```\n\n### `IntegrationFieldV1`\n\n```ts\ntype IntegrationFieldV1 = {\n entity: string\n attribute: string\n field?: string\n jsonataExpression?: string\n}\n```\n\n### `IntegrationConfigurationV2`\n\n```ts\ntype IntegrationConfigurationV2 = {\n version: \"2.0\"\n mapping: {\n events: Record\n }\n}\n```\n\n### `OutboundMapping`\n\nA mapping that delivers an event to an external system — either pushed to a webhook (with a JSONata payload transformation) or made available on the pull-based poll queue (raw event payload, no transformation)\n\n```ts\ntype OutboundMapping = {\n id?: string // uuid\n name: string\n jsonata_expression?: string\n enabled: boolean\n delivery: {\n type: \"webhook\"\n webhook_id: string\n webhook_name?: string\n webhook_url?: string\n } | {\n type: \"poll\"\n retention_days?: number\n poison_policy?: \"dead_letter\" | \"block\"\n max_delivery_attempts?: number\n }\n created_at?: string // date-time\n updated_at?: string // date-time\n}\n```\n\n### `DeliveryConfig`\n\nConfiguration for how the event should be delivered. webhook = push delivery via svc-webhooks (JSONata-transformed payload); poll = pull-based queue delivery where the consumer fetches items via the poll API (raw event payload)\n\n```ts\ntype DeliveryConfig = {\n type: \"webhook\"\n webhook_id: string\n webhook_name?: string\n webhook_url?: string\n} | {\n type: \"poll\"\n retention_days?: number\n poison_policy?: \"dead_letter\" | \"block\"\n max_delivery_attempts?: number\n}\n```\n\n### `WebhookDeliveryConfig`\n\nPush delivery of the transformed event to a webhook via svc-webhooks\n\n```ts\ntype WebhookDeliveryConfig = {\n type: \"webhook\"\n webhook_id: string\n webhook_name?: string\n webhook_url?: string\n}\n```\n\n### `PollDeliveryConfig`\n\nPull-based queue delivery. Items carry the raw standardized event-catalog payload; no JSONata mapping is applied in poll mode. Consumers fetch and acknowledge items via the poll API.\n\n```ts\ntype PollDeliveryConfig = {\n type: \"poll\"\n retention_days?: number\n poison_policy?: \"dead_letter\" | \"block\"\n max_delivery_attempts?: number\n}\n```\n\n### `OutboundStatusResponse`\n\n```ts\ntype OutboundStatusResponse = {\n useCases: Array<{\n useCaseId: string // uuid\n name: string\n useCaseEnabled: boolean\n eventCatalogEvent?: string\n eventEnabled?: boolean\n webhooks?: Array<{\n webhookId: { ... }\n webhookName?: { ... }\n enabled?: { ... }\n }>\n status: \"ok\" | \"conflict\" | \"disabled\"\n conflicts?: Array<{\n type: { ... }\n webhookId?: { ... }\n message: { ... }\n }>\n poll?: {\n queue_depth: { ... }\n oldest_unconsumed_age_seconds: { ... }\n last_poll_at: { ... }\n last_ack_at: { ... }\n blocked: { ... }\n dlq_count: { ... }\n }\n }>\n}\n```\n\n### `OutboundUseCaseStatus`\n\n```ts\ntype OutboundUseCaseStatus = {\n useCaseId: string // uuid\n name: string\n useCaseEnabled: boolean\n eventCatalogEvent?: string\n eventEnabled?: boolean\n webhooks?: Array<{\n webhookId: string\n webhookName?: string\n enabled?: boolean\n }>\n status: \"ok\" | \"conflict\" | \"disabled\"\n conflicts?: Array<{\n type: \"event_disabled\" | \"all_webhooks_disabled\" | \"event_enabled_while_disabled\" | \"webhook_enabled_while_disabled\" | \"stream_blocked\" | \"dlq_items_present\"\n webhookId?: string\n message: string\n }>\n poll?: {\n queue_depth: number\n oldest_unconsumed_age_seconds: number\n last_poll_at: string // date-time\n last_ack_at: string // date-time\n blocked: boolean\n dlq_count: number\n }\n}\n```\n\n### `OutboundPollStatus`\n\nQueue/consumer health for a poll-mode use case. Present only on use\ncases with a poll delivery mapping — webhook-only use cases are\nunaffected. Depth/age/DLQ numbers are first-page approximations.\n\n\n```ts\ntype OutboundPollStatus = {\n queue_depth: number\n oldest_unconsumed_age_seconds: number\n last_poll_at: string // date-time\n last_ack_at: string // date-time\n blocked: boolean\n dlq_count: number\n}\n```\n\n### `WebhookStatus`\n\n```ts\ntype WebhookStatus = {\n webhookId: string\n webhookName?: string\n enabled?: boolean\n}\n```\n\n### `OutboundConflict`\n\n```ts\ntype OutboundConflict = {\n type: \"event_disabled\" | \"all_webhooks_disabled\" | \"event_enabled_while_disabled\" | \"webhook_enabled_while_disabled\" | \"stream_blocked\" | \"dlq_items_present\"\n webhookId?: string\n message: string\n}\n```\n\n### `PollOutboundMessagesRequest`\n\n```ts\ntype PollOutboundMessagesRequest = {\n limit?: number\n}\n```\n\n### `OutboundMessage`\n\n```ts\ntype OutboundMessage = {\n id: string\n lease_token: string\n use_case_id: string\n event_name: string\n event_id: string\n group: string\n payload: Record\n enqueued_at: string // date-time\n}\n```\n\n### `PollOutboundMessagesResponse`\n\n```ts\ntype PollOutboundMessagesResponse = {\n messages: Array<{\n id: string\n lease_token: string\n use_case_id: string\n event_name: string\n event_id: string\n group: string\n payload: Record\n enqueued_at: string // date-time\n }>\n visibility_timeout_seconds: number\n has_more: boolean\n}\n```\n\n### `AckOutboundMessagesRequest`\n\n```ts\ntype AckOutboundMessagesRequest = {\n acks: Array<{\n id: string\n lease_token: string\n }>\n}\n```\n\n### `AckResult`\n\n```ts\ntype AckResult = {\n id: string\n status: \"accepted\" | \"rejected\"\n reason?: \"stale_lease\" | \"out_of_order\" | \"not_found\"\n}\n```\n\n### `AckOutboundMessagesResponse`\n\n```ts\ntype AckOutboundMessagesResponse = {\n results: Array<{\n id: string\n status: \"accepted\" | \"rejected\"\n reason?: \"stale_lease\" | \"out_of_order\" | \"not_found\"\n }>\n}\n```\n\n### `OutboundDlqMessage`\n\n```ts\ntype OutboundDlqMessage = {\n id: string\n use_case_id: string\n event_name: string\n event_id: string\n enqueued_at?: string // date-time\n dead_lettered_at: string // date-time\n delivery_attempts: number\n reason?: string\n expires_at?: string // date-time\n}\n```\n\n### `OutboundDlqListResponse`\n\n```ts\ntype OutboundDlqListResponse = {\n items: Array<{\n id: string\n use_case_id: string\n event_name: string\n event_id: string\n enqueued_at?: string // date-time\n dead_lettered_at: string // date-time\n delivery_attempts: number\n reason?: string\n expires_at?: string // date-time\n }>\n next_token?: string\n}\n```\n\n### `RedriveOutboundDlqRequest`\n\n```ts\ntype RedriveOutboundDlqRequest = {\n ids: string[]\n}\n```\n\n### `RedriveOutboundDlqResult`\n\n```ts\ntype RedriveOutboundDlqResult = {\n id: string\n status: \"redriven\" | \"not_found\"\n}\n```\n\n### `RedriveOutboundDlqResponse`\n\n```ts\ntype RedriveOutboundDlqResponse = {\n results: Array<{\n id: string\n status: \"redriven\" | \"not_found\"\n }>\n}\n```\n\n### `UnblockOutboundStreamRequest`\n\n```ts\ntype UnblockOutboundStreamRequest = {\n reason?: string\n}\n```\n\n### `UnblockOutboundStreamResponse`\n\n```ts\ntype UnblockOutboundStreamResponse = {\n unblocked: boolean\n dead_lettered_id?: string\n}\n```\n\n### `RelationConfig`\n\n```ts\ntype RelationConfig = {\n operation: \"_set\" | \"_append\" | \"_append_all\"\n items?: Array<{\n entity_schema: string\n _tags?: string[]\n unique_ids: Array<{\n attribute: { ... }\n _type?: { ... }\n field?: { ... }\n jsonataExpression?: { ... }\n constant?: { ... }\n }>\n }>\n jsonataExpression?: string\n}\n```\n\n### `RelationItemConfig`\n\n```ts\ntype RelationItemConfig = {\n entity_schema: string\n _tags?: string[]\n unique_ids: Array<{\n attribute: string\n _type?: \"email\" | \"phone\"\n field?: string\n jsonataExpression?: string\n constant?: unknown\n }>\n}\n```\n\n### `RelationUniqueIdField`\n\n```ts\ntype RelationUniqueIdField = {\n attribute: string\n _type?: \"email\" | \"phone\"\n field?: string\n jsonataExpression?: string\n constant?: unknown\n}\n```\n\n### `RelationRefsConfig`\n\nConfiguration for relation references ($relation_ref).\nRelation references link to a specific item within a repeatable attribute on a related entity.\nCommon use case: referencing a specific address within a contact's address list.\n\n\n```ts\ntype RelationRefsConfig = {\n operation: \"_set\" | \"_append\" | \"_append_all\"\n items?: Array<{\n entity_schema: string\n unique_ids: Array<{\n attribute: { ... }\n _type?: { ... }\n field?: { ... }\n jsonataExpression?: { ... }\n constant?: { ... }\n }>\n path: string\n value: {\n attribute: { ... }\n operation?: { ... }\n field?: { ... }\n jsonataExpression?: { ... }\n constant?: { ... }\n }\n }>\n jsonataExpression?: string\n}\n```\n\n### `RelationRefItemConfig`\n\nConfiguration for a single relation reference item\n\n```ts\ntype RelationRefItemConfig = {\n entity_schema: string\n unique_ids: Array<{\n attribute: string\n _type?: \"email\" | \"phone\"\n field?: string\n jsonataExpression?: string\n constant?: unknown\n }>\n path: string\n value: {\n attribute: string\n operation?: \"_set\" | \"_append\" | \"_append_all\"\n field?: string\n jsonataExpression?: string\n constant?: unknown\n }\n}\n```\n\n### `RelationRefValueConfig`\n\nConfiguration for the value to set on the related entity's attribute\n\n```ts\ntype RelationRefValueConfig = {\n attribute: string\n operation?: \"_set\" | \"_append\" | \"_append_all\"\n field?: string\n jsonataExpression?: string\n constant?: unknown\n}\n```\n\n### `RepeatableFieldType`\n\nType hint for repeatable fields that require special search handling.\nThese fields are stored as arrays of objects (e.g., email: [{ email: \"value\" }]).\n\n\n```ts\ntype RepeatableFieldType = \"email\" | \"phone\"\n```\n\n### `ReplayEventsRequest`\n\n```ts\ntype ReplayEventsRequest = {\n event_ids: string[]\n}\n```\n\n### `QueryEventsRequest`\n\n```ts\ntype QueryEventsRequest = {\n event_id?: string\n event_type?: \"CREATE\" | \"UPDATE\" | \"DELETE\"\n correlation_id?: string\n object_type?: string\n event_name?: string\n use_case_id?: string\n limit?: number\n cursor?: {\n event_time?: string // date-time\n event_id?: string\n }\n}\n```\n\n### `QueryInboundMonitoringEventsRequest`\n\n```ts\ntype QueryInboundMonitoringEventsRequest = {\n use_case_id?: string // uuid\n event_type?: \"CREATE\" | \"UPDATE\" | \"DELETE\" | \"TRIGGER\"\n sync_type?: \"entity\" | \"meter_reading\" | \"webhook\" | \"api_deprecation\"\n status?: \"success\" | \"error\" | \"skipped\" | \"warning\"\n error_category?: \"validation\" | \"configuration\" | \"downstream_api\" | \"timeout\" | \"system\"\n correlation_id?: string\n object_type?: string\n event_name?: string\n event_id?: string\n from_date?: string // date-time\n to_date?: string // date-time\n limit?: number\n cursor?: {\n completed_at?: string // date-time\n event_id?: string\n }\n}\n```\n\n### `QueryAccessLogsRequest`\n\n```ts\ntype QueryAccessLogsRequest = {\n token_id?: string\n service?: string\n method?: \"GET\" | \"POST\" | \"PUT\" | \"PATCH\" | \"DELETE\" | \"OPTIONS\" | \"HEAD\"\n path?: string\n status?: number\n from_date?: string // date-time\n to_date?: string // date-time\n limit?: number\n cursor?: {\n timestamp?: string // date-time\n request_id?: string\n }\n}\n```\n\n### `AccessLogEntry`\n\n```ts\ntype AccessLogEntry = {\n timestamp?: string // date-time\n environment?: string\n service?: string\n request_id?: string\n method?: string\n path?: string\n status?: number\n response_latency_ms?: number\n response_length?: number\n token_id?: string\n org_id?: string\n origin?: string\n source_ip?: string\n}\n```\n\n### `GetMonitoringStatsRequest`\n\n```ts\ntype GetMonitoringStatsRequest = {\n from_date?: string // date-time\n to_date?: string // date-time\n inbound_group_by?: \"use_case_id\" | \"sync_type\" | \"status\" | \"error_category\" | \"object_type\" | \"event_name\" | \"date\"[]\n outbound_group_by?: \"event_name\" | \"status\" | \"webhook_config_id\" | \"date\"[]\n}\n```\n\n### `GetMonitoringTimeSeriesRequest`\n\n```ts\ntype GetMonitoringTimeSeriesRequest = {\n from_date: string // date-time\n to_date?: string // date-time\n interval: \"5m\" | \"10m\" | \"30m\" | \"1h\" | \"3h\" | \"1d\"\n direction?: \"inbound\" | \"outbound\" | \"both\"\n}\n```\n\n### `TimeSeriesBucket`\n\n```ts\ntype TimeSeriesBucket = {\n timestamp: string // date-time\n inbound?: {\n success_count?: number\n error_count?: number\n warning_count?: number\n skipped_count?: number\n total_count?: number\n }\n outbound?: {\n success_count?: number\n error_count?: number\n pending_count?: number\n total_count?: number\n }\n}\n```\n\n### `QueryOutboundMonitoringEventsRequest`\n\n```ts\ntype QueryOutboundMonitoringEventsRequest = {\n event_name?: string\n status?: \"succeeded\" | \"failed\" | \"pending\"\n webhook_config_id?: string\n from_date?: string // date-time\n to_date?: string // date-time\n limit?: number\n cursor?: {\n created_at?: string // date-time\n event_id?: string\n }\n}\n```\n\n### `OutboundMonitoringEvent`\n\n```ts\ntype OutboundMonitoringEvent = {\n org_id: string\n event_id: string\n event_name: string\n status: \"succeeded\" | \"failed\" | \"pending\"\n url?: string\n http_method?: string\n http_response?: Record\n webhook_config_id?: string\n metadata?: Record\n execution_context?: Record\n payload?: Record\n created_at: string // date-time\n updated_at?: string // date-time\n}\n```\n\n### `MonitoringStats`\n\n```ts\ntype MonitoringStats = {\n inbound: {\n total_events: number\n total_correlations?: number\n success_count: number\n error_count: number\n skipped_count: number\n warning_count?: number\n success_rate?: number\n last_error_at?: string // date-time\n breakdown?: Record[]\n }\n outbound: {\n total_events: number\n success_count: number\n error_count: number\n pending_count?: number\n success_rate?: number\n last_error_at?: string // date-time\n breakdown?: Record[]\n }\n}\n```\n\n### `InboundMonitoringEvent`\n\n```ts\ntype InboundMonitoringEvent = {\n org_id: string\n event_id: string\n correlation_id?: string\n integration_id?: string\n use_case_id?: string\n event_type?: \"CREATE\" | \"UPDATE\" | \"DELETE\" | \"TRIGGER\"\n object_type: string\n sync_type: \"entity\" | \"meter_reading\" | \"webhook\" | \"api_deprecation\"\n status: \"success\" | \"error\" | \"skipped\" | \"warning\"\n error_code?: string\n error_message?: string\n error_category?: \"validation\" | \"configuration\" | \"downstream_api\" | \"timeout\" | \"system\"\n processing_duration_ms?: number\n received_at: string // date-time\n completed_at: string // date-time\n}\n```\n\n### `QueryMonitoringEventsV2Request`\n\n```ts\ntype QueryMonitoringEventsV2Request = {\n use_case_id?: string\n use_case_type?: \"inbound\" | \"outbound\" | \"file_proxy\" | \"managed_call\" | \"secure_proxy\"\n level?: \"success\" | \"error\" | \"skipped\" | \"warning\"\n code?: string\n event_id?: string\n correlation_id?: string\n from_date?: string // date-time\n to_date?: string // date-time\n limit?: number\n cursor?: {\n created_at?: string // date-time\n id?: string // uuid\n }\n}\n```\n\n### `ExternalMonitoringSpan`\n\nA single monitoring span produced by an external system. `correlation_id`, `level`, `use_case_slug`, `occurred_at` and `message` are all required and `level` must be one of success|error|warning|info — but these are validated PER SPAN at ingest and reported in the per-item `results[]`, so one malfor\n\n```ts\ntype ExternalMonitoringSpan = {\n correlation_id?: string\n level?: string\n use_case_slug?: string\n occurred_at?: string // date-time\n message?: string\n detail?: Record\n}\n```\n\n### `IngestExternalMonitoringEventsRequest`\n\n```ts\ntype IngestExternalMonitoringEventsRequest = {\n events: Array<{\n correlation_id?: string\n level?: string\n use_case_slug?: string\n occurred_at?: string // date-time\n message?: string\n detail?: Record\n }>\n}\n```\n\n### `IngestExternalMonitoringEventsResponse`\n\n```ts\ntype IngestExternalMonitoringEventsResponse = {\n accepted: number\n rejected: number\n results?: Array<{\n index: number\n status: \"accepted\" | \"rejected\"\n reason?: string\n }>\n}\n```\n\n### `MonitoringTraceResponse`\n\n```ts\ntype MonitoringTraceResponse = {\n correlation_id: string\n status: \"success\" | \"error\" | \"warning\" | \"info\"\n started_at?: string // date-time\n ended_at?: string // date-time\n span_count: number\n truncated: boolean\n spans: Array<{\n id: string // uuid\n org_id: string\n integration_id: string\n event_id: string\n correlation_id?: string\n use_case_id?: string\n use_case_type: \"inbound\" | \"outbound\" | \"file_proxy\" | \"managed_call\" | \"secure_proxy\" | \"\"\n level: \"success\" | \"error\" | \"skipped\" | \"warning\"\n code?: string\n message?: string\n detail?: Record\n created_at: string // date-time\n }>\n inbound_event?: Record\n}\n```\n\n### `MonitoringEventV2`\n\n```ts\ntype MonitoringEventV2 = {\n id: string // uuid\n org_id: string\n integration_id: string\n event_id: string\n correlation_id?: string\n use_case_id?: string\n use_case_type: \"inbound\" | \"outbound\" | \"file_proxy\" | \"managed_call\" | \"secure_proxy\" | \"\"\n level: \"success\" | \"error\" | \"skipped\" | \"warning\"\n code?: string\n message?: string\n detail?: Record\n created_at: string // date-time\n}\n```\n\n### `GetMonitoringStatsV2Request`\n\n```ts\ntype GetMonitoringStatsV2Request = {\n from_date?: string // date-time\n to_date?: string // date-time\n use_case_type?: \"inbound\" | \"outbound\" | \"file_proxy\" | \"managed_call\" | \"secure_proxy\"\n use_case_types?: \"inbound\" | \"outbound\" | \"file_proxy\" | \"managed_call\" | \"secure_proxy\"[]\n group_by?: \"use_case_id\" | \"use_case_type\" | \"level\" | \"code\" | \"date\"\n source?: \"monitoring\" | \"incoming\"\n}\n```\n\n### `MonitoringStatsV2`\n\n```ts\ntype MonitoringStatsV2 = {\n total_events: number\n success_count: number\n error_count: number\n warning_count: number\n skipped_count: number\n ack_timeout_count?: number\n success_rate?: number\n last_error_at?: string // date-time\n breakdown?: Record[]\n}\n```\n\n### `GetMonitoringTimeSeriesV2Request`\n\n```ts\ntype GetMonitoringTimeSeriesV2Request = {\n from_date: string // date-time\n to_date?: string // date-time\n interval: \"5m\" | \"10m\" | \"30m\" | \"1h\" | \"3h\" | \"1d\"\n use_case_type?: \"inbound\" | \"outbound\" | \"file_proxy\" | \"managed_call\" | \"secure_proxy\"\n group_by?: \"use_case_type\" | \"use_case\"\n}\n```\n\n### `TimeSeriesBreakdownItemV2`\n\n```ts\ntype TimeSeriesBreakdownItemV2 = {\n use_case_type?: \"inbound\" | \"outbound\" | \"file_proxy\" | \"managed_call\" | \"secure_proxy\"\n use_case_id?: string\n success_count: number\n error_count: number\n warning_count: number\n skipped_count: number\n total_count: number\n}\n```\n\n### `TimeSeriesBucketV2`\n\n```ts\ntype TimeSeriesBucketV2 = {\n timestamp: string // date-time\n success_count?: number\n error_count?: number\n warning_count?: number\n skipped_count?: number\n total_count: number\n breakdown?: Array<{\n use_case_type?: \"inbound\" | \"outbound\" | \"file_proxy\" | \"managed_call\" | \"secure_proxy\"\n use_case_id?: string\n success_count: number\n error_count: number\n warning_count: number\n skipped_count: number\n total_count: number\n }>\n}\n```\n" +"# Integration Toolkit API\n\n- **Base URL:** `https://integration-toolkit.sls.epilot.io`\n- **Full API Docs:** [https://docs.epilot.io/api/integration-toolkit](https://docs.epilot.io/api/integration-toolkit)\n\n## Usage\n\n```ts\nimport { epilot } from '@epilot/sdk'\n\nepilot.authorize(() => '')\nconst { data } = await epilot.integrationToolkit.acknowledgeTracking(...)\n```\n\n### Tree-shakeable import\n\n```ts\nimport { getClient, authorize } from '@epilot/sdk/integration-toolkit'\n\nconst integrationToolkitClient = getClient()\nauthorize(integrationToolkitClient, () => '')\nconst { data } = await integrationToolkitClient.acknowledgeTracking(...)\n```\n\n## Operations\n\n**erp**\n- [`acknowledgeTracking`](#acknowledgetracking)\n- [`triggerErp`](#triggererp)\n- [`processErpUpdatesEventsV3`](#processerpupdateseventsv3)\n- [`simulateMappingV2`](#simulatemappingv2)\n- [`simulateMapping`](#simulatemapping)\n\n**integrations**\n- [`listIntegrations`](#listintegrations)\n- [`createIntegration`](#createintegration)\n- [`getIntegration`](#getintegration)\n- [`updateIntegration`](#updateintegration)\n- [`deleteIntegration`](#deleteintegration)\n- [`queryEvents`](#queryevents)\n- [`replayEvents`](#replayevents)\n- [`listUseCases`](#listusecases)\n- [`createUseCase`](#createusecase)\n- [`getUseCase`](#getusecase)\n- [`updateUseCase`](#updateusecase)\n- [`deleteUseCase`](#deleteusecase)\n- [`listUseCaseHistory`](#listusecasehistory)\n- [`listIntegrationsV2`](#listintegrationsv2)\n- [`createIntegrationV2`](#createintegrationv2)\n- [`getIntegrationV2`](#getintegrationv2)\n- [`updateIntegrationV2`](#updateintegrationv2)\n- [`deleteIntegrationV2`](#deleteintegrationv2)\n- [`listNotificationHistory`](#listnotificationhistory)\n- [`testSendNotification`](#testsendnotification)\n- [`getNotificationStatus`](#getnotificationstatus)\n- [`getSecureProxyWhitelist`](#getsecureproxywhitelist)\n- [`updateSecureProxyWhitelist`](#updatesecureproxywhitelist)\n- [`listSecureProxyWhitelistHistory`](#listsecureproxywhitelisthistory)\n- [`setIntegrationAppMapping`](#setintegrationappmapping)\n- [`deleteIntegrationAppMapping`](#deleteintegrationappmapping)\n- [`getOutboundStatus`](#getoutboundstatus)\n- [`pollOutboundMessages`](#polloutboundmessages)\n- [`ackOutboundMessages`](#ackoutboundmessages)\n- [`listOutboundDlqMessages`](#listoutbounddlqmessages)\n- [`redriveOutboundDlqMessages`](#redriveoutbounddlqmessages)\n- [`unblockOutboundStream`](#unblockoutboundstream)\n- [`listSecureProxies`](#listsecureproxies)\n- [`generateTypesPreview`](#generatetypespreview)\n- [`generateTypes`](#generatetypes)\n- [`commitTypes`](#committypes)\n\n**monitoring**\n- [`queryInboundMonitoringEvents`](#queryinboundmonitoringevents)\n- [`getMonitoringStats`](#getmonitoringstats)\n- [`getMonitoringTimeSeries`](#getmonitoringtimeseries)\n- [`queryAccessLogs`](#queryaccesslogs)\n- [`queryOutboundMonitoringEvents`](#queryoutboundmonitoringevents)\n- [`queryMonitoringEventsV2`](#querymonitoringeventsv2)\n- [`getMonitoringStatsV2`](#getmonitoringstatsv2)\n- [`getMonitoringTimeSeriesV2`](#getmonitoringtimeseriesv2)\n- [`getAssociatedMonitoringEvents`](#getassociatedmonitoringevents)\n- [`ingestExternalMonitoringEvents`](#ingestexternalmonitoringevents)\n- [`getMonitoringTraceByCorrelation`](#getmonitoringtracebycorrelation)\n\n**proxy**\n- [`secureProxy`](#secureproxy)\n\n**managed-call**\n- [`managedCallExecute`](#managedcallexecute)\n\n**erp-imports**\n- [`createErpImport`](#createerpimport)\n- [`listErpImports`](#listerpimports)\n- [`getErpImport`](#geterpimport)\n- [`executeErpImport`](#executeerpimport)\n- [`abortErpImport`](#aborterpimport)\n\n**Schemas**\n- [`S3Reference`](#s3reference)\n- [`CreateErpImportRequest`](#createerpimportrequest)\n- [`ErpImportValidation`](#erpimportvalidation)\n- [`ErpImportProgress`](#erpimportprogress)\n- [`ErpImportError`](#erpimporterror)\n- [`CreateErpImportResponse`](#createerpimportresponse)\n- [`ErpImportJob`](#erpimportjob)\n- [`ErpImportList`](#erpimportlist)\n- [`NotificationHistoryItem`](#notificationhistoryitem)\n- [`NotificationHistoryResponse`](#notificationhistoryresponse)\n- [`TestNotificationRequest`](#testnotificationrequest)\n- [`TestNotificationResponse`](#testnotificationresponse)\n- [`NotificationStatusResponse`](#notificationstatusresponse)\n- [`NotificationRuleStatus`](#notificationrulestatus)\n- [`RuleBaselineStatus`](#rulebaselinestatus)\n- [`RuleBaselineBucket`](#rulebaselinebucket)\n- [`ErrorResponseBase`](#errorresponsebase)\n- [`ErpEvent`](#erpevent)\n- [`ErpUpdatesEventsV2Request`](#erpupdateseventsv2request)\n- [`ErpEventV3`](#erpeventv3)\n- [`ErpUpdatesEventsV3Request`](#erpupdateseventsv3request)\n- [`TriggerErpActionRequest`](#triggererpactionrequest)\n- [`TriggerWebhookResp`](#triggerwebhookresp)\n- [`IntegrationEditableFields`](#integrationeditablefields)\n- [`ConnectorConfig`](#connectorconfig)\n- [`ManagedCallAuth`](#managedcallauth)\n- [`Integration`](#integration)\n- [`CreateIntegrationRequest`](#createintegrationrequest)\n- [`UpdateIntegrationRequest`](#updateintegrationrequest)\n- [`EnvironmentFieldConfig`](#environmentfieldconfig)\n- [`IntegrationSettings`](#integrationsettings)\n- [`AutoRefreshSettings`](#autorefreshsettings)\n- [`IntegrationNotificationConfig`](#integrationnotificationconfig)\n- [`NotificationRecipient`](#notificationrecipient)\n- [`NotificationChannelSet`](#notificationchannelset)\n- [`NotificationRule`](#notificationrule)\n- [`NotificationDigestConfig`](#notificationdigestconfig)\n- [`SetIntegrationAppMappingRequest`](#setintegrationappmappingrequest)\n- [`DeleteIntegrationAppMappingRequest`](#deleteintegrationappmappingrequest)\n- [`IntegrationAppMapping`](#integrationappmapping)\n- [`IntegrationWithUseCases`](#integrationwithusecases)\n- [`UpsertIntegrationWithUseCasesRequest`](#upsertintegrationwithusecasesrequest)\n- [`InboundIntegrationEventConfiguration`](#inboundintegrationeventconfiguration)\n- [`OutboundIntegrationEventConfiguration`](#outboundintegrationeventconfiguration)\n- [`IntegrationEntity`](#integrationentity)\n- [`IntegrationMeterReading`](#integrationmeterreading)\n- [`PruneScopeConfig`](#prunescopeconfig)\n- [`MeterReadingPruneScopeConfig`](#meterreadingprunescopeconfig)\n- [`MeterUniqueIdsConfig`](#meteruniqueidsconfig)\n- [`IntegrationEntityField`](#integrationentityfield)\n- [`FileProxyUrlParam`](#fileproxyurlparam)\n- [`FileProxyUrlParams`](#fileproxyurlparams)\n- [`FileProxyUrlConfig`](#fileproxyurlconfig)\n- [`PortalOrigin`](#portalorigin)\n- [`PortalRefFilter`](#portalreffilter)\n- [`PortalRefConfig`](#portalrefconfig)\n- [`EnvVarRefConfig`](#envvarrefconfig)\n- [`EmbeddedUseCaseRequest`](#embeddedusecaserequest)\n- [`EmbeddedUseCaseRequestBase`](#embeddedusecaserequestbase)\n- [`EmbeddedInboundUseCaseRequest`](#embeddedinboundusecaserequest)\n- [`EmbeddedOutboundUseCaseRequest`](#embeddedoutboundusecaserequest)\n- [`EmbeddedFileProxyUseCaseRequest`](#embeddedfileproxyusecaserequest)\n- [`EmbeddedManagedCallUseCaseRequest`](#embeddedmanagedcallusecaserequest)\n- [`EmbeddedSecureProxyUseCaseRequest`](#embeddedsecureproxyusecaserequest)\n- [`UseCaseBase`](#usecasebase)\n- [`InboundUseCase`](#inboundusecase)\n- [`OutboundUseCase`](#outboundusecase)\n- [`FileProxyUseCase`](#fileproxyusecase)\n- [`ManagedCallUseCase`](#managedcallusecase)\n- [`SecureProxyUseCase`](#secureproxyusecase)\n- [`UseCase`](#usecase)\n- [`CreateUseCaseRequest`](#createusecaserequest)\n- [`CreateUseCaseRequestBase`](#createusecaserequestbase)\n- [`CreateInboundUseCaseRequest`](#createinboundusecaserequest)\n- [`CreateOutboundUseCaseRequest`](#createoutboundusecaserequest)\n- [`CreateFileProxyUseCaseRequest`](#createfileproxyusecaserequest)\n- [`CreateManagedCallUseCaseRequest`](#createmanagedcallusecaserequest)\n- [`CreateSecureProxyUseCaseRequest`](#createsecureproxyusecaserequest)\n- [`UpdateUseCaseRequest`](#updateusecaserequest)\n- [`UpdateUseCaseRequestBase`](#updateusecaserequestbase)\n- [`UpdateInboundUseCaseRequest`](#updateinboundusecaserequest)\n- [`UpdateOutboundUseCaseRequest`](#updateoutboundusecaserequest)\n- [`UpdateFileProxyUseCaseRequest`](#updatefileproxyusecaserequest)\n- [`UpdateManagedCallUseCaseRequest`](#updatemanagedcallusecaserequest)\n- [`UpdateSecureProxyUseCaseRequest`](#updatesecureproxyusecaserequest)\n- [`UseCaseHistoryEntry`](#usecasehistoryentry)\n- [`UseCaseHistoryEntryBase`](#usecasehistoryentrybase)\n- [`InboundUseCaseHistoryEntry`](#inboundusecasehistoryentry)\n- [`OutboundUseCaseHistoryEntry`](#outboundusecasehistoryentry)\n- [`FileProxyUseCaseHistoryEntry`](#fileproxyusecasehistoryentry)\n- [`ManagedCallUseCaseHistoryEntry`](#managedcallusecasehistoryentry)\n- [`SecureProxyUseCaseHistoryEntry`](#secureproxyusecasehistoryentry)\n- [`SecureProxyUseCaseConfiguration`](#secureproxyusecaseconfiguration)\n- [`SecureProxyWhitelist`](#secureproxywhitelist)\n- [`SecureProxyWhitelistUpdate`](#secureproxywhitelistupdate)\n- [`SecureProxySummary`](#secureproxysummary)\n- [`SecureProxyRequest`](#secureproxyrequest)\n- [`SecureProxyResponse`](#secureproxyresponse)\n- [`SecureProxyUpstreamError`](#secureproxyupstreamerror)\n- [`ManagedCallOperationConfig`](#managedcalloperationconfig)\n- [`ManagedCallOperation`](#managedcalloperation)\n- [`ManagedCallExecuteRequest`](#managedcallexecuterequest)\n- [`ManagedCallExecuteResponse`](#managedcallexecuteresponse)\n- [`ManagedCallErrorResponse`](#managedcallerrorresponse)\n- [`TypeAnnotations`](#typeannotations)\n- [`TypeDescriptor`](#typedescriptor)\n- [`UseCaseTypePreview`](#usecasetypepreview)\n- [`GenerateTypesPreviewResponse`](#generatetypespreviewresponse)\n- [`GenerateTypesRequest`](#generatetypesrequest)\n- [`GenerateTypesResponse`](#generatetypesresponse)\n- [`CommitTypesRequest`](#committypesrequest)\n- [`CommitTypesResponse`](#committypesresponse)\n- [`FileProxyUseCaseConfiguration`](#fileproxyusecaseconfiguration)\n- [`FileProxySecureProxyAttachment`](#fileproxysecureproxyattachment)\n- [`FileProxyAuth`](#fileproxyauth)\n- [`FileProxyParam`](#fileproxyparam)\n- [`FileProxyStep`](#fileproxystep)\n- [`FileProxyResponseConfig`](#fileproxyresponseconfig)\n- [`MappingSimulationRequest`](#mappingsimulationrequest)\n- [`MappingSimulationV2Request`](#mappingsimulationv2request)\n- [`MappingSimulationResponse`](#mappingsimulationresponse)\n- [`MappingSimulationWarning`](#mappingsimulationwarning)\n- [`EntityUpdate`](#entityupdate)\n- [`MeterReadingUpdate`](#meterreadingupdate)\n- [`IntegrationConfigurationV1`](#integrationconfigurationv1)\n- [`IntegrationObjectV1`](#integrationobjectv1)\n- [`IntegrationFieldV1`](#integrationfieldv1)\n- [`IntegrationConfigurationV2`](#integrationconfigurationv2)\n- [`OutboundMapping`](#outboundmapping)\n- [`DeliveryConfig`](#deliveryconfig)\n- [`WebhookDeliveryConfig`](#webhookdeliveryconfig)\n- [`PollDeliveryConfig`](#polldeliveryconfig)\n- [`OutboundStatusResponse`](#outboundstatusresponse)\n- [`OutboundUseCaseStatus`](#outboundusecasestatus)\n- [`OutboundPollStatus`](#outboundpollstatus)\n- [`WebhookStatus`](#webhookstatus)\n- [`OutboundConflict`](#outboundconflict)\n- [`PollOutboundMessagesRequest`](#polloutboundmessagesrequest)\n- [`OutboundMessage`](#outboundmessage)\n- [`PollOutboundMessagesResponse`](#polloutboundmessagesresponse)\n- [`AckOutboundMessagesRequest`](#ackoutboundmessagesrequest)\n- [`AckResult`](#ackresult)\n- [`AckOutboundMessagesResponse`](#ackoutboundmessagesresponse)\n- [`OutboundDlqMessage`](#outbounddlqmessage)\n- [`OutboundDlqListResponse`](#outbounddlqlistresponse)\n- [`RedriveOutboundDlqRequest`](#redriveoutbounddlqrequest)\n- [`RedriveOutboundDlqResult`](#redriveoutbounddlqresult)\n- [`RedriveOutboundDlqResponse`](#redriveoutbounddlqresponse)\n- [`UnblockOutboundStreamRequest`](#unblockoutboundstreamrequest)\n- [`UnblockOutboundStreamResponse`](#unblockoutboundstreamresponse)\n- [`RelationConfig`](#relationconfig)\n- [`RelationItemConfig`](#relationitemconfig)\n- [`RelationUniqueIdField`](#relationuniqueidfield)\n- [`RelationRefsConfig`](#relationrefsconfig)\n- [`RelationRefItemConfig`](#relationrefitemconfig)\n- [`RelationRefValueConfig`](#relationrefvalueconfig)\n- [`RepeatableFieldType`](#repeatablefieldtype)\n- [`ReplayEventsRequest`](#replayeventsrequest)\n- [`QueryEventsRequest`](#queryeventsrequest)\n- [`QueryInboundMonitoringEventsRequest`](#queryinboundmonitoringeventsrequest)\n- [`QueryAccessLogsRequest`](#queryaccesslogsrequest)\n- [`AccessLogEntry`](#accesslogentry)\n- [`GetMonitoringStatsRequest`](#getmonitoringstatsrequest)\n- [`GetMonitoringTimeSeriesRequest`](#getmonitoringtimeseriesrequest)\n- [`TimeSeriesBucket`](#timeseriesbucket)\n- [`QueryOutboundMonitoringEventsRequest`](#queryoutboundmonitoringeventsrequest)\n- [`OutboundMonitoringEvent`](#outboundmonitoringevent)\n- [`MonitoringStats`](#monitoringstats)\n- [`InboundMonitoringEvent`](#inboundmonitoringevent)\n- [`QueryMonitoringEventsV2Request`](#querymonitoringeventsv2request)\n- [`ExternalMonitoringSpan`](#externalmonitoringspan)\n- [`IngestExternalMonitoringEventsRequest`](#ingestexternalmonitoringeventsrequest)\n- [`IngestExternalMonitoringEventsResponse`](#ingestexternalmonitoringeventsresponse)\n- [`MonitoringTraceResponse`](#monitoringtraceresponse)\n- [`MonitoringEventV2`](#monitoringeventv2)\n- [`GetMonitoringStatsV2Request`](#getmonitoringstatsv2request)\n- [`MonitoringStatsV2`](#monitoringstatsv2)\n- [`GetMonitoringTimeSeriesV2Request`](#getmonitoringtimeseriesv2request)\n- [`TimeSeriesBreakdownItemV2`](#timeseriesbreakdownitemv2)\n- [`TimeSeriesBucketV2`](#timeseriesbucketv2)\n\n### `acknowledgeTracking`\n\nAcknowledges an ERP tracking record by removing it from the tracking table, requires public authentication\n\n`POST /v1/erp/tracking/acknowledgement`\n\n```ts\nconst { data } = await client.acknowledgeTracking(\n null,\n {\n ack_id: 'string'\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"message\": \"string\"\n}\n```\n\n
\n\n---\n\n### `triggerErp`\n\nTriggers the ERP integration process\n\n`POST /v1/erp/trigger`\n\n```ts\nconst { data } = await client.triggerErp(\n null,\n {\n execution_id: 'string',\n org_id: 'string',\n webhook_id: 'string',\n flow_id: 'string',\n created_at: '1970-01-01T00:00:00.000Z',\n action_id: 'string',\n flow_action_id: 'string',\n flow_name: 'string',\n activity_id: 'string',\n entity_id: 'string'\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"status_code\": \"string\",\n \"message\": \"string\",\n \"body\": {},\n \"code\": \"string\",\n \"status\": \"succeeded\",\n \"start_date\": \"string\",\n \"end_date\": \"string\",\n \"event_id\": \"string\"\n}\n```\n\n
\n\n---\n\n### `processErpUpdatesEventsV3`\n\nHandles updates from ERP systems using integration_id directly.\nThis is the v3 version that removes the unused event_type field and renames object_type to event_name\nto align with the integration UI n\n\n`POST /v3/erp/updates/events`\n\n```ts\nconst { data } = await client.processErpUpdatesEventsV3(\n null,\n {\n integration_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',\n correlation_id: 'string',\n group_id: 'customer-42',\n events: [\n {},\n {}\n ]\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"results\": [\n {\n \"event_id\": \"string\",\n \"status\": \"success\",\n \"message\": \"string\"\n }\n ]\n}\n```\n\n
\n\n---\n\n### `simulateMappingV2`\n\nTest v2.0 mapping configuration by transforming a payload using the provided mapping rules without persisting data.\n\n`POST /v2/erp/updates/mapping_simulation`\n\n```ts\nconst { data } = await client.simulateMappingV2(\n null,\n {\n event_configuration: {\n entities: [\n { /* ... */ }\n ],\n meter_readings: [\n { /* ... */ }\n ]\n },\n format: 'json',\n payload: 'string'\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"entity_updates\": [\n {\n \"entity_slug\": \"string\",\n \"unique_identifiers\": {},\n \"attributes\": {}\n }\n ],\n \"meter_readings_updates\": [\n {\n \"meter\": {\n \"$entity_unique_ids\": {}\n },\n \"meter_counter\": {\n \"$entity_unique_ids\": {}\n },\n \"attributes\": {}\n }\n ],\n \"warnings\": [\n {\n \"entity_schema\": \"string\",\n \"field\": \"string\",\n \"message\": \"string\"\n }\n ]\n}\n```\n\n
\n\n---\n\n### `simulateMapping`\n\nTest mapping configuration by transforming a payload using the provided mapping rules without persisting data.\n\n`POST /v1/erp/updates/mapping_simulation`\n\n```ts\nconst { data } = await client.simulateMapping(\n null,\n {\n mapping_configuration: {\n version: '1.0',\n mapping: {\n objects: {}\n }\n },\n object_type: 'string',\n format: 'json',\n payload: 'string'\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"entity_updates\": [\n {\n \"entity_slug\": \"string\",\n \"unique_identifiers\": {},\n \"attributes\": {}\n }\n ],\n \"meter_readings_updates\": [\n {\n \"meter\": {\n \"$entity_unique_ids\": {}\n },\n \"meter_counter\": {\n \"$entity_unique_ids\": {}\n },\n \"attributes\": {}\n }\n ],\n \"warnings\": [\n {\n \"entity_schema\": \"string\",\n \"field\": \"string\",\n \"message\": \"string\"\n }\n ]\n}\n```\n\n
\n\n---\n\n### `listIntegrations`\n\nRetrieve all integrations for the authenticated organization\n\n`GET /v1/integrations`\n\n```ts\nconst { data } = await client.listIntegrations()\n```\n\n
\nResponse\n\n```json\n{\n \"integrations\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"orgId\": \"string\",\n \"created_at\": \"1970-01-01T00:00:00.000Z\",\n \"updated_at\": \"1970-01-01T00:00:00.000Z\",\n \"name\": \"string\",\n \"description\": \"string\",\n \"access_token_ids\": [\"string\"],\n \"app_ids\": [\"string\"],\n \"environment_config\": [],\n \"settings\": {},\n \"integration_type\": \"erp\",\n \"connector_config\": {},\n \"protected\": true,\n \"_manifest\": [\"string\"]\n }\n ]\n}\n```\n\n
\n\n---\n\n### `createIntegration`\n\nCreate a new integration configuration\n\n`POST /v1/integrations`\n\n```ts\nconst { data } = await client.createIntegration(\n null,\n {\n name: 'string',\n description: 'string',\n access_token_ids: ['string'],\n app_ids: ['string'],\n environment_config: [\n {\n key: 'string',\n label: 'string',\n type: 'String',\n description: 'string',\n required: false,\n order: 0\n }\n ],\n settings: {\n autoRefresh: {\n enabled: false,\n freshnessThresholdMinutes: 1\n },\n notifications: {\n enabled: true,\n recipients: [ /* ... */ ],\n defaultChannels: { /* ... */ },\n monitoredUseCases: ['string'],\n monitoredCodes: ['string'],\n rules: [ /* ... */ ],\n digest: { /* ... */ },\n muteUntil: '1970-01-01T00:00:00.000Z'\n }\n },\n integration_type: 'erp',\n connector_config: {\n base_url: 'string',\n auth: {\n type: 'oauth2_client_credentials',\n token_url: 'string',\n client_id: 'string',\n client_secret: 'string',\n scope: 'string',\n audience: 'string',\n resource: 'string',\n body_params: {},\n headers: {},\n query_params: {},\n api_key_header: 'string',\n api_key: 'string',\n token: 'string'\n },\n types_versions: [\n { /* ... */ }\n ],\n latest_types_version: 'string',\n latest_types_package_name: 'string'\n },\n protected: true,\n _manifest: ['string']\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"orgId\": \"string\",\n \"created_at\": \"1970-01-01T00:00:00.000Z\",\n \"updated_at\": \"1970-01-01T00:00:00.000Z\",\n \"name\": \"string\",\n \"description\": \"string\",\n \"access_token_ids\": [\"string\"],\n \"app_ids\": [\"string\"],\n \"environment_config\": [\n {\n \"key\": \"string\",\n \"label\": \"string\",\n \"type\": \"String\",\n \"description\": \"string\",\n \"required\": false,\n \"order\": 0\n }\n ],\n \"settings\": {\n \"autoRefresh\": {\n \"enabled\": false,\n \"freshnessThresholdMinutes\": 1\n },\n \"notifications\": {\n \"enabled\": true,\n \"recipients\": [],\n \"defaultChannels\": {},\n \"monitoredUseCases\": [\"string\"],\n \"monitoredCodes\": [\"string\"],\n \"rules\": [],\n \"digest\": {},\n \"muteUntil\": \"1970-01-01T00:00:00.000Z\"\n }\n },\n \"integration_type\": \"erp\",\n \"connector_config\": {\n \"base_url\": \"string\",\n \"auth\": {\n \"type\": \"oauth2_client_credentials\",\n \"token_url\": \"string\",\n \"client_id\": \"string\",\n \"client_secret\": \"string\",\n \"scope\": \"string\",\n \"audience\": \"string\",\n \"resource\": \"string\",\n \"body_params\": {},\n \"headers\": {},\n \"query_params\": {},\n \"api_key_header\": \"string\",\n \"api_key\": \"string\",\n \"token\": \"string\"\n },\n \"types_versions\": [\n {}\n ],\n \"latest_types_version\": \"string\",\n \"latest_types_package_name\": \"string\"\n },\n \"protected\": true,\n \"_manifest\": [\"string\"]\n}\n```\n\n
\n\n---\n\n### `getIntegration`\n\nRetrieve a specific integration by its ID\n\n`GET /v1/integrations/{integrationId}`\n\n```ts\nconst { data } = await client.getIntegration({\n integrationId: 'example',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"orgId\": \"string\",\n \"created_at\": \"1970-01-01T00:00:00.000Z\",\n \"updated_at\": \"1970-01-01T00:00:00.000Z\",\n \"name\": \"string\",\n \"description\": \"string\",\n \"access_token_ids\": [\"string\"],\n \"app_ids\": [\"string\"],\n \"environment_config\": [\n {\n \"key\": \"string\",\n \"label\": \"string\",\n \"type\": \"String\",\n \"description\": \"string\",\n \"required\": false,\n \"order\": 0\n }\n ],\n \"settings\": {\n \"autoRefresh\": {\n \"enabled\": false,\n \"freshnessThresholdMinutes\": 1\n },\n \"notifications\": {\n \"enabled\": true,\n \"recipients\": [],\n \"defaultChannels\": {},\n \"monitoredUseCases\": [\"string\"],\n \"monitoredCodes\": [\"string\"],\n \"rules\": [],\n \"digest\": {},\n \"muteUntil\": \"1970-01-01T00:00:00.000Z\"\n }\n },\n \"integration_type\": \"erp\",\n \"connector_config\": {\n \"base_url\": \"string\",\n \"auth\": {\n \"type\": \"oauth2_client_credentials\",\n \"token_url\": \"string\",\n \"client_id\": \"string\",\n \"client_secret\": \"string\",\n \"scope\": \"string\",\n \"audience\": \"string\",\n \"resource\": \"string\",\n \"body_params\": {},\n \"headers\": {},\n \"query_params\": {},\n \"api_key_header\": \"string\",\n \"api_key\": \"string\",\n \"token\": \"string\"\n },\n \"types_versions\": [\n {}\n ],\n \"latest_types_version\": \"string\",\n \"latest_types_package_name\": \"string\"\n },\n \"protected\": true,\n \"_manifest\": [\"string\"]\n}\n```\n\n
\n\n---\n\n### `updateIntegration`\n\nUpdate an existing integration configuration\n\n`PUT /v1/integrations/{integrationId}`\n\n```ts\nconst { data } = await client.updateIntegration(\n {\n integrationId: 'example',\n },\n {},\n)\n```\n\n
\nResponse\n\n```json\n{\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"orgId\": \"string\",\n \"created_at\": \"1970-01-01T00:00:00.000Z\",\n \"updated_at\": \"1970-01-01T00:00:00.000Z\",\n \"name\": \"string\",\n \"description\": \"string\",\n \"access_token_ids\": [\"string\"],\n \"app_ids\": [\"string\"],\n \"environment_config\": [\n {\n \"key\": \"string\",\n \"label\": \"string\",\n \"type\": \"String\",\n \"description\": \"string\",\n \"required\": false,\n \"order\": 0\n }\n ],\n \"settings\": {\n \"autoRefresh\": {\n \"enabled\": false,\n \"freshnessThresholdMinutes\": 1\n },\n \"notifications\": {\n \"enabled\": true,\n \"recipients\": [],\n \"defaultChannels\": {},\n \"monitoredUseCases\": [\"string\"],\n \"monitoredCodes\": [\"string\"],\n \"rules\": [],\n \"digest\": {},\n \"muteUntil\": \"1970-01-01T00:00:00.000Z\"\n }\n },\n \"integration_type\": \"erp\",\n \"connector_config\": {\n \"base_url\": \"string\",\n \"auth\": {\n \"type\": \"oauth2_client_credentials\",\n \"token_url\": \"string\",\n \"client_id\": \"string\",\n \"client_secret\": \"string\",\n \"scope\": \"string\",\n \"audience\": \"string\",\n \"resource\": \"string\",\n \"body_params\": {},\n \"headers\": {},\n \"query_params\": {},\n \"api_key_header\": \"string\",\n \"api_key\": \"string\",\n \"token\": \"string\"\n },\n \"types_versions\": [\n {}\n ],\n \"latest_types_version\": \"string\",\n \"latest_types_package_name\": \"string\"\n },\n \"protected\": true,\n \"_manifest\": [\"string\"]\n}\n```\n\n
\n\n---\n\n### `deleteIntegration`\n\nDelete an integration and all its use cases\n\n`DELETE /v1/integrations/{integrationId}`\n\n```ts\nconst { data } = await client.deleteIntegration({\n integrationId: 'example',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"message\": \"string\"\n}\n```\n\n
\n\n---\n\n### `queryEvents`\n\nQuery events for a specific integration\n\n`POST /v1/integrations/{integrationId}/events`\n\n```ts\nconst { data } = await client.queryEvents(\n {\n integrationId: 'example',\n },\n {\n event_id: 'string',\n event_type: 'CREATE',\n correlation_id: 'string',\n object_type: 'string',\n event_name: 'string',\n use_case_id: 'string',\n limit: 25,\n cursor: {\n event_time: '2025-10-31T12:34:56Z',\n event_id: 'evt_1234567890abcdef'\n }\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"data\": [\n {\n \"event_type\": \"CREATE\",\n \"object_type\": \"string\",\n \"timestamp\": \"1970-01-01T00:00:00.000Z\",\n \"format\": \"json\",\n \"payload\": \"string\",\n \"deduplication_id\": \"evt-2025-05-01-12345-create-bp\",\n \"correlation_id\": \"bp-8f3a2c-7d4e-4b1a-9c2f-1e6d5a4b3c21\",\n \"use_case_id\": \"string\"\n }\n ],\n \"next_cursor\": {\n \"event_time\": \"2025-10-31T12:34:56Z\",\n \"event_id\": \"evt_1234567890abcdef\"\n },\n \"has_more\": true\n}\n```\n\n
\n\n---\n\n### `replayEvents`\n\nReplay one or more events for a specific integration. Events will be re-processed with their original payloads but with a new correlation ID for traceability.\n\n`POST /v1/integrations/{integrationId}/events/replay`\n\n```ts\nconst { data } = await client.replayEvents(\n {\n integrationId: 'example',\n },\n {\n event_ids: ['string']\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"replayed\": 2,\n \"results\": [\n {\n \"event_id\": \"string\",\n \"status\": \"success\",\n \"replay_event_id\": \"string\",\n \"message\": \"string\"\n }\n ],\n \"event_ids\": [\"string\"]\n}\n```\n\n
\n\n---\n\n### `listUseCases`\n\nRetrieve all use cases for a specific integration\n\n`GET /v1/integrations/{integrationId}/use-cases`\n\n```ts\nconst { data } = await client.listUseCases({\n integrationId: 'example',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"use_cases\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"integrationId\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"name\": \"string\",\n \"slug\": \"string\",\n \"type\": \"inbound\",\n \"enabled\": true,\n \"change_description\": \"string\",\n \"created_at\": \"1970-01-01T00:00:00.000Z\",\n \"updated_at\": \"1970-01-01T00:00:00.000Z\",\n \"configuration\": {}\n }\n ]\n}\n```\n\n
\n\n---\n\n### `createUseCase`\n\nCreate a new use case for an integration\n\n`POST /v1/integrations/{integrationId}/use-cases`\n\n```ts\nconst { data } = await client.createUseCase(\n {\n integrationId: 'example',\n },\n {\n name: 'string',\n slug: 'string',\n enabled: true,\n type: 'inbound',\n configuration: {\n entities: [\n { /* ... */ }\n ],\n meter_readings: [\n { /* ... */ }\n ]\n }\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"integrationId\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"name\": \"string\",\n \"slug\": \"string\",\n \"type\": \"inbound\",\n \"enabled\": true,\n \"change_description\": \"string\",\n \"created_at\": \"1970-01-01T00:00:00.000Z\",\n \"updated_at\": \"1970-01-01T00:00:00.000Z\",\n \"configuration\": {\n \"entities\": [\n {}\n ],\n \"meter_readings\": [\n {}\n ]\n }\n}\n```\n\n
\n\n---\n\n### `getUseCase`\n\nRetrieve a specific use case by its ID\n\n`GET /v1/integrations/{integrationId}/use-cases/{useCaseId}`\n\n```ts\nconst { data } = await client.getUseCase({\n integrationId: 'example',\n useCaseId: 'example',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"integrationId\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"name\": \"string\",\n \"slug\": \"string\",\n \"type\": \"inbound\",\n \"enabled\": true,\n \"change_description\": \"string\",\n \"created_at\": \"1970-01-01T00:00:00.000Z\",\n \"updated_at\": \"1970-01-01T00:00:00.000Z\",\n \"configuration\": {\n \"entities\": [\n {}\n ],\n \"meter_readings\": [\n {}\n ]\n }\n}\n```\n\n
\n\n---\n\n### `updateUseCase`\n\nUpdate an existing use case configuration\n\n`PUT /v1/integrations/{integrationId}/use-cases/{useCaseId}`\n\n```ts\nconst { data } = await client.updateUseCase(\n {\n integrationId: 'example',\n useCaseId: 'example',\n },\n {\n name: 'string',\n slug: 'string',\n enabled: true,\n change_description: 'string',\n type: 'inbound',\n configuration: {\n entities: [\n { /* ... */ }\n ],\n meter_readings: [\n { /* ... */ }\n ]\n }\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"integrationId\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"name\": \"string\",\n \"slug\": \"string\",\n \"type\": \"inbound\",\n \"enabled\": true,\n \"change_description\": \"string\",\n \"created_at\": \"1970-01-01T00:00:00.000Z\",\n \"updated_at\": \"1970-01-01T00:00:00.000Z\",\n \"configuration\": {\n \"entities\": [\n {}\n ],\n \"meter_readings\": [\n {}\n ]\n }\n}\n```\n\n
\n\n---\n\n### `deleteUseCase`\n\nDelete a use case from an integration\n\n`DELETE /v1/integrations/{integrationId}/use-cases/{useCaseId}`\n\n```ts\nconst { data } = await client.deleteUseCase({\n integrationId: 'example',\n useCaseId: 'example',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"message\": \"string\"\n}\n```\n\n
\n\n---\n\n### `listUseCaseHistory`\n\nRetrieve historical versions of a use case's configuration.\nHistory entries are returned in reverse chronological order (newest first).\nUse the 'cursor' parameter for pagination to fetch additional en\n\n`GET /v1/integrations/{integrationId}/use-cases/{useCaseId}/history`\n\n```ts\nconst { data } = await client.listUseCaseHistory({\n integrationId: 'example',\n useCaseId: 'example',\n cursor: 'example',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"history\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"useCaseId\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"integrationId\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"name\": \"string\",\n \"slug\": \"string\",\n \"enabled\": true,\n \"change_description\": \"string\",\n \"changed_by\": \"string\",\n \"created_at\": \"1970-01-01T00:00:00.000Z\",\n \"updated_at\": \"1970-01-01T00:00:00.000Z\",\n \"history_created_at\": \"1970-01-01T00:00:00.000Z\",\n \"type\": \"inbound\",\n \"configuration\": {}\n }\n ],\n \"next_cursor\": \"string\"\n}\n```\n\n
\n\n---\n\n### `listIntegrationsV2`\n\nRetrieve all integrations with embedded use cases for the authenticated organization\n\n`GET /v2/integrations`\n\n```ts\nconst { data } = await client.listIntegrationsV2()\n```\n\n
\nResponse\n\n```json\n{\n \"integrations\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"orgId\": \"string\",\n \"created_at\": \"1970-01-01T00:00:00.000Z\",\n \"updated_at\": \"1970-01-01T00:00:00.000Z\",\n \"name\": \"string\",\n \"description\": \"string\",\n \"access_token_ids\": [\"string\"],\n \"app_ids\": [\"string\"],\n \"environment_config\": [],\n \"settings\": {},\n \"integration_type\": \"erp\",\n \"connector_config\": {},\n \"protected\": true,\n \"_manifest\": [\"string\"],\n \"use_cases\": []\n }\n ]\n}\n```\n\n
\n\n---\n\n### `createIntegrationV2`\n\nCreate a new integration with embedded use cases.\n\n`POST /v2/integrations`\n\n```ts\nconst { data } = await client.createIntegrationV2(\n null,\n {\n name: 'string',\n description: 'string',\n access_token_ids: ['string'],\n app_ids: ['string'],\n environment_config: [\n {\n key: 'string',\n label: 'string',\n type: 'String',\n description: 'string',\n required: false,\n order: 0\n }\n ],\n settings: {\n autoRefresh: {\n enabled: false,\n freshnessThresholdMinutes: 1\n },\n notifications: {\n enabled: true,\n recipients: [ /* ... */ ],\n defaultChannels: { /* ... */ },\n monitoredUseCases: ['string'],\n monitoredCodes: ['string'],\n rules: [ /* ... */ ],\n digest: { /* ... */ },\n muteUntil: '1970-01-01T00:00:00.000Z'\n }\n },\n integration_type: 'erp',\n connector_config: {\n base_url: 'string',\n auth: {\n type: 'oauth2_client_credentials',\n token_url: 'string',\n client_id: 'string',\n client_secret: 'string',\n scope: 'string',\n audience: 'string',\n resource: 'string',\n body_params: {},\n headers: {},\n query_params: {},\n api_key_header: 'string',\n api_key: 'string',\n token: 'string'\n },\n types_versions: [\n { /* ... */ }\n ],\n latest_types_version: 'string',\n latest_types_package_name: 'string'\n },\n protected: true,\n _manifest: ['string'],\n use_cases: [\n {\n id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',\n name: 'string',\n slug: 'string',\n enabled: true,\n change_description: 'string',\n type: 'inbound',\n configuration: { /* ... */ }\n }\n ]\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"orgId\": \"string\",\n \"created_at\": \"1970-01-01T00:00:00.000Z\",\n \"updated_at\": \"1970-01-01T00:00:00.000Z\",\n \"name\": \"string\",\n \"description\": \"string\",\n \"access_token_ids\": [\"string\"],\n \"app_ids\": [\"string\"],\n \"environment_config\": [\n {\n \"key\": \"string\",\n \"label\": \"string\",\n \"type\": \"String\",\n \"description\": \"string\",\n \"required\": false,\n \"order\": 0\n }\n ],\n \"settings\": {\n \"autoRefresh\": {\n \"enabled\": false,\n \"freshnessThresholdMinutes\": 1\n },\n \"notifications\": {\n \"enabled\": true,\n \"recipients\": [],\n \"defaultChannels\": {},\n \"monitoredUseCases\": [\"string\"],\n \"monitoredCodes\": [\"string\"],\n \"rules\": [],\n \"digest\": {},\n \"muteUntil\": \"1970-01-01T00:00:00.000Z\"\n }\n },\n \"integration_type\": \"erp\",\n \"connector_config\": {\n \"base_url\": \"string\",\n \"auth\": {\n \"type\": \"oauth2_client_credentials\",\n \"token_url\": \"string\",\n \"client_id\": \"string\",\n \"client_secret\": \"string\",\n \"scope\": \"string\",\n \"audience\": \"string\",\n \"resource\": \"string\",\n \"body_params\": {},\n \"headers\": {},\n \"query_params\": {},\n \"api_key_header\": \"string\",\n \"api_key\": \"string\",\n \"token\": \"string\"\n },\n \"types_versions\": [\n {}\n ],\n \"latest_types_version\": \"string\",\n \"latest_types_package_name\": \"string\"\n },\n \"protected\": true,\n \"_manifest\": [\"string\"],\n \"use_cases\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"integrationId\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"name\": \"string\",\n \"slug\": \"string\",\n \"type\": \"inbound\",\n \"enabled\": true,\n \"change_description\": \"string\",\n \"created_at\": \"1970-01-01T00:00:00.000Z\",\n \"updated_at\": \"1970-01-01T00:00:00.000Z\",\n \"configuration\": {}\n }\n ]\n}\n```\n\n
\n\n---\n\n### `getIntegrationV2`\n\nRetrieve a specific integration with all its embedded use cases\n\n`GET /v2/integrations/{integrationId}`\n\n```ts\nconst { data } = await client.getIntegrationV2({\n integrationId: 'example',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"orgId\": \"string\",\n \"created_at\": \"1970-01-01T00:00:00.000Z\",\n \"updated_at\": \"1970-01-01T00:00:00.000Z\",\n \"name\": \"string\",\n \"description\": \"string\",\n \"access_token_ids\": [\"string\"],\n \"app_ids\": [\"string\"],\n \"environment_config\": [\n {\n \"key\": \"string\",\n \"label\": \"string\",\n \"type\": \"String\",\n \"description\": \"string\",\n \"required\": false,\n \"order\": 0\n }\n ],\n \"settings\": {\n \"autoRefresh\": {\n \"enabled\": false,\n \"freshnessThresholdMinutes\": 1\n },\n \"notifications\": {\n \"enabled\": true,\n \"recipients\": [],\n \"defaultChannels\": {},\n \"monitoredUseCases\": [\"string\"],\n \"monitoredCodes\": [\"string\"],\n \"rules\": [],\n \"digest\": {},\n \"muteUntil\": \"1970-01-01T00:00:00.000Z\"\n }\n },\n \"integration_type\": \"erp\",\n \"connector_config\": {\n \"base_url\": \"string\",\n \"auth\": {\n \"type\": \"oauth2_client_credentials\",\n \"token_url\": \"string\",\n \"client_id\": \"string\",\n \"client_secret\": \"string\",\n \"scope\": \"string\",\n \"audience\": \"string\",\n \"resource\": \"string\",\n \"body_params\": {},\n \"headers\": {},\n \"query_params\": {},\n \"api_key_header\": \"string\",\n \"api_key\": \"string\",\n \"token\": \"string\"\n },\n \"types_versions\": [\n {}\n ],\n \"latest_types_version\": \"string\",\n \"latest_types_package_name\": \"string\"\n },\n \"protected\": true,\n \"_manifest\": [\"string\"],\n \"use_cases\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"integrationId\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"name\": \"string\",\n \"slug\": \"string\",\n \"type\": \"inbound\",\n \"enabled\": true,\n \"change_description\": \"string\",\n \"created_at\": \"1970-01-01T00:00:00.000Z\",\n \"updated_at\": \"1970-01-01T00:00:00.000Z\",\n \"configuration\": {}\n }\n ]\n}\n```\n\n
\n\n---\n\n### `updateIntegrationV2`\n\nUpdate an existing integration with embedded use cases.\nThe integration must already exist.\nUse cases are updated declaratively:\n- Use cases in the request with matching IDs are updated\n- Use cases in\n\n`PUT /v2/integrations/{integrationId}`\n\n```ts\nconst { data } = await client.updateIntegrationV2(\n {\n integrationId: 'example',\n },\n {\n name: 'string',\n description: 'string',\n access_token_ids: ['string'],\n app_ids: ['string'],\n environment_config: [\n {\n key: 'string',\n label: 'string',\n type: 'String',\n description: 'string',\n required: false,\n order: 0\n }\n ],\n settings: {\n autoRefresh: {\n enabled: false,\n freshnessThresholdMinutes: 1\n },\n notifications: {\n enabled: true,\n recipients: [ /* ... */ ],\n defaultChannels: { /* ... */ },\n monitoredUseCases: ['string'],\n monitoredCodes: ['string'],\n rules: [ /* ... */ ],\n digest: { /* ... */ },\n muteUntil: '1970-01-01T00:00:00.000Z'\n }\n },\n integration_type: 'erp',\n connector_config: {\n base_url: 'string',\n auth: {\n type: 'oauth2_client_credentials',\n token_url: 'string',\n client_id: 'string',\n client_secret: 'string',\n scope: 'string',\n audience: 'string',\n resource: 'string',\n body_params: {},\n headers: {},\n query_params: {},\n api_key_header: 'string',\n api_key: 'string',\n token: 'string'\n },\n types_versions: [\n { /* ... */ }\n ],\n latest_types_version: 'string',\n latest_types_package_name: 'string'\n },\n protected: true,\n _manifest: ['string'],\n use_cases: [\n {\n id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',\n name: 'string',\n slug: 'string',\n enabled: true,\n change_description: 'string',\n type: 'inbound',\n configuration: { /* ... */ }\n }\n ]\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"orgId\": \"string\",\n \"created_at\": \"1970-01-01T00:00:00.000Z\",\n \"updated_at\": \"1970-01-01T00:00:00.000Z\",\n \"name\": \"string\",\n \"description\": \"string\",\n \"access_token_ids\": [\"string\"],\n \"app_ids\": [\"string\"],\n \"environment_config\": [\n {\n \"key\": \"string\",\n \"label\": \"string\",\n \"type\": \"String\",\n \"description\": \"string\",\n \"required\": false,\n \"order\": 0\n }\n ],\n \"settings\": {\n \"autoRefresh\": {\n \"enabled\": false,\n \"freshnessThresholdMinutes\": 1\n },\n \"notifications\": {\n \"enabled\": true,\n \"recipients\": [],\n \"defaultChannels\": {},\n \"monitoredUseCases\": [\"string\"],\n \"monitoredCodes\": [\"string\"],\n \"rules\": [],\n \"digest\": {},\n \"muteUntil\": \"1970-01-01T00:00:00.000Z\"\n }\n },\n \"integration_type\": \"erp\",\n \"connector_config\": {\n \"base_url\": \"string\",\n \"auth\": {\n \"type\": \"oauth2_client_credentials\",\n \"token_url\": \"string\",\n \"client_id\": \"string\",\n \"client_secret\": \"string\",\n \"scope\": \"string\",\n \"audience\": \"string\",\n \"resource\": \"string\",\n \"body_params\": {},\n \"headers\": {},\n \"query_params\": {},\n \"api_key_header\": \"string\",\n \"api_key\": \"string\",\n \"token\": \"string\"\n },\n \"types_versions\": [\n {}\n ],\n \"latest_types_version\": \"string\",\n \"latest_types_package_name\": \"string\"\n },\n \"protected\": true,\n \"_manifest\": [\"string\"],\n \"use_cases\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"integrationId\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"name\": \"string\",\n \"slug\": \"string\",\n \"type\": \"inbound\",\n \"enabled\": true,\n \"change_description\": \"string\",\n \"created_at\": \"1970-01-01T00:00:00.000Z\",\n \"updated_at\": \"1970-01-01T00:00:00.000Z\",\n \"configuration\": {}\n }\n ]\n}\n```\n\n
\n\n---\n\n### `deleteIntegrationV2`\n\nDelete an integration and all its use cases\n\n`DELETE /v2/integrations/{integrationId}`\n\n```ts\nconst { data } = await client.deleteIntegrationV2({\n integrationId: 'example',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"message\": \"string\"\n}\n```\n\n
\n\n---\n\n### `listNotificationHistory`\n\nReturns the cursor-paginated, newest-first notification history for an\nintegration (every real notification decision — both fired and suppressed).\nRequires the `integration:view` permission on the int\n\n`GET /v2/integrations/{integrationId}/notifications/history`\n\n```ts\nconst { data } = await client.listNotificationHistory({\n integrationId: 'example',\n cursor: 'example',\n limit: 1,\n type: 'example',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"history\": [\n {\n \"id\": \"string\",\n \"type\": \"string\",\n \"state_transition\": \"string\",\n \"severity\": \"error\",\n \"title\": \"string\",\n \"occurred_at\": \"1970-01-01T00:00:00.000Z\",\n \"notified\": true,\n \"suppressed_reason\": \"muted\",\n \"recipients\": [\"string\"],\n \"context\": {},\n \"created_at\": \"1970-01-01T00:00:00.000Z\"\n }\n ],\n \"next_cursor\": \"string\"\n}\n```\n\n
\n\n---\n\n### `testSendNotification`\n\nRenders and sends ONE representative notification of the requested kind/type to\nthe CALLING USER ONLY (never any other recipient), so an operator can preview how\na notification looks. A test send does\n\n`POST /v2/integrations/{integrationId}/notifications/test`\n\n```ts\nconst { data } = await client.testSendNotification(\n {\n integrationId: 'example',\n },\n {\n kind: 'alert',\n type: 'string',\n channels: ['email']\n },\n)\n```\n\n---\n\n### `getNotificationStatus`\n\nReturns the live per-rule alert state and (for 'auto' rules) the current\nhour-of-week baseline band for an integration's notification monitoring.\nReflects the latest 5-minute sweep — near-real-time, n\n\n`GET /v2/integrations/{integrationId}/notifications/status`\n\n```ts\nconst { data } = await client.getNotificationStatus({\n integrationId: 'example',\n include: 'example',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"health\": \"healthy\",\n \"evaluated_at\": \"1970-01-01T00:00:00.000Z\",\n \"rules\": [\n {\n \"rule_id\": \"string\",\n \"state\": \"ok\",\n \"last_fired_at\": \"1970-01-01T00:00:00.000Z\",\n \"last_cleared_at\": \"1970-01-01T00:00:00.000Z\",\n \"baseline\": {\n \"is_mature\": true,\n \"computed_at\": \"1970-01-01T00:00:00.000Z\",\n \"median\": 0,\n \"mad\": 0,\n \"upper\": 0,\n \"buckets\": [\n {\n \"dow\": 1,\n \"hour\": 0,\n \"median\": 0,\n \"mad\": 0\n }\n ]\n }\n }\n ]\n}\n```\n\n
\n\n---\n\n### `getSecureProxyWhitelist`\n\nGet secure_proxy whitelist (admin portal only)\n\n`GET /v2/integrations/{integrationId}/use-cases/{useCaseId}/secure-proxy-whitelist`\n\n```ts\nconst { data } = await client.getSecureProxyWhitelist({\n integrationId: 'example',\n useCaseId: 'example',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"vpc_mode\": \"static_ip\",\n \"allowed_domains\": [\"string\"],\n \"allowed_ips\": [\"string\"]\n}\n```\n\n
\n\n---\n\n### `updateSecureProxyWhitelist`\n\nUpdate secure_proxy whitelist (admin portal only)\n\n`PUT /v2/integrations/{integrationId}/use-cases/{useCaseId}/secure-proxy-whitelist`\n\n```ts\nconst { data } = await client.updateSecureProxyWhitelist(\n {\n integrationId: 'example',\n useCaseId: 'example',\n },\n {\n allowed_domains: ['string'],\n allowed_ips: ['string']\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"vpc_mode\": \"static_ip\",\n \"allowed_domains\": [\"string\"],\n \"allowed_ips\": [\"string\"]\n}\n```\n\n
\n\n---\n\n### `listSecureProxyWhitelistHistory`\n\nList secure_proxy whitelist change history (admin portal only)\n\n`GET /v2/integrations/{integrationId}/use-cases/{useCaseId}/secure-proxy-whitelist/history`\n\n```ts\nconst { data } = await client.listSecureProxyWhitelistHistory({\n integrationId: 'example',\n useCaseId: 'example',\n limit: 1,\n})\n```\n\n
\nResponse\n\n```json\n{\n \"history\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"useCaseId\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"integrationId\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"name\": \"string\",\n \"slug\": \"string\",\n \"enabled\": true,\n \"change_description\": \"string\",\n \"changed_by\": \"string\",\n \"created_at\": \"1970-01-01T00:00:00.000Z\",\n \"updated_at\": \"1970-01-01T00:00:00.000Z\",\n \"history_created_at\": \"1970-01-01T00:00:00.000Z\",\n \"type\": \"secure_proxy\",\n \"configuration\": {\n \"vpc_mode\": \"static_ip\",\n \"allowed_domains\": [\"string\"],\n \"allowed_ips\": [\"string\"]\n }\n }\n ]\n}\n```\n\n
\n\n---\n\n### `setIntegrationAppMapping`\n\nCreates or updates a mapping from an app/component to an integration.\nThis allows ERP updates sent via app_id and component_id to be associated\nwith a specific integration configuration.\n\n`PUT /v1/integrations/{integrationId}/app-mapping`\n\n```ts\nconst { data } = await client.setIntegrationAppMapping(\n {\n integrationId: 'example',\n },\n {\n app_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',\n component_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',\n overwrite: false\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"integration_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\"\n}\n```\n\n
\n\n---\n\n### `deleteIntegrationAppMapping`\n\nRemoves a mapping from an app/component to an integration.\n\n`DELETE /v1/integrations/{integrationId}/app-mapping`\n\n```ts\nconst { data } = await client.deleteIntegrationAppMapping(\n {\n integrationId: 'example',\n },\n {\n app_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',\n component_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6'\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"message\": \"string\"\n}\n```\n\n
\n\n---\n\n### `queryInboundMonitoringEvents`\n\nQuery inbound monitoring events for a specific integration.\nReturns detailed information about inbound sync events from ERP systems,\nincluding success rates, error breakdowns, and processing metrics.\n\n`POST /v1/integrations/{integrationId}/monitoring/inbound-events`\n\n```ts\nconst { data } = await client.queryInboundMonitoringEvents(\n {\n integrationId: 'example',\n },\n {\n use_case_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',\n event_type: 'CREATE',\n sync_type: 'entity',\n status: 'success',\n error_category: 'validation',\n correlation_id: 'string',\n object_type: 'string',\n event_name: 'string',\n event_id: 'string',\n from_date: '2025-01-01T00:00:00Z',\n to_date: '2025-01-31T23:59:59Z',\n limit: 50,\n cursor: {\n completed_at: '1970-01-01T00:00:00.000Z',\n event_id: 'string'\n }\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"data\": [\n {\n \"org_id\": \"string\",\n \"event_id\": \"string\",\n \"correlation_id\": \"string\",\n \"integration_id\": \"string\",\n \"use_case_id\": \"string\",\n \"event_type\": \"CREATE\",\n \"object_type\": \"string\",\n \"sync_type\": \"entity\",\n \"status\": \"success\",\n \"error_code\": \"string\",\n \"error_message\": \"string\",\n \"error_category\": \"validation\",\n \"processing_duration_ms\": 0,\n \"received_at\": \"1970-01-01T00:00:00.000Z\",\n \"completed_at\": \"1970-01-01T00:00:00.000Z\"\n }\n ],\n \"next_cursor\": {\n \"completed_at\": \"1970-01-01T00:00:00.000Z\",\n \"event_id\": \"string\"\n },\n \"has_more\": true\n}\n```\n\n
\n\n---\n\n### `getMonitoringStats`\n\nGet aggregated statistics for both inbound and outbound monitoring events for a specific integration.\nReturns summary metrics for inbound (ERP sync) and outbound (webhook delivery) events,\nincluding s\n\n`POST /v1/integrations/{integrationId}/monitoring/stats`\n\n```ts\nconst { data } = await client.getMonitoringStats(\n {\n integrationId: 'example',\n },\n {\n from_date: '2025-01-01T00:00:00Z',\n to_date: '2025-01-31T23:59:59Z',\n inbound_group_by: ['use_case_id', 'status'],\n outbound_group_by: ['event_name', 'status']\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"inbound\": {\n \"total_events\": 0,\n \"total_correlations\": 0,\n \"success_count\": 0,\n \"error_count\": 0,\n \"skipped_count\": 0,\n \"warning_count\": 0,\n \"success_rate\": 0,\n \"last_error_at\": \"1970-01-01T00:00:00.000Z\",\n \"breakdown\": [\n {}\n ]\n },\n \"outbound\": {\n \"total_events\": 0,\n \"success_count\": 0,\n \"error_count\": 0,\n \"pending_count\": 0,\n \"success_rate\": 0,\n \"last_error_at\": \"1970-01-01T00:00:00.000Z\",\n \"breakdown\": [\n {}\n ]\n }\n}\n```\n\n
\n\n---\n\n### `getMonitoringTimeSeries`\n\nGet time-series aggregated event counts for monitoring charts.\nReturns pre-bucketed counts at configurable intervals for both inbound and outbound events.\nMaximum of 200 buckets per request. Returns 4\n\n`POST /v1/integrations/{integrationId}/monitoring/timeseries`\n\n```ts\nconst { data } = await client.getMonitoringTimeSeries(\n {\n integrationId: 'example',\n },\n {\n from_date: '2025-01-01T00:00:00Z',\n to_date: '2025-01-31T23:59:59Z',\n interval: '1h',\n direction: 'both'\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"interval\": \"5m\",\n \"from_date\": \"1970-01-01T00:00:00.000Z\",\n \"to_date\": \"1970-01-01T00:00:00.000Z\",\n \"buckets\": [\n {\n \"timestamp\": \"1970-01-01T00:00:00.000Z\",\n \"inbound\": {\n \"success_count\": 0,\n \"error_count\": 0,\n \"warning_count\": 0,\n \"skipped_count\": 0,\n \"total_count\": 0\n },\n \"outbound\": {\n \"success_count\": 0,\n \"error_count\": 0,\n \"pending_count\": 0,\n \"total_count\": 0\n }\n }\n ]\n}\n```\n\n
\n\n---\n\n### `getOutboundStatus`\n\nGet the status of all outbound use cases for a specific integration.\nReturns conflict information when events or webhooks are disabled but the use case is enabled.\n\n`GET /v1/integrations/{integrationId}/outbound-status`\n\n```ts\nconst { data } = await client.getOutboundStatus({\n integrationId: 'example',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"useCases\": [\n {\n \"useCaseId\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"name\": \"string\",\n \"useCaseEnabled\": true,\n \"eventCatalogEvent\": \"contract.created\",\n \"eventEnabled\": true,\n \"webhooks\": [\n {\n \"webhookId\": \"string\",\n \"webhookName\": \"string\",\n \"enabled\": true\n }\n ],\n \"status\": \"ok\",\n \"conflicts\": [\n {\n \"type\": \"event_disabled\",\n \"webhookId\": \"string\",\n \"message\": \"string\"\n }\n ],\n \"poll\": {\n \"queue_depth\": 0,\n \"oldest_unconsumed_age_seconds\": 0,\n \"last_poll_at\": \"1970-01-01T00:00:00.000Z\",\n \"last_ack_at\": \"1970-01-01T00:00:00.000Z\",\n \"blocked\": true,\n \"dlq_count\": 0\n }\n }\n ]\n}\n```\n\n
\n\n---\n\n### `pollOutboundMessages`\n\nPoll outbound messages for an integration's poll-mode use cases.\nTakes a lease on the head-of-line batch of the integration's FIFO stream:\nthe returned messages stay invisible to subsequent polls unti\n\n`POST /v1/integrations/{integrationId}/outbound/messages/poll`\n\n```ts\nconst { data } = await client.pollOutboundMessages(\n {\n integrationId: 'example',\n },\n {\n limit: 10\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"messages\": [\n {\n \"id\": \"string\",\n \"lease_token\": \"string\",\n \"use_case_id\": \"string\",\n \"event_name\": \"string\",\n \"event_id\": \"string\",\n \"group\": \"string\",\n \"payload\": {},\n \"enqueued_at\": \"1970-01-01T00:00:00.000Z\"\n }\n ],\n \"visibility_timeout_seconds\": 0,\n \"has_more\": true\n}\n```\n\n
\n\n---\n\n### `ackOutboundMessages`\n\nAcknowledge polled outbound messages. Acks are validated against the\nactive lease and committed as a prefix-contiguous cursor advance:\nmessages must be acknowledged in stream order. Out-of-order acks \n\n`POST /v1/integrations/{integrationId}/outbound/messages/ack`\n\n```ts\nconst { data } = await client.ackOutboundMessages(\n {\n integrationId: 'example',\n },\n {\n acks: [\n {\n id: 'string',\n lease_token: 'string'\n }\n ]\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"results\": [\n {\n \"id\": \"string\",\n \"status\": \"accepted\",\n \"reason\": \"stale_lease\"\n }\n ]\n}\n```\n\n
\n\n---\n\n### `listOutboundDlqMessages`\n\nList an integration's dead-lettered outbound queue messages\n(poison_policy enforcement and operator skips move messages here).\nOperator endpoint — requires the `integration:manage` grant. Message\npayl\n\n`GET /v1/integrations/{integrationId}/outbound/messages/dlq`\n\n```ts\nconst { data } = await client.listOutboundDlqMessages({\n integrationId: 'example',\n limit: 1,\n next_token: 'example',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"items\": [\n {\n \"id\": \"string\",\n \"use_case_id\": \"string\",\n \"event_name\": \"string\",\n \"event_id\": \"string\",\n \"enqueued_at\": \"1970-01-01T00:00:00.000Z\",\n \"dead_lettered_at\": \"1970-01-01T00:00:00.000Z\",\n \"delivery_attempts\": 0,\n \"reason\": \"string\",\n \"expires_at\": \"1970-01-01T00:00:00.000Z\"\n }\n ],\n \"next_token\": \"string\"\n}\n```\n\n
\n\n---\n\n### `redriveOutboundDlqMessages`\n\nRedrive selected dead-lettered messages back into the live stream.\nOperator endpoint — requires the `integration:manage` grant.\nA redriven message is re-enqueued at the tail with a new id and\nsequence\n\n`POST /v1/integrations/{integrationId}/outbound/messages/dlq/redrive`\n\n```ts\nconst { data } = await client.redriveOutboundDlqMessages(\n {\n integrationId: 'example',\n },\n {\n ids: ['string']\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"results\": [\n {\n \"id\": \"string\",\n \"status\": \"redriven\"\n }\n ]\n}\n```\n\n
\n\n---\n\n### `unblockOutboundStream`\n\nUnblock an integration's outbound stream halted by the `block`\npoison policy: skips (dead-letters) the current blocked head message,\nemitting MSG_DEAD_LETTERED and letting the next message become the\n\n\n`POST /v1/integrations/{integrationId}/outbound/messages/unblock`\n\n```ts\nconst { data } = await client.unblockOutboundStream(\n {\n integrationId: 'example',\n },\n {\n reason: 'string'\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"unblocked\": true,\n \"dead_lettered_id\": \"string\"\n}\n```\n\n
\n\n---\n\n### `queryAccessLogs`\n\nQuery API access logs for a specific integration's organization.\nReturns access token usage analytics filtered by user_id (access token).\nSupports infinite scroll pagination with cursor-based navigati\n\n`POST /v1/integrations/{integrationId}/monitoring/access-logs`\n\n```ts\nconst { data } = await client.queryAccessLogs(\n {\n integrationId: 'example',\n },\n {\n token_id: 'api_5ZugdRXasLfWBypHi93Fk',\n service: 'entity',\n method: 'GET',\n path: '/v1/entity',\n status: 200,\n from_date: '2025-01-01T00:00:00Z',\n to_date: '2025-01-31T23:59:59Z',\n limit: 50,\n cursor: {\n timestamp: '1970-01-01T00:00:00.000Z',\n request_id: 'string'\n }\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"data\": [\n {\n \"timestamp\": \"1970-01-01T00:00:00.000Z\",\n \"environment\": \"string\",\n \"service\": \"string\",\n \"request_id\": \"string\",\n \"method\": \"string\",\n \"path\": \"string\",\n \"status\": 0,\n \"response_latency_ms\": 0,\n \"response_length\": 0,\n \"token_id\": \"string\",\n \"org_id\": \"string\",\n \"origin\": \"string\",\n \"source_ip\": \"string\"\n }\n ],\n \"next_cursor\": {\n \"timestamp\": \"1970-01-01T00:00:00.000Z\",\n \"request_id\": \"string\"\n },\n \"has_more\": true\n}\n```\n\n
\n\n---\n\n### `queryOutboundMonitoringEvents`\n\nQuery outbound monitoring events for a specific integration.\nReturns detailed information about outbound event deliveries,\nfiltered by event_name (event_catalog_event) linked to the integration's outb\n\n`POST /v1/integrations/{integrationId}/monitoring/outbound-events`\n\n```ts\nconst { data } = await client.queryOutboundMonitoringEvents(\n {\n integrationId: 'example',\n },\n {\n event_name: 'automation_flow_target',\n status: 'succeeded',\n webhook_config_id: 'string',\n from_date: '2025-01-01T00:00:00Z',\n to_date: '2025-01-31T23:59:59Z',\n limit: 50,\n cursor: {\n created_at: '1970-01-01T00:00:00.000Z',\n event_id: 'string'\n }\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"data\": [\n {\n \"org_id\": \"string\",\n \"event_id\": \"string\",\n \"event_name\": \"string\",\n \"status\": \"succeeded\",\n \"url\": \"string\",\n \"http_method\": \"string\",\n \"http_response\": {},\n \"webhook_config_id\": \"string\",\n \"metadata\": {},\n \"execution_context\": {},\n \"payload\": {},\n \"created_at\": \"1970-01-01T00:00:00.000Z\",\n \"updated_at\": \"1970-01-01T00:00:00.000Z\"\n }\n ],\n \"next_cursor\": {\n \"created_at\": \"1970-01-01T00:00:00.000Z\",\n \"event_id\": \"string\"\n },\n \"has_more\": true\n}\n```\n\n
\n\n---\n\n### `queryMonitoringEventsV2`\n\nQuery monitoring events from the unified erp_monitoring_v2 table.\nReturns all event types (inbound, outbound, file_proxy, etc.) in a single list.\nReplaces the separate v1 inbound-events and outbound-e\n\n`POST /v2/integrations/{integrationId}/monitoring/events`\n\n```ts\nconst { data } = await client.queryMonitoringEventsV2(\n {\n integrationId: 'example',\n },\n {\n use_case_id: 'string',\n use_case_type: 'inbound',\n level: 'success',\n code: 'string',\n event_id: 'string',\n correlation_id: 'string',\n from_date: '2025-01-01T00:00:00Z',\n to_date: '2025-01-31T23:59:59Z',\n limit: 50,\n cursor: {\n created_at: '1970-01-01T00:00:00.000Z',\n id: '3fa85f64-5717-4562-b3fc-2c963f66afa6'\n }\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"data\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"org_id\": \"string\",\n \"integration_id\": \"string\",\n \"event_id\": \"string\",\n \"correlation_id\": \"string\",\n \"use_case_id\": \"string\",\n \"use_case_type\": \"inbound\",\n \"level\": \"success\",\n \"code\": \"string\",\n \"message\": \"string\",\n \"detail\": {},\n \"created_at\": \"1970-01-01T00:00:00.000Z\"\n }\n ],\n \"next_cursor\": {\n \"created_at\": \"1970-01-01T00:00:00.000Z\",\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\"\n },\n \"has_more\": true\n}\n```\n\n
\n\n---\n\n### `getMonitoringStatsV2`\n\nGet aggregated statistics from the unified erp_monitoring_v2 table.\nReturns combined metrics for all event types with optional breakdowns.\n\n`POST /v2/integrations/{integrationId}/monitoring/stats`\n\n```ts\nconst { data } = await client.getMonitoringStatsV2(\n {\n integrationId: 'example',\n },\n {\n from_date: '2025-01-01T00:00:00Z',\n to_date: '2025-01-31T23:59:59Z',\n use_case_type: 'inbound',\n use_case_types: ['inbound'],\n group_by: 'use_case_id',\n source: 'monitoring'\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"total_events\": 0,\n \"success_count\": 0,\n \"error_count\": 0,\n \"warning_count\": 0,\n \"skipped_count\": 0,\n \"ack_timeout_count\": 0,\n \"success_rate\": 0,\n \"last_error_at\": \"1970-01-01T00:00:00.000Z\",\n \"breakdown\": [\n {}\n ]\n}\n```\n\n
\n\n---\n\n### `getMonitoringTimeSeriesV2`\n\nGet time-series aggregated event counts from the unified erp_monitoring_v2 table.\nReturns bucketed counts for chart rendering.\n\n`POST /v2/integrations/{integrationId}/monitoring/time-series`\n\n```ts\nconst { data } = await client.getMonitoringTimeSeriesV2(\n {\n integrationId: 'example',\n },\n {\n from_date: '2025-01-01T00:00:00Z',\n to_date: '2025-01-31T23:59:59Z',\n interval: '5m',\n use_case_type: 'inbound',\n group_by: 'use_case_type'\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"interval\": \"5m\",\n \"from_date\": \"1970-01-01T00:00:00.000Z\",\n \"to_date\": \"1970-01-01T00:00:00.000Z\",\n \"buckets\": [\n {\n \"timestamp\": \"1970-01-01T00:00:00.000Z\",\n \"success_count\": 0,\n \"error_count\": 0,\n \"warning_count\": 0,\n \"skipped_count\": 0,\n \"total_count\": 0,\n \"breakdown\": [\n {\n \"use_case_type\": \"inbound\",\n \"use_case_id\": \"string\",\n \"success_count\": 0,\n \"error_count\": 0,\n \"warning_count\": 0,\n \"skipped_count\": 0,\n \"total_count\": 0\n }\n ]\n }\n ]\n}\n```\n\n
\n\n---\n\n### `getAssociatedMonitoringEvents`\n\nReturns all monitoring events sharing the same event_id, ordered chronologically.\nAlso includes the original inbound event payload from erp_incoming_events if available.\nUsed to display a full event t\n\n`GET /v2/integrations/{integrationId}/monitoring/events/{eventId}/associated`\n\n```ts\nconst { data } = await client.getAssociatedMonitoringEvents({\n integrationId: 'example',\n eventId: 'example',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"monitoring_events\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"org_id\": \"string\",\n \"integration_id\": \"string\",\n \"event_id\": \"string\",\n \"correlation_id\": \"string\",\n \"use_case_id\": \"string\",\n \"use_case_type\": \"inbound\",\n \"level\": \"success\",\n \"code\": \"string\",\n \"message\": \"string\",\n \"detail\": {},\n \"created_at\": \"1970-01-01T00:00:00.000Z\"\n }\n ],\n \"inbound_event\": {}\n}\n```\n\n
\n\n---\n\n### `ingestExternalMonitoringEvents`\n\nIngest monitoring spans produced by an EXTERNAL system (e.g. an integration\nmiddleware), so the Integration Hub is the central monitoring point and the\ncross-system event trace spans both the external\n\n`POST /v2/integrations/{integrationId}/monitoring/external-events`\n\n```ts\nconst { data } = await client.ingestExternalMonitoringEvents(\n {\n integrationId: 'example',\n },\n {\n events: [\n {\n correlation_id: 'string',\n level: 'string',\n use_case_slug: 'string',\n occurred_at: '1970-01-01T00:00:00.000Z',\n message: 'string',\n detail: {}\n }\n ]\n },\n)\n```\n\n---\n\n### `getMonitoringTraceByCorrelation`\n\nReturns the cross-system event trace for a `correlation_id`: every monitoring\nspan sharing it — external spans (middleware) plus epilot's own processing spans\n— ordered chronologically, with a rolled-\n\n`GET /v2/integrations/{integrationId}/monitoring/traces/{correlationId}`\n\n```ts\nconst { data } = await client.getMonitoringTraceByCorrelation({\n integrationId: 'example',\n correlationId: 'example',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"correlation_id\": \"string\",\n \"status\": \"success\",\n \"started_at\": \"1970-01-01T00:00:00.000Z\",\n \"ended_at\": \"1970-01-01T00:00:00.000Z\",\n \"span_count\": 0,\n \"truncated\": true,\n \"spans\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"org_id\": \"string\",\n \"integration_id\": \"string\",\n \"event_id\": \"string\",\n \"correlation_id\": \"string\",\n \"use_case_id\": \"string\",\n \"use_case_type\": \"inbound\",\n \"level\": \"success\",\n \"code\": \"string\",\n \"message\": \"string\",\n \"detail\": {},\n \"created_at\": \"1970-01-01T00:00:00.000Z\"\n }\n ],\n \"inbound_event\": {}\n}\n```\n\n
\n\n---\n\n### `listSecureProxies`\n\nList all secure proxy use cases\n\n`GET /v1/integrations/secure-proxies`\n\n```ts\nconst { data } = await client.listSecureProxies()\n```\n\n
\nResponse\n\n```json\n{\n \"secure_proxies\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"name\": \"string\",\n \"slug\": \"string\",\n \"enabled\": true,\n \"vpc_mode\": \"static_ip\",\n \"allowed_domains\": [\"string\"],\n \"allowed_ips\": [\"string\"],\n \"integration_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"integration_name\": \"string\"\n }\n ]\n}\n```\n\n
\n\n---\n\n### `secureProxy`\n\nProxy HTTP request through secure VPC\n\n`POST /v1/secure-proxy`\n\n```ts\nconst { data } = await client.secureProxy(\n null,\n {\n integration_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',\n use_case_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',\n use_case_slug: 'string',\n url: 'https://example.com/path',\n method: 'GET',\n headers: {},\n body: {},\n response_type: 'json'\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"status_code\": 0,\n \"headers\": {},\n \"body\": {}\n}\n```\n\n
\n\n---\n\n### `managedCallExecute`\n\nExecute a managed call operation\n\n`POST /v1/managed-call/{slug}/execute`\n\n```ts\nconst { data } = await client.managedCallExecute(\n {\n slug: 'example',\n },\n {\n integration_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',\n payload: {},\n correlation_id: 'string'\n },\n)\n```\n\n
\nResponse\n\n```json\n{}\n```\n\n
\n\n---\n\n### `generateTypesPreview`\n\nPreview scaffolded types for a connector integration\n\n`POST /v1/integrations/{integrationId}/generate-types-preview`\n\n```ts\nconst { data } = await client.generateTypesPreview({\n integrationId: 'example',\n})\n```\n\n---\n\n### `generateTypes`\n\nGenerate a TypeScript npm package for a connector integration\n\n`POST /v1/integrations/{integrationId}/generate-types`\n\n```ts\nconst { data } = await client.generateTypes(\n {\n integrationId: 'example',\n },\n {\n package_name: '@epilot/hems-cleverpv',\n version: '1.0.0',\n description: 'string',\n domain_package: '@epilot/hems',\n domain_map_name: 'HemsUseCaseMap',\n annotations: {}\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"package_name\": \"string\",\n \"version\": \"string\",\n \"files\": {},\n \"warnings\": [\"string\"]\n}\n```\n\n
\n\n---\n\n### `commitTypes`\n\nCommit generated types and lock use case configurations\n\n`POST /v1/integrations/{integrationId}/commit-types`\n\n```ts\nconst { data } = await client.commitTypes(\n {\n integrationId: 'example',\n },\n {\n package_name: '@epilot/hems-cleverpv',\n version: '1.0.0',\n annotations: {}\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"committed\": true,\n \"warnings\": [\"string\"]\n}\n```\n\n
\n\n---\n\n### `createErpImport`\n\nCreate a pricing-file import job from an already-uploaded file (S3 ref). Returns a job id and starts the validate phase asynchronously — poll GET /v2/erp/imports/{importId}.\n\n`POST /v2/erp/imports`\n\n```ts\nconst { data } = await client.createErpImport(\n null,\n {\n s3_reference: {\n bucket: 'string',\n key: 'string'\n },\n integration_id: 'string',\n use_case_slug: 'string'\n },\n)\n```\n\n---\n\n### `listErpImports`\n\nList recent pricing-file import jobs for the org, newest first.\n\n`GET /v2/erp/imports`\n\n```ts\nconst { data } = await client.listErpImports({\n limit: 1,\n cursor: 'example',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"results\": [\n {\n \"import_id\": \"string\",\n \"org_id\": \"string\",\n \"created_by\": \"string\",\n \"integration_id\": \"string\",\n \"use_case_slug\": \"string\",\n \"format\": \"csv\",\n \"status\": \"PENDING\",\n \"s3_input_ref\": {\n \"bucket\": \"string\",\n \"key\": \"string\"\n },\n \"validation\": {\n \"total_rows\": 0,\n \"blocking\": 0,\n \"warnings\": 0,\n \"entities\": {}\n },\n \"progress\": {\n \"processed_rows\": 0,\n \"total_rows\": 0\n },\n \"error\": {\n \"type\": \"VALIDATION_BLOCKED\",\n \"message\": \"string\"\n },\n \"correlation_id\": \"string\",\n \"activity_id\": \"string\",\n \"created_at\": \"1970-01-01T00:00:00.000Z\",\n \"updated_at\": \"1970-01-01T00:00:00.000Z\"\n }\n ],\n \"next_cursor\": \"string\"\n}\n```\n\n
\n\n---\n\n### `getErpImport`\n\nGet a pricing-file import job (status, counts, result links).\n\n`GET /v2/erp/imports/{importId}`\n\n```ts\nconst { data } = await client.getErpImport({\n importId: 'example',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"import_id\": \"string\",\n \"org_id\": \"string\",\n \"created_by\": \"string\",\n \"integration_id\": \"string\",\n \"use_case_slug\": \"string\",\n \"format\": \"csv\",\n \"status\": \"PENDING\",\n \"s3_input_ref\": {\n \"bucket\": \"string\",\n \"key\": \"string\"\n },\n \"validation\": {\n \"total_rows\": 0,\n \"blocking\": 0,\n \"warnings\": 0,\n \"entities\": {}\n },\n \"progress\": {\n \"processed_rows\": 0,\n \"total_rows\": 0\n },\n \"error\": {\n \"type\": \"VALIDATION_BLOCKED\",\n \"message\": \"string\"\n },\n \"correlation_id\": \"string\",\n \"activity_id\": \"string\",\n \"created_at\": \"1970-01-01T00:00:00.000Z\",\n \"updated_at\": \"1970-01-01T00:00:00.000Z\"\n}\n```\n\n
\n\n---\n\n### `executeErpImport`\n\nConfirm and run the write phase of a validated import. Only a READY job may be executed; any other status returns 409.\n\n`POST /v2/erp/imports/{importId}:execute`\n\n```ts\nconst { data } = await client.executeErpImport({\n importId: 'example',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"import_id\": \"string\",\n \"org_id\": \"string\",\n \"created_by\": \"string\",\n \"integration_id\": \"string\",\n \"use_case_slug\": \"string\",\n \"format\": \"csv\",\n \"status\": \"PENDING\",\n \"s3_input_ref\": {\n \"bucket\": \"string\",\n \"key\": \"string\"\n },\n \"validation\": {\n \"total_rows\": 0,\n \"blocking\": 0,\n \"warnings\": 0,\n \"entities\": {}\n },\n \"progress\": {\n \"processed_rows\": 0,\n \"total_rows\": 0\n },\n \"error\": {\n \"type\": \"VALIDATION_BLOCKED\",\n \"message\": \"string\"\n },\n \"correlation_id\": \"string\",\n \"activity_id\": \"string\",\n \"created_at\": \"1970-01-01T00:00:00.000Z\",\n \"updated_at\": \"1970-01-01T00:00:00.000Z\"\n}\n```\n\n
\n\n---\n\n### `abortErpImport`\n\nAsk a running import to stop. Valid while the job is VALIDATING or PROCESSING; any other status returns 409.\nThe stop is cooperative: the job passes through CANCELLING and typically reaches CANCELLED \n\n`POST /v2/erp/imports/{importId}:abort`\n\n```ts\nconst { data } = await client.abortErpImport({\n importId: 'example',\n})\n```\n\n---\n\n## Schemas\n\n### `S3Reference`\n\n```ts\ntype S3Reference = {\n bucket: string\n key: string\n}\n```\n\n### `CreateErpImportRequest`\n\n```ts\ntype CreateErpImportRequest = {\n s3_reference: {\n bucket: string\n key: string\n }\n integration_id: string\n use_case_slug?: string\n}\n```\n\n### `ErpImportValidation`\n\nValidate-phase summary: what the file will create, and whether it may be confirmed. Absent until the validate phase completes. No per-row detail is kept — a rejected file is corrected and imported again.\n\n```ts\ntype ErpImportValidation = {\n total_rows: number\n blocking: number\n warnings: number\n entities: Record\n}\n```\n\n### `ErpImportProgress`\n\nHow far the currently running phase has got. Written at every batch boundary, so it advances during long runs rather than only at the end.\n`total_rows` is ABSENT during the validate phase until the file has been read to the end — there is deliberately no counting pass, since that would be a second u\n\n```ts\ntype ErpImportProgress = {\n processed_rows: number\n total_rows?: number\n}\n```\n\n### `ErpImportError`\n\nWhy the import failed — present if and only if status = FAILED.\n\n```ts\ntype ErpImportError = {\n type: \"VALIDATION_BLOCKED\" | \"PROCESSING_ERROR\" | \"INTERNAL_ERROR\"\n message: string\n}\n```\n\n### `CreateErpImportResponse`\n\n```ts\ntype CreateErpImportResponse = {\n import_id: string\n}\n```\n\n### `ErpImportJob`\n\n```ts\ntype ErpImportJob = {\n import_id: string\n org_id: string\n created_by?: string\n integration_id: string\n use_case_slug?: string\n format: \"csv\" | \"xlsx\"\n status: \"PENDING\" | \"VALIDATING\" | \"READY\" | \"PROCESSING\" | \"IMPORTED\" | \"FAILED\" | \"CANCELLING\" | \"CANCELLED\"\n s3_input_ref: {\n bucket: string\n key: string\n }\n validation?: {\n total_rows: number\n blocking: number\n warnings: number\n entities: Record\n }\n progress?: {\n processed_rows: number\n total_rows?: number\n }\n error?: {\n type: \"VALIDATION_BLOCKED\" | \"PROCESSING_ERROR\" | \"INTERNAL_ERROR\"\n message: string\n }\n correlation_id?: string\n activity_id?: string\n created_at: string // date-time\n updated_at: string // date-time\n}\n```\n\n### `ErpImportList`\n\n```ts\ntype ErpImportList = {\n results: Array<{\n import_id: string\n org_id: string\n created_by?: string\n integration_id: string\n use_case_slug?: string\n format: \"csv\" | \"xlsx\"\n status: \"PENDING\" | \"VALIDATING\" | \"READY\" | \"PROCESSING\" | \"IMPORTED\" | \"FAILED\" | \"CANCELLING\" | \"CANCELLED\"\n s3_input_ref: {\n bucket: { ... }\n key: { ... }\n }\n validation?: {\n total_rows: { ... }\n blocking: { ... }\n warnings: { ... }\n entities: { ... }\n }\n progress?: {\n processed_rows: { ... }\n total_rows?: { ... }\n }\n error?: {\n type: { ... }\n message: { ... }\n }\n correlation_id?: string\n activity_id?: string\n created_at: string // date-time\n updated_at: string // date-time\n }>\n next_cursor?: string\n}\n```\n\n### `NotificationHistoryItem`\n\nA single notification-history row (one real notification decision).\n\n```ts\ntype NotificationHistoryItem = {\n id: string\n type: string\n state_transition?: string\n severity: \"error\" | \"warning\" | \"info\"\n title: string\n occurred_at: string // date-time\n notified: boolean\n suppressed_reason?: \"muted\" | \"debounced\" | \"recipient_opt_out\"\n recipients: string[]\n context: Record\n created_at: string // date-time\n}\n```\n\n### `NotificationHistoryResponse`\n\n```ts\ntype NotificationHistoryResponse = {\n history: Array<{\n id: string\n type: string\n state_transition?: string\n severity: \"error\" | \"warning\" | \"info\"\n title: string\n occurred_at: string // date-time\n notified: boolean\n suppressed_reason?: \"muted\" | \"debounced\" | \"recipient_opt_out\"\n recipients: string[]\n context: Record\n created_at: string // date-time\n }>\n next_cursor?: string\n}\n```\n\n### `TestNotificationRequest`\n\n```ts\ntype TestNotificationRequest = {\n kind: \"alert\" | \"digest\"\n type?: string\n channels?: \"email\" | \"in_app\"[]\n}\n```\n\n### `TestNotificationResponse`\n\n```ts\ntype TestNotificationResponse = {\n sent: boolean\n recipient: string\n channels: string[]\n notification_id?: string\n}\n```\n\n### `NotificationStatusResponse`\n\n```ts\ntype NotificationStatusResponse = {\n health: \"healthy\" | \"alerting\" | \"muted\"\n evaluated_at?: string // date-time\n rules: Array<{\n rule_id: string\n state: \"ok\" | \"alerting\" | \"recovered\"\n last_fired_at?: string // date-time\n last_cleared_at?: string // date-time\n baseline?: {\n is_mature: { ... }\n computed_at?: { ... }\n median?: { ... }\n mad?: { ... }\n upper?: { ... }\n buckets?: { ... }\n }\n }>\n}\n```\n\n### `NotificationRuleStatus`\n\n```ts\ntype NotificationRuleStatus = {\n rule_id: string\n state: \"ok\" | \"alerting\" | \"recovered\"\n last_fired_at?: string // date-time\n last_cleared_at?: string // date-time\n baseline?: {\n is_mature: boolean\n computed_at?: string // date-time\n median?: number\n mad?: number\n upper?: number\n buckets?: Array<{\n dow: { ... }\n hour: { ... }\n median: { ... }\n mad: { ... }\n }>\n }\n}\n```\n\n### `RuleBaselineStatus`\n\n```ts\ntype RuleBaselineStatus = {\n is_mature: boolean\n computed_at?: string // date-time\n median?: number\n mad?: number\n upper?: number\n buckets?: Array<{\n dow: number\n hour: number\n median: number\n mad: number\n }>\n}\n```\n\n### `RuleBaselineBucket`\n\n```ts\ntype RuleBaselineBucket = {\n dow: number\n hour: number\n median: number\n mad: number\n}\n```\n\n### `ErrorResponseBase`\n\n```ts\ntype ErrorResponseBase = {\n code?: string\n message?: string\n}\n```\n\n### `ErpEvent`\n\n```ts\ntype ErpEvent = {\n event_type: \"CREATE\" | \"UPDATE\" | \"DELETE\"\n object_type: string\n timestamp: string // date-time\n format: \"json\" | \"xml\"\n payload: string | Record\n deduplication_id?: string\n correlation_id?: string\n use_case_id?: string\n}\n```\n\n### `ErpUpdatesEventsV2Request`\n\n```ts\ntype ErpUpdatesEventsV2Request = {\n integration_id: string // uuid\n correlation_id?: string\n events: Array<{\n event_type: \"CREATE\" | \"UPDATE\" | \"DELETE\"\n object_type: string\n timestamp: string // date-time\n format: \"json\" | \"xml\"\n payload: string | Record\n deduplication_id?: string\n correlation_id?: string\n use_case_id?: string\n }>\n}\n```\n\n### `ErpEventV3`\n\n```ts\ntype ErpEventV3 = unknown | unknown\n```\n\n### `ErpUpdatesEventsV3Request`\n\n```ts\ntype ErpUpdatesEventsV3Request = {\n integration_id: string // uuid\n correlation_id?: string\n group_id?: string\n events: unknown | unknown[]\n}\n```\n\n### `TriggerErpActionRequest`\n\n```ts\ntype TriggerErpActionRequest = {\n execution_id: string\n org_id: string\n webhook_id: string\n flow_id: string\n created_at: string // date-time\n action_id: string\n flow_action_id: string\n flow_name: string\n activity_id: string\n entity_id: string\n}\n```\n\n### `TriggerWebhookResp`\n\n```ts\ntype TriggerWebhookResp = {\n status_code?: string\n message?: string\n body?: object\n code?: string\n status?: \"succeeded\" | \"failed\"\n start_date?: string\n end_date?: string\n event_id?: string\n}\n```\n\n### `IntegrationEditableFields`\n\n```ts\ntype IntegrationEditableFields = {\n name?: string\n description?: string\n access_token_ids?: string[]\n app_ids?: string[]\n environment_config?: Array<{\n key: string\n label: string\n type: \"String\" | \"SecretString\"\n description?: string\n required?: boolean\n order?: number\n }>\n settings?: {\n autoRefresh?: {\n enabled?: { ... }\n freshnessThresholdMinutes?: { ... }\n }\n notifications?: {\n enabled: { ... }\n recipients: { ... }\n defaultChannels: { ... }\n monitoredUseCases?: { ... }\n monitoredCodes?: { ... }\n rules: { ... }\n digest: { ... }\n muteUntil?: { ... }\n }\n }\n integration_type?: \"erp\" | \"connector\"\n connector_config?: {\n base_url?: string\n auth?: {\n type?: { ... }\n token_url?: { ... }\n client_id?: { ... }\n client_secret?: { ... }\n scope?: { ... }\n audience?: { ... }\n resource?: { ... }\n body_params?: { ... }\n headers?: { ... }\n query_params?: { ... }\n api_key_header?: { ... }\n api_key?: { ... }\n token?: { ... }\n }\n types_versions?: Array<{\n version: { ... }\n package_name: { ... }\n generated_at: { ... }\n generated_by: { ... }\n status: { ... }\n }>\n latest_types_version?: string\n latest_types_package_name?: string\n }\n protected?: boolean\n _manifest?: string[]\n}\n```\n\n### `ConnectorConfig`\n\nShared configuration for connector-type integrations\n\n```ts\ntype ConnectorConfig = {\n base_url?: string\n auth?: {\n type?: \"oauth2_client_credentials\" | \"api_key\" | \"bearer\"\n token_url?: string\n client_id?: string\n client_secret?: string\n scope?: string\n audience?: string\n resource?: string\n body_params?: Record\n headers?: Record\n query_params?: Record\n api_key_header?: string\n api_key?: string\n token?: string\n }\n types_versions?: Array<{\n version: string\n package_name: string\n generated_at: string // date-time\n generated_by: string\n status: \"active\" | \"deprecated\"\n }>\n latest_types_version?: string\n latest_types_package_name?: string\n}\n```\n\n### `ManagedCallAuth`\n\nAuthentication configuration for managed call requests\n\n```ts\ntype ManagedCallAuth = {\n type?: \"oauth2_client_credentials\" | \"api_key\" | \"bearer\"\n token_url?: string\n client_id?: string\n client_secret?: string\n scope?: string\n audience?: string\n resource?: string\n body_params?: Record\n headers?: Record\n query_params?: Record\n api_key_header?: string\n api_key?: string\n token?: string\n}\n```\n\n### `Integration`\n\n```ts\ntype Integration = {\n id: string // uuid\n orgId: string\n created_at: string // date-time\n updated_at: string // date-time\n name: string\n description?: string\n access_token_ids?: string[]\n app_ids?: string[]\n environment_config?: Array<{\n key: string\n label: string\n type: \"String\" | \"SecretString\"\n description?: string\n required?: boolean\n order?: number\n }>\n settings?: {\n autoRefresh?: {\n enabled?: { ... }\n freshnessThresholdMinutes?: { ... }\n }\n notifications?: {\n enabled: { ... }\n recipients: { ... }\n defaultChannels: { ... }\n monitoredUseCases?: { ... }\n monitoredCodes?: { ... }\n rules: { ... }\n digest: { ... }\n muteUntil?: { ... }\n }\n }\n integration_type?: \"erp\" | \"connector\"\n connector_config?: {\n base_url?: string\n auth?: {\n type?: { ... }\n token_url?: { ... }\n client_id?: { ... }\n client_secret?: { ... }\n scope?: { ... }\n audience?: { ... }\n resource?: { ... }\n body_params?: { ... }\n headers?: { ... }\n query_params?: { ... }\n api_key_header?: { ... }\n api_key?: { ... }\n token?: { ... }\n }\n types_versions?: Array<{\n version: { ... }\n package_name: { ... }\n generated_at: { ... }\n generated_by: { ... }\n status: { ... }\n }>\n latest_types_version?: string\n latest_types_package_name?: string\n }\n protected?: boolean\n _manifest?: string[]\n}\n```\n\n### `CreateIntegrationRequest`\n\n```ts\ntype CreateIntegrationRequest = {\n name: string\n description?: string\n access_token_ids?: string[]\n app_ids?: string[]\n environment_config?: Array<{\n key: string\n label: string\n type: \"String\" | \"SecretString\"\n description?: string\n required?: boolean\n order?: number\n }>\n settings?: {\n autoRefresh?: {\n enabled?: { ... }\n freshnessThresholdMinutes?: { ... }\n }\n notifications?: {\n enabled: { ... }\n recipients: { ... }\n defaultChannels: { ... }\n monitoredUseCases?: { ... }\n monitoredCodes?: { ... }\n rules: { ... }\n digest: { ... }\n muteUntil?: { ... }\n }\n }\n integration_type?: \"erp\" | \"connector\"\n connector_config?: {\n base_url?: string\n auth?: {\n type?: { ... }\n token_url?: { ... }\n client_id?: { ... }\n client_secret?: { ... }\n scope?: { ... }\n audience?: { ... }\n resource?: { ... }\n body_params?: { ... }\n headers?: { ... }\n query_params?: { ... }\n api_key_header?: { ... }\n api_key?: { ... }\n token?: { ... }\n }\n types_versions?: Array<{\n version: { ... }\n package_name: { ... }\n generated_at: { ... }\n generated_by: { ... }\n status: { ... }\n }>\n latest_types_version?: string\n latest_types_package_name?: string\n }\n protected?: boolean\n _manifest?: string[]\n}\n```\n\n### `UpdateIntegrationRequest`\n\n```ts\ntype UpdateIntegrationRequest = {\n name?: string\n description?: string\n access_token_ids?: string[]\n app_ids?: string[]\n environment_config?: Array<{\n key: string\n label: string\n type: \"String\" | \"SecretString\"\n description?: string\n required?: boolean\n order?: number\n }>\n settings?: {\n autoRefresh?: {\n enabled?: { ... }\n freshnessThresholdMinutes?: { ... }\n }\n notifications?: {\n enabled: { ... }\n recipients: { ... }\n defaultChannels: { ... }\n monitoredUseCases?: { ... }\n monitoredCodes?: { ... }\n rules: { ... }\n digest: { ... }\n muteUntil?: { ... }\n }\n }\n integration_type?: \"erp\" | \"connector\"\n connector_config?: {\n base_url?: string\n auth?: {\n type?: { ... }\n token_url?: { ... }\n client_id?: { ... }\n client_secret?: { ... }\n scope?: { ... }\n audience?: { ... }\n resource?: { ... }\n body_params?: { ... }\n headers?: { ... }\n query_params?: { ... }\n api_key_header?: { ... }\n api_key?: { ... }\n token?: { ... }\n }\n types_versions?: Array<{\n version: { ... }\n package_name: { ... }\n generated_at: { ... }\n generated_by: { ... }\n status: { ... }\n }>\n latest_types_version?: string\n latest_types_package_name?: string\n }\n protected?: boolean\n _manifest?: string[]\n}\n```\n\n### `EnvironmentFieldConfig`\n\n```ts\ntype EnvironmentFieldConfig = {\n key: string\n label: string\n type: \"String\" | \"SecretString\"\n description?: string\n required?: boolean\n order?: number\n}\n```\n\n### `IntegrationSettings`\n\nSettings for the integration\n\n```ts\ntype IntegrationSettings = {\n autoRefresh?: {\n enabled?: boolean\n freshnessThresholdMinutes?: number\n }\n notifications?: {\n enabled: boolean\n recipients: Array<{\n user_id: { ... }\n }>\n defaultChannels: {\n email: { ... }\n in_app: { ... }\n }\n monitoredUseCases?: string[]\n monitoredCodes?: string[]\n rules: Array<{\n id?: { ... }\n name?: { ... }\n type: { ... }\n enabled: { ... }\n channels?: { ... }\n codes?: { ... }\n threshold?: { ... }\n sensitivity?: { ... }\n fallbackThreshold?: { ... }\n window?: { ... }\n minSampleSize?: { ... }\n quietPeriod?: { ... }\n }>\n digest: {\n enabled: { ... }\n frequency: { ... }\n dayOfWeek?: { ... }\n timeOfDay: { ... }\n timezone: { ... }\n channels: { ... }\n includeHealthy: { ... }\n skipIfEmpty: { ... }\n }\n muteUntil?: string // date-time\n }\n}\n```\n\n### `AutoRefreshSettings`\n\nAuto-refresh settings for keeping integration data fresh\n\n```ts\ntype AutoRefreshSettings = {\n enabled?: boolean\n freshnessThresholdMinutes?: number\n}\n```\n\n### `IntegrationNotificationConfig`\n\nIntegration monitoring notification configuration. Rides Integration.settings.notifications (camelCase) and surfaces on both v1 and v2 GET/PUT. Unknown keys are stripped server-side to stay forward-compatible with deferred (V2) rule types.\n\n```ts\ntype IntegrationNotificationConfig = {\n enabled: boolean\n recipients: Array<{\n user_id: string\n }>\n defaultChannels: {\n email: boolean\n in_app: boolean\n }\n monitoredUseCases?: string[]\n monitoredCodes?: string[]\n rules: Array<{\n id?: string\n name?: string\n type: \"critical_error\" | \"error_threshold\" | \"warning_threshold\" | \"success_rate_drop\" | \"recovery\" | \"silence\"\n enabled: boolean\n channels?: {\n email: { ... }\n in_app: { ... }\n }\n codes?: string[]\n threshold?: number | \"auto\"\n sensitivity?: \"low\" | \"medium\" | \"high\"\n fallbackThreshold?: number\n window?: string\n minSampleSize?: number\n quietPeriod?: string\n }>\n digest: {\n enabled: boolean\n frequency: \"daily\" | \"weekly\"\n dayOfWeek?: 0 | 1 | 2 | 3 | 4 | 5 | 6\n timeOfDay: string\n timezone: string\n channels: {\n email: { ... }\n in_app: { ... }\n }\n includeHealthy: boolean\n skipIfEmpty: boolean\n }\n muteUntil?: string // date-time\n}\n```\n\n### `NotificationRecipient`\n\nA configured recipient. Only the epilot user_id is stored.\n\n```ts\ntype NotificationRecipient = {\n user_id: string\n}\n```\n\n### `NotificationChannelSet`\n\nDelivery channel toggles. New channels added in svc-notification-api inherit here.\n\n```ts\ntype NotificationChannelSet = {\n email: boolean\n in_app: boolean\n}\n```\n\n### `NotificationRule`\n\nA single notification rule. Only the params relevant to a given type are set. The id is optional on write: the server mints a ULID when omitted and preserves a supplied id verbatim (a stable id keeps a rule's AlertState across config saves).\n\n```ts\ntype NotificationRule = {\n id?: string\n name?: string\n type: \"critical_error\" | \"error_threshold\" | \"warning_threshold\" | \"success_rate_drop\" | \"recovery\" | \"silence\"\n enabled: boolean\n channels?: {\n email: boolean\n in_app: boolean\n }\n codes?: string[]\n threshold?: number | \"auto\"\n sensitivity?: \"low\" | \"medium\" | \"high\"\n fallbackThreshold?: number\n window?: string\n minSampleSize?: number\n quietPeriod?: string\n}\n```\n\n### `NotificationDigestConfig`\n\nDigest schedule and content configuration.\n\n```ts\ntype NotificationDigestConfig = {\n enabled: boolean\n frequency: \"daily\" | \"weekly\"\n dayOfWeek?: 0 | 1 | 2 | 3 | 4 | 5 | 6\n timeOfDay: string\n timezone: string\n channels: {\n email: boolean\n in_app: boolean\n }\n includeHealthy: boolean\n skipIfEmpty: boolean\n}\n```\n\n### `SetIntegrationAppMappingRequest`\n\n```ts\ntype SetIntegrationAppMappingRequest = {\n app_id: string // uuid\n component_id: string // uuid\n overwrite?: boolean\n}\n```\n\n### `DeleteIntegrationAppMappingRequest`\n\n```ts\ntype DeleteIntegrationAppMappingRequest = {\n app_id: string // uuid\n component_id: string // uuid\n}\n```\n\n### `IntegrationAppMapping`\n\n```ts\ntype IntegrationAppMapping = {\n integration_id: string // uuid\n}\n```\n\n### `IntegrationWithUseCases`\n\n```ts\ntype IntegrationWithUseCases = {\n use_cases: Array<{\n id: string // uuid\n integrationId: string // uuid\n name: string\n slug?: string\n type: \"inbound\"\n enabled: boolean\n change_description?: string\n created_at: string // date-time\n updated_at: string // date-time\n configuration?: {\n entities?: { ... }\n meter_readings?: { ... }\n }\n } | {\n id: string // uuid\n integrationId: string // uuid\n name: string\n slug?: string\n type: \"outbound\"\n enabled: boolean\n change_description?: string\n created_at: string // date-time\n updated_at: string // date-time\n configuration?: {\n event_catalog_event: { ... }\n mappings: { ... }\n }\n } | {\n id: string // uuid\n integrationId: string // uuid\n name: string\n slug?: string\n type: \"file_proxy\"\n enabled: boolean\n change_description?: string\n created_at: string // date-time\n updated_at: string // date-time\n configuration?: {\n secure_proxy?: { ... }\n auth?: { ... }\n params?: { ... }\n allowed_origins?: { ... }\n steps: { ... }\n response: { ... }\n prevent_indirect_serving?: { ... }\n }\n } | {\n id: string // uuid\n integrationId: string // uuid\n name: string\n slug?: string\n type: \"managed_call\"\n enabled: boolean\n change_description?: string\n created_at: string // date-time\n updated_at: string // date-time\n configuration?: {\n operation: { ... }\n request_mapping?: { ... }\n response_mapping?: { ... }\n inbound_use_case_slug?: { ... }\n }\n type_annotations?: {\n request?: { ... }\n response?: { ... }\n }\n types_locked?: boolean\n } | {\n id: string // uuid\n integrationId: string // uuid\n name: string\n slug?: string\n type: \"secure_proxy\"\n enabled: boolean\n change_description?: string\n created_at: string // date-time\n updated_at: string // date-time\n configuration?: {\n vpc_mode: { ... }\n allowed_domains?: { ... }\n allowed_ips?: { ... }\n }\n }>\n}\n```\n\n### `UpsertIntegrationWithUseCasesRequest`\n\n```ts\ntype UpsertIntegrationWithUseCasesRequest = {\n name: string\n description?: string\n access_token_ids?: string[]\n app_ids?: string[]\n environment_config?: Array<{\n key: string\n label: string\n type: \"String\" | \"SecretString\"\n description?: string\n required?: boolean\n order?: number\n }>\n settings?: {\n autoRefresh?: {\n enabled?: { ... }\n freshnessThresholdMinutes?: { ... }\n }\n notifications?: {\n enabled: { ... }\n recipients: { ... }\n defaultChannels: { ... }\n monitoredUseCases?: { ... }\n monitoredCodes?: { ... }\n rules: { ... }\n digest: { ... }\n muteUntil?: { ... }\n }\n }\n integration_type?: \"erp\" | \"connector\"\n connector_config?: {\n base_url?: string\n auth?: {\n type?: { ... }\n token_url?: { ... }\n client_id?: { ... }\n client_secret?: { ... }\n scope?: { ... }\n audience?: { ... }\n resource?: { ... }\n body_params?: { ... }\n headers?: { ... }\n query_params?: { ... }\n api_key_header?: { ... }\n api_key?: { ... }\n token?: { ... }\n }\n types_versions?: Array<{\n version: { ... }\n package_name: { ... }\n generated_at: { ... }\n generated_by: { ... }\n status: { ... }\n }>\n latest_types_version?: string\n latest_types_package_name?: string\n }\n protected?: boolean\n _manifest?: string[]\n use_cases?: Array<{\n id?: string // uuid\n name: string\n slug?: string\n enabled: boolean\n change_description?: string\n type: \"inbound\"\n configuration?: {\n entities?: { ... }\n meter_readings?: { ... }\n }\n } | {\n id?: string // uuid\n name: string\n slug?: string\n enabled: boolean\n change_description?: string\n type: \"outbound\"\n configuration?: {\n event_catalog_event: { ... }\n mappings: { ... }\n }\n } | {\n id?: string // uuid\n name: string\n slug?: string\n enabled: boolean\n change_description?: string\n type: \"file_proxy\"\n configuration?: {\n secure_proxy?: { ... }\n auth?: { ... }\n params?: { ... }\n allowed_origins?: { ... }\n steps: { ... }\n response: { ... }\n prevent_indirect_serving?: { ... }\n }\n } | {\n id?: string // uuid\n name: string\n // ...\n}\n```\n\n### `InboundIntegrationEventConfiguration`\n\nConfiguration for inbound use cases (ERP to epilot)\n\n```ts\ntype InboundIntegrationEventConfiguration = {\n entities?: Array<{\n entity_schema: string\n unique_ids: string[]\n jsonataExpression?: string\n enabled?: boolean | string\n mode?: \"upsert\" | \"delete\" | \"purge\" | \"upsert-prune-scope-purge\" | \"upsert-prune-scope-delete\"\n scope?: {\n scope_mode: { ... }\n schema?: { ... }\n unique_ids?: { ... }\n query?: { ... }\n }\n fields: Array<{\n attribute: { ... }\n field?: { ... }\n jsonataExpression?: { ... }\n constant?: { ... }\n _type?: { ... }\n enabled?: { ... }\n relations?: { ... }\n relation_refs?: { ... }\n file_proxy_url?: { ... }\n portal_ref?: { ... }\n env_var_ref?: { ... }\n }>\n }>\n meter_readings?: Array<{\n jsonataExpression?: string\n reading_matching?: \"external_id\" | \"strict-date\"\n mode?: \"upsert\" | \"delete\" | \"upsert-prune-scope\"\n scope?: {\n source?: { ... }\n }\n meter: {\n unique_ids: { ... }\n }\n meter_counter?: {\n unique_ids: { ... }\n }\n fields: Array<{\n attribute: { ... }\n field?: { ... }\n jsonataExpression?: { ... }\n constant?: { ... }\n _type?: { ... }\n enabled?: { ... }\n relations?: { ... }\n relation_refs?: { ... }\n file_proxy_url?: { ... }\n portal_ref?: { ... }\n env_var_ref?: { ... }\n }>\n }>\n}\n```\n\n### `OutboundIntegrationEventConfiguration`\n\nConfiguration for outbound use cases. Defines the event that triggers the flow and the webhook mappings.\n\n```ts\ntype OutboundIntegrationEventConfiguration = {\n event_catalog_event: string\n mappings: Array<{\n id?: string // uuid\n name: string\n jsonata_expression?: string\n enabled: boolean\n delivery: {\n type: { ... }\n webhook_id: { ... }\n webhook_name?: { ... }\n webhook_url?: { ... }\n } | {\n type: { ... }\n retention_days?: { ... }\n poison_policy?: { ... }\n max_delivery_attempts?: { ... }\n }\n created_at?: string // date-time\n updated_at?: string // date-time\n }>\n}\n```\n\n### `IntegrationEntity`\n\n```ts\ntype IntegrationEntity = {\n entity_schema: string\n unique_ids: string[]\n jsonataExpression?: string\n enabled?: boolean | string\n mode?: \"upsert\" | \"delete\" | \"purge\" | \"upsert-prune-scope-purge\" | \"upsert-prune-scope-delete\"\n scope?: {\n scope_mode: \"relations\" | \"query\"\n schema?: string\n unique_ids?: Array<{\n attribute: { ... }\n _type?: { ... }\n field?: { ... }\n jsonataExpression?: { ... }\n constant?: { ... }\n }>\n query?: Array<{\n attribute: { ... }\n _type?: { ... }\n field?: { ... }\n jsonataExpression?: { ... }\n constant?: { ... }\n }>\n }\n fields: Array<{\n attribute: string\n field?: string\n jsonataExpression?: string\n constant?: unknown\n _type?: \"email\" | \"phone\"\n enabled?: boolean | string\n relations?: {\n operation: { ... }\n items?: { ... }\n jsonataExpression?: { ... }\n }\n relation_refs?: {\n operation: { ... }\n items?: { ... }\n jsonataExpression?: { ... }\n }\n file_proxy_url?: {\n use_case_slug: { ... }\n params?: { ... }\n } | {\n use_case_id: { ... }\n params?: { ... }\n }\n portal_ref?: {\n filter?: { ... }\n select?: { ... }\n return?: { ... }\n } | {\n filter?: { ... }\n select?: { ... }\n return: { ... }\n jsonataExpression: { ... }\n }\n env_var_ref?: {\n key: { ... }\n default?: { ... }\n return?: { ... }\n } | {\n key: { ... }\n default?: { ... }\n return: { ... }\n jsonataExpression: { ... }\n }\n }>\n}\n```\n\n### `IntegrationMeterReading`\n\n```ts\ntype IntegrationMeterReading = {\n jsonataExpression?: string\n reading_matching?: \"external_id\" | \"strict-date\"\n mode?: \"upsert\" | \"delete\" | \"upsert-prune-scope\"\n scope?: {\n source?: string\n }\n meter: {\n unique_ids: Array<{\n attribute: { ... }\n _type?: { ... }\n field?: { ... }\n jsonataExpression?: { ... }\n constant?: { ... }\n }>\n }\n meter_counter?: {\n unique_ids: Array<{\n attribute: { ... }\n _type?: { ... }\n field?: { ... }\n jsonataExpression?: { ... }\n constant?: { ... }\n }>\n }\n fields: Array<{\n attribute: string\n field?: string\n jsonataExpression?: string\n constant?: unknown\n _type?: \"email\" | \"phone\"\n enabled?: boolean | string\n relations?: {\n operation: { ... }\n items?: { ... }\n jsonataExpression?: { ... }\n }\n relation_refs?: {\n operation: { ... }\n items?: { ... }\n jsonataExpression?: { ... }\n }\n file_proxy_url?: {\n use_case_slug: { ... }\n params?: { ... }\n } | {\n use_case_id: { ... }\n params?: { ... }\n }\n portal_ref?: {\n filter?: { ... }\n select?: { ... }\n return?: { ... }\n } | {\n filter?: { ... }\n select?: { ... }\n return: { ... }\n jsonataExpression: { ... }\n }\n env_var_ref?: {\n key: { ... }\n default?: { ... }\n return?: { ... }\n } | {\n key: { ... }\n default?: { ... }\n return: { ... }\n jsonataExpression: { ... }\n }\n }>\n}\n```\n\n### `PruneScopeConfig`\n\nScope configuration for upsert-prune-scope modes.\nDefines how to find entities that should be pruned if not in the upsert payload.\nThe scope is resolved against the original event payload (not individual array items).\n\n\n```ts\ntype PruneScopeConfig = {\n scope_mode: \"relations\" | \"query\"\n schema?: string\n unique_ids?: Array<{\n attribute: string\n _type?: \"email\" | \"phone\"\n field?: string\n jsonataExpression?: string\n constant?: unknown\n }>\n query?: Array<{\n attribute: string\n _type?: \"email\" | \"phone\"\n field?: string\n jsonataExpression?: string\n constant?: unknown\n }>\n}\n```\n\n### `MeterReadingPruneScopeConfig`\n\nScope configuration for meter reading upsert-prune-scope mode.\nThe scope is all readings for the same meter + counter.\n\n\n```ts\ntype MeterReadingPruneScopeConfig = {\n source?: string\n}\n```\n\n### `MeterUniqueIdsConfig`\n\n```ts\ntype MeterUniqueIdsConfig = {\n unique_ids: Array<{\n attribute: string\n _type?: \"email\" | \"phone\"\n field?: string\n jsonataExpression?: string\n constant?: unknown\n }>\n}\n```\n\n### `IntegrationEntityField`\n\n```ts\ntype IntegrationEntityField = {\n attribute: string\n field?: string\n jsonataExpression?: string\n constant?: unknown\n _type?: \"email\" | \"phone\"\n enabled?: boolean | string\n relations?: {\n operation: \"_set\" | \"_append\" | \"_append_all\"\n items?: Array<{\n entity_schema: { ... }\n _tags?: { ... }\n unique_ids: { ... }\n }>\n jsonataExpression?: string\n }\n relation_refs?: {\n operation: \"_set\" | \"_append\" | \"_append_all\"\n items?: Array<{\n entity_schema: { ... }\n unique_ids: { ... }\n path: { ... }\n value: { ... }\n }>\n jsonataExpression?: string\n }\n file_proxy_url?: {\n use_case_slug: string\n params?: Record\n } | {\n use_case_id: string\n params?: Record\n }\n portal_ref?: {\n filter?: {\n origin?: { ... }\n enabled?: { ... }\n is_dummy?: { ... }\n is_epilot_domain?: { ... }\n name?: { ... }\n domain?: { ... }\n }\n select?: \"single\" | \"all\"\n return?: \"portal_id\" | \"origin\" | \"domain\" | \"name\"\n } | {\n filter?: {\n origin?: { ... }\n enabled?: { ... }\n is_dummy?: { ... }\n is_epilot_domain?: { ... }\n name?: { ... }\n domain?: { ... }\n }\n select?: \"single\" | \"all\"\n return: \"jsonata\"\n jsonataExpression: string\n }\n env_var_ref?: {\n key: string\n default?: string\n return?: \"value\"\n } | {\n key: string\n default?: string\n return: \"jsonata\"\n jsonataExpression: string\n }\n}\n```\n\n### `FileProxyUrlParam`\n\nParameter for file proxy URL. Exactly one of field, constant, or jsonataExpression must be set.\n\n```ts\ntype FileProxyUrlParam = {\n field: string\n} | {\n constant: unknown\n} | {\n jsonataExpression: string\n}\n```\n\n### `FileProxyUrlParams`\n\nCustom query parameters. Keys become URL param names, values resolved from payload.\n\n```ts\ntype FileProxyUrlParams = Record\n```\n\n### `FileProxyUrlConfig`\n\nAuto-constructs a file proxy download URL. orgId and integrationId are injected from context. Exactly one of use_case_id or use_case_slug must be provided. Using use_case_slug is recommended as it is portable across environments.\n\n\n```ts\ntype FileProxyUrlConfig = {\n use_case_slug: string\n params?: Record\n} | {\n use_case_id: string\n params?: Record\n}\n```\n\n### `PortalOrigin`\n\nOrigin/type of an epilot portal configuration.\n\n```ts\ntype PortalOrigin = \"END_CUSTOMER_PORTAL\" | \"INSTALLER_PORTAL\" | \"B2B_PORTAL\" | \"ADDITIONAL_PORTAL\"\n```\n\n### `PortalRefFilter`\n\nFilter applied to the org's portal configurations before selection. All filters default to \"match any\" except `enabled` (default `true`) and `is_dummy` (default `false`). Set `enabled` or `is_dummy` to `null` to opt out of the default.\n\n\n```ts\ntype PortalRefFilter = {\n origin?: \"END_CUSTOMER_PORTAL\" | \"INSTALLER_PORTAL\" | \"B2B_PORTAL\" | \"ADDITIONAL_PORTAL\" | \"END_CUSTOMER_PORTAL\" | \"INSTALLER_PORTAL\" | \"B2B_PORTAL\" | \"ADDITIONAL_PORTAL\"[]\n enabled?: boolean\n is_dummy?: boolean\n is_epilot_domain?: boolean\n name?: string\n domain?: string\n}\n```\n\n### `PortalRefConfig`\n\nResolves to a property of one of the calling organization's epilot portal configurations at runtime, replacing hard-coded environment-specific portal UUIDs in inbound mappings. Matched portals are sorted ascending by `(_created_at, portal_id)`; portals without `_created_at` sort first (treated as ol\n\n```ts\ntype PortalRefConfig = {\n filter?: {\n origin?: \"END_CUSTOMER_PORTAL\" | \"INSTALLER_PORTAL\" | \"B2B_PORTAL\" | \"ADDITIONAL_PORTAL\" | \"END_CUSTOMER_PORTAL\" | \"INSTALLER_PORTAL\" | \"B2B_PORTAL\" | \"ADDITIONAL_PORTAL\"[]\n enabled?: boolean\n is_dummy?: boolean\n is_epilot_domain?: boolean\n name?: string\n domain?: string\n }\n select?: \"single\" | \"all\"\n return?: \"portal_id\" | \"origin\" | \"domain\" | \"name\"\n} | {\n filter?: {\n origin?: \"END_CUSTOMER_PORTAL\" | \"INSTALLER_PORTAL\" | \"B2B_PORTAL\" | \"ADDITIONAL_PORTAL\" | \"END_CUSTOMER_PORTAL\" | \"INSTALLER_PORTAL\" | \"B2B_PORTAL\" | \"ADDITIONAL_PORTAL\"[]\n enabled?: boolean\n is_dummy?: boolean\n is_epilot_domain?: boolean\n name?: string\n domain?: string\n }\n select?: \"single\" | \"all\"\n return: \"jsonata\"\n jsonataExpression: string\n}\n```\n\n### `EnvVarRefConfig`\n\nResolves to an org-scoped environment variable from the epilot environments-api service at runtime, replacing hard-coded environment-specific values (URLs, prefixes, identifiers) in inbound mappings. Secrets (`SecretString` values) are never exposed; the runtime treats both \"missing key\" and \"secret\n\n```ts\ntype EnvVarRefConfig = {\n key: string\n default?: string\n return?: \"value\"\n} | {\n key: string\n default?: string\n return: \"jsonata\"\n jsonataExpression: string\n}\n```\n\n### `EmbeddedUseCaseRequest`\n\n```ts\ntype EmbeddedUseCaseRequest = {\n id?: string // uuid\n name: string\n slug?: string\n enabled: boolean\n change_description?: string\n type: \"inbound\"\n configuration?: {\n entities?: Array<{\n entity_schema: { ... }\n unique_ids: { ... }\n jsonataExpression?: { ... }\n enabled?: { ... }\n mode?: { ... }\n scope?: { ... }\n fields: { ... }\n }>\n meter_readings?: Array<{\n jsonataExpression?: { ... }\n reading_matching?: { ... }\n mode?: { ... }\n scope?: { ... }\n meter: { ... }\n meter_counter?: { ... }\n fields: { ... }\n }>\n }\n} | {\n id?: string // uuid\n name: string\n slug?: string\n enabled: boolean\n change_description?: string\n type: \"outbound\"\n configuration?: {\n event_catalog_event: string\n mappings: Array<{\n id?: { ... }\n name: { ... }\n jsonata_expression?: { ... }\n enabled: { ... }\n delivery: { ... }\n created_at?: { ... }\n updated_at?: { ... }\n }>\n }\n} | {\n id?: string // uuid\n name: string\n slug?: string\n enabled: boolean\n change_description?: string\n type: \"file_proxy\"\n configuration?: {\n secure_proxy?: {\n use_case_slug: { ... }\n }\n auth?: {\n type: { ... }\n token_url: { ... }\n client_id: { ... }\n client_secret: { ... }\n scope?: { ... }\n audience?: { ... }\n resource?: { ... }\n username?: { ... }\n password?: { ... }\n body_params?: { ... }\n headers?: { ... }\n query_params?: { ... }\n }\n params?: Array<{\n name: { ... }\n required: { ... }\n description?: { ... }\n }>\n allowed_origins?: string // uri[]\n steps: Array<{\n url: { ... }\n method: { ... }\n headers?: { ... }\n body?: { ... }\n response_type: { ... }\n }>\n response: {\n body: { ... }\n encoding: { ... }\n filename?: { ... }\n content_type?: { ... }\n }\n prevent_indirect_serving?: boolean\n }\n} | {\n id?: string // uuid\n name: string\n slug?: string\n enabled: boolean\n change_description?: string\n type: \"managed_call\"\n configuration?: {\n // ...\n}\n```\n\n### `EmbeddedUseCaseRequestBase`\n\n```ts\ntype EmbeddedUseCaseRequestBase = {\n id?: string // uuid\n name: string\n slug?: string\n enabled: boolean\n change_description?: string\n}\n```\n\n### `EmbeddedInboundUseCaseRequest`\n\n```ts\ntype EmbeddedInboundUseCaseRequest = {\n id?: string // uuid\n name: string\n slug?: string\n enabled: boolean\n change_description?: string\n type: \"inbound\"\n configuration?: {\n entities?: Array<{\n entity_schema: { ... }\n unique_ids: { ... }\n jsonataExpression?: { ... }\n enabled?: { ... }\n mode?: { ... }\n scope?: { ... }\n fields: { ... }\n }>\n meter_readings?: Array<{\n jsonataExpression?: { ... }\n reading_matching?: { ... }\n mode?: { ... }\n scope?: { ... }\n meter: { ... }\n meter_counter?: { ... }\n fields: { ... }\n }>\n }\n}\n```\n\n### `EmbeddedOutboundUseCaseRequest`\n\n```ts\ntype EmbeddedOutboundUseCaseRequest = {\n id?: string // uuid\n name: string\n slug?: string\n enabled: boolean\n change_description?: string\n type: \"outbound\"\n configuration?: {\n event_catalog_event: string\n mappings: Array<{\n id?: { ... }\n name: { ... }\n jsonata_expression?: { ... }\n enabled: { ... }\n delivery: { ... }\n created_at?: { ... }\n updated_at?: { ... }\n }>\n }\n}\n```\n\n### `EmbeddedFileProxyUseCaseRequest`\n\n```ts\ntype EmbeddedFileProxyUseCaseRequest = {\n id?: string // uuid\n name: string\n slug?: string\n enabled: boolean\n change_description?: string\n type: \"file_proxy\"\n configuration?: {\n secure_proxy?: {\n use_case_slug: { ... }\n }\n auth?: {\n type: { ... }\n token_url: { ... }\n client_id: { ... }\n client_secret: { ... }\n scope?: { ... }\n audience?: { ... }\n resource?: { ... }\n username?: { ... }\n password?: { ... }\n body_params?: { ... }\n headers?: { ... }\n query_params?: { ... }\n }\n params?: Array<{\n name: { ... }\n required: { ... }\n description?: { ... }\n }>\n allowed_origins?: string // uri[]\n steps: Array<{\n url: { ... }\n method: { ... }\n headers?: { ... }\n body?: { ... }\n response_type: { ... }\n }>\n response: {\n body: { ... }\n encoding: { ... }\n filename?: { ... }\n content_type?: { ... }\n }\n prevent_indirect_serving?: boolean\n }\n}\n```\n\n### `EmbeddedManagedCallUseCaseRequest`\n\n```ts\ntype EmbeddedManagedCallUseCaseRequest = {\n id?: string // uuid\n name: string\n slug?: string\n enabled: boolean\n change_description?: string\n type: \"managed_call\"\n configuration?: {\n operation: {\n method: { ... }\n path: { ... }\n headers?: { ... }\n query_params?: { ... }\n }\n request_mapping?: string\n response_mapping?: string\n inbound_use_case_slug?: string\n }\n}\n```\n\n### `EmbeddedSecureProxyUseCaseRequest`\n\n```ts\ntype EmbeddedSecureProxyUseCaseRequest = {\n id?: string // uuid\n name: string\n slug?: string\n enabled: boolean\n change_description?: string\n type: \"secure_proxy\"\n configuration?: {\n vpc_mode: \"static_ip\" | \"secure_link\"\n allowed_domains?: string[]\n allowed_ips?: string[]\n }\n}\n```\n\n### `UseCaseBase`\n\n```ts\ntype UseCaseBase = {\n id: string // uuid\n integrationId: string // uuid\n name: string\n slug?: string\n type: \"inbound\" | \"outbound\" | \"file_proxy\" | \"managed_call\" | \"secure_proxy\"\n enabled: boolean\n change_description?: string\n created_at: string // date-time\n updated_at: string // date-time\n}\n```\n\n### `InboundUseCase`\n\n```ts\ntype InboundUseCase = {\n id: string // uuid\n integrationId: string // uuid\n name: string\n slug?: string\n type: \"inbound\"\n enabled: boolean\n change_description?: string\n created_at: string // date-time\n updated_at: string // date-time\n configuration?: {\n entities?: Array<{\n entity_schema: { ... }\n unique_ids: { ... }\n jsonataExpression?: { ... }\n enabled?: { ... }\n mode?: { ... }\n scope?: { ... }\n fields: { ... }\n }>\n meter_readings?: Array<{\n jsonataExpression?: { ... }\n reading_matching?: { ... }\n mode?: { ... }\n scope?: { ... }\n meter: { ... }\n meter_counter?: { ... }\n fields: { ... }\n }>\n }\n}\n```\n\n### `OutboundUseCase`\n\n```ts\ntype OutboundUseCase = {\n id: string // uuid\n integrationId: string // uuid\n name: string\n slug?: string\n type: \"outbound\"\n enabled: boolean\n change_description?: string\n created_at: string // date-time\n updated_at: string // date-time\n configuration?: {\n event_catalog_event: string\n mappings: Array<{\n id?: { ... }\n name: { ... }\n jsonata_expression?: { ... }\n enabled: { ... }\n delivery: { ... }\n created_at?: { ... }\n updated_at?: { ... }\n }>\n }\n}\n```\n\n### `FileProxyUseCase`\n\n```ts\ntype FileProxyUseCase = {\n id: string // uuid\n integrationId: string // uuid\n name: string\n slug?: string\n type: \"file_proxy\"\n enabled: boolean\n change_description?: string\n created_at: string // date-time\n updated_at: string // date-time\n configuration?: {\n secure_proxy?: {\n use_case_slug: { ... }\n }\n auth?: {\n type: { ... }\n token_url: { ... }\n client_id: { ... }\n client_secret: { ... }\n scope?: { ... }\n audience?: { ... }\n resource?: { ... }\n username?: { ... }\n password?: { ... }\n body_params?: { ... }\n headers?: { ... }\n query_params?: { ... }\n }\n params?: Array<{\n name: { ... }\n required: { ... }\n description?: { ... }\n }>\n allowed_origins?: string // uri[]\n steps: Array<{\n url: { ... }\n method: { ... }\n headers?: { ... }\n body?: { ... }\n response_type: { ... }\n }>\n response: {\n body: { ... }\n encoding: { ... }\n filename?: { ... }\n content_type?: { ... }\n }\n prevent_indirect_serving?: boolean\n }\n}\n```\n\n### `ManagedCallUseCase`\n\n```ts\ntype ManagedCallUseCase = {\n id: string // uuid\n integrationId: string // uuid\n name: string\n slug?: string\n type: \"managed_call\"\n enabled: boolean\n change_description?: string\n created_at: string // date-time\n updated_at: string // date-time\n configuration?: {\n operation: {\n method: { ... }\n path: { ... }\n headers?: { ... }\n query_params?: { ... }\n }\n request_mapping?: string\n response_mapping?: string\n inbound_use_case_slug?: string\n }\n type_annotations?: {\n request?: Record\n response?: Record\n }\n types_locked?: boolean\n}\n```\n\n### `SecureProxyUseCase`\n\n```ts\ntype SecureProxyUseCase = {\n id: string // uuid\n integrationId: string // uuid\n name: string\n slug?: string\n type: \"secure_proxy\"\n enabled: boolean\n change_description?: string\n created_at: string // date-time\n updated_at: string // date-time\n configuration?: {\n vpc_mode: \"static_ip\" | \"secure_link\"\n allowed_domains?: string[]\n allowed_ips?: string[]\n }\n}\n```\n\n### `UseCase`\n\n```ts\ntype UseCase = {\n id: string // uuid\n integrationId: string // uuid\n name: string\n slug?: string\n type: \"inbound\"\n enabled: boolean\n change_description?: string\n created_at: string // date-time\n updated_at: string // date-time\n configuration?: {\n entities?: Array<{\n entity_schema: { ... }\n unique_ids: { ... }\n jsonataExpression?: { ... }\n enabled?: { ... }\n mode?: { ... }\n scope?: { ... }\n fields: { ... }\n }>\n meter_readings?: Array<{\n jsonataExpression?: { ... }\n reading_matching?: { ... }\n mode?: { ... }\n scope?: { ... }\n meter: { ... }\n meter_counter?: { ... }\n fields: { ... }\n }>\n }\n} | {\n id: string // uuid\n integrationId: string // uuid\n name: string\n slug?: string\n type: \"outbound\"\n enabled: boolean\n change_description?: string\n created_at: string // date-time\n updated_at: string // date-time\n configuration?: {\n event_catalog_event: string\n mappings: Array<{\n id?: { ... }\n name: { ... }\n jsonata_expression?: { ... }\n enabled: { ... }\n delivery: { ... }\n created_at?: { ... }\n updated_at?: { ... }\n }>\n }\n} | {\n id: string // uuid\n integrationId: string // uuid\n name: string\n slug?: string\n type: \"file_proxy\"\n enabled: boolean\n change_description?: string\n created_at: string // date-time\n updated_at: string // date-time\n configuration?: {\n secure_proxy?: {\n use_case_slug: { ... }\n }\n auth?: {\n type: { ... }\n token_url: { ... }\n client_id: { ... }\n client_secret: { ... }\n scope?: { ... }\n audience?: { ... }\n resource?: { ... }\n username?: { ... }\n password?: { ... }\n body_params?: { ... }\n headers?: { ... }\n query_params?: { ... }\n }\n params?: Array<{\n name: { ... }\n required: { ... }\n description?: { ... }\n }>\n allowed_origins?: string // uri[]\n steps: Array<{\n url: { ... }\n method: { ... }\n headers?: { ... }\n body?: { ... }\n response_type: { ... }\n }>\n response: {\n body: { ... }\n encoding: { ... }\n filename?: { ... }\n content_type?: { ... }\n }\n prevent_indirect_serving?: boolean\n // ...\n}\n```\n\n### `CreateUseCaseRequest`\n\n```ts\ntype CreateUseCaseRequest = {\n name: string\n slug: string\n enabled: boolean\n type: \"inbound\"\n configuration?: {\n entities?: Array<{\n entity_schema: { ... }\n unique_ids: { ... }\n jsonataExpression?: { ... }\n enabled?: { ... }\n mode?: { ... }\n scope?: { ... }\n fields: { ... }\n }>\n meter_readings?: Array<{\n jsonataExpression?: { ... }\n reading_matching?: { ... }\n mode?: { ... }\n scope?: { ... }\n meter: { ... }\n meter_counter?: { ... }\n fields: { ... }\n }>\n }\n} | {\n name: string\n slug: string\n enabled: boolean\n type: \"outbound\"\n configuration?: {\n event_catalog_event: string\n mappings: Array<{\n id?: { ... }\n name: { ... }\n jsonata_expression?: { ... }\n enabled: { ... }\n delivery: { ... }\n created_at?: { ... }\n updated_at?: { ... }\n }>\n }\n} | {\n name: string\n slug: string\n enabled: boolean\n type: \"file_proxy\"\n configuration?: {\n secure_proxy?: {\n use_case_slug: { ... }\n }\n auth?: {\n type: { ... }\n token_url: { ... }\n client_id: { ... }\n client_secret: { ... }\n scope?: { ... }\n audience?: { ... }\n resource?: { ... }\n username?: { ... }\n password?: { ... }\n body_params?: { ... }\n headers?: { ... }\n query_params?: { ... }\n }\n params?: Array<{\n name: { ... }\n required: { ... }\n description?: { ... }\n }>\n allowed_origins?: string // uri[]\n steps: Array<{\n url: { ... }\n method: { ... }\n headers?: { ... }\n body?: { ... }\n response_type: { ... }\n }>\n response: {\n body: { ... }\n encoding: { ... }\n filename?: { ... }\n content_type?: { ... }\n }\n prevent_indirect_serving?: boolean\n }\n} | {\n name: string\n slug: string\n enabled: boolean\n type: \"managed_call\"\n configuration?: {\n operation: {\n method: { ... }\n path: { ... }\n headers?: { ... }\n query_params?: { ... }\n }\n request_mapping?: string\n response_mapping?: string\n // ...\n}\n```\n\n### `CreateUseCaseRequestBase`\n\n```ts\ntype CreateUseCaseRequestBase = {\n name: string\n slug: string\n enabled: boolean\n}\n```\n\n### `CreateInboundUseCaseRequest`\n\n```ts\ntype CreateInboundUseCaseRequest = {\n name: string\n slug: string\n enabled: boolean\n type: \"inbound\"\n configuration?: {\n entities?: Array<{\n entity_schema: { ... }\n unique_ids: { ... }\n jsonataExpression?: { ... }\n enabled?: { ... }\n mode?: { ... }\n scope?: { ... }\n fields: { ... }\n }>\n meter_readings?: Array<{\n jsonataExpression?: { ... }\n reading_matching?: { ... }\n mode?: { ... }\n scope?: { ... }\n meter: { ... }\n meter_counter?: { ... }\n fields: { ... }\n }>\n }\n}\n```\n\n### `CreateOutboundUseCaseRequest`\n\n```ts\ntype CreateOutboundUseCaseRequest = {\n name: string\n slug: string\n enabled: boolean\n type: \"outbound\"\n configuration?: {\n event_catalog_event: string\n mappings: Array<{\n id?: { ... }\n name: { ... }\n jsonata_expression?: { ... }\n enabled: { ... }\n delivery: { ... }\n created_at?: { ... }\n updated_at?: { ... }\n }>\n }\n}\n```\n\n### `CreateFileProxyUseCaseRequest`\n\n```ts\ntype CreateFileProxyUseCaseRequest = {\n name: string\n slug: string\n enabled: boolean\n type: \"file_proxy\"\n configuration?: {\n secure_proxy?: {\n use_case_slug: { ... }\n }\n auth?: {\n type: { ... }\n token_url: { ... }\n client_id: { ... }\n client_secret: { ... }\n scope?: { ... }\n audience?: { ... }\n resource?: { ... }\n username?: { ... }\n password?: { ... }\n body_params?: { ... }\n headers?: { ... }\n query_params?: { ... }\n }\n params?: Array<{\n name: { ... }\n required: { ... }\n description?: { ... }\n }>\n allowed_origins?: string // uri[]\n steps: Array<{\n url: { ... }\n method: { ... }\n headers?: { ... }\n body?: { ... }\n response_type: { ... }\n }>\n response: {\n body: { ... }\n encoding: { ... }\n filename?: { ... }\n content_type?: { ... }\n }\n prevent_indirect_serving?: boolean\n }\n}\n```\n\n### `CreateManagedCallUseCaseRequest`\n\n```ts\ntype CreateManagedCallUseCaseRequest = {\n name: string\n slug: string\n enabled: boolean\n type: \"managed_call\"\n configuration?: {\n operation: {\n method: { ... }\n path: { ... }\n headers?: { ... }\n query_params?: { ... }\n }\n request_mapping?: string\n response_mapping?: string\n inbound_use_case_slug?: string\n }\n}\n```\n\n### `CreateSecureProxyUseCaseRequest`\n\n```ts\ntype CreateSecureProxyUseCaseRequest = {\n name: string\n slug: string\n enabled: boolean\n type: \"secure_proxy\"\n configuration?: {\n vpc_mode: \"static_ip\" | \"secure_link\"\n allowed_domains?: string[]\n allowed_ips?: string[]\n }\n}\n```\n\n### `UpdateUseCaseRequest`\n\n```ts\ntype UpdateUseCaseRequest = {\n name?: string\n slug?: string\n enabled?: boolean\n change_description?: string\n type?: \"inbound\"\n configuration?: {\n entities?: Array<{\n entity_schema: { ... }\n unique_ids: { ... }\n jsonataExpression?: { ... }\n enabled?: { ... }\n mode?: { ... }\n scope?: { ... }\n fields: { ... }\n }>\n meter_readings?: Array<{\n jsonataExpression?: { ... }\n reading_matching?: { ... }\n mode?: { ... }\n scope?: { ... }\n meter: { ... }\n meter_counter?: { ... }\n fields: { ... }\n }>\n }\n} | {\n name?: string\n slug?: string\n enabled?: boolean\n change_description?: string\n type?: \"outbound\"\n configuration?: {\n event_catalog_event: string\n mappings: Array<{\n id?: { ... }\n name: { ... }\n jsonata_expression?: { ... }\n enabled: { ... }\n delivery: { ... }\n created_at?: { ... }\n updated_at?: { ... }\n }>\n }\n} | {\n name?: string\n slug?: string\n enabled?: boolean\n change_description?: string\n type?: \"file_proxy\"\n configuration?: {\n secure_proxy?: {\n use_case_slug: { ... }\n }\n auth?: {\n type: { ... }\n token_url: { ... }\n client_id: { ... }\n client_secret: { ... }\n scope?: { ... }\n audience?: { ... }\n resource?: { ... }\n username?: { ... }\n password?: { ... }\n body_params?: { ... }\n headers?: { ... }\n query_params?: { ... }\n }\n params?: Array<{\n name: { ... }\n required: { ... }\n description?: { ... }\n }>\n allowed_origins?: string // uri[]\n steps: Array<{\n url: { ... }\n method: { ... }\n headers?: { ... }\n body?: { ... }\n response_type: { ... }\n }>\n response: {\n body: { ... }\n encoding: { ... }\n filename?: { ... }\n content_type?: { ... }\n }\n prevent_indirect_serving?: boolean\n }\n} | {\n name?: string\n slug?: string\n enabled?: boolean\n change_description?: string\n type?: \"managed_call\"\n configuration?: {\n operation: {\n method: { ... }\n path: { ... }\n headers?: { ... }\n // ...\n}\n```\n\n### `UpdateUseCaseRequestBase`\n\n```ts\ntype UpdateUseCaseRequestBase = {\n name?: string\n slug?: string\n enabled?: boolean\n change_description?: string\n}\n```\n\n### `UpdateInboundUseCaseRequest`\n\n```ts\ntype UpdateInboundUseCaseRequest = {\n name?: string\n slug?: string\n enabled?: boolean\n change_description?: string\n type?: \"inbound\"\n configuration?: {\n entities?: Array<{\n entity_schema: { ... }\n unique_ids: { ... }\n jsonataExpression?: { ... }\n enabled?: { ... }\n mode?: { ... }\n scope?: { ... }\n fields: { ... }\n }>\n meter_readings?: Array<{\n jsonataExpression?: { ... }\n reading_matching?: { ... }\n mode?: { ... }\n scope?: { ... }\n meter: { ... }\n meter_counter?: { ... }\n fields: { ... }\n }>\n }\n}\n```\n\n### `UpdateOutboundUseCaseRequest`\n\n```ts\ntype UpdateOutboundUseCaseRequest = {\n name?: string\n slug?: string\n enabled?: boolean\n change_description?: string\n type?: \"outbound\"\n configuration?: {\n event_catalog_event: string\n mappings: Array<{\n id?: { ... }\n name: { ... }\n jsonata_expression?: { ... }\n enabled: { ... }\n delivery: { ... }\n created_at?: { ... }\n updated_at?: { ... }\n }>\n }\n}\n```\n\n### `UpdateFileProxyUseCaseRequest`\n\n```ts\ntype UpdateFileProxyUseCaseRequest = {\n name?: string\n slug?: string\n enabled?: boolean\n change_description?: string\n type?: \"file_proxy\"\n configuration?: {\n secure_proxy?: {\n use_case_slug: { ... }\n }\n auth?: {\n type: { ... }\n token_url: { ... }\n client_id: { ... }\n client_secret: { ... }\n scope?: { ... }\n audience?: { ... }\n resource?: { ... }\n username?: { ... }\n password?: { ... }\n body_params?: { ... }\n headers?: { ... }\n query_params?: { ... }\n }\n params?: Array<{\n name: { ... }\n required: { ... }\n description?: { ... }\n }>\n allowed_origins?: string // uri[]\n steps: Array<{\n url: { ... }\n method: { ... }\n headers?: { ... }\n body?: { ... }\n response_type: { ... }\n }>\n response: {\n body: { ... }\n encoding: { ... }\n filename?: { ... }\n content_type?: { ... }\n }\n prevent_indirect_serving?: boolean\n }\n}\n```\n\n### `UpdateManagedCallUseCaseRequest`\n\n```ts\ntype UpdateManagedCallUseCaseRequest = {\n name?: string\n slug?: string\n enabled?: boolean\n change_description?: string\n type?: \"managed_call\"\n configuration?: {\n operation: {\n method: { ... }\n path: { ... }\n headers?: { ... }\n query_params?: { ... }\n }\n request_mapping?: string\n response_mapping?: string\n inbound_use_case_slug?: string\n }\n type_annotations?: {\n request?: Record\n response?: Record\n }\n}\n```\n\n### `UpdateSecureProxyUseCaseRequest`\n\n```ts\ntype UpdateSecureProxyUseCaseRequest = {\n name?: string\n slug?: string\n enabled?: boolean\n change_description?: string\n type?: \"secure_proxy\"\n configuration?: {\n vpc_mode: \"static_ip\" | \"secure_link\"\n allowed_domains?: string[]\n allowed_ips?: string[]\n }\n}\n```\n\n### `UseCaseHistoryEntry`\n\n```ts\ntype UseCaseHistoryEntry = {\n id: string // uuid\n useCaseId: string // uuid\n integrationId: string // uuid\n name: string\n slug?: string\n enabled: boolean\n change_description?: string\n changed_by?: string\n created_at: string // date-time\n updated_at: string // date-time\n history_created_at: string // date-time\n type: \"inbound\"\n configuration?: {\n entities?: Array<{\n entity_schema: { ... }\n unique_ids: { ... }\n jsonataExpression?: { ... }\n enabled?: { ... }\n mode?: { ... }\n scope?: { ... }\n fields: { ... }\n }>\n meter_readings?: Array<{\n jsonataExpression?: { ... }\n reading_matching?: { ... }\n mode?: { ... }\n scope?: { ... }\n meter: { ... }\n meter_counter?: { ... }\n fields: { ... }\n }>\n }\n} | {\n id: string // uuid\n useCaseId: string // uuid\n integrationId: string // uuid\n name: string\n slug?: string\n enabled: boolean\n change_description?: string\n changed_by?: string\n created_at: string // date-time\n updated_at: string // date-time\n history_created_at: string // date-time\n type: \"outbound\"\n configuration?: {\n event_catalog_event: string\n mappings: Array<{\n id?: { ... }\n name: { ... }\n jsonata_expression?: { ... }\n enabled: { ... }\n delivery: { ... }\n created_at?: { ... }\n updated_at?: { ... }\n }>\n }\n} | {\n id: string // uuid\n useCaseId: string // uuid\n integrationId: string // uuid\n name: string\n slug?: string\n enabled: boolean\n change_description?: string\n changed_by?: string\n created_at: string // date-time\n updated_at: string // date-time\n history_created_at: string // date-time\n type: \"file_proxy\"\n configuration?: {\n secure_proxy?: {\n use_case_slug: { ... }\n }\n auth?: {\n type: { ... }\n token_url: { ... }\n client_id: { ... }\n client_secret: { ... }\n scope?: { ... }\n audience?: { ... }\n resource?: { ... }\n username?: { ... }\n password?: { ... }\n body_params?: { ... }\n headers?: { ... }\n query_params?: { ... }\n }\n params?: Array<{\n name: { ... }\n required: { ... }\n description?: { ... }\n }>\n allowed_origins?: string // uri[]\n steps: Array<{\n url: { ... }\n method: { ... }\n headers?: { ... }\n body?: { ... }\n // ...\n}\n```\n\n### `UseCaseHistoryEntryBase`\n\n```ts\ntype UseCaseHistoryEntryBase = {\n id: string // uuid\n useCaseId: string // uuid\n integrationId: string // uuid\n name: string\n slug?: string\n enabled: boolean\n change_description?: string\n changed_by?: string\n created_at: string // date-time\n updated_at: string // date-time\n history_created_at: string // date-time\n}\n```\n\n### `InboundUseCaseHistoryEntry`\n\n```ts\ntype InboundUseCaseHistoryEntry = {\n id: string // uuid\n useCaseId: string // uuid\n integrationId: string // uuid\n name: string\n slug?: string\n enabled: boolean\n change_description?: string\n changed_by?: string\n created_at: string // date-time\n updated_at: string // date-time\n history_created_at: string // date-time\n type: \"inbound\"\n configuration?: {\n entities?: Array<{\n entity_schema: { ... }\n unique_ids: { ... }\n jsonataExpression?: { ... }\n enabled?: { ... }\n mode?: { ... }\n scope?: { ... }\n fields: { ... }\n }>\n meter_readings?: Array<{\n jsonataExpression?: { ... }\n reading_matching?: { ... }\n mode?: { ... }\n scope?: { ... }\n meter: { ... }\n meter_counter?: { ... }\n fields: { ... }\n }>\n }\n}\n```\n\n### `OutboundUseCaseHistoryEntry`\n\n```ts\ntype OutboundUseCaseHistoryEntry = {\n id: string // uuid\n useCaseId: string // uuid\n integrationId: string // uuid\n name: string\n slug?: string\n enabled: boolean\n change_description?: string\n changed_by?: string\n created_at: string // date-time\n updated_at: string // date-time\n history_created_at: string // date-time\n type: \"outbound\"\n configuration?: {\n event_catalog_event: string\n mappings: Array<{\n id?: { ... }\n name: { ... }\n jsonata_expression?: { ... }\n enabled: { ... }\n delivery: { ... }\n created_at?: { ... }\n updated_at?: { ... }\n }>\n }\n}\n```\n\n### `FileProxyUseCaseHistoryEntry`\n\n```ts\ntype FileProxyUseCaseHistoryEntry = {\n id: string // uuid\n useCaseId: string // uuid\n integrationId: string // uuid\n name: string\n slug?: string\n enabled: boolean\n change_description?: string\n changed_by?: string\n created_at: string // date-time\n updated_at: string // date-time\n history_created_at: string // date-time\n type: \"file_proxy\"\n configuration?: {\n secure_proxy?: {\n use_case_slug: { ... }\n }\n auth?: {\n type: { ... }\n token_url: { ... }\n client_id: { ... }\n client_secret: { ... }\n scope?: { ... }\n audience?: { ... }\n resource?: { ... }\n username?: { ... }\n password?: { ... }\n body_params?: { ... }\n headers?: { ... }\n query_params?: { ... }\n }\n params?: Array<{\n name: { ... }\n required: { ... }\n description?: { ... }\n }>\n allowed_origins?: string // uri[]\n steps: Array<{\n url: { ... }\n method: { ... }\n headers?: { ... }\n body?: { ... }\n response_type: { ... }\n }>\n response: {\n body: { ... }\n encoding: { ... }\n filename?: { ... }\n content_type?: { ... }\n }\n prevent_indirect_serving?: boolean\n }\n}\n```\n\n### `ManagedCallUseCaseHistoryEntry`\n\n```ts\ntype ManagedCallUseCaseHistoryEntry = {\n id: string // uuid\n useCaseId: string // uuid\n integrationId: string // uuid\n name: string\n slug?: string\n enabled: boolean\n change_description?: string\n changed_by?: string\n created_at: string // date-time\n updated_at: string // date-time\n history_created_at: string // date-time\n type: \"managed_call\"\n configuration?: {\n operation: {\n method: { ... }\n path: { ... }\n headers?: { ... }\n query_params?: { ... }\n }\n request_mapping?: string\n response_mapping?: string\n inbound_use_case_slug?: string\n }\n type_annotations?: {\n request?: Record\n response?: Record\n }\n types_locked?: boolean\n}\n```\n\n### `SecureProxyUseCaseHistoryEntry`\n\n```ts\ntype SecureProxyUseCaseHistoryEntry = {\n id: string // uuid\n useCaseId: string // uuid\n integrationId: string // uuid\n name: string\n slug?: string\n enabled: boolean\n change_description?: string\n changed_by?: string\n created_at: string // date-time\n updated_at: string // date-time\n history_created_at: string // date-time\n type: \"secure_proxy\"\n configuration?: {\n vpc_mode: \"static_ip\" | \"secure_link\"\n allowed_domains?: string[]\n allowed_ips?: string[]\n }\n}\n```\n\n### `SecureProxyUseCaseConfiguration`\n\nConfiguration for secure_proxy use cases. Defines how to route requests through a secure VPC.\n\n\n```ts\ntype SecureProxyUseCaseConfiguration = {\n vpc_mode: \"static_ip\" | \"secure_link\"\n allowed_domains?: string[]\n allowed_ips?: string[]\n}\n```\n\n### `SecureProxyWhitelist`\n\nCurrent whitelist state for a secure_proxy use case. vpc_mode is read-only\ncontext so the UI can show the user what mode the pool is in.\n\n\n```ts\ntype SecureProxyWhitelist = {\n vpc_mode: \"static_ip\" | \"secure_link\"\n allowed_domains: string[]\n allowed_ips: string[]\n}\n```\n\n### `SecureProxyWhitelistUpdate`\n\nPartial update for a secure_proxy whitelist. At least one of\n`allowed_domains` or `allowed_ips` must be provided.\n\nPer-field semantics:\n - **omitted** — the field is not modified; the stored value is preserved.\n - **non-empty array** — the stored value is replaced with the supplied list.\n - **emp\n\n```ts\ntype SecureProxyWhitelistUpdate = {\n allowed_domains?: string[]\n allowed_ips?: string[]\n}\n```\n\n### `SecureProxySummary`\n\n```ts\ntype SecureProxySummary = {\n id: string // uuid\n name: string\n slug?: string\n enabled: boolean\n vpc_mode: \"static_ip\" | \"secure_link\"\n allowed_domains?: string[]\n allowed_ips?: string[]\n integration_id: string // uuid\n integration_name: string\n}\n```\n\n### `SecureProxyRequest`\n\n```ts\ntype SecureProxyRequest = {\n integration_id: string // uuid\n use_case_id?: string // uuid\n use_case_slug?: string\n url: string // uri\n method: \"GET\" | \"POST\" | \"PUT\" | \"PATCH\" | \"DELETE\"\n headers?: Record\n body?: unknown\n response_type?: \"json\" | \"binary\"\n}\n```\n\n### `SecureProxyResponse`\n\n```ts\ntype SecureProxyResponse = {\n status_code?: number\n headers?: Record\n body?: unknown\n}\n```\n\n### `SecureProxyUpstreamError`\n\nError payload returned when epilot could not obtain an HTTP response from the proxied target. The failure is epilot-generated (HTTP 502) but the cause is usually remote-side; `code`/`reason` make that attributable.\n\n```ts\ntype SecureProxyUpstreamError = {\n message: \"Upstream network error\" | \"Upstream error\"\n code?: string\n reason?: string\n}\n```\n\n### `ManagedCallOperationConfig`\n\nConfiguration for managed_call use cases. Defines a single API operation with JSONata mapping.\n\n```ts\ntype ManagedCallOperationConfig = {\n operation: {\n method: \"GET\" | \"POST\" | \"PUT\" | \"PATCH\" | \"DELETE\"\n path: string\n headers?: Record\n query_params?: Record\n }\n request_mapping?: string\n response_mapping?: string\n inbound_use_case_slug?: string\n}\n```\n\n### `ManagedCallOperation`\n\nHTTP operation configuration for managed calls\n\n```ts\ntype ManagedCallOperation = {\n method: \"GET\" | \"POST\" | \"PUT\" | \"PATCH\" | \"DELETE\"\n path: string\n headers?: Record\n query_params?: Record\n}\n```\n\n### `ManagedCallExecuteRequest`\n\n```ts\ntype ManagedCallExecuteRequest = {\n integration_id: string // uuid\n payload?: Record\n correlation_id?: string\n}\n```\n\n### `ManagedCallExecuteResponse`\n\nThe response from a managed call execution.\nOn success, returns the JSONata-mapped response data directly (no wrapper).\nThe shape is entirely defined by your response_mapping JSONata expression.\nIf no response_mapping is configured, returns the raw external API response.\nCheck the X-Inbound-Event-Id\n\n```ts\ntype ManagedCallExecuteResponse = unknown\n```\n\n### `ManagedCallErrorResponse`\n\n```ts\ntype ManagedCallErrorResponse = {\n error: {\n code: string\n message: string\n details?: Record\n }\n}\n```\n\n### `TypeAnnotations`\n\nDeveloper-provided type annotations for a use case's request and response fields\n\n```ts\ntype TypeAnnotations = {\n request?: Record\n response?: Record\n}\n```\n\n### `TypeDescriptor`\n\nDescribes the inferred type shape of a JSONata expression\n\n```ts\ntype TypeDescriptor = {\n kind: \"object\" | \"array\" | \"string\" | \"number\" | \"boolean\" | \"null\" | \"unknown\" | \"union\"\n properties?: Record\n items?: {\n kind: { ... }\n properties?: { ... }\n items?: { ... }\n source?: { ... }\n variants?: { ... }\n }\n source?: string\n variants?: Array<{\n kind: { ... }\n properties?: { ... }\n items?: { ... }\n source?: { ... }\n variants?: { ... }\n }>\n }>\n items?: {\n kind: \"object\" | \"array\" | \"string\" | \"number\" | \"boolean\" | \"null\" | \"unknown\" | \"union\"\n properties?: Record\n items?: {\n kind: { ... }\n properties?: { ... }\n items?: { ... }\n source?: { ... }\n variants?: { ... }\n }\n source?: string\n variants?: Array<{\n kind: { ... }\n properties?: { ... }\n items?: { ... }\n source?: { ... }\n variants?: { ... }\n }>\n }\n source?: string\n variants?: Array<{\n kind: \"object\" | \"array\" | \"string\" | \"number\" | \"boolean\" | \"null\" | \"unknown\" | \"union\"\n properties?: Record\n items?: {\n kind: { ... }\n properties?: { ... }\n items?: { ... }\n source?: { ... }\n variants?: { ... }\n }\n source?: string\n variants?: Array<{\n kind: { ... }\n properties?: { ... }\n items?: { ... }\n source?: { ... }\n variants?: { ... }\n }>\n }>\n}\n```\n\n### `UseCaseTypePreview`\n\nScaffolded type descriptors for a single use case\n\n```ts\ntype UseCaseTypePreview = {\n slug: string\n name?: string\n request_shape: {\n kind: \"object\" | \"array\" | \"string\" | \"number\" | \"boolean\" | \"null\" | \"unknown\" | \"union\"\n properties?: Record\n items?: {\n kind: { ... }\n properties?: { ... }\n items?: { ... }\n source?: { ... }\n variants?: { ... }\n }\n source?: string\n variants?: Array<{\n kind: { ... }\n properties?: { ... }\n items?: { ... }\n source?: { ... }\n variants?: { ... }\n }>\n }\n response_shape: {\n kind: \"object\" | \"array\" | \"string\" | \"number\" | \"boolean\" | \"null\" | \"unknown\" | \"union\"\n properties?: Record\n items?: {\n kind: { ... }\n properties?: { ... }\n items?: { ... }\n source?: { ... }\n variants?: { ... }\n }\n source?: string\n variants?: Array<{\n kind: { ... }\n properties?: { ... }\n items?: { ... }\n source?: { ... }\n variants?: { ... }\n }>\n }\n existing_annotations?: {\n request?: Record\n response?: Record\n }\n}\n```\n\n### `GenerateTypesPreviewResponse`\n\n```ts\ntype GenerateTypesPreviewResponse = {\n integration_name?: string\n use_cases: Array<{\n slug: string\n name?: string\n request_shape: {\n kind: { ... }\n properties?: { ... }\n items?: { ... }\n source?: { ... }\n variants?: { ... }\n }\n response_shape: {\n kind: { ... }\n properties?: { ... }\n items?: { ... }\n source?: { ... }\n variants?: { ... }\n }\n existing_annotations?: {\n request?: { ... }\n response?: { ... }\n }\n }>\n previous_version?: string\n suggested_version?: string\n suggested_bump?: \"major\" | \"minor\"\n detected_changes?: Array<{\n slug: string\n field: string\n type: \"breaking\" | \"non-breaking\"\n description: string\n }>\n}\n```\n\n### `GenerateTypesRequest`\n\n```ts\ntype GenerateTypesRequest = {\n package_name: string\n version: string\n description?: string\n domain_package?: string\n domain_map_name?: string\n annotations?: Record\n response?: Record\n }>\n}\n```\n\n### `GenerateTypesResponse`\n\n```ts\ntype GenerateTypesResponse = {\n package_name: string\n version: string\n files: Record\n warnings?: string[]\n}\n```\n\n### `CommitTypesRequest`\n\n```ts\ntype CommitTypesRequest = {\n package_name: string\n version: string\n annotations?: Record\n response?: Record\n }>\n}\n```\n\n### `CommitTypesResponse`\n\n```ts\ntype CommitTypesResponse = {\n committed: boolean\n warnings?: string[]\n}\n```\n\n### `FileProxyUseCaseConfiguration`\n\nConfiguration for file_proxy use cases. Defines how to authenticate and fetch files from external document systems.\n\nThe file proxy download URL always requires `orgId`, `integrationId`, and either `useCaseSlug` (recommended) or `useCaseId` (legacy UUID) as query parameters.\nThe `orgId` is included \n\n```ts\ntype FileProxyUseCaseConfiguration = {\n secure_proxy?: {\n use_case_slug: string\n }\n auth?: {\n type: \"oauth2_client_credentials\" | \"oauth2_password\"\n token_url: string\n client_id: string\n client_secret: string\n scope?: string\n audience?: string\n resource?: string\n username?: string\n password?: string\n body_params?: Record\n headers?: Record\n query_params?: Record\n }\n params?: Array<{\n name: string\n required: boolean\n description?: string\n }>\n allowed_origins?: string // uri[]\n steps: Array<{\n url: string\n method: \"GET\" | \"POST\"\n headers?: Record\n body?: string\n response_type: \"json\" | \"binary\"\n }>\n response: {\n body: string\n encoding: \"base64\" | \"binary\"\n filename?: string\n content_type?: string\n }\n prevent_indirect_serving?: boolean\n}\n```\n\n### `FileProxySecureProxyAttachment`\n\n```ts\ntype FileProxySecureProxyAttachment = {\n use_case_slug: string\n}\n```\n\n### `FileProxyAuth`\n\n```ts\ntype FileProxyAuth = {\n type: \"oauth2_client_credentials\" | \"oauth2_password\"\n token_url: string\n client_id: string\n client_secret: string\n scope?: string\n audience?: string\n resource?: string\n username?: string\n password?: string\n body_params?: Record\n headers?: Record\n query_params?: Record\n}\n```\n\n### `FileProxyParam`\n\n```ts\ntype FileProxyParam = {\n name: string\n required: boolean\n description?: string\n}\n```\n\n### `FileProxyStep`\n\n```ts\ntype FileProxyStep = {\n url: string\n method: \"GET\" | \"POST\"\n headers?: Record\n body?: string\n response_type: \"json\" | \"binary\"\n}\n```\n\n### `FileProxyResponseConfig`\n\n```ts\ntype FileProxyResponseConfig = {\n body: string\n encoding: \"base64\" | \"binary\"\n filename?: string\n content_type?: string\n}\n```\n\n### `MappingSimulationRequest`\n\n```ts\ntype MappingSimulationRequest = {\n mapping_configuration: {\n version?: \"1.0\"\n mapping: {\n objects: { ... }\n }\n } | {\n version: \"2.0\"\n mapping: {\n events: { ... }\n }\n }\n object_type: string\n format: \"json\" | \"xml\"\n payload: string | Record\n}\n```\n\n### `MappingSimulationV2Request`\n\nRequest for v2 mapping simulation. Uses the same configuration format stored in integration use case resources,\nmaking it easier to test configurations before saving them.\n\n\n```ts\ntype MappingSimulationV2Request = {\n event_configuration: {\n entities?: Array<{\n entity_schema: { ... }\n unique_ids: { ... }\n jsonataExpression?: { ... }\n enabled?: { ... }\n mode?: { ... }\n scope?: { ... }\n fields: { ... }\n }>\n meter_readings?: Array<{\n jsonataExpression?: { ... }\n reading_matching?: { ... }\n mode?: { ... }\n scope?: { ... }\n meter: { ... }\n meter_counter?: { ... }\n fields: { ... }\n }>\n }\n format: \"json\" | \"xml\"\n payload: string | Record\n}\n```\n\n### `MappingSimulationResponse`\n\n```ts\ntype MappingSimulationResponse = {\n entity_updates: Array<{\n entity_slug: string\n unique_identifiers: Record\n attributes: Record\n }>\n meter_readings_updates?: Array<{\n meter: {\n $entity_unique_ids: { ... }\n }\n meter_counter?: {\n $entity_unique_ids?: { ... }\n }\n attributes: Record\n }>\n warnings?: Array<{\n entity_schema: string\n field: string\n message: string\n }>\n}\n```\n\n### `MappingSimulationWarning`\n\n```ts\ntype MappingSimulationWarning = {\n entity_schema: string\n field: string\n message: string\n}\n```\n\n### `EntityUpdate`\n\n```ts\ntype EntityUpdate = {\n entity_slug: string\n unique_identifiers: Record\n attributes: Record\n}\n```\n\n### `MeterReadingUpdate`\n\n```ts\ntype MeterReadingUpdate = {\n meter: {\n $entity_unique_ids: Record\n }\n meter_counter?: {\n $entity_unique_ids?: Record\n }\n attributes: Record\n}\n```\n\n### `IntegrationConfigurationV1`\n\n```ts\ntype IntegrationConfigurationV1 = {\n version?: \"1.0\"\n mapping: {\n objects: Record\n }\n}\n```\n\n### `IntegrationObjectV1`\n\n```ts\ntype IntegrationObjectV1 = {\n unique_ids: Record>\n fields: Array<{\n entity: string\n attribute: string\n field?: string\n jsonataExpression?: string\n }>\n}\n```\n\n### `IntegrationFieldV1`\n\n```ts\ntype IntegrationFieldV1 = {\n entity: string\n attribute: string\n field?: string\n jsonataExpression?: string\n}\n```\n\n### `IntegrationConfigurationV2`\n\n```ts\ntype IntegrationConfigurationV2 = {\n version: \"2.0\"\n mapping: {\n events: Record\n }\n}\n```\n\n### `OutboundMapping`\n\nA mapping that delivers an event to an external system — either pushed to a webhook (with a JSONata payload transformation) or made available on the pull-based poll queue (raw event payload, no transformation)\n\n```ts\ntype OutboundMapping = {\n id?: string // uuid\n name: string\n jsonata_expression?: string\n enabled: boolean\n delivery: {\n type: \"webhook\"\n webhook_id: string\n webhook_name?: string\n webhook_url?: string\n } | {\n type: \"poll\"\n retention_days?: number\n poison_policy?: \"dead_letter\" | \"block\"\n max_delivery_attempts?: number\n }\n created_at?: string // date-time\n updated_at?: string // date-time\n}\n```\n\n### `DeliveryConfig`\n\nConfiguration for how the event should be delivered. webhook = push delivery via svc-webhooks (JSONata-transformed payload); poll = pull-based queue delivery where the consumer fetches items via the poll API (raw event payload)\n\n```ts\ntype DeliveryConfig = {\n type: \"webhook\"\n webhook_id: string\n webhook_name?: string\n webhook_url?: string\n} | {\n type: \"poll\"\n retention_days?: number\n poison_policy?: \"dead_letter\" | \"block\"\n max_delivery_attempts?: number\n}\n```\n\n### `WebhookDeliveryConfig`\n\nPush delivery of the transformed event to a webhook via svc-webhooks\n\n```ts\ntype WebhookDeliveryConfig = {\n type: \"webhook\"\n webhook_id: string\n webhook_name?: string\n webhook_url?: string\n}\n```\n\n### `PollDeliveryConfig`\n\nPull-based queue delivery. Items carry the raw standardized event-catalog payload; no JSONata mapping is applied in poll mode. Consumers fetch and acknowledge items via the poll API.\n\n```ts\ntype PollDeliveryConfig = {\n type: \"poll\"\n retention_days?: number\n poison_policy?: \"dead_letter\" | \"block\"\n max_delivery_attempts?: number\n}\n```\n\n### `OutboundStatusResponse`\n\n```ts\ntype OutboundStatusResponse = {\n useCases: Array<{\n useCaseId: string // uuid\n name: string\n useCaseEnabled: boolean\n eventCatalogEvent?: string\n eventEnabled?: boolean\n webhooks?: Array<{\n webhookId: { ... }\n webhookName?: { ... }\n enabled?: { ... }\n }>\n status: \"ok\" | \"conflict\" | \"disabled\"\n conflicts?: Array<{\n type: { ... }\n webhookId?: { ... }\n message: { ... }\n }>\n poll?: {\n queue_depth: { ... }\n oldest_unconsumed_age_seconds: { ... }\n last_poll_at: { ... }\n last_ack_at: { ... }\n blocked: { ... }\n dlq_count: { ... }\n }\n }>\n}\n```\n\n### `OutboundUseCaseStatus`\n\n```ts\ntype OutboundUseCaseStatus = {\n useCaseId: string // uuid\n name: string\n useCaseEnabled: boolean\n eventCatalogEvent?: string\n eventEnabled?: boolean\n webhooks?: Array<{\n webhookId: string\n webhookName?: string\n enabled?: boolean\n }>\n status: \"ok\" | \"conflict\" | \"disabled\"\n conflicts?: Array<{\n type: \"event_disabled\" | \"all_webhooks_disabled\" | \"event_enabled_while_disabled\" | \"webhook_enabled_while_disabled\" | \"stream_blocked\" | \"dlq_items_present\"\n webhookId?: string\n message: string\n }>\n poll?: {\n queue_depth: number\n oldest_unconsumed_age_seconds: number\n last_poll_at: string // date-time\n last_ack_at: string // date-time\n blocked: boolean\n dlq_count: number\n }\n}\n```\n\n### `OutboundPollStatus`\n\nQueue/consumer health for a poll-mode use case. Present only on use\ncases with a poll delivery mapping — webhook-only use cases are\nunaffected. Depth/age/DLQ numbers are first-page approximations.\n\n\n```ts\ntype OutboundPollStatus = {\n queue_depth: number\n oldest_unconsumed_age_seconds: number\n last_poll_at: string // date-time\n last_ack_at: string // date-time\n blocked: boolean\n dlq_count: number\n}\n```\n\n### `WebhookStatus`\n\n```ts\ntype WebhookStatus = {\n webhookId: string\n webhookName?: string\n enabled?: boolean\n}\n```\n\n### `OutboundConflict`\n\n```ts\ntype OutboundConflict = {\n type: \"event_disabled\" | \"all_webhooks_disabled\" | \"event_enabled_while_disabled\" | \"webhook_enabled_while_disabled\" | \"stream_blocked\" | \"dlq_items_present\"\n webhookId?: string\n message: string\n}\n```\n\n### `PollOutboundMessagesRequest`\n\n```ts\ntype PollOutboundMessagesRequest = {\n limit?: number\n}\n```\n\n### `OutboundMessage`\n\n```ts\ntype OutboundMessage = {\n id: string\n lease_token: string\n use_case_id: string\n event_name: string\n event_id: string\n group: string\n payload: Record\n enqueued_at: string // date-time\n}\n```\n\n### `PollOutboundMessagesResponse`\n\n```ts\ntype PollOutboundMessagesResponse = {\n messages: Array<{\n id: string\n lease_token: string\n use_case_id: string\n event_name: string\n event_id: string\n group: string\n payload: Record\n enqueued_at: string // date-time\n }>\n visibility_timeout_seconds: number\n has_more: boolean\n}\n```\n\n### `AckOutboundMessagesRequest`\n\n```ts\ntype AckOutboundMessagesRequest = {\n acks: Array<{\n id: string\n lease_token: string\n }>\n}\n```\n\n### `AckResult`\n\n```ts\ntype AckResult = {\n id: string\n status: \"accepted\" | \"rejected\"\n reason?: \"stale_lease\" | \"out_of_order\" | \"not_found\"\n}\n```\n\n### `AckOutboundMessagesResponse`\n\n```ts\ntype AckOutboundMessagesResponse = {\n results: Array<{\n id: string\n status: \"accepted\" | \"rejected\"\n reason?: \"stale_lease\" | \"out_of_order\" | \"not_found\"\n }>\n}\n```\n\n### `OutboundDlqMessage`\n\n```ts\ntype OutboundDlqMessage = {\n id: string\n use_case_id: string\n event_name: string\n event_id: string\n enqueued_at?: string // date-time\n dead_lettered_at: string // date-time\n delivery_attempts: number\n reason?: string\n expires_at?: string // date-time\n}\n```\n\n### `OutboundDlqListResponse`\n\n```ts\ntype OutboundDlqListResponse = {\n items: Array<{\n id: string\n use_case_id: string\n event_name: string\n event_id: string\n enqueued_at?: string // date-time\n dead_lettered_at: string // date-time\n delivery_attempts: number\n reason?: string\n expires_at?: string // date-time\n }>\n next_token?: string\n}\n```\n\n### `RedriveOutboundDlqRequest`\n\n```ts\ntype RedriveOutboundDlqRequest = {\n ids: string[]\n}\n```\n\n### `RedriveOutboundDlqResult`\n\n```ts\ntype RedriveOutboundDlqResult = {\n id: string\n status: \"redriven\" | \"not_found\"\n}\n```\n\n### `RedriveOutboundDlqResponse`\n\n```ts\ntype RedriveOutboundDlqResponse = {\n results: Array<{\n id: string\n status: \"redriven\" | \"not_found\"\n }>\n}\n```\n\n### `UnblockOutboundStreamRequest`\n\n```ts\ntype UnblockOutboundStreamRequest = {\n reason?: string\n}\n```\n\n### `UnblockOutboundStreamResponse`\n\n```ts\ntype UnblockOutboundStreamResponse = {\n unblocked: boolean\n dead_lettered_id?: string\n}\n```\n\n### `RelationConfig`\n\n```ts\ntype RelationConfig = {\n operation: \"_set\" | \"_append\" | \"_append_all\"\n items?: Array<{\n entity_schema: string\n _tags?: string[]\n unique_ids: Array<{\n attribute: { ... }\n _type?: { ... }\n field?: { ... }\n jsonataExpression?: { ... }\n constant?: { ... }\n }>\n }>\n jsonataExpression?: string\n}\n```\n\n### `RelationItemConfig`\n\n```ts\ntype RelationItemConfig = {\n entity_schema: string\n _tags?: string[]\n unique_ids: Array<{\n attribute: string\n _type?: \"email\" | \"phone\"\n field?: string\n jsonataExpression?: string\n constant?: unknown\n }>\n}\n```\n\n### `RelationUniqueIdField`\n\n```ts\ntype RelationUniqueIdField = {\n attribute: string\n _type?: \"email\" | \"phone\"\n field?: string\n jsonataExpression?: string\n constant?: unknown\n}\n```\n\n### `RelationRefsConfig`\n\nConfiguration for relation references ($relation_ref).\nRelation references link to a specific item within a repeatable attribute on a related entity.\nCommon use case: referencing a specific address within a contact's address list.\n\n\n```ts\ntype RelationRefsConfig = {\n operation: \"_set\" | \"_append\" | \"_append_all\"\n items?: Array<{\n entity_schema: string\n unique_ids: Array<{\n attribute: { ... }\n _type?: { ... }\n field?: { ... }\n jsonataExpression?: { ... }\n constant?: { ... }\n }>\n path: string\n value: {\n attribute: { ... }\n operation?: { ... }\n field?: { ... }\n jsonataExpression?: { ... }\n constant?: { ... }\n }\n }>\n jsonataExpression?: string\n}\n```\n\n### `RelationRefItemConfig`\n\nConfiguration for a single relation reference item\n\n```ts\ntype RelationRefItemConfig = {\n entity_schema: string\n unique_ids: Array<{\n attribute: string\n _type?: \"email\" | \"phone\"\n field?: string\n jsonataExpression?: string\n constant?: unknown\n }>\n path: string\n value: {\n attribute: string\n operation?: \"_set\" | \"_append\" | \"_append_all\"\n field?: string\n jsonataExpression?: string\n constant?: unknown\n }\n}\n```\n\n### `RelationRefValueConfig`\n\nConfiguration for the value to set on the related entity's attribute\n\n```ts\ntype RelationRefValueConfig = {\n attribute: string\n operation?: \"_set\" | \"_append\" | \"_append_all\"\n field?: string\n jsonataExpression?: string\n constant?: unknown\n}\n```\n\n### `RepeatableFieldType`\n\nType hint for repeatable fields that require special search handling.\nThese fields are stored as arrays of objects (e.g., email: [{ email: \"value\" }]).\n\n\n```ts\ntype RepeatableFieldType = \"email\" | \"phone\"\n```\n\n### `ReplayEventsRequest`\n\n```ts\ntype ReplayEventsRequest = {\n event_ids: string[]\n}\n```\n\n### `QueryEventsRequest`\n\n```ts\ntype QueryEventsRequest = {\n event_id?: string\n event_type?: \"CREATE\" | \"UPDATE\" | \"DELETE\"\n correlation_id?: string\n object_type?: string\n event_name?: string\n use_case_id?: string\n limit?: number\n cursor?: {\n event_time?: string // date-time\n event_id?: string\n }\n}\n```\n\n### `QueryInboundMonitoringEventsRequest`\n\n```ts\ntype QueryInboundMonitoringEventsRequest = {\n use_case_id?: string // uuid\n event_type?: \"CREATE\" | \"UPDATE\" | \"DELETE\" | \"TRIGGER\"\n sync_type?: \"entity\" | \"meter_reading\" | \"webhook\" | \"api_deprecation\"\n status?: \"success\" | \"error\" | \"skipped\" | \"warning\"\n error_category?: \"validation\" | \"configuration\" | \"downstream_api\" | \"timeout\" | \"system\"\n correlation_id?: string\n object_type?: string\n event_name?: string\n event_id?: string\n from_date?: string // date-time\n to_date?: string // date-time\n limit?: number\n cursor?: {\n completed_at?: string // date-time\n event_id?: string\n }\n}\n```\n\n### `QueryAccessLogsRequest`\n\n```ts\ntype QueryAccessLogsRequest = {\n token_id?: string\n service?: string\n method?: \"GET\" | \"POST\" | \"PUT\" | \"PATCH\" | \"DELETE\" | \"OPTIONS\" | \"HEAD\"\n path?: string\n status?: number\n from_date?: string // date-time\n to_date?: string // date-time\n limit?: number\n cursor?: {\n timestamp?: string // date-time\n request_id?: string\n }\n}\n```\n\n### `AccessLogEntry`\n\n```ts\ntype AccessLogEntry = {\n timestamp?: string // date-time\n environment?: string\n service?: string\n request_id?: string\n method?: string\n path?: string\n status?: number\n response_latency_ms?: number\n response_length?: number\n token_id?: string\n org_id?: string\n origin?: string\n source_ip?: string\n}\n```\n\n### `GetMonitoringStatsRequest`\n\n```ts\ntype GetMonitoringStatsRequest = {\n from_date?: string // date-time\n to_date?: string // date-time\n inbound_group_by?: \"use_case_id\" | \"sync_type\" | \"status\" | \"error_category\" | \"object_type\" | \"event_name\" | \"date\"[]\n outbound_group_by?: \"event_name\" | \"status\" | \"webhook_config_id\" | \"date\"[]\n}\n```\n\n### `GetMonitoringTimeSeriesRequest`\n\n```ts\ntype GetMonitoringTimeSeriesRequest = {\n from_date: string // date-time\n to_date?: string // date-time\n interval: \"5m\" | \"10m\" | \"30m\" | \"1h\" | \"3h\" | \"1d\"\n direction?: \"inbound\" | \"outbound\" | \"both\"\n}\n```\n\n### `TimeSeriesBucket`\n\n```ts\ntype TimeSeriesBucket = {\n timestamp: string // date-time\n inbound?: {\n success_count?: number\n error_count?: number\n warning_count?: number\n skipped_count?: number\n total_count?: number\n }\n outbound?: {\n success_count?: number\n error_count?: number\n pending_count?: number\n total_count?: number\n }\n}\n```\n\n### `QueryOutboundMonitoringEventsRequest`\n\n```ts\ntype QueryOutboundMonitoringEventsRequest = {\n event_name?: string\n status?: \"succeeded\" | \"failed\" | \"pending\"\n webhook_config_id?: string\n from_date?: string // date-time\n to_date?: string // date-time\n limit?: number\n cursor?: {\n created_at?: string // date-time\n event_id?: string\n }\n}\n```\n\n### `OutboundMonitoringEvent`\n\n```ts\ntype OutboundMonitoringEvent = {\n org_id: string\n event_id: string\n event_name: string\n status: \"succeeded\" | \"failed\" | \"pending\"\n url?: string\n http_method?: string\n http_response?: Record\n webhook_config_id?: string\n metadata?: Record\n execution_context?: Record\n payload?: Record\n created_at: string // date-time\n updated_at?: string // date-time\n}\n```\n\n### `MonitoringStats`\n\n```ts\ntype MonitoringStats = {\n inbound: {\n total_events: number\n total_correlations?: number\n success_count: number\n error_count: number\n skipped_count: number\n warning_count?: number\n success_rate?: number\n last_error_at?: string // date-time\n breakdown?: Record[]\n }\n outbound: {\n total_events: number\n success_count: number\n error_count: number\n pending_count?: number\n success_rate?: number\n last_error_at?: string // date-time\n breakdown?: Record[]\n }\n}\n```\n\n### `InboundMonitoringEvent`\n\n```ts\ntype InboundMonitoringEvent = {\n org_id: string\n event_id: string\n correlation_id?: string\n integration_id?: string\n use_case_id?: string\n event_type?: \"CREATE\" | \"UPDATE\" | \"DELETE\" | \"TRIGGER\"\n object_type: string\n sync_type: \"entity\" | \"meter_reading\" | \"webhook\" | \"api_deprecation\"\n status: \"success\" | \"error\" | \"skipped\" | \"warning\"\n error_code?: string\n error_message?: string\n error_category?: \"validation\" | \"configuration\" | \"downstream_api\" | \"timeout\" | \"system\"\n processing_duration_ms?: number\n received_at: string // date-time\n completed_at: string // date-time\n}\n```\n\n### `QueryMonitoringEventsV2Request`\n\n```ts\ntype QueryMonitoringEventsV2Request = {\n use_case_id?: string\n use_case_type?: \"inbound\" | \"outbound\" | \"file_proxy\" | \"managed_call\" | \"secure_proxy\"\n level?: \"success\" | \"error\" | \"skipped\" | \"warning\"\n code?: string\n event_id?: string\n correlation_id?: string\n from_date?: string // date-time\n to_date?: string // date-time\n limit?: number\n cursor?: {\n created_at?: string // date-time\n id?: string // uuid\n }\n}\n```\n\n### `ExternalMonitoringSpan`\n\nA single monitoring span produced by an external system. `correlation_id`, `level`, `use_case_slug`, `occurred_at` and `message` are all required and `level` must be one of success|error|warning|info — but these are validated PER SPAN at ingest and reported in the per-item `results[]`, so one malfor\n\n```ts\ntype ExternalMonitoringSpan = {\n correlation_id?: string\n level?: string\n use_case_slug?: string\n occurred_at?: string // date-time\n message?: string\n detail?: Record\n}\n```\n\n### `IngestExternalMonitoringEventsRequest`\n\n```ts\ntype IngestExternalMonitoringEventsRequest = {\n events: Array<{\n correlation_id?: string\n level?: string\n use_case_slug?: string\n occurred_at?: string // date-time\n message?: string\n detail?: Record\n }>\n}\n```\n\n### `IngestExternalMonitoringEventsResponse`\n\n```ts\ntype IngestExternalMonitoringEventsResponse = {\n accepted: number\n rejected: number\n results?: Array<{\n index: number\n status: \"accepted\" | \"rejected\"\n reason?: string\n }>\n}\n```\n\n### `MonitoringTraceResponse`\n\n```ts\ntype MonitoringTraceResponse = {\n correlation_id: string\n status: \"success\" | \"error\" | \"warning\" | \"info\"\n started_at?: string // date-time\n ended_at?: string // date-time\n span_count: number\n truncated: boolean\n spans: Array<{\n id: string // uuid\n org_id: string\n integration_id: string\n event_id: string\n correlation_id?: string\n use_case_id?: string\n use_case_type: \"inbound\" | \"outbound\" | \"file_proxy\" | \"managed_call\" | \"secure_proxy\" | \"\"\n level: \"success\" | \"error\" | \"skipped\" | \"warning\"\n code?: string\n message?: string\n detail?: Record\n created_at: string // date-time\n }>\n inbound_event?: Record\n}\n```\n\n### `MonitoringEventV2`\n\n```ts\ntype MonitoringEventV2 = {\n id: string // uuid\n org_id: string\n integration_id: string\n event_id: string\n correlation_id?: string\n use_case_id?: string\n use_case_type: \"inbound\" | \"outbound\" | \"file_proxy\" | \"managed_call\" | \"secure_proxy\" | \"\"\n level: \"success\" | \"error\" | \"skipped\" | \"warning\"\n code?: string\n message?: string\n detail?: Record\n created_at: string // date-time\n}\n```\n\n### `GetMonitoringStatsV2Request`\n\n```ts\ntype GetMonitoringStatsV2Request = {\n from_date?: string // date-time\n to_date?: string // date-time\n use_case_type?: \"inbound\" | \"outbound\" | \"file_proxy\" | \"managed_call\" | \"secure_proxy\"\n use_case_types?: \"inbound\" | \"outbound\" | \"file_proxy\" | \"managed_call\" | \"secure_proxy\"[]\n group_by?: \"use_case_id\" | \"use_case_type\" | \"level\" | \"code\" | \"date\"\n source?: \"monitoring\" | \"incoming\"\n}\n```\n\n### `MonitoringStatsV2`\n\n```ts\ntype MonitoringStatsV2 = {\n total_events: number\n success_count: number\n error_count: number\n warning_count: number\n skipped_count: number\n ack_timeout_count?: number\n success_rate?: number\n last_error_at?: string // date-time\n breakdown?: Record[]\n}\n```\n\n### `GetMonitoringTimeSeriesV2Request`\n\n```ts\ntype GetMonitoringTimeSeriesV2Request = {\n from_date: string // date-time\n to_date?: string // date-time\n interval: \"5m\" | \"10m\" | \"30m\" | \"1h\" | \"3h\" | \"1d\"\n use_case_type?: \"inbound\" | \"outbound\" | \"file_proxy\" | \"managed_call\" | \"secure_proxy\"\n group_by?: \"use_case_type\" | \"use_case\"\n}\n```\n\n### `TimeSeriesBreakdownItemV2`\n\n```ts\ntype TimeSeriesBreakdownItemV2 = {\n use_case_type?: \"inbound\" | \"outbound\" | \"file_proxy\" | \"managed_call\" | \"secure_proxy\"\n use_case_id?: string\n success_count: number\n error_count: number\n warning_count: number\n skipped_count: number\n total_count: number\n}\n```\n\n### `TimeSeriesBucketV2`\n\n```ts\ntype TimeSeriesBucketV2 = {\n timestamp: string // date-time\n success_count?: number\n error_count?: number\n warning_count?: number\n skipped_count?: number\n total_count: number\n breakdown?: Array<{\n use_case_type?: \"inbound\" | \"outbound\" | \"file_proxy\" | \"managed_call\" | \"secure_proxy\"\n use_case_id?: string\n success_count: number\n error_count: number\n warning_count: number\n skipped_count: number\n total_count: number\n }>\n}\n```\n" diff --git a/packages/epilot-sdk-v2/src/types/integration-toolkit.d.ts b/packages/epilot-sdk-v2/src/types/integration-toolkit.d.ts index ae02667e..071fb80e 100644 --- a/packages/epilot-sdk-v2/src/types/integration-toolkit.d.ts +++ b/packages/epilot-sdk-v2/src/types/integration-toolkit.d.ts @@ -10,6 +10,7 @@ import type { export declare namespace Components { namespace Responses { export type BadRequest = Schemas.ErrorResponseBase; + export type Conflict = Schemas.ErrorResponseBase; export interface ERPUpdatesResponse { results?: { /** @@ -163,6 +164,35 @@ export declare namespace Components { has_more?: boolean; } export interface ReplayEventsResponse { + /** + * Number of events actually queued for re-processing. + * example: + * 2 + */ + replayed: number; + /** + * One entry per requested event id, in request order. + */ + results: { + /** + * The requested (source) event ID. + */ + event_id: string; + /** + * Outcome for this event. `success`/`queued` means it was enqueued for re-processing. `not_found` means no inbound event with that ID exists for the organization. `skipped` means it was deduplicated, `ignored` means no enabled use case matched it, and `error` means it could not be queued (see `message`). + * + */ + status: "success" | "queued" | "skipped" | "ignored" | "not_found" | "error"; + /** + * The new event ID assigned to the replayed event. Use it to follow the replay in monitoring. + * + */ + replay_event_id?: string; + /** + * Human-readable detail for this outcome. + */ + message?: string; + }[]; /** * List of event IDs for which replay was requested */ @@ -1312,6 +1342,17 @@ export declare namespace Components { */ latest_types_package_name?: string; } + export interface CreateErpImportRequest { + s3_reference: S3Reference; + integration_id: string; + use_case_slug?: string; + } + export interface CreateErpImportResponse { + /** + * `imp_{ULID}` — time-ordered, also used as the job's correlation_id. + */ + import_id: string; + } export interface CreateFileProxyUseCaseRequest { /** * Use case name @@ -1924,6 +1965,93 @@ export declare namespace Components { */ group_id?: string; }; + /** + * Why the import failed — present if and only if status = FAILED. + */ + export interface ErpImportError { + /** + * VALIDATION_BLOCKED = blocking row issues (see `validation`); PROCESSING_ERROR = a named, deterministic failure — retrying the same file cannot help; INTERNAL_ERROR = crashed or never started, so retry. + */ + type: "VALIDATION_BLOCKED" | "PROCESSING_ERROR" | "INTERNAL_ERROR"; + /** + * User-facing explanation of `type`. + */ + message: string; + } + export interface ErpImportJob { + /** + * `imp_{ULID}` — time-ordered, also used as the job's correlation_id. + */ + import_id: string; + org_id: string; + created_by?: string; + integration_id: string; + /** + * The inbound use case whose mapping drives both phases. + */ + use_case_slug?: string; + format: "csv" | "xlsx"; + /** + * PENDING → VALIDATING → READY → PROCESSING → IMPORTED, with FAILED reachable from any working status, and CANCELLING → CANCELLED reachable from VALIDATING or PROCESSING via :abort. IMPORTED, FAILED and CANCELLED are terminal and final. + * IMPORTED means every row was handed to the platform, not that the platform finished — per-row outcomes live in monitoring, filtered by correlation_id. A file that fails validation is FAILED with error.type = VALIDATION_BLOCKED. + * READY is legitimately idle for as long as the user takes to confirm, so it carries no running work and never goes stale. + * CANCELLING is transient and cooperative: the abort has been recorded but the worker only notices at its next batch boundary. Rows already published stay published — a stop is not a rollback. + */ + status: "PENDING" | "VALIDATING" | "READY" | "PROCESSING" | "IMPORTED" | "FAILED" | "CANCELLING" | "CANCELLED"; + s3_input_ref: S3Reference; + validation?: /* Validate-phase summary: what the file will create, and whether it may be confirmed. Absent until the validate phase completes. No per-row detail is kept — a rejected file is corrected and imported again. */ ErpImportValidation; + progress?: /** + * How far the currently running phase has got. Written at every batch boundary, so it advances during long runs rather than only at the end. + * `total_rows` is ABSENT during the validate phase until the file has been read to the end — there is deliberately no counting pass, since that would be a second unbounded read of the whole file. Render an indeterminate indicator while it is missing: dividing by a missing total yields a determinate bar pinned at 0%, which reads as a hung import. + */ + ErpImportProgress; + error?: /* Why the import failed — present if and only if status = FAILED. */ ErpImportError; + /** + * Scopes this run in monitoring. Always equal to `import_id`. + */ + correlation_id?: string; + activity_id?: string; + created_at: string; // date-time + updated_at: string; // date-time + } + export interface ErpImportList { + results: ErpImportJob[]; + /** + * Cursor for the next page, or null when there are no more rows. + */ + next_cursor?: string | null; + } + /** + * How far the currently running phase has got. Written at every batch boundary, so it advances during long runs rather than only at the end. + * `total_rows` is ABSENT during the validate phase until the file has been read to the end — there is deliberately no counting pass, since that would be a second unbounded read of the whole file. Render an indeterminate indicator while it is missing: dividing by a missing total yields a determinate bar pinned at 0%, which reads as a hung import. + */ + export interface ErpImportProgress { + /** + * Rows fully processed. An exact "the first N rows are done" watermark, not an estimate — it only advances once a batch has been completely handled. + */ + processed_rows: number; + /** + * Rows in the file. Known only once a phase has read to EOF; the execute phase has it from the start, because validate recorded it first. + */ + total_rows?: number; + } + /** + * Validate-phase summary: what the file will create, and whether it may be confirmed. Absent until the validate phase completes. No per-row detail is kept — a rejected file is corrected and imported again. + */ + export interface ErpImportValidation { + /** + * Data rows read from the file. + */ + total_rows: number; + blocking: number; + warnings: number; + /** + * Distinct entities the file expresses, keyed by entity slug. + */ + entities: { + [name: string]: number; + }; + } export interface ErpUpdatesEventsV2Request { /** * UUID that identifies the integration configuration to use @@ -5612,6 +5740,10 @@ export declare namespace Components { */ buckets?: RuleBaselineBucket[] | null; } + export interface S3Reference { + bucket: string; + key: string; + } export interface SecureProxyRequest { /** * Integration ID that owns the secure_proxy use case @@ -6459,6 +6591,21 @@ export declare namespace Components { } } export declare namespace Paths { + namespace AbortErpImport { + namespace Parameters { + export type ImportId = string; + } + export interface PathParameters { + importId: Parameters.ImportId; + } + namespace Responses { + export type $202 = Components.Schemas.ErpImportJob; + export type $403 = Components.Responses.Forbidden; + export type $404 = Components.Responses.NotFound; + export type $409 = Components.Responses.Conflict; + export type $500 = Components.Responses.InternalServerError; + } + } namespace AckOutboundMessages { namespace Parameters { export type IntegrationId = string; // uuid @@ -6513,6 +6660,15 @@ export declare namespace Paths { export type $500 = Components.Responses.InternalServerError; } } + namespace CreateErpImport { + export type RequestBody = Components.Schemas.CreateErpImportRequest; + namespace Responses { + export type $202 = Components.Schemas.CreateErpImportResponse; + export type $400 = Components.Responses.BadRequest; + export type $403 = Components.Responses.Forbidden; + export type $500 = Components.Responses.InternalServerError; + } + } namespace CreateIntegration { export type RequestBody = Components.Schemas.CreateIntegrationRequest; namespace Responses { @@ -6625,6 +6781,21 @@ export declare namespace Paths { export type $500 = Components.Responses.InternalServerError; } } + namespace ExecuteErpImport { + namespace Parameters { + export type ImportId = string; + } + export interface PathParameters { + importId: Parameters.ImportId; + } + namespace Responses { + export type $200 = Components.Schemas.ErpImportJob; + export type $403 = Components.Responses.Forbidden; + export type $404 = Components.Responses.NotFound; + export type $409 = Components.Responses.Conflict; + export type $500 = Components.Responses.InternalServerError; + } + } namespace GenerateTypes { namespace Parameters { export type IntegrationId = string; // uuid @@ -6672,6 +6843,20 @@ export declare namespace Paths { export type $500 = Components.Responses.InternalServerError; } } + namespace GetErpImport { + namespace Parameters { + export type ImportId = string; + } + export interface PathParameters { + importId: Parameters.ImportId; + } + namespace Responses { + export type $200 = Components.Schemas.ErpImportJob; + export type $403 = Components.Responses.Forbidden; + export type $404 = Components.Responses.NotFound; + export type $500 = Components.Responses.InternalServerError; + } + } namespace GetIntegration { namespace Parameters { export type IntegrationId = string; // uuid @@ -6874,6 +7059,22 @@ export declare namespace Paths { export type $500 = Components.Responses.InternalServerError; } } + namespace ListErpImports { + namespace Parameters { + export type Cursor = string; + export type Limit = number; + } + export interface QueryParameters { + limit?: Parameters.Limit; + cursor?: Parameters.Cursor; + } + namespace Responses { + export type $200 = Components.Schemas.ErpImportList; + export type $400 = Components.Responses.BadRequest; + export type $403 = Components.Responses.Forbidden; + export type $500 = Components.Responses.InternalServerError; + } + } namespace ListIntegrations { namespace Responses { export interface $200 { @@ -8157,6 +8358,63 @@ export interface OperationMethods { data?: Paths.CommitTypes.RequestBody, config?: AxiosRequestConfig ): OperationResponse + /** + * listErpImports - listErpImports + * + * List recent pricing-file import jobs for the org, newest first. + * + * Pass `next_cursor` back as `cursor` for the next page. A page can be + * shorter than `limit` and still have more behind it, so stop on + * `next_cursor: null`. + * + */ + 'listErpImports'( + parameters?: Parameters | null, + data?: any, + config?: AxiosRequestConfig + ): OperationResponse + /** + * createErpImport - createErpImport + * + * Create a pricing-file import job from an already-uploaded file (S3 ref). Returns a job id and starts the validate phase asynchronously — poll GET /v2/erp/imports/{importId}. + */ + 'createErpImport'( + parameters?: Parameters | null, + data?: Paths.CreateErpImport.RequestBody, + config?: AxiosRequestConfig + ): OperationResponse + /** + * getErpImport - getErpImport + * + * Get a pricing-file import job (status, counts, result links). + */ + 'getErpImport'( + parameters?: Parameters | null, + data?: any, + config?: AxiosRequestConfig + ): OperationResponse + /** + * executeErpImport - executeErpImport + * + * Confirm and run the write phase of a validated import. Only a READY job may be executed; any other status returns 409. + */ + 'executeErpImport'( + parameters?: Parameters | null, + data?: any, + config?: AxiosRequestConfig + ): OperationResponse + /** + * abortErpImport - abortErpImport + * + * Ask a running import to stop. Valid while the job is VALIDATING or PROCESSING; any other status returns 409. + * The stop is cooperative: the job passes through CANCELLING and typically reaches CANCELLED within seconds. + * Rows already published to the platform are **kept**: this is a stop, not a rollback. Aborting during VALIDATING has published nothing, so it is always clean; aborting during PROCESSING leaves a partial import, and the rows that landed are visible in monitoring under the job's correlation_id. + */ + 'abortErpImport'( + parameters?: Parameters | null, + data?: any, + config?: AxiosRequestConfig + ): OperationResponse } export interface PathsDictionary { @@ -8977,6 +9235,71 @@ export interface PathsDictionary { config?: AxiosRequestConfig ): OperationResponse } + ['/v2/erp/imports']: { + /** + * createErpImport - createErpImport + * + * Create a pricing-file import job from an already-uploaded file (S3 ref). Returns a job id and starts the validate phase asynchronously — poll GET /v2/erp/imports/{importId}. + */ + 'post'( + parameters?: Parameters | null, + data?: Paths.CreateErpImport.RequestBody, + config?: AxiosRequestConfig + ): OperationResponse + /** + * listErpImports - listErpImports + * + * List recent pricing-file import jobs for the org, newest first. + * + * Pass `next_cursor` back as `cursor` for the next page. A page can be + * shorter than `limit` and still have more behind it, so stop on + * `next_cursor: null`. + * + */ + 'get'( + parameters?: Parameters | null, + data?: any, + config?: AxiosRequestConfig + ): OperationResponse + } + ['/v2/erp/imports/{importId}']: { + /** + * getErpImport - getErpImport + * + * Get a pricing-file import job (status, counts, result links). + */ + 'get'( + parameters?: Parameters | null, + data?: any, + config?: AxiosRequestConfig + ): OperationResponse + } + ['/v2/erp/imports/{importId}:execute']: { + /** + * executeErpImport - executeErpImport + * + * Confirm and run the write phase of a validated import. Only a READY job may be executed; any other status returns 409. + */ + 'post'( + parameters?: Parameters | null, + data?: any, + config?: AxiosRequestConfig + ): OperationResponse + } + ['/v2/erp/imports/{importId}:abort']: { + /** + * abortErpImport - abortErpImport + * + * Ask a running import to stop. Valid while the job is VALIDATING or PROCESSING; any other status returns 409. + * The stop is cooperative: the job passes through CANCELLING and typically reaches CANCELLED within seconds. + * Rows already published to the platform are **kept**: this is a stop, not a rollback. Aborting during VALIDATING has published nothing, so it is always clean; aborting during PROCESSING leaves a partial import, and the rows that landed are visible in monitoring under the job's correlation_id. + */ + 'post'( + parameters?: Parameters | null, + data?: any, + config?: AxiosRequestConfig + ): OperationResponse + } } export type Client = OpenAPIClient @@ -8990,6 +9313,8 @@ export type AutoRefreshSettings = Components.Schemas.AutoRefreshSettings; export type CommitTypesRequest = Components.Schemas.CommitTypesRequest; export type CommitTypesResponse = Components.Schemas.CommitTypesResponse; export type ConnectorConfig = Components.Schemas.ConnectorConfig; +export type CreateErpImportRequest = Components.Schemas.CreateErpImportRequest; +export type CreateErpImportResponse = Components.Schemas.CreateErpImportResponse; export type CreateFileProxyUseCaseRequest = Components.Schemas.CreateFileProxyUseCaseRequest; export type CreateInboundUseCaseRequest = Components.Schemas.CreateInboundUseCaseRequest; export type CreateIntegrationRequest = Components.Schemas.CreateIntegrationRequest; @@ -9012,6 +9337,11 @@ export type EnvVarRefConfig = Components.Schemas.EnvVarRefConfig; export type EnvironmentFieldConfig = Components.Schemas.EnvironmentFieldConfig; export type ErpEvent = Components.Schemas.ErpEvent; export type ErpEventV3 = Components.Schemas.ErpEventV3; +export type ErpImportError = Components.Schemas.ErpImportError; +export type ErpImportJob = Components.Schemas.ErpImportJob; +export type ErpImportList = Components.Schemas.ErpImportList; +export type ErpImportProgress = Components.Schemas.ErpImportProgress; +export type ErpImportValidation = Components.Schemas.ErpImportValidation; export type ErpUpdatesEventsV2Request = Components.Schemas.ErpUpdatesEventsV2Request; export type ErpUpdatesEventsV3Request = Components.Schemas.ErpUpdatesEventsV3Request; export type ErrorResponseBase = Components.Schemas.ErrorResponseBase; @@ -9117,6 +9447,7 @@ export type RepeatableFieldType = Components.Schemas.RepeatableFieldType; export type ReplayEventsRequest = Components.Schemas.ReplayEventsRequest; export type RuleBaselineBucket = Components.Schemas.RuleBaselineBucket; export type RuleBaselineStatus = Components.Schemas.RuleBaselineStatus; +export type S3Reference = Components.Schemas.S3Reference; export type SecureProxyRequest = Components.Schemas.SecureProxyRequest; export type SecureProxyResponse = Components.Schemas.SecureProxyResponse; export type SecureProxySummary = Components.Schemas.SecureProxySummary;