@gpt-platform/admin 0.9.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -32,6 +32,7 @@ __export(index_exports, {
32
32
  ServerError: () => ServerError,
33
33
  TimeoutError: () => TimeoutError,
34
34
  ValidationError: () => ValidationError,
35
+ createChannelsNamespace: () => createChannelsNamespace,
35
36
  createImportsNamespace: () => createImportsNamespace,
36
37
  default: () => index_default,
37
38
  handleApiError: () => handleApiError
@@ -854,8 +855,8 @@ var createClient = (config = {}) => {
854
855
  };
855
856
 
856
857
  // src/version.ts
857
- var SDK_VERSION = "0.9.0";
858
- var DEFAULT_API_VERSION = "2026-03-21";
858
+ var SDK_VERSION = "0.10.0";
859
+ var DEFAULT_API_VERSION = "2026-03-23";
859
860
 
860
861
  // src/base-client.ts
861
862
  function isSecureUrl(url) {
@@ -1003,7 +1004,7 @@ var ServerError = class extends GptCoreError {
1003
1004
  function handleApiError(error) {
1004
1005
  const err = error;
1005
1006
  const response = err?.response || err;
1006
- const statusCode = response?.status || err?.status || err?.statusCode;
1007
+ let statusCode = response?.status || err?.status || err?.statusCode;
1007
1008
  const headers = response?.headers || err?.headers;
1008
1009
  const requestId = headers?.get?.("x-request-id") || headers?.["x-request-id"];
1009
1010
  const body = response?.body || response?.data || err?.body || err?.data || err;
@@ -1017,6 +1018,13 @@ function handleApiError(error) {
1017
1018
  field: e.source?.pointer?.split("/").pop(),
1018
1019
  message: e.detail || e.title || "Unknown error"
1019
1020
  }));
1021
+ if (!statusCode && firstError?.status) {
1022
+ const parsed = parseInt(firstError.status, 10);
1023
+ if (!isNaN(parsed)) statusCode = parsed;
1024
+ }
1025
+ } else if (bodyObj?.errors && typeof bodyObj.errors === "object" && !Array.isArray(bodyObj.errors)) {
1026
+ const errObj = bodyObj.errors;
1027
+ message = errObj.detail || errObj.title || message;
1020
1028
  } else if (bodyObj?.message) {
1021
1029
  message = bodyObj.message;
1022
1030
  } else if (typeof body === "string") {
@@ -1198,15 +1206,18 @@ var RequestBuilder = class {
1198
1206
  async execute(fn, params, options) {
1199
1207
  const headers = buildHeaders(this.getHeaders, options);
1200
1208
  try {
1201
- const { data } = await this.requestWithRetry(
1209
+ const result = await this.requestWithRetry(
1202
1210
  () => fn({
1203
1211
  client: this.clientInstance,
1204
- throwOnError: true,
1205
1212
  headers,
1206
1213
  ...params,
1207
1214
  ...options?.signal && { signal: options.signal }
1208
1215
  })
1209
1216
  );
1217
+ const { data, error } = result;
1218
+ if (error) {
1219
+ throw enrichError(error, result);
1220
+ }
1210
1221
  return this.unwrap(data?.data);
1211
1222
  } catch (error) {
1212
1223
  throw handleApiError(error);
@@ -1218,15 +1229,18 @@ var RequestBuilder = class {
1218
1229
  async executeDelete(fn, params, options) {
1219
1230
  const headers = buildHeaders(this.getHeaders, options);
1220
1231
  try {
1221
- await this.requestWithRetry(
1232
+ const result = await this.requestWithRetry(
1222
1233
  () => fn({
1223
1234
  client: this.clientInstance,
1224
- throwOnError: true,
1225
1235
  headers,
1226
1236
  ...params,
1227
1237
  ...options?.signal && { signal: options.signal }
1228
1238
  })
1229
1239
  );
1240
+ const { error } = result;
1241
+ if (error) {
1242
+ throw enrichError(error, result);
1243
+ }
1230
1244
  return true;
1231
1245
  } catch (error) {
1232
1246
  throw handleApiError(error);
@@ -1483,6 +1497,11 @@ var client = createClient(
1483
1497
  );
1484
1498
 
1485
1499
  // src/_internal/sdk.gen.ts
1500
+ var getAdminEmailTemplateVersionsTemplateByTemplateId = (options) => (options.client ?? client).get({
1501
+ security: [{ scheme: "bearer", type: "http" }],
1502
+ url: "/admin/email/template-versions/template/{template_id}",
1503
+ ...options
1504
+ });
1486
1505
  var getAdminWorkspaces = (options) => (options.client ?? client).get({
1487
1506
  security: [{ scheme: "bearer", type: "http" }],
1488
1507
  url: "/admin/workspaces",
@@ -1497,6 +1516,16 @@ var postAdminWorkspaces = (options) => (options.client ?? client).post({
1497
1516
  ...options.headers
1498
1517
  }
1499
1518
  });
1519
+ var deleteAdminVoiceTranscriptionJobsById = (options) => (options.client ?? client).delete({
1520
+ security: [{ scheme: "bearer", type: "http" }],
1521
+ url: "/admin/voice/transcription-jobs/{id}",
1522
+ ...options
1523
+ });
1524
+ var getAdminVoiceTranscriptionJobsById = (options) => (options.client ?? client).get({
1525
+ security: [{ scheme: "bearer", type: "http" }],
1526
+ url: "/admin/voice/transcription-jobs/{id}",
1527
+ ...options
1528
+ });
1500
1529
  var getAdminWallet = (options) => (options.client ?? client).get({
1501
1530
  security: [{ scheme: "bearer", type: "http" }],
1502
1531
  url: "/admin/wallet",
@@ -1662,6 +1691,20 @@ var getAdminSocialMetricsCampaignBySocialCampaignId = (options) => (options.clie
1662
1691
  url: "/admin/social/metrics/campaign/{social_campaign_id}",
1663
1692
  ...options
1664
1693
  });
1694
+ var getAdminVoiceTranscriptionJobs = (options) => (options.client ?? client).get({
1695
+ security: [{ scheme: "bearer", type: "http" }],
1696
+ url: "/admin/voice/transcription-jobs",
1697
+ ...options
1698
+ });
1699
+ var postAdminVoiceTranscriptionJobs = (options) => (options.client ?? client).post({
1700
+ security: [{ scheme: "bearer", type: "http" }],
1701
+ url: "/admin/voice/transcription-jobs",
1702
+ ...options,
1703
+ headers: {
1704
+ "Content-Type": "application/vnd.api+json",
1705
+ ...options.headers
1706
+ }
1707
+ });
1665
1708
  var getAdminFieldTemplates = (options) => (options.client ?? client).get({
1666
1709
  security: [{ scheme: "bearer", type: "http" }],
1667
1710
  url: "/admin/field-templates",
@@ -1690,6 +1733,25 @@ var postAdminConnectors = (options) => (options.client ?? client).post({
1690
1733
  ...options.headers
1691
1734
  }
1692
1735
  });
1736
+ var deleteAdminCampaignsSequencesById = (options) => (options.client ?? client).delete({
1737
+ security: [{ scheme: "bearer", type: "http" }],
1738
+ url: "/admin/campaigns/sequences/{id}",
1739
+ ...options
1740
+ });
1741
+ var getAdminCampaignsSequencesById = (options) => (options.client ?? client).get({
1742
+ security: [{ scheme: "bearer", type: "http" }],
1743
+ url: "/admin/campaigns/sequences/{id}",
1744
+ ...options
1745
+ });
1746
+ var patchAdminCampaignsSequencesById = (options) => (options.client ?? client).patch({
1747
+ security: [{ scheme: "bearer", type: "http" }],
1748
+ url: "/admin/campaigns/sequences/{id}",
1749
+ ...options,
1750
+ headers: {
1751
+ "Content-Type": "application/vnd.api+json",
1752
+ ...options.headers
1753
+ }
1754
+ });
1693
1755
  var deleteAdminCrmRelationshipTypesById = (options) => (options.client ?? client).delete({
1694
1756
  security: [{ scheme: "bearer", type: "http" }],
1695
1757
  url: "/admin/crm/relationship-types/{id}",
@@ -1822,6 +1884,15 @@ var getAdminCrmRelationshipsById = (options) => (options.client ?? client).get({
1822
1884
  url: "/admin/crm/relationships/{id}",
1823
1885
  ...options
1824
1886
  });
1887
+ var postAdminEmailMarketingCampaignsByIdCreateFollowup = (options) => (options.client ?? client).post({
1888
+ security: [{ scheme: "bearer", type: "http" }],
1889
+ url: "/admin/email-marketing/campaigns/{id}/create-followup",
1890
+ ...options,
1891
+ headers: {
1892
+ "Content-Type": "application/vnd.api+json",
1893
+ ...options.headers
1894
+ }
1895
+ });
1825
1896
  var getAdminExtractionResultsDocumentByDocumentIdHistory = (options) => (options.client ?? client).get({
1826
1897
  security: [{ scheme: "bearer", type: "http" }],
1827
1898
  url: "/admin/extraction/results/document/{document_id}/history",
@@ -1882,6 +1953,15 @@ var postAdminClinicalPracticeResources = (options) => (options.client ?? client)
1882
1953
  ...options.headers
1883
1954
  }
1884
1955
  });
1956
+ var patchAdminCampaignsSequencesByIdActivate = (options) => (options.client ?? client).patch({
1957
+ security: [{ scheme: "bearer", type: "http" }],
1958
+ url: "/admin/campaigns/sequences/{id}/activate",
1959
+ ...options,
1960
+ headers: {
1961
+ "Content-Type": "application/vnd.api+json",
1962
+ ...options.headers
1963
+ }
1964
+ });
1885
1965
  var getAdminLlmAnalyticsSummary = (options) => (options.client ?? client).get({
1886
1966
  security: [{ scheme: "bearer", type: "http" }],
1887
1967
  url: "/admin/llm-analytics/summary",
@@ -1915,6 +1995,15 @@ var postAdminClinicalClientGoals = (options) => (options.client ?? client).post(
1915
1995
  ...options.headers
1916
1996
  }
1917
1997
  });
1998
+ var patchAdminCampaignsSequencesByIdResume = (options) => (options.client ?? client).patch({
1999
+ security: [{ scheme: "bearer", type: "http" }],
2000
+ url: "/admin/campaigns/sequences/{id}/resume",
2001
+ ...options,
2002
+ headers: {
2003
+ "Content-Type": "application/vnd.api+json",
2004
+ ...options.headers
2005
+ }
2006
+ });
1918
2007
  var patchAdminTenantsByIdAutoTopUp = (options) => (options.client ?? client).patch({
1919
2008
  security: [{ scheme: "bearer", type: "http" }],
1920
2009
  url: "/admin/tenants/{id}/auto-top-up",
@@ -1985,6 +2074,15 @@ var postAdminSchedulingCalendarSyncs = (options) => (options.client ?? client).p
1985
2074
  ...options.headers
1986
2075
  }
1987
2076
  });
2077
+ var postAdminEmailMarketingCampaignsByIdAnalyze = (options) => (options.client ?? client).post({
2078
+ security: [{ scheme: "bearer", type: "http" }],
2079
+ url: "/admin/email-marketing/campaigns/{id}/analyze",
2080
+ ...options,
2081
+ headers: {
2082
+ "Content-Type": "application/vnd.api+json",
2083
+ ...options.headers
2084
+ }
2085
+ });
1988
2086
  var postAdminCrmCustomEntities = (options) => (options.client ?? client).post({
1989
2087
  security: [{ scheme: "bearer", type: "http" }],
1990
2088
  url: "/admin/crm/custom-entities",
@@ -2046,6 +2144,24 @@ var patchAdminIsvCrmEntityTypesById = (options) => (options.client ?? client).pa
2046
2144
  ...options.headers
2047
2145
  }
2048
2146
  });
2147
+ var postAdminCampaignsSequenceSteps = (options) => (options.client ?? client).post({
2148
+ security: [{ scheme: "bearer", type: "http" }],
2149
+ url: "/admin/campaigns/sequence-steps",
2150
+ ...options,
2151
+ headers: {
2152
+ "Content-Type": "application/vnd.api+json",
2153
+ ...options.headers
2154
+ }
2155
+ });
2156
+ var patchAdminEmailMarketingGeneratedEmailsByIdReject = (options) => (options.client ?? client).patch({
2157
+ security: [{ scheme: "bearer", type: "http" }],
2158
+ url: "/admin/email-marketing/generated-emails/{id}/reject",
2159
+ ...options,
2160
+ headers: {
2161
+ "Content-Type": "application/vnd.api+json",
2162
+ ...options.headers
2163
+ }
2164
+ });
2049
2165
  var getAdminCrmPipelineStagesPipelineByPipelineId = (options) => (options.client ?? client).get({
2050
2166
  security: [{ scheme: "bearer", type: "http" }],
2051
2167
  url: "/admin/crm/pipeline-stages/pipeline/{pipeline_id}",
@@ -2079,6 +2195,15 @@ var postAdminTenantPricingOverrides = (options) => (options.client ?? client).po
2079
2195
  ...options.headers
2080
2196
  }
2081
2197
  });
2198
+ var patchAdminEmailMarketingTemplatesByIdUnpublish = (options) => (options.client ?? client).patch({
2199
+ security: [{ scheme: "bearer", type: "http" }],
2200
+ url: "/admin/email-marketing/templates/{id}/unpublish",
2201
+ ...options,
2202
+ headers: {
2203
+ "Content-Type": "application/vnd.api+json",
2204
+ ...options.headers
2205
+ }
2206
+ });
2082
2207
  var postAdminWebhookConfigsByIdReplay = (options) => (options.client ?? client).post({
2083
2208
  security: [{ scheme: "bearer", type: "http" }],
2084
2209
  url: "/admin/webhook-configs/{id}/replay",
@@ -2158,6 +2283,15 @@ var getAdminAgentVersionsByIdRevisions = (options) => (options.client ?? client)
2158
2283
  url: "/admin/agent-versions/{id}/revisions",
2159
2284
  ...options
2160
2285
  });
2286
+ var patchAdminEmailMarketingTemplatesByIdArchive = (options) => (options.client ?? client).patch({
2287
+ security: [{ scheme: "bearer", type: "http" }],
2288
+ url: "/admin/email-marketing/templates/{id}/archive",
2289
+ ...options,
2290
+ headers: {
2291
+ "Content-Type": "application/vnd.api+json",
2292
+ ...options.headers
2293
+ }
2294
+ });
2161
2295
  var patchAdminSchedulingEventsByIdReschedule = (options) => (options.client ?? client).patch({
2162
2296
  security: [{ scheme: "bearer", type: "http" }],
2163
2297
  url: "/admin/scheduling/events/{id}/reschedule",
@@ -2457,6 +2591,11 @@ var postAdminClinicalGoalTemplatesCatalog = (options) => (options.client ?? clie
2457
2591
  ...options.headers
2458
2592
  }
2459
2593
  });
2594
+ var getAdminCampaignsSequencesWorkspaceByWorkspaceId = (options) => (options.client ?? client).get({
2595
+ security: [{ scheme: "bearer", type: "http" }],
2596
+ url: "/admin/campaigns/sequences/workspace/{workspace_id}",
2597
+ ...options
2598
+ });
2460
2599
  var getAdminSchedulingEventsById = (options) => (options.client ?? client).get({
2461
2600
  security: [{ scheme: "bearer", type: "http" }],
2462
2601
  url: "/admin/scheduling/events/{id}",
@@ -2580,6 +2719,15 @@ var getAdminEmailMarketingCampaignsById = (options) => (options.client ?? client
2580
2719
  url: "/admin/email-marketing/campaigns/{id}",
2581
2720
  ...options
2582
2721
  });
2722
+ var patchAdminEmailMarketingCampaignsById = (options) => (options.client ?? client).patch({
2723
+ security: [{ scheme: "bearer", type: "http" }],
2724
+ url: "/admin/email-marketing/campaigns/{id}",
2725
+ ...options,
2726
+ headers: {
2727
+ "Content-Type": "application/vnd.api+json",
2728
+ ...options.headers
2729
+ }
2730
+ });
2583
2731
  var getAdminSupportSlaPoliciesApplicationByApplicationId = (options) => (options.client ?? client).get({
2584
2732
  security: [{ scheme: "bearer", type: "http" }],
2585
2733
  url: "/admin/support/sla-policies/application/{application_id}",
@@ -2796,6 +2944,15 @@ var getAdminThreadsByIdMessages = (options) => (options.client ?? client).get({
2796
2944
  url: "/admin/threads/{id}/messages",
2797
2945
  ...options
2798
2946
  });
2947
+ var postAdminThreadsByIdMessages = (options) => (options.client ?? client).post({
2948
+ security: [{ scheme: "bearer", type: "http" }],
2949
+ url: "/admin/threads/{id}/messages",
2950
+ ...options,
2951
+ headers: {
2952
+ "Content-Type": "application/vnd.api+json",
2953
+ ...options.headers
2954
+ }
2955
+ });
2799
2956
  var getAdminSocialTrendingHistoryRange = (options) => (options.client ?? client).get({
2800
2957
  security: [{ scheme: "bearer", type: "http" }],
2801
2958
  url: "/admin/social/trending/history/range",
@@ -3031,6 +3188,15 @@ var patchAdminClinicalPracticeToolsCatalogByIdRestore = (options) => (options.cl
3031
3188
  ...options.headers
3032
3189
  }
3033
3190
  });
3191
+ var patchAdminCampaignsSequencesByIdPause = (options) => (options.client ?? client).patch({
3192
+ security: [{ scheme: "bearer", type: "http" }],
3193
+ url: "/admin/campaigns/sequences/{id}/pause",
3194
+ ...options,
3195
+ headers: {
3196
+ "Content-Type": "application/vnd.api+json",
3197
+ ...options.headers
3198
+ }
3199
+ });
3034
3200
  var getAdminVoiceSessions = (options) => (options.client ?? client).get({
3035
3201
  security: [{ scheme: "bearer", type: "http" }],
3036
3202
  url: "/admin/voice/sessions",
@@ -3045,6 +3211,15 @@ var patchAdminClinicalNotesByIdArchive = (options) => (options.client ?? client)
3045
3211
  ...options.headers
3046
3212
  }
3047
3213
  });
3214
+ var postAdminEmailMarketingCampaignsByIdOptimizeSubjects = (options) => (options.client ?? client).post({
3215
+ security: [{ scheme: "bearer", type: "http" }],
3216
+ url: "/admin/email-marketing/campaigns/{id}/optimize-subjects",
3217
+ ...options,
3218
+ headers: {
3219
+ "Content-Type": "application/vnd.api+json",
3220
+ ...options.headers
3221
+ }
3222
+ });
3048
3223
  var getAdminCrmActivitiesWorkspaceByWorkspaceId = (options) => (options.client ?? client).get({
3049
3224
  security: [{ scheme: "bearer", type: "http" }],
3050
3225
  url: "/admin/crm/activities/workspace/{workspace_id}",
@@ -3199,6 +3374,11 @@ var postAdminConnectorsOauthAppConfigs = (options) => (options.client ?? client)
3199
3374
  ...options.headers
3200
3375
  }
3201
3376
  });
3377
+ var getAdminCampaignsSequenceStepsSequenceBySequenceId = (options) => (options.client ?? client).get({
3378
+ security: [{ scheme: "bearer", type: "http" }],
3379
+ url: "/admin/campaigns/sequence-steps/sequence/{sequence_id}",
3380
+ ...options
3381
+ });
3202
3382
  var deleteAdminClinicalPracticeResourcesByIdPermanent = (options) => (options.client ?? client).delete({
3203
3383
  security: [{ scheme: "bearer", type: "http" }],
3204
3384
  url: "/admin/clinical/practice-resources/{id}/permanent",
@@ -3336,6 +3516,11 @@ var postAdminConnectorsOauthInitiate = (options) => (options.client ?? client).p
3336
3516
  ...options.headers
3337
3517
  }
3338
3518
  });
3519
+ var getAdminCampaignsRecipientsById = (options) => (options.client ?? client).get({
3520
+ security: [{ scheme: "bearer", type: "http" }],
3521
+ url: "/admin/campaigns/recipients/{id}",
3522
+ ...options
3523
+ });
3339
3524
  var getAdminVoiceSessionsById = (options) => (options.client ?? client).get({
3340
3525
  security: [{ scheme: "bearer", type: "http" }],
3341
3526
  url: "/admin/voice/sessions/{id}",
@@ -3567,6 +3752,15 @@ var patchAdminCrawlerJobsByIdCancel = (options) => (options.client ?? client).pa
3567
3752
  ...options.headers
3568
3753
  }
3569
3754
  });
3755
+ var patchAdminCampaignsSequencesByIdComplete = (options) => (options.client ?? client).patch({
3756
+ security: [{ scheme: "bearer", type: "http" }],
3757
+ url: "/admin/campaigns/sequences/{id}/complete",
3758
+ ...options,
3759
+ headers: {
3760
+ "Content-Type": "application/vnd.api+json",
3761
+ ...options.headers
3762
+ }
3763
+ });
3570
3764
  var getAdminExtractionResultsDocumentByDocumentIdPartial = (options) => (options.client ?? client).get({
3571
3765
  security: [{ scheme: "bearer", type: "http" }],
3572
3766
  url: "/admin/extraction/results/document/{document_id}/partial",
@@ -3620,6 +3814,11 @@ var getAdminClinicalGoalTemplatesCategoriesCatalog = (options) => (options.clien
3620
3814
  url: "/admin/clinical/goal-templates/categories/catalog",
3621
3815
  ...options
3622
3816
  });
3817
+ var getAdminSchedulingAvailabilityRulesByEventType = (options) => (options.client ?? client).get({
3818
+ security: [{ scheme: "bearer", type: "http" }],
3819
+ url: "/admin/scheduling/availability-rules/by-event-type",
3820
+ ...options
3821
+ });
3623
3822
  var patchAdminClinicalNotesByIdRestore = (options) => (options.client ?? client).patch({
3624
3823
  security: [{ scheme: "bearer", type: "http" }],
3625
3824
  url: "/admin/clinical/notes/{id}/restore",
@@ -3647,6 +3846,15 @@ var patchAdminUsersByIdConfirmEmail = (options) => (options.client ?? client).pa
3647
3846
  ...options.headers
3648
3847
  }
3649
3848
  });
3849
+ var postAdminEmailMarketingTemplates = (options) => (options.client ?? client).post({
3850
+ security: [{ scheme: "bearer", type: "http" }],
3851
+ url: "/admin/email-marketing/templates",
3852
+ ...options,
3853
+ headers: {
3854
+ "Content-Type": "application/vnd.api+json",
3855
+ ...options.headers
3856
+ }
3857
+ });
3650
3858
  var getAdminExtractionResultsWorkspaceByWorkspaceId = (options) => (options.client ?? client).get({
3651
3859
  security: [{ scheme: "bearer", type: "http" }],
3652
3860
  url: "/admin/extraction/results/workspace/{workspace_id}",
@@ -3804,6 +4012,11 @@ var getAdminExtractionShadowComparisonsById = (options) => (options.client ?? cl
3804
4012
  url: "/admin/extraction/shadow-comparisons/{id}",
3805
4013
  ...options
3806
4014
  });
4015
+ var getAdminEmailMarketingTemplatesWorkspaceByWorkspaceId = (options) => (options.client ?? client).get({
4016
+ security: [{ scheme: "bearer", type: "http" }],
4017
+ url: "/admin/email-marketing/templates/workspace/{workspace_id}",
4018
+ ...options
4019
+ });
3807
4020
  var postAdminSocialCampaignsByIdGenerateMasterCopy = (options) => (options.client ?? client).post({
3808
4021
  security: [{ scheme: "bearer", type: "http" }],
3809
4022
  url: "/admin/social/campaigns/{id}/generate-master-copy",
@@ -3864,6 +4077,15 @@ var patchAdminClinicalPracticeResourcesCatalogByIdRestore = (options) => (option
3864
4077
  ...options.headers
3865
4078
  }
3866
4079
  });
4080
+ var patchAdminEmailMarketingTemplatesByIdRestore = (options) => (options.client ?? client).patch({
4081
+ security: [{ scheme: "bearer", type: "http" }],
4082
+ url: "/admin/email-marketing/templates/{id}/restore",
4083
+ ...options,
4084
+ headers: {
4085
+ "Content-Type": "application/vnd.api+json",
4086
+ ...options.headers
4087
+ }
4088
+ });
3867
4089
  var patchAdminWalletPlan = (options) => (options.client ?? client).patch({
3868
4090
  security: [{ scheme: "bearer", type: "http" }],
3869
4091
  url: "/admin/wallet/plan",
@@ -3925,6 +4147,15 @@ var getAdminAgentsByIdUsage = (options) => (options.client ?? client).get({
3925
4147
  url: "/admin/agents/{id}/usage",
3926
4148
  ...options
3927
4149
  });
4150
+ var patchAdminEmailMarketingGeneratedEmailsByIdSchedule = (options) => (options.client ?? client).patch({
4151
+ security: [{ scheme: "bearer", type: "http" }],
4152
+ url: "/admin/email-marketing/generated-emails/{id}/schedule",
4153
+ ...options,
4154
+ headers: {
4155
+ "Content-Type": "application/vnd.api+json",
4156
+ ...options.headers
4157
+ }
4158
+ });
3928
4159
  var getAdminEmailTrackingEventsById = (options) => (options.client ?? client).get({
3929
4160
  security: [{ scheme: "bearer", type: "http" }],
3930
4161
  url: "/admin/email/tracking-events/{id}",
@@ -4067,6 +4298,20 @@ var patchAdminClinicalClientGoalsByIdRestore = (options) => (options.client ?? c
4067
4298
  ...options.headers
4068
4299
  }
4069
4300
  });
4301
+ var getAdminEmailMarketingGeneratedEmailsById = (options) => (options.client ?? client).get({
4302
+ security: [{ scheme: "bearer", type: "http" }],
4303
+ url: "/admin/email-marketing/generated-emails/{id}",
4304
+ ...options
4305
+ });
4306
+ var patchAdminEmailMarketingGeneratedEmailsById = (options) => (options.client ?? client).patch({
4307
+ security: [{ scheme: "bearer", type: "http" }],
4308
+ url: "/admin/email-marketing/generated-emails/{id}",
4309
+ ...options,
4310
+ headers: {
4311
+ "Content-Type": "application/vnd.api+json",
4312
+ ...options.headers
4313
+ }
4314
+ });
4070
4315
  var getAdminInvitationsMe = (options) => (options.client ?? client).get({
4071
4316
  security: [{ scheme: "bearer", type: "http" }],
4072
4317
  url: "/admin/invitations/me",
@@ -4105,6 +4350,11 @@ var getAdminVoiceSessionsWorkspaceByWorkspaceId = (options) => (options.client ?
4105
4350
  url: "/admin/voice/sessions/workspace/{workspace_id}",
4106
4351
  ...options
4107
4352
  });
4353
+ var getAdminCampaignsRecipientsCampaignByCampaignId = (options) => (options.client ?? client).get({
4354
+ security: [{ scheme: "bearer", type: "http" }],
4355
+ url: "/admin/campaigns/recipients/campaign/{campaign_id}",
4356
+ ...options
4357
+ });
4108
4358
  var getAdminInvitationsConsumeByToken = (options) => (options.client ?? client).get({
4109
4359
  security: [{ scheme: "bearer", type: "http" }],
4110
4360
  url: "/admin/invitations/consume/{token}",
@@ -4143,6 +4393,25 @@ var postAdminWorkspaceAgentConfigs = (options) => (options.client ?? client).pos
4143
4393
  ...options.headers
4144
4394
  }
4145
4395
  });
4396
+ var getAdminEmailTemplateVersionsByTemplateIdVersionsByVersionNumber = (options) => (options.client ?? client).get({
4397
+ security: [{ scheme: "bearer", type: "http" }],
4398
+ url: "/admin/email/template-versions/{template_id}/versions/{version_number}",
4399
+ ...options
4400
+ });
4401
+ var postAdminEmailMarketingCampaignsByIdOptimizeSendTimes = (options) => (options.client ?? client).post({
4402
+ security: [{ scheme: "bearer", type: "http" }],
4403
+ url: "/admin/email-marketing/campaigns/{id}/optimize-send-times",
4404
+ ...options,
4405
+ headers: {
4406
+ "Content-Type": "application/vnd.api+json",
4407
+ ...options.headers
4408
+ }
4409
+ });
4410
+ var getAdminVoiceTranscriptionJobsWorkspaceByWorkspaceId = (options) => (options.client ?? client).get({
4411
+ security: [{ scheme: "bearer", type: "http" }],
4412
+ url: "/admin/voice/transcription-jobs/workspace/{workspace_id}",
4413
+ ...options
4414
+ });
4146
4415
  var getAdminSocialMetricsPostBySocialPostIdLatest = (options) => (options.client ?? client).get({
4147
4416
  security: [{ scheme: "bearer", type: "http" }],
4148
4417
  url: "/admin/social/metrics/post/{social_post_id}/latest",
@@ -4261,6 +4530,15 @@ var postAdminExtractionDocumentsBulkReprocess = (options) => (options.client ??
4261
4530
  ...options.headers
4262
4531
  }
4263
4532
  });
4533
+ var postAdminEmailMarketingCampaignsByIdGenerateEmails = (options) => (options.client ?? client).post({
4534
+ security: [{ scheme: "bearer", type: "http" }],
4535
+ url: "/admin/email-marketing/campaigns/{id}/generate-emails",
4536
+ ...options,
4537
+ headers: {
4538
+ "Content-Type": "application/vnd.api+json",
4539
+ ...options.headers
4540
+ }
4541
+ });
4264
4542
  var postAdminContentEditImage = (options) => (options.client ?? client).post({
4265
4543
  security: [{ scheme: "bearer", type: "http" }],
4266
4544
  url: "/admin/content/edit-image",
@@ -4393,6 +4671,15 @@ var patchAdminExtractionResultsByIdRegenerate = (options) => (options.client ??
4393
4671
  ...options.headers
4394
4672
  }
4395
4673
  });
4674
+ var patchAdminEmailMarketingTemplatesByIdPreview = (options) => (options.client ?? client).patch({
4675
+ security: [{ scheme: "bearer", type: "http" }],
4676
+ url: "/admin/email-marketing/templates/{id}/preview",
4677
+ ...options,
4678
+ headers: {
4679
+ "Content-Type": "application/vnd.api+json",
4680
+ ...options.headers
4681
+ }
4682
+ });
4396
4683
  var postAdminWorkspacesByWorkspaceIdExtractionDocumentsDismissAllTrained = (options) => (options.client ?? client).post({
4397
4684
  security: [{ scheme: "bearer", type: "http" }],
4398
4685
  url: "/admin/workspaces/{workspace_id}/extraction/documents/dismiss-all-trained",
@@ -4500,6 +4787,25 @@ var patchAdminAgentDeploymentsByIdAcceptUpdate = (options) => (options.client ??
4500
4787
  ...options.headers
4501
4788
  }
4502
4789
  });
4790
+ var deleteAdminEmailMarketingTemplatesById = (options) => (options.client ?? client).delete({
4791
+ security: [{ scheme: "bearer", type: "http" }],
4792
+ url: "/admin/email-marketing/templates/{id}",
4793
+ ...options
4794
+ });
4795
+ var getAdminEmailMarketingTemplatesById = (options) => (options.client ?? client).get({
4796
+ security: [{ scheme: "bearer", type: "http" }],
4797
+ url: "/admin/email-marketing/templates/{id}",
4798
+ ...options
4799
+ });
4800
+ var patchAdminEmailMarketingTemplatesById = (options) => (options.client ?? client).patch({
4801
+ security: [{ scheme: "bearer", type: "http" }],
4802
+ url: "/admin/email-marketing/templates/{id}",
4803
+ ...options,
4804
+ headers: {
4805
+ "Content-Type": "application/vnd.api+json",
4806
+ ...options.headers
4807
+ }
4808
+ });
4503
4809
  var getAdminDocumentsStats = (options) => (options.client ?? client).get({
4504
4810
  security: [{ scheme: "bearer", type: "http" }],
4505
4811
  url: "/admin/documents/stats",
@@ -4725,6 +5031,15 @@ var getAdminCrmExportsWorkspaceByWorkspaceId = (options) => (options.client ?? c
4725
5031
  url: "/admin/crm/exports/workspace/{workspace_id}",
4726
5032
  ...options
4727
5033
  });
5034
+ var postAdminEmailMarketingCampaignsByIdImportRecipients = (options) => (options.client ?? client).post({
5035
+ security: [{ scheme: "bearer", type: "http" }],
5036
+ url: "/admin/email-marketing/campaigns/{id}/import-recipients",
5037
+ ...options,
5038
+ headers: {
5039
+ "Content-Type": "application/vnd.api+json",
5040
+ ...options.headers
5041
+ }
5042
+ });
4728
5043
  var getAdminSupportTicketMessagesTicketByTicketId = (options) => (options.client ?? client).get({
4729
5044
  security: [{ scheme: "bearer", type: "http" }],
4730
5045
  url: "/admin/support/ticket-messages/ticket/{ticket_id}",
@@ -4744,6 +5059,11 @@ var getAdminWorkspacesByWorkspaceIdExtractionExportsById = (options) => (options
4744
5059
  url: "/admin/workspaces/{workspace_id}/extraction/exports/{id}",
4745
5060
  ...options
4746
5061
  });
5062
+ var getAdminEmailMarketingGeneratedEmailsCampaignByCampaignId = (options) => (options.client ?? client).get({
5063
+ security: [{ scheme: "bearer", type: "http" }],
5064
+ url: "/admin/email-marketing/generated-emails/campaign/{campaign_id}",
5065
+ ...options
5066
+ });
4747
5067
  var postAdminSupportCannedResponses = (options) => (options.client ?? client).post({
4748
5068
  security: [{ scheme: "bearer", type: "http" }],
4749
5069
  url: "/admin/support/canned-responses",
@@ -4790,6 +5110,15 @@ var postAdminSupportTicketRatings = (options) => (options.client ?? client).post
4790
5110
  ...options.headers
4791
5111
  }
4792
5112
  });
5113
+ var postAdminCampaignsSequences = (options) => (options.client ?? client).post({
5114
+ security: [{ scheme: "bearer", type: "http" }],
5115
+ url: "/admin/campaigns/sequences",
5116
+ ...options,
5117
+ headers: {
5118
+ "Content-Type": "application/vnd.api+json",
5119
+ ...options.headers
5120
+ }
5121
+ });
4793
5122
  var postAdminCrmActivities = (options) => (options.client ?? client).post({
4794
5123
  security: [{ scheme: "bearer", type: "http" }],
4795
5124
  url: "/admin/crm/activities",
@@ -4836,6 +5165,15 @@ var patchAdminPricingStrategiesById = (options) => (options.client ?? client).pa
4836
5165
  ...options.headers
4837
5166
  }
4838
5167
  });
5168
+ var postAdminEmailMarketingCampaignsByIdExport = (options) => (options.client ?? client).post({
5169
+ security: [{ scheme: "bearer", type: "http" }],
5170
+ url: "/admin/email-marketing/campaigns/{id}/export",
5171
+ ...options,
5172
+ headers: {
5173
+ "Content-Type": "application/vnd.api+json",
5174
+ ...options.headers
5175
+ }
5176
+ });
4839
5177
  var getAdminCrmRelationshipsWorkspaceByWorkspaceId = (options) => (options.client ?? client).get({
4840
5178
  security: [{ scheme: "bearer", type: "http" }],
4841
5179
  url: "/admin/crm/relationships/workspace/{workspace_id}",
@@ -4920,6 +5258,15 @@ var postAdminAgentsByIdTest = (options) => (options.client ?? client).post({
4920
5258
  ...options.headers
4921
5259
  }
4922
5260
  });
5261
+ var patchAdminSchedulingRemindersByIdCancel = (options) => (options.client ?? client).patch({
5262
+ security: [{ scheme: "bearer", type: "http" }],
5263
+ url: "/admin/scheduling/reminders/{id}/cancel",
5264
+ ...options,
5265
+ headers: {
5266
+ "Content-Type": "application/vnd.api+json",
5267
+ ...options.headers
5268
+ }
5269
+ });
4923
5270
  var getAdminSchedulingLocationsById = (options) => (options.client ?? client).get({
4924
5271
  security: [{ scheme: "bearer", type: "http" }],
4925
5272
  url: "/admin/scheduling/locations/{id}",
@@ -5280,6 +5627,11 @@ var getAdminSchedulingRemindersById = (options) => (options.client ?? client).ge
5280
5627
  url: "/admin/scheduling/reminders/{id}",
5281
5628
  ...options
5282
5629
  });
5630
+ var getAdminSchedulingBookingsByBooker = (options) => (options.client ?? client).get({
5631
+ security: [{ scheme: "bearer", type: "http" }],
5632
+ url: "/admin/scheduling/bookings/by-booker",
5633
+ ...options
5634
+ });
5283
5635
  var deleteAdminClinicalPatientsById = (options) => (options.client ?? client).delete({
5284
5636
  security: [{ scheme: "bearer", type: "http" }],
5285
5637
  url: "/admin/clinical/patients/{id}",
@@ -5518,6 +5870,15 @@ var getAdminVoiceRecordingsById = (options) => (options.client ?? client).get({
5518
5870
  url: "/admin/voice/recordings/{id}",
5519
5871
  ...options
5520
5872
  });
5873
+ var patchAdminEmailMarketingGeneratedEmailsByIdApprove = (options) => (options.client ?? client).patch({
5874
+ security: [{ scheme: "bearer", type: "http" }],
5875
+ url: "/admin/email-marketing/generated-emails/{id}/approve",
5876
+ ...options,
5877
+ headers: {
5878
+ "Content-Type": "application/vnd.api+json",
5879
+ ...options.headers
5880
+ }
5881
+ });
5521
5882
  var patchAdminClinicalMealPlansByIdArchive = (options) => (options.client ?? client).patch({
5522
5883
  security: [{ scheme: "bearer", type: "http" }],
5523
5884
  url: "/admin/clinical/meal-plans/{id}/archive",
@@ -5573,6 +5934,25 @@ var postAdminClinicalNotes = (options) => (options.client ?? client).post({
5573
5934
  ...options.headers
5574
5935
  }
5575
5936
  });
5937
+ var deleteAdminCampaignsSequenceStepsById = (options) => (options.client ?? client).delete({
5938
+ security: [{ scheme: "bearer", type: "http" }],
5939
+ url: "/admin/campaigns/sequence-steps/{id}",
5940
+ ...options
5941
+ });
5942
+ var getAdminCampaignsSequenceStepsById = (options) => (options.client ?? client).get({
5943
+ security: [{ scheme: "bearer", type: "http" }],
5944
+ url: "/admin/campaigns/sequence-steps/{id}",
5945
+ ...options
5946
+ });
5947
+ var patchAdminCampaignsSequenceStepsById = (options) => (options.client ?? client).patch({
5948
+ security: [{ scheme: "bearer", type: "http" }],
5949
+ url: "/admin/campaigns/sequence-steps/{id}",
5950
+ ...options,
5951
+ headers: {
5952
+ "Content-Type": "application/vnd.api+json",
5953
+ ...options.headers
5954
+ }
5955
+ });
5576
5956
  var getAdminClinicalPatientsByIdGoals = (options) => (options.client ?? client).get({
5577
5957
  security: [{ scheme: "bearer", type: "http" }],
5578
5958
  url: "/admin/clinical/patients/{id}/goals",
@@ -5620,6 +6000,15 @@ var getAdminSupportRoutingRulesApplicationByApplicationId = (options) => (option
5620
6000
  url: "/admin/support/routing-rules/application/{application_id}",
5621
6001
  ...options
5622
6002
  });
6003
+ var postAdminEmailMarketingTemplatesCompile = (options) => (options.client ?? client).post({
6004
+ security: [{ scheme: "bearer", type: "http" }],
6005
+ url: "/admin/email-marketing/templates/compile",
6006
+ ...options,
6007
+ headers: {
6008
+ "Content-Type": "application/vnd.api+json",
6009
+ ...options.headers
6010
+ }
6011
+ });
5623
6012
  var getAdminClinicalNotesArchived = (options) => (options.client ?? client).get({
5624
6013
  security: [{ scheme: "bearer", type: "http" }],
5625
6014
  url: "/admin/clinical/notes/archived",
@@ -5755,6 +6144,15 @@ var postAdminSysSemanticCacheClear = (options) => (options.client ?? client).pos
5755
6144
  ...options.headers
5756
6145
  }
5757
6146
  });
6147
+ var patchAdminEmailMarketingTemplatesByIdRollback = (options) => (options.client ?? client).patch({
6148
+ security: [{ scheme: "bearer", type: "http" }],
6149
+ url: "/admin/email-marketing/templates/{id}/rollback",
6150
+ ...options,
6151
+ headers: {
6152
+ "Content-Type": "application/vnd.api+json",
6153
+ ...options.headers
6154
+ }
6155
+ });
5758
6156
  var getAdminSocialTrendingWatchesWorkspaceByWorkspaceId = (options) => (options.client ?? client).get({
5759
6157
  security: [{ scheme: "bearer", type: "http" }],
5760
6158
  url: "/admin/social/trending/watches/workspace/{workspace_id}",
@@ -5981,6 +6379,15 @@ var patchAdminSocialTrendingWatchesById = (options) => (options.client ?? client
5981
6379
  ...options.headers
5982
6380
  }
5983
6381
  });
6382
+ var patchAdminEmailMarketingTemplatesByIdPublish = (options) => (options.client ?? client).patch({
6383
+ security: [{ scheme: "bearer", type: "http" }],
6384
+ url: "/admin/email-marketing/templates/{id}/publish",
6385
+ ...options,
6386
+ headers: {
6387
+ "Content-Type": "application/vnd.api+json",
6388
+ ...options.headers
6389
+ }
6390
+ });
5984
6391
  var getAdminSocialMetricsAccountBySocialAccountId = (options) => (options.client ?? client).get({
5985
6392
  security: [{ scheme: "bearer", type: "http" }],
5986
6393
  url: "/admin/social/metrics/account/{social_account_id}",
@@ -6105,6 +6512,15 @@ var patchAdminPlansById = (options) => (options.client ?? client).patch({
6105
6512
  ...options.headers
6106
6513
  }
6107
6514
  });
6515
+ var patchAdminSchedulingEventTypesByIdArchive = (options) => (options.client ?? client).patch({
6516
+ security: [{ scheme: "bearer", type: "http" }],
6517
+ url: "/admin/scheduling/event-types/{id}/archive",
6518
+ ...options,
6519
+ headers: {
6520
+ "Content-Type": "application/vnd.api+json",
6521
+ ...options.headers
6522
+ }
6523
+ });
6108
6524
  var patchAdminUsersByIdResetPassword = (options) => (options.client ?? client).patch({
6109
6525
  security: [{ scheme: "bearer", type: "http" }],
6110
6526
  url: "/admin/users/{id}/reset-password",
@@ -6449,6 +6865,11 @@ var postAdminThreadsByIdComplete = (options) => (options.client ?? client).post(
6449
6865
  ...options.headers
6450
6866
  }
6451
6867
  });
6868
+ var getAdminVoiceTranscriptionJobsMine = (options) => (options.client ?? client).get({
6869
+ security: [{ scheme: "bearer", type: "http" }],
6870
+ url: "/admin/voice/transcription-jobs/mine",
6871
+ ...options
6872
+ });
6452
6873
  var deleteAdminConnectorsOauthAppConfigsById = (options) => (options.client ?? client).delete({
6453
6874
  security: [{ scheme: "bearer", type: "http" }],
6454
6875
  url: "/admin/connectors/oauth-app-configs/{id}",
@@ -6468,6 +6889,11 @@ var patchAdminConnectorsOauthAppConfigsById = (options) => (options.client ?? cl
6468
6889
  ...options.headers
6469
6890
  }
6470
6891
  });
6892
+ var getAdminSchedulingAvailabilityRulesByUser = (options) => (options.client ?? client).get({
6893
+ security: [{ scheme: "bearer", type: "http" }],
6894
+ url: "/admin/scheduling/availability-rules/by-user",
6895
+ ...options
6896
+ });
6471
6897
  var getAdminClinicalClientResourceAssignments = (options) => (options.client ?? client).get({
6472
6898
  security: [{ scheme: "bearer", type: "http" }],
6473
6899
  url: "/admin/clinical/client-resource-assignments",
@@ -6659,6 +7085,11 @@ var patchAdminInvitationsByIdDecline = (options) => (options.client ?? client).p
6659
7085
  ...options.headers
6660
7086
  }
6661
7087
  });
7088
+ var getAdminSchedulingEventTypesBySlug = (options) => (options.client ?? client).get({
7089
+ security: [{ scheme: "bearer", type: "http" }],
7090
+ url: "/admin/scheduling/event-types/by-slug",
7091
+ ...options
7092
+ });
6662
7093
  var deleteAdminClinicalGoalTemplatesCatalogByIdPermanent = (options) => (options.client ?? client).delete({
6663
7094
  security: [{ scheme: "bearer", type: "http" }],
6664
7095
  url: "/admin/clinical/goal-templates/catalog/{id}/permanent",
@@ -7229,7 +7660,7 @@ function createAgentsNamespace(rb) {
7229
7660
  create: async (attributes, options) => {
7230
7661
  return rb.execute(
7231
7662
  postAdminAgentVersions,
7232
- { body: { data: { type: "agent_version", attributes } } },
7663
+ { body: { data: { type: "agent-version", attributes } } },
7233
7664
  options
7234
7665
  );
7235
7666
  },
@@ -7251,7 +7682,7 @@ function createAgentsNamespace(rb) {
7251
7682
  path: { id },
7252
7683
  body: {
7253
7684
  data: {
7254
- type: "agent_version",
7685
+ type: "agent-version",
7255
7686
  system_field_name: fieldName
7256
7687
  }
7257
7688
  }
@@ -7277,7 +7708,7 @@ function createAgentsNamespace(rb) {
7277
7708
  path: { id },
7278
7709
  body: {
7279
7710
  data: {
7280
- type: "agent_version",
7711
+ type: "agent-version",
7281
7712
  system_field_name: fieldName
7282
7713
  }
7283
7714
  }
@@ -7303,7 +7734,7 @@ function createAgentsNamespace(rb) {
7303
7734
  path: { id },
7304
7735
  body: {
7305
7736
  data: {
7306
- type: "agent_version",
7737
+ type: "agent-version",
7307
7738
  system_field_names: fieldNames
7308
7739
  }
7309
7740
  }
@@ -7395,7 +7826,7 @@ function createAgentsNamespace(rb) {
7395
7826
  {
7396
7827
  body: {
7397
7828
  data: {
7398
- type: "agent_version_comparison",
7829
+ type: "agent-version-comparison",
7399
7830
  attributes: {
7400
7831
  version_a_id: versionAId,
7401
7832
  version_b_id: versionBId
@@ -7443,7 +7874,7 @@ function createAgentsNamespace(rb) {
7443
7874
  postAdminAgentsByIdSchemaVersions,
7444
7875
  {
7445
7876
  path: { id: agentId },
7446
- body: { data: { type: "agent_version", ...attributes } }
7877
+ body: { data: { type: "agent-version", ...attributes } }
7447
7878
  },
7448
7879
  options
7449
7880
  );
@@ -7483,7 +7914,7 @@ function createAgentsNamespace(rb) {
7483
7914
  patchAdminAgentsByIdSchemaVersionsByVersionId,
7484
7915
  {
7485
7916
  path: { id: agentId, version_id: versionId },
7486
- body: { data: { type: "agent_version", ...attributes } }
7917
+ body: { data: { type: "agent-version", ...attributes } }
7487
7918
  },
7488
7919
  options
7489
7920
  );
@@ -7540,7 +7971,7 @@ function createAgentsNamespace(rb) {
7540
7971
  create: async (attributes, options) => {
7541
7972
  return rb.execute(
7542
7973
  postAdminTrainingExamples,
7543
- { body: { data: { type: "training_example", attributes } } },
7974
+ { body: { data: { type: "training-example", attributes } } },
7544
7975
  options
7545
7976
  );
7546
7977
  },
@@ -7560,7 +7991,7 @@ function createAgentsNamespace(rb) {
7560
7991
  patchAdminTrainingExamplesById,
7561
7992
  {
7562
7993
  path: { id },
7563
- body: { data: { id, type: "training_example", attributes } }
7994
+ body: { data: { id, type: "training-example", attributes } }
7564
7995
  },
7565
7996
  options
7566
7997
  );
@@ -7600,7 +8031,7 @@ function createAgentsNamespace(rb) {
7600
8031
  {
7601
8032
  body: {
7602
8033
  data: {
7603
- type: "training_example",
8034
+ type: "training-example",
7604
8035
  agent_id: examples[0]?.agent_id,
7605
8036
  examples
7606
8037
  }
@@ -7623,7 +8054,7 @@ function createAgentsNamespace(rb) {
7623
8054
  return rb.execute(
7624
8055
  postAdminTrainingExamplesBulkDelete,
7625
8056
  {
7626
- body: { data: { type: "training_example", ids } }
8057
+ body: { data: { type: "training-example", ids } }
7627
8058
  },
7628
8059
  options
7629
8060
  );
@@ -7643,7 +8074,7 @@ function createAgentsNamespace(rb) {
7643
8074
  postAdminTrainingExamplesSearch,
7644
8075
  {
7645
8076
  body: {
7646
- data: { type: "training_example", query }
8077
+ data: { type: "training-example", query }
7647
8078
  }
7648
8079
  },
7649
8080
  options
@@ -7787,7 +8218,7 @@ function createAgentsNamespace(rb) {
7787
8218
  create: async (attributes, options) => {
7788
8219
  return rb.execute(
7789
8220
  postAdminFieldTemplates,
7790
- { body: { data: { type: "field_template", attributes } } },
8221
+ { body: { data: { type: "field-template", attributes } } },
7791
8222
  options
7792
8223
  );
7793
8224
  },
@@ -8890,7 +9321,7 @@ function createApiKeysNamespace(rb) {
8890
9321
  create: async (attributes, options) => {
8891
9322
  return rb.execute(
8892
9323
  postAdminApiKeys,
8893
- { body: { data: { type: "api_key", attributes } } },
9324
+ { body: { data: { type: "api-key", attributes } } },
8894
9325
  options
8895
9326
  );
8896
9327
  },
@@ -8903,7 +9334,7 @@ function createApiKeysNamespace(rb) {
8903
9334
  update: async (id, attributes, options) => {
8904
9335
  return rb.execute(
8905
9336
  patchAdminApiKeysById,
8906
- { path: { id }, body: { data: { id, type: "api_key", attributes } } },
9337
+ { path: { id }, body: { data: { id, type: "api-key", attributes } } },
8907
9338
  options
8908
9339
  );
8909
9340
  },
@@ -8933,7 +9364,7 @@ function createApiKeysNamespace(rb) {
8933
9364
  body: {
8934
9365
  data: {
8935
9366
  id,
8936
- type: "api_key",
9367
+ type: "api-key",
8937
9368
  attributes: {
8938
9369
  credit_limit: creditLimit,
8939
9370
  credit_limit_period: creditLimitPeriod
@@ -8972,7 +9403,7 @@ function createApiKeysNamespace(rb) {
8972
9403
  patchAdminApiKeysByIdResetPeriod,
8973
9404
  {
8974
9405
  path: { id },
8975
- body: { data: { id, type: "api_key", attributes: {} } }
9406
+ body: { data: { id, type: "api-key", attributes: {} } }
8976
9407
  },
8977
9408
  options
8978
9409
  );
@@ -9264,7 +9695,7 @@ function createStorageNamespace(rb) {
9264
9695
  archive: async (id, options) => {
9265
9696
  return rb.execute(
9266
9697
  patchAdminStorageFilesByIdArchive,
9267
- { path: { id }, body: { data: { id, type: "storage_file" } } },
9698
+ { path: { id }, body: { data: { id, type: "storage-file" } } },
9268
9699
  options
9269
9700
  );
9270
9701
  },
@@ -9272,7 +9703,7 @@ function createStorageNamespace(rb) {
9272
9703
  restore: async (id, options) => {
9273
9704
  return rb.execute(
9274
9705
  patchAdminStorageFilesByIdRestore,
9275
- { path: { id }, body: { data: { id, type: "storage_file" } } },
9706
+ { path: { id }, body: { data: { id, type: "storage-file" } } },
9276
9707
  options
9277
9708
  );
9278
9709
  },
@@ -9285,7 +9716,7 @@ function createStorageNamespace(rb) {
9285
9716
  body: {
9286
9717
  data: {
9287
9718
  id,
9288
- type: "storage_file",
9719
+ type: "storage-file",
9289
9720
  attributes: attributes ?? {}
9290
9721
  }
9291
9722
  }
@@ -9297,7 +9728,7 @@ function createStorageNamespace(rb) {
9297
9728
  softDelete: async (id, options) => {
9298
9729
  return rb.execute(
9299
9730
  patchAdminStorageFilesByIdSoftDelete,
9300
- { path: { id }, body: { data: { id, type: "storage_file" } } },
9731
+ { path: { id }, body: { data: { id, type: "storage-file" } } },
9301
9732
  options
9302
9733
  );
9303
9734
  },
@@ -9308,7 +9739,7 @@ function createStorageNamespace(rb) {
9308
9739
  {
9309
9740
  path: { id },
9310
9741
  body: {
9311
- data: { id, type: "storage_file", attributes: { tags } }
9742
+ data: { id, type: "storage-file", attributes: { tags } }
9312
9743
  }
9313
9744
  },
9314
9745
  options
@@ -9323,7 +9754,7 @@ function createStorageNamespace(rb) {
9323
9754
  body: {
9324
9755
  data: {
9325
9756
  id,
9326
- type: "storage_file",
9757
+ type: "storage-file",
9327
9758
  attributes: { new_metadata: newMetadata }
9328
9759
  }
9329
9760
  }
@@ -9803,6 +10234,132 @@ function createVoiceNamespace(rb) {
9803
10234
  options
9804
10235
  );
9805
10236
  }
10237
+ },
10238
+ /**
10239
+ * Transcription job management — admin view.
10240
+ *
10241
+ * Transcription jobs enable chunked, progressive transcription of long
10242
+ * audio recordings. Each job tracks uploaded chunks, assembly status,
10243
+ * and the final assembled transcript.
10244
+ */
10245
+ transcriptionJobs: {
10246
+ /**
10247
+ * List transcription jobs across all workspaces.
10248
+ *
10249
+ * @param options - Optional pagination and request options.
10250
+ * @returns Array of TranscriptionJob objects.
10251
+ *
10252
+ * @example
10253
+ * ```typescript
10254
+ * const jobs = await admin.voice.transcriptionJobs.list();
10255
+ * ```
10256
+ */
10257
+ list: async (options) => {
10258
+ return rb.execute(
10259
+ getAdminVoiceTranscriptionJobs,
10260
+ buildPageQuery(options?.page, options?.pageSize),
10261
+ options
10262
+ );
10263
+ },
10264
+ /**
10265
+ * Retrieve a single transcription job by ID.
10266
+ *
10267
+ * @param id - The UUID of the transcription job.
10268
+ * @param options - Optional request options.
10269
+ * @returns The TranscriptionJob.
10270
+ *
10271
+ * @example
10272
+ * ```typescript
10273
+ * const job = await admin.voice.transcriptionJobs.get('job-uuid');
10274
+ * ```
10275
+ */
10276
+ get: async (id, options) => {
10277
+ return rb.execute(
10278
+ getAdminVoiceTranscriptionJobsById,
10279
+ { path: { id } },
10280
+ options
10281
+ );
10282
+ },
10283
+ /**
10284
+ * List transcription jobs owned by the current actor.
10285
+ *
10286
+ * @param options - Optional pagination and request options.
10287
+ * @returns Array of TranscriptionJob objects.
10288
+ *
10289
+ * @example
10290
+ * ```typescript
10291
+ * const myJobs = await admin.voice.transcriptionJobs.listMine();
10292
+ * ```
10293
+ */
10294
+ listMine: async (options) => {
10295
+ return rb.execute(
10296
+ getAdminVoiceTranscriptionJobsMine,
10297
+ buildPageQuery(options?.page, options?.pageSize),
10298
+ options
10299
+ );
10300
+ },
10301
+ /**
10302
+ * List transcription jobs in a specific workspace.
10303
+ *
10304
+ * @param workspaceId - The UUID of the workspace.
10305
+ * @param options - Optional pagination and request options.
10306
+ * @returns Array of TranscriptionJob objects in the workspace.
10307
+ *
10308
+ * @example
10309
+ * ```typescript
10310
+ * const jobs = await admin.voice.transcriptionJobs.listByWorkspace('ws-uuid');
10311
+ * ```
10312
+ */
10313
+ listByWorkspace: async (workspaceId, options) => {
10314
+ return rb.execute(
10315
+ getAdminVoiceTranscriptionJobsWorkspaceByWorkspaceId,
10316
+ {
10317
+ path: { workspace_id: workspaceId },
10318
+ ...buildPageQuery(options?.page, options?.pageSize)
10319
+ },
10320
+ options
10321
+ );
10322
+ },
10323
+ /**
10324
+ * Create a new transcription job.
10325
+ *
10326
+ * @param data - Job creation attributes (language, model_size, etc.).
10327
+ * @param options - Optional request options.
10328
+ * @returns The created TranscriptionJob.
10329
+ *
10330
+ * @example
10331
+ * ```typescript
10332
+ * const job = await admin.voice.transcriptionJobs.create({
10333
+ * language: "en",
10334
+ * model_size: "large-v3",
10335
+ * });
10336
+ * ```
10337
+ */
10338
+ create: async (data, options) => {
10339
+ return rb.execute(
10340
+ postAdminVoiceTranscriptionJobs,
10341
+ { body: { data: { type: "transcription-job", attributes: data } } },
10342
+ options
10343
+ );
10344
+ },
10345
+ /**
10346
+ * Delete a transcription job by ID.
10347
+ *
10348
+ * @param id - The UUID of the transcription job to delete.
10349
+ * @param options - Optional request options.
10350
+ *
10351
+ * @example
10352
+ * ```typescript
10353
+ * await admin.voice.transcriptionJobs.destroy('job-uuid');
10354
+ * ```
10355
+ */
10356
+ destroy: async (id, options) => {
10357
+ return rb.execute(
10358
+ deleteAdminVoiceTranscriptionJobsById,
10359
+ { path: { id } },
10360
+ options
10361
+ );
10362
+ }
9806
10363
  }
9807
10364
  };
9808
10365
  }
@@ -10004,7 +10561,7 @@ function createWebhooksNamespace(rb) {
10004
10561
  {
10005
10562
  body: {
10006
10563
  data: {
10007
- type: "webhook_config",
10564
+ type: "webhook-config",
10008
10565
  attributes: {
10009
10566
  name,
10010
10567
  url,
@@ -10049,7 +10606,7 @@ function createWebhooksNamespace(rb) {
10049
10606
  patchAdminWebhookConfigsById,
10050
10607
  {
10051
10608
  path: { id },
10052
- body: { data: { id, type: "webhook_config", attributes } }
10609
+ body: { data: { id, type: "webhook-config", attributes } }
10053
10610
  },
10054
10611
  options
10055
10612
  );
@@ -10177,88 +10734,953 @@ function createWebhooksNamespace(rb) {
10177
10734
  }
10178
10735
  },
10179
10736
  /**
10180
- * Lists all available webhook event types supported by the platform.
10181
- *
10182
- * Returns the complete event catalog. Use this to discover which event
10183
- * types exist, understand their payload shape, and validate the `events`
10184
- * array when registering or updating webhook configs.
10185
- *
10186
- * @param options - Optional request options.
10187
- * @returns A promise that resolves to an array of event type descriptors,
10188
- * each with `type`, `description`, and `data_object`.
10737
+ * Lists all available webhook event types supported by the platform.
10738
+ *
10739
+ * Returns the complete event catalog. Use this to discover which event
10740
+ * types exist, understand their payload shape, and validate the `events`
10741
+ * array when registering or updating webhook configs.
10742
+ *
10743
+ * @param options - Optional request options.
10744
+ * @returns A promise that resolves to an array of event type descriptors,
10745
+ * each with `type`, `description`, and `data_object`.
10746
+ *
10747
+ * @example
10748
+ * const admin = new GptAdmin({ apiKey: 'sk_srv_...' });
10749
+ * const types = await admin.webhooks.listEventTypes();
10750
+ * console.log(types.map(t => t.type));
10751
+ */
10752
+ listEventTypes: async (options) => {
10753
+ return rb.rawGet("/webhook-event-types", options);
10754
+ },
10755
+ deliveries: {
10756
+ /**
10757
+ * Lists all webhook delivery records across all configurations.
10758
+ *
10759
+ * Each delivery record tracks the attempt count, status, payload, and
10760
+ * response for a single event dispatch.
10761
+ *
10762
+ * @param options - Optional request options.
10763
+ * @returns Array of WebhookDelivery objects.
10764
+ */
10765
+ list: async (options) => {
10766
+ return rb.execute(
10767
+ getAdminWebhookDeliveries,
10768
+ {},
10769
+ options
10770
+ );
10771
+ },
10772
+ /**
10773
+ * Fetches a single delivery record by ID.
10774
+ *
10775
+ * @param id - WebhookDelivery ID.
10776
+ * @param options - Optional request options.
10777
+ * @returns The WebhookDelivery.
10778
+ */
10779
+ get: async (id, options) => {
10780
+ return rb.execute(
10781
+ getAdminWebhookDeliveriesById,
10782
+ { path: { id } },
10783
+ options
10784
+ );
10785
+ },
10786
+ /**
10787
+ * Re-enqueues a failed or pending delivery for immediate re-dispatch.
10788
+ *
10789
+ * Sets the delivery status to `retrying` and inserts a new WebhookSender
10790
+ * Oban job. Use this to recover from transient endpoint failures without
10791
+ * waiting for the automatic retry schedule.
10792
+ *
10793
+ * @param id - WebhookDelivery ID.
10794
+ * @param options - Optional request options.
10795
+ * @returns Updated WebhookDelivery with status `retrying`.
10796
+ */
10797
+ retry: async (id, options) => {
10798
+ return rb.execute(
10799
+ postAdminWebhookDeliveriesByIdRetry,
10800
+ { path: { id }, body: {} },
10801
+ options
10802
+ );
10803
+ },
10804
+ /**
10805
+ * Sets multiple delivery records to `retrying` status in bulk.
10806
+ *
10807
+ * Authorization is actor-scoped — only deliveries the actor can update
10808
+ * are affected. Use this to recover from endpoint outages without
10809
+ * retrying each delivery individually.
10810
+ *
10811
+ * @param ids - Array of WebhookDelivery IDs to retry.
10812
+ * @param options - Optional request options.
10813
+ * @returns An object with `success: true` and the count of queued retries.
10814
+ */
10815
+ bulkRetry: async (ids, options) => {
10816
+ return rb.execute(
10817
+ postAdminWebhookDeliveriesBulkRetry,
10818
+ { body: { data: { ids } } },
10819
+ options
10820
+ );
10821
+ }
10822
+ }
10823
+ };
10824
+ }
10825
+
10826
+ // src/namespaces/campaigns.ts
10827
+ function createCampaignsNamespace(rb) {
10828
+ return {
10829
+ /**
10830
+ * Campaigns -- email campaign orchestration.
10831
+ *
10832
+ * A campaign represents a single bulk email send (or a scheduled future
10833
+ * send) targeting a list of recipients. Campaigns can be created from
10834
+ * templates, analysed with AI for performance insights, have their send
10835
+ * times AI-optimised, and spawn follow-up campaigns automatically.
10836
+ */
10837
+ campaigns: {
10838
+ /**
10839
+ * Fetch a single campaign by its unique ID.
10840
+ *
10841
+ * @param id - The unique identifier of the campaign to retrieve.
10842
+ * @param options - Optional request-level overrides.
10843
+ * @returns A promise that resolves to the matching {@link Campaign}.
10844
+ */
10845
+ get: async (id, options) => {
10846
+ return rb.execute(
10847
+ getAdminEmailMarketingCampaignsById,
10848
+ { path: { id } },
10849
+ options
10850
+ );
10851
+ },
10852
+ /**
10853
+ * List campaigns for a workspace with optional pagination.
10854
+ *
10855
+ * @param workspaceId - The ID of the workspace whose campaigns to list.
10856
+ * @param options - Optional pagination controls and request-level overrides.
10857
+ * @returns A promise that resolves to an array of {@link Campaign} records.
10858
+ */
10859
+ listByWorkspace: async (workspaceId, options) => {
10860
+ return rb.execute(
10861
+ getAdminEmailMarketingCampaignsWorkspaceByWorkspaceId,
10862
+ {
10863
+ path: { workspace_id: workspaceId },
10864
+ ...buildPageQuery(options?.page, options?.pageSize)
10865
+ },
10866
+ options
10867
+ );
10868
+ },
10869
+ /**
10870
+ * Create a new email campaign.
10871
+ *
10872
+ * @param attributes - Campaign attributes including `workspace_id`, `name`, and `template_id`.
10873
+ * @param options - Optional request-level overrides.
10874
+ * @returns A promise that resolves to the newly created {@link Campaign}.
10875
+ */
10876
+ create: async (attributes, options) => {
10877
+ return rb.execute(
10878
+ postAdminEmailMarketingCampaigns,
10879
+ { body: { data: { type: "campaign", attributes } } },
10880
+ options
10881
+ );
10882
+ },
10883
+ /**
10884
+ * Update an existing campaign's attributes (PATCH semantics).
10885
+ *
10886
+ * @param id - The unique identifier of the campaign to update.
10887
+ * @param attributes - Key/value map of attributes to change.
10888
+ * @param options - Optional request-level overrides.
10889
+ * @returns A promise that resolves to the updated {@link Campaign}.
10890
+ */
10891
+ update: async (id, attributes, options) => {
10892
+ return rb.execute(
10893
+ patchAdminEmailMarketingCampaignsById,
10894
+ {
10895
+ path: { id },
10896
+ body: {
10897
+ data: { id, type: "campaign", attributes }
10898
+ }
10899
+ },
10900
+ options
10901
+ );
10902
+ },
10903
+ /**
10904
+ * Trigger immediate delivery of a campaign to all recipients.
10905
+ *
10906
+ * @param id - The unique identifier of the campaign to send.
10907
+ * @param options - Optional request-level overrides.
10908
+ * @returns A promise that resolves to the updated {@link Campaign}.
10909
+ */
10910
+ send: async (id, options) => {
10911
+ return rb.execute(
10912
+ postAdminEmailMarketingCampaignsByIdSend,
10913
+ { path: { id }, body: {} },
10914
+ options
10915
+ );
10916
+ },
10917
+ /**
10918
+ * Request an AI-powered performance analysis of a sent campaign.
10919
+ *
10920
+ * @param id - The unique identifier of the campaign to analyse.
10921
+ * @param options - Optional request-level overrides.
10922
+ * @returns A promise that resolves to the AI-generated analysis report payload.
10923
+ */
10924
+ analyze: async (id, options) => {
10925
+ return rb.execute(
10926
+ postAdminEmailMarketingCampaignsByIdAnalyze,
10927
+ { path: { id }, body: {} },
10928
+ options
10929
+ );
10930
+ },
10931
+ /**
10932
+ * Use AI to determine the optimal send time for a campaign.
10933
+ *
10934
+ * @param id - The unique identifier of the campaign to optimise.
10935
+ * @param options - Optional request-level overrides.
10936
+ * @returns A promise that resolves to the optimisation result payload.
10937
+ */
10938
+ optimizeSendTimes: async (id, options) => {
10939
+ return rb.execute(
10940
+ postAdminEmailMarketingCampaignsByIdOptimizeSendTimes,
10941
+ { path: { id }, body: {} },
10942
+ options
10943
+ );
10944
+ },
10945
+ /**
10946
+ * Create a follow-up campaign targeted at non-engaged recipients.
10947
+ *
10948
+ * @param id - The ID of the original campaign to follow up on.
10949
+ * @param attributes - Additional attributes for the follow-up campaign.
10950
+ * @param options - Optional request-level overrides.
10951
+ * @returns A promise that resolves to the newly created follow-up {@link Campaign}.
10952
+ */
10953
+ createFollowup: async (id, attributes, options) => {
10954
+ return rb.execute(
10955
+ postAdminEmailMarketingCampaignsByIdCreateFollowup,
10956
+ {
10957
+ path: { id },
10958
+ body: { data: { type: "campaign", ...attributes } }
10959
+ },
10960
+ options
10961
+ );
10962
+ },
10963
+ /**
10964
+ * Import recipients from a CSV file stored in platform storage.
10965
+ *
10966
+ * @param id - The campaign ID to import recipients into.
10967
+ * @param attributes - Import configuration including `csv_storage_key` and `workspace_id`.
10968
+ * @param options - Optional request-level overrides.
10969
+ * @returns A promise resolving to the import job details.
10970
+ */
10971
+ importRecipients: async (id, attributes, options) => {
10972
+ return rb.execute(
10973
+ postAdminEmailMarketingCampaignsByIdImportRecipients,
10974
+ { path: { id }, body: { data: { type: "campaign", attributes } } },
10975
+ options
10976
+ );
10977
+ },
10978
+ /**
10979
+ * Trigger AI-powered email generation for all campaign recipients.
10980
+ *
10981
+ * @param id - The campaign ID to generate emails for.
10982
+ * @param workspaceId - The workspace ID.
10983
+ * @param options - Optional request-level overrides.
10984
+ * @returns A promise resolving to the generation job details.
10985
+ */
10986
+ generateEmails: async (id, workspaceId, options) => {
10987
+ return rb.execute(
10988
+ postAdminEmailMarketingCampaignsByIdGenerateEmails,
10989
+ {
10990
+ path: { id },
10991
+ body: {
10992
+ data: {
10993
+ type: "campaign",
10994
+ attributes: { workspace_id: workspaceId }
10995
+ }
10996
+ }
10997
+ },
10998
+ options
10999
+ );
11000
+ },
11001
+ /**
11002
+ * Generate A/B test subject line variants using AI.
11003
+ *
11004
+ * @param id - The campaign ID to optimize subjects for.
11005
+ * @param attributes - Subject optimization parameters.
11006
+ * @param options - Optional request-level overrides.
11007
+ * @returns A promise resolving to the optimization result with variant suggestions.
11008
+ */
11009
+ optimizeSubjects: async (id, attributes, options) => {
11010
+ return rb.execute(
11011
+ postAdminEmailMarketingCampaignsByIdOptimizeSubjects,
11012
+ {
11013
+ path: { id },
11014
+ body: {
11015
+ data: { type: "campaign", attributes }
11016
+ }
11017
+ },
11018
+ options
11019
+ );
11020
+ },
11021
+ /**
11022
+ * Export campaign data (recipients, results, or analytics) as CSV.
11023
+ *
11024
+ * @param id - The campaign ID to export.
11025
+ * @param attributes - Export configuration including `workspace_id`.
11026
+ * @param options - Optional request-level overrides.
11027
+ * @returns A promise resolving to the export job details.
11028
+ */
11029
+ export: async (id, attributes, options) => {
11030
+ return rb.execute(
11031
+ postAdminEmailMarketingCampaignsByIdExport,
11032
+ {
11033
+ path: { id },
11034
+ body: {
11035
+ data: { type: "campaign", attributes }
11036
+ }
11037
+ },
11038
+ options
11039
+ );
11040
+ },
11041
+ /**
11042
+ * Permanently delete a campaign.
11043
+ *
11044
+ * @param id - The unique identifier of the campaign to delete.
11045
+ * @param options - Optional request-level overrides.
11046
+ * @returns A promise that resolves to `true` on successful deletion.
11047
+ */
11048
+ delete: async (id, options) => {
11049
+ return rb.executeDelete(
11050
+ deleteAdminEmailMarketingCampaignsById,
11051
+ { path: { id } },
11052
+ options
11053
+ );
11054
+ }
11055
+ },
11056
+ /**
11057
+ * Templates -- reusable MJML-based email layout templates with versioning.
11058
+ *
11059
+ * Templates define the HTML and/or plain-text structure of an email.
11060
+ * They support live MJML compilation, publish/unpublish lifecycle,
11061
+ * archive/restore, rollback, and immutable version snapshots.
11062
+ */
11063
+ templates: {
11064
+ /**
11065
+ * Fetch a single template by its unique ID.
11066
+ *
11067
+ * @param id - The unique identifier of the template to retrieve.
11068
+ * @param options - Optional request-level overrides.
11069
+ * @returns A promise that resolves to the matching {@link EmailMarketingTemplate}.
11070
+ */
11071
+ get: async (id, options) => {
11072
+ return rb.execute(
11073
+ getAdminEmailMarketingTemplatesById,
11074
+ { path: { id } },
11075
+ options
11076
+ );
11077
+ },
11078
+ /**
11079
+ * List all email templates for a workspace with optional pagination.
11080
+ *
11081
+ * @param workspaceId - The ID of the workspace whose templates to list.
11082
+ * @param options - Optional pagination controls and request-level overrides.
11083
+ * @returns A promise that resolves to an array of {@link EmailMarketingTemplate} records.
11084
+ */
11085
+ listByWorkspace: async (workspaceId, options) => {
11086
+ return rb.execute(
11087
+ getAdminEmailMarketingTemplatesWorkspaceByWorkspaceId,
11088
+ {
11089
+ path: { workspace_id: workspaceId },
11090
+ ...buildPageQuery(options?.page, options?.pageSize)
11091
+ },
11092
+ options
11093
+ );
11094
+ },
11095
+ /**
11096
+ * Create a new email template.
11097
+ *
11098
+ * @param attributes - Template attributes including `name`.
11099
+ * @param options - Optional request-level overrides.
11100
+ * @returns A promise that resolves to the newly created {@link EmailMarketingTemplate}.
11101
+ */
11102
+ create: async (attributes, options) => {
11103
+ return rb.execute(
11104
+ postAdminEmailMarketingTemplates,
11105
+ { body: { data: { type: "email-marketing-template", attributes } } },
11106
+ options
11107
+ );
11108
+ },
11109
+ /**
11110
+ * Update an existing template's attributes (PATCH semantics).
11111
+ *
11112
+ * @param id - The unique identifier of the template to update.
11113
+ * @param attributes - Key/value map of attributes to change.
11114
+ * @param options - Optional request-level overrides.
11115
+ * @returns A promise that resolves to the updated {@link EmailMarketingTemplate}.
11116
+ */
11117
+ update: async (id, attributes, options) => {
11118
+ return rb.execute(
11119
+ patchAdminEmailMarketingTemplatesById,
11120
+ {
11121
+ path: { id },
11122
+ body: {
11123
+ data: { id, type: "email-marketing-template", attributes }
11124
+ }
11125
+ },
11126
+ options
11127
+ );
11128
+ },
11129
+ /**
11130
+ * Permanently delete a template.
11131
+ *
11132
+ * @param id - The unique identifier of the template to delete.
11133
+ * @param options - Optional request-level overrides.
11134
+ * @returns A promise that resolves to `true` on successful deletion.
11135
+ */
11136
+ delete: async (id, options) => {
11137
+ return rb.executeDelete(
11138
+ deleteAdminEmailMarketingTemplatesById,
11139
+ { path: { id } },
11140
+ options
11141
+ );
11142
+ },
11143
+ /**
11144
+ * Publish a template, creating an immutable version snapshot.
11145
+ *
11146
+ * @param id - The unique identifier of the template to publish.
11147
+ * @param options - Optional request-level overrides.
11148
+ * @returns A promise that resolves to the published {@link EmailMarketingTemplate}.
11149
+ */
11150
+ publish: async (id, options) => {
11151
+ return rb.execute(
11152
+ patchAdminEmailMarketingTemplatesByIdPublish,
11153
+ { path: { id }, body: {} },
11154
+ options
11155
+ );
11156
+ },
11157
+ /**
11158
+ * Unpublish a template, reverting it to draft state.
11159
+ *
11160
+ * @param id - The unique identifier of the template to unpublish.
11161
+ * @param options - Optional request-level overrides.
11162
+ * @returns A promise that resolves to the updated {@link EmailMarketingTemplate}.
11163
+ */
11164
+ unpublish: async (id, options) => {
11165
+ return rb.execute(
11166
+ patchAdminEmailMarketingTemplatesByIdUnpublish,
11167
+ { path: { id }, body: {} },
11168
+ options
11169
+ );
11170
+ },
11171
+ /**
11172
+ * Archive a template, removing it from active listings.
11173
+ *
11174
+ * @param id - The unique identifier of the template to archive.
11175
+ * @param options - Optional request-level overrides.
11176
+ * @returns A promise that resolves to the archived {@link EmailMarketingTemplate}.
11177
+ */
11178
+ archive: async (id, options) => {
11179
+ return rb.execute(
11180
+ patchAdminEmailMarketingTemplatesByIdArchive,
11181
+ { path: { id }, body: {} },
11182
+ options
11183
+ );
11184
+ },
11185
+ /**
11186
+ * Restore an archived template back to active state.
11187
+ *
11188
+ * @param id - The unique identifier of the template to restore.
11189
+ * @param options - Optional request-level overrides.
11190
+ * @returns A promise that resolves to the restored {@link EmailMarketingTemplate}.
11191
+ */
11192
+ restore: async (id, options) => {
11193
+ return rb.execute(
11194
+ patchAdminEmailMarketingTemplatesByIdRestore,
11195
+ { path: { id }, body: {} },
11196
+ options
11197
+ );
11198
+ },
11199
+ /**
11200
+ * Roll back a template's MJML source to a previous version.
11201
+ *
11202
+ * Does NOT auto-publish. Call `publish` after reviewing the restored content.
11203
+ *
11204
+ * @param id - The unique identifier of the template to roll back.
11205
+ * @param versionNumber - The version number to restore from.
11206
+ * @param options - Optional request-level overrides.
11207
+ * @returns A promise that resolves to the updated {@link EmailMarketingTemplate}.
11208
+ */
11209
+ rollback: async (id, versionNumber, options) => {
11210
+ return rb.execute(
11211
+ patchAdminEmailMarketingTemplatesByIdRollback,
11212
+ {
11213
+ path: { id },
11214
+ body: {
11215
+ data: {
11216
+ id,
11217
+ type: "email-marketing-template",
11218
+ attributes: { version_number: versionNumber }
11219
+ }
11220
+ }
11221
+ },
11222
+ options
11223
+ );
11224
+ },
11225
+ /**
11226
+ * Render a saved template with variable overrides for preview.
11227
+ *
11228
+ * @param id - The unique identifier of the template to preview.
11229
+ * @param variables - Key/value map of variable substitutions.
11230
+ * @param options - Optional request-level overrides.
11231
+ * @returns A promise that resolves to the preview result.
11232
+ */
11233
+ preview: async (id, variables, options) => {
11234
+ return rb.execute(
11235
+ patchAdminEmailMarketingTemplatesByIdPreview,
11236
+ {
11237
+ path: { id },
11238
+ body: {
11239
+ data: {
11240
+ id,
11241
+ type: "email-marketing-template",
11242
+ attributes: { variables }
11243
+ }
11244
+ }
11245
+ },
11246
+ options
11247
+ );
11248
+ },
11249
+ /**
11250
+ * Stateless MJML compilation. Does not save. Use for live preview in builder UI.
11251
+ *
11252
+ * @param mjml - Raw MJML source string to compile.
11253
+ * @param options - Optional request-level overrides.
11254
+ * @returns A promise resolving to the compilation result including HTML, variables, and errors.
11255
+ */
11256
+ compile: async (mjml, options) => {
11257
+ return rb.execute(
11258
+ postAdminEmailMarketingTemplatesCompile,
11259
+ {
11260
+ body: {
11261
+ data: {
11262
+ type: "campaign-template",
11263
+ body_mjml: mjml
11264
+ }
11265
+ }
11266
+ },
11267
+ options
11268
+ );
11269
+ },
11270
+ /**
11271
+ * List all version snapshots for a template, ordered by version_number descending.
11272
+ *
11273
+ * @param templateId - The ID of the template whose versions to list.
11274
+ * @param options - Optional request-level overrides.
11275
+ * @returns A promise resolving to an array of {@link EmailTemplateVersion} records.
11276
+ */
11277
+ versions: async (templateId, options) => {
11278
+ return rb.execute(
11279
+ getAdminEmailTemplateVersionsTemplateByTemplateId,
11280
+ { path: { template_id: templateId } },
11281
+ options
11282
+ );
11283
+ },
11284
+ /**
11285
+ * Fetch a specific template version by template ID and version number.
11286
+ *
11287
+ * @param templateId - The ID of the template.
11288
+ * @param versionNumber - The version number to fetch.
11289
+ * @param options - Optional request-level overrides.
11290
+ * @returns A promise resolving to the full {@link EmailTemplateVersion}.
11291
+ */
11292
+ getVersion: async (templateId, versionNumber, options) => {
11293
+ return rb.execute(
11294
+ getAdminEmailTemplateVersionsByTemplateIdVersionsByVersionNumber,
11295
+ {
11296
+ path: {
11297
+ template_id: templateId,
11298
+ version_number: versionNumber
11299
+ }
11300
+ },
11301
+ options
11302
+ );
11303
+ }
11304
+ },
11305
+ /**
11306
+ * Generated Emails -- AI-personalised email drafts awaiting human review.
11307
+ *
11308
+ * When a campaign uses AI personalisation, the platform generates an
11309
+ * individual email draft for each recipient. These drafts sit in a review
11310
+ * queue until a human approves or rejects them.
11311
+ */
11312
+ generatedEmails: {
11313
+ /**
11314
+ * Fetch a single AI-generated email draft by its unique ID.
11315
+ *
11316
+ * @param id - The unique identifier of the generated email to retrieve.
11317
+ * @param options - Optional request-level overrides.
11318
+ * @returns A promise that resolves to the matching {@link EmailMarketingGeneratedEmail}.
11319
+ */
11320
+ get: async (id, options) => {
11321
+ return rb.execute(
11322
+ getAdminEmailMarketingGeneratedEmailsById,
11323
+ { path: { id } },
11324
+ options
11325
+ );
11326
+ },
11327
+ /**
11328
+ * Update an AI-generated email draft before approval.
11329
+ *
11330
+ * @param id - The unique identifier of the generated email to update.
11331
+ * @param attributes - Key/value map of attributes to change (e.g. `subject`, `body`).
11332
+ * @param options - Optional request-level overrides.
11333
+ * @returns A promise that resolves to the updated {@link EmailMarketingGeneratedEmail}.
11334
+ */
11335
+ update: async (id, attributes, options) => {
11336
+ return rb.execute(
11337
+ patchAdminEmailMarketingGeneratedEmailsById,
11338
+ {
11339
+ path: { id },
11340
+ body: {
11341
+ data: { id, type: "email-marketing-generated-email", attributes }
11342
+ }
11343
+ },
11344
+ options
11345
+ );
11346
+ },
11347
+ /**
11348
+ * Approve a generated email draft and move it to the sending queue.
11349
+ *
11350
+ * @param id - The unique identifier of the generated email to approve.
11351
+ * @param options - Optional request-level overrides.
11352
+ * @returns A promise that resolves to the updated {@link EmailMarketingGeneratedEmail}.
11353
+ */
11354
+ approve: async (id, options) => {
11355
+ return rb.execute(
11356
+ patchAdminEmailMarketingGeneratedEmailsByIdApprove,
11357
+ { path: { id }, body: {} },
11358
+ options
11359
+ );
11360
+ },
11361
+ /**
11362
+ * Reject an AI-generated email draft. The email will not be sent.
11363
+ *
11364
+ * @param id - The unique identifier of the generated email to reject.
11365
+ * @param options - Optional request-level overrides.
11366
+ * @returns A promise that resolves to the updated {@link EmailMarketingGeneratedEmail}.
11367
+ */
11368
+ reject: async (id, options) => {
11369
+ return rb.execute(
11370
+ patchAdminEmailMarketingGeneratedEmailsByIdReject,
11371
+ { path: { id }, body: {} },
11372
+ options
11373
+ );
11374
+ },
11375
+ /**
11376
+ * Schedule a generated email for delivery at a specific time.
11377
+ *
11378
+ * @param id - The unique identifier of the generated email to schedule.
11379
+ * @param options - Optional request-level overrides.
11380
+ * @returns A promise that resolves to the updated {@link EmailMarketingGeneratedEmail}.
11381
+ */
11382
+ schedule: async (id, options) => {
11383
+ return rb.execute(
11384
+ patchAdminEmailMarketingGeneratedEmailsByIdSchedule,
11385
+ { path: { id }, body: {} },
11386
+ options
11387
+ );
11388
+ },
11389
+ /**
11390
+ * List all generated emails for a specific campaign.
11391
+ *
11392
+ * @param campaignId - The ID of the campaign whose generated emails to list.
11393
+ * @param options - Optional pagination controls and request-level overrides.
11394
+ * @returns A promise resolving to an array of {@link EmailMarketingGeneratedEmail}.
11395
+ */
11396
+ listByCampaign: async (campaignId, options) => {
11397
+ return rb.execute(
11398
+ getAdminEmailMarketingGeneratedEmailsCampaignByCampaignId,
11399
+ {
11400
+ path: { campaign_id: campaignId },
11401
+ ...buildPageQuery(options?.page, options?.pageSize)
11402
+ },
11403
+ options
11404
+ );
11405
+ }
11406
+ },
11407
+ /**
11408
+ * Sequences -- multi-step drip campaign automation.
11409
+ *
11410
+ * A sequence is a timed series of emails automatically sent to enrolled
11411
+ * contacts over days or weeks. Each step in the sequence has a delay and
11412
+ * references a template or inline content.
11413
+ */
11414
+ sequences: {
11415
+ /**
11416
+ * Fetch a single sequence by its unique ID.
11417
+ *
11418
+ * @param id - The unique identifier of the sequence to retrieve.
11419
+ * @param options - Optional request-level overrides.
11420
+ * @returns A promise that resolves to the matching {@link EmailMarketingSequence}.
11421
+ */
11422
+ get: async (id, options) => {
11423
+ return rb.execute(
11424
+ getAdminCampaignsSequencesById,
11425
+ { path: { id } },
11426
+ options
11427
+ );
11428
+ },
11429
+ /**
11430
+ * Create a new email sequence.
11431
+ *
11432
+ * @param attributes - Sequence attributes including `workspace_id` and `name`.
11433
+ * @param options - Optional request-level overrides.
11434
+ * @returns A promise that resolves to the newly created {@link EmailMarketingSequence}.
11435
+ */
11436
+ create: async (attributes, options) => {
11437
+ return rb.execute(
11438
+ postAdminCampaignsSequences,
11439
+ { body: { data: { type: "email-marketing-sequence", attributes } } },
11440
+ options
11441
+ );
11442
+ },
11443
+ /**
11444
+ * Update an existing sequence's attributes (PATCH semantics).
11445
+ *
11446
+ * @param id - The unique identifier of the sequence to update.
11447
+ * @param attributes - Key/value map of attributes to change.
11448
+ * @param options - Optional request-level overrides.
11449
+ * @returns A promise that resolves to the updated {@link EmailMarketingSequence}.
11450
+ */
11451
+ update: async (id, attributes, options) => {
11452
+ return rb.execute(
11453
+ patchAdminCampaignsSequencesById,
11454
+ {
11455
+ path: { id },
11456
+ body: {
11457
+ data: { id, type: "email-marketing-sequence", attributes }
11458
+ }
11459
+ },
11460
+ options
11461
+ );
11462
+ },
11463
+ /**
11464
+ * List all sequences for a workspace with optional pagination.
11465
+ *
11466
+ * @param workspaceId - The ID of the workspace whose sequences to list.
11467
+ * @param options - Optional pagination controls and request-level overrides.
11468
+ * @returns A promise that resolves to an array of {@link EmailMarketingSequence} records.
11469
+ */
11470
+ listByWorkspace: async (workspaceId, options) => {
11471
+ return rb.execute(
11472
+ getAdminCampaignsSequencesWorkspaceByWorkspaceId,
11473
+ {
11474
+ path: { workspace_id: workspaceId },
11475
+ ...buildPageQuery(options?.page, options?.pageSize)
11476
+ },
11477
+ options
11478
+ );
11479
+ },
11480
+ /**
11481
+ * Permanently delete a sequence.
11482
+ *
11483
+ * @param id - The unique identifier of the sequence to delete.
11484
+ * @param options - Optional request-level overrides.
11485
+ * @returns A promise that resolves to `true` on successful deletion.
11486
+ */
11487
+ delete: async (id, options) => {
11488
+ return rb.executeDelete(
11489
+ deleteAdminCampaignsSequencesById,
11490
+ { path: { id } },
11491
+ options
11492
+ );
11493
+ },
11494
+ /**
11495
+ * Activate a sequence to start delivering emails to enrolled contacts.
11496
+ *
11497
+ * @param id - The unique identifier of the sequence to activate.
11498
+ * @param options - Optional request-level overrides.
11499
+ * @returns A promise that resolves to the updated {@link EmailMarketingSequence}.
11500
+ */
11501
+ activate: async (id, options) => {
11502
+ return rb.execute(
11503
+ patchAdminCampaignsSequencesByIdActivate,
11504
+ { path: { id }, body: {} },
11505
+ options
11506
+ );
11507
+ },
11508
+ /**
11509
+ * Pause a running sequence, suspending all pending deliveries.
11510
+ *
11511
+ * @param id - The unique identifier of the sequence to pause.
11512
+ * @param options - Optional request-level overrides.
11513
+ * @returns A promise that resolves to the updated {@link EmailMarketingSequence}.
11514
+ */
11515
+ pause: async (id, options) => {
11516
+ return rb.execute(
11517
+ patchAdminCampaignsSequencesByIdPause,
11518
+ { path: { id }, body: {} },
11519
+ options
11520
+ );
11521
+ },
11522
+ /**
11523
+ * Mark a sequence as complete, finalizing all deliveries.
11524
+ *
11525
+ * @param id - The unique identifier of the sequence to complete.
11526
+ * @param options - Optional request-level overrides.
11527
+ * @returns A promise that resolves to the updated {@link EmailMarketingSequence}.
11528
+ */
11529
+ complete: async (id, options) => {
11530
+ return rb.execute(
11531
+ patchAdminCampaignsSequencesByIdComplete,
11532
+ { path: { id }, body: {} },
11533
+ options
11534
+ );
11535
+ },
11536
+ /**
11537
+ * Resume a paused sequence from where it left off.
11538
+ *
11539
+ * @param id - The unique identifier of the sequence to resume.
11540
+ * @param options - Optional request-level overrides.
11541
+ * @returns A promise that resolves to the updated {@link EmailMarketingSequence}.
11542
+ */
11543
+ resume: async (id, options) => {
11544
+ return rb.execute(
11545
+ patchAdminCampaignsSequencesByIdResume,
11546
+ { path: { id }, body: {} },
11547
+ options
11548
+ );
11549
+ }
11550
+ },
11551
+ /**
11552
+ * Recipients -- campaign audience members.
11553
+ *
11554
+ * Each recipient represents one email address on a campaign's send list,
11555
+ * with optional merge fields for personalisation.
11556
+ */
11557
+ recipients: {
11558
+ /**
11559
+ * Fetch a single recipient by its unique ID.
11560
+ *
11561
+ * @param id - The unique identifier of the recipient.
11562
+ * @param options - Optional request-level overrides.
11563
+ * @returns A promise resolving to the {@link EmailMarketingRecipient}.
11564
+ */
11565
+ get: async (id, options) => {
11566
+ return rb.execute(
11567
+ getAdminCampaignsRecipientsById,
11568
+ { path: { id } },
11569
+ options
11570
+ );
11571
+ },
11572
+ /**
11573
+ * List all recipients for a specific campaign.
11574
+ *
11575
+ * @param campaignId - The ID of the campaign whose recipients to list.
11576
+ * @param options - Optional pagination controls and request-level overrides.
11577
+ * @returns A promise resolving to an array of {@link EmailMarketingRecipient} records.
11578
+ */
11579
+ listByCampaign: async (campaignId, options) => {
11580
+ return rb.execute(
11581
+ getAdminCampaignsRecipientsCampaignByCampaignId,
11582
+ {
11583
+ path: { campaign_id: campaignId },
11584
+ ...buildPageQuery(options?.page, options?.pageSize)
11585
+ },
11586
+ options
11587
+ );
11588
+ }
11589
+ },
11590
+ /**
11591
+ * Sequence Steps -- individual steps within a drip sequence.
10189
11592
  *
10190
- * @example
10191
- * const admin = new GptAdmin({ apiKey: 'sk_srv_...' });
10192
- * const types = await admin.webhooks.listEventTypes();
10193
- * console.log(types.map(t => t.type));
11593
+ * Each step defines a timed email delivery within a sequence, with a
11594
+ * delay offset and template or inline content.
10194
11595
  */
10195
- listEventTypes: async (options) => {
10196
- return rb.rawGet("/webhook-event-types", options);
10197
- },
10198
- deliveries: {
11596
+ sequenceSteps: {
10199
11597
  /**
10200
- * Lists all webhook delivery records across all configurations.
10201
- *
10202
- * Each delivery record tracks the attempt count, status, payload, and
10203
- * response for a single event dispatch.
11598
+ * Fetch a single sequence step by its unique ID.
10204
11599
  *
10205
- * @param options - Optional request options.
10206
- * @returns Array of WebhookDelivery objects.
11600
+ * @param id - The unique identifier of the sequence step.
11601
+ * @param options - Optional request-level overrides.
11602
+ * @returns A promise resolving to the {@link EmailMarketingSequenceStep}.
10207
11603
  */
10208
- list: async (options) => {
11604
+ get: async (id, options) => {
10209
11605
  return rb.execute(
10210
- getAdminWebhookDeliveries,
10211
- {},
11606
+ getAdminCampaignsSequenceStepsById,
11607
+ { path: { id } },
10212
11608
  options
10213
11609
  );
10214
11610
  },
10215
11611
  /**
10216
- * Fetches a single delivery record by ID.
11612
+ * Create a new step within a sequence.
10217
11613
  *
10218
- * @param id - WebhookDelivery ID.
10219
- * @param options - Optional request options.
10220
- * @returns The WebhookDelivery.
11614
+ * @param attributes - Step attributes including `sequence_id`.
11615
+ * @param options - Optional request-level overrides.
11616
+ * @returns A promise resolving to the newly created {@link EmailMarketingSequenceStep}.
10221
11617
  */
10222
- get: async (id, options) => {
11618
+ create: async (attributes, options) => {
10223
11619
  return rb.execute(
10224
- getAdminWebhookDeliveriesById,
10225
- { path: { id } },
11620
+ postAdminCampaignsSequenceSteps,
11621
+ {
11622
+ body: {
11623
+ data: {
11624
+ type: "email-marketing-sequence-step",
11625
+ attributes
11626
+ }
11627
+ }
11628
+ },
10226
11629
  options
10227
11630
  );
10228
11631
  },
10229
11632
  /**
10230
- * Re-enqueues a failed or pending delivery for immediate re-dispatch.
10231
- *
10232
- * Sets the delivery status to `retrying` and inserts a new WebhookSender
10233
- * Oban job. Use this to recover from transient endpoint failures without
10234
- * waiting for the automatic retry schedule.
11633
+ * Update an existing sequence step's attributes (PATCH semantics).
10235
11634
  *
10236
- * @param id - WebhookDelivery ID.
10237
- * @param options - Optional request options.
10238
- * @returns Updated WebhookDelivery with status `retrying`.
11635
+ * @param id - The unique identifier of the sequence step to update.
11636
+ * @param attributes - Key/value map of attributes to change.
11637
+ * @param options - Optional request-level overrides.
11638
+ * @returns A promise resolving to the updated {@link EmailMarketingSequenceStep}.
10239
11639
  */
10240
- retry: async (id, options) => {
11640
+ update: async (id, attributes, options) => {
10241
11641
  return rb.execute(
10242
- postAdminWebhookDeliveriesByIdRetry,
10243
- { path: { id }, body: {} },
11642
+ patchAdminCampaignsSequenceStepsById,
11643
+ {
11644
+ path: { id },
11645
+ body: {
11646
+ data: {
11647
+ id,
11648
+ type: "email-marketing-sequence-step",
11649
+ attributes
11650
+ }
11651
+ }
11652
+ },
10244
11653
  options
10245
11654
  );
10246
11655
  },
10247
11656
  /**
10248
- * Sets multiple delivery records to `retrying` status in bulk.
11657
+ * Permanently delete a sequence step.
10249
11658
  *
10250
- * Authorization is actor-scoped only deliveries the actor can update
10251
- * are affected. Use this to recover from endpoint outages without
10252
- * retrying each delivery individually.
11659
+ * @param id - The unique identifier of the sequence step to delete.
11660
+ * @param options - Optional request-level overrides.
11661
+ * @returns A promise that resolves to `true` on successful deletion.
11662
+ */
11663
+ delete: async (id, options) => {
11664
+ return rb.executeDelete(
11665
+ deleteAdminCampaignsSequenceStepsById,
11666
+ { path: { id } },
11667
+ options
11668
+ );
11669
+ },
11670
+ /**
11671
+ * List all steps in a specific sequence.
10253
11672
  *
10254
- * @param ids - Array of WebhookDelivery IDs to retry.
10255
- * @param options - Optional request options.
10256
- * @returns An object with `success: true` and the count of queued retries.
11673
+ * @param sequenceId - The ID of the sequence whose steps to list.
11674
+ * @param options - Optional pagination controls and request-level overrides.
11675
+ * @returns A promise resolving to an array of {@link EmailMarketingSequenceStep} records.
10257
11676
  */
10258
- bulkRetry: async (ids, options) => {
11677
+ listBySequence: async (sequenceId, options) => {
10259
11678
  return rb.execute(
10260
- postAdminWebhookDeliveriesBulkRetry,
10261
- { body: { data: { ids } } },
11679
+ getAdminCampaignsSequenceStepsSequenceBySequenceId,
11680
+ {
11681
+ path: { sequence_id: sequenceId },
11682
+ ...buildPageQuery(options?.page, options?.pageSize)
11683
+ },
10262
11684
  options
10263
11685
  );
10264
11686
  }
@@ -10266,119 +11688,6 @@ function createWebhooksNamespace(rb) {
10266
11688
  };
10267
11689
  }
10268
11690
 
10269
- // src/namespaces/campaigns.ts
10270
- function createCampaignsNamespace(rb) {
10271
- return {
10272
- /**
10273
- * Get a campaign by ID.
10274
- *
10275
- * @param id - The unique identifier of the campaign.
10276
- * @param options - Optional request-level overrides.
10277
- * @returns A promise resolving to the {@link Campaign}.
10278
- *
10279
- * @example
10280
- * ```typescript
10281
- * const admin = new GptAdmin({ apiKey: 'sk_srv_...' });
10282
- * const campaign = await admin.campaigns.get('camp_abc123');
10283
- * ```
10284
- */
10285
- get: async (id, options) => {
10286
- return rb.execute(
10287
- getAdminEmailMarketingCampaignsById,
10288
- { path: { id } },
10289
- options
10290
- );
10291
- },
10292
- /**
10293
- * List all campaigns for a workspace.
10294
- *
10295
- * @param workspaceId - The ID of the workspace to query.
10296
- * @param options - Optional pagination and request options.
10297
- * @returns A promise resolving to an array of {@link Campaign} records.
10298
- *
10299
- * @example
10300
- * ```typescript
10301
- * const admin = new GptAdmin({ apiKey: 'sk_srv_...' });
10302
- * const campaigns = await admin.campaigns.listByWorkspace('ws_abc123');
10303
- * ```
10304
- */
10305
- listByWorkspace: async (workspaceId, options) => {
10306
- return rb.execute(
10307
- getAdminEmailMarketingCampaignsWorkspaceByWorkspaceId,
10308
- {
10309
- path: { workspace_id: workspaceId },
10310
- ...buildPageQuery(options?.page, options?.pageSize)
10311
- },
10312
- options
10313
- );
10314
- },
10315
- /**
10316
- * Create a new campaign.
10317
- *
10318
- * @param attributes - Campaign attributes including `workspace_id`, `name`, `template_id`.
10319
- * @param options - Optional request-level overrides.
10320
- * @returns A promise resolving to the newly created {@link Campaign}.
10321
- *
10322
- * @example
10323
- * ```typescript
10324
- * const admin = new GptAdmin({ apiKey: 'sk_srv_...' });
10325
- * const campaign = await admin.campaigns.create({
10326
- * workspace_id: 'ws_abc123',
10327
- * name: 'Q1 Outreach',
10328
- * template_id: 'tmpl_xyz',
10329
- * });
10330
- * ```
10331
- */
10332
- create: async (attributes, options) => {
10333
- return rb.execute(
10334
- postAdminEmailMarketingCampaigns,
10335
- { body: { data: { type: "campaign", attributes } } },
10336
- options
10337
- );
10338
- },
10339
- /**
10340
- * Trigger sending for an approved campaign.
10341
- *
10342
- * @param id - The ID of the campaign to send.
10343
- * @param options - Optional request-level overrides.
10344
- * @returns A promise resolving to the updated {@link Campaign}.
10345
- *
10346
- * @example
10347
- * ```typescript
10348
- * const admin = new GptAdmin({ apiKey: 'sk_srv_...' });
10349
- * await admin.campaigns.send('camp_abc123');
10350
- * ```
10351
- */
10352
- send: async (id, options) => {
10353
- return rb.execute(
10354
- postAdminEmailMarketingCampaignsByIdSend,
10355
- { path: { id }, body: {} },
10356
- options
10357
- );
10358
- },
10359
- /**
10360
- * Delete a campaign.
10361
- *
10362
- * @param id - The unique identifier of the campaign to delete.
10363
- * @param options - Optional request-level overrides.
10364
- * @returns A promise that resolves to `true` on successful deletion.
10365
- *
10366
- * @example
10367
- * ```typescript
10368
- * const admin = new GptAdmin({ apiKey: 'sk_srv_...' });
10369
- * await admin.campaigns.delete('camp_abc123');
10370
- * ```
10371
- */
10372
- delete: async (id, options) => {
10373
- return rb.executeDelete(
10374
- deleteAdminEmailMarketingCampaignsById,
10375
- { path: { id } },
10376
- options
10377
- );
10378
- }
10379
- };
10380
- }
10381
-
10382
11691
  // src/namespaces/email.ts
10383
11692
  function createEmailNamespace(rb) {
10384
11693
  return {
@@ -10450,7 +11759,7 @@ function createEmailNamespace(rb) {
10450
11759
  create: async (attributes, options) => {
10451
11760
  return rb.execute(
10452
11761
  postAdminEmailOutboundEmails,
10453
- { body: { data: { type: "email_outbound_email", attributes } } },
11762
+ { body: { data: { type: "email-outbound-email", attributes } } },
10454
11763
  options
10455
11764
  );
10456
11765
  },
@@ -10542,7 +11851,11 @@ function createEmailNamespace(rb) {
10542
11851
  create: async (attributes, options) => {
10543
11852
  return rb.execute(
10544
11853
  postAdminEmailMarketingSenderProfiles,
10545
- { body: { data: { type: "email_sender_profile", attributes } } },
11854
+ {
11855
+ body: {
11856
+ data: { type: "email-marketing-sender-profile", attributes }
11857
+ }
11858
+ },
10546
11859
  options
10547
11860
  );
10548
11861
  },
@@ -10567,7 +11880,9 @@ function createEmailNamespace(rb) {
10567
11880
  patchAdminEmailMarketingSenderProfilesById,
10568
11881
  {
10569
11882
  path: { id },
10570
- body: { data: { id, type: "email_sender_profile", attributes } }
11883
+ body: {
11884
+ data: { id, type: "email-marketing-sender-profile", attributes }
11885
+ }
10571
11886
  },
10572
11887
  options
10573
11888
  );
@@ -10735,7 +12050,7 @@ function createBillingNamespace(rb) {
10735
12050
  body: {
10736
12051
  data: {
10737
12052
  id: walletId,
10738
- type: "wallet",
12053
+ type: "wallet-public",
10739
12054
  attributes: { plan_slug: planSlug }
10740
12055
  }
10741
12056
  }
@@ -10772,7 +12087,7 @@ function createBillingNamespace(rb) {
10772
12087
  body: {
10773
12088
  data: {
10774
12089
  id: walletId,
10775
- type: "wallet",
12090
+ type: "wallet-public",
10776
12091
  attributes
10777
12092
  }
10778
12093
  }
@@ -10893,7 +12208,7 @@ function createBillingNamespace(rb) {
10893
12208
  create: async (attrs, options) => {
10894
12209
  return rb.execute(
10895
12210
  postAdminPricingStrategies,
10896
- { body: { data: { type: "pricing_strategy", attributes: attrs } } },
12211
+ { body: { data: { type: "pricing-strategy", attributes: attrs } } },
10897
12212
  options
10898
12213
  );
10899
12214
  },
@@ -10908,7 +12223,7 @@ function createBillingNamespace(rb) {
10908
12223
  patchAdminPricingStrategiesById,
10909
12224
  {
10910
12225
  path: { id },
10911
- body: { data: { id, type: "pricing_strategy", attributes: attrs } }
12226
+ body: { data: { id, type: "pricing-strategy", attributes: attrs } }
10912
12227
  },
10913
12228
  options
10914
12229
  );
@@ -10951,7 +12266,7 @@ function createBillingNamespace(rb) {
10951
12266
  postAdminTenantPricingOverrides,
10952
12267
  {
10953
12268
  body: {
10954
- data: { type: "tenant_pricing_override", attributes: attrs }
12269
+ data: { type: "tenant-pricing-override", attributes: attrs }
10955
12270
  }
10956
12271
  },
10957
12272
  options
@@ -10969,7 +12284,7 @@ function createBillingNamespace(rb) {
10969
12284
  {
10970
12285
  path: { id },
10971
12286
  body: {
10972
- data: { id, type: "tenant_pricing_override", attributes: attrs }
12287
+ data: { id, type: "tenant-pricing-override", attributes: attrs }
10973
12288
  }
10974
12289
  },
10975
12290
  options
@@ -11025,7 +12340,7 @@ function createBillingNamespace(rb) {
11025
12340
  return rb.execute(
11026
12341
  postAdminWholesaleAgreements,
11027
12342
  {
11028
- body: { data: { type: "wholesale_agreement", attributes: attrs } }
12343
+ body: { data: { type: "wholesale-agreement", attributes: attrs } }
11029
12344
  },
11030
12345
  options
11031
12346
  );
@@ -11042,7 +12357,7 @@ function createBillingNamespace(rb) {
11042
12357
  {
11043
12358
  path: { id },
11044
12359
  body: {
11045
- data: { id, type: "wholesale_agreement", attributes: attrs }
12360
+ data: { id, type: "wholesale-agreement", attributes: attrs }
11046
12361
  }
11047
12362
  },
11048
12363
  options
@@ -11177,7 +12492,7 @@ function createBillingNamespace(rb) {
11177
12492
  postAdminFeatureDefinitions,
11178
12493
  {
11179
12494
  body: {
11180
- data: { type: "feature_definition", attributes: attrs }
12495
+ data: { type: "feature-definition", attributes: attrs }
11181
12496
  }
11182
12497
  },
11183
12498
  options
@@ -11190,7 +12505,7 @@ function createBillingNamespace(rb) {
11190
12505
  {
11191
12506
  path: { id },
11192
12507
  body: {
11193
- data: { id, type: "feature_definition", attributes: attrs }
12508
+ data: { id, type: "feature-definition", attributes: attrs }
11194
12509
  }
11195
12510
  },
11196
12511
  options
@@ -11290,7 +12605,7 @@ function createBillingNamespace(rb) {
11290
12605
  list: async (options) => {
11291
12606
  const result = await rb.execute(
11292
12607
  getAdminFeatureUsages,
11293
- {},
12608
+ buildPageQuery(options?.page, options?.pageSize),
11294
12609
  options
11295
12610
  );
11296
12611
  return result.data ?? result;
@@ -11307,7 +12622,10 @@ function createBillingNamespace(rb) {
11307
12622
  listByTenant: async (tenantId, options) => {
11308
12623
  const result = await rb.execute(
11309
12624
  getAdminFeatureUsagesByTenantByTenantId,
11310
- { path: { tenant_id: tenantId } },
12625
+ {
12626
+ path: { tenant_id: tenantId },
12627
+ ...buildPageQuery(options?.page, options?.pageSize)
12628
+ },
11311
12629
  options
11312
12630
  );
11313
12631
  return result.data ?? result;
@@ -11335,7 +12653,11 @@ function createBillingNamespace(rb) {
11335
12653
  * @returns A promise resolving to an array of {@link UsageEvent} objects.
11336
12654
  */
11337
12655
  list: async (tenantId, filters, options) => {
11338
- const query = { tenant_id: tenantId };
12656
+ const pageQuery = buildPageQuery(filters?.page, filters?.pageSize);
12657
+ const query = {
12658
+ tenant_id: tenantId,
12659
+ ...pageQuery.query
12660
+ };
11339
12661
  if (filters?.startDate) query.start_date = filters.startDate;
11340
12662
  if (filters?.endDate) query.end_date = filters.endDate;
11341
12663
  const result = await rb.execute(
@@ -11372,9 +12694,11 @@ function createBillingNamespace(rb) {
11372
12694
  * @returns A promise resolving to an array of {@link UsageEvent} objects.
11373
12695
  */
11374
12696
  listByUser: async (tenantId, userId, filters, options) => {
12697
+ const pageQuery = buildPageQuery(filters?.page, filters?.pageSize);
11375
12698
  const query = {
11376
12699
  tenant_id: tenantId,
11377
- user_id: userId
12700
+ user_id: userId,
12701
+ ...pageQuery.query
11378
12702
  };
11379
12703
  if (filters?.startDate) query.start_date = filters.startDate;
11380
12704
  if (filters?.endDate) query.end_date = filters.endDate;
@@ -11398,7 +12722,11 @@ function createBillingNamespace(rb) {
11398
12722
  * @returns A promise resolving to an array of {@link UsageEvent} objects.
11399
12723
  */
11400
12724
  summary: async (tenantId, filters, options) => {
11401
- const query = { tenant_id: tenantId };
12725
+ const pageQuery = buildPageQuery(filters?.page, filters?.pageSize);
12726
+ const query = {
12727
+ tenant_id: tenantId,
12728
+ ...pageQuery.query
12729
+ };
11402
12730
  if (filters?.startDate) query.start_date = filters.startDate;
11403
12731
  if (filters?.endDate) query.end_date = filters.endDate;
11404
12732
  const result = await rb.execute(
@@ -11678,7 +13006,7 @@ function createSocialNamespace(rb) {
11678
13006
  postAdminSocialAccounts,
11679
13007
  {
11680
13008
  body: {
11681
- data: { type: "social_account", attributes }
13009
+ data: { type: "social-account", attributes }
11682
13010
  }
11683
13011
  },
11684
13012
  options
@@ -11691,7 +13019,7 @@ function createSocialNamespace(rb) {
11691
13019
  {
11692
13020
  path: { id },
11693
13021
  body: {
11694
- data: { type: "social_account", id, attributes }
13022
+ data: { type: "social-account", id, attributes }
11695
13023
  }
11696
13024
  },
11697
13025
  options
@@ -11712,7 +13040,7 @@ function createSocialNamespace(rb) {
11712
13040
  {
11713
13041
  path: { id },
11714
13042
  body: {
11715
- data: { type: "social_account", id, attributes: {} }
13043
+ data: { type: "social-account", id, attributes: {} }
11716
13044
  }
11717
13045
  },
11718
13046
  options
@@ -11725,7 +13053,7 @@ function createSocialNamespace(rb) {
11725
13053
  {
11726
13054
  path: { id },
11727
13055
  body: {
11728
- data: { type: "social_account", id, attributes: {} }
13056
+ data: { type: "social-account", id, attributes: {} }
11729
13057
  }
11730
13058
  },
11731
13059
  options
@@ -11738,7 +13066,7 @@ function createSocialNamespace(rb) {
11738
13066
  {
11739
13067
  path: { id },
11740
13068
  body: {
11741
- data: { type: "social_account", id, attributes: {} }
13069
+ data: { type: "social-account", id, attributes: {} }
11742
13070
  }
11743
13071
  },
11744
13072
  options
@@ -11753,7 +13081,7 @@ function createSocialNamespace(rb) {
11753
13081
  postAdminSocialPosts,
11754
13082
  {
11755
13083
  body: {
11756
- data: { type: "social_post", attributes }
13084
+ data: { type: "social-post", attributes }
11757
13085
  }
11758
13086
  },
11759
13087
  options
@@ -11770,7 +13098,7 @@ function createSocialNamespace(rb) {
11770
13098
  {
11771
13099
  path: { id },
11772
13100
  body: {
11773
- data: { type: "social_post", id, attributes }
13101
+ data: { type: "social-post", id, attributes }
11774
13102
  }
11775
13103
  },
11776
13104
  options
@@ -11792,7 +13120,7 @@ function createSocialNamespace(rb) {
11792
13120
  path: { id },
11793
13121
  body: {
11794
13122
  data: {
11795
- type: "social_post",
13123
+ type: "social-post",
11796
13124
  id,
11797
13125
  attributes: { scheduled_at: scheduledAt }
11798
13126
  }
@@ -11808,7 +13136,7 @@ function createSocialNamespace(rb) {
11808
13136
  {
11809
13137
  path: { id },
11810
13138
  body: {
11811
- data: { type: "social_post", id, attributes: {} }
13139
+ data: { type: "social-post", id, attributes: {} }
11812
13140
  }
11813
13141
  },
11814
13142
  options
@@ -11821,7 +13149,7 @@ function createSocialNamespace(rb) {
11821
13149
  {
11822
13150
  path: { id },
11823
13151
  body: {
11824
- data: { type: "social_post", id, attributes: {} }
13152
+ data: { type: "social-post", id, attributes: {} }
11825
13153
  }
11826
13154
  },
11827
13155
  options
@@ -11834,7 +13162,7 @@ function createSocialNamespace(rb) {
11834
13162
  {
11835
13163
  path: { id },
11836
13164
  body: {
11837
- data: { type: "social_post", id, attributes: {} }
13165
+ data: { type: "social-post", id, attributes: {} }
11838
13166
  }
11839
13167
  },
11840
13168
  options
@@ -11847,7 +13175,7 @@ function createSocialNamespace(rb) {
11847
13175
  {
11848
13176
  path: { id },
11849
13177
  body: {
11850
- data: { type: "social_post", id, attributes }
13178
+ data: { type: "social-post", id, attributes }
11851
13179
  }
11852
13180
  },
11853
13181
  options
@@ -11941,7 +13269,7 @@ function createSocialNamespace(rb) {
11941
13269
  postAdminSocialCampaigns,
11942
13270
  {
11943
13271
  body: {
11944
- data: { type: "social_campaign", attributes }
13272
+ data: { type: "social-campaign", attributes }
11945
13273
  }
11946
13274
  },
11947
13275
  options
@@ -11954,7 +13282,7 @@ function createSocialNamespace(rb) {
11954
13282
  {
11955
13283
  path: { id },
11956
13284
  body: {
11957
- data: { type: "social_campaign", id, attributes }
13285
+ data: { type: "social-campaign", id, attributes }
11958
13286
  }
11959
13287
  },
11960
13288
  options
@@ -11976,7 +13304,7 @@ function createSocialNamespace(rb) {
11976
13304
  path: { id },
11977
13305
  body: {
11978
13306
  data: {
11979
- type: "social_campaign",
13307
+ type: "social-campaign",
11980
13308
  id,
11981
13309
  attributes: { scheduled_at: scheduledAt }
11982
13310
  }
@@ -11992,7 +13320,7 @@ function createSocialNamespace(rb) {
11992
13320
  {
11993
13321
  path: { id },
11994
13322
  body: {
11995
- data: { type: "social_campaign", id, attributes: {} }
13323
+ data: { type: "social-campaign", id, attributes: {} }
11996
13324
  }
11997
13325
  },
11998
13326
  options
@@ -12006,8 +13334,11 @@ function createSocialNamespace(rb) {
12006
13334
  path: { id },
12007
13335
  body: {
12008
13336
  data: {
12009
- campaign_id: id,
12010
- workspace_id: workspaceId
13337
+ type: "social-campaign",
13338
+ attributes: {
13339
+ campaign_id: id,
13340
+ workspace_id: workspaceId
13341
+ }
12011
13342
  }
12012
13343
  }
12013
13344
  },
@@ -12022,9 +13353,12 @@ function createSocialNamespace(rb) {
12022
13353
  path: { id },
12023
13354
  body: {
12024
13355
  data: {
12025
- campaign_id: id,
12026
- workspace_id: workspaceId,
12027
- social_account_id: socialAccountId
13356
+ type: "social-campaign",
13357
+ attributes: {
13358
+ campaign_id: id,
13359
+ workspace_id: workspaceId,
13360
+ social_account_id: socialAccountId
13361
+ }
12028
13362
  }
12029
13363
  }
12030
13364
  },
@@ -12263,7 +13597,7 @@ function createConnectorsNamespace(rb) {
12263
13597
  /** Create a connector instance. */
12264
13598
  create: async (attributes, options) => rb.execute(
12265
13599
  postAdminConnectors,
12266
- { body: { data: { type: "connector_instance", attributes } } },
13600
+ { body: { data: { type: "connector-instance", attributes } } },
12267
13601
  options
12268
13602
  ),
12269
13603
  /** Update a connector instance. */
@@ -12271,7 +13605,7 @@ function createConnectorsNamespace(rb) {
12271
13605
  patchAdminConnectorsById,
12272
13606
  {
12273
13607
  path: { id },
12274
- body: { data: { type: "connector_instance", id, attributes } }
13608
+ body: { data: { type: "connector-instance", id, attributes } }
12275
13609
  },
12276
13610
  options
12277
13611
  ),
@@ -12311,7 +13645,7 @@ function createConnectorsNamespace(rb) {
12311
13645
  {
12312
13646
  body: {
12313
13647
  data: {
12314
- type: "connector_instance",
13648
+ type: "connector-instance",
12315
13649
  connector_type: connectorType,
12316
13650
  workspace_id: workspaceId
12317
13651
  }
@@ -12325,7 +13659,7 @@ function createConnectorsNamespace(rb) {
12325
13659
  {
12326
13660
  body: {
12327
13661
  data: {
12328
- type: "connector_instance",
13662
+ type: "connector-instance",
12329
13663
  connector_type: connectorType,
12330
13664
  code,
12331
13665
  state,
@@ -12357,7 +13691,7 @@ function createConnectorsNamespace(rb) {
12357
13691
  create: async (attributes, options) => rb.execute(
12358
13692
  postAdminConnectorsOauthAppConfigs,
12359
13693
  {
12360
- body: { data: { type: "oauth_app_config", attributes } }
13694
+ body: { data: { type: "oauth-app-config", attributes } }
12361
13695
  },
12362
13696
  options
12363
13697
  ),
@@ -12366,7 +13700,7 @@ function createConnectorsNamespace(rb) {
12366
13700
  patchAdminConnectorsOauthAppConfigsById,
12367
13701
  {
12368
13702
  path: { id },
12369
- body: { data: { type: "oauth_app_config", id, attributes } }
13703
+ body: { data: { type: "oauth-app-config", id, attributes } }
12370
13704
  },
12371
13705
  options
12372
13706
  ),
@@ -12460,7 +13794,7 @@ function createCrawlerNamespace(rb) {
12460
13794
  create: async (attributes, options) => {
12461
13795
  return rb.execute(
12462
13796
  postAdminCrawlerJobs,
12463
- { body: { data: { type: "crawler_crawl_job", attributes } } },
13797
+ { body: { data: { type: "crawler-job", attributes } } },
12464
13798
  options
12465
13799
  );
12466
13800
  },
@@ -12505,7 +13839,7 @@ function createCrawlerNamespace(rb) {
12505
13839
  postAdminCrawlerSchedules,
12506
13840
  {
12507
13841
  body: {
12508
- data: { type: "crawler_crawl_schedule", attributes }
13842
+ data: { type: "crawler-schedule", attributes }
12509
13843
  }
12510
13844
  },
12511
13845
  options
@@ -12518,7 +13852,7 @@ function createCrawlerNamespace(rb) {
12518
13852
  {
12519
13853
  path: { id },
12520
13854
  body: {
12521
- data: { id, type: "crawler_crawl_schedule", attributes }
13855
+ data: { id, type: "crawler-schedule", attributes }
12522
13856
  }
12523
13857
  },
12524
13858
  options
@@ -12596,7 +13930,7 @@ function createCrawlerNamespace(rb) {
12596
13930
  postAdminCrawlerSiteConfigs,
12597
13931
  {
12598
13932
  body: {
12599
- data: { type: "crawler_site_config", attributes }
13933
+ data: { type: "crawler-site-config", attributes }
12600
13934
  }
12601
13935
  },
12602
13936
  options
@@ -12609,7 +13943,7 @@ function createCrawlerNamespace(rb) {
12609
13943
  {
12610
13944
  path: { id },
12611
13945
  body: {
12612
- data: { id, type: "crawler_site_config", attributes }
13946
+ data: { id, type: "crawler-site-config", attributes }
12613
13947
  }
12614
13948
  },
12615
13949
  options
@@ -12679,7 +14013,7 @@ function createExtractionNamespace(rb) {
12679
14013
  {
12680
14014
  path: { id },
12681
14015
  body: {
12682
- data: { id, type: "extraction_document", attributes }
14016
+ data: { id, type: "extraction-document", attributes }
12683
14017
  }
12684
14018
  },
12685
14019
  options
@@ -12740,7 +14074,7 @@ function createExtractionNamespace(rb) {
12740
14074
  {
12741
14075
  path: { id },
12742
14076
  body: {
12743
- data: { id, type: "extraction_document", attributes }
14077
+ data: { id, type: "extraction-document", attributes }
12744
14078
  }
12745
14079
  },
12746
14080
  options
@@ -12776,7 +14110,7 @@ function createExtractionNamespace(rb) {
12776
14110
  postAdminExtractionDocumentsBeginUpload,
12777
14111
  {
12778
14112
  body: {
12779
- data: { type: "presigned_url", attributes }
14113
+ data: { type: "presigned-url", attributes }
12780
14114
  }
12781
14115
  },
12782
14116
  options
@@ -12788,7 +14122,7 @@ function createExtractionNamespace(rb) {
12788
14122
  postAdminExtractionDocumentsFindOrBeginUpload,
12789
14123
  {
12790
14124
  body: {
12791
- data: { type: "presigned_url", attributes }
14125
+ data: { type: "presigned-url", attributes }
12792
14126
  }
12793
14127
  },
12794
14128
  options
@@ -12800,7 +14134,7 @@ function createExtractionNamespace(rb) {
12800
14134
  postAdminExtractionDocumentsUpload,
12801
14135
  {
12802
14136
  body: {
12803
- data: { type: "extraction_document", attributes }
14137
+ data: { type: "extraction-document", attributes }
12804
14138
  }
12805
14139
  },
12806
14140
  options
@@ -12813,7 +14147,7 @@ function createExtractionNamespace(rb) {
12813
14147
  {
12814
14148
  body: {
12815
14149
  data: {
12816
- type: "bulk_reprocess_result",
14150
+ type: "bulk-reprocess-result",
12817
14151
  attributes: { ids }
12818
14152
  }
12819
14153
  }
@@ -12827,7 +14161,7 @@ function createExtractionNamespace(rb) {
12827
14161
  postAdminDocumentsBulkDelete,
12828
14162
  {
12829
14163
  body: {
12830
- data: { type: "bulk_delete", attributes: { ids } }
14164
+ data: { type: "bulk-delete", attributes: { ids } }
12831
14165
  }
12832
14166
  },
12833
14167
  options
@@ -12922,7 +14256,7 @@ function createExtractionNamespace(rb) {
12922
14256
  {
12923
14257
  path: { id },
12924
14258
  body: {
12925
- data: { id, type: "extraction_result", attributes }
14259
+ data: { id, type: "extraction-result", attributes }
12926
14260
  }
12927
14261
  },
12928
14262
  options
@@ -12967,7 +14301,7 @@ function createExtractionNamespace(rb) {
12967
14301
  {
12968
14302
  path: { id },
12969
14303
  body: {
12970
- data: { id, type: "extraction_result", attributes }
14304
+ data: { id, type: "extraction-result", attributes }
12971
14305
  }
12972
14306
  },
12973
14307
  options
@@ -12980,7 +14314,7 @@ function createExtractionNamespace(rb) {
12980
14314
  {
12981
14315
  path: { id },
12982
14316
  body: {
12983
- data: { id, type: "extraction_result", attributes }
14317
+ data: { id, type: "extraction-result", attributes }
12984
14318
  }
12985
14319
  },
12986
14320
  options
@@ -13019,7 +14353,7 @@ function createExtractionNamespace(rb) {
13019
14353
  postAdminExtractionBatches,
13020
14354
  {
13021
14355
  body: {
13022
- data: { type: "extraction_batch", attributes }
14356
+ data: { type: "extraction-batch", attributes }
13023
14357
  }
13024
14358
  },
13025
14359
  options
@@ -13059,7 +14393,7 @@ function createExtractionNamespace(rb) {
13059
14393
  {
13060
14394
  path: { workspace_id: workspaceId },
13061
14395
  body: {
13062
- data: { type: "extraction_export", attributes }
14396
+ data: { type: "extraction-export", attributes }
13063
14397
  }
13064
14398
  },
13065
14399
  options
@@ -13090,7 +14424,7 @@ function createExtractionNamespace(rb) {
13090
14424
  postAdminExtractionWorkflows,
13091
14425
  {
13092
14426
  body: {
13093
- data: { type: "extraction_workflow", attributes }
14427
+ data: { type: "extraction-workflow", attributes }
13094
14428
  }
13095
14429
  },
13096
14430
  options
@@ -13111,7 +14445,7 @@ function createExtractionNamespace(rb) {
13111
14445
  {
13112
14446
  path: { id },
13113
14447
  body: {
13114
- data: { id, type: "extraction_workflow", attributes }
14448
+ data: { id, type: "extraction-workflow", attributes }
13115
14449
  }
13116
14450
  },
13117
14451
  options
@@ -13142,7 +14476,7 @@ function createExtractionNamespace(rb) {
13142
14476
  postAdminExtractionConfigEnums,
13143
14477
  {
13144
14478
  body: {
13145
- data: { type: "config_enum", attributes }
14479
+ data: { type: "config-enum", attributes }
13146
14480
  }
13147
14481
  },
13148
14482
  options
@@ -13163,7 +14497,7 @@ function createExtractionNamespace(rb) {
13163
14497
  {
13164
14498
  path: { id },
13165
14499
  body: {
13166
- data: { id, type: "config_enum", attributes }
14500
+ data: { id, type: "config-enum", attributes }
13167
14501
  }
13168
14502
  },
13169
14503
  options
@@ -13178,7 +14512,7 @@ function createExtractionNamespace(rb) {
13178
14512
  postAdminExtractionSchemaDiscoveries,
13179
14513
  {
13180
14514
  body: {
13181
- data: { type: "schema_discovery", attributes }
14515
+ data: { type: "schema-discovery", attributes }
13182
14516
  }
13183
14517
  },
13184
14518
  options
@@ -13198,7 +14532,7 @@ function createExtractionNamespace(rb) {
13198
14532
  postAdminExtractionSchemaDiscoveriesBootstrap,
13199
14533
  {
13200
14534
  body: {
13201
- data: { type: "schema_discovery", attributes }
14535
+ data: { type: "schema-discovery", attributes }
13202
14536
  }
13203
14537
  },
13204
14538
  options
@@ -13222,7 +14556,7 @@ function createExtractionNamespace(rb) {
13222
14556
  {
13223
14557
  path: { workspace_id: workspaceId, document_id: documentId },
13224
14558
  body: {
13225
- data: { type: "field_mapping_result", attributes }
14559
+ data: { type: "field-mapping-result", attributes }
13226
14560
  }
13227
14561
  },
13228
14562
  options
@@ -13253,7 +14587,7 @@ function createExtractionNamespace(rb) {
13253
14587
  postAdminExtractionShadowComparisons,
13254
14588
  {
13255
14589
  body: {
13256
- data: { type: "shadow_comparison", attributes }
14590
+ data: { type: "shadow-comparison", attributes }
13257
14591
  }
13258
14592
  },
13259
14593
  options
@@ -13366,7 +14700,7 @@ function createSchedulingNamespace(rb) {
13366
14700
  create: async (attributes, options) => {
13367
14701
  return rb.execute(
13368
14702
  postAdminSchedulingLocations,
13369
- { body: { data: { type: "scheduling_location", attributes } } },
14703
+ { body: { data: { type: "scheduling-location", attributes } } },
13370
14704
  options
13371
14705
  );
13372
14706
  },
@@ -13377,7 +14711,7 @@ function createSchedulingNamespace(rb) {
13377
14711
  {
13378
14712
  path: { id },
13379
14713
  body: {
13380
- data: { id, type: "scheduling_location", attributes }
14714
+ data: { id, type: "scheduling-location", attributes }
13381
14715
  }
13382
14716
  },
13383
14717
  options
@@ -13392,7 +14726,7 @@ function createSchedulingNamespace(rb) {
13392
14726
  body: {
13393
14727
  data: {
13394
14728
  id,
13395
- type: "scheduling_location",
14729
+ type: "scheduling-location",
13396
14730
  attributes: { is_active: false }
13397
14731
  }
13398
14732
  }
@@ -13423,7 +14757,7 @@ function createSchedulingNamespace(rb) {
13423
14757
  create: async (attributes, options) => {
13424
14758
  return rb.execute(
13425
14759
  postAdminSchedulingEventTypes,
13426
- { body: { data: { type: "scheduling_event_type", attributes } } },
14760
+ { body: { data: { type: "scheduling-event-type", attributes } } },
13427
14761
  options
13428
14762
  );
13429
14763
  },
@@ -13434,20 +14768,36 @@ function createSchedulingNamespace(rb) {
13434
14768
  {
13435
14769
  path: { id },
13436
14770
  body: {
13437
- data: { id, type: "scheduling_event_type", attributes }
14771
+ data: { id, type: "scheduling-event-type", attributes }
13438
14772
  }
13439
14773
  },
13440
14774
  options
13441
14775
  );
14776
+ },
14777
+ /** Archive an event type. */
14778
+ archive: async (id, options) => {
14779
+ return rb.execute(
14780
+ patchAdminSchedulingEventTypesByIdArchive,
14781
+ { path: { id }, body: {} },
14782
+ options
14783
+ );
14784
+ },
14785
+ /** Get an event type by its public slug. */
14786
+ getBySlug: async (slug, workspaceId, options) => {
14787
+ return rb.execute(
14788
+ getAdminSchedulingEventTypesBySlug,
14789
+ { query: { slug, workspace_id: workspaceId } },
14790
+ options
14791
+ );
13442
14792
  }
13443
14793
  },
13444
14794
  /** Events — scheduled occurrences between workspace members. */
13445
14795
  events: {
13446
- /** List events. */
13447
- list: async (options) => {
14796
+ /** List events in a workspace. */
14797
+ list: async (workspaceId, options) => {
13448
14798
  return rb.execute(
13449
14799
  getAdminSchedulingEvents,
13450
- {},
14800
+ { query: { workspace_id: workspaceId } },
13451
14801
  options
13452
14802
  );
13453
14803
  },
@@ -13463,7 +14813,7 @@ function createSchedulingNamespace(rb) {
13463
14813
  create: async (attributes, options) => {
13464
14814
  return rb.execute(
13465
14815
  postAdminSchedulingEvents,
13466
- { body: { data: { type: "scheduling_event", attributes } } },
14816
+ { body: { data: { type: "scheduling-event", attributes } } },
13467
14817
  options
13468
14818
  );
13469
14819
  },
@@ -13473,7 +14823,7 @@ function createSchedulingNamespace(rb) {
13473
14823
  patchAdminSchedulingEventsById,
13474
14824
  {
13475
14825
  path: { id },
13476
- body: { data: { id, type: "scheduling_event", attributes } }
14826
+ body: { data: { id, type: "scheduling-event", attributes } }
13477
14827
  },
13478
14828
  options
13479
14829
  );
@@ -13484,7 +14834,7 @@ function createSchedulingNamespace(rb) {
13484
14834
  patchAdminSchedulingEventsByIdCancel,
13485
14835
  {
13486
14836
  path: { id },
13487
- body: attributes ? { data: { type: "scheduling_event", attributes } } : {}
14837
+ body: attributes ? { data: { type: "scheduling-event", attributes } } : {}
13488
14838
  },
13489
14839
  options
13490
14840
  );
@@ -13503,7 +14853,7 @@ function createSchedulingNamespace(rb) {
13503
14853
  patchAdminSchedulingEventsByIdReschedule,
13504
14854
  {
13505
14855
  path: { id },
13506
- body: { data: { type: "scheduling_event", attributes } }
14856
+ body: { data: { type: "scheduling-event", attributes } }
13507
14857
  },
13508
14858
  options
13509
14859
  );
@@ -13555,7 +14905,7 @@ function createSchedulingNamespace(rb) {
13555
14905
  postAdminSchedulingParticipants,
13556
14906
  {
13557
14907
  body: {
13558
- data: { type: "scheduling_participant", attributes }
14908
+ data: { type: "scheduling-participant", attributes }
13559
14909
  }
13560
14910
  },
13561
14911
  options
@@ -13568,7 +14918,7 @@ function createSchedulingNamespace(rb) {
13568
14918
  {
13569
14919
  path: { id },
13570
14920
  body: {
13571
- data: { id, type: "scheduling_participant", attributes }
14921
+ data: { id, type: "scheduling-participant", attributes }
13572
14922
  }
13573
14923
  },
13574
14924
  options
@@ -13582,7 +14932,7 @@ function createSchedulingNamespace(rb) {
13582
14932
  path: { id },
13583
14933
  body: {
13584
14934
  data: {
13585
- type: "scheduling_participant",
14935
+ type: "scheduling-participant",
13586
14936
  attributes: { status }
13587
14937
  }
13588
14938
  }
@@ -13623,7 +14973,7 @@ function createSchedulingNamespace(rb) {
13623
14973
  postAdminSchedulingAvailabilityRules,
13624
14974
  {
13625
14975
  body: {
13626
- data: { type: "scheduling_availability_rule", attributes }
14976
+ data: { type: "scheduling-availability-rule", attributes }
13627
14977
  }
13628
14978
  },
13629
14979
  options
@@ -13638,7 +14988,7 @@ function createSchedulingNamespace(rb) {
13638
14988
  body: {
13639
14989
  data: {
13640
14990
  id,
13641
- type: "scheduling_availability_rule",
14991
+ type: "scheduling-availability-rule",
13642
14992
  attributes
13643
14993
  }
13644
14994
  }
@@ -13653,6 +15003,22 @@ function createSchedulingNamespace(rb) {
13653
15003
  { path: { id } },
13654
15004
  options
13655
15005
  );
15006
+ },
15007
+ /** List availability rules for a specific user. */
15008
+ listByUser: async (userId, options) => {
15009
+ return rb.execute(
15010
+ getAdminSchedulingAvailabilityRulesByUser,
15011
+ { query: { user_id: userId } },
15012
+ options
15013
+ );
15014
+ },
15015
+ /** List availability rules for a specific event type. */
15016
+ listByEventType: async (eventTypeId, options) => {
15017
+ return rb.execute(
15018
+ getAdminSchedulingAvailabilityRulesByEventType,
15019
+ { query: { event_type_id: eventTypeId } },
15020
+ options
15021
+ );
13656
15022
  }
13657
15023
  },
13658
15024
  /** Bookings — external party appointment requests. */
@@ -13677,7 +15043,7 @@ function createSchedulingNamespace(rb) {
13677
15043
  create: async (attributes, options) => {
13678
15044
  return rb.execute(
13679
15045
  postAdminSchedulingBookings,
13680
- { body: { data: { type: "scheduling_booking", attributes } } },
15046
+ { body: { data: { type: "scheduling-booking", attributes } } },
13681
15047
  options
13682
15048
  );
13683
15049
  },
@@ -13695,7 +15061,7 @@ function createSchedulingNamespace(rb) {
13695
15061
  patchAdminSchedulingBookingsByIdCancel,
13696
15062
  {
13697
15063
  path: { id },
13698
- body: attributes ? { data: { type: "scheduling_booking", attributes } } : {}
15064
+ body: attributes ? { data: { type: "scheduling-booking", attributes } } : {}
13699
15065
  },
13700
15066
  options
13701
15067
  );
@@ -13706,7 +15072,7 @@ function createSchedulingNamespace(rb) {
13706
15072
  patchAdminSchedulingBookingsByIdReschedule,
13707
15073
  {
13708
15074
  path: { id },
13709
- body: { data: { type: "scheduling_booking", attributes } }
15075
+ body: { data: { type: "scheduling-booking", attributes } }
13710
15076
  },
13711
15077
  options
13712
15078
  );
@@ -13718,6 +15084,14 @@ function createSchedulingNamespace(rb) {
13718
15084
  { path: { id }, body: {} },
13719
15085
  options
13720
15086
  );
15087
+ },
15088
+ /** List bookings by booker email address. */
15089
+ listByBooker: async (email, options) => {
15090
+ return rb.execute(
15091
+ getAdminSchedulingBookingsByBooker,
15092
+ { query: { booker_email: email } },
15093
+ options
15094
+ );
13721
15095
  }
13722
15096
  },
13723
15097
  /** Reminders — scheduled notifications tied to events. */
@@ -13742,7 +15116,15 @@ function createSchedulingNamespace(rb) {
13742
15116
  create: async (attributes, options) => {
13743
15117
  return rb.execute(
13744
15118
  postAdminSchedulingReminders,
13745
- { body: { data: { type: "scheduling_reminder", attributes } } },
15119
+ { body: { data: { type: "scheduling-reminder", attributes } } },
15120
+ options
15121
+ );
15122
+ },
15123
+ /** Cancel a pending reminder. */
15124
+ cancel: async (id, options) => {
15125
+ return rb.execute(
15126
+ patchAdminSchedulingRemindersByIdCancel,
15127
+ { path: { id }, body: {} },
13746
15128
  options
13747
15129
  );
13748
15130
  }
@@ -13771,7 +15153,7 @@ function createSchedulingNamespace(rb) {
13771
15153
  postAdminSchedulingCalendarSyncs,
13772
15154
  {
13773
15155
  body: {
13774
- data: { type: "scheduling_calendar_sync", attributes }
15156
+ data: { type: "scheduling-calendar-sync", attributes }
13775
15157
  }
13776
15158
  },
13777
15159
  options
@@ -13784,7 +15166,7 @@ function createSchedulingNamespace(rb) {
13784
15166
  {
13785
15167
  path: { id },
13786
15168
  body: {
13787
- data: { id, type: "scheduling_calendar_sync", attributes }
15169
+ data: { id, type: "scheduling-calendar-sync", attributes }
13788
15170
  }
13789
15171
  },
13790
15172
  options
@@ -13846,7 +15228,7 @@ function createCrmNamespace(rb) {
13846
15228
  create: async (attributes, options) => {
13847
15229
  return rb.execute(
13848
15230
  postAdminCrmContacts,
13849
- { body: { data: { type: "crm_contact", attributes } } },
15231
+ { body: { data: { type: "crm-contact", attributes } } },
13850
15232
  options
13851
15233
  );
13852
15234
  },
@@ -13856,7 +15238,7 @@ function createCrmNamespace(rb) {
13856
15238
  patchAdminCrmContactsById,
13857
15239
  {
13858
15240
  path: { id },
13859
- body: { data: { type: "crm_contact", id, attributes } }
15241
+ body: { data: { type: "crm-contact", id, attributes } }
13860
15242
  },
13861
15243
  options
13862
15244
  );
@@ -13867,7 +15249,7 @@ function createCrmNamespace(rb) {
13867
15249
  patchAdminCrmContactsByIdArchive,
13868
15250
  {
13869
15251
  path: { id },
13870
- body: { data: { type: "crm_contact", id, attributes: {} } }
15252
+ body: { data: { type: "crm-contact", id, attributes: {} } }
13871
15253
  },
13872
15254
  options
13873
15255
  );
@@ -13878,7 +15260,7 @@ function createCrmNamespace(rb) {
13878
15260
  postAdminCrmContactsByIdUnarchive,
13879
15261
  {
13880
15262
  path: { id },
13881
- body: { data: { type: "crm_contact", id } }
15263
+ body: { data: { type: "crm-contact", id } }
13882
15264
  },
13883
15265
  options
13884
15266
  );
@@ -13905,7 +15287,7 @@ function createCrmNamespace(rb) {
13905
15287
  create: async (attributes, options) => {
13906
15288
  return rb.execute(
13907
15289
  postAdminCrmCompanies,
13908
- { body: { data: { type: "crm_company", attributes } } },
15290
+ { body: { data: { type: "crm-company", attributes } } },
13909
15291
  options
13910
15292
  );
13911
15293
  },
@@ -13915,7 +15297,7 @@ function createCrmNamespace(rb) {
13915
15297
  patchAdminCrmCompaniesById,
13916
15298
  {
13917
15299
  path: { id },
13918
- body: { data: { type: "crm_company", id, attributes } }
15300
+ body: { data: { type: "crm-company", id, attributes } }
13919
15301
  },
13920
15302
  options
13921
15303
  );
@@ -13947,7 +15329,7 @@ function createCrmNamespace(rb) {
13947
15329
  create: async (attributes, options) => {
13948
15330
  return rb.execute(
13949
15331
  postAdminCrmDeals,
13950
- { body: { data: { type: "crm_deal", attributes } } },
15332
+ { body: { data: { type: "crm-deal", attributes } } },
13951
15333
  options
13952
15334
  );
13953
15335
  },
@@ -13957,7 +15339,7 @@ function createCrmNamespace(rb) {
13957
15339
  patchAdminCrmDealsById,
13958
15340
  {
13959
15341
  path: { id },
13960
- body: { data: { type: "crm_deal", id, attributes } }
15342
+ body: { data: { type: "crm-deal", id, attributes } }
13961
15343
  },
13962
15344
  options
13963
15345
  );
@@ -13968,7 +15350,7 @@ function createCrmNamespace(rb) {
13968
15350
  patchAdminCrmDealsByIdMoveStage,
13969
15351
  {
13970
15352
  path: { id },
13971
- body: { data: { type: "crm_deal", id, attributes } }
15353
+ body: { data: { type: "crm-deal", id, attributes } }
13972
15354
  },
13973
15355
  options
13974
15356
  );
@@ -13996,7 +15378,7 @@ function createCrmNamespace(rb) {
13996
15378
  create: async (attributes, options) => {
13997
15379
  return rb.execute(
13998
15380
  postAdminCrmActivities,
13999
- { body: { data: { type: "crm_activity", attributes } } },
15381
+ { body: { data: { type: "crm-activity", attributes } } },
14000
15382
  options
14001
15383
  );
14002
15384
  },
@@ -14006,7 +15388,7 @@ function createCrmNamespace(rb) {
14006
15388
  patchAdminCrmActivitiesById,
14007
15389
  {
14008
15390
  path: { id },
14009
- body: { data: { type: "crm_activity", id, attributes } }
15391
+ body: { data: { type: "crm-activity", id, attributes } }
14010
15392
  },
14011
15393
  options
14012
15394
  );
@@ -14038,7 +15420,7 @@ function createCrmNamespace(rb) {
14038
15420
  create: async (attributes, options) => {
14039
15421
  return rb.execute(
14040
15422
  postAdminCrmPipelines,
14041
- { body: { data: { type: "crm_pipeline", attributes } } },
15423
+ { body: { data: { type: "crm-pipeline", attributes } } },
14042
15424
  options
14043
15425
  );
14044
15426
  },
@@ -14048,7 +15430,7 @@ function createCrmNamespace(rb) {
14048
15430
  patchAdminCrmPipelinesById,
14049
15431
  {
14050
15432
  path: { id },
14051
- body: { data: { type: "crm_pipeline", id, attributes } }
15433
+ body: { data: { type: "crm-pipeline", id, attributes } }
14052
15434
  },
14053
15435
  options
14054
15436
  );
@@ -14084,7 +15466,7 @@ function createCrmNamespace(rb) {
14084
15466
  create: async (attributes, options) => {
14085
15467
  return rb.execute(
14086
15468
  postAdminCrmPipelineStages,
14087
- { body: { data: { type: "crm_pipeline_stage", attributes } } },
15469
+ { body: { data: { type: "crm-pipeline-stage", attributes } } },
14088
15470
  options
14089
15471
  );
14090
15472
  },
@@ -14094,7 +15476,7 @@ function createCrmNamespace(rb) {
14094
15476
  patchAdminCrmPipelineStagesById,
14095
15477
  {
14096
15478
  path: { id },
14097
- body: { data: { type: "crm_pipeline_stage", id, attributes } }
15479
+ body: { data: { type: "crm-pipeline-stage", id, attributes } }
14098
15480
  },
14099
15481
  options
14100
15482
  );
@@ -14130,7 +15512,7 @@ function createCrmNamespace(rb) {
14130
15512
  create: async (attributes, options) => {
14131
15513
  return rb.execute(
14132
15514
  postAdminCrmRelationships,
14133
- { body: { data: { type: "crm_relationship", attributes } } },
15515
+ { body: { data: { type: "crm-relationship", attributes } } },
14134
15516
  options
14135
15517
  );
14136
15518
  },
@@ -14161,7 +15543,7 @@ function createCrmNamespace(rb) {
14161
15543
  create: async (attributes, options) => {
14162
15544
  return rb.execute(
14163
15545
  postAdminCrmRelationshipTypes,
14164
- { body: { data: { type: "crm_relationship_type", attributes } } },
15546
+ { body: { data: { type: "crm-relationship-type", attributes } } },
14165
15547
  options
14166
15548
  );
14167
15549
  },
@@ -14171,7 +15553,7 @@ function createCrmNamespace(rb) {
14171
15553
  patchAdminCrmRelationshipTypesById,
14172
15554
  {
14173
15555
  path: { id },
14174
- body: { data: { type: "crm_relationship_type", id, attributes } }
15556
+ body: { data: { type: "crm-relationship-type", id, attributes } }
14175
15557
  },
14176
15558
  options
14177
15559
  );
@@ -14207,7 +15589,7 @@ function createCrmNamespace(rb) {
14207
15589
  create: async (attributes, options) => {
14208
15590
  return rb.execute(
14209
15591
  postAdminCrmCustomEntities,
14210
- { body: { data: { type: "crm_custom_entity", attributes } } },
15592
+ { body: { data: { type: "crm-custom-entity", attributes } } },
14211
15593
  options
14212
15594
  );
14213
15595
  },
@@ -14217,7 +15599,7 @@ function createCrmNamespace(rb) {
14217
15599
  patchAdminCrmCustomEntitiesById,
14218
15600
  {
14219
15601
  path: { id },
14220
- body: { data: { type: "crm_custom_entity", id, attributes } }
15602
+ body: { data: { type: "crm-custom-entity", id, attributes } }
14221
15603
  },
14222
15604
  options
14223
15605
  );
@@ -14265,7 +15647,7 @@ function createCrmNamespace(rb) {
14265
15647
  create: async (attributes, options) => {
14266
15648
  return rb.execute(
14267
15649
  postAdminCrmDealProducts,
14268
- { body: { data: { type: "crm_deal_product", attributes } } },
15650
+ { body: { data: { type: "crm-deal-product", attributes } } },
14269
15651
  options
14270
15652
  );
14271
15653
  },
@@ -14296,7 +15678,7 @@ function createCrmNamespace(rb) {
14296
15678
  create: async (attributes, options) => {
14297
15679
  return rb.execute(
14298
15680
  postAdminCrmExports,
14299
- { body: { data: { type: "crm_data_export_job", attributes } } },
15681
+ { body: { data: { type: "crm-data-export-job", attributes } } },
14300
15682
  options
14301
15683
  );
14302
15684
  },
@@ -14306,7 +15688,7 @@ function createCrmNamespace(rb) {
14306
15688
  patchAdminCrmExportsByIdRefreshUrl,
14307
15689
  {
14308
15690
  path: { id },
14309
- body: { data: { type: "crm_data_export_job", id, attributes: {} } }
15691
+ body: { data: { type: "crm-data-export-job", id, attributes: {} } }
14310
15692
  },
14311
15693
  options
14312
15694
  );
@@ -14334,7 +15716,7 @@ function createCrmNamespace(rb) {
14334
15716
  create: async (attributes, options) => {
14335
15717
  return rb.execute(
14336
15718
  postAdminIsvCrmEntityTypes,
14337
- { body: { data: { type: "crm_custom_entity_type", attributes } } },
15719
+ { body: { data: { type: "crm-custom-entity-type", attributes } } },
14338
15720
  options
14339
15721
  );
14340
15722
  },
@@ -14344,7 +15726,7 @@ function createCrmNamespace(rb) {
14344
15726
  patchAdminIsvCrmEntityTypesById,
14345
15727
  {
14346
15728
  path: { id },
14347
- body: { data: { type: "crm_custom_entity_type", id, attributes } }
15729
+ body: { data: { type: "crm-custom-entity-type", id, attributes } }
14348
15730
  },
14349
15731
  options
14350
15732
  );
@@ -14381,7 +15763,7 @@ function createCrmNamespace(rb) {
14381
15763
  return rb.execute(
14382
15764
  postAdminCrmFieldDefinitions,
14383
15765
  {
14384
- body: { data: { type: "crm_custom_field_definition", attributes } }
15766
+ body: { data: { type: "crm-custom-field-definition", attributes } }
14385
15767
  },
14386
15768
  options
14387
15769
  );
@@ -14393,7 +15775,7 @@ function createCrmNamespace(rb) {
14393
15775
  {
14394
15776
  path: { id },
14395
15777
  body: {
14396
- data: { type: "crm_custom_field_definition", id, attributes }
15778
+ data: { type: "crm-custom-field-definition", id, attributes }
14397
15779
  }
14398
15780
  },
14399
15781
  options
@@ -14423,7 +15805,7 @@ function createCrmNamespace(rb) {
14423
15805
  return rb.execute(
14424
15806
  postAdminIsvCrmChannelCaptureConfig,
14425
15807
  {
14426
- body: { data: { type: "crm_channel_capture_config", attributes } }
15808
+ body: { data: { type: "crm-channel-capture-config", attributes } }
14427
15809
  },
14428
15810
  options
14429
15811
  );
@@ -14435,7 +15817,7 @@ function createCrmNamespace(rb) {
14435
15817
  {
14436
15818
  path: { id },
14437
15819
  body: {
14438
- data: { type: "crm_channel_capture_config", id, attributes }
15820
+ data: { type: "crm-channel-capture-config", id, attributes }
14439
15821
  }
14440
15822
  },
14441
15823
  options
@@ -14456,7 +15838,7 @@ function createCrmNamespace(rb) {
14456
15838
  create: async (attributes, options) => {
14457
15839
  return rb.execute(
14458
15840
  postAdminCrmSyncConfigs,
14459
- { body: { data: { type: "crm_sync_config", attributes } } },
15841
+ { body: { data: { type: "crm-sync-config", attributes } } },
14460
15842
  options
14461
15843
  );
14462
15844
  },
@@ -14466,7 +15848,7 @@ function createCrmNamespace(rb) {
14466
15848
  patchAdminCrmSyncConfigsById,
14467
15849
  {
14468
15850
  path: { id },
14469
- body: { data: { type: "crm_sync_config", id, attributes } }
15851
+ body: { data: { type: "crm-sync-config", id, attributes } }
14470
15852
  },
14471
15853
  options
14472
15854
  );
@@ -14508,7 +15890,7 @@ function createSupportNamespace(rb) {
14508
15890
  create: async (attributes, options) => {
14509
15891
  return rb.execute(
14510
15892
  postAdminSupportTickets,
14511
- { body: { data: { type: "support_ticket", attributes } } },
15893
+ { body: { data: { type: "support-ticket", attributes } } },
14512
15894
  options
14513
15895
  );
14514
15896
  },
@@ -14518,7 +15900,7 @@ function createSupportNamespace(rb) {
14518
15900
  patchAdminSupportTicketsById,
14519
15901
  {
14520
15902
  path: { id },
14521
- body: { data: { type: "support_ticket", id, attributes } }
15903
+ body: { data: { type: "support-ticket", id, attributes } }
14522
15904
  },
14523
15905
  options
14524
15906
  );
@@ -14529,7 +15911,7 @@ function createSupportNamespace(rb) {
14529
15911
  patchAdminSupportTicketsByIdAssign,
14530
15912
  {
14531
15913
  path: { id },
14532
- body: { data: { type: "support_ticket", id, attributes } }
15914
+ body: { data: { type: "support-ticket", id, attributes } }
14533
15915
  },
14534
15916
  options
14535
15917
  );
@@ -14540,7 +15922,7 @@ function createSupportNamespace(rb) {
14540
15922
  patchAdminSupportTicketsByIdResolve,
14541
15923
  {
14542
15924
  path: { id },
14543
- body: { data: { type: "support_ticket", id, attributes } }
15925
+ body: { data: { type: "support-ticket", id, attributes } }
14544
15926
  },
14545
15927
  options
14546
15928
  );
@@ -14551,7 +15933,7 @@ function createSupportNamespace(rb) {
14551
15933
  patchAdminSupportTicketsByIdClose,
14552
15934
  {
14553
15935
  path: { id },
14554
- body: { data: { type: "support_ticket", id, attributes } }
15936
+ body: { data: { type: "support-ticket", id, attributes } }
14555
15937
  },
14556
15938
  options
14557
15939
  );
@@ -14562,7 +15944,7 @@ function createSupportNamespace(rb) {
14562
15944
  patchAdminSupportTicketsByIdReopen,
14563
15945
  {
14564
15946
  path: { id },
14565
- body: { data: { type: "support_ticket", id, attributes } }
15947
+ body: { data: { type: "support-ticket", id, attributes } }
14566
15948
  },
14567
15949
  options
14568
15950
  );
@@ -14573,7 +15955,7 @@ function createSupportNamespace(rb) {
14573
15955
  patchAdminSupportTicketsByIdMerge,
14574
15956
  {
14575
15957
  path: { id },
14576
- body: { data: { type: "support_ticket", id, attributes } }
15958
+ body: { data: { type: "support-ticket", id, attributes } }
14577
15959
  },
14578
15960
  options
14579
15961
  );
@@ -14601,7 +15983,7 @@ function createSupportNamespace(rb) {
14601
15983
  create: async (attributes, options) => {
14602
15984
  return rb.execute(
14603
15985
  postAdminSupportTicketMessages,
14604
- { body: { data: { type: "support_ticket_message", attributes } } },
15986
+ { body: { data: { type: "support-ticket-message", attributes } } },
14605
15987
  options
14606
15988
  );
14607
15989
  }
@@ -14620,7 +16002,7 @@ function createSupportNamespace(rb) {
14620
16002
  create: async (attributes, options) => {
14621
16003
  return rb.execute(
14622
16004
  postAdminSupportTicketAttachments,
14623
- { body: { data: { type: "support_ticket_attachment", attributes } } },
16005
+ { body: { data: { type: "support-ticket-attachment", attributes } } },
14624
16006
  options
14625
16007
  );
14626
16008
  }
@@ -14631,7 +16013,7 @@ function createSupportNamespace(rb) {
14631
16013
  create: async (attributes, options) => {
14632
16014
  return rb.execute(
14633
16015
  postAdminSupportTicketRatings,
14634
- { body: { data: { type: "support_ticket_rating", attributes } } },
16016
+ { body: { data: { type: "support-ticket-rating", attributes } } },
14635
16017
  options
14636
16018
  );
14637
16019
  }
@@ -14650,7 +16032,7 @@ function createSupportNamespace(rb) {
14650
16032
  create: async (attributes, options) => {
14651
16033
  return rb.execute(
14652
16034
  postAdminSupportTags,
14653
- { body: { data: { type: "support_tag", attributes } } },
16035
+ { body: { data: { type: "support-tag", attributes } } },
14654
16036
  options
14655
16037
  );
14656
16038
  },
@@ -14681,7 +16063,7 @@ function createSupportNamespace(rb) {
14681
16063
  create: async (attributes, options) => {
14682
16064
  return rb.execute(
14683
16065
  postAdminSupportQueues,
14684
- { body: { data: { type: "support_queue", attributes } } },
16066
+ { body: { data: { type: "support-queue", attributes } } },
14685
16067
  options
14686
16068
  );
14687
16069
  },
@@ -14691,7 +16073,7 @@ function createSupportNamespace(rb) {
14691
16073
  patchAdminSupportQueuesById,
14692
16074
  {
14693
16075
  path: { id },
14694
- body: { data: { type: "support_queue", id, attributes } }
16076
+ body: { data: { type: "support-queue", id, attributes } }
14695
16077
  },
14696
16078
  options
14697
16079
  );
@@ -14727,7 +16109,7 @@ function createSupportNamespace(rb) {
14727
16109
  create: async (attributes, options) => {
14728
16110
  return rb.execute(
14729
16111
  postAdminSupportQueueMembers,
14730
- { body: { data: { type: "support_queue_member", attributes } } },
16112
+ { body: { data: { type: "support-queue-member", attributes } } },
14731
16113
  options
14732
16114
  );
14733
16115
  },
@@ -14737,7 +16119,7 @@ function createSupportNamespace(rb) {
14737
16119
  patchAdminSupportQueueMembersById,
14738
16120
  {
14739
16121
  path: { id },
14740
- body: { data: { type: "support_queue_member", id, attributes } }
16122
+ body: { data: { type: "support-queue-member", id, attributes } }
14741
16123
  },
14742
16124
  options
14743
16125
  );
@@ -14773,7 +16155,7 @@ function createSupportNamespace(rb) {
14773
16155
  create: async (attributes, options) => {
14774
16156
  return rb.execute(
14775
16157
  postAdminSupportRoutingRules,
14776
- { body: { data: { type: "support_routing_rule", attributes } } },
16158
+ { body: { data: { type: "support-routing-rule", attributes } } },
14777
16159
  options
14778
16160
  );
14779
16161
  },
@@ -14783,7 +16165,7 @@ function createSupportNamespace(rb) {
14783
16165
  patchAdminSupportRoutingRulesById,
14784
16166
  {
14785
16167
  path: { id },
14786
- body: { data: { type: "support_routing_rule", id, attributes } }
16168
+ body: { data: { type: "support-routing-rule", id, attributes } }
14787
16169
  },
14788
16170
  options
14789
16171
  );
@@ -14819,7 +16201,7 @@ function createSupportNamespace(rb) {
14819
16201
  create: async (attributes, options) => {
14820
16202
  return rb.execute(
14821
16203
  postAdminSupportSlaPolicies,
14822
- { body: { data: { type: "support_sla_policy", attributes } } },
16204
+ { body: { data: { type: "support-sla-policy", attributes } } },
14823
16205
  options
14824
16206
  );
14825
16207
  },
@@ -14829,7 +16211,7 @@ function createSupportNamespace(rb) {
14829
16211
  patchAdminSupportSlaPoliciesById,
14830
16212
  {
14831
16213
  path: { id },
14832
- body: { data: { type: "support_sla_policy", id, attributes } }
16214
+ body: { data: { type: "support-sla-policy", id, attributes } }
14833
16215
  },
14834
16216
  options
14835
16217
  );
@@ -14857,7 +16239,7 @@ function createSupportNamespace(rb) {
14857
16239
  upsert: async (attributes, options) => {
14858
16240
  return rb.execute(
14859
16241
  postAdminSupportAiConfigs,
14860
- { body: { data: { type: "support_ai_config", attributes } } },
16242
+ { body: { data: { type: "support-ai-config", attributes } } },
14861
16243
  options
14862
16244
  );
14863
16245
  }
@@ -14878,7 +16260,7 @@ function createSupportNamespace(rb) {
14878
16260
  postAdminSupportChannelCaptureConfigs,
14879
16261
  {
14880
16262
  body: {
14881
- data: { type: "support_channel_capture_config", attributes }
16263
+ data: { type: "support-channel-capture-config", attributes }
14882
16264
  }
14883
16265
  },
14884
16266
  options
@@ -14899,7 +16281,7 @@ function createSupportNamespace(rb) {
14899
16281
  create: async (attributes, options) => {
14900
16282
  return rb.execute(
14901
16283
  postAdminSupportSyncConfigs,
14902
- { body: { data: { type: "support_sync_config", attributes } } },
16284
+ { body: { data: { type: "support-sync-config", attributes } } },
14903
16285
  options
14904
16286
  );
14905
16287
  },
@@ -14909,7 +16291,7 @@ function createSupportNamespace(rb) {
14909
16291
  patchAdminSupportSyncConfigsById,
14910
16292
  {
14911
16293
  path: { id },
14912
- body: { data: { type: "support_sync_config", id, attributes } }
16294
+ body: { data: { type: "support-sync-config", id, attributes } }
14913
16295
  },
14914
16296
  options
14915
16297
  );
@@ -14937,7 +16319,7 @@ function createSupportNamespace(rb) {
14937
16319
  create: async (attributes, options) => {
14938
16320
  return rb.execute(
14939
16321
  postAdminSupportCannedResponses,
14940
- { body: { data: { type: "support_canned_response", attributes } } },
16322
+ { body: { data: { type: "support-canned-response", attributes } } },
14941
16323
  options
14942
16324
  );
14943
16325
  },
@@ -14947,7 +16329,7 @@ function createSupportNamespace(rb) {
14947
16329
  patchAdminSupportCannedResponsesById,
14948
16330
  {
14949
16331
  path: { id },
14950
- body: { data: { type: "support_canned_response", id, attributes } }
16332
+ body: { data: { type: "support-canned-response", id, attributes } }
14951
16333
  },
14952
16334
  options
14953
16335
  );
@@ -15399,7 +16781,7 @@ function createComplianceNamespace(rb) {
15399
16781
  create: async (attributes, options) => {
15400
16782
  return rb.execute(
15401
16783
  postAdminLegalDocuments,
15402
- { body: { data: { type: "legal_document", attributes } } },
16784
+ { body: { data: { type: "legal-document", attributes } } },
15403
16785
  options
15404
16786
  );
15405
16787
  },
@@ -15423,7 +16805,7 @@ function createComplianceNamespace(rb) {
15423
16805
  patchAdminLegalDocumentsById,
15424
16806
  {
15425
16807
  path: { id },
15426
- body: { data: { type: "legal_document", id, attributes } }
16808
+ body: { data: { type: "legal-document", id, attributes } }
15427
16809
  },
15428
16810
  options
15429
16811
  );
@@ -15501,7 +16883,7 @@ function createComplianceNamespace(rb) {
15501
16883
  patchAdminLegalDocumentsByIdPublish,
15502
16884
  {
15503
16885
  path: { id },
15504
- body: { data: { type: "legal_document", id, attributes: {} } }
16886
+ body: { data: { type: "legal-document", id, attributes: {} } }
15505
16887
  },
15506
16888
  options
15507
16889
  );
@@ -15523,7 +16905,7 @@ function createComplianceNamespace(rb) {
15523
16905
  patchAdminLegalDocumentsByIdUnpublish,
15524
16906
  {
15525
16907
  path: { id },
15526
- body: { data: { type: "legal_document", id, attributes: {} } }
16908
+ body: { data: { type: "legal-document", id, attributes: {} } }
15527
16909
  },
15528
16910
  options
15529
16911
  );
@@ -15725,7 +17107,7 @@ function createPipelineExecutionsNamespace(rb) {
15725
17107
  {
15726
17108
  path: { id },
15727
17109
  body: {
15728
- data: { type: "pipeline_execution", id, attributes: {} }
17110
+ data: { type: "pipeline-execution", id, attributes: {} }
15729
17111
  }
15730
17112
  },
15731
17113
  options
@@ -15744,7 +17126,7 @@ function createPipelineExecutionsNamespace(rb) {
15744
17126
  {
15745
17127
  path: { id },
15746
17128
  body: {
15747
- data: { type: "pipeline_execution", id, attributes: {} }
17129
+ data: { type: "pipeline-execution", id, attributes: {} }
15748
17130
  }
15749
17131
  },
15750
17132
  options
@@ -15765,7 +17147,7 @@ function createPipelineExecutionsNamespace(rb) {
15765
17147
  {
15766
17148
  path: { id },
15767
17149
  body: {
15768
- data: { type: "pipeline_execution", id, attributes }
17150
+ data: { type: "pipeline-execution", id, attributes }
15769
17151
  }
15770
17152
  },
15771
17153
  options
@@ -15786,7 +17168,7 @@ function createPipelineExecutionsNamespace(rb) {
15786
17168
  path: { id },
15787
17169
  body: {
15788
17170
  data: {
15789
- type: "pipeline_execution",
17171
+ type: "pipeline-execution",
15790
17172
  id,
15791
17173
  attributes: { checkpoint_notes: note }
15792
17174
  }
@@ -15811,7 +17193,7 @@ function createPipelineExecutionsNamespace(rb) {
15811
17193
  path: { id },
15812
17194
  body: {
15813
17195
  data: {
15814
- type: "pipeline_execution",
17196
+ type: "pipeline-execution",
15815
17197
  id,
15816
17198
  attributes: { node_id: nodeId, instruction }
15817
17199
  }
@@ -16639,10 +18021,13 @@ function createThreadsNamespace(rb) {
16639
18021
  * const fork = await admin.threads.fork('thr_01HXYZ...');
16640
18022
  * ```
16641
18023
  */
16642
- fork: async (id, options) => {
18024
+ fork: async (id, title, options) => {
16643
18025
  return rb.execute(
16644
18026
  postAdminThreadsByIdFork,
16645
- { path: { id }, body: {} },
18027
+ {
18028
+ path: { id },
18029
+ body: title ? { data: { type: "chat-thread", attributes: { title } } } : {}
18030
+ },
16646
18031
  options
16647
18032
  );
16648
18033
  },
@@ -16726,7 +18111,7 @@ function createThreadsNamespace(rb) {
16726
18111
  );
16727
18112
  },
16728
18113
  /**
16729
- * Sub-namespace for reading messages within a thread.
18114
+ * Sub-namespace for managing messages within a thread.
16730
18115
  */
16731
18116
  messages: {
16732
18117
  /**
@@ -16748,6 +18133,36 @@ function createThreadsNamespace(rb) {
16748
18133
  { path: { id: threadId } },
16749
18134
  options
16750
18135
  );
18136
+ },
18137
+ /**
18138
+ * Sends a message to a thread and triggers AI processing.
18139
+ *
18140
+ * @param threadId - The UUID of the thread.
18141
+ * @param content - The message content to send.
18142
+ * @param attributes - Optional extra attributes (role, metadata, attachments).
18143
+ * @param options - Optional request options.
18144
+ * @returns A promise resolving to the thread with the AI response.
18145
+ *
18146
+ * @example
18147
+ * ```typescript
18148
+ * const admin = new GptAdmin({ apiKey: 'sk_srv_...' });
18149
+ * const result = await admin.threads.messages.send('thr_01HXYZ...', 'Analyze this data');
18150
+ * ```
18151
+ */
18152
+ send: async (threadId, content, attributes, options) => {
18153
+ return rb.execute(
18154
+ postAdminThreadsByIdMessages,
18155
+ {
18156
+ path: { id: threadId },
18157
+ body: {
18158
+ data: {
18159
+ type: "chat-thread",
18160
+ attributes: { content, ...attributes }
18161
+ }
18162
+ }
18163
+ },
18164
+ options
18165
+ );
16751
18166
  }
16752
18167
  }
16753
18168
  };
@@ -19156,7 +20571,7 @@ function createBrandIdentitiesNamespace(rb) {
19156
20571
  create: async (attributes, options) => {
19157
20572
  return rb.execute(
19158
20573
  postAdminBrandIdentities,
19159
- { body: { data: { type: "brand_identity", attributes } } },
20574
+ { body: { data: { type: "brand-identity", attributes } } },
19160
20575
  options
19161
20576
  );
19162
20577
  },
@@ -19180,7 +20595,7 @@ function createBrandIdentitiesNamespace(rb) {
19180
20595
  patchAdminBrandIdentitiesById,
19181
20596
  {
19182
20597
  path: { id },
19183
- body: { data: { id, type: "brand_identity", attributes } }
20598
+ body: { data: { id, type: "brand-identity", attributes } }
19184
20599
  },
19185
20600
  options
19186
20601
  );
@@ -19297,7 +20712,7 @@ function createBrandIdentitiesNamespace(rb) {
19297
20712
  patchAdminBrandIdentitiesByIdSetDefault,
19298
20713
  {
19299
20714
  path: { id },
19300
- body: { data: { id, type: "brand_identity", attributes: {} } }
20715
+ body: { data: { id, type: "brand-identity", attributes: {} } }
19301
20716
  },
19302
20717
  options
19303
20718
  );
@@ -19319,7 +20734,7 @@ function createBrandIdentitiesNamespace(rb) {
19319
20734
  patchAdminBrandIdentitiesByIdUnsetDefault,
19320
20735
  {
19321
20736
  path: { id },
19322
- body: { data: { id, type: "brand_identity", attributes: {} } }
20737
+ body: { data: { id, type: "brand-identity", attributes: {} } }
19323
20738
  },
19324
20739
  options
19325
20740
  );
@@ -19381,7 +20796,7 @@ function createPlatformTonesNamespace(rb) {
19381
20796
  create: async (attributes, options) => {
19382
20797
  return rb.execute(
19383
20798
  postAdminPlatformTones,
19384
- { body: { data: { type: "platform_tone", attributes } } },
20799
+ { body: { data: { type: "platform-tone", attributes } } },
19385
20800
  options
19386
20801
  );
19387
20802
  },
@@ -19405,7 +20820,7 @@ function createPlatformTonesNamespace(rb) {
19405
20820
  patchAdminPlatformTonesById,
19406
20821
  {
19407
20822
  path: { id },
19408
- body: { data: { id, type: "platform_tone", attributes } }
20823
+ body: { data: { id, type: "platform-tone", attributes } }
19409
20824
  },
19410
20825
  options
19411
20826
  );
@@ -19452,11 +20867,23 @@ function createPlatformTonesNamespace(rb) {
19452
20867
  }
19453
20868
 
19454
20869
  // src/namespaces/channels.ts
20870
+ function mapResponse(raw) {
20871
+ return {
20872
+ channelToken: raw.channel_token,
20873
+ expiresAt: raw.expires_at,
20874
+ channels: raw.channels,
20875
+ workspaceId: raw.workspace_id
20876
+ };
20877
+ }
19455
20878
  function createChannelsNamespace(rb) {
19456
20879
  return {
19457
20880
  /**
19458
20881
  * Exchange the current bearer token for a scoped channel token.
19459
20882
  *
20883
+ * **Important:** This endpoint requires user context (Bearer token from a
20884
+ * `sk_tenant_` key). Server keys (`sk_srv_`, `sk_sys_`) are explicitly
20885
+ * rejected — channel tokens are scoped to end-user sessions.
20886
+ *
19460
20887
  * @param request - Workspace and channel scope
19461
20888
  * @param options - Request options (signal, etc.)
19462
20889
  * @returns Channel token response
@@ -19470,12 +20897,7 @@ function createChannelsNamespace(rb) {
19470
20897
  },
19471
20898
  options
19472
20899
  );
19473
- return {
19474
- channelToken: raw.channel_token,
19475
- expiresAt: raw.expires_at,
19476
- channels: raw.channels,
19477
- workspaceId: raw.workspace_id
19478
- };
20900
+ return mapResponse(raw);
19479
20901
  }
19480
20902
  };
19481
20903
  }
@@ -19668,6 +21090,7 @@ var index_default = GptAdmin;
19668
21090
  ServerError,
19669
21091
  TimeoutError,
19670
21092
  ValidationError,
21093
+ createChannelsNamespace,
19671
21094
  createImportsNamespace,
19672
21095
  handleApiError
19673
21096
  });