@epilot/sdk 2.7.11 → 2.7.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/definitions/targeting.json +14 -7
- package/definitions/webhooks.json +31 -0
- package/dist/apis/access-token.cjs +6 -6
- package/dist/apis/access-token.js +1 -1
- package/dist/apis/address-suggestions.cjs +6 -6
- package/dist/apis/address-suggestions.js +1 -1
- package/dist/apis/address.cjs +6 -6
- package/dist/apis/address.js +1 -1
- package/dist/apis/ai-agents.cjs +6 -6
- package/dist/apis/ai-agents.js +1 -1
- package/dist/apis/app.cjs +6 -6
- package/dist/apis/app.js +1 -1
- package/dist/apis/audit-logs.cjs +6 -6
- package/dist/apis/audit-logs.js +1 -1
- package/dist/apis/automation.cjs +6 -6
- package/dist/apis/automation.js +1 -1
- package/dist/apis/billing.cjs +6 -6
- package/dist/apis/billing.js +1 -1
- package/dist/apis/blueprint-manifest.cjs +6 -6
- package/dist/apis/blueprint-manifest.js +1 -1
- package/dist/apis/calendar.cjs +6 -6
- package/dist/apis/calendar.js +1 -1
- package/dist/apis/configuration-hub.cjs +6 -6
- package/dist/apis/configuration-hub.js +1 -1
- package/dist/apis/consent.cjs +6 -6
- package/dist/apis/consent.js +1 -1
- package/dist/apis/customer-portal.cjs +6 -6
- package/dist/apis/customer-portal.js +1 -1
- package/dist/apis/dashboard.cjs +6 -6
- package/dist/apis/dashboard.js +1 -1
- package/dist/apis/data-governance.cjs +6 -6
- package/dist/apis/data-governance.js +1 -1
- package/dist/apis/deduplication.cjs +6 -6
- package/dist/apis/deduplication.js +1 -1
- package/dist/apis/design.cjs +6 -6
- package/dist/apis/design.js +1 -1
- package/dist/apis/document.cjs +6 -6
- package/dist/apis/document.js +1 -1
- package/dist/apis/email-settings.cjs +6 -6
- package/dist/apis/email-settings.js +1 -1
- package/dist/apis/email-template.cjs +6 -6
- package/dist/apis/email-template.js +1 -1
- package/dist/apis/entity-mapping.cjs +6 -6
- package/dist/apis/entity-mapping.js +1 -1
- package/dist/apis/entity.cjs +6 -6
- package/dist/apis/entity.js +1 -1
- package/dist/apis/environments.cjs +6 -6
- package/dist/apis/environments.js +1 -1
- package/dist/apis/event-catalog.cjs +6 -6
- package/dist/apis/event-catalog.js +1 -1
- package/dist/apis/file.cjs +6 -6
- package/dist/apis/file.js +1 -1
- package/dist/apis/iban.cjs +6 -6
- package/dist/apis/iban.js +1 -1
- package/dist/apis/integration-toolkit.cjs +6 -6
- package/dist/apis/integration-toolkit.js +1 -1
- package/dist/apis/journey.cjs +6 -6
- package/dist/apis/journey.js +1 -1
- package/dist/apis/kanban.cjs +6 -6
- package/dist/apis/kanban.js +1 -1
- package/dist/apis/message.cjs +6 -6
- package/dist/apis/message.js +1 -1
- package/dist/apis/metering.cjs +6 -6
- package/dist/apis/metering.js +1 -1
- package/dist/apis/notes.cjs +6 -6
- package/dist/apis/notes.js +1 -1
- package/dist/apis/notification.cjs +6 -6
- package/dist/apis/notification.js +1 -1
- package/dist/apis/organization.cjs +6 -6
- package/dist/apis/organization.js +1 -1
- package/dist/apis/partner-directory.cjs +6 -6
- package/dist/apis/partner-directory.js +1 -1
- package/dist/apis/permissions.cjs +6 -6
- package/dist/apis/permissions.js +1 -1
- package/dist/apis/pricing-tier.cjs +6 -6
- package/dist/apis/pricing-tier.js +1 -1
- package/dist/apis/pricing.cjs +6 -6
- package/dist/apis/pricing.js +1 -1
- package/dist/apis/purpose.cjs +6 -6
- package/dist/apis/purpose.js +1 -1
- package/dist/apis/query.cjs +6 -6
- package/dist/apis/query.js +1 -1
- package/dist/apis/sandbox.cjs +6 -6
- package/dist/apis/sandbox.js +1 -1
- package/dist/apis/sharing.cjs +6 -6
- package/dist/apis/sharing.js +1 -1
- package/dist/apis/submission.cjs +6 -6
- package/dist/apis/submission.js +1 -1
- package/dist/apis/target.cjs +6 -6
- package/dist/apis/target.js +1 -1
- package/dist/apis/targeting.cjs +6 -6
- package/dist/apis/targeting.d.cts +2 -2
- package/dist/apis/targeting.d.ts +2 -2
- package/dist/apis/targeting.js +1 -1
- package/dist/apis/template-variables.cjs +6 -6
- package/dist/apis/template-variables.js +1 -1
- package/dist/apis/user.cjs +6 -6
- package/dist/apis/user.js +1 -1
- package/dist/apis/validation-rules.cjs +6 -6
- package/dist/apis/validation-rules.js +1 -1
- package/dist/apis/webhooks.cjs +6 -6
- package/dist/apis/webhooks.d.cts +2 -2
- package/dist/apis/webhooks.d.ts +2 -2
- package/dist/apis/webhooks.js +1 -1
- package/dist/apis/workflow-definition.cjs +6 -6
- package/dist/apis/workflow-definition.js +1 -1
- package/dist/apis/workflow.cjs +6 -6
- package/dist/apis/workflow.js +1 -1
- package/dist/{chunk-XZPA2XDZ.cjs → chunk-BVBIJPY6.cjs} +2 -2
- package/dist/{chunk-THI6AB4O.js → chunk-DMM5OZY2.js} +2 -2
- package/dist/index.cjs +8 -8
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/targeting-DAFJBPIZ.cjs +7 -0
- package/dist/targeting-TGPCRRI6.js +7 -0
- package/dist/{targeting.d-BkPe5NmP.d.cts → targeting.d-DxHQbn7-.d.cts} +11 -8
- package/dist/{targeting.d-BkPe5NmP.d.ts → targeting.d-DxHQbn7-.d.ts} +11 -8
- package/dist/webhooks-6CUXSTPH.cjs +7 -0
- package/dist/webhooks-DTNKNJEN.js +7 -0
- package/dist/{webhooks.d-ByePoUWs.d.ts → webhooks.d-DKZOMj1P.d.cts} +37 -0
- package/dist/{webhooks.d-ByePoUWs.d.cts → webhooks.d-DKZOMj1P.d.ts} +37 -0
- package/docs/targeting.md +11 -8
- package/docs/webhooks.md +11 -2
- package/package.json +1 -1
- package/dist/targeting-5N5DGNHB.js +0 -7
- package/dist/targeting-6U2RIRAE.cjs +0 -7
- package/dist/webhooks-NZHJBT64.js +0 -7
- package/dist/webhooks-SK2STDKR.cjs +0 -7
|
@@ -526,6 +526,19 @@ declare namespace Components {
|
|
|
526
526
|
id?: string;
|
|
527
527
|
name: string;
|
|
528
528
|
eventName: string;
|
|
529
|
+
/**
|
|
530
|
+
* Pinned schema version of the Event Catalog event this webhook is subscribed to.
|
|
531
|
+
* Only applicable when `eventName` refers to an Event Catalog event (prefixed with `event_`).
|
|
532
|
+
* When omitted on creation, it is backfilled lazily on first delivery to match the
|
|
533
|
+
* event's own `_event_version` (the latest at that time, stamped on the event itself).
|
|
534
|
+
* Always MAJOR.MINOR (e.g. "1.0", "2.0"), mirroring exactly what event-catalog-api
|
|
535
|
+
* stamps as `_event_version` and in its `_downgrades[].to` values. Absent for legacy
|
|
536
|
+
* configs that have not yet received an event.
|
|
537
|
+
*
|
|
538
|
+
* example:
|
|
539
|
+
* 1.0
|
|
540
|
+
*/
|
|
541
|
+
eventVersion?: string | null; // ^\d+\.\d+$
|
|
529
542
|
url?: string;
|
|
530
543
|
/**
|
|
531
544
|
* Timestamp the webhook was first created. Immutable after creation.
|
|
@@ -614,6 +627,26 @@ declare namespace Components {
|
|
|
614
627
|
[name: string]: string;
|
|
615
628
|
};
|
|
616
629
|
};
|
|
630
|
+
/**
|
|
631
|
+
* Automatic-retry policy for transient delivery failures (5xx, 429,
|
|
632
|
+
* connection-level errors). Newly-created webhooks are materialized
|
|
633
|
+
* with defaults (`enabled: true`, `maxAttempts: 3`). Webhooks created
|
|
634
|
+
* before this feature have no policy and are treated as disabled — on
|
|
635
|
+
* update, omit this field to preserve the existing value. The backoff
|
|
636
|
+
* curve is a fixed Standard Webhooks schedule (5s, 5m, 30m, 2h, 5h);
|
|
637
|
+
* only the first `maxAttempts` intervals are used.
|
|
638
|
+
*
|
|
639
|
+
*/
|
|
640
|
+
retryPolicy?: {
|
|
641
|
+
/**
|
|
642
|
+
* Master on/off switch for automatic retries.
|
|
643
|
+
*/
|
|
644
|
+
enabled: boolean;
|
|
645
|
+
/**
|
|
646
|
+
* Maximum number of automatic retries after the initial delivery attempt.
|
|
647
|
+
*/
|
|
648
|
+
maxAttempts?: number;
|
|
649
|
+
};
|
|
617
650
|
filterConditions?: /* A group of conditions with a logical operator. Multiple conditions are AND-ed by default. */ WebhookConditionGroup;
|
|
618
651
|
/**
|
|
619
652
|
* Manifest ID used to create/update the webhook resource
|
|
@@ -656,6 +689,10 @@ declare namespace Components {
|
|
|
656
689
|
* stringified payload of the webhook request
|
|
657
690
|
*/
|
|
658
691
|
payload?: string;
|
|
692
|
+
/**
|
|
693
|
+
* Number of automatic delivery retries that preceded this terminal outcome. 0 means the event was delivered (or finally failed) on the first attempt.
|
|
694
|
+
*/
|
|
695
|
+
retry_attempt?: number;
|
|
659
696
|
}
|
|
660
697
|
}
|
|
661
698
|
}
|
|
@@ -526,6 +526,19 @@ declare namespace Components {
|
|
|
526
526
|
id?: string;
|
|
527
527
|
name: string;
|
|
528
528
|
eventName: string;
|
|
529
|
+
/**
|
|
530
|
+
* Pinned schema version of the Event Catalog event this webhook is subscribed to.
|
|
531
|
+
* Only applicable when `eventName` refers to an Event Catalog event (prefixed with `event_`).
|
|
532
|
+
* When omitted on creation, it is backfilled lazily on first delivery to match the
|
|
533
|
+
* event's own `_event_version` (the latest at that time, stamped on the event itself).
|
|
534
|
+
* Always MAJOR.MINOR (e.g. "1.0", "2.0"), mirroring exactly what event-catalog-api
|
|
535
|
+
* stamps as `_event_version` and in its `_downgrades[].to` values. Absent for legacy
|
|
536
|
+
* configs that have not yet received an event.
|
|
537
|
+
*
|
|
538
|
+
* example:
|
|
539
|
+
* 1.0
|
|
540
|
+
*/
|
|
541
|
+
eventVersion?: string | null; // ^\d+\.\d+$
|
|
529
542
|
url?: string;
|
|
530
543
|
/**
|
|
531
544
|
* Timestamp the webhook was first created. Immutable after creation.
|
|
@@ -614,6 +627,26 @@ declare namespace Components {
|
|
|
614
627
|
[name: string]: string;
|
|
615
628
|
};
|
|
616
629
|
};
|
|
630
|
+
/**
|
|
631
|
+
* Automatic-retry policy for transient delivery failures (5xx, 429,
|
|
632
|
+
* connection-level errors). Newly-created webhooks are materialized
|
|
633
|
+
* with defaults (`enabled: true`, `maxAttempts: 3`). Webhooks created
|
|
634
|
+
* before this feature have no policy and are treated as disabled — on
|
|
635
|
+
* update, omit this field to preserve the existing value. The backoff
|
|
636
|
+
* curve is a fixed Standard Webhooks schedule (5s, 5m, 30m, 2h, 5h);
|
|
637
|
+
* only the first `maxAttempts` intervals are used.
|
|
638
|
+
*
|
|
639
|
+
*/
|
|
640
|
+
retryPolicy?: {
|
|
641
|
+
/**
|
|
642
|
+
* Master on/off switch for automatic retries.
|
|
643
|
+
*/
|
|
644
|
+
enabled: boolean;
|
|
645
|
+
/**
|
|
646
|
+
* Maximum number of automatic retries after the initial delivery attempt.
|
|
647
|
+
*/
|
|
648
|
+
maxAttempts?: number;
|
|
649
|
+
};
|
|
617
650
|
filterConditions?: /* A group of conditions with a logical operator. Multiple conditions are AND-ed by default. */ WebhookConditionGroup;
|
|
618
651
|
/**
|
|
619
652
|
* Manifest ID used to create/update the webhook resource
|
|
@@ -656,6 +689,10 @@ declare namespace Components {
|
|
|
656
689
|
* stringified payload of the webhook request
|
|
657
690
|
*/
|
|
658
691
|
payload?: string;
|
|
692
|
+
/**
|
|
693
|
+
* Number of automatic delivery retries that preceded this terminal outcome. 0 means the event was delivered (or finally failed) on the first attempt.
|
|
694
|
+
*/
|
|
695
|
+
retry_attempt?: number;
|
|
659
696
|
}
|
|
660
697
|
}
|
|
661
698
|
}
|
package/docs/targeting.md
CHANGED
|
@@ -283,14 +283,15 @@ const { data } = await client.setupCampaign(
|
|
|
283
283
|
target_ids: ['b8c01433-5556-4e2b-aad4-6f5348d1df84']
|
|
284
284
|
},
|
|
285
285
|
journey: {
|
|
286
|
-
journey_id: 'b8c01433-5556-4e2b-aad4-6f5348d1df84'
|
|
287
|
-
design_id: 'b8c01433-5556-4e2b-aad4-6f5348d1df84'
|
|
286
|
+
journey_id: 'b8c01433-5556-4e2b-aad4-6f5348d1df84'
|
|
288
287
|
},
|
|
289
288
|
channels: {
|
|
290
289
|
portal_widget: {
|
|
291
290
|
portal_id: 'b8c01433-5556-4e2b-aad4-6f5348d1df84',
|
|
292
|
-
block_id: 'b8c01433-5556-4e2b-aad4-6f5348d1df84'
|
|
293
|
-
|
|
291
|
+
block_id: 'b8c01433-5556-4e2b-aad4-6f5348d1df84'
|
|
292
|
+
},
|
|
293
|
+
email: {
|
|
294
|
+
automation_id: 'b8c01433-5556-4e2b-aad4-6f5348d1df84'
|
|
294
295
|
}
|
|
295
296
|
}
|
|
296
297
|
},
|
|
@@ -1052,13 +1053,14 @@ type SetupCampaignRequest = {
|
|
|
1052
1053
|
}
|
|
1053
1054
|
journey?: {
|
|
1054
1055
|
journey_id: string // uuid
|
|
1055
|
-
design_id?: string // uuid
|
|
1056
1056
|
}
|
|
1057
1057
|
channels?: {
|
|
1058
1058
|
portal_widget?: {
|
|
1059
1059
|
portal_id: { ... }
|
|
1060
1060
|
block_id: { ... }
|
|
1061
|
-
|
|
1061
|
+
}
|
|
1062
|
+
email?: {
|
|
1063
|
+
automation_id: { ... }
|
|
1062
1064
|
}
|
|
1063
1065
|
}
|
|
1064
1066
|
}
|
|
@@ -1085,13 +1087,14 @@ type SetupTariffChangeCampaignRequest = {
|
|
|
1085
1087
|
}
|
|
1086
1088
|
journey?: {
|
|
1087
1089
|
journey_id: string // uuid
|
|
1088
|
-
design_id?: string // uuid
|
|
1089
1090
|
}
|
|
1090
1091
|
channels?: {
|
|
1091
1092
|
portal_widget?: {
|
|
1092
1093
|
portal_id: { ... }
|
|
1093
1094
|
block_id: { ... }
|
|
1094
|
-
|
|
1095
|
+
}
|
|
1096
|
+
email?: {
|
|
1097
|
+
automation_id: { ... }
|
|
1095
1098
|
}
|
|
1096
1099
|
}
|
|
1097
1100
|
}
|
package/docs/webhooks.md
CHANGED
|
@@ -475,7 +475,8 @@ const { data } = await client.getEventById({
|
|
|
475
475
|
},
|
|
476
476
|
"status": "succeeded",
|
|
477
477
|
"http_method": "GET",
|
|
478
|
-
"payload": "string"
|
|
478
|
+
"payload": "string",
|
|
479
|
+
"retry_attempt": 0
|
|
479
480
|
}
|
|
480
481
|
```
|
|
481
482
|
|
|
@@ -605,7 +606,8 @@ const { data } = await client.getWebhookEventsV2(
|
|
|
605
606
|
},
|
|
606
607
|
"status": "succeeded",
|
|
607
608
|
"http_method": "GET",
|
|
608
|
-
"payload": "string"
|
|
609
|
+
"payload": "string",
|
|
610
|
+
"retry_attempt": 0
|
|
609
611
|
}
|
|
610
612
|
],
|
|
611
613
|
"next_cursor": {
|
|
@@ -683,6 +685,7 @@ type EventListResponse = {
|
|
|
683
685
|
status?: "succeeded" | "failed" | "in_progress" | "skipped"
|
|
684
686
|
http_method?: "GET" | "POST" | "PUT"
|
|
685
687
|
payload?: string
|
|
688
|
+
retry_attempt?: number
|
|
686
689
|
}>
|
|
687
690
|
next_cursor?: {
|
|
688
691
|
created_at?: string // date-time
|
|
@@ -826,6 +829,7 @@ type WebhookConfig = {
|
|
|
826
829
|
id?: string
|
|
827
830
|
name: string
|
|
828
831
|
eventName: string
|
|
832
|
+
eventVersion?: string
|
|
829
833
|
url?: string
|
|
830
834
|
creationTime?: string
|
|
831
835
|
updatedTime?: string
|
|
@@ -879,6 +883,10 @@ type WebhookConfig = {
|
|
|
879
883
|
fileSource?: string
|
|
880
884
|
extraFields?: Record<string, string>
|
|
881
885
|
}
|
|
886
|
+
retryPolicy?: {
|
|
887
|
+
enabled: boolean
|
|
888
|
+
maxAttempts?: number
|
|
889
|
+
}
|
|
882
890
|
filterConditions?: {
|
|
883
891
|
conditions?: Array<{
|
|
884
892
|
field: { ... }
|
|
@@ -1045,6 +1053,7 @@ type WebhookEvent = {
|
|
|
1045
1053
|
status?: "succeeded" | "failed" | "in_progress" | "skipped"
|
|
1046
1054
|
http_method?: "GET" | "POST" | "PUT"
|
|
1047
1055
|
payload?: string
|
|
1056
|
+
retry_attempt?: number
|
|
1048
1057
|
}
|
|
1049
1058
|
```
|
|
1050
1059
|
|
package/package.json
CHANGED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import "./chunk-YPSWSI3M.js";
|
|
2
|
-
|
|
3
|
-
// src/docs/targeting.json
|
|
4
|
-
var targeting_default = '# Targeting API\n\n- **Base URL:** `https://targeting.sls.epilot.io`\n- **Full API Docs:** [https://docs.epilot.io/api/targeting](https://docs.epilot.io/api/targeting)\n\n## Usage\n\n```ts\nimport { epilot } from \'@epilot/sdk\'\n\nepilot.authorize(() => \'<token>\')\nconst { data } = await epilot.targeting.changeCampaignStatus(...)\n```\n\n### Tree-shakeable import\n\n```ts\nimport { getClient, authorize } from \'@epilot/sdk/targeting\'\n\nconst targetingClient = getClient()\nauthorize(targetingClient, () => \'<token>\')\nconst { data } = await targetingClient.changeCampaignStatus(...)\n```\n\n## Operations\n\n**Campaign**\n- [`changeCampaignStatus`](#changecampaignstatus)\n- [`getCampaignJobStatus`](#getcampaignjobstatus)\n- [`getCampaignPortals`](#getcampaignportals)\n- [`setupCampaign`](#setupcampaign)\n- [`matchCampaigns`](#matchcampaigns)\n\n**Campaign Delivery**\n- [`retriggerCampaignAutomations`](#retriggercampaignautomations)\n\n**Target**\n- [`matchTargets`](#matchtargets)\n- [`getTargetQueries`](#gettargetqueries)\n\n**Campaign Recipient**\n- [`createRecipient`](#createrecipient)\n- [`updateRecipient`](#updaterecipient)\n- [`updateRecipientPortalStatus`](#updaterecipientportalstatus)\n- [`getRecipients`](#getrecipients)\n\n**Schemas**\n- [`BaseError`](#baseerror)\n- [`ServerError`](#servererror)\n- [`ClientError`](#clienterror)\n- [`BaseUUID`](#baseuuid)\n- [`BaseNanoID`](#basenanoid)\n- [`BaseTags`](#basetags)\n- [`BaseRelation`](#baserelation)\n- [`BaseSystemId`](#basesystemid)\n- [`BaseEntityOwner`](#baseentityowner)\n- [`BaseEntityAcl`](#baseentityacl)\n- [`BaseSystemFields`](#basesystemfields)\n- [`BaseSystemFieldsRequired`](#basesystemfieldsrequired)\n- [`CampaignStatus`](#campaignstatus)\n- [`ExecutionSummaryItem`](#executionsummaryitem)\n- [`JobStatus`](#jobstatus)\n- [`Campaign`](#campaign)\n- [`Target`](#target)\n- [`MatchCampaignParams`](#matchcampaignparams)\n- [`MatchTargetParams`](#matchtargetparams)\n- [`GetTargetQueriesParams`](#gettargetqueriesparams)\n- [`TargetQueryResult`](#targetqueryresult)\n- [`AutomationStatus`](#automationstatus)\n- [`PortalStatus`](#portalstatus)\n- [`Recipient`](#recipient)\n- [`BaseRecipientPayload`](#baserecipientpayload)\n- [`AutomationRecipientPayload`](#automationrecipientpayload)\n- [`PortalRecipientPayload`](#portalrecipientpayload)\n- [`CreateRecipientPayload`](#createrecipientpayload)\n- [`UpdateRecipientPayload`](#updaterecipientpayload)\n- [`RetriggerAutomationsRequest`](#retriggerautomationsrequest)\n- [`RetriggerAutomationsResult`](#retriggerautomationsresult)\n- [`UpdatePortalStatusRequest`](#updateportalstatusrequest)\n- [`SetupCampaignRequest`](#setupcampaignrequest)\n- [`SetupTariffChangeCampaignRequest`](#setuptariffchangecampaignrequest)\n- [`SetupTariffChangeCampaignResponse`](#setuptariffchangecampaignresponse)\n\n### `changeCampaignStatus`\n\nChange the status of a campaign\n\n`POST /v1/campaign/{campaign_id}/status`\n\n```ts\nconst { data } = await client.changeCampaignStatus({\n campaign_id: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "campaign": {\n "_id": "b8c01433-5556-4e2b-aad4-6f5348d1df84",\n "_org": "string",\n "_owners": [\n {\n "org_id": "123",\n "user_id": "123"\n }\n ],\n "_schema": "string",\n "_title": "string",\n "_tags": ["string"],\n "_created_at": "1970-01-01T00:00:00.000Z",\n "_updated_at": "1970-01-01T00:00:00.000Z",\n "_acl": {\n "view": ["org:456"],\n "edit": ["org:456"],\n "delete": ["org:456"]\n },\n "name": "string",\n "goal": "string",\n "status": "draft",\n "start_date": "1970-01-01",\n "end_date": "1970-01-01",\n "flow_id": "string",\n "job_id": "string",\n "target": {\n "$relation": [\n {\n "entity_id": "b8c01433-5556-4e2b-aad4-6f5348d1df84",\n "_tags": ["string"]\n }\n ]\n }\n }\n}\n```\n\n</details>\n\n---\n\n### `getCampaignJobStatus`\n\nGet the status of a campaign\'s automation job\n\n`GET /v1/campaign/{campaign_id}/job`\n\n```ts\nconst { data } = await client.getCampaignJobStatus({\n campaign_id: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "status": "queued",\n "execution_summary": [\n {\n "execution_id": "string",\n "execution_status": "string"\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `getCampaignPortals`\n\nGet portals usage info for a campaign\n\n`GET /v1/campaign/{campaign_id}/portals`\n\n```ts\nconst { data } = await client.getCampaignPortals({\n campaign_id: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n[\n {\n "portal": {\n "origin": "string",\n "domain": "string",\n "name": "string"\n },\n "widgets": [\n {\n "id": "string",\n "headline": {\n "en": "string",\n "de": "string"\n }\n }\n ]\n }\n]\n```\n\n</details>\n\n---\n\n### `retriggerCampaignAutomations`\n\nRetrigger automations for campaign recipients\n\n`POST /v1/campaign/{campaign_id}/automations:retrigger`\n\n```ts\nconst { data } = await client.retriggerCampaignAutomations(\n {\n campaign_id: \'example\',\n },\n {\n recipient_ids: [\'3fa85f64-5717-4562-b3fc-2c963f66afa6\']\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "message": "string",\n "results": [\n {\n "recipient_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "result": "success",\n "execution_id": "string",\n "error": "string"\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `setupCampaign`\n\nSet up a campaign with related entities and configurations\n\n`POST /v1/campaign:setup`\n\n```ts\nconst { data } = await client.setupCampaign(\n null,\n {\n type: \'tariff_change\',\n product_recommendation: {\n name: \'string\',\n source_product_id: \'b8c01433-5556-4e2b-aad4-6f5348d1df84\',\n source_price_id: \'b8c01433-5556-4e2b-aad4-6f5348d1df84\',\n offers: [\n {\n target_id: \'b8c01433-5556-4e2b-aad4-6f5348d1df84\',\n items: [\n {\n product_id: \'b8c01433-5556-4e2b-aad4-6f5348d1df84\',\n price_id: \'b8c01433-5556-4e2b-aad4-6f5348d1df84\',\n highlight_config: {}\n }\n ]\n }\n ]\n },\n campaign: {\n name: \'string\',\n goal: \'string\',\n target_ids: [\'b8c01433-5556-4e2b-aad4-6f5348d1df84\']\n },\n journey: {\n journey_id: \'b8c01433-5556-4e2b-aad4-6f5348d1df84\',\n design_id: \'b8c01433-5556-4e2b-aad4-6f5348d1df84\'\n },\n channels: {\n portal_widget: {\n portal_id: \'b8c01433-5556-4e2b-aad4-6f5348d1df84\',\n block_id: \'b8c01433-5556-4e2b-aad4-6f5348d1df84\',\n design_id: \'b8c01433-5556-4e2b-aad4-6f5348d1df84\'\n }\n }\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "type": "tariff_change",\n "product_recommendation_id": "b8c01433-5556-4e2b-aad4-6f5348d1df84",\n "campaign_id": "b8c01433-5556-4e2b-aad4-6f5348d1df84",\n "journey_id": "b8c01433-5556-4e2b-aad4-6f5348d1df84",\n "portal_widget_id": "b8c01433-5556-4e2b-aad4-6f5348d1df84"\n}\n```\n\n</details>\n\n---\n\n### `matchCampaigns`\n\nMatch campaigns\n\n`POST /v1/campaign:match`\n\n```ts\nconst { data } = await client.matchCampaigns(\n null,\n {\n entity_refs: [\n {\n entity_id: \'b8c01433-5556-4e2b-aad4-6f5348d1df84\',\n entity_schema: \'string\'\n }\n ],\n campaign_ids: [\'b8c01433-5556-4e2b-aad4-6f5348d1df84\']\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "hits": 0,\n "results": [\n {\n "campaign": {\n "_id": "b8c01433-5556-4e2b-aad4-6f5348d1df84",\n "_org": "string",\n "_owners": [\n {\n "org_id": "123",\n "user_id": "123"\n }\n ],\n "_schema": "string",\n "_title": "string",\n "_tags": ["string"],\n "_created_at": "1970-01-01T00:00:00.000Z",\n "_updated_at": "1970-01-01T00:00:00.000Z",\n "_acl": {\n "view": ["org:456"],\n "edit": ["org:456"],\n "delete": ["org:456"]\n },\n "name": "string",\n "goal": "string",\n "status": "draft",\n "start_date": "1970-01-01",\n "end_date": "1970-01-01",\n "flow_id": "string",\n "job_id": "string",\n "target": {\n "$relation": [\n {\n "entity_id": "b8c01433-5556-4e2b-aad4-6f5348d1df84",\n "_tags": ["string"]\n }\n ]\n }\n }\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `matchTargets`\n\nMatch targets\n\n`POST /v1/target:match`\n\n```ts\nconst { data } = await client.matchTargets(\n null,\n {\n entity_refs: [\n {\n entity_id: \'b8c01433-5556-4e2b-aad4-6f5348d1df84\',\n entity_schema: \'string\'\n }\n ],\n target_ids: [\'b8c01433-5556-4e2b-aad4-6f5348d1df84\']\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "hits": 0,\n "results": [\n {\n "target": {\n "_id": "b8c01433-5556-4e2b-aad4-6f5348d1df84",\n "_org": "string",\n "_owners": [\n {\n "org_id": "123",\n "user_id": "123"\n }\n ],\n "_schema": "string",\n "_title": "string",\n "_tags": ["string"],\n "_created_at": "1970-01-01T00:00:00.000Z",\n "_updated_at": "1970-01-01T00:00:00.000Z",\n "_acl": {\n "view": ["org:456"],\n "edit": ["org:456"],\n "delete": ["org:456"]\n },\n "name": "string",\n "description": "string",\n "entity_schema": "string",\n "entity_filters": {}\n }\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `getTargetQueries`\n\nGet target queries\n\n`POST /v1/target/queries`\n\n```ts\nconst { data } = await client.getTargetQueries(\n null,\n {\n target_ids: [\'b8c01433-5556-4e2b-aad4-6f5348d1df84\']\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "results": [\n {\n "target_id": "b8c01433-5556-4e2b-aad4-6f5348d1df84",\n "query": "string",\n "error": "string"\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `createRecipient`\n\nCreate a recipient associated with a campaign\n\n`POST /v1/campaign/{campaign_id}/recipient`\n\n```ts\nconst { data } = await client.createRecipient(\n {\n campaign_id: \'example\',\n },\n {\n entity_id: \'b8c01433-5556-4e2b-aad4-6f5348d1df84\',\n entity_schema: \'string\',\n automation_status: \'pending\',\n automation_execution_id: \'string\'\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "entity_id": "b8c01433-5556-4e2b-aad4-6f5348d1df84",\n "entity_schema": "string",\n "title": "string",\n "automation_status": "pending",\n "automation_execution_id": "string",\n "portal_status": "sent",\n "portal_status_updated_at": "1970-01-01T00:00:00.000Z",\n "portal_state": {},\n "updated_at": "1970-01-01T00:00:00.000Z"\n}\n```\n\n</details>\n\n---\n\n### `updateRecipient`\n\nUpdate a recipient\n\n`PATCH /v1/campaign/{campaign_id}/recipient/{recipient_id}`\n\n```ts\nconst { data } = await client.updateRecipient(\n {\n campaign_id: \'example\',\n recipient_id: \'example\',\n },\n {\n automation_status: \'pending\',\n automation_execution_id: \'string\',\n portal_status: \'sent\',\n portal_state: {}\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "entity_id": "b8c01433-5556-4e2b-aad4-6f5348d1df84",\n "entity_schema": "string",\n "title": "string",\n "automation_status": "pending",\n "automation_execution_id": "string",\n "portal_status": "sent",\n "portal_status_updated_at": "1970-01-01T00:00:00.000Z",\n "portal_state": {},\n "updated_at": "1970-01-01T00:00:00.000Z"\n}\n```\n\n</details>\n\n---\n\n### `updateRecipientPortalStatus`\n\nUpdate portal status for a campaign recipient\n\n`PATCH /v1/campaign/{campaign_id}/recipient/{recipient_id}/portal:status`\n\n```ts\nconst { data } = await client.updateRecipientPortalStatus(\n {\n campaign_id: \'example\',\n recipient_id: \'example\',\n },\n {\n status: \'sent\'\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "entity_id": "b8c01433-5556-4e2b-aad4-6f5348d1df84",\n "entity_schema": "string",\n "title": "string",\n "automation_status": "pending",\n "automation_execution_id": "string",\n "portal_status": "sent",\n "portal_status_updated_at": "1970-01-01T00:00:00.000Z",\n "portal_state": {},\n "updated_at": "1970-01-01T00:00:00.000Z"\n}\n```\n\n</details>\n\n---\n\n### `getRecipients`\n\nGet campaign recipients\n\n`GET /v1/campaign/{campaign_id}/recipients`\n\n```ts\nconst { data } = await client.getRecipients({\n campaign_id: \'example\',\n limit: 1,\n next: \'example\',\n q: \'example\',\n automation_status: \'example\',\n portal_status: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "results": [\n {\n "entity_id": "b8c01433-5556-4e2b-aad4-6f5348d1df84",\n "entity_schema": "string",\n "title": "string",\n "automation_status": "pending",\n "automation_execution_id": "string",\n "portal_status": "sent",\n "portal_status_updated_at": "1970-01-01T00:00:00.000Z",\n "portal_state": {},\n "updated_at": "1970-01-01T00:00:00.000Z"\n }\n ],\n "next": "string",\n "total": 0\n}\n```\n\n</details>\n\n---\n\n## Schemas\n\n### `BaseError`\n\n```ts\ntype BaseError = {\n status: number\n message: string\n}\n```\n\n### `ServerError`\n\n```ts\ntype ServerError = {\n status: number\n message: string\n}\n```\n\n### `ClientError`\n\nDescribes the structure of a client error response, which can be one of several types:\n1. `MessageError`: Contains a \'message\' field for general descriptive errors.\n2. `CodeError`: Contains a \'code\' field for specific, machine-readable error codes.\n3. `StatusedError`: Contains \'error\' and \'status\' f\n\n```ts\ntype ClientError = {\n message: string\n} | {\n code: "CAMPAIGN_NOT_FOUND" | "CAMPAIGN_HAS_NO_TARGET" | "CAMPAIGN_HAS_NO_DELIVERY_METHOD" | "CAMPAIGN_HAS_JOB_IN_PROGRESS" | "CAMPAIGN_HAS_UNEXPECTED_STATUS" | "JOB_TOKEN_MISSING" | "TARGET_WITHOUT_FILTERS"\n} | {\n error: string\n status: number\n}\n```\n\n### `BaseUUID`\n\n```ts\ntype BaseUUID = string // uuid\n```\n\n### `BaseNanoID`\n\n```ts\ntype BaseNanoID = string\n```\n\n### `BaseTags`\n\n```ts\ntype BaseTags = string[]\n```\n\n### `BaseRelation`\n\n```ts\ntype BaseRelation = {\n $relation?: Array<{\n entity_id?: string // uuid\n _tags?: string[]\n }>\n}\n```\n\n### `BaseSystemId`\n\n```ts\ntype BaseSystemId = {\n _id: string // uuid\n}\n```\n\n### `BaseEntityOwner`\n\nThe user / organization owning this entity.\n\nNote: Owner implicitly has access to the entity regardless of ACLs.\n\n\n```ts\ntype BaseEntityOwner = {\n org_id: string\n user_id?: string\n}\n```\n\n### `BaseEntityAcl`\n\nAccess control list (ACL) for an entity. Defines sharing access to external orgs or users.\n\n```ts\ntype BaseEntityAcl = {\n view?: string[]\n edit?: string[]\n delete?: string[]\n}\n```\n\n### `BaseSystemFields`\n\n```ts\ntype BaseSystemFields = {\n _id?: string // uuid\n _org?: string\n _owners?: Array<{\n org_id: string\n user_id?: string\n }>\n _schema?: string\n _title?: string\n _tags?: string[]\n _created_at?: string // date-time\n _updated_at?: string // date-time\n _acl?: {\n view?: string[]\n edit?: string[]\n delete?: string[]\n }\n}\n```\n\n### `BaseSystemFieldsRequired`\n\n```ts\ntype BaseSystemFieldsRequired = object\n```\n\n### `CampaignStatus`\n\n```ts\ntype CampaignStatus = "draft" | "activating" | "active" | "inactive"\n```\n\n### `ExecutionSummaryItem`\n\n```ts\ntype ExecutionSummaryItem = {\n execution_id?: string\n execution_status?: string\n}\n```\n\n### `JobStatus`\n\n```ts\ntype JobStatus = {\n status?: "queued" | "processing" | "finished" | "failed" | "cancelled" | "send_report"\n execution_summary?: Array<{\n execution_id?: string\n execution_status?: string\n }>\n}\n```\n\n### `Campaign`\n\n```ts\ntype Campaign = {\n _id?: string // uuid\n _org?: string\n _owners?: Array<{\n org_id: string\n user_id?: string\n }>\n _schema?: string\n _title?: string\n _tags?: string[]\n _created_at?: string // date-time\n _updated_at?: string // date-time\n _acl?: {\n view?: string[]\n edit?: string[]\n delete?: string[]\n }\n name?: string\n goal?: string\n status?: "draft" | "activating" | "active" | "inactive"\n start_date?: string // date\n end_date?: string // date\n flow_id?: string\n job_id?: string\n target?: {\n $relation?: Array<{\n entity_id?: { ... }\n _tags?: { ... }\n }>\n }\n}\n```\n\n### `Target`\n\n```ts\ntype Target = {\n _id?: string // uuid\n _org?: string\n _owners?: Array<{\n org_id: string\n user_id?: string\n }>\n _schema?: string\n _title?: string\n _tags?: string[]\n _created_at?: string // date-time\n _updated_at?: string // date-time\n _acl?: {\n view?: string[]\n edit?: string[]\n delete?: string[]\n }\n name?: string\n description?: string\n entity_schema?: string\n entity_filters?: Record<string, unknown>\n}\n```\n\n### `MatchCampaignParams`\n\n```ts\ntype MatchCampaignParams = {\n entity_refs: Array<{\n entity_id: string // uuid\n entity_schema: string\n }>\n campaign_ids: string // uuid[]\n}\n```\n\n### `MatchTargetParams`\n\n```ts\ntype MatchTargetParams = {\n entity_refs: Array<{\n entity_id: string // uuid\n entity_schema: string\n }>\n target_ids: string // uuid[]\n}\n```\n\n### `GetTargetQueriesParams`\n\n```ts\ntype GetTargetQueriesParams = {\n target_ids: string // uuid[]\n}\n```\n\n### `TargetQueryResult`\n\n```ts\ntype TargetQueryResult = {\n target_id: string // uuid\n query: string\n error?: string\n}\n```\n\n### `AutomationStatus`\n\n```ts\ntype AutomationStatus = "pending" | "in_progress" | "success" | "failed" | "cancelled"\n```\n\n### `PortalStatus`\n\n```ts\ntype PortalStatus = "sent" | "seen" | "dismissed" | "clicked"\n```\n\n### `Recipient`\n\n```ts\ntype Recipient = {\n entity_id?: string // uuid\n entity_schema?: string\n title?: string\n automation_status?: "pending" | "in_progress" | "success" | "failed" | "cancelled"\n automation_execution_id?: string\n portal_status?: "sent" | "seen" | "dismissed" | "clicked"\n portal_status_updated_at?: string // date-time\n portal_state?: Record<string, unknown>\n updated_at?: string // date-time\n}\n```\n\n### `BaseRecipientPayload`\n\n```ts\ntype BaseRecipientPayload = {\n entity_id: string // uuid\n entity_schema: string\n}\n```\n\n### `AutomationRecipientPayload`\n\n```ts\ntype AutomationRecipientPayload = {\n automation_status: "pending" | "in_progress" | "success" | "failed" | "cancelled"\n automation_execution_id: string\n}\n```\n\n### `PortalRecipientPayload`\n\n```ts\ntype PortalRecipientPayload = {\n portal_status: "sent" | "seen" | "dismissed" | "clicked"\n portal_state?: Record<string, unknown>\n}\n```\n\n### `CreateRecipientPayload`\n\n```ts\ntype CreateRecipientPayload = {\n entity_id: string // uuid\n entity_schema: string\n automation_status: "pending" | "in_progress" | "success" | "failed" | "cancelled"\n automation_execution_id: string\n} | {\n entity_id: string // uuid\n entity_schema: string\n portal_status: "sent" | "seen" | "dismissed" | "clicked"\n portal_state?: Record<string, unknown>\n} | {\n entity_id: string // uuid\n entity_schema: string\n automation_status: "pending" | "in_progress" | "success" | "failed" | "cancelled"\n automation_execution_id: string\n portal_status: "sent" | "seen" | "dismissed" | "clicked"\n portal_state?: Record<string, unknown>\n}\n```\n\n### `UpdateRecipientPayload`\n\n```ts\ntype UpdateRecipientPayload = {\n automation_status?: "pending" | "in_progress" | "success" | "failed" | "cancelled"\n automation_execution_id?: string\n portal_status?: "sent" | "seen" | "dismissed" | "clicked"\n portal_state?: Record<string, unknown>\n}\n```\n\n### `RetriggerAutomationsRequest`\n\n```ts\ntype RetriggerAutomationsRequest = {\n recipient_ids: string // uuid[]\n}\n```\n\n### `RetriggerAutomationsResult`\n\n```ts\ntype RetriggerAutomationsResult = {\n recipient_id: string // uuid\n result: "success" | "failure" | "not_found" | "invalid_status"\n execution_id?: string\n error?: string\n}\n```\n\n### `UpdatePortalStatusRequest`\n\n```ts\ntype UpdatePortalStatusRequest = {\n status: "sent" | "seen" | "dismissed" | "clicked"\n}\n```\n\n### `SetupCampaignRequest`\n\nDiscriminated by `type`. Each campaign variant has its own request shape;\nnew variants are added by introducing a new schema and extending the `oneOf` list.\n\n\n```ts\ntype SetupCampaignRequest = {\n type: "tariff_change"\n product_recommendation: {\n name?: string\n source_product_id?: string // uuid\n source_price_id?: string // uuid\n offers?: Array<{\n target_id?: { ... }\n items: { ... }\n }>\n }\n campaign: {\n name: string\n goal?: string\n target_ids: string // uuid[]\n }\n journey?: {\n journey_id: string // uuid\n design_id?: string // uuid\n }\n channels?: {\n portal_widget?: {\n portal_id: { ... }\n block_id: { ... }\n design_id?: { ... }\n }\n }\n}\n```\n\n### `SetupTariffChangeCampaignRequest`\n\n```ts\ntype SetupTariffChangeCampaignRequest = {\n type: "tariff_change"\n product_recommendation: {\n name?: string\n source_product_id?: string // uuid\n source_price_id?: string // uuid\n offers?: Array<{\n target_id?: { ... }\n items: { ... }\n }>\n }\n campaign: {\n name: string\n goal?: string\n target_ids: string // uuid[]\n }\n journey?: {\n journey_id: string // uuid\n design_id?: string // uuid\n }\n channels?: {\n portal_widget?: {\n portal_id: { ... }\n block_id: { ... }\n design_id?: { ... }\n }\n }\n}\n```\n\n### `SetupTariffChangeCampaignResponse`\n\n```ts\ntype SetupTariffChangeCampaignResponse = {\n type: "tariff_change"\n product_recommendation_id: string // uuid\n campaign_id: string // uuid\n journey_id?: string // uuid\n portal_widget_id?: string // uuid\n}\n```\n';
|
|
5
|
-
export {
|
|
6
|
-
targeting_default as default
|
|
7
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-NJK5F5TF.cjs');
|
|
2
|
-
|
|
3
|
-
// src/docs/targeting.json
|
|
4
|
-
var targeting_default = '# Targeting API\n\n- **Base URL:** `https://targeting.sls.epilot.io`\n- **Full API Docs:** [https://docs.epilot.io/api/targeting](https://docs.epilot.io/api/targeting)\n\n## Usage\n\n```ts\nimport { epilot } from \'@epilot/sdk\'\n\nepilot.authorize(() => \'<token>\')\nconst { data } = await epilot.targeting.changeCampaignStatus(...)\n```\n\n### Tree-shakeable import\n\n```ts\nimport { getClient, authorize } from \'@epilot/sdk/targeting\'\n\nconst targetingClient = getClient()\nauthorize(targetingClient, () => \'<token>\')\nconst { data } = await targetingClient.changeCampaignStatus(...)\n```\n\n## Operations\n\n**Campaign**\n- [`changeCampaignStatus`](#changecampaignstatus)\n- [`getCampaignJobStatus`](#getcampaignjobstatus)\n- [`getCampaignPortals`](#getcampaignportals)\n- [`setupCampaign`](#setupcampaign)\n- [`matchCampaigns`](#matchcampaigns)\n\n**Campaign Delivery**\n- [`retriggerCampaignAutomations`](#retriggercampaignautomations)\n\n**Target**\n- [`matchTargets`](#matchtargets)\n- [`getTargetQueries`](#gettargetqueries)\n\n**Campaign Recipient**\n- [`createRecipient`](#createrecipient)\n- [`updateRecipient`](#updaterecipient)\n- [`updateRecipientPortalStatus`](#updaterecipientportalstatus)\n- [`getRecipients`](#getrecipients)\n\n**Schemas**\n- [`BaseError`](#baseerror)\n- [`ServerError`](#servererror)\n- [`ClientError`](#clienterror)\n- [`BaseUUID`](#baseuuid)\n- [`BaseNanoID`](#basenanoid)\n- [`BaseTags`](#basetags)\n- [`BaseRelation`](#baserelation)\n- [`BaseSystemId`](#basesystemid)\n- [`BaseEntityOwner`](#baseentityowner)\n- [`BaseEntityAcl`](#baseentityacl)\n- [`BaseSystemFields`](#basesystemfields)\n- [`BaseSystemFieldsRequired`](#basesystemfieldsrequired)\n- [`CampaignStatus`](#campaignstatus)\n- [`ExecutionSummaryItem`](#executionsummaryitem)\n- [`JobStatus`](#jobstatus)\n- [`Campaign`](#campaign)\n- [`Target`](#target)\n- [`MatchCampaignParams`](#matchcampaignparams)\n- [`MatchTargetParams`](#matchtargetparams)\n- [`GetTargetQueriesParams`](#gettargetqueriesparams)\n- [`TargetQueryResult`](#targetqueryresult)\n- [`AutomationStatus`](#automationstatus)\n- [`PortalStatus`](#portalstatus)\n- [`Recipient`](#recipient)\n- [`BaseRecipientPayload`](#baserecipientpayload)\n- [`AutomationRecipientPayload`](#automationrecipientpayload)\n- [`PortalRecipientPayload`](#portalrecipientpayload)\n- [`CreateRecipientPayload`](#createrecipientpayload)\n- [`UpdateRecipientPayload`](#updaterecipientpayload)\n- [`RetriggerAutomationsRequest`](#retriggerautomationsrequest)\n- [`RetriggerAutomationsResult`](#retriggerautomationsresult)\n- [`UpdatePortalStatusRequest`](#updateportalstatusrequest)\n- [`SetupCampaignRequest`](#setupcampaignrequest)\n- [`SetupTariffChangeCampaignRequest`](#setuptariffchangecampaignrequest)\n- [`SetupTariffChangeCampaignResponse`](#setuptariffchangecampaignresponse)\n\n### `changeCampaignStatus`\n\nChange the status of a campaign\n\n`POST /v1/campaign/{campaign_id}/status`\n\n```ts\nconst { data } = await client.changeCampaignStatus({\n campaign_id: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "campaign": {\n "_id": "b8c01433-5556-4e2b-aad4-6f5348d1df84",\n "_org": "string",\n "_owners": [\n {\n "org_id": "123",\n "user_id": "123"\n }\n ],\n "_schema": "string",\n "_title": "string",\n "_tags": ["string"],\n "_created_at": "1970-01-01T00:00:00.000Z",\n "_updated_at": "1970-01-01T00:00:00.000Z",\n "_acl": {\n "view": ["org:456"],\n "edit": ["org:456"],\n "delete": ["org:456"]\n },\n "name": "string",\n "goal": "string",\n "status": "draft",\n "start_date": "1970-01-01",\n "end_date": "1970-01-01",\n "flow_id": "string",\n "job_id": "string",\n "target": {\n "$relation": [\n {\n "entity_id": "b8c01433-5556-4e2b-aad4-6f5348d1df84",\n "_tags": ["string"]\n }\n ]\n }\n }\n}\n```\n\n</details>\n\n---\n\n### `getCampaignJobStatus`\n\nGet the status of a campaign\'s automation job\n\n`GET /v1/campaign/{campaign_id}/job`\n\n```ts\nconst { data } = await client.getCampaignJobStatus({\n campaign_id: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "status": "queued",\n "execution_summary": [\n {\n "execution_id": "string",\n "execution_status": "string"\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `getCampaignPortals`\n\nGet portals usage info for a campaign\n\n`GET /v1/campaign/{campaign_id}/portals`\n\n```ts\nconst { data } = await client.getCampaignPortals({\n campaign_id: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n[\n {\n "portal": {\n "origin": "string",\n "domain": "string",\n "name": "string"\n },\n "widgets": [\n {\n "id": "string",\n "headline": {\n "en": "string",\n "de": "string"\n }\n }\n ]\n }\n]\n```\n\n</details>\n\n---\n\n### `retriggerCampaignAutomations`\n\nRetrigger automations for campaign recipients\n\n`POST /v1/campaign/{campaign_id}/automations:retrigger`\n\n```ts\nconst { data } = await client.retriggerCampaignAutomations(\n {\n campaign_id: \'example\',\n },\n {\n recipient_ids: [\'3fa85f64-5717-4562-b3fc-2c963f66afa6\']\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "message": "string",\n "results": [\n {\n "recipient_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "result": "success",\n "execution_id": "string",\n "error": "string"\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `setupCampaign`\n\nSet up a campaign with related entities and configurations\n\n`POST /v1/campaign:setup`\n\n```ts\nconst { data } = await client.setupCampaign(\n null,\n {\n type: \'tariff_change\',\n product_recommendation: {\n name: \'string\',\n source_product_id: \'b8c01433-5556-4e2b-aad4-6f5348d1df84\',\n source_price_id: \'b8c01433-5556-4e2b-aad4-6f5348d1df84\',\n offers: [\n {\n target_id: \'b8c01433-5556-4e2b-aad4-6f5348d1df84\',\n items: [\n {\n product_id: \'b8c01433-5556-4e2b-aad4-6f5348d1df84\',\n price_id: \'b8c01433-5556-4e2b-aad4-6f5348d1df84\',\n highlight_config: {}\n }\n ]\n }\n ]\n },\n campaign: {\n name: \'string\',\n goal: \'string\',\n target_ids: [\'b8c01433-5556-4e2b-aad4-6f5348d1df84\']\n },\n journey: {\n journey_id: \'b8c01433-5556-4e2b-aad4-6f5348d1df84\',\n design_id: \'b8c01433-5556-4e2b-aad4-6f5348d1df84\'\n },\n channels: {\n portal_widget: {\n portal_id: \'b8c01433-5556-4e2b-aad4-6f5348d1df84\',\n block_id: \'b8c01433-5556-4e2b-aad4-6f5348d1df84\',\n design_id: \'b8c01433-5556-4e2b-aad4-6f5348d1df84\'\n }\n }\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "type": "tariff_change",\n "product_recommendation_id": "b8c01433-5556-4e2b-aad4-6f5348d1df84",\n "campaign_id": "b8c01433-5556-4e2b-aad4-6f5348d1df84",\n "journey_id": "b8c01433-5556-4e2b-aad4-6f5348d1df84",\n "portal_widget_id": "b8c01433-5556-4e2b-aad4-6f5348d1df84"\n}\n```\n\n</details>\n\n---\n\n### `matchCampaigns`\n\nMatch campaigns\n\n`POST /v1/campaign:match`\n\n```ts\nconst { data } = await client.matchCampaigns(\n null,\n {\n entity_refs: [\n {\n entity_id: \'b8c01433-5556-4e2b-aad4-6f5348d1df84\',\n entity_schema: \'string\'\n }\n ],\n campaign_ids: [\'b8c01433-5556-4e2b-aad4-6f5348d1df84\']\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "hits": 0,\n "results": [\n {\n "campaign": {\n "_id": "b8c01433-5556-4e2b-aad4-6f5348d1df84",\n "_org": "string",\n "_owners": [\n {\n "org_id": "123",\n "user_id": "123"\n }\n ],\n "_schema": "string",\n "_title": "string",\n "_tags": ["string"],\n "_created_at": "1970-01-01T00:00:00.000Z",\n "_updated_at": "1970-01-01T00:00:00.000Z",\n "_acl": {\n "view": ["org:456"],\n "edit": ["org:456"],\n "delete": ["org:456"]\n },\n "name": "string",\n "goal": "string",\n "status": "draft",\n "start_date": "1970-01-01",\n "end_date": "1970-01-01",\n "flow_id": "string",\n "job_id": "string",\n "target": {\n "$relation": [\n {\n "entity_id": "b8c01433-5556-4e2b-aad4-6f5348d1df84",\n "_tags": ["string"]\n }\n ]\n }\n }\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `matchTargets`\n\nMatch targets\n\n`POST /v1/target:match`\n\n```ts\nconst { data } = await client.matchTargets(\n null,\n {\n entity_refs: [\n {\n entity_id: \'b8c01433-5556-4e2b-aad4-6f5348d1df84\',\n entity_schema: \'string\'\n }\n ],\n target_ids: [\'b8c01433-5556-4e2b-aad4-6f5348d1df84\']\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "hits": 0,\n "results": [\n {\n "target": {\n "_id": "b8c01433-5556-4e2b-aad4-6f5348d1df84",\n "_org": "string",\n "_owners": [\n {\n "org_id": "123",\n "user_id": "123"\n }\n ],\n "_schema": "string",\n "_title": "string",\n "_tags": ["string"],\n "_created_at": "1970-01-01T00:00:00.000Z",\n "_updated_at": "1970-01-01T00:00:00.000Z",\n "_acl": {\n "view": ["org:456"],\n "edit": ["org:456"],\n "delete": ["org:456"]\n },\n "name": "string",\n "description": "string",\n "entity_schema": "string",\n "entity_filters": {}\n }\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `getTargetQueries`\n\nGet target queries\n\n`POST /v1/target/queries`\n\n```ts\nconst { data } = await client.getTargetQueries(\n null,\n {\n target_ids: [\'b8c01433-5556-4e2b-aad4-6f5348d1df84\']\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "results": [\n {\n "target_id": "b8c01433-5556-4e2b-aad4-6f5348d1df84",\n "query": "string",\n "error": "string"\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `createRecipient`\n\nCreate a recipient associated with a campaign\n\n`POST /v1/campaign/{campaign_id}/recipient`\n\n```ts\nconst { data } = await client.createRecipient(\n {\n campaign_id: \'example\',\n },\n {\n entity_id: \'b8c01433-5556-4e2b-aad4-6f5348d1df84\',\n entity_schema: \'string\',\n automation_status: \'pending\',\n automation_execution_id: \'string\'\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "entity_id": "b8c01433-5556-4e2b-aad4-6f5348d1df84",\n "entity_schema": "string",\n "title": "string",\n "automation_status": "pending",\n "automation_execution_id": "string",\n "portal_status": "sent",\n "portal_status_updated_at": "1970-01-01T00:00:00.000Z",\n "portal_state": {},\n "updated_at": "1970-01-01T00:00:00.000Z"\n}\n```\n\n</details>\n\n---\n\n### `updateRecipient`\n\nUpdate a recipient\n\n`PATCH /v1/campaign/{campaign_id}/recipient/{recipient_id}`\n\n```ts\nconst { data } = await client.updateRecipient(\n {\n campaign_id: \'example\',\n recipient_id: \'example\',\n },\n {\n automation_status: \'pending\',\n automation_execution_id: \'string\',\n portal_status: \'sent\',\n portal_state: {}\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "entity_id": "b8c01433-5556-4e2b-aad4-6f5348d1df84",\n "entity_schema": "string",\n "title": "string",\n "automation_status": "pending",\n "automation_execution_id": "string",\n "portal_status": "sent",\n "portal_status_updated_at": "1970-01-01T00:00:00.000Z",\n "portal_state": {},\n "updated_at": "1970-01-01T00:00:00.000Z"\n}\n```\n\n</details>\n\n---\n\n### `updateRecipientPortalStatus`\n\nUpdate portal status for a campaign recipient\n\n`PATCH /v1/campaign/{campaign_id}/recipient/{recipient_id}/portal:status`\n\n```ts\nconst { data } = await client.updateRecipientPortalStatus(\n {\n campaign_id: \'example\',\n recipient_id: \'example\',\n },\n {\n status: \'sent\'\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "entity_id": "b8c01433-5556-4e2b-aad4-6f5348d1df84",\n "entity_schema": "string",\n "title": "string",\n "automation_status": "pending",\n "automation_execution_id": "string",\n "portal_status": "sent",\n "portal_status_updated_at": "1970-01-01T00:00:00.000Z",\n "portal_state": {},\n "updated_at": "1970-01-01T00:00:00.000Z"\n}\n```\n\n</details>\n\n---\n\n### `getRecipients`\n\nGet campaign recipients\n\n`GET /v1/campaign/{campaign_id}/recipients`\n\n```ts\nconst { data } = await client.getRecipients({\n campaign_id: \'example\',\n limit: 1,\n next: \'example\',\n q: \'example\',\n automation_status: \'example\',\n portal_status: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "results": [\n {\n "entity_id": "b8c01433-5556-4e2b-aad4-6f5348d1df84",\n "entity_schema": "string",\n "title": "string",\n "automation_status": "pending",\n "automation_execution_id": "string",\n "portal_status": "sent",\n "portal_status_updated_at": "1970-01-01T00:00:00.000Z",\n "portal_state": {},\n "updated_at": "1970-01-01T00:00:00.000Z"\n }\n ],\n "next": "string",\n "total": 0\n}\n```\n\n</details>\n\n---\n\n## Schemas\n\n### `BaseError`\n\n```ts\ntype BaseError = {\n status: number\n message: string\n}\n```\n\n### `ServerError`\n\n```ts\ntype ServerError = {\n status: number\n message: string\n}\n```\n\n### `ClientError`\n\nDescribes the structure of a client error response, which can be one of several types:\n1. `MessageError`: Contains a \'message\' field for general descriptive errors.\n2. `CodeError`: Contains a \'code\' field for specific, machine-readable error codes.\n3. `StatusedError`: Contains \'error\' and \'status\' f\n\n```ts\ntype ClientError = {\n message: string\n} | {\n code: "CAMPAIGN_NOT_FOUND" | "CAMPAIGN_HAS_NO_TARGET" | "CAMPAIGN_HAS_NO_DELIVERY_METHOD" | "CAMPAIGN_HAS_JOB_IN_PROGRESS" | "CAMPAIGN_HAS_UNEXPECTED_STATUS" | "JOB_TOKEN_MISSING" | "TARGET_WITHOUT_FILTERS"\n} | {\n error: string\n status: number\n}\n```\n\n### `BaseUUID`\n\n```ts\ntype BaseUUID = string // uuid\n```\n\n### `BaseNanoID`\n\n```ts\ntype BaseNanoID = string\n```\n\n### `BaseTags`\n\n```ts\ntype BaseTags = string[]\n```\n\n### `BaseRelation`\n\n```ts\ntype BaseRelation = {\n $relation?: Array<{\n entity_id?: string // uuid\n _tags?: string[]\n }>\n}\n```\n\n### `BaseSystemId`\n\n```ts\ntype BaseSystemId = {\n _id: string // uuid\n}\n```\n\n### `BaseEntityOwner`\n\nThe user / organization owning this entity.\n\nNote: Owner implicitly has access to the entity regardless of ACLs.\n\n\n```ts\ntype BaseEntityOwner = {\n org_id: string\n user_id?: string\n}\n```\n\n### `BaseEntityAcl`\n\nAccess control list (ACL) for an entity. Defines sharing access to external orgs or users.\n\n```ts\ntype BaseEntityAcl = {\n view?: string[]\n edit?: string[]\n delete?: string[]\n}\n```\n\n### `BaseSystemFields`\n\n```ts\ntype BaseSystemFields = {\n _id?: string // uuid\n _org?: string\n _owners?: Array<{\n org_id: string\n user_id?: string\n }>\n _schema?: string\n _title?: string\n _tags?: string[]\n _created_at?: string // date-time\n _updated_at?: string // date-time\n _acl?: {\n view?: string[]\n edit?: string[]\n delete?: string[]\n }\n}\n```\n\n### `BaseSystemFieldsRequired`\n\n```ts\ntype BaseSystemFieldsRequired = object\n```\n\n### `CampaignStatus`\n\n```ts\ntype CampaignStatus = "draft" | "activating" | "active" | "inactive"\n```\n\n### `ExecutionSummaryItem`\n\n```ts\ntype ExecutionSummaryItem = {\n execution_id?: string\n execution_status?: string\n}\n```\n\n### `JobStatus`\n\n```ts\ntype JobStatus = {\n status?: "queued" | "processing" | "finished" | "failed" | "cancelled" | "send_report"\n execution_summary?: Array<{\n execution_id?: string\n execution_status?: string\n }>\n}\n```\n\n### `Campaign`\n\n```ts\ntype Campaign = {\n _id?: string // uuid\n _org?: string\n _owners?: Array<{\n org_id: string\n user_id?: string\n }>\n _schema?: string\n _title?: string\n _tags?: string[]\n _created_at?: string // date-time\n _updated_at?: string // date-time\n _acl?: {\n view?: string[]\n edit?: string[]\n delete?: string[]\n }\n name?: string\n goal?: string\n status?: "draft" | "activating" | "active" | "inactive"\n start_date?: string // date\n end_date?: string // date\n flow_id?: string\n job_id?: string\n target?: {\n $relation?: Array<{\n entity_id?: { ... }\n _tags?: { ... }\n }>\n }\n}\n```\n\n### `Target`\n\n```ts\ntype Target = {\n _id?: string // uuid\n _org?: string\n _owners?: Array<{\n org_id: string\n user_id?: string\n }>\n _schema?: string\n _title?: string\n _tags?: string[]\n _created_at?: string // date-time\n _updated_at?: string // date-time\n _acl?: {\n view?: string[]\n edit?: string[]\n delete?: string[]\n }\n name?: string\n description?: string\n entity_schema?: string\n entity_filters?: Record<string, unknown>\n}\n```\n\n### `MatchCampaignParams`\n\n```ts\ntype MatchCampaignParams = {\n entity_refs: Array<{\n entity_id: string // uuid\n entity_schema: string\n }>\n campaign_ids: string // uuid[]\n}\n```\n\n### `MatchTargetParams`\n\n```ts\ntype MatchTargetParams = {\n entity_refs: Array<{\n entity_id: string // uuid\n entity_schema: string\n }>\n target_ids: string // uuid[]\n}\n```\n\n### `GetTargetQueriesParams`\n\n```ts\ntype GetTargetQueriesParams = {\n target_ids: string // uuid[]\n}\n```\n\n### `TargetQueryResult`\n\n```ts\ntype TargetQueryResult = {\n target_id: string // uuid\n query: string\n error?: string\n}\n```\n\n### `AutomationStatus`\n\n```ts\ntype AutomationStatus = "pending" | "in_progress" | "success" | "failed" | "cancelled"\n```\n\n### `PortalStatus`\n\n```ts\ntype PortalStatus = "sent" | "seen" | "dismissed" | "clicked"\n```\n\n### `Recipient`\n\n```ts\ntype Recipient = {\n entity_id?: string // uuid\n entity_schema?: string\n title?: string\n automation_status?: "pending" | "in_progress" | "success" | "failed" | "cancelled"\n automation_execution_id?: string\n portal_status?: "sent" | "seen" | "dismissed" | "clicked"\n portal_status_updated_at?: string // date-time\n portal_state?: Record<string, unknown>\n updated_at?: string // date-time\n}\n```\n\n### `BaseRecipientPayload`\n\n```ts\ntype BaseRecipientPayload = {\n entity_id: string // uuid\n entity_schema: string\n}\n```\n\n### `AutomationRecipientPayload`\n\n```ts\ntype AutomationRecipientPayload = {\n automation_status: "pending" | "in_progress" | "success" | "failed" | "cancelled"\n automation_execution_id: string\n}\n```\n\n### `PortalRecipientPayload`\n\n```ts\ntype PortalRecipientPayload = {\n portal_status: "sent" | "seen" | "dismissed" | "clicked"\n portal_state?: Record<string, unknown>\n}\n```\n\n### `CreateRecipientPayload`\n\n```ts\ntype CreateRecipientPayload = {\n entity_id: string // uuid\n entity_schema: string\n automation_status: "pending" | "in_progress" | "success" | "failed" | "cancelled"\n automation_execution_id: string\n} | {\n entity_id: string // uuid\n entity_schema: string\n portal_status: "sent" | "seen" | "dismissed" | "clicked"\n portal_state?: Record<string, unknown>\n} | {\n entity_id: string // uuid\n entity_schema: string\n automation_status: "pending" | "in_progress" | "success" | "failed" | "cancelled"\n automation_execution_id: string\n portal_status: "sent" | "seen" | "dismissed" | "clicked"\n portal_state?: Record<string, unknown>\n}\n```\n\n### `UpdateRecipientPayload`\n\n```ts\ntype UpdateRecipientPayload = {\n automation_status?: "pending" | "in_progress" | "success" | "failed" | "cancelled"\n automation_execution_id?: string\n portal_status?: "sent" | "seen" | "dismissed" | "clicked"\n portal_state?: Record<string, unknown>\n}\n```\n\n### `RetriggerAutomationsRequest`\n\n```ts\ntype RetriggerAutomationsRequest = {\n recipient_ids: string // uuid[]\n}\n```\n\n### `RetriggerAutomationsResult`\n\n```ts\ntype RetriggerAutomationsResult = {\n recipient_id: string // uuid\n result: "success" | "failure" | "not_found" | "invalid_status"\n execution_id?: string\n error?: string\n}\n```\n\n### `UpdatePortalStatusRequest`\n\n```ts\ntype UpdatePortalStatusRequest = {\n status: "sent" | "seen" | "dismissed" | "clicked"\n}\n```\n\n### `SetupCampaignRequest`\n\nDiscriminated by `type`. Each campaign variant has its own request shape;\nnew variants are added by introducing a new schema and extending the `oneOf` list.\n\n\n```ts\ntype SetupCampaignRequest = {\n type: "tariff_change"\n product_recommendation: {\n name?: string\n source_product_id?: string // uuid\n source_price_id?: string // uuid\n offers?: Array<{\n target_id?: { ... }\n items: { ... }\n }>\n }\n campaign: {\n name: string\n goal?: string\n target_ids: string // uuid[]\n }\n journey?: {\n journey_id: string // uuid\n design_id?: string // uuid\n }\n channels?: {\n portal_widget?: {\n portal_id: { ... }\n block_id: { ... }\n design_id?: { ... }\n }\n }\n}\n```\n\n### `SetupTariffChangeCampaignRequest`\n\n```ts\ntype SetupTariffChangeCampaignRequest = {\n type: "tariff_change"\n product_recommendation: {\n name?: string\n source_product_id?: string // uuid\n source_price_id?: string // uuid\n offers?: Array<{\n target_id?: { ... }\n items: { ... }\n }>\n }\n campaign: {\n name: string\n goal?: string\n target_ids: string // uuid[]\n }\n journey?: {\n journey_id: string // uuid\n design_id?: string // uuid\n }\n channels?: {\n portal_widget?: {\n portal_id: { ... }\n block_id: { ... }\n design_id?: { ... }\n }\n }\n}\n```\n\n### `SetupTariffChangeCampaignResponse`\n\n```ts\ntype SetupTariffChangeCampaignResponse = {\n type: "tariff_change"\n product_recommendation_id: string // uuid\n campaign_id: string // uuid\n journey_id?: string // uuid\n portal_widget_id?: string // uuid\n}\n```\n';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
exports.default = targeting_default;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import "./chunk-YPSWSI3M.js";
|
|
2
|
-
|
|
3
|
-
// src/docs/webhooks.json
|
|
4
|
-
var webhooks_default = '# Webhooks\n\n- **Base URL:** `https://webhooks.sls.epilot.io`\n- **Full API Docs:** [https://docs.epilot.io/api/webhooks](https://docs.epilot.io/api/webhooks)\n\n## Usage\n\n```ts\nimport { epilot } from \'@epilot/sdk\'\n\nepilot.authorize(() => \'<token>\')\nconst { data } = await epilot.webhooks.getPublicKey(...)\n```\n\n### Tree-shakeable import\n\n```ts\nimport { getClient, authorize } from \'@epilot/sdk/webhooks\'\n\nconst webhooksClient = getClient()\nauthorize(webhooksClient, () => \'<token>\')\nconst { data } = await webhooksClient.getPublicKey(...)\n```\n\n## Operations\n\n**webhooks**\n- [`getPublicKey`](#getpublickey)\n- [`getConfiguredEvents`](#getconfiguredevents)\n- [`getConfigs`](#getconfigs)\n- [`createConfig`](#createconfig)\n- [`getConfig`](#getconfig)\n- [`updateConfig`](#updateconfig)\n- [`deleteConfig`](#deleteconfig)\n- [`testOAuth`](#testoauth)\n- [`triggerWebhook`](#triggerwebhook)\n- [`batchReplayEvents`](#batchreplayevents)\n- [`getEventById`](#geteventbyid)\n- [`replayEvent`](#replayevent)\n- [`getWebhookExample`](#getwebhookexample)\n\n**Events**\n- [`getWebhookEventsV2`](#getwebhookeventsv2)\n\n**Schemas**\n- [`PublicKeyResponse`](#publickeyresponse)\n- [`SearchOptions`](#searchoptions)\n- [`EventListResponse`](#eventlistresponse)\n- [`HttpMethod`](#httpmethod)\n- [`AuthType`](#authtype)\n- [`Filter`](#filter)\n- [`WebhookCondition`](#webhookcondition)\n- [`WebhookConditionGroup`](#webhookconditiongroup)\n- [`Auth`](#auth)\n- [`BasicAuthConfig`](#basicauthconfig)\n- [`OAuthConfig`](#oauthconfig)\n- [`ApiKeyConfig`](#apikeyconfig)\n- [`WebhookConfig`](#webhookconfig)\n- [`EventConfigResp`](#eventconfigresp)\n- [`EventConfigEntry`](#eventconfigentry)\n- [`ErrorResp`](#errorresp)\n- [`TriggerWebhookResp`](#triggerwebhookresp)\n- [`PayloadConfiguration`](#payloadconfiguration)\n- [`CustomHeader`](#customheader)\n- [`CustomOAuthParameter`](#customoauthparameter)\n- [`Metadata`](#metadata)\n- [`ExecutionPayload`](#executionpayload)\n- [`WebhookEvent`](#webhookevent)\n- [`ExampleRequest`](#examplerequest)\n- [`ExampleResponse`](#exampleresponse)\n- [`TestOAuthResponse`](#testoauthresponse)\n- [`BatchReplayRequest`](#batchreplayrequest)\n\n### `getPublicKey`\n\nReturns the platform-level Ed25519 public key used to verify\nasymmetric (v1a) webhook signatures. This endpoint is unauthenticated since the public key is not a secret, but the orgId parameter is requ\n\n`GET /v1/webhooks/.well-known/public-key`\n\n```ts\nconst { data } = await client.getPublicKey({\n orgId: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "public_key": "-----BEGIN PUBLIC KEY-----\\nMCowBQYDK2VwAyEA...\\n-----END PUBLIC KEY-----\\n",\n "algorithm": "ed25519",\n "issuer": "epilot"\n}\n```\n\n</details>\n\n---\n\n### `getConfiguredEvents`\n\nRetrieve events that can trigger webhooks\n\n`GET /v1/webhooks/configured-events`\n\n```ts\nconst { data } = await client.getConfiguredEvents()\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n[\n {\n "eventName": "customer_request_created",\n "eventLabel": "Customer Request Created"\n }\n]\n```\n\n</details>\n\n---\n\n### `getConfigs`\n\nSearch Webhook Client Configs\n\n`GET /v1/webhooks/configs`\n\n```ts\nconst { data } = await client.getConfigs({\n eventName: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n[\n {\n "eventName": "CustomerRequest_Created",\n "url": "https://my-partner-service.api.com",\n "httpMethod": "POST",\n "enabled": true,\n "auth": {\n "authType": "BASIC",\n "basicAuthConfig": {\n "username": "secretUsername",\n "password": "secret7825@!"\n }\n },\n "filter": {\n "keyToFilter": "customer_request.productId",\n "supportedValues": ["2324245", "5253642"]\n }\n }\n]\n```\n\n</details>\n\n---\n\n### `createConfig`\n\nCreate Webhook Client Config\n\n`POST /v1/webhooks/configs`\n\n```ts\nconst { data } = await client.createConfig(\n null,\n {\n eventName: \'CustomerRequest_Created\',\n url: \'https://my-partner-service.api.com\',\n httpMethod: \'POST\',\n enabled: true,\n auth: {\n authType: \'BASIC\',\n basicAuthConfig: {\n username: \'secretUsername\',\n password: \'secret7825@!\'\n }\n },\n filter: {\n keyToFilter: \'customer_request.productId\',\n supportedValues: [\'2324245\', \'5253642\']\n }\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "eventName": "CustomerRequest_Created",\n "url": "https://my-partner-service.api.com",\n "httpMethod": "POST",\n "enabled": true,\n "auth": {\n "authType": "BASIC",\n "basicAuthConfig": {\n "username": "secretUsername",\n "password": "secret7825@!"\n }\n },\n "filter": {\n "keyToFilter": "customer_request.productId",\n "supportedValues": ["2324245", "5253642"]\n }\n}\n```\n\n</details>\n\n---\n\n### `getConfig`\n\nGet webhook config by id\n\n`GET /v1/webhooks/configs/{configId}`\n\n```ts\nconst { data } = await client.getConfig({\n configId: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "eventName": "CustomerRequest_Created",\n "url": "https://my-partner-service.api.com",\n "httpMethod": "POST",\n "enabled": true,\n "auth": {\n "authType": "BASIC",\n "basicAuthConfig": {\n "username": "secretUsername",\n "password": "secret7825@!"\n }\n },\n "filter": {\n "keyToFilter": "customer_request.productId",\n "supportedValues": ["2324245", "5253642"]\n }\n}\n```\n\n</details>\n\n---\n\n### `updateConfig`\n\nUpdate Webhook Client Config\n\n`PUT /v1/webhooks/configs/{configId}`\n\n```ts\nconst { data } = await client.updateConfig(\n {\n configId: \'example\',\n },\n {\n eventName: \'CustomerRequest_Created\',\n url: \'https://my-partner-service.api.com\',\n httpMethod: \'POST\',\n enabled: true,\n auth: {\n authType: \'BASIC\',\n basicAuthConfig: {\n username: \'secretUsername\',\n password: \'secret7825@!\'\n }\n },\n filter: {\n keyToFilter: \'customer_request.productId\',\n supportedValues: [\'2324245\', \'5253642\']\n }\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "eventName": "CustomerRequest_Created",\n "url": "https://my-partner-service.api.com",\n "httpMethod": "POST",\n "enabled": true,\n "auth": {\n "authType": "BASIC",\n "basicAuthConfig": {\n "username": "secretUsername",\n "password": "secret7825@!"\n }\n },\n "filter": {\n "keyToFilter": "customer_request.productId",\n "supportedValues": ["2324245", "5253642"]\n }\n}\n```\n\n</details>\n\n---\n\n### `deleteConfig`\n\nDelete Webhook Client Config\n\n`DELETE /v1/webhooks/configs/{configId}`\n\n```ts\nconst { data } = await client.deleteConfig({\n configId: \'example\',\n})\n```\n\n---\n\n### `testOAuth`\n\nTest OAuth connection\n\n`POST /v1/webhooks/configs/{configId}/test-oauth`\n\n```ts\nconst { data } = await client.testOAuth({\n configId: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "success": true,\n "expires_in": 3600,\n "token_type": "Bearer",\n "message": "OAuth token exchange successful"\n}\n```\n\n</details>\n\n---\n\n### `triggerWebhook`\n\ntriggers a webhook event either async or sync\n\n`POST /v1/webhooks/configs/{configId}/trigger`\n\n```ts\nconst { data } = await client.triggerWebhook(\n {\n sync: true,\n configId: \'example\',\n },\n {\n metadata: {\n action: \'Manual triggered by user with id 123456\',\n origin: \'string\',\n creation_timestamp: \'string\',\n webhook_id: \'string\',\n webhook_name: \'string\',\n automation_name: \'string\',\n organization_id: \'string\',\n user_id: \'string\',\n correlation_id: \'string\',\n execution_id: \'string\',\n action_id: \'string\'\n }\n },\n)\n```\n\n<details>\n<summary>Response</summary>\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</details>\n\n---\n\n### `batchReplayEvents`\n\nReplay a batch of webhook events\n\n`POST /v1/webhooks/configs/{configId}/events/replay-batch`\n\n```ts\nconst { data } = await client.batchReplayEvents(\n {\n configId: \'example\',\n },\n {\n eventIds: [\'2f1b7cf8-ff55-4359-966f-e56f39a52c94\', \'48c984bf-466b-470b-b743-d07cea168243\']\n },\n)\n```\n\n---\n\n### `getEventById`\n\nGet a webhook event by its id\n\n`GET /v1/webhooks/configs/{configId}/events/{eventId}`\n\n```ts\nconst { data } = await client.getEventById({\n configId: \'example\',\n eventId: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "event_id": "string",\n "org_id": "string",\n "webhook_config_id": "string",\n "url": "string",\n "created_at": "2021-04-27T12:01:13.000Z",\n "event_name": "string",\n "http_response": {\n "status_code": 0,\n "message": "string",\n "body": {},\n "code": "string"\n },\n "metadata": {\n "action": "Manual triggered by user with id 123456",\n "origin": "string",\n "creation_timestamp": "string",\n "webhook_id": "string",\n "webhook_name": "string",\n "automation_name": "string",\n "organization_id": "string",\n "user_id": "string",\n "correlation_id": "string",\n "execution_id": "string",\n "action_id": "string"\n },\n "status": "succeeded",\n "http_method": "GET",\n "payload": "string"\n}\n```\n\n</details>\n\n---\n\n### `replayEvent`\n\nReplay a webhook event\n\n`POST /v1/webhooks/configs/{configId}/events/{eventId}/replay`\n\n```ts\nconst { data } = await client.replayEvent({\n configId: \'example\',\n eventId: \'example\',\n})\n```\n\n---\n\n### `getWebhookExample`\n\nGenerate an example payload for a webhook configuration based on trigger type\n\n`POST /v1/webhooks/configs/{configId}/example`\n\n```ts\nconst { data } = await client.getWebhookExample(\n {\n configId: \'example\',\n },\n {\n automation_id: \'automation_123\'\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "metadata": {\n "action": "Manual triggered by user with id 123456",\n "origin": "string",\n "creation_timestamp": "string",\n "webhook_id": "string",\n "webhook_name": "string",\n "automation_name": "string",\n "organization_id": "string",\n "user_id": "string",\n "correlation_id": "string",\n "execution_id": "string",\n "action_id": "string"\n },\n "entity": {},\n "relations": [\n {}\n ]\n}\n```\n\n</details>\n\n---\n\n### `getWebhookEventsV2`\n\nList webhook events and filter them by status, timestamp, etc.\n\n`POST /v2/webhooks/configs/{configId}/events`\n\n```ts\nconst { data } = await client.getWebhookEventsV2(\n {\n configId: \'example\',\n },\n {\n limit: 25,\n cursor: {\n created_at: \'2025-10-31T12:34:56Z\',\n event_id: \'evt_1234567890abcdef\'\n },\n timestamp: {\n from: \'2025-10-01T00:00:00Z\',\n to: \'2025-10-31T23:59:59Z\'\n },\n event_id: \'evt_1234567890abcdef\',\n status: \'succeeded\'\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "data": [\n {\n "event_id": "string",\n "org_id": "string",\n "webhook_config_id": "string",\n "url": "string",\n "created_at": "2021-04-27T12:01:13.000Z",\n "event_name": "string",\n "http_response": {\n "status_code": 0,\n "message": "string",\n "body": {},\n "code": "string"\n },\n "metadata": {\n "action": "Manual triggered by user with id 123456",\n "origin": "string",\n "creation_timestamp": "string",\n "webhook_id": "string",\n "webhook_name": "string",\n "automation_name": "string",\n "organization_id": "string",\n "user_id": "string",\n "correlation_id": "string",\n "execution_id": "string",\n "action_id": "string"\n },\n "status": "succeeded",\n "http_method": "GET",\n "payload": "string"\n }\n ],\n "next_cursor": {\n "created_at": "2025-10-31T12:34:56Z",\n "event_id": "evt_1234567890abcdef"\n },\n "has_more": true\n}\n```\n\n</details>\n\n---\n\n## Schemas\n\n### `PublicKeyResponse`\n\n```ts\ntype PublicKeyResponse = {\n public_key: string\n algorithm: string\n issuer?: string\n}\n```\n\n### `SearchOptions`\n\n```ts\ntype SearchOptions = {\n limit?: number\n cursor?: {\n created_at?: string // date-time\n event_id?: string\n }\n timestamp?: {\n from?: string // date-time\n to?: string // date-time\n }\n event_id?: string\n status?: "succeeded" | "failed" | "skipped"\n}\n```\n\n### `EventListResponse`\n\n```ts\ntype EventListResponse = {\n data?: Array<{\n event_id: string\n org_id: string\n webhook_config_id: string\n url?: string\n created_at?: string\n event_name?: string\n http_response?: {\n status_code?: { ... }\n message?: { ... }\n body?: { ... }\n code?: { ... }\n }\n metadata?: {\n action?: { ... }\n origin?: { ... }\n creation_timestamp?: { ... }\n webhook_id?: { ... }\n webhook_name?: { ... }\n automation_name?: { ... }\n organization_id: { ... }\n user_id?: { ... }\n correlation_id?: { ... }\n execution_id?: { ... }\n action_id?: { ... }\n }\n status?: "succeeded" | "failed" | "in_progress" | "skipped"\n http_method?: "GET" | "POST" | "PUT"\n payload?: string\n }>\n next_cursor?: {\n created_at?: string // date-time\n event_id?: string\n }\n has_more?: boolean\n}\n```\n\n### `HttpMethod`\n\n```ts\ntype HttpMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "OPTIONS" | "HEAD"\n```\n\n### `AuthType`\n\n```ts\ntype AuthType = "BASIC" | "OAUTH_CLIENT_CREDENTIALS" | "API_KEY" | "NONE"\n```\n\n### `Filter`\n\n```ts\ntype Filter = {\n keyToFilter: string\n supportedValues: string[]\n}\n```\n\n### `WebhookCondition`\n\nA condition that must be met for the webhook to fire.\n\n```ts\ntype WebhookCondition = {\n field: string\n operation: "equals" | "not_equals" | "any_of" | "none_of" | "contains" | "not_contains" | "starts_with" | "ends_with" | "greater_than" | "less_than" | "greater_than_or_equals" | "less_than_or_equals" | "is_empty" | "is_not_empty"\n values?: string[]\n field_type?: "string" | "number" | "boolean" | "date" | "datetime"\n is_array_field?: boolean\n repeatable_item_op?: boolean\n}\n```\n\n### `WebhookConditionGroup`\n\nA group of conditions with a logical operator. Multiple conditions are AND-ed by default.\n\n```ts\ntype WebhookConditionGroup = {\n conditions?: Array<{\n field: string\n operation: "equals" | "not_equals" | "any_of" | "none_of" | "contains" | "not_contains" | "starts_with" | "ends_with" | "greater_than" | "less_than" | "greater_than_or_equals" | "less_than_or_equals" | "is_empty" | "is_not_empty"\n values?: string[]\n field_type?: "string" | "number" | "boolean" | "date" | "datetime"\n is_array_field?: boolean\n repeatable_item_op?: boolean\n }>\n logical_operator?: "AND" | "OR"\n}\n```\n\n### `Auth`\n\n```ts\ntype Auth = {\n authType: "BASIC" | "OAUTH_CLIENT_CREDENTIALS" | "API_KEY" | "NONE"\n basicAuthConfig?: {\n username: string\n password?: string\n passwordIsEnvVar?: boolean\n }\n oauthConfig?: {\n clientId: string\n clientSecret?: string\n clientSecretIsEnvVar?: boolean\n endpoint: string\n httpMethod: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "OPTIONS" | "HEAD"\n customParameterList?: Array<{\n type: { ... }\n key: { ... }\n value: { ... }\n }>\n }\n apiKeyConfig?: {\n keyName: string\n keyValue?: string\n keyValueIsEnvVar?: boolean\n }\n}\n```\n\n### `BasicAuthConfig`\n\nTo be sent only if authType is BASIC\n\n```ts\ntype BasicAuthConfig = {\n username: string\n password?: string\n passwordIsEnvVar?: boolean\n}\n```\n\n### `OAuthConfig`\n\nTo be sent only if authType is OAUTH_CLIENT_CREDENTIALS\n\n```ts\ntype OAuthConfig = {\n clientId: string\n clientSecret?: string\n clientSecretIsEnvVar?: boolean\n endpoint: string\n httpMethod: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "OPTIONS" | "HEAD"\n customParameterList?: Array<{\n type: "body" | "query" | "header"\n key: string\n value: string\n }>\n}\n```\n\n### `ApiKeyConfig`\n\nTo be sent only if authType is API_KEY\n\n```ts\ntype ApiKeyConfig = {\n keyName: string\n keyValue?: string\n keyValueIsEnvVar?: boolean\n}\n```\n\n### `WebhookConfig`\n\n```ts\ntype WebhookConfig = {\n id?: string\n name: string\n eventName: string\n url?: string\n creationTime?: string\n updatedTime?: string\n httpMethod?: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "OPTIONS" | "HEAD"\n enabled?: boolean\n auth?: {\n authType: "BASIC" | "OAUTH_CLIENT_CREDENTIALS" | "API_KEY" | "NONE"\n basicAuthConfig?: {\n username: { ... }\n password?: { ... }\n passwordIsEnvVar?: { ... }\n }\n oauthConfig?: {\n clientId: { ... }\n clientSecret?: { ... }\n clientSecretIsEnvVar?: { ... }\n endpoint: { ... }\n httpMethod: { ... }\n customParameterList?: { ... }\n }\n apiKeyConfig?: {\n keyName: { ... }\n keyValue?: { ... }\n keyValueIsEnvVar?: { ... }\n }\n }\n filter?: {\n keyToFilter: string\n supportedValues: string[]\n }\n payloadConfiguration?: {\n hydrate_entity?: boolean\n include_relations?: boolean\n include_activity?: boolean\n include_changed_attributes?: boolean\n apply_changesets?: boolean\n custom_headers?: Record<string, string>\n }\n enableStaticIP?: boolean\n protected?: boolean\n secureProxy?: {\n integration_id: string // uuid\n use_case_slug: string\n }\n status?: "active" | "inactive" | "incomplete"\n jsonataExpression?: string\n deliveryMode?: "json_base64" | "binary_multipart"\n multipartConfig?: {\n fileFieldName?: string\n fileFieldStrategy?: "single" | "multi"\n fileSource?: string\n extraFields?: Record<string, string>\n }\n filterConditions?: {\n conditions?: Array<{\n field: { ... }\n operation: { ... }\n values?: { ... }\n field_type?: { ... }\n is_array_field?: { ... }\n repeatable_item_op?: { ... }\n }>\n logical_operator?: "AND" | "OR"\n }\n _manifest?: string // uuid[]\n signingSecret?: string\n}\n```\n\n### `EventConfigResp`\n\n```ts\ntype EventConfigResp = Array<{\n eventName?: string\n eventLabel?: string\n}>\n```\n\n### `EventConfigEntry`\n\n```ts\ntype EventConfigEntry = {\n eventName?: string\n eventLabel?: string\n}\n```\n\n### `ErrorResp`\n\n```ts\ntype ErrorResp = {\n message?: 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### `PayloadConfiguration`\n\nConfiguration for the webhook payload\n\n```ts\ntype PayloadConfiguration = {\n hydrate_entity?: boolean\n include_relations?: boolean\n include_activity?: boolean\n include_changed_attributes?: boolean\n apply_changesets?: boolean\n custom_headers?: Record<string, string>\n}\n```\n\n### `CustomHeader`\n\nObject representing custom headers as key-value pairs.\n\n```ts\ntype CustomHeader = Record<string, string>\n```\n\n### `CustomOAuthParameter`\n\nCustom key/value pair of either type body, query or header\n\n```ts\ntype CustomOAuthParameter = {\n type: "body" | "query" | "header"\n key: string\n value: string\n}\n```\n\n### `Metadata`\n\nContains the metadata about the configured event\n\n```ts\ntype Metadata = {\n action?: string\n origin?: string\n creation_timestamp?: string\n webhook_id?: string\n webhook_name?: string\n automation_name?: string\n organization_id: string\n user_id?: string\n correlation_id?: string\n execution_id?: string\n action_id?: string\n}\n```\n\n### `ExecutionPayload`\n\nPayload for triggering a webhook\n\n```ts\ntype ExecutionPayload = {\n metadata: {\n action?: string\n origin?: string\n creation_timestamp?: string\n webhook_id?: string\n webhook_name?: string\n automation_name?: string\n organization_id: string\n user_id?: string\n correlation_id?: string\n execution_id?: string\n action_id?: string\n }\n}\n```\n\n### `WebhookEvent`\n\n```ts\ntype WebhookEvent = {\n event_id: string\n org_id: string\n webhook_config_id: string\n url?: string\n created_at?: string\n event_name?: string\n http_response?: {\n status_code?: number\n message?: string\n body?: object\n code?: string\n }\n metadata?: {\n action?: string\n origin?: string\n creation_timestamp?: string\n webhook_id?: string\n webhook_name?: string\n automation_name?: string\n organization_id: string\n user_id?: string\n correlation_id?: string\n execution_id?: string\n action_id?: string\n }\n status?: "succeeded" | "failed" | "in_progress" | "skipped"\n http_method?: "GET" | "POST" | "PUT"\n payload?: string\n}\n```\n\n### `ExampleRequest`\n\n```ts\ntype ExampleRequest = {\n automation_id?: string\n}\n```\n\n### `ExampleResponse`\n\n```ts\ntype ExampleResponse = {\n metadata?: {\n action?: string\n origin?: string\n creation_timestamp?: string\n webhook_id?: string\n webhook_name?: string\n automation_name?: string\n organization_id: string\n user_id?: string\n correlation_id?: string\n execution_id?: string\n action_id?: string\n }\n entity?: Record<string, unknown>\n relations?: Record<string, unknown>[]\n}\n```\n\n### `TestOAuthResponse`\n\n```ts\ntype TestOAuthResponse = {\n success: boolean\n expires_in?: number\n token_type?: string\n message: string\n}\n```\n\n### `BatchReplayRequest`\n\n```ts\ntype BatchReplayRequest = {\n eventIds: string[]\n}\n```\n';
|
|
5
|
-
export {
|
|
6
|
-
webhooks_default as default
|
|
7
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-NJK5F5TF.cjs');
|
|
2
|
-
|
|
3
|
-
// src/docs/webhooks.json
|
|
4
|
-
var webhooks_default = '# Webhooks\n\n- **Base URL:** `https://webhooks.sls.epilot.io`\n- **Full API Docs:** [https://docs.epilot.io/api/webhooks](https://docs.epilot.io/api/webhooks)\n\n## Usage\n\n```ts\nimport { epilot } from \'@epilot/sdk\'\n\nepilot.authorize(() => \'<token>\')\nconst { data } = await epilot.webhooks.getPublicKey(...)\n```\n\n### Tree-shakeable import\n\n```ts\nimport { getClient, authorize } from \'@epilot/sdk/webhooks\'\n\nconst webhooksClient = getClient()\nauthorize(webhooksClient, () => \'<token>\')\nconst { data } = await webhooksClient.getPublicKey(...)\n```\n\n## Operations\n\n**webhooks**\n- [`getPublicKey`](#getpublickey)\n- [`getConfiguredEvents`](#getconfiguredevents)\n- [`getConfigs`](#getconfigs)\n- [`createConfig`](#createconfig)\n- [`getConfig`](#getconfig)\n- [`updateConfig`](#updateconfig)\n- [`deleteConfig`](#deleteconfig)\n- [`testOAuth`](#testoauth)\n- [`triggerWebhook`](#triggerwebhook)\n- [`batchReplayEvents`](#batchreplayevents)\n- [`getEventById`](#geteventbyid)\n- [`replayEvent`](#replayevent)\n- [`getWebhookExample`](#getwebhookexample)\n\n**Events**\n- [`getWebhookEventsV2`](#getwebhookeventsv2)\n\n**Schemas**\n- [`PublicKeyResponse`](#publickeyresponse)\n- [`SearchOptions`](#searchoptions)\n- [`EventListResponse`](#eventlistresponse)\n- [`HttpMethod`](#httpmethod)\n- [`AuthType`](#authtype)\n- [`Filter`](#filter)\n- [`WebhookCondition`](#webhookcondition)\n- [`WebhookConditionGroup`](#webhookconditiongroup)\n- [`Auth`](#auth)\n- [`BasicAuthConfig`](#basicauthconfig)\n- [`OAuthConfig`](#oauthconfig)\n- [`ApiKeyConfig`](#apikeyconfig)\n- [`WebhookConfig`](#webhookconfig)\n- [`EventConfigResp`](#eventconfigresp)\n- [`EventConfigEntry`](#eventconfigentry)\n- [`ErrorResp`](#errorresp)\n- [`TriggerWebhookResp`](#triggerwebhookresp)\n- [`PayloadConfiguration`](#payloadconfiguration)\n- [`CustomHeader`](#customheader)\n- [`CustomOAuthParameter`](#customoauthparameter)\n- [`Metadata`](#metadata)\n- [`ExecutionPayload`](#executionpayload)\n- [`WebhookEvent`](#webhookevent)\n- [`ExampleRequest`](#examplerequest)\n- [`ExampleResponse`](#exampleresponse)\n- [`TestOAuthResponse`](#testoauthresponse)\n- [`BatchReplayRequest`](#batchreplayrequest)\n\n### `getPublicKey`\n\nReturns the platform-level Ed25519 public key used to verify\nasymmetric (v1a) webhook signatures. This endpoint is unauthenticated since the public key is not a secret, but the orgId parameter is requ\n\n`GET /v1/webhooks/.well-known/public-key`\n\n```ts\nconst { data } = await client.getPublicKey({\n orgId: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "public_key": "-----BEGIN PUBLIC KEY-----\\nMCowBQYDK2VwAyEA...\\n-----END PUBLIC KEY-----\\n",\n "algorithm": "ed25519",\n "issuer": "epilot"\n}\n```\n\n</details>\n\n---\n\n### `getConfiguredEvents`\n\nRetrieve events that can trigger webhooks\n\n`GET /v1/webhooks/configured-events`\n\n```ts\nconst { data } = await client.getConfiguredEvents()\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n[\n {\n "eventName": "customer_request_created",\n "eventLabel": "Customer Request Created"\n }\n]\n```\n\n</details>\n\n---\n\n### `getConfigs`\n\nSearch Webhook Client Configs\n\n`GET /v1/webhooks/configs`\n\n```ts\nconst { data } = await client.getConfigs({\n eventName: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n[\n {\n "eventName": "CustomerRequest_Created",\n "url": "https://my-partner-service.api.com",\n "httpMethod": "POST",\n "enabled": true,\n "auth": {\n "authType": "BASIC",\n "basicAuthConfig": {\n "username": "secretUsername",\n "password": "secret7825@!"\n }\n },\n "filter": {\n "keyToFilter": "customer_request.productId",\n "supportedValues": ["2324245", "5253642"]\n }\n }\n]\n```\n\n</details>\n\n---\n\n### `createConfig`\n\nCreate Webhook Client Config\n\n`POST /v1/webhooks/configs`\n\n```ts\nconst { data } = await client.createConfig(\n null,\n {\n eventName: \'CustomerRequest_Created\',\n url: \'https://my-partner-service.api.com\',\n httpMethod: \'POST\',\n enabled: true,\n auth: {\n authType: \'BASIC\',\n basicAuthConfig: {\n username: \'secretUsername\',\n password: \'secret7825@!\'\n }\n },\n filter: {\n keyToFilter: \'customer_request.productId\',\n supportedValues: [\'2324245\', \'5253642\']\n }\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "eventName": "CustomerRequest_Created",\n "url": "https://my-partner-service.api.com",\n "httpMethod": "POST",\n "enabled": true,\n "auth": {\n "authType": "BASIC",\n "basicAuthConfig": {\n "username": "secretUsername",\n "password": "secret7825@!"\n }\n },\n "filter": {\n "keyToFilter": "customer_request.productId",\n "supportedValues": ["2324245", "5253642"]\n }\n}\n```\n\n</details>\n\n---\n\n### `getConfig`\n\nGet webhook config by id\n\n`GET /v1/webhooks/configs/{configId}`\n\n```ts\nconst { data } = await client.getConfig({\n configId: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "eventName": "CustomerRequest_Created",\n "url": "https://my-partner-service.api.com",\n "httpMethod": "POST",\n "enabled": true,\n "auth": {\n "authType": "BASIC",\n "basicAuthConfig": {\n "username": "secretUsername",\n "password": "secret7825@!"\n }\n },\n "filter": {\n "keyToFilter": "customer_request.productId",\n "supportedValues": ["2324245", "5253642"]\n }\n}\n```\n\n</details>\n\n---\n\n### `updateConfig`\n\nUpdate Webhook Client Config\n\n`PUT /v1/webhooks/configs/{configId}`\n\n```ts\nconst { data } = await client.updateConfig(\n {\n configId: \'example\',\n },\n {\n eventName: \'CustomerRequest_Created\',\n url: \'https://my-partner-service.api.com\',\n httpMethod: \'POST\',\n enabled: true,\n auth: {\n authType: \'BASIC\',\n basicAuthConfig: {\n username: \'secretUsername\',\n password: \'secret7825@!\'\n }\n },\n filter: {\n keyToFilter: \'customer_request.productId\',\n supportedValues: [\'2324245\', \'5253642\']\n }\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "eventName": "CustomerRequest_Created",\n "url": "https://my-partner-service.api.com",\n "httpMethod": "POST",\n "enabled": true,\n "auth": {\n "authType": "BASIC",\n "basicAuthConfig": {\n "username": "secretUsername",\n "password": "secret7825@!"\n }\n },\n "filter": {\n "keyToFilter": "customer_request.productId",\n "supportedValues": ["2324245", "5253642"]\n }\n}\n```\n\n</details>\n\n---\n\n### `deleteConfig`\n\nDelete Webhook Client Config\n\n`DELETE /v1/webhooks/configs/{configId}`\n\n```ts\nconst { data } = await client.deleteConfig({\n configId: \'example\',\n})\n```\n\n---\n\n### `testOAuth`\n\nTest OAuth connection\n\n`POST /v1/webhooks/configs/{configId}/test-oauth`\n\n```ts\nconst { data } = await client.testOAuth({\n configId: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "success": true,\n "expires_in": 3600,\n "token_type": "Bearer",\n "message": "OAuth token exchange successful"\n}\n```\n\n</details>\n\n---\n\n### `triggerWebhook`\n\ntriggers a webhook event either async or sync\n\n`POST /v1/webhooks/configs/{configId}/trigger`\n\n```ts\nconst { data } = await client.triggerWebhook(\n {\n sync: true,\n configId: \'example\',\n },\n {\n metadata: {\n action: \'Manual triggered by user with id 123456\',\n origin: \'string\',\n creation_timestamp: \'string\',\n webhook_id: \'string\',\n webhook_name: \'string\',\n automation_name: \'string\',\n organization_id: \'string\',\n user_id: \'string\',\n correlation_id: \'string\',\n execution_id: \'string\',\n action_id: \'string\'\n }\n },\n)\n```\n\n<details>\n<summary>Response</summary>\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</details>\n\n---\n\n### `batchReplayEvents`\n\nReplay a batch of webhook events\n\n`POST /v1/webhooks/configs/{configId}/events/replay-batch`\n\n```ts\nconst { data } = await client.batchReplayEvents(\n {\n configId: \'example\',\n },\n {\n eventIds: [\'2f1b7cf8-ff55-4359-966f-e56f39a52c94\', \'48c984bf-466b-470b-b743-d07cea168243\']\n },\n)\n```\n\n---\n\n### `getEventById`\n\nGet a webhook event by its id\n\n`GET /v1/webhooks/configs/{configId}/events/{eventId}`\n\n```ts\nconst { data } = await client.getEventById({\n configId: \'example\',\n eventId: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "event_id": "string",\n "org_id": "string",\n "webhook_config_id": "string",\n "url": "string",\n "created_at": "2021-04-27T12:01:13.000Z",\n "event_name": "string",\n "http_response": {\n "status_code": 0,\n "message": "string",\n "body": {},\n "code": "string"\n },\n "metadata": {\n "action": "Manual triggered by user with id 123456",\n "origin": "string",\n "creation_timestamp": "string",\n "webhook_id": "string",\n "webhook_name": "string",\n "automation_name": "string",\n "organization_id": "string",\n "user_id": "string",\n "correlation_id": "string",\n "execution_id": "string",\n "action_id": "string"\n },\n "status": "succeeded",\n "http_method": "GET",\n "payload": "string"\n}\n```\n\n</details>\n\n---\n\n### `replayEvent`\n\nReplay a webhook event\n\n`POST /v1/webhooks/configs/{configId}/events/{eventId}/replay`\n\n```ts\nconst { data } = await client.replayEvent({\n configId: \'example\',\n eventId: \'example\',\n})\n```\n\n---\n\n### `getWebhookExample`\n\nGenerate an example payload for a webhook configuration based on trigger type\n\n`POST /v1/webhooks/configs/{configId}/example`\n\n```ts\nconst { data } = await client.getWebhookExample(\n {\n configId: \'example\',\n },\n {\n automation_id: \'automation_123\'\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "metadata": {\n "action": "Manual triggered by user with id 123456",\n "origin": "string",\n "creation_timestamp": "string",\n "webhook_id": "string",\n "webhook_name": "string",\n "automation_name": "string",\n "organization_id": "string",\n "user_id": "string",\n "correlation_id": "string",\n "execution_id": "string",\n "action_id": "string"\n },\n "entity": {},\n "relations": [\n {}\n ]\n}\n```\n\n</details>\n\n---\n\n### `getWebhookEventsV2`\n\nList webhook events and filter them by status, timestamp, etc.\n\n`POST /v2/webhooks/configs/{configId}/events`\n\n```ts\nconst { data } = await client.getWebhookEventsV2(\n {\n configId: \'example\',\n },\n {\n limit: 25,\n cursor: {\n created_at: \'2025-10-31T12:34:56Z\',\n event_id: \'evt_1234567890abcdef\'\n },\n timestamp: {\n from: \'2025-10-01T00:00:00Z\',\n to: \'2025-10-31T23:59:59Z\'\n },\n event_id: \'evt_1234567890abcdef\',\n status: \'succeeded\'\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "data": [\n {\n "event_id": "string",\n "org_id": "string",\n "webhook_config_id": "string",\n "url": "string",\n "created_at": "2021-04-27T12:01:13.000Z",\n "event_name": "string",\n "http_response": {\n "status_code": 0,\n "message": "string",\n "body": {},\n "code": "string"\n },\n "metadata": {\n "action": "Manual triggered by user with id 123456",\n "origin": "string",\n "creation_timestamp": "string",\n "webhook_id": "string",\n "webhook_name": "string",\n "automation_name": "string",\n "organization_id": "string",\n "user_id": "string",\n "correlation_id": "string",\n "execution_id": "string",\n "action_id": "string"\n },\n "status": "succeeded",\n "http_method": "GET",\n "payload": "string"\n }\n ],\n "next_cursor": {\n "created_at": "2025-10-31T12:34:56Z",\n "event_id": "evt_1234567890abcdef"\n },\n "has_more": true\n}\n```\n\n</details>\n\n---\n\n## Schemas\n\n### `PublicKeyResponse`\n\n```ts\ntype PublicKeyResponse = {\n public_key: string\n algorithm: string\n issuer?: string\n}\n```\n\n### `SearchOptions`\n\n```ts\ntype SearchOptions = {\n limit?: number\n cursor?: {\n created_at?: string // date-time\n event_id?: string\n }\n timestamp?: {\n from?: string // date-time\n to?: string // date-time\n }\n event_id?: string\n status?: "succeeded" | "failed" | "skipped"\n}\n```\n\n### `EventListResponse`\n\n```ts\ntype EventListResponse = {\n data?: Array<{\n event_id: string\n org_id: string\n webhook_config_id: string\n url?: string\n created_at?: string\n event_name?: string\n http_response?: {\n status_code?: { ... }\n message?: { ... }\n body?: { ... }\n code?: { ... }\n }\n metadata?: {\n action?: { ... }\n origin?: { ... }\n creation_timestamp?: { ... }\n webhook_id?: { ... }\n webhook_name?: { ... }\n automation_name?: { ... }\n organization_id: { ... }\n user_id?: { ... }\n correlation_id?: { ... }\n execution_id?: { ... }\n action_id?: { ... }\n }\n status?: "succeeded" | "failed" | "in_progress" | "skipped"\n http_method?: "GET" | "POST" | "PUT"\n payload?: string\n }>\n next_cursor?: {\n created_at?: string // date-time\n event_id?: string\n }\n has_more?: boolean\n}\n```\n\n### `HttpMethod`\n\n```ts\ntype HttpMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "OPTIONS" | "HEAD"\n```\n\n### `AuthType`\n\n```ts\ntype AuthType = "BASIC" | "OAUTH_CLIENT_CREDENTIALS" | "API_KEY" | "NONE"\n```\n\n### `Filter`\n\n```ts\ntype Filter = {\n keyToFilter: string\n supportedValues: string[]\n}\n```\n\n### `WebhookCondition`\n\nA condition that must be met for the webhook to fire.\n\n```ts\ntype WebhookCondition = {\n field: string\n operation: "equals" | "not_equals" | "any_of" | "none_of" | "contains" | "not_contains" | "starts_with" | "ends_with" | "greater_than" | "less_than" | "greater_than_or_equals" | "less_than_or_equals" | "is_empty" | "is_not_empty"\n values?: string[]\n field_type?: "string" | "number" | "boolean" | "date" | "datetime"\n is_array_field?: boolean\n repeatable_item_op?: boolean\n}\n```\n\n### `WebhookConditionGroup`\n\nA group of conditions with a logical operator. Multiple conditions are AND-ed by default.\n\n```ts\ntype WebhookConditionGroup = {\n conditions?: Array<{\n field: string\n operation: "equals" | "not_equals" | "any_of" | "none_of" | "contains" | "not_contains" | "starts_with" | "ends_with" | "greater_than" | "less_than" | "greater_than_or_equals" | "less_than_or_equals" | "is_empty" | "is_not_empty"\n values?: string[]\n field_type?: "string" | "number" | "boolean" | "date" | "datetime"\n is_array_field?: boolean\n repeatable_item_op?: boolean\n }>\n logical_operator?: "AND" | "OR"\n}\n```\n\n### `Auth`\n\n```ts\ntype Auth = {\n authType: "BASIC" | "OAUTH_CLIENT_CREDENTIALS" | "API_KEY" | "NONE"\n basicAuthConfig?: {\n username: string\n password?: string\n passwordIsEnvVar?: boolean\n }\n oauthConfig?: {\n clientId: string\n clientSecret?: string\n clientSecretIsEnvVar?: boolean\n endpoint: string\n httpMethod: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "OPTIONS" | "HEAD"\n customParameterList?: Array<{\n type: { ... }\n key: { ... }\n value: { ... }\n }>\n }\n apiKeyConfig?: {\n keyName: string\n keyValue?: string\n keyValueIsEnvVar?: boolean\n }\n}\n```\n\n### `BasicAuthConfig`\n\nTo be sent only if authType is BASIC\n\n```ts\ntype BasicAuthConfig = {\n username: string\n password?: string\n passwordIsEnvVar?: boolean\n}\n```\n\n### `OAuthConfig`\n\nTo be sent only if authType is OAUTH_CLIENT_CREDENTIALS\n\n```ts\ntype OAuthConfig = {\n clientId: string\n clientSecret?: string\n clientSecretIsEnvVar?: boolean\n endpoint: string\n httpMethod: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "OPTIONS" | "HEAD"\n customParameterList?: Array<{\n type: "body" | "query" | "header"\n key: string\n value: string\n }>\n}\n```\n\n### `ApiKeyConfig`\n\nTo be sent only if authType is API_KEY\n\n```ts\ntype ApiKeyConfig = {\n keyName: string\n keyValue?: string\n keyValueIsEnvVar?: boolean\n}\n```\n\n### `WebhookConfig`\n\n```ts\ntype WebhookConfig = {\n id?: string\n name: string\n eventName: string\n url?: string\n creationTime?: string\n updatedTime?: string\n httpMethod?: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "OPTIONS" | "HEAD"\n enabled?: boolean\n auth?: {\n authType: "BASIC" | "OAUTH_CLIENT_CREDENTIALS" | "API_KEY" | "NONE"\n basicAuthConfig?: {\n username: { ... }\n password?: { ... }\n passwordIsEnvVar?: { ... }\n }\n oauthConfig?: {\n clientId: { ... }\n clientSecret?: { ... }\n clientSecretIsEnvVar?: { ... }\n endpoint: { ... }\n httpMethod: { ... }\n customParameterList?: { ... }\n }\n apiKeyConfig?: {\n keyName: { ... }\n keyValue?: { ... }\n keyValueIsEnvVar?: { ... }\n }\n }\n filter?: {\n keyToFilter: string\n supportedValues: string[]\n }\n payloadConfiguration?: {\n hydrate_entity?: boolean\n include_relations?: boolean\n include_activity?: boolean\n include_changed_attributes?: boolean\n apply_changesets?: boolean\n custom_headers?: Record<string, string>\n }\n enableStaticIP?: boolean\n protected?: boolean\n secureProxy?: {\n integration_id: string // uuid\n use_case_slug: string\n }\n status?: "active" | "inactive" | "incomplete"\n jsonataExpression?: string\n deliveryMode?: "json_base64" | "binary_multipart"\n multipartConfig?: {\n fileFieldName?: string\n fileFieldStrategy?: "single" | "multi"\n fileSource?: string\n extraFields?: Record<string, string>\n }\n filterConditions?: {\n conditions?: Array<{\n field: { ... }\n operation: { ... }\n values?: { ... }\n field_type?: { ... }\n is_array_field?: { ... }\n repeatable_item_op?: { ... }\n }>\n logical_operator?: "AND" | "OR"\n }\n _manifest?: string // uuid[]\n signingSecret?: string\n}\n```\n\n### `EventConfigResp`\n\n```ts\ntype EventConfigResp = Array<{\n eventName?: string\n eventLabel?: string\n}>\n```\n\n### `EventConfigEntry`\n\n```ts\ntype EventConfigEntry = {\n eventName?: string\n eventLabel?: string\n}\n```\n\n### `ErrorResp`\n\n```ts\ntype ErrorResp = {\n message?: 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### `PayloadConfiguration`\n\nConfiguration for the webhook payload\n\n```ts\ntype PayloadConfiguration = {\n hydrate_entity?: boolean\n include_relations?: boolean\n include_activity?: boolean\n include_changed_attributes?: boolean\n apply_changesets?: boolean\n custom_headers?: Record<string, string>\n}\n```\n\n### `CustomHeader`\n\nObject representing custom headers as key-value pairs.\n\n```ts\ntype CustomHeader = Record<string, string>\n```\n\n### `CustomOAuthParameter`\n\nCustom key/value pair of either type body, query or header\n\n```ts\ntype CustomOAuthParameter = {\n type: "body" | "query" | "header"\n key: string\n value: string\n}\n```\n\n### `Metadata`\n\nContains the metadata about the configured event\n\n```ts\ntype Metadata = {\n action?: string\n origin?: string\n creation_timestamp?: string\n webhook_id?: string\n webhook_name?: string\n automation_name?: string\n organization_id: string\n user_id?: string\n correlation_id?: string\n execution_id?: string\n action_id?: string\n}\n```\n\n### `ExecutionPayload`\n\nPayload for triggering a webhook\n\n```ts\ntype ExecutionPayload = {\n metadata: {\n action?: string\n origin?: string\n creation_timestamp?: string\n webhook_id?: string\n webhook_name?: string\n automation_name?: string\n organization_id: string\n user_id?: string\n correlation_id?: string\n execution_id?: string\n action_id?: string\n }\n}\n```\n\n### `WebhookEvent`\n\n```ts\ntype WebhookEvent = {\n event_id: string\n org_id: string\n webhook_config_id: string\n url?: string\n created_at?: string\n event_name?: string\n http_response?: {\n status_code?: number\n message?: string\n body?: object\n code?: string\n }\n metadata?: {\n action?: string\n origin?: string\n creation_timestamp?: string\n webhook_id?: string\n webhook_name?: string\n automation_name?: string\n organization_id: string\n user_id?: string\n correlation_id?: string\n execution_id?: string\n action_id?: string\n }\n status?: "succeeded" | "failed" | "in_progress" | "skipped"\n http_method?: "GET" | "POST" | "PUT"\n payload?: string\n}\n```\n\n### `ExampleRequest`\n\n```ts\ntype ExampleRequest = {\n automation_id?: string\n}\n```\n\n### `ExampleResponse`\n\n```ts\ntype ExampleResponse = {\n metadata?: {\n action?: string\n origin?: string\n creation_timestamp?: string\n webhook_id?: string\n webhook_name?: string\n automation_name?: string\n organization_id: string\n user_id?: string\n correlation_id?: string\n execution_id?: string\n action_id?: string\n }\n entity?: Record<string, unknown>\n relations?: Record<string, unknown>[]\n}\n```\n\n### `TestOAuthResponse`\n\n```ts\ntype TestOAuthResponse = {\n success: boolean\n expires_in?: number\n token_type?: string\n message: string\n}\n```\n\n### `BatchReplayRequest`\n\n```ts\ntype BatchReplayRequest = {\n eventIds: string[]\n}\n```\n';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
exports.default = webhooks_default;
|