@gpt-platform/client 0.7.1 → 0.7.3

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
@@ -1333,7 +1333,7 @@ function buildUserAgent(sdkVersion, appInfo) {
1333
1333
  }
1334
1334
 
1335
1335
  // src/version.ts
1336
- var SDK_VERSION = "0.7.1";
1336
+ var SDK_VERSION = "0.7.3";
1337
1337
  var DEFAULT_API_VERSION = "2026-03-11";
1338
1338
 
1339
1339
  // src/base-client.ts
@@ -1831,6 +1831,11 @@ var postEmailOutboundEmails = (options) => (options.client ?? client).post({
1831
1831
  ...options.headers
1832
1832
  }
1833
1833
  });
1834
+ var getBrandIdentitiesDefaultWorkspaceByWorkspaceId = (options) => (options.client ?? client).get({
1835
+ security: [{ scheme: "bearer", type: "http" }],
1836
+ url: "/brand-identities/default/workspace/{workspace_id}",
1837
+ ...options
1838
+ });
1834
1839
  var patchWalletCredits = (options) => (options.client ?? client).patch({
1835
1840
  security: [{ scheme: "bearer", type: "http" }],
1836
1841
  url: "/wallet/credits",
@@ -1940,6 +1945,20 @@ var getApplicationsCurrent = (options) => (options.client ?? client).get({
1940
1945
  url: "/applications/current",
1941
1946
  ...options
1942
1947
  });
1948
+ var patchTenantsByIdConvertToOrg = (options) => (options.client ?? client).patch({
1949
+ security: [{ scheme: "bearer", type: "http" }],
1950
+ url: "/tenants/{id}/convert-to-org",
1951
+ ...options,
1952
+ headers: {
1953
+ "Content-Type": "application/vnd.api+json",
1954
+ ...options.headers
1955
+ }
1956
+ });
1957
+ var getBrandIdentitiesByTenantByTenantId = (options) => (options.client ?? client).get({
1958
+ security: [{ scheme: "bearer", type: "http" }],
1959
+ url: "/brand-identities/by-tenant/{tenant_id}",
1960
+ ...options
1961
+ });
1943
1962
  var postInvitationsAcceptByToken = (options) => (options.client ?? client).post({
1944
1963
  security: [{ scheme: "bearer", type: "http" }],
1945
1964
  url: "/invitations/accept-by-token",
@@ -2015,6 +2034,15 @@ var getSchedulingEventsByParticipant = (options) => (options.client ?? client).g
2015
2034
  url: "/scheduling/events/by_participant",
2016
2035
  ...options
2017
2036
  });
2037
+ var postTenantsPersonal = (options) => (options.client ?? client).post({
2038
+ security: [{ scheme: "bearer", type: "http" }],
2039
+ url: "/tenants/personal",
2040
+ ...options,
2041
+ headers: {
2042
+ "Content-Type": "application/vnd.api+json",
2043
+ ...options.headers
2044
+ }
2045
+ });
2018
2046
  var getEmailTrackingEventsById = (options) => (options.client ?? client).get({
2019
2047
  security: [{ scheme: "bearer", type: "http" }],
2020
2048
  url: "/email/tracking-events/{id}",
@@ -2223,6 +2251,15 @@ var postAgentsImport = (options) => (options.client ?? client).post({
2223
2251
  ...options.headers
2224
2252
  }
2225
2253
  });
2254
+ var postUsersAuthPasswordResetRequest = (options) => (options.client ?? client).post({
2255
+ security: [{ scheme: "bearer", type: "http" }],
2256
+ url: "/users/auth/password-reset/request",
2257
+ ...options,
2258
+ headers: {
2259
+ "Content-Type": "application/vnd.api+json",
2260
+ ...options.headers
2261
+ }
2262
+ });
2226
2263
  var getExtractionBatchesWorkspaceByWorkspaceId = (options) => (options.client ?? client).get({
2227
2264
  security: [{ scheme: "bearer", type: "http" }],
2228
2265
  url: "/extraction/batches/workspace/{workspace_id}",
@@ -2382,6 +2419,15 @@ var patchRetentionPoliciesById = (options) => (options.client ?? client).patch({
2382
2419
  ...options.headers
2383
2420
  }
2384
2421
  });
2422
+ var patchWorkspacesByIdAllocate = (options) => (options.client ?? client).patch({
2423
+ security: [{ scheme: "bearer", type: "http" }],
2424
+ url: "/workspaces/{id}/allocate",
2425
+ ...options,
2426
+ headers: {
2427
+ "Content-Type": "application/vnd.api+json",
2428
+ ...options.headers
2429
+ }
2430
+ });
2385
2431
  var patchInvitationsByIdRevoke = (options) => (options.client ?? client).patch({
2386
2432
  security: [{ scheme: "bearer", type: "http" }],
2387
2433
  url: "/invitations/{id}/revoke",
@@ -2632,6 +2678,11 @@ var postCrmCompanies = (options) => (options.client ?? client).post({
2632
2678
  ...options.headers
2633
2679
  }
2634
2680
  });
2681
+ var getPlanFeatureAllocations = (options) => (options.client ?? client).get({
2682
+ security: [{ scheme: "bearer", type: "http" }],
2683
+ url: "/plan-feature-allocations",
2684
+ ...options
2685
+ });
2635
2686
  var patchLegalDocumentsByIdUnpublish = (options) => (options.client ?? client).patch({
2636
2687
  security: [{ scheme: "bearer", type: "http" }],
2637
2688
  url: "/legal-documents/{id}/unpublish",
@@ -2763,6 +2814,15 @@ var patchEmailInboundAddressesByIdDisable = (options) => (options.client ?? clie
2763
2814
  ...options.headers
2764
2815
  }
2765
2816
  });
2817
+ var patchWorkspacesByIdPopulateHashes = (options) => (options.client ?? client).patch({
2818
+ security: [{ scheme: "bearer", type: "http" }],
2819
+ url: "/workspaces/{id}/populate-hashes",
2820
+ ...options,
2821
+ headers: {
2822
+ "Content-Type": "application/vnd.api+json",
2823
+ ...options.headers
2824
+ }
2825
+ });
2766
2826
  var deleteSchedulingCalendarSyncsById = (options) => (options.client ?? client).delete({
2767
2827
  security: [{ scheme: "bearer", type: "http" }],
2768
2828
  url: "/scheduling/calendar-syncs/{id}",
@@ -3085,6 +3145,11 @@ var getLegalAcceptancesById = (options) => (options.client ?? client).get({
3085
3145
  url: "/legal-acceptances/{id}",
3086
3146
  ...options
3087
3147
  });
3148
+ var getPlanFeatureAllocationsByPlanByPlanId = (options) => (options.client ?? client).get({
3149
+ security: [{ scheme: "bearer", type: "http" }],
3150
+ url: "/plan-feature-allocations/by-plan/{plan_id}",
3151
+ ...options
3152
+ });
3088
3153
  var deleteCrmRelationshipTypesById = (options) => (options.client ?? client).delete({
3089
3154
  security: [{ scheme: "bearer", type: "http" }],
3090
3155
  url: "/crm/relationship-types/{id}",
@@ -3627,6 +3692,11 @@ var postInvitations = (options) => (options.client ?? client).post({
3627
3692
  ...options.headers
3628
3693
  }
3629
3694
  });
3695
+ var getCrmPipelineStagesPipelineByPipelineId = (options) => (options.client ?? client).get({
3696
+ security: [{ scheme: "bearer", type: "http" }],
3697
+ url: "/crm/pipeline-stages/pipeline/{pipeline_id}",
3698
+ ...options
3699
+ });
3630
3700
  var patchThreadsByIdArchive = (options) => (options.client ?? client).patch({
3631
3701
  security: [{ scheme: "bearer", type: "http" }],
3632
3702
  url: "/threads/{id}/archive",
@@ -4073,6 +4143,11 @@ var getVoiceRecordingsSessionBySessionId = (options) => (options.client ?? clien
4073
4143
  url: "/voice/recordings/session/{session_id}",
4074
4144
  ...options
4075
4145
  });
4146
+ var getBrandIdentitiesByWorkspaceByWorkspaceId = (options) => (options.client ?? client).get({
4147
+ security: [{ scheme: "bearer", type: "http" }],
4148
+ url: "/brand-identities/by-workspace/{workspace_id}",
4149
+ ...options
4150
+ });
4076
4151
  var postExtractionDocumentsUpload = (options) => (options.client ?? client).post({
4077
4152
  security: [{ scheme: "bearer", type: "http" }],
4078
4153
  url: "/extraction/documents/upload",
@@ -4175,6 +4250,15 @@ var getWorkspacesById = (options) => (options.client ?? client).get({
4175
4250
  url: "/workspaces/{id}",
4176
4251
  ...options
4177
4252
  });
4253
+ var patchWorkspacesById = (options) => (options.client ?? client).patch({
4254
+ security: [{ scheme: "bearer", type: "http" }],
4255
+ url: "/workspaces/{id}",
4256
+ ...options,
4257
+ headers: {
4258
+ "Content-Type": "application/vnd.api+json",
4259
+ ...options.headers
4260
+ }
4261
+ });
4178
4262
  var getCrawlerSchedules = (options) => (options.client ?? client).get({
4179
4263
  security: [{ scheme: "bearer", type: "http" }],
4180
4264
  url: "/crawler/schedules",
@@ -4208,6 +4292,15 @@ var getTenants = (options) => (options.client ?? client).get({
4208
4292
  url: "/tenants",
4209
4293
  ...options
4210
4294
  });
4295
+ var postTenants = (options) => (options.client ?? client).post({
4296
+ security: [{ scheme: "bearer", type: "http" }],
4297
+ url: "/tenants",
4298
+ ...options,
4299
+ headers: {
4300
+ "Content-Type": "application/vnd.api+json",
4301
+ ...options.headers
4302
+ }
4303
+ });
4211
4304
  var getExtractionSchemaDiscoveriesById = (options) => (options.client ?? client).get({
4212
4305
  security: [{ scheme: "bearer", type: "http" }],
4213
4306
  url: "/extraction/schema-discoveries/{id}",
@@ -4538,6 +4631,15 @@ var getCrmActivitiesById = (options) => (options.client ?? client).get({
4538
4631
  url: "/crm/activities/{id}",
4539
4632
  ...options
4540
4633
  });
4634
+ var patchCrmActivitiesById = (options) => (options.client ?? client).patch({
4635
+ security: [{ scheme: "bearer", type: "http" }],
4636
+ url: "/crm/activities/{id}",
4637
+ ...options,
4638
+ headers: {
4639
+ "Content-Type": "application/vnd.api+json",
4640
+ ...options.headers
4641
+ }
4642
+ });
4541
4643
  var postTrainingExamplesSearch = (options) => (options.client ?? client).post({
4542
4644
  security: [{ scheme: "bearer", type: "http" }],
4543
4645
  url: "/training-examples/search",
@@ -4570,6 +4672,15 @@ var patchSchedulingEventsByIdCancel = (options) => (options.client ?? client).pa
4570
4672
  ...options.headers
4571
4673
  }
4572
4674
  });
4675
+ var patchTenantsByIdTransferOwnership = (options) => (options.client ?? client).patch({
4676
+ security: [{ scheme: "bearer", type: "http" }],
4677
+ url: "/tenants/{id}/transfer-ownership",
4678
+ ...options,
4679
+ headers: {
4680
+ "Content-Type": "application/vnd.api+json",
4681
+ ...options.headers
4682
+ }
4683
+ });
4573
4684
  var deleteAgentsById = (options) => (options.client ?? client).delete({
4574
4685
  security: [{ scheme: "bearer", type: "http" }],
4575
4686
  url: "/agents/{id}",
@@ -4785,6 +4896,20 @@ var patchExtractionDocumentsByIdVerification = (options) => (options.client ?? c
4785
4896
  ...options.headers
4786
4897
  }
4787
4898
  });
4899
+ var getPlatformTones = (options) => (options.client ?? client).get({
4900
+ security: [{ scheme: "bearer", type: "http" }],
4901
+ url: "/platform-tones",
4902
+ ...options
4903
+ });
4904
+ var postPlatformTones = (options) => (options.client ?? client).post({
4905
+ security: [{ scheme: "bearer", type: "http" }],
4906
+ url: "/platform-tones",
4907
+ ...options,
4908
+ headers: {
4909
+ "Content-Type": "application/vnd.api+json",
4910
+ ...options.headers
4911
+ }
4912
+ });
4788
4913
  var postThreadsByIdFork = (options) => (options.client ?? client).post({
4789
4914
  security: [{ scheme: "bearer", type: "http" }],
4790
4915
  url: "/threads/{id}/fork",
@@ -4966,6 +5091,20 @@ var getPermissions = (options) => (options.client ?? client).get({
4966
5091
  url: "/permissions",
4967
5092
  ...options
4968
5093
  });
5094
+ var getBrandIdentities = (options) => (options.client ?? client).get({
5095
+ security: [{ scheme: "bearer", type: "http" }],
5096
+ url: "/brand-identities",
5097
+ ...options
5098
+ });
5099
+ var postBrandIdentities = (options) => (options.client ?? client).post({
5100
+ security: [{ scheme: "bearer", type: "http" }],
5101
+ url: "/brand-identities",
5102
+ ...options,
5103
+ headers: {
5104
+ "Content-Type": "application/vnd.api+json",
5105
+ ...options.headers
5106
+ }
5107
+ });
4969
5108
  var patchEmailOutboundEmailsByIdCancelSchedule = (options) => (options.client ?? client).patch({
4970
5109
  security: [{ scheme: "bearer", type: "http" }],
4971
5110
  url: "/email/outbound-emails/{id}/cancel-schedule",
@@ -5044,6 +5183,11 @@ var patchSupportTicketsByIdAssign = (options) => (options.client ?? client).patc
5044
5183
  ...options.headers
5045
5184
  }
5046
5185
  });
5186
+ var getPlanFeatureAllocationsById = (options) => (options.client ?? client).get({
5187
+ security: [{ scheme: "bearer", type: "http" }],
5188
+ url: "/plan-feature-allocations/{id}",
5189
+ ...options
5190
+ });
5047
5191
  var getAgentsByIdTrainingStats = (options) => (options.client ?? client).get({
5048
5192
  security: [{ scheme: "bearer", type: "http" }],
5049
5193
  url: "/agents/{id}/training-stats",
@@ -5179,14 +5323,10 @@ var getWorkspacesMine = (options) => (options.client ?? client).get({
5179
5323
  url: "/workspaces/mine",
5180
5324
  ...options
5181
5325
  });
5182
- var postTenantsIsv = (options) => (options.client ?? client).post({
5326
+ var getPlatformTonesByBrandByBrandIdentityId = (options) => (options.client ?? client).get({
5183
5327
  security: [{ scheme: "bearer", type: "http" }],
5184
- url: "/tenants/isv",
5185
- ...options,
5186
- headers: {
5187
- "Content-Type": "application/vnd.api+json",
5188
- ...options.headers
5189
- }
5328
+ url: "/platform-tones/by-brand/{brand_identity_id}",
5329
+ ...options
5190
5330
  });
5191
5331
  var getScanResultsById = (options) => (options.client ?? client).get({
5192
5332
  security: [{ scheme: "bearer", type: "http" }],
@@ -5339,6 +5479,15 @@ var getFieldTemplatesById = (options) => (options.client ?? client).get({
5339
5479
  url: "/field-templates/{id}",
5340
5480
  ...options
5341
5481
  });
5482
+ var postTenantsOrg = (options) => (options.client ?? client).post({
5483
+ security: [{ scheme: "bearer", type: "http" }],
5484
+ url: "/tenants/org",
5485
+ ...options,
5486
+ headers: {
5487
+ "Content-Type": "application/vnd.api+json",
5488
+ ...options.headers
5489
+ }
5490
+ });
5342
5491
  var postUsersAuthRegister = (options) => (options.client ?? client).post({
5343
5492
  security: [{ scheme: "bearer", type: "http" }],
5344
5493
  url: "/users/auth/register",
@@ -5353,6 +5502,25 @@ var getStorageFilesChildren = (options) => (options.client ?? client).get({
5353
5502
  url: "/storage-files/children",
5354
5503
  ...options
5355
5504
  });
5505
+ var deleteBrandIdentitiesById = (options) => (options.client ?? client).delete({
5506
+ security: [{ scheme: "bearer", type: "http" }],
5507
+ url: "/brand-identities/{id}",
5508
+ ...options
5509
+ });
5510
+ var getBrandIdentitiesById = (options) => (options.client ?? client).get({
5511
+ security: [{ scheme: "bearer", type: "http" }],
5512
+ url: "/brand-identities/{id}",
5513
+ ...options
5514
+ });
5515
+ var patchBrandIdentitiesById = (options) => (options.client ?? client).patch({
5516
+ security: [{ scheme: "bearer", type: "http" }],
5517
+ url: "/brand-identities/{id}",
5518
+ ...options,
5519
+ headers: {
5520
+ "Content-Type": "application/vnd.api+json",
5521
+ ...options.headers
5522
+ }
5523
+ });
5356
5524
  var getTrainingExamples = (options) => (options.client ?? client).get({
5357
5525
  security: [{ scheme: "bearer", type: "http" }],
5358
5526
  url: "/training-examples",
@@ -5466,6 +5634,15 @@ var postConnectorsByIdPracticeBetterPushNote = (options) => (options.client ?? c
5466
5634
  ...options.headers
5467
5635
  }
5468
5636
  });
5637
+ var patchBrandIdentitiesByIdUnsetDefault = (options) => (options.client ?? client).patch({
5638
+ security: [{ scheme: "bearer", type: "http" }],
5639
+ url: "/brand-identities/{id}/unset-default",
5640
+ ...options,
5641
+ headers: {
5642
+ "Content-Type": "application/vnd.api+json",
5643
+ ...options.headers
5644
+ }
5645
+ });
5469
5646
  var deleteTenantsById = (options) => (options.client ?? client).delete({
5470
5647
  security: [{ scheme: "bearer", type: "http" }],
5471
5648
  url: "/tenants/{id}",
@@ -5625,6 +5802,20 @@ var postConsentRecords = (options) => (options.client ?? client).post({
5625
5802
  ...options.headers
5626
5803
  }
5627
5804
  });
5805
+ var patchBrandIdentitiesByIdSetDefault = (options) => (options.client ?? client).patch({
5806
+ security: [{ scheme: "bearer", type: "http" }],
5807
+ url: "/brand-identities/{id}/set-default",
5808
+ ...options,
5809
+ headers: {
5810
+ "Content-Type": "application/vnd.api+json",
5811
+ ...options.headers
5812
+ }
5813
+ });
5814
+ var getBrandIdentitiesDefaultTenantByTenantId = (options) => (options.client ?? client).get({
5815
+ security: [{ scheme: "bearer", type: "http" }],
5816
+ url: "/brand-identities/default/tenant/{tenant_id}",
5817
+ ...options
5818
+ });
5628
5819
  var postUsersAuthResendConfirmation = (options) => (options.client ?? client).post({
5629
5820
  security: [{ scheme: "bearer", type: "http" }],
5630
5821
  url: "/users/auth/resend-confirmation",
@@ -5863,6 +6054,15 @@ var patchStorageFilesByIdTag = (options) => (options.client ?? client).patch({
5863
6054
  ...options.headers
5864
6055
  }
5865
6056
  });
6057
+ var patchCrmDealsByIdMoveStage = (options) => (options.client ?? client).patch({
6058
+ security: [{ scheme: "bearer", type: "http" }],
6059
+ url: "/crm/deals/{id}/move-stage",
6060
+ ...options,
6061
+ headers: {
6062
+ "Content-Type": "application/vnd.api+json",
6063
+ ...options.headers
6064
+ }
6065
+ });
5866
6066
  var getApiKeys = (options) => (options.client ?? client).get({
5867
6067
  security: [{ scheme: "bearer", type: "http" }],
5868
6068
  url: "/api-keys",
@@ -5924,6 +6124,11 @@ var postExtractionDocumentsBulkReprocess = (options) => (options.client ?? clien
5924
6124
  ...options.headers
5925
6125
  }
5926
6126
  });
6127
+ var getApplicationsBySlugBySlug = (options) => (options.client ?? client).get({
6128
+ security: [{ scheme: "bearer", type: "http" }],
6129
+ url: "/applications/by-slug/{slug}",
6130
+ ...options
6131
+ });
5927
6132
  var getWebhookConfigs = (options) => (options.client ?? client).get({
5928
6133
  security: [{ scheme: "bearer", type: "http" }],
5929
6134
  url: "/webhook-configs",
@@ -6187,6 +6392,25 @@ var getCrmCompaniesWorkspaceByWorkspaceId = (options) => (options.client ?? clie
6187
6392
  url: "/crm/companies/workspace/{workspace_id}",
6188
6393
  ...options
6189
6394
  });
6395
+ var deletePlatformTonesById = (options) => (options.client ?? client).delete({
6396
+ security: [{ scheme: "bearer", type: "http" }],
6397
+ url: "/platform-tones/{id}",
6398
+ ...options
6399
+ });
6400
+ var getPlatformTonesById = (options) => (options.client ?? client).get({
6401
+ security: [{ scheme: "bearer", type: "http" }],
6402
+ url: "/platform-tones/{id}",
6403
+ ...options
6404
+ });
6405
+ var patchPlatformTonesById = (options) => (options.client ?? client).patch({
6406
+ security: [{ scheme: "bearer", type: "http" }],
6407
+ url: "/platform-tones/{id}",
6408
+ ...options,
6409
+ headers: {
6410
+ "Content-Type": "application/vnd.api+json",
6411
+ ...options.headers
6412
+ }
6413
+ });
6190
6414
  var getCreditPackages = (options) => (options.client ?? client).get({
6191
6415
  security: [{ scheme: "bearer", type: "http" }],
6192
6416
  url: "/credit-packages",
@@ -6397,30 +6621,33 @@ function createAgentsNamespace(rb) {
6397
6621
  return rb.execute(getAgentsById, { path: { id } }, options);
6398
6622
  },
6399
6623
  /**
6400
- * Creates a new agent with the given name and prompt template.
6624
+ * Creates a new agent with a blank initial version (v1).
6625
+ *
6626
+ * The agent is created with default settings. To set the prompt template,
6627
+ * create or update a schema version after creation:
6401
6628
  *
6402
- * The prompt template is the system prompt that shapes the agent's behavior.
6403
- * Additional attributes such as output schema fields, model preferences, or
6404
- * metadata can be passed via the `attributes` parameter.
6629
+ * ```typescript
6630
+ * const agent = await client.agents.create('Invoice Parser');
6631
+ * await client.agents.updateSchemaVersion(agent.id, versionId, {
6632
+ * prompt_template: 'You are an expert invoice parser...',
6633
+ * });
6634
+ * ```
6405
6635
  *
6406
- * @param name - A human-readable display name for the agent (e.g. `"Invoice Parser"`).
6407
- * @param promptTemplate - The system prompt that defines how the agent behaves.
6408
- * @param attributes - Optional additional attributes to set on the agent resource
6409
- * (e.g. `{ model: 'gpt-4o', temperature: 0.2 }`).
6636
+ * @param name - The display name for the agent.
6637
+ * @param attributes - Optional agent attributes (description, instructions, tags, etc.).
6410
6638
  * @param options - Optional request options.
6411
- * @returns A promise that resolves to the newly created `Agent` object.
6639
+ * @returns A promise that resolves to the created `Agent` object with its auto-generated v1.
6412
6640
  *
6413
6641
  * @example
6414
6642
  * const client = new GptClient({ apiKey: 'sk_app_...' });
6415
6643
  *
6416
- * const agent = await client.agents.create(
6417
- * 'Invoice Parser',
6418
- * 'You are an expert at extracting structured data from invoice documents.',
6419
- * { model: 'gpt-4o', temperature: 0 },
6420
- * );
6644
+ * const agent = await client.agents.create('Invoice Parser', {
6645
+ * description: 'Extracts structured data from invoices',
6646
+ * instructions: 'Focus on line items and totals',
6647
+ * });
6421
6648
  * console.log(`Created agent: ${agent.id}`);
6422
6649
  */
6423
- create: async (name, promptTemplate, attributes, options) => {
6650
+ create: async (name, attributes, options) => {
6424
6651
  return rb.execute(
6425
6652
  postAgents,
6426
6653
  {
@@ -6429,7 +6656,6 @@ function createAgentsNamespace(rb) {
6429
6656
  type: "agent",
6430
6657
  attributes: {
6431
6658
  name,
6432
- prompt_template: promptTemplate,
6433
6659
  ...attributes
6434
6660
  }
6435
6661
  }
@@ -6446,7 +6672,7 @@ function createAgentsNamespace(rb) {
6446
6672
  *
6447
6673
  * @param id - The UUID of the agent to update.
6448
6674
  * @param attributes - A partial map of agent attributes to update
6449
- * (e.g. `{ name: 'New Name', prompt_template: '...' }`).
6675
+ * (e.g. `{ name: 'New Name', description: 'Updated description' }`).
6450
6676
  * @param options - Optional request options.
6451
6677
  * @returns A promise that resolves to the updated `Agent` object.
6452
6678
  *
@@ -9038,7 +9264,7 @@ function createBillingNamespace(rb) {
9038
9264
  create: async (attributes, options) => {
9039
9265
  return rb.execute(
9040
9266
  postPaymentMethods,
9041
- { body: { data: { type: "payment_method", attributes } } },
9267
+ { body: { data: { type: "payment-method", attributes } } },
9042
9268
  options
9043
9269
  );
9044
9270
  },
@@ -9065,7 +9291,7 @@ function createBillingNamespace(rb) {
9065
9291
  return rb.execute(
9066
9292
  postPaymentMethodsTokenize,
9067
9293
  {
9068
- body: { data: { type: "payment_method", attributes: cardDetails } }
9294
+ body: { data: { type: "payment-method", attributes: cardDetails } }
9069
9295
  },
9070
9296
  options
9071
9297
  );
@@ -9095,7 +9321,7 @@ function createBillingNamespace(rb) {
9095
9321
  patchPaymentMethodsById,
9096
9322
  {
9097
9323
  path: { id },
9098
- body: { data: { id, type: "payment_method", attributes } }
9324
+ body: { data: { id, type: "payment-method", attributes } }
9099
9325
  },
9100
9326
  options
9101
9327
  );
@@ -9251,6 +9477,65 @@ function createBillingNamespace(rb) {
9251
9477
  );
9252
9478
  return result.data ?? result;
9253
9479
  }
9480
+ },
9481
+ /**
9482
+ * Plan-feature allocations — per-plan overrides for feature definitions (read-only).
9483
+ *
9484
+ * Allocations link feature definitions to plans, specifying which features are
9485
+ * enabled on each plan and any per-plan overrides for limits, credit costs,
9486
+ * and activation costs. Use `listByPlan` to build plan comparison tables.
9487
+ */
9488
+ planFeatureAllocations: {
9489
+ /** List all plan-feature allocations for the current application. */
9490
+ list: async (options) => {
9491
+ return rb.execute(
9492
+ getPlanFeatureAllocations,
9493
+ buildPageQuery(options?.page, options?.pageSize),
9494
+ options
9495
+ );
9496
+ },
9497
+ /** Fetch all plan-feature allocations by paginating through every page. */
9498
+ listAll: async (options) => {
9499
+ return paginateToArray(
9500
+ rb.createPaginatedFetcher(
9501
+ getPlanFeatureAllocations,
9502
+ (page, pageSize) => ({
9503
+ query: { page: { number: page, size: pageSize } }
9504
+ }),
9505
+ options
9506
+ )
9507
+ );
9508
+ },
9509
+ /** Get a plan-feature allocation by ID. */
9510
+ get: async (id, options) => {
9511
+ return rb.execute(
9512
+ getPlanFeatureAllocationsById,
9513
+ { path: { id } },
9514
+ options
9515
+ );
9516
+ },
9517
+ /**
9518
+ * List allocations for a specific plan.
9519
+ *
9520
+ * Use this to build a plan comparison table — returns all feature
9521
+ * allocations (enabled/disabled, limits, costs) for one plan.
9522
+ *
9523
+ * @param planId - UUID of the plan to query.
9524
+ *
9525
+ * @example
9526
+ * ```typescript
9527
+ * const allocations = await client.billing.planFeatureAllocations.listByPlan(planId);
9528
+ * const enabledFeatures = allocations.filter(a => a.attributes?.enabled);
9529
+ * ```
9530
+ */
9531
+ listByPlan: async (planId, options) => {
9532
+ const result = await rb.execute(
9533
+ getPlanFeatureAllocationsByPlanByPlanId,
9534
+ { path: { plan_id: planId } },
9535
+ options
9536
+ );
9537
+ return result.data ?? result;
9538
+ }
9254
9539
  }
9255
9540
  };
9256
9541
  }
@@ -14292,6 +14577,7 @@ function createCrmNamespace(rb) {
14292
14577
  {
14293
14578
  path: { workspace_id: workspaceId },
14294
14579
  query: {
14580
+ ...options?.name ? { name: options.name } : {},
14295
14581
  ...options?.status ? { status: options.status } : {},
14296
14582
  ...options?.filters ? { filters: options.filters } : {},
14297
14583
  ...options?.tags ? { tags: options.tags } : {},
@@ -14622,6 +14908,33 @@ function createCrmNamespace(rb) {
14622
14908
  options
14623
14909
  );
14624
14910
  },
14911
+ /**
14912
+ * Move a deal to a different pipeline stage.
14913
+ *
14914
+ * @param id - The unique identifier of the deal to move.
14915
+ * @param attributes - Must include `stage_id` (the target stage).
14916
+ * @param options - Optional request-level overrides.
14917
+ * @returns A promise that resolves to the updated {@link CrmDeal}.
14918
+ *
14919
+ * @example
14920
+ * ```typescript
14921
+ * const client = new GptClient({ apiKey: 'sk_app_...' });
14922
+ *
14923
+ * const deal = await client.crm.deals.moveStage('deal_abc123', {
14924
+ * stage_id: 'stage_closed_won',
14925
+ * });
14926
+ * ```
14927
+ */
14928
+ moveStage: async (id, attributes, options) => {
14929
+ return rb.execute(
14930
+ patchCrmDealsByIdMoveStage,
14931
+ {
14932
+ path: { id },
14933
+ body: { data: { type: "crm_deal", id, attributes } }
14934
+ },
14935
+ options
14936
+ );
14937
+ },
14625
14938
  /**
14626
14939
  * Permanently delete a deal.
14627
14940
  *
@@ -14733,30 +15046,57 @@ function createCrmNamespace(rb) {
14733
15046
  );
14734
15047
  },
14735
15048
  /**
14736
- * Permanently delete an activity.
15049
+ * Update an existing activity's attributes.
14737
15050
  *
14738
- * @param id - The unique identifier of the activity to delete.
15051
+ * @param id - The unique identifier of the activity to update.
15052
+ * @param attributes - Key/value map of attributes to change.
14739
15053
  * @param options - Optional request-level overrides.
14740
- * @returns A promise that resolves to `true` on successful deletion.
15054
+ * @returns A promise that resolves to the updated {@link CrmActivity}.
14741
15055
  *
14742
15056
  * @example
14743
15057
  * ```typescript
14744
15058
  * const client = new GptClient({ apiKey: 'sk_app_...' });
14745
15059
  *
14746
- * await client.crm.activities.delete('act_abc123');
15060
+ * const activity = await client.crm.activities.update('act_abc123', {
15061
+ * note: 'Updated notes from follow-up call.',
15062
+ * });
14747
15063
  * ```
14748
15064
  */
14749
- delete: async (id, options) => {
14750
- return rb.executeDelete(
14751
- deleteCrmActivitiesById,
14752
- { path: { id } },
15065
+ update: async (id, attributes, options) => {
15066
+ return rb.execute(
15067
+ patchCrmActivitiesById,
15068
+ {
15069
+ path: { id },
15070
+ body: { data: { id, type: "crm_activity", attributes } }
15071
+ },
14753
15072
  options
14754
15073
  );
14755
15074
  },
14756
15075
  /**
14757
- * List activities in a workspace with optional pagination.
15076
+ * Permanently delete an activity.
14758
15077
  *
14759
- * @param workspaceId - The ID of the workspace to list activities from.
15078
+ * @param id - The unique identifier of the activity to delete.
15079
+ * @param options - Optional request-level overrides.
15080
+ * @returns A promise that resolves to `true` on successful deletion.
15081
+ *
15082
+ * @example
15083
+ * ```typescript
15084
+ * const client = new GptClient({ apiKey: 'sk_app_...' });
15085
+ *
15086
+ * await client.crm.activities.delete('act_abc123');
15087
+ * ```
15088
+ */
15089
+ delete: async (id, options) => {
15090
+ return rb.executeDelete(
15091
+ deleteCrmActivitiesById,
15092
+ { path: { id } },
15093
+ options
15094
+ );
15095
+ },
15096
+ /**
15097
+ * List activities in a workspace with optional pagination.
15098
+ *
15099
+ * @param workspaceId - The ID of the workspace to list activities from.
14760
15100
  * @param options - Optional pagination controls and request-level overrides.
14761
15101
  * @returns A promise that resolves to an array of {@link CrmActivity} records.
14762
15102
  *
@@ -15018,6 +15358,28 @@ function createCrmNamespace(rb) {
15018
15358
  { path: { id } },
15019
15359
  options
15020
15360
  );
15361
+ },
15362
+ /**
15363
+ * List all stages belonging to a specific pipeline.
15364
+ *
15365
+ * @param pipelineId - The ID of the pipeline whose stages to list.
15366
+ * @param options - Optional request-level overrides.
15367
+ * @returns A promise that resolves to an array of {@link CrmPipelineStage} records.
15368
+ *
15369
+ * @example
15370
+ * ```typescript
15371
+ * const client = new GptClient({ apiKey: 'sk_app_...' });
15372
+ *
15373
+ * const stages = await client.crm.pipelineStages.listByPipeline('pipe_abc123');
15374
+ * stages.forEach((s) => console.log(s.attributes.name, s.attributes.order));
15375
+ * ```
15376
+ */
15377
+ listByPipeline: async (pipelineId, options) => {
15378
+ return rb.execute(
15379
+ getCrmPipelineStagesPipelineByPipelineId,
15380
+ { path: { pipeline_id: pipelineId } },
15381
+ options
15382
+ );
15021
15383
  }
15022
15384
  },
15023
15385
  /**
@@ -19280,7 +19642,7 @@ function createIdentityNamespace(rb, baseUrl) {
19280
19642
  requestPasswordReset: async (email, options) => {
19281
19643
  RequestPasswordResetSchema.parse({ email });
19282
19644
  return rb.execute(
19283
- patchUsersAuthResetPassword,
19645
+ postUsersAuthPasswordResetRequest,
19284
19646
  {
19285
19647
  body: {
19286
19648
  data: { type: "user", attributes: { email } }
@@ -19960,7 +20322,7 @@ function createPlatformNamespace(rb) {
19960
20322
  */
19961
20323
  update: async (id, attributes, options) => {
19962
20324
  return rb.execute(
19963
- patchWorkspacesByIdStorageSettings,
20325
+ patchWorkspacesById,
19964
20326
  {
19965
20327
  path: { id },
19966
20328
  body: { data: { id, type: "workspace", attributes } }
@@ -19968,6 +20330,29 @@ function createPlatformNamespace(rb) {
19968
20330
  options
19969
20331
  );
19970
20332
  },
20333
+ /**
20334
+ * Update storage-specific settings for a workspace.
20335
+ *
20336
+ * Updates the embedded storage settings (e.g., deduplication,
20337
+ * upload limits) without touching other workspace attributes.
20338
+ *
20339
+ * @param id - The UUID of the workspace.
20340
+ * @param settings - Storage settings to update.
20341
+ * @param options - Optional request options.
20342
+ * @returns The updated `Workspace`.
20343
+ */
20344
+ updateStorageSettings: async (id, settings, options) => {
20345
+ return rb.execute(
20346
+ patchWorkspacesByIdStorageSettings,
20347
+ {
20348
+ path: { id },
20349
+ body: {
20350
+ data: { id, type: "workspace", attributes: { settings } }
20351
+ }
20352
+ },
20353
+ options
20354
+ );
20355
+ },
19971
20356
  /**
19972
20357
  * Allocate credits to a workspace.
19973
20358
  *
@@ -19976,20 +20361,63 @@ function createPlatformNamespace(rb) {
19976
20361
  * reflects the updated credit balance.
19977
20362
  *
19978
20363
  * @param workspaceId - The UUID of the workspace to allocate credits for.
20364
+ * @param amount - Number of credits to allocate (max 100,000 per call).
19979
20365
  * @param options - Optional request options.
19980
- * @returns The updated `Workspace` with new credit balance.
20366
+ * @returns The updated `Workspace` after allocation.
19981
20367
  *
19982
20368
  * @example
19983
20369
  * ```typescript
19984
20370
  * const client = new GptClient({ apiKey: 'sk_app_...' });
19985
- * const workspace = await client.platform.workspaces.allocateCredits('ws_abc123');
19986
- * console.log(workspace.attributes?.credit_balance);
20371
+ * const workspace = await client.platform.workspaces.allocateCredits('ws_abc123', 5000);
19987
20372
  * ```
19988
20373
  */
19989
- allocateCredits: async (workspaceId, options) => {
20374
+ allocateCredits: async (workspaceId, amount, options) => {
19990
20375
  return rb.execute(
19991
- postWorkspacesByWorkspaceIdExtractionExports,
19992
- { path: { workspace_id: workspaceId }, body: {} },
20376
+ patchWorkspacesByIdAllocate,
20377
+ {
20378
+ path: { id: workspaceId },
20379
+ body: {
20380
+ data: {
20381
+ id: workspaceId,
20382
+ type: "workspace",
20383
+ attributes: { amount }
20384
+ }
20385
+ }
20386
+ },
20387
+ options
20388
+ );
20389
+ },
20390
+ /**
20391
+ * Populate content hashes for all documents in a workspace.
20392
+ *
20393
+ * Triggers a backfill operation that computes and stores content
20394
+ * hashes for documents that were created before hash-on-upload
20395
+ * was enabled. This is an idempotent operation — documents that
20396
+ * already have hashes are skipped.
20397
+ *
20398
+ * @param workspaceId - The UUID of the workspace to populate hashes for.
20399
+ * @param options - Optional request options.
20400
+ * @returns The updated `Workspace`.
20401
+ *
20402
+ * @example
20403
+ * ```typescript
20404
+ * const client = new GptClient({ apiKey: 'sk_app_...' });
20405
+ * const workspace = await client.platform.workspaces.populateHashes('ws_abc123');
20406
+ * ```
20407
+ */
20408
+ populateHashes: async (workspaceId, options) => {
20409
+ return rb.execute(
20410
+ patchWorkspacesByIdPopulateHashes,
20411
+ {
20412
+ path: { id: workspaceId },
20413
+ body: {
20414
+ data: {
20415
+ id: workspaceId,
20416
+ type: "workspace",
20417
+ attributes: {}
20418
+ }
20419
+ }
20420
+ },
19993
20421
  options
19994
20422
  );
19995
20423
  }
@@ -20190,6 +20618,31 @@ function createPlatformNamespace(rb) {
20190
20618
  */
20191
20619
  readCurrent: async (options) => {
20192
20620
  return rb.execute(getApplicationsCurrent, {}, options);
20621
+ },
20622
+ /**
20623
+ * Fetch an application by its unique slug.
20624
+ *
20625
+ * Looks up an application using its URL-friendly slug identifier
20626
+ * rather than its UUID. Useful for public-facing flows where the
20627
+ * slug is known (e.g., from a vanity URL).
20628
+ *
20629
+ * @param slug - The application slug (e.g., `"my-saas-app"`).
20630
+ * @param options - Optional request options.
20631
+ * @returns The matching `Application`.
20632
+ *
20633
+ * @example
20634
+ * ```typescript
20635
+ * const client = new GptClient({ apiKey: 'sk_app_...' });
20636
+ * const app = await client.platform.applications.getBySlug('my-saas-app');
20637
+ * console.log(app.attributes?.name);
20638
+ * ```
20639
+ */
20640
+ getBySlug: async (slug, options) => {
20641
+ return rb.execute(
20642
+ getApplicationsBySlugBySlug,
20643
+ { path: { slug } },
20644
+ options
20645
+ );
20193
20646
  }
20194
20647
  },
20195
20648
  /**
@@ -20342,7 +20795,7 @@ function createPlatformNamespace(rb) {
20342
20795
  */
20343
20796
  create: async (attributes, options) => {
20344
20797
  return rb.execute(
20345
- postTenantsIsv,
20798
+ postTenants,
20346
20799
  { body: { data: { type: "tenant", attributes } } },
20347
20800
  options
20348
20801
  );
@@ -20399,7 +20852,6 @@ function createPlatformNamespace(rb) {
20399
20852
  options
20400
20853
  );
20401
20854
  },
20402
- /**
20403
20855
  /**
20404
20856
  * Retrieve a single tenant by its ID.
20405
20857
  *
@@ -20430,7 +20882,7 @@ function createPlatformNamespace(rb) {
20430
20882
  */
20431
20883
  transferOwnership: async (tenantId, newOwnerId, options) => {
20432
20884
  return rb.execute(
20433
- patchTenantsById,
20885
+ patchTenantsByIdTransferOwnership,
20434
20886
  {
20435
20887
  path: { id: tenantId },
20436
20888
  body: {
@@ -20443,6 +20895,75 @@ function createPlatformNamespace(rb) {
20443
20895
  },
20444
20896
  options
20445
20897
  );
20898
+ },
20899
+ /**
20900
+ * Convert a personal tenant to an organization.
20901
+ *
20902
+ * Flips `is_personal` to `false`, sets a new name and slug, and
20903
+ * provisions a default workspace if `application_id` is provided.
20904
+ * Only the tenant owner can perform this action.
20905
+ *
20906
+ * @param tenantId - The UUID of the personal tenant to convert.
20907
+ * @param attributes - Conversion attributes. `name` is required; `slug` and `application_id` are optional.
20908
+ * @param options - Optional request options.
20909
+ * @returns The converted `Tenant`.
20910
+ *
20911
+ * @example
20912
+ * ```typescript
20913
+ * const org = await client.platform.tenants.convertToOrg(tenantId, {
20914
+ * name: "My Company",
20915
+ * });
20916
+ * console.log(org.is_personal); // false
20917
+ * ```
20918
+ */
20919
+ convertToOrg: async (tenantId, attributes, options) => {
20920
+ return rb.execute(
20921
+ patchTenantsByIdConvertToOrg,
20922
+ {
20923
+ path: { id: tenantId },
20924
+ body: {
20925
+ data: {
20926
+ id: tenantId,
20927
+ type: "tenant",
20928
+ attributes
20929
+ }
20930
+ }
20931
+ },
20932
+ options
20933
+ );
20934
+ },
20935
+ /**
20936
+ * Create a new organization tenant.
20937
+ *
20938
+ * Requires the application to have `allow_org_creation` enabled.
20939
+ * Provisions a workspace, billing accounts, and storage for the new org.
20940
+ *
20941
+ * @param attributes - Org creation attributes. `name` is required.
20942
+ * @param options - Optional request options.
20943
+ * @returns The newly created organization `Tenant`.
20944
+ */
20945
+ createOrg: async (attributes, options) => {
20946
+ return rb.execute(
20947
+ postTenantsOrg,
20948
+ { body: { data: { type: "tenant", attributes } } },
20949
+ options
20950
+ );
20951
+ },
20952
+ /**
20953
+ * Create a personal tenant for the current user.
20954
+ *
20955
+ * Each user may have at most one personal tenant. Name and slug are
20956
+ * auto-generated from the user's email.
20957
+ *
20958
+ * @param options - Optional request options.
20959
+ * @returns The newly created personal `Tenant`.
20960
+ */
20961
+ createPersonal: async (options) => {
20962
+ return rb.execute(
20963
+ postTenantsPersonal,
20964
+ { body: { data: { type: "tenant", attributes: {} } } },
20965
+ options
20966
+ );
20446
20967
  }
20447
20968
  },
20448
20969
  /**
@@ -20459,12 +20980,14 @@ function createPlatformNamespace(rb) {
20459
20980
  * @param options - Optional request options.
20460
20981
  * @returns The updated `Invitation`.
20461
20982
  */
20462
- accept: async (id, options) => {
20983
+ accept: async (id, token, options) => {
20463
20984
  return rb.execute(
20464
20985
  patchInvitationsByIdAccept,
20465
20986
  {
20466
20987
  path: { id },
20467
- body: { data: { id, type: "invitation", attributes: {} } }
20988
+ body: {
20989
+ data: { id, type: "invitation", attributes: { token } }
20990
+ }
20468
20991
  },
20469
20992
  options
20470
20993
  );
@@ -20584,7 +21107,6 @@ function createPlatformNamespace(rb) {
20584
21107
  options
20585
21108
  );
20586
21109
  },
20587
- /**
20588
21110
  /**
20589
21111
  * Resend an invitation email with a refreshed token and new 7-day expiry.
20590
21112
  *
@@ -20920,6 +21442,441 @@ function createPlatformNamespace(rb) {
20920
21442
  );
20921
21443
  }
20922
21444
  }
21445
+ },
21446
+ /**
21447
+ * Brand Identities — visual branding configuration for tenants and workspaces.
21448
+ *
21449
+ * Brand identities define the visual appearance (colors, logos, fonts) applied
21450
+ * to tenant or workspace experiences. Each brand identity can be scoped to a
21451
+ * tenant or workspace, and one can be marked as the default at each scope level.
21452
+ *
21453
+ * Access via `client.platform.brandIdentities`.
21454
+ */
21455
+ brandIdentities: {
21456
+ /**
21457
+ * List all brand identities accessible to the current actor.
21458
+ *
21459
+ * @param options - Optional page number, page size, and request options.
21460
+ * @returns A page of `BrandIdentity` records.
21461
+ *
21462
+ * @example
21463
+ * ```typescript
21464
+ * const client = new GptClient({ apiKey: 'sk_app_...' });
21465
+ * const brands = await client.platform.brandIdentities.list();
21466
+ * brands.forEach(b => console.log(b.attributes?.name));
21467
+ * ```
21468
+ */
21469
+ list: async (options) => {
21470
+ return rb.execute(
21471
+ getBrandIdentities,
21472
+ buildPageQuery(options?.page, options?.pageSize),
21473
+ options
21474
+ );
21475
+ },
21476
+ /**
21477
+ * Retrieve a single brand identity by its ID.
21478
+ *
21479
+ * @param id - The UUID of the brand identity.
21480
+ * @param options - Optional request options.
21481
+ * @returns The matching `BrandIdentity`.
21482
+ *
21483
+ * @example
21484
+ * ```typescript
21485
+ * const client = new GptClient({ apiKey: 'sk_app_...' });
21486
+ * const brand = await client.platform.brandIdentities.get('bi_abc123');
21487
+ * console.log(brand.attributes?.name, brand.attributes?.primary_color);
21488
+ * ```
21489
+ */
21490
+ get: async (id, options) => {
21491
+ return rb.execute(
21492
+ getBrandIdentitiesById,
21493
+ { path: { id } },
21494
+ options
21495
+ );
21496
+ },
21497
+ /**
21498
+ * Create a new brand identity.
21499
+ *
21500
+ * Defines visual branding (colors, logos, fonts) scoped to a tenant or
21501
+ * workspace. Pass `tenant_id` or `workspace_id` to set the scope.
21502
+ *
21503
+ * @param attributes - Brand identity creation attributes. `name` is required.
21504
+ * @param options - Optional request options.
21505
+ * @returns The newly created `BrandIdentity`.
21506
+ *
21507
+ * @example
21508
+ * ```typescript
21509
+ * const client = new GptClient({ apiKey: 'sk_app_...' });
21510
+ * const brand = await client.platform.brandIdentities.create({
21511
+ * name: 'Acme Healthcare',
21512
+ * primary_color: '#2563eb',
21513
+ * font_family: 'Inter',
21514
+ * tenant_id: 'tenant_abc123',
21515
+ * });
21516
+ * console.log(brand.id);
21517
+ * ```
21518
+ */
21519
+ create: async (attributes, options) => {
21520
+ return rb.execute(
21521
+ postBrandIdentities,
21522
+ { body: { data: { type: "brand_identity", attributes } } },
21523
+ options
21524
+ );
21525
+ },
21526
+ /**
21527
+ * Update a brand identity's attributes.
21528
+ *
21529
+ * @param id - The UUID of the brand identity to update.
21530
+ * @param attributes - Attribute map of fields to change.
21531
+ * @param options - Optional request options.
21532
+ * @returns The updated `BrandIdentity`.
21533
+ *
21534
+ * @example
21535
+ * ```typescript
21536
+ * const client = new GptClient({ apiKey: 'sk_app_...' });
21537
+ * const brand = await client.platform.brandIdentities.update('bi_abc123', {
21538
+ * primary_color: '#dc2626',
21539
+ * tagline: 'Caring for you',
21540
+ * });
21541
+ * ```
21542
+ */
21543
+ update: async (id, attributes, options) => {
21544
+ return rb.execute(
21545
+ patchBrandIdentitiesById,
21546
+ {
21547
+ path: { id },
21548
+ body: { data: { id, type: "brand_identity", attributes } }
21549
+ },
21550
+ options
21551
+ );
21552
+ },
21553
+ /**
21554
+ * Delete a brand identity.
21555
+ *
21556
+ * Permanently removes the brand identity. Any platform tones associated
21557
+ * with this brand identity should be deleted or reassigned first.
21558
+ *
21559
+ * @param id - The UUID of the brand identity to delete.
21560
+ * @param options - Optional request options.
21561
+ * @returns `true` on successful deletion.
21562
+ *
21563
+ * @example
21564
+ * ```typescript
21565
+ * const client = new GptClient({ apiKey: 'sk_app_...' });
21566
+ * await client.platform.brandIdentities.delete('bi_abc123');
21567
+ * ```
21568
+ */
21569
+ delete: async (id, options) => {
21570
+ return rb.executeDelete(
21571
+ deleteBrandIdentitiesById,
21572
+ { path: { id } },
21573
+ options
21574
+ );
21575
+ },
21576
+ /**
21577
+ * List brand identities scoped to a specific tenant.
21578
+ *
21579
+ * @param tenantId - The UUID of the tenant.
21580
+ * @param options - Optional page number, page size, and request options.
21581
+ * @returns A page of `BrandIdentity` records for the tenant.
21582
+ *
21583
+ * @example
21584
+ * ```typescript
21585
+ * const client = new GptClient({ apiKey: 'sk_app_...' });
21586
+ * const brands = await client.platform.brandIdentities.listByTenant('tenant_abc123');
21587
+ * ```
21588
+ */
21589
+ listByTenant: async (tenantId, options) => {
21590
+ return rb.execute(
21591
+ getBrandIdentitiesByTenantByTenantId,
21592
+ {
21593
+ path: { tenant_id: tenantId },
21594
+ ...buildPageQuery(options?.page, options?.pageSize)
21595
+ },
21596
+ options
21597
+ );
21598
+ },
21599
+ /**
21600
+ * List brand identities scoped to a specific workspace.
21601
+ *
21602
+ * @param workspaceId - The UUID of the workspace.
21603
+ * @param options - Optional page number, page size, and request options.
21604
+ * @returns A page of `BrandIdentity` records for the workspace.
21605
+ *
21606
+ * @example
21607
+ * ```typescript
21608
+ * const client = new GptClient({ apiKey: 'sk_app_...' });
21609
+ * const brands = await client.platform.brandIdentities.listByWorkspace('ws_abc123');
21610
+ * ```
21611
+ */
21612
+ listByWorkspace: async (workspaceId, options) => {
21613
+ return rb.execute(
21614
+ getBrandIdentitiesByWorkspaceByWorkspaceId,
21615
+ {
21616
+ path: { workspace_id: workspaceId },
21617
+ ...buildPageQuery(options?.page, options?.pageSize)
21618
+ },
21619
+ options
21620
+ );
21621
+ },
21622
+ /**
21623
+ * Get the default brand identity for a tenant.
21624
+ *
21625
+ * Returns the brand identity marked as default for the given tenant,
21626
+ * or throws if none is set.
21627
+ *
21628
+ * @param tenantId - The UUID of the tenant.
21629
+ * @param options - Optional request options.
21630
+ * @returns The default `BrandIdentity` for the tenant.
21631
+ *
21632
+ * @example
21633
+ * ```typescript
21634
+ * const client = new GptClient({ apiKey: 'sk_app_...' });
21635
+ * const defaultBrand = await client.platform.brandIdentities.getDefaultForTenant('tenant_abc123');
21636
+ * console.log(defaultBrand.attributes?.name);
21637
+ * ```
21638
+ */
21639
+ getDefaultForTenant: async (tenantId, options) => {
21640
+ return rb.execute(
21641
+ getBrandIdentitiesDefaultTenantByTenantId,
21642
+ { path: { tenant_id: tenantId } },
21643
+ options
21644
+ );
21645
+ },
21646
+ /**
21647
+ * Get the default brand identity for a workspace.
21648
+ *
21649
+ * Returns the brand identity marked as default for the given workspace,
21650
+ * or throws if none is set.
21651
+ *
21652
+ * @param workspaceId - The UUID of the workspace.
21653
+ * @param options - Optional request options.
21654
+ * @returns The default `BrandIdentity` for the workspace.
21655
+ *
21656
+ * @example
21657
+ * ```typescript
21658
+ * const client = new GptClient({ apiKey: 'sk_app_...' });
21659
+ * const defaultBrand = await client.platform.brandIdentities.getDefaultForWorkspace('ws_abc123');
21660
+ * console.log(defaultBrand.attributes?.name);
21661
+ * ```
21662
+ */
21663
+ getDefaultForWorkspace: async (workspaceId, options) => {
21664
+ return rb.execute(
21665
+ getBrandIdentitiesDefaultWorkspaceByWorkspaceId,
21666
+ { path: { workspace_id: workspaceId } },
21667
+ options
21668
+ );
21669
+ },
21670
+ /**
21671
+ * Mark a brand identity as the default for its scope (tenant or workspace).
21672
+ *
21673
+ * If another brand identity was previously the default at this scope,
21674
+ * it is automatically unset.
21675
+ *
21676
+ * @param id - The UUID of the brand identity to set as default.
21677
+ * @param options - Optional request options.
21678
+ * @returns The updated `BrandIdentity` with `is_default` set to `true`.
21679
+ *
21680
+ * @example
21681
+ * ```typescript
21682
+ * const client = new GptClient({ apiKey: 'sk_app_...' });
21683
+ * const brand = await client.platform.brandIdentities.setDefault('bi_abc123');
21684
+ * console.log(brand.attributes?.is_default); // true
21685
+ * ```
21686
+ */
21687
+ setDefault: async (id, options) => {
21688
+ return rb.execute(
21689
+ patchBrandIdentitiesByIdSetDefault,
21690
+ {
21691
+ path: { id },
21692
+ body: { data: { id, type: "brand_identity", attributes: {} } }
21693
+ },
21694
+ options
21695
+ );
21696
+ },
21697
+ /**
21698
+ * Remove the default status from a brand identity.
21699
+ *
21700
+ * After this call, the scope (tenant or workspace) will have no default
21701
+ * brand identity until another is explicitly set.
21702
+ *
21703
+ * @param id - The UUID of the brand identity to unset as default.
21704
+ * @param options - Optional request options.
21705
+ * @returns The updated `BrandIdentity` with `is_default` set to `false`.
21706
+ *
21707
+ * @example
21708
+ * ```typescript
21709
+ * const client = new GptClient({ apiKey: 'sk_app_...' });
21710
+ * const brand = await client.platform.brandIdentities.unsetDefault('bi_abc123');
21711
+ * console.log(brand.attributes?.is_default); // false
21712
+ * ```
21713
+ */
21714
+ unsetDefault: async (id, options) => {
21715
+ return rb.execute(
21716
+ patchBrandIdentitiesByIdUnsetDefault,
21717
+ {
21718
+ path: { id },
21719
+ body: { data: { id, type: "brand_identity", attributes: {} } }
21720
+ },
21721
+ options
21722
+ );
21723
+ }
21724
+ },
21725
+ /**
21726
+ * Platform Tones — communication tone and style configuration.
21727
+ *
21728
+ * Platform tones define the voice, formality, and vocabulary preferences
21729
+ * used by AI-generated content within a brand identity context. Each tone
21730
+ * is associated with a brand identity and can be used to customize how
21731
+ * the platform communicates on behalf of the brand.
21732
+ *
21733
+ * Access via `client.platform.platformTones`.
21734
+ */
21735
+ platformTones: {
21736
+ /**
21737
+ * List all platform tones accessible to the current actor.
21738
+ *
21739
+ * @param options - Optional page number, page size, and request options.
21740
+ * @returns A page of `PlatformTone` records.
21741
+ *
21742
+ * @example
21743
+ * ```typescript
21744
+ * const client = new GptClient({ apiKey: 'sk_app_...' });
21745
+ * const tones = await client.platform.platformTones.list();
21746
+ * tones.forEach(t => console.log(t.attributes?.name));
21747
+ * ```
21748
+ */
21749
+ list: async (options) => {
21750
+ return rb.execute(
21751
+ getPlatformTones,
21752
+ buildPageQuery(options?.page, options?.pageSize),
21753
+ options
21754
+ );
21755
+ },
21756
+ /**
21757
+ * Retrieve a single platform tone by its ID.
21758
+ *
21759
+ * @param id - The UUID of the platform tone.
21760
+ * @param options - Optional request options.
21761
+ * @returns The matching `PlatformTone`.
21762
+ *
21763
+ * @example
21764
+ * ```typescript
21765
+ * const client = new GptClient({ apiKey: 'sk_app_...' });
21766
+ * const tone = await client.platform.platformTones.get('pt_abc123');
21767
+ * console.log(tone.attributes?.name, tone.attributes?.formality_level);
21768
+ * ```
21769
+ */
21770
+ get: async (id, options) => {
21771
+ return rb.execute(
21772
+ getPlatformTonesById,
21773
+ { path: { id } },
21774
+ options
21775
+ );
21776
+ },
21777
+ /**
21778
+ * Create a new platform tone.
21779
+ *
21780
+ * Defines tone and style preferences for AI-generated content within
21781
+ * the context of a brand identity. `brand_identity_id` is required to
21782
+ * associate the tone with the correct brand.
21783
+ *
21784
+ * @param attributes - Platform tone creation attributes. `name` and `brand_identity_id` are required.
21785
+ * @param options - Optional request options.
21786
+ * @returns The newly created `PlatformTone`.
21787
+ *
21788
+ * @example
21789
+ * ```typescript
21790
+ * const client = new GptClient({ apiKey: 'sk_app_...' });
21791
+ * const tone = await client.platform.platformTones.create({
21792
+ * name: 'Professional',
21793
+ * brand_identity_id: 'bi_abc123',
21794
+ * formality_level: 'formal',
21795
+ * tone_style: 'authoritative',
21796
+ * });
21797
+ * console.log(tone.id);
21798
+ * ```
21799
+ */
21800
+ create: async (attributes, options) => {
21801
+ return rb.execute(
21802
+ postPlatformTones,
21803
+ { body: { data: { type: "platform_tone", attributes } } },
21804
+ options
21805
+ );
21806
+ },
21807
+ /**
21808
+ * Update a platform tone's attributes.
21809
+ *
21810
+ * @param id - The UUID of the platform tone to update.
21811
+ * @param attributes - Attribute map of fields to change.
21812
+ * @param options - Optional request options.
21813
+ * @returns The updated `PlatformTone`.
21814
+ *
21815
+ * @example
21816
+ * ```typescript
21817
+ * const client = new GptClient({ apiKey: 'sk_app_...' });
21818
+ * const tone = await client.platform.platformTones.update('pt_abc123', {
21819
+ * formality_level: 'casual',
21820
+ * tone_style: 'friendly',
21821
+ * });
21822
+ * ```
21823
+ */
21824
+ update: async (id, attributes, options) => {
21825
+ return rb.execute(
21826
+ patchPlatformTonesById,
21827
+ {
21828
+ path: { id },
21829
+ body: { data: { id, type: "platform_tone", attributes } }
21830
+ },
21831
+ options
21832
+ );
21833
+ },
21834
+ /**
21835
+ * Delete a platform tone.
21836
+ *
21837
+ * Permanently removes the platform tone.
21838
+ *
21839
+ * @param id - The UUID of the platform tone to delete.
21840
+ * @param options - Optional request options.
21841
+ * @returns `true` on successful deletion.
21842
+ *
21843
+ * @example
21844
+ * ```typescript
21845
+ * const client = new GptClient({ apiKey: 'sk_app_...' });
21846
+ * await client.platform.platformTones.delete('pt_abc123');
21847
+ * ```
21848
+ */
21849
+ delete: async (id, options) => {
21850
+ return rb.executeDelete(
21851
+ deletePlatformTonesById,
21852
+ { path: { id } },
21853
+ options
21854
+ );
21855
+ },
21856
+ /**
21857
+ * List platform tones associated with a specific brand identity.
21858
+ *
21859
+ * @param brandIdentityId - The UUID of the brand identity.
21860
+ * @param options - Optional page number, page size, and request options.
21861
+ * @returns A page of `PlatformTone` records for the brand.
21862
+ *
21863
+ * @example
21864
+ * ```typescript
21865
+ * const client = new GptClient({ apiKey: 'sk_app_...' });
21866
+ * const tones = await client.platform.platformTones.listByBrand('bi_abc123');
21867
+ * tones.forEach(t => console.log(t.attributes?.name));
21868
+ * ```
21869
+ */
21870
+ listByBrand: async (brandIdentityId, options) => {
21871
+ return rb.execute(
21872
+ getPlatformTonesByBrandByBrandIdentityId,
21873
+ {
21874
+ path: { brand_identity_id: brandIdentityId },
21875
+ ...buildPageQuery(options?.page, options?.pageSize)
21876
+ },
21877
+ options
21878
+ );
21879
+ }
20923
21880
  }
20924
21881
  };
20925
21882
  }
@@ -23293,7 +24250,7 @@ function createThreadsNamespace(rb) {
23293
24250
  path: { id: threadId },
23294
24251
  body: {
23295
24252
  data: {
23296
- type: "message",
24253
+ type: "thread",
23297
24254
  attributes: {
23298
24255
  content,
23299
24256
  ...rest,