@iblai/iblai-api 4.265.1-core → 4.265.2-core

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.
Files changed (77) hide show
  1. package/dist/index.cjs.js +2168 -258
  2. package/dist/index.cjs.js.map +1 -1
  3. package/dist/index.esm.js +2165 -259
  4. package/dist/index.esm.js.map +1 -1
  5. package/dist/index.umd.js +2168 -258
  6. package/dist/index.umd.js.map +1 -1
  7. package/dist/types/index.d.ts +26 -1
  8. package/dist/types/models/Activity.d.ts +83 -0
  9. package/dist/types/models/ActivityTypeEnum.d.ts +18 -0
  10. package/dist/types/models/Deal.d.ts +83 -0
  11. package/dist/types/models/DealLostRequest.d.ts +10 -0
  12. package/dist/types/models/DealMoveStageRequest.d.ts +10 -0
  13. package/dist/types/models/DealStatusEnum.d.ts +10 -0
  14. package/dist/types/models/DealWonRequest.d.ts +6 -0
  15. package/dist/types/models/LeadSource.d.ts +30 -0
  16. package/dist/types/models/NotificationTemplateDetail.d.ts +24 -2
  17. package/dist/types/models/NotificationTemplateList.d.ts +5 -2
  18. package/dist/types/models/Organization.d.ts +1 -1
  19. package/dist/types/models/PaginatedActivityList.d.ts +7 -0
  20. package/dist/types/models/PaginatedDealList.d.ts +7 -0
  21. package/dist/types/models/PaginatedLeadSourceList.d.ts +7 -0
  22. package/dist/types/models/PaginatedPipelineList.d.ts +7 -0
  23. package/dist/types/models/PaginatedPipelineStageList.d.ts +7 -0
  24. package/dist/types/models/PatchedActivity.d.ts +83 -0
  25. package/dist/types/models/PatchedDeal.d.ts +83 -0
  26. package/dist/types/models/PatchedLeadSource.d.ts +30 -0
  27. package/dist/types/models/PatchedNotificationTemplateDetail.d.ts +24 -2
  28. package/dist/types/models/PatchedOrganization.d.ts +1 -1
  29. package/dist/types/models/PatchedPipeline.d.ts +34 -0
  30. package/dist/types/models/PatchedPipelineStage.d.ts +40 -0
  31. package/dist/types/models/Pipeline.d.ts +34 -0
  32. package/dist/types/models/PipelineStage.d.ts +40 -0
  33. package/dist/types/models/RecipientsRecipientModeEnum.d.ts +14 -0
  34. package/dist/types/models/{TypeD36Enum.d.ts → Type4b7Enum.d.ts} +7 -1
  35. package/dist/types/services/ActivitiesService.d.ts +126 -0
  36. package/dist/types/services/CrmService.d.ts +553 -1
  37. package/dist/types/services/DealsService.d.ts +160 -0
  38. package/dist/types/services/LeadSourcesService.d.ts +95 -0
  39. package/dist/types/services/PersonsService.d.ts +1 -1
  40. package/dist/types/services/PipelinesService.d.ts +183 -0
  41. package/package.json +1 -1
  42. package/sdk_schema.yml +4093 -141
  43. package/src/core/OpenAPI.ts +1 -1
  44. package/src/index.ts +26 -1
  45. package/src/models/Activity.ts +88 -0
  46. package/src/models/ActivityTypeEnum.ts +22 -0
  47. package/src/models/Deal.ts +88 -0
  48. package/src/models/DealLostRequest.ts +15 -0
  49. package/src/models/DealMoveStageRequest.ts +15 -0
  50. package/src/models/DealStatusEnum.ts +14 -0
  51. package/src/models/DealWonRequest.ts +11 -0
  52. package/src/models/LeadSource.ts +35 -0
  53. package/src/models/NotificationTemplateDetail.ts +24 -2
  54. package/src/models/NotificationTemplateList.ts +5 -2
  55. package/src/models/Organization.ts +1 -1
  56. package/src/models/PaginatedActivityList.ts +12 -0
  57. package/src/models/PaginatedDealList.ts +12 -0
  58. package/src/models/PaginatedLeadSourceList.ts +12 -0
  59. package/src/models/PaginatedPipelineList.ts +12 -0
  60. package/src/models/PaginatedPipelineStageList.ts +12 -0
  61. package/src/models/PatchedActivity.ts +88 -0
  62. package/src/models/PatchedDeal.ts +88 -0
  63. package/src/models/PatchedLeadSource.ts +35 -0
  64. package/src/models/PatchedNotificationTemplateDetail.ts +24 -2
  65. package/src/models/PatchedOrganization.ts +1 -1
  66. package/src/models/PatchedPipeline.ts +39 -0
  67. package/src/models/PatchedPipelineStage.ts +45 -0
  68. package/src/models/Pipeline.ts +39 -0
  69. package/src/models/PipelineStage.ts +45 -0
  70. package/src/models/RecipientsRecipientModeEnum.ts +18 -0
  71. package/src/models/{TypeD36Enum.ts → Type4b7Enum.ts} +7 -1
  72. package/src/services/ActivitiesService.ts +255 -0
  73. package/src/services/CrmService.ts +1161 -1
  74. package/src/services/DealsService.ts +337 -0
  75. package/src/services/LeadSourcesService.ts +198 -0
  76. package/src/services/PersonsService.ts +1 -1
  77. package/src/services/PipelinesService.ts +406 -0
package/dist/index.cjs.js CHANGED
@@ -110,7 +110,7 @@ class CancelablePromise {
110
110
 
111
111
  const OpenAPI = {
112
112
  BASE: 'https://base.manager.iblai.app',
113
- VERSION: '4.265.1-core',
113
+ VERSION: '4.265.2-core',
114
114
  WITH_CREDENTIALS: false,
115
115
  CREDENTIALS: 'include',
116
116
  TOKEN: undefined,
@@ -136,6 +136,30 @@ exports.AcceptanceEnum = void 0;
136
136
  AcceptanceEnum["REJECTED"] = "Rejected";
137
137
  })(exports.AcceptanceEnum || (exports.AcceptanceEnum = {}));
138
138
 
139
+ /* generated using openapi-typescript-codegen -- do not edit */
140
+ /* istanbul ignore file */
141
+ /* tslint:disable */
142
+ /* eslint-disable */
143
+ /**
144
+ * * `call` - Call
145
+ * * `meeting` - Meeting
146
+ * * `email` - Email
147
+ * * `note` - Note
148
+ * * `task` - Task
149
+ * * `lunch` - Lunch
150
+ * * `deadline` - Deadline
151
+ */
152
+ exports.ActivityTypeEnum = void 0;
153
+ (function (ActivityTypeEnum) {
154
+ ActivityTypeEnum["CALL"] = "call";
155
+ ActivityTypeEnum["MEETING"] = "meeting";
156
+ ActivityTypeEnum["EMAIL"] = "email";
157
+ ActivityTypeEnum["NOTE"] = "note";
158
+ ActivityTypeEnum["TASK"] = "task";
159
+ ActivityTypeEnum["LUNCH"] = "lunch";
160
+ ActivityTypeEnum["DEADLINE"] = "deadline";
161
+ })(exports.ActivityTypeEnum || (exports.ActivityTypeEnum = {}));
162
+
139
163
  /* generated using openapi-typescript-codegen -- do not edit */
140
164
  /* istanbul ignore file */
141
165
  /* tslint:disable */
@@ -231,6 +255,22 @@ exports.CreditTransactionHistoryStatusEnum = void 0;
231
255
  CreditTransactionHistoryStatusEnum["CANCELLED"] = "cancelled";
232
256
  })(exports.CreditTransactionHistoryStatusEnum || (exports.CreditTransactionHistoryStatusEnum = {}));
233
257
 
258
+ /* generated using openapi-typescript-codegen -- do not edit */
259
+ /* istanbul ignore file */
260
+ /* tslint:disable */
261
+ /* eslint-disable */
262
+ /**
263
+ * * `open` - Open
264
+ * * `won` - Won
265
+ * * `lost` - Lost
266
+ */
267
+ exports.DealStatusEnum = void 0;
268
+ (function (DealStatusEnum) {
269
+ DealStatusEnum["OPEN"] = "open";
270
+ DealStatusEnum["WON"] = "won";
271
+ DealStatusEnum["LOST"] = "lost";
272
+ })(exports.DealStatusEnum || (exports.DealStatusEnum = {}));
273
+
234
274
  /* generated using openapi-typescript-codegen -- do not edit */
235
275
  /* istanbul ignore file */
236
276
  /* tslint:disable */
@@ -693,6 +733,26 @@ exports.ProgramTypeEnum = void 0;
693
733
  ProgramTypeEnum["OTHER"] = "other";
694
734
  })(exports.ProgramTypeEnum || (exports.ProgramTypeEnum = {}));
695
735
 
736
+ /* generated using openapi-typescript-codegen -- do not edit */
737
+ /* istanbul ignore file */
738
+ /* tslint:disable */
739
+ /* eslint-disable */
740
+ /**
741
+ * * `platform_admins_only` - platform_admins_only
742
+ * * `object_owner_only` - object_owner_only
743
+ * * `object_owner_only_strict` - object_owner_only_strict
744
+ * * `platform_admins_and_object_owner` - platform_admins_and_object_owner
745
+ * * `custom` - custom
746
+ */
747
+ exports.RecipientsRecipientModeEnum = void 0;
748
+ (function (RecipientsRecipientModeEnum) {
749
+ RecipientsRecipientModeEnum["PLATFORM_ADMINS_ONLY"] = "platform_admins_only";
750
+ RecipientsRecipientModeEnum["OBJECT_OWNER_ONLY"] = "object_owner_only";
751
+ RecipientsRecipientModeEnum["OBJECT_OWNER_ONLY_STRICT"] = "object_owner_only_strict";
752
+ RecipientsRecipientModeEnum["PLATFORM_ADMINS_AND_OBJECT_OWNER"] = "platform_admins_and_object_owner";
753
+ RecipientsRecipientModeEnum["CUSTOM"] = "custom";
754
+ })(exports.RecipientsRecipientModeEnum || (exports.RecipientsRecipientModeEnum = {}));
755
+
696
756
  /* generated using openapi-typescript-codegen -- do not edit */
697
757
  /* istanbul ignore file */
698
758
  /* tslint:disable */
@@ -797,6 +857,9 @@ exports.TransactionTypeEnum = void 0;
797
857
  * * `COURSE_LICENSE_GROUP_ASSIGNMENT` - Course License Group Assignment
798
858
  * * `COURSE_SCHEDULE_CHANGE` - Course Schedule Change
799
859
  * * `COURSES_PROGRESS_SUMMARY` - Courses Progress Summary
860
+ * * `CRM_DEAL_STAGE_CHANGED` - Crm Deal Stage Changed
861
+ * * `CRM_PERSON_CREATED` - Crm Person Created
862
+ * * `CRM_PERSON_LINKED_TO_USER` - Crm Person Linked To User
800
863
  * * `CUSTOM_NOTIFICATION` - Custom Notification
801
864
  * * `DEFAULT_TEMPLATE` - Default Template
802
865
  * * `HUMAN_SUPPORT_NOTIFICATION` - Human Support Notification
@@ -821,41 +884,44 @@ exports.TransactionTypeEnum = void 0;
821
884
  * * `USER_NOTIF_USER_INACTIVITY` - User Notif User Inactivity
822
885
  * * `USER_NOTIF_USER_REGISTRATION` - User Notif User Registration
823
886
  */
824
- exports.TypeD36Enum = void 0;
825
- (function (TypeD36Enum) {
826
- TypeD36Enum["ACTIVITY_COURSE_MILESTONE"] = "ACTIVITY_COURSE_MILESTONE";
827
- TypeD36Enum["ACTIVITY_NEW_CONTENT"] = "ACTIVITY_NEW_CONTENT";
828
- TypeD36Enum["ADMIN_NOTIF_COURSE_ENROLLMENT"] = "ADMIN_NOTIF_COURSE_ENROLLMENT";
829
- TypeD36Enum["APP_REGISTRATION"] = "APP_REGISTRATION";
830
- TypeD36Enum["COURSE_INVITATION"] = "COURSE_INVITATION";
831
- TypeD36Enum["COURSE_LICENSE_ASSIGNMENT"] = "COURSE_LICENSE_ASSIGNMENT";
832
- TypeD36Enum["COURSE_LICENSE_GROUP_ASSIGNMENT"] = "COURSE_LICENSE_GROUP_ASSIGNMENT";
833
- TypeD36Enum["COURSE_SCHEDULE_CHANGE"] = "COURSE_SCHEDULE_CHANGE";
834
- TypeD36Enum["COURSES_PROGRESS_SUMMARY"] = "COURSES_PROGRESS_SUMMARY";
835
- TypeD36Enum["CUSTOM_NOTIFICATION"] = "CUSTOM_NOTIFICATION";
836
- TypeD36Enum["DEFAULT_TEMPLATE"] = "DEFAULT_TEMPLATE";
837
- TypeD36Enum["HUMAN_SUPPORT_NOTIFICATION"] = "HUMAN_SUPPORT_NOTIFICATION";
838
- TypeD36Enum["PATHWAY_ENROLLMENT_CONFIRMATION"] = "PATHWAY_ENROLLMENT_CONFIRMATION";
839
- TypeD36Enum["PLATFORM_INVITATION"] = "PLATFORM_INVITATION";
840
- TypeD36Enum["POLICY_ASSIGNMENT"] = "POLICY_ASSIGNMENT";
841
- TypeD36Enum["PROACTIVE_LEARNER_NOTIFICATION"] = "PROACTIVE_LEARNER_NOTIFICATION";
842
- TypeD36Enum["PROGRAM_ENROLLMENT_CONFIRMATION"] = "PROGRAM_ENROLLMENT_CONFIRMATION";
843
- TypeD36Enum["PROGRAM_INVITATION"] = "PROGRAM_INVITATION";
844
- TypeD36Enum["PROGRAM_LICENSE_ASSIGNMENT"] = "PROGRAM_LICENSE_ASSIGNMENT";
845
- TypeD36Enum["PROGRAM_LICENSE_GROUP_ASSIGNMENT"] = "PROGRAM_LICENSE_GROUP_ASSIGNMENT";
846
- TypeD36Enum["REPORT_COMPLETED"] = "REPORT_COMPLETED";
847
- TypeD36Enum["ROLE_CHANGE"] = "ROLE_CHANGE";
848
- TypeD36Enum["SKILL_MASTERY_CHANGE"] = "SKILL_MASTERY_CHANGE";
849
- TypeD36Enum["SUBSECTION_GRADE_UPDATE"] = "SUBSECTION_GRADE_UPDATE";
850
- TypeD36Enum["USER_LICENSE_ASSIGNMENT"] = "USER_LICENSE_ASSIGNMENT";
851
- TypeD36Enum["USER_LICENSE_GROUP_ASSIGNMENT"] = "USER_LICENSE_GROUP_ASSIGNMENT";
852
- TypeD36Enum["USER_NOTIF_COURSE_COMPLETION"] = "USER_NOTIF_COURSE_COMPLETION";
853
- TypeD36Enum["USER_NOTIF_COURSE_ENROLLMENT"] = "USER_NOTIF_COURSE_ENROLLMENT";
854
- TypeD36Enum["USER_NOTIF_CREDENTIALS"] = "USER_NOTIF_CREDENTIALS";
855
- TypeD36Enum["USER_NOTIF_LEARNER_PROGRESS"] = "USER_NOTIF_LEARNER_PROGRESS";
856
- TypeD36Enum["USER_NOTIF_USER_INACTIVITY"] = "USER_NOTIF_USER_INACTIVITY";
857
- TypeD36Enum["USER_NOTIF_USER_REGISTRATION"] = "USER_NOTIF_USER_REGISTRATION";
858
- })(exports.TypeD36Enum || (exports.TypeD36Enum = {}));
887
+ exports.Type4b7Enum = void 0;
888
+ (function (Type4b7Enum) {
889
+ Type4b7Enum["ACTIVITY_COURSE_MILESTONE"] = "ACTIVITY_COURSE_MILESTONE";
890
+ Type4b7Enum["ACTIVITY_NEW_CONTENT"] = "ACTIVITY_NEW_CONTENT";
891
+ Type4b7Enum["ADMIN_NOTIF_COURSE_ENROLLMENT"] = "ADMIN_NOTIF_COURSE_ENROLLMENT";
892
+ Type4b7Enum["APP_REGISTRATION"] = "APP_REGISTRATION";
893
+ Type4b7Enum["COURSE_INVITATION"] = "COURSE_INVITATION";
894
+ Type4b7Enum["COURSE_LICENSE_ASSIGNMENT"] = "COURSE_LICENSE_ASSIGNMENT";
895
+ Type4b7Enum["COURSE_LICENSE_GROUP_ASSIGNMENT"] = "COURSE_LICENSE_GROUP_ASSIGNMENT";
896
+ Type4b7Enum["COURSE_SCHEDULE_CHANGE"] = "COURSE_SCHEDULE_CHANGE";
897
+ Type4b7Enum["COURSES_PROGRESS_SUMMARY"] = "COURSES_PROGRESS_SUMMARY";
898
+ Type4b7Enum["CRM_DEAL_STAGE_CHANGED"] = "CRM_DEAL_STAGE_CHANGED";
899
+ Type4b7Enum["CRM_PERSON_CREATED"] = "CRM_PERSON_CREATED";
900
+ Type4b7Enum["CRM_PERSON_LINKED_TO_USER"] = "CRM_PERSON_LINKED_TO_USER";
901
+ Type4b7Enum["CUSTOM_NOTIFICATION"] = "CUSTOM_NOTIFICATION";
902
+ Type4b7Enum["DEFAULT_TEMPLATE"] = "DEFAULT_TEMPLATE";
903
+ Type4b7Enum["HUMAN_SUPPORT_NOTIFICATION"] = "HUMAN_SUPPORT_NOTIFICATION";
904
+ Type4b7Enum["PATHWAY_ENROLLMENT_CONFIRMATION"] = "PATHWAY_ENROLLMENT_CONFIRMATION";
905
+ Type4b7Enum["PLATFORM_INVITATION"] = "PLATFORM_INVITATION";
906
+ Type4b7Enum["POLICY_ASSIGNMENT"] = "POLICY_ASSIGNMENT";
907
+ Type4b7Enum["PROACTIVE_LEARNER_NOTIFICATION"] = "PROACTIVE_LEARNER_NOTIFICATION";
908
+ Type4b7Enum["PROGRAM_ENROLLMENT_CONFIRMATION"] = "PROGRAM_ENROLLMENT_CONFIRMATION";
909
+ Type4b7Enum["PROGRAM_INVITATION"] = "PROGRAM_INVITATION";
910
+ Type4b7Enum["PROGRAM_LICENSE_ASSIGNMENT"] = "PROGRAM_LICENSE_ASSIGNMENT";
911
+ Type4b7Enum["PROGRAM_LICENSE_GROUP_ASSIGNMENT"] = "PROGRAM_LICENSE_GROUP_ASSIGNMENT";
912
+ Type4b7Enum["REPORT_COMPLETED"] = "REPORT_COMPLETED";
913
+ Type4b7Enum["ROLE_CHANGE"] = "ROLE_CHANGE";
914
+ Type4b7Enum["SKILL_MASTERY_CHANGE"] = "SKILL_MASTERY_CHANGE";
915
+ Type4b7Enum["SUBSECTION_GRADE_UPDATE"] = "SUBSECTION_GRADE_UPDATE";
916
+ Type4b7Enum["USER_LICENSE_ASSIGNMENT"] = "USER_LICENSE_ASSIGNMENT";
917
+ Type4b7Enum["USER_LICENSE_GROUP_ASSIGNMENT"] = "USER_LICENSE_GROUP_ASSIGNMENT";
918
+ Type4b7Enum["USER_NOTIF_COURSE_COMPLETION"] = "USER_NOTIF_COURSE_COMPLETION";
919
+ Type4b7Enum["USER_NOTIF_COURSE_ENROLLMENT"] = "USER_NOTIF_COURSE_ENROLLMENT";
920
+ Type4b7Enum["USER_NOTIF_CREDENTIALS"] = "USER_NOTIF_CREDENTIALS";
921
+ Type4b7Enum["USER_NOTIF_LEARNER_PROGRESS"] = "USER_NOTIF_LEARNER_PROGRESS";
922
+ Type4b7Enum["USER_NOTIF_USER_INACTIVITY"] = "USER_NOTIF_USER_INACTIVITY";
923
+ Type4b7Enum["USER_NOTIF_USER_REGISTRATION"] = "USER_NOTIF_USER_REGISTRATION";
924
+ })(exports.Type4b7Enum || (exports.Type4b7Enum = {}));
859
925
 
860
926
  /* generated using openapi-typescript-codegen -- do not edit */
861
927
  /* istanbul ignore file */
@@ -1176,6 +1242,195 @@ class AccountService {
1176
1242
  }
1177
1243
  }
1178
1244
 
1245
+ class ActivitiesService {
1246
+ /**
1247
+ * List activities
1248
+ * Returns a paginated list of Activities in your Platform. Supports filtering by `type`, `is_done`, `owner`, `deal`, `person`, schedule-from ranges, and `metadata__has_key`.
1249
+ *
1250
+ * **Required permission:** `Ibl.CRM/Activities/list`.
1251
+ * @returns PaginatedActivityList
1252
+ * @throws ApiError
1253
+ */
1254
+ static activitiesList({
1255
+ deal,
1256
+ isDone,
1257
+ metadataHasKey,
1258
+ owner,
1259
+ page,
1260
+ pageSize,
1261
+ person,
1262
+ scheduleFromGte,
1263
+ scheduleFromLte,
1264
+ type
1265
+ }) {
1266
+ return request(OpenAPI, {
1267
+ method: 'GET',
1268
+ url: '/activities/',
1269
+ query: {
1270
+ 'deal': deal,
1271
+ 'is_done': isDone,
1272
+ 'metadata__has_key': metadataHasKey,
1273
+ 'owner': owner,
1274
+ 'page': page,
1275
+ 'page_size': pageSize,
1276
+ 'person': person,
1277
+ 'schedule_from__gte': scheduleFromGte,
1278
+ 'schedule_from__lte': scheduleFromLte,
1279
+ 'type': type
1280
+ },
1281
+ errors: {
1282
+ 401: `Authentication required.`,
1283
+ 403: `Missing required permission \`Ibl.CRM/Activities/list\`.`
1284
+ }
1285
+ });
1286
+ }
1287
+ /**
1288
+ * Create an activity
1289
+ * Creates an Activity. Either `deal` or `person` must be supplied; both must belong to your Platform.
1290
+ *
1291
+ * **Required permission:** `Ibl.CRM/Activities/write`.
1292
+ * @returns Activity
1293
+ * @throws ApiError
1294
+ */
1295
+ static activitiesCreate({
1296
+ requestBody
1297
+ }) {
1298
+ return request(OpenAPI, {
1299
+ method: 'POST',
1300
+ url: '/activities/',
1301
+ body: requestBody,
1302
+ mediaType: 'application/json',
1303
+ errors: {
1304
+ 400: `Validation error.`,
1305
+ 403: `Missing required permission \`Ibl.CRM/Activities/write\`.`
1306
+ }
1307
+ });
1308
+ }
1309
+ /**
1310
+ * Retrieve an activity
1311
+ * Returns a single Activity by id.
1312
+ *
1313
+ * **Required permission:** `Ibl.CRM/Activities/read`.
1314
+ * @returns Activity
1315
+ * @throws ApiError
1316
+ */
1317
+ static activitiesRetrieve({
1318
+ id
1319
+ }) {
1320
+ return request(OpenAPI, {
1321
+ method: 'GET',
1322
+ url: '/activities/{id}/',
1323
+ path: {
1324
+ 'id': id
1325
+ },
1326
+ errors: {
1327
+ 403: `Missing required permission \`Ibl.CRM/Activities/read\`.`,
1328
+ 404: `Activity not found.`
1329
+ }
1330
+ });
1331
+ }
1332
+ /**
1333
+ * Replace an activity
1334
+ * Replaces all editable fields on the Activity.
1335
+ *
1336
+ * **Required permission:** `Ibl.CRM/Activities/write`.
1337
+ * @returns Activity
1338
+ * @throws ApiError
1339
+ */
1340
+ static activitiesUpdate({
1341
+ id,
1342
+ requestBody
1343
+ }) {
1344
+ return request(OpenAPI, {
1345
+ method: 'PUT',
1346
+ url: '/activities/{id}/',
1347
+ path: {
1348
+ 'id': id
1349
+ },
1350
+ body: requestBody,
1351
+ mediaType: 'application/json',
1352
+ errors: {
1353
+ 400: `Validation error.`,
1354
+ 403: `Missing required permission \`Ibl.CRM/Activities/write\`.`,
1355
+ 404: `Activity not found.`
1356
+ }
1357
+ });
1358
+ }
1359
+ /**
1360
+ * Update an activity
1361
+ * Updates only the supplied fields on the Activity.
1362
+ *
1363
+ * **Required permission:** `Ibl.CRM/Activities/write`.
1364
+ * @returns Activity
1365
+ * @throws ApiError
1366
+ */
1367
+ static activitiesPartialUpdate({
1368
+ id,
1369
+ requestBody
1370
+ }) {
1371
+ return request(OpenAPI, {
1372
+ method: 'PATCH',
1373
+ url: '/activities/{id}/',
1374
+ path: {
1375
+ 'id': id
1376
+ },
1377
+ body: requestBody,
1378
+ mediaType: 'application/json',
1379
+ errors: {
1380
+ 400: `Validation error.`,
1381
+ 403: `Missing required permission \`Ibl.CRM/Activities/write\`.`,
1382
+ 404: `Activity not found.`
1383
+ }
1384
+ });
1385
+ }
1386
+ /**
1387
+ * Delete an activity
1388
+ * Deletes the Activity.
1389
+ *
1390
+ * **Required permission:** `Ibl.CRM/Activities/delete`.
1391
+ * @returns void
1392
+ * @throws ApiError
1393
+ */
1394
+ static activitiesDestroy({
1395
+ id
1396
+ }) {
1397
+ return request(OpenAPI, {
1398
+ method: 'DELETE',
1399
+ url: '/activities/{id}/',
1400
+ path: {
1401
+ 'id': id
1402
+ },
1403
+ errors: {
1404
+ 403: `Missing required permission \`Ibl.CRM/Activities/delete\`.`,
1405
+ 404: `Activity not found.`
1406
+ }
1407
+ });
1408
+ }
1409
+ /**
1410
+ * Mark an activity as done
1411
+ * Flips `is_done=True` and stamps `done_at` if it isn't already set. Idempotent — calling on an already-done Activity preserves the original `done_at`.
1412
+ *
1413
+ * **Required permission:** `Ibl.CRM/Activities/write`.
1414
+ * @returns Activity
1415
+ * @throws ApiError
1416
+ */
1417
+ static activitiesDoneCreate({
1418
+ id
1419
+ }) {
1420
+ return request(OpenAPI, {
1421
+ method: 'POST',
1422
+ url: '/activities/{id}/done/',
1423
+ path: {
1424
+ 'id': id
1425
+ },
1426
+ errors: {
1427
+ 403: `Missing required permission \`Ibl.CRM/Activities/write\`.`,
1428
+ 404: `Activity not found.`
1429
+ }
1430
+ });
1431
+ }
1432
+ }
1433
+
1179
1434
  class AiAnalyticsService {
1180
1435
  /**
1181
1436
  * Get Content Analytics
@@ -19787,94 +20042,106 @@ class CreditsService {
19787
20042
 
19788
20043
  class CrmService {
19789
20044
  /**
19790
- * List organizations
19791
- * Returns a paginated list of organizations in your Platform. Supports filtering by `owner` and by `name` (case-insensitive substring match).
20045
+ * List activities
20046
+ * Returns a paginated list of Activities in your Platform. Supports filtering by `type`, `is_done`, `owner`, `deal`, `person`, schedule-from ranges, and `metadata__has_key`.
19792
20047
  *
19793
- * **Required permission:** `Ibl.CRM/Organizations/list`.
19794
- * @returns PaginatedOrganizationList
20048
+ * **Required permission:** `Ibl.CRM/Activities/list`.
20049
+ * @returns PaginatedActivityList
19795
20050
  * @throws ApiError
19796
20051
  */
19797
- static crmOrganizationsList({
19798
- name,
20052
+ static crmActivitiesList({
20053
+ deal,
20054
+ isDone,
20055
+ metadataHasKey,
19799
20056
  owner,
19800
20057
  page,
19801
- pageSize
20058
+ pageSize,
20059
+ person,
20060
+ scheduleFromGte,
20061
+ scheduleFromLte,
20062
+ type
19802
20063
  }) {
19803
20064
  return request(OpenAPI, {
19804
20065
  method: 'GET',
19805
- url: '/api/crm/organizations/',
20066
+ url: '/api/crm/activities/',
19806
20067
  query: {
19807
- 'name': name,
20068
+ 'deal': deal,
20069
+ 'is_done': isDone,
20070
+ 'metadata__has_key': metadataHasKey,
19808
20071
  'owner': owner,
19809
20072
  'page': page,
19810
- 'page_size': pageSize
20073
+ 'page_size': pageSize,
20074
+ 'person': person,
20075
+ 'schedule_from__gte': scheduleFromGte,
20076
+ 'schedule_from__lte': scheduleFromLte,
20077
+ 'type': type
19811
20078
  },
19812
20079
  errors: {
19813
20080
  401: `Authentication required.`,
19814
- 403: `Missing required permission \`Ibl.CRM/Organizations/list\`.`
20081
+ 403: `Missing required permission \`Ibl.CRM/Activities/list\`.`
19815
20082
  }
19816
20083
  });
19817
20084
  }
19818
20085
  /**
19819
- * Create an organization
19820
- * Creates a new organization in your Platform. The Platform is inferred from your credentials. `name` must be unique within your Platform.
20086
+ * Create an activity
20087
+ * Creates an Activity. Either `deal` or `person` must be supplied; both must belong to your Platform.
19821
20088
  *
19822
- * **Required permission:** `Ibl.CRM/Organizations/write`.
19823
- * @returns Organization
20089
+ * **Required permission:** `Ibl.CRM/Activities/write`.
20090
+ * @returns Activity
19824
20091
  * @throws ApiError
19825
20092
  */
19826
- static crmOrganizationsCreate({
20093
+ static crmActivitiesCreate({
19827
20094
  requestBody
19828
20095
  }) {
19829
20096
  return request(OpenAPI, {
19830
20097
  method: 'POST',
19831
- url: '/api/crm/organizations/',
20098
+ url: '/api/crm/activities/',
19832
20099
  body: requestBody,
19833
20100
  mediaType: 'application/json',
19834
20101
  errors: {
19835
- 400: `Validation error (for example, duplicate name).`,
19836
- 403: `Missing required permission \`Ibl.CRM/Organizations/write\`.`
20102
+ 400: `Validation error.`,
20103
+ 403: `Missing required permission \`Ibl.CRM/Activities/write\`.`
19837
20104
  }
19838
20105
  });
19839
20106
  }
19840
20107
  /**
19841
- * Retrieve an organization
19842
- * Returns a single organization by id.
20108
+ * Retrieve an activity
20109
+ * Returns a single Activity by id.
19843
20110
  *
19844
- * **Required permission:** `Ibl.CRM/Organizations/read`.
19845
- * @returns Organization
20111
+ * **Required permission:** `Ibl.CRM/Activities/read`.
20112
+ * @returns Activity
19846
20113
  * @throws ApiError
19847
20114
  */
19848
- static crmOrganizationsRetrieve({
20115
+ static crmActivitiesRetrieve({
19849
20116
  id
19850
20117
  }) {
19851
20118
  return request(OpenAPI, {
19852
20119
  method: 'GET',
19853
- url: '/api/crm/organizations/{id}/',
20120
+ url: '/api/crm/activities/{id}/',
19854
20121
  path: {
19855
20122
  'id': id
19856
20123
  },
19857
20124
  errors: {
19858
- 403: `Missing required permission \`Ibl.CRM/Organizations/read\`.`,
19859
- 404: `Organization not found.`
20125
+ 403: `Missing required permission \`Ibl.CRM/Activities/read\`.`,
20126
+ 404: `Activity not found.`
19860
20127
  }
19861
20128
  });
19862
20129
  }
19863
20130
  /**
19864
- * Replace an organization
19865
- * Replaces all editable fields on the organization.
20131
+ * Replace an activity
20132
+ * Replaces all editable fields on the Activity.
19866
20133
  *
19867
- * **Required permission:** `Ibl.CRM/Organizations/write`.
19868
- * @returns Organization
20134
+ * **Required permission:** `Ibl.CRM/Activities/write`.
20135
+ * @returns Activity
19869
20136
  * @throws ApiError
19870
20137
  */
19871
- static crmOrganizationsUpdate({
20138
+ static crmActivitiesUpdate({
19872
20139
  id,
19873
20140
  requestBody
19874
20141
  }) {
19875
20142
  return request(OpenAPI, {
19876
20143
  method: 'PUT',
19877
- url: '/api/crm/organizations/{id}/',
20144
+ url: '/api/crm/activities/{id}/',
19878
20145
  path: {
19879
20146
  'id': id
19880
20147
  },
@@ -19882,26 +20149,26 @@ class CrmService {
19882
20149
  mediaType: 'application/json',
19883
20150
  errors: {
19884
20151
  400: `Validation error.`,
19885
- 403: `Missing required permission \`Ibl.CRM/Organizations/write\`.`,
19886
- 404: `Organization not found.`
20152
+ 403: `Missing required permission \`Ibl.CRM/Activities/write\`.`,
20153
+ 404: `Activity not found.`
19887
20154
  }
19888
20155
  });
19889
20156
  }
19890
20157
  /**
19891
- * Update an organization
19892
- * Updates only the supplied fields on the organization.
20158
+ * Update an activity
20159
+ * Updates only the supplied fields on the Activity.
19893
20160
  *
19894
- * **Required permission:** `Ibl.CRM/Organizations/write`.
19895
- * @returns Organization
20161
+ * **Required permission:** `Ibl.CRM/Activities/write`.
20162
+ * @returns Activity
19896
20163
  * @throws ApiError
19897
20164
  */
19898
- static crmOrganizationsPartialUpdate({
20165
+ static crmActivitiesPartialUpdate({
19899
20166
  id,
19900
20167
  requestBody
19901
20168
  }) {
19902
20169
  return request(OpenAPI, {
19903
20170
  method: 'PATCH',
19904
- url: '/api/crm/organizations/{id}/',
20171
+ url: '/api/crm/activities/{id}/',
19905
20172
  path: {
19906
20173
  'id': id
19907
20174
  },
@@ -19909,131 +20176,166 @@ class CrmService {
19909
20176
  mediaType: 'application/json',
19910
20177
  errors: {
19911
20178
  400: `Validation error.`,
19912
- 403: `Missing required permission \`Ibl.CRM/Organizations/write\`.`,
19913
- 404: `Organization not found.`
20179
+ 403: `Missing required permission \`Ibl.CRM/Activities/write\`.`,
20180
+ 404: `Activity not found.`
19914
20181
  }
19915
20182
  });
19916
20183
  }
19917
20184
  /**
19918
- * Delete an organization
19919
- * Deletes the organization. Any persons linked to it are kept; their organization reference is cleared.
20185
+ * Delete an activity
20186
+ * Deletes the Activity.
19920
20187
  *
19921
- * **Required permission:** `Ibl.CRM/Organizations/delete`.
20188
+ * **Required permission:** `Ibl.CRM/Activities/delete`.
19922
20189
  * @returns void
19923
20190
  * @throws ApiError
19924
20191
  */
19925
- static crmOrganizationsDestroy({
20192
+ static crmActivitiesDestroy({
19926
20193
  id
19927
20194
  }) {
19928
20195
  return request(OpenAPI, {
19929
20196
  method: 'DELETE',
19930
- url: '/api/crm/organizations/{id}/',
20197
+ url: '/api/crm/activities/{id}/',
19931
20198
  path: {
19932
20199
  'id': id
19933
20200
  },
19934
20201
  errors: {
19935
- 403: `Missing required permission \`Ibl.CRM/Organizations/delete\`.`,
19936
- 404: `Organization not found.`
20202
+ 403: `Missing required permission \`Ibl.CRM/Activities/delete\`.`,
20203
+ 404: `Activity not found.`
19937
20204
  }
19938
20205
  });
19939
20206
  }
19940
20207
  /**
19941
- * List persons
19942
- * Returns a paginated list of persons in your Platform. Supports filtering by `lifecycle_stage`, `owner`, `organization`, `created_at__gte`/`created_at__lte`, and `metadata__has_key`.
20208
+ * Mark an activity as done
20209
+ * Flips `is_done=True` and stamps `done_at` if it isn't already set. Idempotent calling on an already-done Activity preserves the original `done_at`.
19943
20210
  *
19944
- * **Required permission:** `Ibl.CRM/Persons/list`.
19945
- * @returns PaginatedPersonList
20211
+ * **Required permission:** `Ibl.CRM/Activities/write`.
20212
+ * @returns Activity
19946
20213
  * @throws ApiError
19947
20214
  */
19948
- static crmPersonsList({
20215
+ static crmActivitiesDoneCreate({
20216
+ id
20217
+ }) {
20218
+ return request(OpenAPI, {
20219
+ method: 'POST',
20220
+ url: '/api/crm/activities/{id}/done/',
20221
+ path: {
20222
+ 'id': id
20223
+ },
20224
+ errors: {
20225
+ 403: `Missing required permission \`Ibl.CRM/Activities/write\`.`,
20226
+ 404: `Activity not found.`
20227
+ }
20228
+ });
20229
+ }
20230
+ /**
20231
+ * List deals
20232
+ * Returns a paginated list of Deals in your Platform. Supports filtering by `status`, `pipeline`, `stage`, `owner`, `source`, `person`, `organization`, expected-close-date and created-at ranges, and `metadata__has_key`.
20233
+ *
20234
+ * **Required permission:** `Ibl.CRM/Deals/list`.
20235
+ * @returns PaginatedDealList
20236
+ * @throws ApiError
20237
+ */
20238
+ static crmDealsList({
19949
20239
  createdAtGte,
19950
20240
  createdAtLte,
19951
- lifecycleStage,
20241
+ expectedCloseDateGte,
20242
+ expectedCloseDateLte,
19952
20243
  metadataHasKey,
19953
20244
  organization,
19954
20245
  owner,
19955
20246
  page,
19956
- pageSize
20247
+ pageSize,
20248
+ person,
20249
+ pipeline,
20250
+ source,
20251
+ stage,
20252
+ status
19957
20253
  }) {
19958
20254
  return request(OpenAPI, {
19959
20255
  method: 'GET',
19960
- url: '/api/crm/persons/',
20256
+ url: '/api/crm/deals/',
19961
20257
  query: {
19962
20258
  'created_at__gte': createdAtGte,
19963
20259
  'created_at__lte': createdAtLte,
19964
- 'lifecycle_stage': lifecycleStage,
20260
+ 'expected_close_date__gte': expectedCloseDateGte,
20261
+ 'expected_close_date__lte': expectedCloseDateLte,
19965
20262
  'metadata__has_key': metadataHasKey,
19966
20263
  'organization': organization,
19967
20264
  'owner': owner,
19968
20265
  'page': page,
19969
- 'page_size': pageSize
20266
+ 'page_size': pageSize,
20267
+ 'person': person,
20268
+ 'pipeline': pipeline,
20269
+ 'source': source,
20270
+ 'stage': stage,
20271
+ 'status': status
19970
20272
  },
19971
20273
  errors: {
19972
20274
  401: `Authentication required.`,
19973
- 403: `Missing required permission \`Ibl.CRM/Persons/list\`.`
20275
+ 403: `Missing required permission \`Ibl.CRM/Deals/list\`.`
19974
20276
  }
19975
20277
  });
19976
20278
  }
19977
20279
  /**
19978
- * Create a person
19979
- * Creates a new person in your Platform. The Platform is inferred from your credentials. If `organization` is supplied, it must reference an organization in your Platform.
20280
+ * Create a deal
20281
+ * Creates a new Deal. All FK targets (`person`, `organization`, `pipeline`, `stage`, `source`) must belong to your Platform; `stage` must belong to `pipeline`. `status` and `closed_at` are service-managed passing them returns `400`.
19980
20282
  *
19981
- * **Required permission:** `Ibl.CRM/Persons/write`.
19982
- * @returns Person
20283
+ * **Required permission:** `Ibl.CRM/Deals/write`.
20284
+ * @returns Deal
19983
20285
  * @throws ApiError
19984
20286
  */
19985
- static crmPersonsCreate({
20287
+ static crmDealsCreate({
19986
20288
  requestBody
19987
20289
  }) {
19988
20290
  return request(OpenAPI, {
19989
20291
  method: 'POST',
19990
- url: '/api/crm/persons/',
20292
+ url: '/api/crm/deals/',
19991
20293
  body: requestBody,
19992
20294
  mediaType: 'application/json',
19993
20295
  errors: {
19994
20296
  400: `Validation error.`,
19995
- 403: `Missing required permission \`Ibl.CRM/Persons/write\`.`
20297
+ 403: `Missing required permission \`Ibl.CRM/Deals/write\`.`
19996
20298
  }
19997
20299
  });
19998
20300
  }
19999
20301
  /**
20000
- * Retrieve a person
20001
- * Returns a single person by id.
20302
+ * Retrieve a deal
20303
+ * Returns a single Deal by id.
20002
20304
  *
20003
- * **Required permission:** `Ibl.CRM/Persons/read`.
20004
- * @returns Person
20305
+ * **Required permission:** `Ibl.CRM/Deals/read`.
20306
+ * @returns Deal
20005
20307
  * @throws ApiError
20006
20308
  */
20007
- static crmPersonsRetrieve({
20309
+ static crmDealsRetrieve({
20008
20310
  id
20009
20311
  }) {
20010
20312
  return request(OpenAPI, {
20011
20313
  method: 'GET',
20012
- url: '/api/crm/persons/{id}/',
20314
+ url: '/api/crm/deals/{id}/',
20013
20315
  path: {
20014
20316
  'id': id
20015
20317
  },
20016
20318
  errors: {
20017
- 403: `Missing required permission \`Ibl.CRM/Persons/read\`.`,
20018
- 404: `Person not found.`
20319
+ 403: `Missing required permission \`Ibl.CRM/Deals/read\`.`,
20320
+ 404: `Deal not found.`
20019
20321
  }
20020
20322
  });
20021
20323
  }
20022
20324
  /**
20023
- * Replace a person
20024
- * Replaces all editable fields on the person.
20325
+ * Replace a deal
20326
+ * Replaces all editable fields on the Deal.
20025
20327
  *
20026
- * **Required permission:** `Ibl.CRM/Persons/write`.
20027
- * @returns Person
20328
+ * **Required permission:** `Ibl.CRM/Deals/write`.
20329
+ * @returns Deal
20028
20330
  * @throws ApiError
20029
20331
  */
20030
- static crmPersonsUpdate({
20332
+ static crmDealsUpdate({
20031
20333
  id,
20032
20334
  requestBody
20033
20335
  }) {
20034
20336
  return request(OpenAPI, {
20035
20337
  method: 'PUT',
20036
- url: '/api/crm/persons/{id}/',
20338
+ url: '/api/crm/deals/{id}/',
20037
20339
  path: {
20038
20340
  'id': id
20039
20341
  },
@@ -20041,8 +20343,550 @@ class CrmService {
20041
20343
  mediaType: 'application/json',
20042
20344
  errors: {
20043
20345
  400: `Validation error.`,
20044
- 403: `Missing required permission \`Ibl.CRM/Persons/write\`.`,
20045
- 404: `Person not found.`
20346
+ 403: `Missing required permission \`Ibl.CRM/Deals/write\`.`,
20347
+ 404: `Deal not found.`
20348
+ }
20349
+ });
20350
+ }
20351
+ /**
20352
+ * Update a deal
20353
+ * Updates only the supplied fields on the Deal. Direct writes to `status` or `closed_at` are rejected with `400` — use `POST /deals/{id}/move-stage/`, `won/`, or `lost/`.
20354
+ *
20355
+ * **Required permission:** `Ibl.CRM/Deals/write`.
20356
+ * @returns Deal
20357
+ * @throws ApiError
20358
+ */
20359
+ static crmDealsPartialUpdate({
20360
+ id,
20361
+ requestBody
20362
+ }) {
20363
+ return request(OpenAPI, {
20364
+ method: 'PATCH',
20365
+ url: '/api/crm/deals/{id}/',
20366
+ path: {
20367
+ 'id': id
20368
+ },
20369
+ body: requestBody,
20370
+ mediaType: 'application/json',
20371
+ errors: {
20372
+ 400: `Validation error.`,
20373
+ 403: `Missing required permission \`Ibl.CRM/Deals/write\`.`,
20374
+ 404: `Deal not found.`
20375
+ }
20376
+ });
20377
+ }
20378
+ /**
20379
+ * Delete a deal
20380
+ * Deletes the Deal.
20381
+ *
20382
+ * **Required permission:** `Ibl.CRM/Deals/delete`.
20383
+ * @returns void
20384
+ * @throws ApiError
20385
+ */
20386
+ static crmDealsDestroy({
20387
+ id
20388
+ }) {
20389
+ return request(OpenAPI, {
20390
+ method: 'DELETE',
20391
+ url: '/api/crm/deals/{id}/',
20392
+ path: {
20393
+ 'id': id
20394
+ },
20395
+ errors: {
20396
+ 403: `Missing required permission \`Ibl.CRM/Deals/delete\`.`,
20397
+ 404: `Deal not found.`
20398
+ }
20399
+ });
20400
+ }
20401
+ /**
20402
+ * Mark a deal as lost
20403
+ * Moves the Deal into a closed-lost stage and persists `lost_reason`. If `stage_code` is omitted, the first `is_lost=True` stage in the Deal's pipeline (by sort order) is used.
20404
+ *
20405
+ * **Required permission:** `Ibl.CRM/Deals/write`.
20406
+ * @returns Deal
20407
+ * @throws ApiError
20408
+ */
20409
+ static crmDealsLostCreate({
20410
+ id,
20411
+ requestBody
20412
+ }) {
20413
+ return request(OpenAPI, {
20414
+ method: 'POST',
20415
+ url: '/api/crm/deals/{id}/lost/',
20416
+ path: {
20417
+ 'id': id
20418
+ },
20419
+ body: requestBody,
20420
+ mediaType: 'application/json',
20421
+ errors: {
20422
+ 400: `Missing \`lost_reason\`, no \`is_lost\` stage configured, or the supplied stage_code is not flagged is_lost=True.`,
20423
+ 403: `Missing required permission \`Ibl.CRM/Deals/write\`.`,
20424
+ 404: `Deal not found.`
20425
+ }
20426
+ });
20427
+ }
20428
+ /**
20429
+ * Move a deal to a different stage
20430
+ * Moves the Deal to the stage identified by `stage_id` or `stage_code`. The target stage must belong to this Deal's pipeline. Records an audit Activity and emits `deal_stage_changed`. `Deal.status` is recomputed from the new stage's `is_won` / `is_lost` flags.
20431
+ *
20432
+ * **Required permission:** `Ibl.CRM/Deals/write`.
20433
+ * @returns Deal
20434
+ * @throws ApiError
20435
+ */
20436
+ static crmDealsMoveStageCreate({
20437
+ id,
20438
+ requestBody
20439
+ }) {
20440
+ return request(OpenAPI, {
20441
+ method: 'POST',
20442
+ url: '/api/crm/deals/{id}/move-stage/',
20443
+ path: {
20444
+ 'id': id
20445
+ },
20446
+ body: requestBody,
20447
+ mediaType: 'application/json',
20448
+ errors: {
20449
+ 400: `Validation error (e.g. stage not in pipeline).`,
20450
+ 403: `Missing required permission \`Ibl.CRM/Deals/write\`.`,
20451
+ 404: `Deal or stage not found.`
20452
+ }
20453
+ });
20454
+ }
20455
+ /**
20456
+ * Mark a deal as won
20457
+ * Moves the Deal into a closed-won stage and sets `status='won'`. If `stage_code` is omitted, the first `is_won=True` stage in the Deal's pipeline (by sort order) is used.
20458
+ *
20459
+ * **Required permission:** `Ibl.CRM/Deals/write`.
20460
+ * @returns Deal
20461
+ * @throws ApiError
20462
+ */
20463
+ static crmDealsWonCreate({
20464
+ id,
20465
+ requestBody
20466
+ }) {
20467
+ return request(OpenAPI, {
20468
+ method: 'POST',
20469
+ url: '/api/crm/deals/{id}/won/',
20470
+ path: {
20471
+ 'id': id
20472
+ },
20473
+ body: requestBody,
20474
+ mediaType: 'application/json',
20475
+ errors: {
20476
+ 400: `No \`is_won\` stage configured, or the supplied stage_code is not flagged is_won=True.`,
20477
+ 403: `Missing required permission \`Ibl.CRM/Deals/write\`.`,
20478
+ 404: `Deal not found.`
20479
+ }
20480
+ });
20481
+ }
20482
+ /**
20483
+ * List lead sources
20484
+ * Returns a paginated list of LeadSources in your Platform.
20485
+ *
20486
+ * **Required permission:** `Ibl.CRM/Pipelines/list`.
20487
+ * @returns PaginatedLeadSourceList
20488
+ * @throws ApiError
20489
+ */
20490
+ static crmLeadSourcesList({
20491
+ code,
20492
+ name,
20493
+ page,
20494
+ pageSize
20495
+ }) {
20496
+ return request(OpenAPI, {
20497
+ method: 'GET',
20498
+ url: '/api/crm/lead-sources/',
20499
+ query: {
20500
+ 'code': code,
20501
+ 'name': name,
20502
+ 'page': page,
20503
+ 'page_size': pageSize
20504
+ },
20505
+ errors: {
20506
+ 401: `Authentication required.`,
20507
+ 403: `Missing required permission \`Ibl.CRM/Pipelines/list\`.`
20508
+ }
20509
+ });
20510
+ }
20511
+ /**
20512
+ * Create a lead source
20513
+ * Creates a new LeadSource in your Platform. `code` must be unique.
20514
+ *
20515
+ * **Required permission:** `Ibl.CRM/Pipelines/write`.
20516
+ * @returns LeadSource
20517
+ * @throws ApiError
20518
+ */
20519
+ static crmLeadSourcesCreate({
20520
+ requestBody
20521
+ }) {
20522
+ return request(OpenAPI, {
20523
+ method: 'POST',
20524
+ url: '/api/crm/lead-sources/',
20525
+ body: requestBody,
20526
+ mediaType: 'application/json',
20527
+ errors: {
20528
+ 400: `Validation error.`,
20529
+ 403: `Missing required permission \`Ibl.CRM/Pipelines/write\`.`
20530
+ }
20531
+ });
20532
+ }
20533
+ /**
20534
+ * Retrieve a lead source
20535
+ * Returns a single LeadSource by id.
20536
+ *
20537
+ * **Required permission:** `Ibl.CRM/Pipelines/read`.
20538
+ * @returns LeadSource
20539
+ * @throws ApiError
20540
+ */
20541
+ static crmLeadSourcesRetrieve({
20542
+ id
20543
+ }) {
20544
+ return request(OpenAPI, {
20545
+ method: 'GET',
20546
+ url: '/api/crm/lead-sources/{id}/',
20547
+ path: {
20548
+ 'id': id
20549
+ },
20550
+ errors: {
20551
+ 403: `Missing required permission \`Ibl.CRM/Pipelines/read\`.`,
20552
+ 404: `LeadSource not found.`
20553
+ }
20554
+ });
20555
+ }
20556
+ /**
20557
+ * Replace a lead source
20558
+ * Replaces all editable fields on the LeadSource.
20559
+ *
20560
+ * **Required permission:** `Ibl.CRM/Pipelines/write`.
20561
+ * @returns LeadSource
20562
+ * @throws ApiError
20563
+ */
20564
+ static crmLeadSourcesUpdate({
20565
+ id,
20566
+ requestBody
20567
+ }) {
20568
+ return request(OpenAPI, {
20569
+ method: 'PUT',
20570
+ url: '/api/crm/lead-sources/{id}/',
20571
+ path: {
20572
+ 'id': id
20573
+ },
20574
+ body: requestBody,
20575
+ mediaType: 'application/json',
20576
+ errors: {
20577
+ 400: `Validation error.`,
20578
+ 403: `Missing required permission \`Ibl.CRM/Pipelines/write\`.`,
20579
+ 404: `LeadSource not found.`
20580
+ }
20581
+ });
20582
+ }
20583
+ /**
20584
+ * Update a lead source
20585
+ * Updates only the supplied fields on the LeadSource.
20586
+ *
20587
+ * **Required permission:** `Ibl.CRM/Pipelines/write`.
20588
+ * @returns LeadSource
20589
+ * @throws ApiError
20590
+ */
20591
+ static crmLeadSourcesPartialUpdate({
20592
+ id,
20593
+ requestBody
20594
+ }) {
20595
+ return request(OpenAPI, {
20596
+ method: 'PATCH',
20597
+ url: '/api/crm/lead-sources/{id}/',
20598
+ path: {
20599
+ 'id': id
20600
+ },
20601
+ body: requestBody,
20602
+ mediaType: 'application/json',
20603
+ errors: {
20604
+ 400: `Validation error.`,
20605
+ 403: `Missing required permission \`Ibl.CRM/Pipelines/write\`.`,
20606
+ 404: `LeadSource not found.`
20607
+ }
20608
+ });
20609
+ }
20610
+ /**
20611
+ * Delete a lead source
20612
+ * Deletes the LeadSource. Any Deals referencing it have their `source` cleared.
20613
+ *
20614
+ * **Required permission:** `Ibl.CRM/Pipelines/delete`.
20615
+ * @returns void
20616
+ * @throws ApiError
20617
+ */
20618
+ static crmLeadSourcesDestroy({
20619
+ id
20620
+ }) {
20621
+ return request(OpenAPI, {
20622
+ method: 'DELETE',
20623
+ url: '/api/crm/lead-sources/{id}/',
20624
+ path: {
20625
+ 'id': id
20626
+ },
20627
+ errors: {
20628
+ 403: `Missing required permission \`Ibl.CRM/Pipelines/delete\`.`,
20629
+ 404: `LeadSource not found.`
20630
+ }
20631
+ });
20632
+ }
20633
+ /**
20634
+ * List organizations
20635
+ * Returns a paginated list of organizations in your Platform. Supports filtering by `owner` and by `name` (case-insensitive substring match).
20636
+ *
20637
+ * **Required permission:** `Ibl.CRM/Organizations/list`.
20638
+ * @returns PaginatedOrganizationList
20639
+ * @throws ApiError
20640
+ */
20641
+ static crmOrganizationsList({
20642
+ name,
20643
+ owner,
20644
+ page,
20645
+ pageSize
20646
+ }) {
20647
+ return request(OpenAPI, {
20648
+ method: 'GET',
20649
+ url: '/api/crm/organizations/',
20650
+ query: {
20651
+ 'name': name,
20652
+ 'owner': owner,
20653
+ 'page': page,
20654
+ 'page_size': pageSize
20655
+ },
20656
+ errors: {
20657
+ 401: `Authentication required.`,
20658
+ 403: `Missing required permission \`Ibl.CRM/Organizations/list\`.`
20659
+ }
20660
+ });
20661
+ }
20662
+ /**
20663
+ * Create an organization
20664
+ * Creates a new organization in your Platform. The Platform is inferred from your credentials. `name` must be unique within your Platform.
20665
+ *
20666
+ * **Required permission:** `Ibl.CRM/Organizations/write`.
20667
+ * @returns Organization
20668
+ * @throws ApiError
20669
+ */
20670
+ static crmOrganizationsCreate({
20671
+ requestBody
20672
+ }) {
20673
+ return request(OpenAPI, {
20674
+ method: 'POST',
20675
+ url: '/api/crm/organizations/',
20676
+ body: requestBody,
20677
+ mediaType: 'application/json',
20678
+ errors: {
20679
+ 400: `Validation error (for example, duplicate name).`,
20680
+ 403: `Missing required permission \`Ibl.CRM/Organizations/write\`.`
20681
+ }
20682
+ });
20683
+ }
20684
+ /**
20685
+ * Retrieve an organization
20686
+ * Returns a single organization by id.
20687
+ *
20688
+ * **Required permission:** `Ibl.CRM/Organizations/read`.
20689
+ * @returns Organization
20690
+ * @throws ApiError
20691
+ */
20692
+ static crmOrganizationsRetrieve({
20693
+ id
20694
+ }) {
20695
+ return request(OpenAPI, {
20696
+ method: 'GET',
20697
+ url: '/api/crm/organizations/{id}/',
20698
+ path: {
20699
+ 'id': id
20700
+ },
20701
+ errors: {
20702
+ 403: `Missing required permission \`Ibl.CRM/Organizations/read\`.`,
20703
+ 404: `Organization not found.`
20704
+ }
20705
+ });
20706
+ }
20707
+ /**
20708
+ * Replace an organization
20709
+ * Replaces all editable fields on the organization.
20710
+ *
20711
+ * **Required permission:** `Ibl.CRM/Organizations/write`.
20712
+ * @returns Organization
20713
+ * @throws ApiError
20714
+ */
20715
+ static crmOrganizationsUpdate({
20716
+ id,
20717
+ requestBody
20718
+ }) {
20719
+ return request(OpenAPI, {
20720
+ method: 'PUT',
20721
+ url: '/api/crm/organizations/{id}/',
20722
+ path: {
20723
+ 'id': id
20724
+ },
20725
+ body: requestBody,
20726
+ mediaType: 'application/json',
20727
+ errors: {
20728
+ 400: `Validation error.`,
20729
+ 403: `Missing required permission \`Ibl.CRM/Organizations/write\`.`,
20730
+ 404: `Organization not found.`
20731
+ }
20732
+ });
20733
+ }
20734
+ /**
20735
+ * Update an organization
20736
+ * Updates only the supplied fields on the organization.
20737
+ *
20738
+ * **Required permission:** `Ibl.CRM/Organizations/write`.
20739
+ * @returns Organization
20740
+ * @throws ApiError
20741
+ */
20742
+ static crmOrganizationsPartialUpdate({
20743
+ id,
20744
+ requestBody
20745
+ }) {
20746
+ return request(OpenAPI, {
20747
+ method: 'PATCH',
20748
+ url: '/api/crm/organizations/{id}/',
20749
+ path: {
20750
+ 'id': id
20751
+ },
20752
+ body: requestBody,
20753
+ mediaType: 'application/json',
20754
+ errors: {
20755
+ 400: `Validation error.`,
20756
+ 403: `Missing required permission \`Ibl.CRM/Organizations/write\`.`,
20757
+ 404: `Organization not found.`
20758
+ }
20759
+ });
20760
+ }
20761
+ /**
20762
+ * Delete an organization
20763
+ * Deletes the organization. Any persons linked to it are kept; their organization reference is cleared.
20764
+ *
20765
+ * **Required permission:** `Ibl.CRM/Organizations/delete`.
20766
+ * @returns void
20767
+ * @throws ApiError
20768
+ */
20769
+ static crmOrganizationsDestroy({
20770
+ id
20771
+ }) {
20772
+ return request(OpenAPI, {
20773
+ method: 'DELETE',
20774
+ url: '/api/crm/organizations/{id}/',
20775
+ path: {
20776
+ 'id': id
20777
+ },
20778
+ errors: {
20779
+ 403: `Missing required permission \`Ibl.CRM/Organizations/delete\`.`,
20780
+ 404: `Organization not found.`
20781
+ }
20782
+ });
20783
+ }
20784
+ /**
20785
+ * List persons
20786
+ * Returns a paginated list of persons in your Platform. Supports filtering by `lifecycle_stage`, `owner`, `organization`, `created_at__gte`/`created_at__lte`, and `metadata__has_key`.
20787
+ *
20788
+ * **Required permission:** `Ibl.CRM/Persons/list`.
20789
+ * @returns PaginatedPersonList
20790
+ * @throws ApiError
20791
+ */
20792
+ static crmPersonsList({
20793
+ createdAtGte,
20794
+ createdAtLte,
20795
+ lifecycleStage,
20796
+ metadataHasKey,
20797
+ organization,
20798
+ owner,
20799
+ page,
20800
+ pageSize
20801
+ }) {
20802
+ return request(OpenAPI, {
20803
+ method: 'GET',
20804
+ url: '/api/crm/persons/',
20805
+ query: {
20806
+ 'created_at__gte': createdAtGte,
20807
+ 'created_at__lte': createdAtLte,
20808
+ 'lifecycle_stage': lifecycleStage,
20809
+ 'metadata__has_key': metadataHasKey,
20810
+ 'organization': organization,
20811
+ 'owner': owner,
20812
+ 'page': page,
20813
+ 'page_size': pageSize
20814
+ },
20815
+ errors: {
20816
+ 401: `Authentication required.`,
20817
+ 403: `Missing required permission \`Ibl.CRM/Persons/list\`.`
20818
+ }
20819
+ });
20820
+ }
20821
+ /**
20822
+ * Create a person
20823
+ * Creates a new person in your Platform. The Platform is inferred from your credentials. If `organization` is supplied, it must reference an organization in your Platform.
20824
+ *
20825
+ * **Required permission:** `Ibl.CRM/Persons/write`.
20826
+ * @returns Person
20827
+ * @throws ApiError
20828
+ */
20829
+ static crmPersonsCreate({
20830
+ requestBody
20831
+ }) {
20832
+ return request(OpenAPI, {
20833
+ method: 'POST',
20834
+ url: '/api/crm/persons/',
20835
+ body: requestBody,
20836
+ mediaType: 'application/json',
20837
+ errors: {
20838
+ 400: `Validation error.`,
20839
+ 403: `Missing required permission \`Ibl.CRM/Persons/write\`.`
20840
+ }
20841
+ });
20842
+ }
20843
+ /**
20844
+ * Retrieve a person
20845
+ * Returns a single person by id.
20846
+ *
20847
+ * **Required permission:** `Ibl.CRM/Persons/read`.
20848
+ * @returns Person
20849
+ * @throws ApiError
20850
+ */
20851
+ static crmPersonsRetrieve({
20852
+ id
20853
+ }) {
20854
+ return request(OpenAPI, {
20855
+ method: 'GET',
20856
+ url: '/api/crm/persons/{id}/',
20857
+ path: {
20858
+ 'id': id
20859
+ },
20860
+ errors: {
20861
+ 403: `Missing required permission \`Ibl.CRM/Persons/read\`.`,
20862
+ 404: `Person not found.`
20863
+ }
20864
+ });
20865
+ }
20866
+ /**
20867
+ * Replace a person
20868
+ * Replaces all editable fields on the person.
20869
+ *
20870
+ * **Required permission:** `Ibl.CRM/Persons/write`.
20871
+ * @returns Person
20872
+ * @throws ApiError
20873
+ */
20874
+ static crmPersonsUpdate({
20875
+ id,
20876
+ requestBody
20877
+ }) {
20878
+ return request(OpenAPI, {
20879
+ method: 'PUT',
20880
+ url: '/api/crm/persons/{id}/',
20881
+ path: {
20882
+ 'id': id
20883
+ },
20884
+ body: requestBody,
20885
+ mediaType: 'application/json',
20886
+ errors: {
20887
+ 400: `Validation error.`,
20888
+ 403: `Missing required permission \`Ibl.CRM/Persons/write\`.`,
20889
+ 404: `Person not found.`
20046
20890
  }
20047
20891
  });
20048
20892
  }
@@ -20050,99 +20894,689 @@ class CrmService {
20050
20894
  * Update a person
20051
20895
  * Updates only the supplied fields on the person.
20052
20896
  *
20053
- * **Required permission:** `Ibl.CRM/Persons/write`.
20054
- * @returns Person
20897
+ * **Required permission:** `Ibl.CRM/Persons/write`.
20898
+ * @returns Person
20899
+ * @throws ApiError
20900
+ */
20901
+ static crmPersonsPartialUpdate({
20902
+ id,
20903
+ requestBody
20904
+ }) {
20905
+ return request(OpenAPI, {
20906
+ method: 'PATCH',
20907
+ url: '/api/crm/persons/{id}/',
20908
+ path: {
20909
+ 'id': id
20910
+ },
20911
+ body: requestBody,
20912
+ mediaType: 'application/json',
20913
+ errors: {
20914
+ 400: `Validation error.`,
20915
+ 403: `Missing required permission \`Ibl.CRM/Persons/write\`.`,
20916
+ 404: `Person not found.`
20917
+ }
20918
+ });
20919
+ }
20920
+ /**
20921
+ * Delete a person
20922
+ * Deletes the person.
20923
+ *
20924
+ * **Required permission:** `Ibl.CRM/Persons/delete`.
20925
+ * @returns void
20926
+ * @throws ApiError
20927
+ */
20928
+ static crmPersonsDestroy({
20929
+ id
20930
+ }) {
20931
+ return request(OpenAPI, {
20932
+ method: 'DELETE',
20933
+ url: '/api/crm/persons/{id}/',
20934
+ path: {
20935
+ 'id': id
20936
+ },
20937
+ errors: {
20938
+ 403: `Missing required permission \`Ibl.CRM/Persons/delete\`.`,
20939
+ 404: `Person not found.`
20940
+ }
20941
+ });
20942
+ }
20943
+ /**
20944
+ * Invite a person to the platform
20945
+ * Sends a platform invitation to the person's `primary_email`. On acceptance, the invitee joins your Platform with the privileges configured in the request body.
20946
+ *
20947
+ * Returns `409 Conflict` if an active invitation already exists for this email in your Platform, and `422 Unprocessable Entity` if the person is already linked to a platform user.
20948
+ *
20949
+ * **Required permission:** `Ibl.CRM/Invite/action`.
20950
+ * @returns PersonInviteResponse
20951
+ * @throws ApiError
20952
+ */
20953
+ static crmPersonsInviteCreate({
20954
+ id,
20955
+ requestBody
20956
+ }) {
20957
+ return request(OpenAPI, {
20958
+ method: 'POST',
20959
+ url: '/api/crm/persons/{id}/invite/',
20960
+ path: {
20961
+ 'id': id
20962
+ },
20963
+ body: requestBody,
20964
+ mediaType: 'application/json',
20965
+ errors: {
20966
+ 400: `Person has no \`primary_email\`; cannot invite.`,
20967
+ 403: `Missing required permission \`Ibl.CRM/Invite/action\`.`,
20968
+ 404: `Person not found.`,
20969
+ 422: `Person is already linked to a platform user.`
20970
+ }
20971
+ });
20972
+ }
20973
+ /**
20974
+ * Bind a person to an existing platform user
20975
+ * Links this person to an existing platform user. The target user must already be a member of your Platform — if they are not, send them an invitation via `POST /persons/{id}/invite/` instead.
20976
+ *
20977
+ * This call is idempotent: linking a person that is already bound to the same user is a no-op. Re-linking a person that is already bound to a *different* user is refused; the existing binding is preserved and the unchanged person is returned.
20978
+ *
20979
+ * **Required permission:** `Ibl.CRM/Persons/write`.
20980
+ * @returns Person
20981
+ * @throws ApiError
20982
+ */
20983
+ static crmPersonsLinkUserCreate({
20984
+ id,
20985
+ requestBody
20986
+ }) {
20987
+ return request(OpenAPI, {
20988
+ method: 'POST',
20989
+ url: '/api/crm/persons/{id}/link-user/',
20990
+ path: {
20991
+ 'id': id
20992
+ },
20993
+ body: requestBody,
20994
+ mediaType: 'application/json',
20995
+ errors: {
20996
+ 400: `Validation error.`,
20997
+ 403: `Missing required permission \`Ibl.CRM/Persons/write\`, or the target user is not a member of your Platform.`,
20998
+ 404: `Person or user not found.`
20999
+ }
21000
+ });
21001
+ }
21002
+ /**
21003
+ * Merge duplicate persons into a primary
21004
+ * Marks each person in `duplicate_ids` as inactive and reports how many related records (deals, activities, tags) were re-parented onto `primary_id`.
21005
+ *
21006
+ * All ids — both the primary and every duplicate — must belong to your Platform. `primary_id` may not appear in `duplicate_ids`.
21007
+ *
21008
+ * **Required permission:** `Ibl.CRM/Persons/write`.
21009
+ * @returns PersonMergeResponse
21010
+ * @throws ApiError
21011
+ */
21012
+ static crmPersonsMergeCreate({
21013
+ requestBody
21014
+ }) {
21015
+ return request(OpenAPI, {
21016
+ method: 'POST',
21017
+ url: '/api/crm/persons/merge/',
21018
+ body: requestBody,
21019
+ mediaType: 'application/json',
21020
+ errors: {
21021
+ 400: `Validation error: the primary appears in duplicates, or one or more ids belong to another Platform.`,
21022
+ 403: `Missing required permission \`Ibl.CRM/Persons/write\`.`,
21023
+ 404: `Primary person not found.`
21024
+ }
21025
+ });
21026
+ }
21027
+ /**
21028
+ * List pipelines
21029
+ * Returns a paginated list of Pipelines in your Platform. Each Pipeline includes its ordered `stages` inline.
21030
+ *
21031
+ * **Required permission:** `Ibl.CRM/Pipelines/list`.
21032
+ * @returns PaginatedPipelineList
21033
+ * @throws ApiError
21034
+ */
21035
+ static crmPipelinesList({
21036
+ code,
21037
+ isDefault,
21038
+ name,
21039
+ page,
21040
+ pageSize
21041
+ }) {
21042
+ return request(OpenAPI, {
21043
+ method: 'GET',
21044
+ url: '/api/crm/pipelines/',
21045
+ query: {
21046
+ 'code': code,
21047
+ 'is_default': isDefault,
21048
+ 'name': name,
21049
+ 'page': page,
21050
+ 'page_size': pageSize
21051
+ },
21052
+ errors: {
21053
+ 401: `Authentication required.`,
21054
+ 403: `Missing required permission \`Ibl.CRM/Pipelines/list\`.`
21055
+ }
21056
+ });
21057
+ }
21058
+ /**
21059
+ * Create a pipeline
21060
+ * Creates a new Pipeline. `code` must be unique within your Platform. Promoting another Pipeline to `is_default=true` while one already exists will fail — unset the existing default first.
21061
+ *
21062
+ * **Required permission:** `Ibl.CRM/Pipelines/write`.
21063
+ * @returns Pipeline
21064
+ * @throws ApiError
21065
+ */
21066
+ static crmPipelinesCreate({
21067
+ requestBody
21068
+ }) {
21069
+ return request(OpenAPI, {
21070
+ method: 'POST',
21071
+ url: '/api/crm/pipelines/',
21072
+ body: requestBody,
21073
+ mediaType: 'application/json',
21074
+ errors: {
21075
+ 400: `Validation error.`,
21076
+ 403: `Missing required permission \`Ibl.CRM/Pipelines/write\`.`
21077
+ }
21078
+ });
21079
+ }
21080
+ /**
21081
+ * List stages for a pipeline
21082
+ * Returns the ordered list of PipelineStages for the given Pipeline.
21083
+ *
21084
+ * **Required permission:** `Ibl.CRM/Pipelines/list`.
21085
+ * @returns PaginatedPipelineStageList
21086
+ * @throws ApiError
21087
+ */
21088
+ static crmPipelinesStagesList({
21089
+ pipelinePk,
21090
+ code,
21091
+ isLost,
21092
+ isWon,
21093
+ page,
21094
+ pageSize
21095
+ }) {
21096
+ return request(OpenAPI, {
21097
+ method: 'GET',
21098
+ url: '/api/crm/pipelines/{pipeline_pk}/stages/',
21099
+ path: {
21100
+ 'pipeline_pk': pipelinePk
21101
+ },
21102
+ query: {
21103
+ 'code': code,
21104
+ 'is_lost': isLost,
21105
+ 'is_won': isWon,
21106
+ 'page': page,
21107
+ 'page_size': pageSize
21108
+ },
21109
+ errors: {
21110
+ 403: `Missing required permission \`Ibl.CRM/Pipelines/list\`.`,
21111
+ 404: `Pipeline not found.`
21112
+ }
21113
+ });
21114
+ }
21115
+ /**
21116
+ * Create a stage
21117
+ * Creates a new PipelineStage in the URL Pipeline. `code` must be unique within that Pipeline. At most one of `is_won` / `is_lost` may be true.
21118
+ *
21119
+ * **Required permission:** `Ibl.CRM/Pipelines/write`.
21120
+ * @returns PipelineStage
21121
+ * @throws ApiError
21122
+ */
21123
+ static crmPipelinesStagesCreate({
21124
+ pipelinePk,
21125
+ requestBody
21126
+ }) {
21127
+ return request(OpenAPI, {
21128
+ method: 'POST',
21129
+ url: '/api/crm/pipelines/{pipeline_pk}/stages/',
21130
+ path: {
21131
+ 'pipeline_pk': pipelinePk
21132
+ },
21133
+ body: requestBody,
21134
+ mediaType: 'application/json',
21135
+ errors: {
21136
+ 400: `Validation error.`,
21137
+ 403: `Missing required permission \`Ibl.CRM/Pipelines/write\`.`,
21138
+ 404: `Pipeline not found.`
21139
+ }
21140
+ });
21141
+ }
21142
+ /**
21143
+ * Retrieve a stage
21144
+ * Returns a single PipelineStage by id (must belong to the URL Pipeline).
21145
+ *
21146
+ * **Required permission:** `Ibl.CRM/Pipelines/read`.
21147
+ * @returns PipelineStage
21148
+ * @throws ApiError
21149
+ */
21150
+ static crmPipelinesStagesRetrieve({
21151
+ id,
21152
+ pipelinePk
21153
+ }) {
21154
+ return request(OpenAPI, {
21155
+ method: 'GET',
21156
+ url: '/api/crm/pipelines/{pipeline_pk}/stages/{id}/',
21157
+ path: {
21158
+ 'id': id,
21159
+ 'pipeline_pk': pipelinePk
21160
+ },
21161
+ errors: {
21162
+ 403: `Missing required permission \`Ibl.CRM/Pipelines/read\`.`,
21163
+ 404: `Stage not found in this Pipeline.`
21164
+ }
21165
+ });
21166
+ }
21167
+ /**
21168
+ * Replace a stage
21169
+ * Replaces all editable fields on the PipelineStage.
21170
+ *
21171
+ * **Required permission:** `Ibl.CRM/Pipelines/write`.
21172
+ * @returns PipelineStage
20055
21173
  * @throws ApiError
20056
21174
  */
20057
- static crmPersonsPartialUpdate({
21175
+ static crmPipelinesStagesUpdate({
21176
+ id,
21177
+ pipelinePk,
21178
+ requestBody
21179
+ }) {
21180
+ return request(OpenAPI, {
21181
+ method: 'PUT',
21182
+ url: '/api/crm/pipelines/{pipeline_pk}/stages/{id}/',
21183
+ path: {
21184
+ 'id': id,
21185
+ 'pipeline_pk': pipelinePk
21186
+ },
21187
+ body: requestBody,
21188
+ mediaType: 'application/json',
21189
+ errors: {
21190
+ 400: `Validation error.`,
21191
+ 403: `Missing required permission \`Ibl.CRM/Pipelines/write\`.`,
21192
+ 404: `Stage not found in this Pipeline.`
21193
+ }
21194
+ });
21195
+ }
21196
+ /**
21197
+ * Update a stage
21198
+ * Updates only the supplied fields on the PipelineStage.
21199
+ *
21200
+ * **Required permission:** `Ibl.CRM/Pipelines/write`.
21201
+ * @returns PipelineStage
21202
+ * @throws ApiError
21203
+ */
21204
+ static crmPipelinesStagesPartialUpdate({
20058
21205
  id,
21206
+ pipelinePk,
20059
21207
  requestBody
20060
21208
  }) {
20061
21209
  return request(OpenAPI, {
20062
21210
  method: 'PATCH',
20063
- url: '/api/crm/persons/{id}/',
21211
+ url: '/api/crm/pipelines/{pipeline_pk}/stages/{id}/',
21212
+ path: {
21213
+ 'id': id,
21214
+ 'pipeline_pk': pipelinePk
21215
+ },
21216
+ body: requestBody,
21217
+ mediaType: 'application/json',
21218
+ errors: {
21219
+ 400: `Validation error.`,
21220
+ 403: `Missing required permission \`Ibl.CRM/Pipelines/write\`.`,
21221
+ 404: `Stage not found in this Pipeline.`
21222
+ }
21223
+ });
21224
+ }
21225
+ /**
21226
+ * Delete a stage
21227
+ * Deletes the PipelineStage. Fails with `409 Conflict` if any Deal still references it (FK is PROTECTed).
21228
+ *
21229
+ * **Required permission:** `Ibl.CRM/Pipelines/delete`.
21230
+ * @returns void
21231
+ * @throws ApiError
21232
+ */
21233
+ static crmPipelinesStagesDestroy({
21234
+ id,
21235
+ pipelinePk
21236
+ }) {
21237
+ return request(OpenAPI, {
21238
+ method: 'DELETE',
21239
+ url: '/api/crm/pipelines/{pipeline_pk}/stages/{id}/',
21240
+ path: {
21241
+ 'id': id,
21242
+ 'pipeline_pk': pipelinePk
21243
+ },
21244
+ errors: {
21245
+ 403: `Missing required permission \`Ibl.CRM/Pipelines/delete\`.`,
21246
+ 404: `Stage not found in this Pipeline.`,
21247
+ 409: `Stage still has Deals attached.`
21248
+ }
21249
+ });
21250
+ }
21251
+ /**
21252
+ * Retrieve a pipeline
21253
+ * Returns a single Pipeline by id, including its ordered `stages`.
21254
+ *
21255
+ * **Required permission:** `Ibl.CRM/Pipelines/read`.
21256
+ * @returns Pipeline
21257
+ * @throws ApiError
21258
+ */
21259
+ static crmPipelinesRetrieve({
21260
+ id
21261
+ }) {
21262
+ return request(OpenAPI, {
21263
+ method: 'GET',
21264
+ url: '/api/crm/pipelines/{id}/',
21265
+ path: {
21266
+ 'id': id
21267
+ },
21268
+ errors: {
21269
+ 403: `Missing required permission \`Ibl.CRM/Pipelines/read\`.`,
21270
+ 404: `Pipeline not found.`
21271
+ }
21272
+ });
21273
+ }
21274
+ /**
21275
+ * Replace a pipeline
21276
+ * Replaces all editable fields on the Pipeline.
21277
+ *
21278
+ * **Required permission:** `Ibl.CRM/Pipelines/write`.
21279
+ * @returns Pipeline
21280
+ * @throws ApiError
21281
+ */
21282
+ static crmPipelinesUpdate({
21283
+ id,
21284
+ requestBody
21285
+ }) {
21286
+ return request(OpenAPI, {
21287
+ method: 'PUT',
21288
+ url: '/api/crm/pipelines/{id}/',
21289
+ path: {
21290
+ 'id': id
21291
+ },
21292
+ body: requestBody,
21293
+ mediaType: 'application/json',
21294
+ errors: {
21295
+ 400: `Validation error.`,
21296
+ 403: `Missing required permission \`Ibl.CRM/Pipelines/write\`.`,
21297
+ 404: `Pipeline not found.`
21298
+ }
21299
+ });
21300
+ }
21301
+ /**
21302
+ * Update a pipeline
21303
+ * Updates only the supplied fields on the Pipeline.
21304
+ *
21305
+ * **Required permission:** `Ibl.CRM/Pipelines/write`.
21306
+ * @returns Pipeline
21307
+ * @throws ApiError
21308
+ */
21309
+ static crmPipelinesPartialUpdate({
21310
+ id,
21311
+ requestBody
21312
+ }) {
21313
+ return request(OpenAPI, {
21314
+ method: 'PATCH',
21315
+ url: '/api/crm/pipelines/{id}/',
21316
+ path: {
21317
+ 'id': id
21318
+ },
21319
+ body: requestBody,
21320
+ mediaType: 'application/json',
21321
+ errors: {
21322
+ 400: `Validation error.`,
21323
+ 403: `Missing required permission \`Ibl.CRM/Pipelines/write\`.`,
21324
+ 404: `Pipeline not found.`
21325
+ }
21326
+ });
21327
+ }
21328
+ /**
21329
+ * Delete a pipeline
21330
+ * Deletes the Pipeline. Fails with `409 Conflict` if any Deal still references it (FK is PROTECTed).
21331
+ *
21332
+ * **Required permission:** `Ibl.CRM/Pipelines/delete`.
21333
+ * @returns void
21334
+ * @throws ApiError
21335
+ */
21336
+ static crmPipelinesDestroy({
21337
+ id
21338
+ }) {
21339
+ return request(OpenAPI, {
21340
+ method: 'DELETE',
21341
+ url: '/api/crm/pipelines/{id}/',
20064
21342
  path: {
20065
21343
  'id': id
20066
21344
  },
21345
+ errors: {
21346
+ 403: `Missing required permission \`Ibl.CRM/Pipelines/delete\`.`,
21347
+ 404: `Pipeline not found.`,
21348
+ 409: `Pipeline still has Deals attached.`
21349
+ }
21350
+ });
21351
+ }
21352
+ }
21353
+
21354
+ class CustomDomainsService {
21355
+ /**
21356
+ * API endpoint to get custom domains (public, no authentication or permission checks)
21357
+ * @returns any No response body
21358
+ * @throws ApiError
21359
+ */
21360
+ static customDomainsRetrieve() {
21361
+ return request(OpenAPI, {
21362
+ method: 'GET',
21363
+ url: '/api/custom-domains/'
21364
+ });
21365
+ }
21366
+ /**
21367
+ * API endpoint to hard delete a custom domain
21368
+ * @returns void
21369
+ * @throws ApiError
21370
+ */
21371
+ static customDomainsDeleteDestroy({
21372
+ domainId
21373
+ }) {
21374
+ return request(OpenAPI, {
21375
+ method: 'DELETE',
21376
+ url: '/api/custom-domains/{domain_id}/delete/',
21377
+ path: {
21378
+ 'domain_id': domainId
21379
+ }
21380
+ });
21381
+ }
21382
+ /**
21383
+ * API endpoint to update the is_deleted status of a custom domain
21384
+ * @returns any No response body
21385
+ * @throws ApiError
21386
+ */
21387
+ static customDomainsDeletedStatusCreate({
21388
+ domainId
21389
+ }) {
21390
+ return request(OpenAPI, {
21391
+ method: 'POST',
21392
+ url: '/api/custom-domains/{domain_id}/deleted-status/',
21393
+ path: {
21394
+ 'domain_id': domainId
21395
+ }
21396
+ });
21397
+ }
21398
+ /**
21399
+ * API endpoint to update custom domain SPA type
21400
+ * @returns any No response body
21401
+ * @throws ApiError
21402
+ */
21403
+ static customDomainsStatusUpdate({
21404
+ domainId
21405
+ }) {
21406
+ return request(OpenAPI, {
21407
+ method: 'PUT',
21408
+ url: '/api/custom-domains/{domain_id}/status/',
21409
+ path: {
21410
+ 'domain_id': domainId
21411
+ }
21412
+ });
21413
+ }
21414
+ /**
21415
+ * API endpoint to update custom domain SPA type by domain name
21416
+ * @returns any No response body
21417
+ * @throws ApiError
21418
+ */
21419
+ static customDomainsByNameStatusUpdate({
21420
+ domainName
21421
+ }) {
21422
+ return request(OpenAPI, {
21423
+ method: 'PUT',
21424
+ url: '/api/custom-domains/by-name/{domain_name}/status/',
21425
+ path: {
21426
+ 'domain_name': domainName
21427
+ }
21428
+ });
21429
+ }
21430
+ /**
21431
+ * API endpoint to create a custom domain
21432
+ * @returns any No response body
21433
+ * @throws ApiError
21434
+ */
21435
+ static customDomainsCreateCreate() {
21436
+ return request(OpenAPI, {
21437
+ method: 'POST',
21438
+ url: '/api/custom-domains/create/'
21439
+ });
21440
+ }
21441
+ }
21442
+
21443
+ class DealsService {
21444
+ /**
21445
+ * List deals
21446
+ * Returns a paginated list of Deals in your Platform. Supports filtering by `status`, `pipeline`, `stage`, `owner`, `source`, `person`, `organization`, expected-close-date and created-at ranges, and `metadata__has_key`.
21447
+ *
21448
+ * **Required permission:** `Ibl.CRM/Deals/list`.
21449
+ * @returns PaginatedDealList
21450
+ * @throws ApiError
21451
+ */
21452
+ static dealsList({
21453
+ createdAtGte,
21454
+ createdAtLte,
21455
+ expectedCloseDateGte,
21456
+ expectedCloseDateLte,
21457
+ metadataHasKey,
21458
+ organization,
21459
+ owner,
21460
+ page,
21461
+ pageSize,
21462
+ person,
21463
+ pipeline,
21464
+ source,
21465
+ stage,
21466
+ status
21467
+ }) {
21468
+ return request(OpenAPI, {
21469
+ method: 'GET',
21470
+ url: '/deals/',
21471
+ query: {
21472
+ 'created_at__gte': createdAtGte,
21473
+ 'created_at__lte': createdAtLte,
21474
+ 'expected_close_date__gte': expectedCloseDateGte,
21475
+ 'expected_close_date__lte': expectedCloseDateLte,
21476
+ 'metadata__has_key': metadataHasKey,
21477
+ 'organization': organization,
21478
+ 'owner': owner,
21479
+ 'page': page,
21480
+ 'page_size': pageSize,
21481
+ 'person': person,
21482
+ 'pipeline': pipeline,
21483
+ 'source': source,
21484
+ 'stage': stage,
21485
+ 'status': status
21486
+ },
21487
+ errors: {
21488
+ 401: `Authentication required.`,
21489
+ 403: `Missing required permission \`Ibl.CRM/Deals/list\`.`
21490
+ }
21491
+ });
21492
+ }
21493
+ /**
21494
+ * Create a deal
21495
+ * Creates a new Deal. All FK targets (`person`, `organization`, `pipeline`, `stage`, `source`) must belong to your Platform; `stage` must belong to `pipeline`. `status` and `closed_at` are service-managed — passing them returns `400`.
21496
+ *
21497
+ * **Required permission:** `Ibl.CRM/Deals/write`.
21498
+ * @returns Deal
21499
+ * @throws ApiError
21500
+ */
21501
+ static dealsCreate({
21502
+ requestBody
21503
+ }) {
21504
+ return request(OpenAPI, {
21505
+ method: 'POST',
21506
+ url: '/deals/',
20067
21507
  body: requestBody,
20068
21508
  mediaType: 'application/json',
20069
21509
  errors: {
20070
21510
  400: `Validation error.`,
20071
- 403: `Missing required permission \`Ibl.CRM/Persons/write\`.`,
20072
- 404: `Person not found.`
21511
+ 403: `Missing required permission \`Ibl.CRM/Deals/write\`.`
20073
21512
  }
20074
21513
  });
20075
21514
  }
20076
21515
  /**
20077
- * Delete a person
20078
- * Deletes the person.
21516
+ * Retrieve a deal
21517
+ * Returns a single Deal by id.
20079
21518
  *
20080
- * **Required permission:** `Ibl.CRM/Persons/delete`.
20081
- * @returns void
21519
+ * **Required permission:** `Ibl.CRM/Deals/read`.
21520
+ * @returns Deal
20082
21521
  * @throws ApiError
20083
21522
  */
20084
- static crmPersonsDestroy({
21523
+ static dealsRetrieve({
20085
21524
  id
20086
21525
  }) {
20087
21526
  return request(OpenAPI, {
20088
- method: 'DELETE',
20089
- url: '/api/crm/persons/{id}/',
21527
+ method: 'GET',
21528
+ url: '/deals/{id}/',
20090
21529
  path: {
20091
21530
  'id': id
20092
21531
  },
20093
21532
  errors: {
20094
- 403: `Missing required permission \`Ibl.CRM/Persons/delete\`.`,
20095
- 404: `Person not found.`
21533
+ 403: `Missing required permission \`Ibl.CRM/Deals/read\`.`,
21534
+ 404: `Deal not found.`
20096
21535
  }
20097
21536
  });
20098
21537
  }
20099
21538
  /**
20100
- * Invite a person to the platform
20101
- * Sends a platform invitation to the person's `primary_email`. On acceptance, the invitee joins your Platform with the privileges configured in the request body.
21539
+ * Replace a deal
21540
+ * Replaces all editable fields on the Deal.
20102
21541
  *
20103
- * Returns `409 Conflict` if an active invitation already exists for this email in your Platform, and `422 Unprocessable Entity` if the person is already linked to a platform user.
20104
- *
20105
- * **Required permission:** `Ibl.CRM/Invite/action`.
20106
- * @returns PersonInviteResponse
21542
+ * **Required permission:** `Ibl.CRM/Deals/write`.
21543
+ * @returns Deal
20107
21544
  * @throws ApiError
20108
21545
  */
20109
- static crmPersonsInviteCreate({
21546
+ static dealsUpdate({
20110
21547
  id,
20111
21548
  requestBody
20112
21549
  }) {
20113
21550
  return request(OpenAPI, {
20114
- method: 'POST',
20115
- url: '/api/crm/persons/{id}/invite/',
21551
+ method: 'PUT',
21552
+ url: '/deals/{id}/',
20116
21553
  path: {
20117
21554
  'id': id
20118
21555
  },
20119
21556
  body: requestBody,
20120
21557
  mediaType: 'application/json',
20121
21558
  errors: {
20122
- 400: `Person has no \`primary_email\`; cannot invite.`,
20123
- 403: `Missing required permission \`Ibl.CRM/Invite/action\`.`,
20124
- 404: `Person not found.`,
20125
- 422: `Person is already linked to a platform user.`
21559
+ 400: `Validation error.`,
21560
+ 403: `Missing required permission \`Ibl.CRM/Deals/write\`.`,
21561
+ 404: `Deal not found.`
20126
21562
  }
20127
21563
  });
20128
21564
  }
20129
21565
  /**
20130
- * Bind a person to an existing platform user
20131
- * Links this person to an existing platform user. The target user must already be a member of your Platform if they are not, send them an invitation via `POST /persons/{id}/invite/` instead.
20132
- *
20133
- * This call is idempotent: linking a person that is already bound to the same user is a no-op. Re-linking a person that is already bound to a *different* user is refused; the existing binding is preserved and the unchanged person is returned.
21566
+ * Update a deal
21567
+ * Updates only the supplied fields on the Deal. Direct writes to `status` or `closed_at` are rejected with `400`use `POST /deals/{id}/move-stage/`, `won/`, or `lost/`.
20134
21568
  *
20135
- * **Required permission:** `Ibl.CRM/Persons/write`.
20136
- * @returns Person
21569
+ * **Required permission:** `Ibl.CRM/Deals/write`.
21570
+ * @returns Deal
20137
21571
  * @throws ApiError
20138
21572
  */
20139
- static crmPersonsLinkUserCreate({
21573
+ static dealsPartialUpdate({
20140
21574
  id,
20141
21575
  requestBody
20142
21576
  }) {
20143
21577
  return request(OpenAPI, {
20144
- method: 'POST',
20145
- url: '/api/crm/persons/{id}/link-user/',
21578
+ method: 'PATCH',
21579
+ url: '/deals/{id}/',
20146
21580
  path: {
20147
21581
  'id': id
20148
21582
  },
@@ -20150,125 +21584,115 @@ class CrmService {
20150
21584
  mediaType: 'application/json',
20151
21585
  errors: {
20152
21586
  400: `Validation error.`,
20153
- 403: `Missing required permission \`Ibl.CRM/Persons/write\`, or the target user is not a member of your Platform.`,
20154
- 404: `Person or user not found.`
21587
+ 403: `Missing required permission \`Ibl.CRM/Deals/write\`.`,
21588
+ 404: `Deal not found.`
20155
21589
  }
20156
21590
  });
20157
21591
  }
20158
21592
  /**
20159
- * Merge duplicate persons into a primary
20160
- * Marks each person in `duplicate_ids` as inactive and reports how many related records (deals, activities, tags) were re-parented onto `primary_id`.
20161
- *
20162
- * All ids — both the primary and every duplicate — must belong to your Platform. `primary_id` may not appear in `duplicate_ids`.
21593
+ * Delete a deal
21594
+ * Deletes the Deal.
20163
21595
  *
20164
- * **Required permission:** `Ibl.CRM/Persons/write`.
20165
- * @returns PersonMergeResponse
20166
- * @throws ApiError
20167
- */
20168
- static crmPersonsMergeCreate({
20169
- requestBody
20170
- }) {
20171
- return request(OpenAPI, {
20172
- method: 'POST',
20173
- url: '/api/crm/persons/merge/',
20174
- body: requestBody,
20175
- mediaType: 'application/json',
20176
- errors: {
20177
- 400: `Validation error: the primary appears in duplicates, or one or more ids belong to another Platform.`,
20178
- 403: `Missing required permission \`Ibl.CRM/Persons/write\`.`,
20179
- 404: `Primary person not found.`
20180
- }
20181
- });
20182
- }
20183
- }
20184
-
20185
- class CustomDomainsService {
20186
- /**
20187
- * API endpoint to get custom domains (public, no authentication or permission checks)
20188
- * @returns any No response body
20189
- * @throws ApiError
20190
- */
20191
- static customDomainsRetrieve() {
20192
- return request(OpenAPI, {
20193
- method: 'GET',
20194
- url: '/api/custom-domains/'
20195
- });
20196
- }
20197
- /**
20198
- * API endpoint to hard delete a custom domain
21596
+ * **Required permission:** `Ibl.CRM/Deals/delete`.
20199
21597
  * @returns void
20200
21598
  * @throws ApiError
20201
21599
  */
20202
- static customDomainsDeleteDestroy({
20203
- domainId
21600
+ static dealsDestroy({
21601
+ id
20204
21602
  }) {
20205
21603
  return request(OpenAPI, {
20206
21604
  method: 'DELETE',
20207
- url: '/api/custom-domains/{domain_id}/delete/',
21605
+ url: '/deals/{id}/',
20208
21606
  path: {
20209
- 'domain_id': domainId
21607
+ 'id': id
21608
+ },
21609
+ errors: {
21610
+ 403: `Missing required permission \`Ibl.CRM/Deals/delete\`.`,
21611
+ 404: `Deal not found.`
20210
21612
  }
20211
21613
  });
20212
21614
  }
20213
21615
  /**
20214
- * API endpoint to update the is_deleted status of a custom domain
20215
- * @returns any No response body
21616
+ * Mark a deal as lost
21617
+ * Moves the Deal into a closed-lost stage and persists `lost_reason`. If `stage_code` is omitted, the first `is_lost=True` stage in the Deal's pipeline (by sort order) is used.
21618
+ *
21619
+ * **Required permission:** `Ibl.CRM/Deals/write`.
21620
+ * @returns Deal
20216
21621
  * @throws ApiError
20217
21622
  */
20218
- static customDomainsDeletedStatusCreate({
20219
- domainId
21623
+ static dealsLostCreate({
21624
+ id,
21625
+ requestBody
20220
21626
  }) {
20221
21627
  return request(OpenAPI, {
20222
21628
  method: 'POST',
20223
- url: '/api/custom-domains/{domain_id}/deleted-status/',
21629
+ url: '/deals/{id}/lost/',
20224
21630
  path: {
20225
- 'domain_id': domainId
21631
+ 'id': id
21632
+ },
21633
+ body: requestBody,
21634
+ mediaType: 'application/json',
21635
+ errors: {
21636
+ 400: `Missing \`lost_reason\`, no \`is_lost\` stage configured, or the supplied stage_code is not flagged is_lost=True.`,
21637
+ 403: `Missing required permission \`Ibl.CRM/Deals/write\`.`,
21638
+ 404: `Deal not found.`
20226
21639
  }
20227
21640
  });
20228
21641
  }
20229
21642
  /**
20230
- * API endpoint to update custom domain SPA type
20231
- * @returns any No response body
21643
+ * Move a deal to a different stage
21644
+ * Moves the Deal to the stage identified by `stage_id` or `stage_code`. The target stage must belong to this Deal's pipeline. Records an audit Activity and emits `deal_stage_changed`. `Deal.status` is recomputed from the new stage's `is_won` / `is_lost` flags.
21645
+ *
21646
+ * **Required permission:** `Ibl.CRM/Deals/write`.
21647
+ * @returns Deal
20232
21648
  * @throws ApiError
20233
21649
  */
20234
- static customDomainsStatusUpdate({
20235
- domainId
21650
+ static dealsMoveStageCreate({
21651
+ id,
21652
+ requestBody
20236
21653
  }) {
20237
21654
  return request(OpenAPI, {
20238
- method: 'PUT',
20239
- url: '/api/custom-domains/{domain_id}/status/',
21655
+ method: 'POST',
21656
+ url: '/deals/{id}/move-stage/',
20240
21657
  path: {
20241
- 'domain_id': domainId
21658
+ 'id': id
21659
+ },
21660
+ body: requestBody,
21661
+ mediaType: 'application/json',
21662
+ errors: {
21663
+ 400: `Validation error (e.g. stage not in pipeline).`,
21664
+ 403: `Missing required permission \`Ibl.CRM/Deals/write\`.`,
21665
+ 404: `Deal or stage not found.`
20242
21666
  }
20243
21667
  });
20244
21668
  }
20245
21669
  /**
20246
- * API endpoint to update custom domain SPA type by domain name
20247
- * @returns any No response body
21670
+ * Mark a deal as won
21671
+ * Moves the Deal into a closed-won stage and sets `status='won'`. If `stage_code` is omitted, the first `is_won=True` stage in the Deal's pipeline (by sort order) is used.
21672
+ *
21673
+ * **Required permission:** `Ibl.CRM/Deals/write`.
21674
+ * @returns Deal
20248
21675
  * @throws ApiError
20249
21676
  */
20250
- static customDomainsByNameStatusUpdate({
20251
- domainName
21677
+ static dealsWonCreate({
21678
+ id,
21679
+ requestBody
20252
21680
  }) {
20253
21681
  return request(OpenAPI, {
20254
- method: 'PUT',
20255
- url: '/api/custom-domains/by-name/{domain_name}/status/',
21682
+ method: 'POST',
21683
+ url: '/deals/{id}/won/',
20256
21684
  path: {
20257
- 'domain_name': domainName
21685
+ 'id': id
21686
+ },
21687
+ body: requestBody,
21688
+ mediaType: 'application/json',
21689
+ errors: {
21690
+ 400: `No \`is_won\` stage configured, or the supplied stage_code is not flagged is_won=True.`,
21691
+ 403: `Missing required permission \`Ibl.CRM/Deals/write\`.`,
21692
+ 404: `Deal not found.`
20258
21693
  }
20259
21694
  });
20260
21695
  }
20261
- /**
20262
- * API endpoint to create a custom domain
20263
- * @returns any No response body
20264
- * @throws ApiError
20265
- */
20266
- static customDomainsCreateCreate() {
20267
- return request(OpenAPI, {
20268
- method: 'POST',
20269
- url: '/api/custom-domains/create/'
20270
- });
20271
- }
20272
21696
  }
20273
21697
 
20274
21698
  class FeaturesService {
@@ -20362,43 +21786,197 @@ class FeaturesService {
20362
21786
  });
20363
21787
  }
20364
21788
  /**
20365
- * POST
20366
- * Update user feature config
20367
- *
20368
- * Params:
20369
- * user_id/username/email
20370
- * platform_key
21789
+ * POST
21790
+ * Update user feature config
21791
+ *
21792
+ * Params:
21793
+ * user_id/username/email
21794
+ * platform_key
21795
+ *
21796
+ * config
21797
+ * (OR)
21798
+ * feature
21799
+ * values
21800
+ * @returns any No response body
21801
+ * @throws ApiError
21802
+ */
21803
+ static featuresConfigCreate() {
21804
+ return request(OpenAPI, {
21805
+ method: 'POST',
21806
+ url: '/api/features/config/'
21807
+ });
21808
+ }
21809
+ }
21810
+
21811
+ class ItemsService {
21812
+ /**
21813
+ * Get public pricing by paywall config unique_id
21814
+ * Looks up the paywall config by its unique_id and delegates to the standard public pricing endpoint.
21815
+ * @returns PublicItemPricing
21816
+ * @throws ApiError
21817
+ */
21818
+ static itemsPublicPricingRetrieve({
21819
+ configUniqueId
21820
+ }) {
21821
+ return request(OpenAPI, {
21822
+ method: 'GET',
21823
+ url: '/items/{config_unique_id}/public-pricing/',
21824
+ path: {
21825
+ 'config_unique_id': configUniqueId
21826
+ }
21827
+ });
21828
+ }
21829
+ }
21830
+
21831
+ class LeadSourcesService {
21832
+ /**
21833
+ * List lead sources
21834
+ * Returns a paginated list of LeadSources in your Platform.
21835
+ *
21836
+ * **Required permission:** `Ibl.CRM/Pipelines/list`.
21837
+ * @returns PaginatedLeadSourceList
21838
+ * @throws ApiError
21839
+ */
21840
+ static leadSourcesList({
21841
+ code,
21842
+ name,
21843
+ page,
21844
+ pageSize
21845
+ }) {
21846
+ return request(OpenAPI, {
21847
+ method: 'GET',
21848
+ url: '/lead-sources/',
21849
+ query: {
21850
+ 'code': code,
21851
+ 'name': name,
21852
+ 'page': page,
21853
+ 'page_size': pageSize
21854
+ },
21855
+ errors: {
21856
+ 401: `Authentication required.`,
21857
+ 403: `Missing required permission \`Ibl.CRM/Pipelines/list\`.`
21858
+ }
21859
+ });
21860
+ }
21861
+ /**
21862
+ * Create a lead source
21863
+ * Creates a new LeadSource in your Platform. `code` must be unique.
21864
+ *
21865
+ * **Required permission:** `Ibl.CRM/Pipelines/write`.
21866
+ * @returns LeadSource
21867
+ * @throws ApiError
21868
+ */
21869
+ static leadSourcesCreate({
21870
+ requestBody
21871
+ }) {
21872
+ return request(OpenAPI, {
21873
+ method: 'POST',
21874
+ url: '/lead-sources/',
21875
+ body: requestBody,
21876
+ mediaType: 'application/json',
21877
+ errors: {
21878
+ 400: `Validation error.`,
21879
+ 403: `Missing required permission \`Ibl.CRM/Pipelines/write\`.`
21880
+ }
21881
+ });
21882
+ }
21883
+ /**
21884
+ * Retrieve a lead source
21885
+ * Returns a single LeadSource by id.
21886
+ *
21887
+ * **Required permission:** `Ibl.CRM/Pipelines/read`.
21888
+ * @returns LeadSource
21889
+ * @throws ApiError
21890
+ */
21891
+ static leadSourcesRetrieve({
21892
+ id
21893
+ }) {
21894
+ return request(OpenAPI, {
21895
+ method: 'GET',
21896
+ url: '/lead-sources/{id}/',
21897
+ path: {
21898
+ 'id': id
21899
+ },
21900
+ errors: {
21901
+ 403: `Missing required permission \`Ibl.CRM/Pipelines/read\`.`,
21902
+ 404: `LeadSource not found.`
21903
+ }
21904
+ });
21905
+ }
21906
+ /**
21907
+ * Replace a lead source
21908
+ * Replaces all editable fields on the LeadSource.
21909
+ *
21910
+ * **Required permission:** `Ibl.CRM/Pipelines/write`.
21911
+ * @returns LeadSource
21912
+ * @throws ApiError
21913
+ */
21914
+ static leadSourcesUpdate({
21915
+ id,
21916
+ requestBody
21917
+ }) {
21918
+ return request(OpenAPI, {
21919
+ method: 'PUT',
21920
+ url: '/lead-sources/{id}/',
21921
+ path: {
21922
+ 'id': id
21923
+ },
21924
+ body: requestBody,
21925
+ mediaType: 'application/json',
21926
+ errors: {
21927
+ 400: `Validation error.`,
21928
+ 403: `Missing required permission \`Ibl.CRM/Pipelines/write\`.`,
21929
+ 404: `LeadSource not found.`
21930
+ }
21931
+ });
21932
+ }
21933
+ /**
21934
+ * Update a lead source
21935
+ * Updates only the supplied fields on the LeadSource.
20371
21936
  *
20372
- * config
20373
- * (OR)
20374
- * feature
20375
- * values
20376
- * @returns any No response body
21937
+ * **Required permission:** `Ibl.CRM/Pipelines/write`.
21938
+ * @returns LeadSource
20377
21939
  * @throws ApiError
20378
21940
  */
20379
- static featuresConfigCreate() {
21941
+ static leadSourcesPartialUpdate({
21942
+ id,
21943
+ requestBody
21944
+ }) {
20380
21945
  return request(OpenAPI, {
20381
- method: 'POST',
20382
- url: '/api/features/config/'
21946
+ method: 'PATCH',
21947
+ url: '/lead-sources/{id}/',
21948
+ path: {
21949
+ 'id': id
21950
+ },
21951
+ body: requestBody,
21952
+ mediaType: 'application/json',
21953
+ errors: {
21954
+ 400: `Validation error.`,
21955
+ 403: `Missing required permission \`Ibl.CRM/Pipelines/write\`.`,
21956
+ 404: `LeadSource not found.`
21957
+ }
20383
21958
  });
20384
21959
  }
20385
- }
20386
-
20387
- class ItemsService {
20388
21960
  /**
20389
- * Get public pricing by paywall config unique_id
20390
- * Looks up the paywall config by its unique_id and delegates to the standard public pricing endpoint.
20391
- * @returns PublicItemPricing
21961
+ * Delete a lead source
21962
+ * Deletes the LeadSource. Any Deals referencing it have their `source` cleared.
21963
+ *
21964
+ * **Required permission:** `Ibl.CRM/Pipelines/delete`.
21965
+ * @returns void
20392
21966
  * @throws ApiError
20393
21967
  */
20394
- static itemsPublicPricingRetrieve({
20395
- configUniqueId
21968
+ static leadSourcesDestroy({
21969
+ id
20396
21970
  }) {
20397
21971
  return request(OpenAPI, {
20398
- method: 'GET',
20399
- url: '/items/{config_unique_id}/public-pricing/',
21972
+ method: 'DELETE',
21973
+ url: '/lead-sources/{id}/',
20400
21974
  path: {
20401
- 'config_unique_id': configUniqueId
21975
+ 'id': id
21976
+ },
21977
+ errors: {
21978
+ 403: `Missing required permission \`Ibl.CRM/Pipelines/delete\`.`,
21979
+ 404: `LeadSource not found.`
20402
21980
  }
20403
21981
  });
20404
21982
  }
@@ -21688,6 +23266,334 @@ class PersonsService {
21688
23266
  }
21689
23267
  }
21690
23268
 
23269
+ class PipelinesService {
23270
+ /**
23271
+ * List pipelines
23272
+ * Returns a paginated list of Pipelines in your Platform. Each Pipeline includes its ordered `stages` inline.
23273
+ *
23274
+ * **Required permission:** `Ibl.CRM/Pipelines/list`.
23275
+ * @returns PaginatedPipelineList
23276
+ * @throws ApiError
23277
+ */
23278
+ static pipelinesList({
23279
+ code,
23280
+ isDefault,
23281
+ name,
23282
+ page,
23283
+ pageSize
23284
+ }) {
23285
+ return request(OpenAPI, {
23286
+ method: 'GET',
23287
+ url: '/pipelines/',
23288
+ query: {
23289
+ 'code': code,
23290
+ 'is_default': isDefault,
23291
+ 'name': name,
23292
+ 'page': page,
23293
+ 'page_size': pageSize
23294
+ },
23295
+ errors: {
23296
+ 401: `Authentication required.`,
23297
+ 403: `Missing required permission \`Ibl.CRM/Pipelines/list\`.`
23298
+ }
23299
+ });
23300
+ }
23301
+ /**
23302
+ * Create a pipeline
23303
+ * Creates a new Pipeline. `code` must be unique within your Platform. Promoting another Pipeline to `is_default=true` while one already exists will fail — unset the existing default first.
23304
+ *
23305
+ * **Required permission:** `Ibl.CRM/Pipelines/write`.
23306
+ * @returns Pipeline
23307
+ * @throws ApiError
23308
+ */
23309
+ static pipelinesCreate({
23310
+ requestBody
23311
+ }) {
23312
+ return request(OpenAPI, {
23313
+ method: 'POST',
23314
+ url: '/pipelines/',
23315
+ body: requestBody,
23316
+ mediaType: 'application/json',
23317
+ errors: {
23318
+ 400: `Validation error.`,
23319
+ 403: `Missing required permission \`Ibl.CRM/Pipelines/write\`.`
23320
+ }
23321
+ });
23322
+ }
23323
+ /**
23324
+ * List stages for a pipeline
23325
+ * Returns the ordered list of PipelineStages for the given Pipeline.
23326
+ *
23327
+ * **Required permission:** `Ibl.CRM/Pipelines/list`.
23328
+ * @returns PaginatedPipelineStageList
23329
+ * @throws ApiError
23330
+ */
23331
+ static pipelinesStagesList({
23332
+ pipelinePk,
23333
+ code,
23334
+ isLost,
23335
+ isWon,
23336
+ page,
23337
+ pageSize
23338
+ }) {
23339
+ return request(OpenAPI, {
23340
+ method: 'GET',
23341
+ url: '/pipelines/{pipeline_pk}/stages/',
23342
+ path: {
23343
+ 'pipeline_pk': pipelinePk
23344
+ },
23345
+ query: {
23346
+ 'code': code,
23347
+ 'is_lost': isLost,
23348
+ 'is_won': isWon,
23349
+ 'page': page,
23350
+ 'page_size': pageSize
23351
+ },
23352
+ errors: {
23353
+ 403: `Missing required permission \`Ibl.CRM/Pipelines/list\`.`,
23354
+ 404: `Pipeline not found.`
23355
+ }
23356
+ });
23357
+ }
23358
+ /**
23359
+ * Create a stage
23360
+ * Creates a new PipelineStage in the URL Pipeline. `code` must be unique within that Pipeline. At most one of `is_won` / `is_lost` may be true.
23361
+ *
23362
+ * **Required permission:** `Ibl.CRM/Pipelines/write`.
23363
+ * @returns PipelineStage
23364
+ * @throws ApiError
23365
+ */
23366
+ static pipelinesStagesCreate({
23367
+ pipelinePk,
23368
+ requestBody
23369
+ }) {
23370
+ return request(OpenAPI, {
23371
+ method: 'POST',
23372
+ url: '/pipelines/{pipeline_pk}/stages/',
23373
+ path: {
23374
+ 'pipeline_pk': pipelinePk
23375
+ },
23376
+ body: requestBody,
23377
+ mediaType: 'application/json',
23378
+ errors: {
23379
+ 400: `Validation error.`,
23380
+ 403: `Missing required permission \`Ibl.CRM/Pipelines/write\`.`,
23381
+ 404: `Pipeline not found.`
23382
+ }
23383
+ });
23384
+ }
23385
+ /**
23386
+ * Retrieve a stage
23387
+ * Returns a single PipelineStage by id (must belong to the URL Pipeline).
23388
+ *
23389
+ * **Required permission:** `Ibl.CRM/Pipelines/read`.
23390
+ * @returns PipelineStage
23391
+ * @throws ApiError
23392
+ */
23393
+ static pipelinesStagesRetrieve({
23394
+ id,
23395
+ pipelinePk
23396
+ }) {
23397
+ return request(OpenAPI, {
23398
+ method: 'GET',
23399
+ url: '/pipelines/{pipeline_pk}/stages/{id}/',
23400
+ path: {
23401
+ 'id': id,
23402
+ 'pipeline_pk': pipelinePk
23403
+ },
23404
+ errors: {
23405
+ 403: `Missing required permission \`Ibl.CRM/Pipelines/read\`.`,
23406
+ 404: `Stage not found in this Pipeline.`
23407
+ }
23408
+ });
23409
+ }
23410
+ /**
23411
+ * Replace a stage
23412
+ * Replaces all editable fields on the PipelineStage.
23413
+ *
23414
+ * **Required permission:** `Ibl.CRM/Pipelines/write`.
23415
+ * @returns PipelineStage
23416
+ * @throws ApiError
23417
+ */
23418
+ static pipelinesStagesUpdate({
23419
+ id,
23420
+ pipelinePk,
23421
+ requestBody
23422
+ }) {
23423
+ return request(OpenAPI, {
23424
+ method: 'PUT',
23425
+ url: '/pipelines/{pipeline_pk}/stages/{id}/',
23426
+ path: {
23427
+ 'id': id,
23428
+ 'pipeline_pk': pipelinePk
23429
+ },
23430
+ body: requestBody,
23431
+ mediaType: 'application/json',
23432
+ errors: {
23433
+ 400: `Validation error.`,
23434
+ 403: `Missing required permission \`Ibl.CRM/Pipelines/write\`.`,
23435
+ 404: `Stage not found in this Pipeline.`
23436
+ }
23437
+ });
23438
+ }
23439
+ /**
23440
+ * Update a stage
23441
+ * Updates only the supplied fields on the PipelineStage.
23442
+ *
23443
+ * **Required permission:** `Ibl.CRM/Pipelines/write`.
23444
+ * @returns PipelineStage
23445
+ * @throws ApiError
23446
+ */
23447
+ static pipelinesStagesPartialUpdate({
23448
+ id,
23449
+ pipelinePk,
23450
+ requestBody
23451
+ }) {
23452
+ return request(OpenAPI, {
23453
+ method: 'PATCH',
23454
+ url: '/pipelines/{pipeline_pk}/stages/{id}/',
23455
+ path: {
23456
+ 'id': id,
23457
+ 'pipeline_pk': pipelinePk
23458
+ },
23459
+ body: requestBody,
23460
+ mediaType: 'application/json',
23461
+ errors: {
23462
+ 400: `Validation error.`,
23463
+ 403: `Missing required permission \`Ibl.CRM/Pipelines/write\`.`,
23464
+ 404: `Stage not found in this Pipeline.`
23465
+ }
23466
+ });
23467
+ }
23468
+ /**
23469
+ * Delete a stage
23470
+ * Deletes the PipelineStage. Fails with `409 Conflict` if any Deal still references it (FK is PROTECTed).
23471
+ *
23472
+ * **Required permission:** `Ibl.CRM/Pipelines/delete`.
23473
+ * @returns void
23474
+ * @throws ApiError
23475
+ */
23476
+ static pipelinesStagesDestroy({
23477
+ id,
23478
+ pipelinePk
23479
+ }) {
23480
+ return request(OpenAPI, {
23481
+ method: 'DELETE',
23482
+ url: '/pipelines/{pipeline_pk}/stages/{id}/',
23483
+ path: {
23484
+ 'id': id,
23485
+ 'pipeline_pk': pipelinePk
23486
+ },
23487
+ errors: {
23488
+ 403: `Missing required permission \`Ibl.CRM/Pipelines/delete\`.`,
23489
+ 404: `Stage not found in this Pipeline.`,
23490
+ 409: `Stage still has Deals attached.`
23491
+ }
23492
+ });
23493
+ }
23494
+ /**
23495
+ * Retrieve a pipeline
23496
+ * Returns a single Pipeline by id, including its ordered `stages`.
23497
+ *
23498
+ * **Required permission:** `Ibl.CRM/Pipelines/read`.
23499
+ * @returns Pipeline
23500
+ * @throws ApiError
23501
+ */
23502
+ static pipelinesRetrieve({
23503
+ id
23504
+ }) {
23505
+ return request(OpenAPI, {
23506
+ method: 'GET',
23507
+ url: '/pipelines/{id}/',
23508
+ path: {
23509
+ 'id': id
23510
+ },
23511
+ errors: {
23512
+ 403: `Missing required permission \`Ibl.CRM/Pipelines/read\`.`,
23513
+ 404: `Pipeline not found.`
23514
+ }
23515
+ });
23516
+ }
23517
+ /**
23518
+ * Replace a pipeline
23519
+ * Replaces all editable fields on the Pipeline.
23520
+ *
23521
+ * **Required permission:** `Ibl.CRM/Pipelines/write`.
23522
+ * @returns Pipeline
23523
+ * @throws ApiError
23524
+ */
23525
+ static pipelinesUpdate({
23526
+ id,
23527
+ requestBody
23528
+ }) {
23529
+ return request(OpenAPI, {
23530
+ method: 'PUT',
23531
+ url: '/pipelines/{id}/',
23532
+ path: {
23533
+ 'id': id
23534
+ },
23535
+ body: requestBody,
23536
+ mediaType: 'application/json',
23537
+ errors: {
23538
+ 400: `Validation error.`,
23539
+ 403: `Missing required permission \`Ibl.CRM/Pipelines/write\`.`,
23540
+ 404: `Pipeline not found.`
23541
+ }
23542
+ });
23543
+ }
23544
+ /**
23545
+ * Update a pipeline
23546
+ * Updates only the supplied fields on the Pipeline.
23547
+ *
23548
+ * **Required permission:** `Ibl.CRM/Pipelines/write`.
23549
+ * @returns Pipeline
23550
+ * @throws ApiError
23551
+ */
23552
+ static pipelinesPartialUpdate({
23553
+ id,
23554
+ requestBody
23555
+ }) {
23556
+ return request(OpenAPI, {
23557
+ method: 'PATCH',
23558
+ url: '/pipelines/{id}/',
23559
+ path: {
23560
+ 'id': id
23561
+ },
23562
+ body: requestBody,
23563
+ mediaType: 'application/json',
23564
+ errors: {
23565
+ 400: `Validation error.`,
23566
+ 403: `Missing required permission \`Ibl.CRM/Pipelines/write\`.`,
23567
+ 404: `Pipeline not found.`
23568
+ }
23569
+ });
23570
+ }
23571
+ /**
23572
+ * Delete a pipeline
23573
+ * Deletes the Pipeline. Fails with `409 Conflict` if any Deal still references it (FK is PROTECTed).
23574
+ *
23575
+ * **Required permission:** `Ibl.CRM/Pipelines/delete`.
23576
+ * @returns void
23577
+ * @throws ApiError
23578
+ */
23579
+ static pipelinesDestroy({
23580
+ id
23581
+ }) {
23582
+ return request(OpenAPI, {
23583
+ method: 'DELETE',
23584
+ url: '/pipelines/{id}/',
23585
+ path: {
23586
+ 'id': id
23587
+ },
23588
+ errors: {
23589
+ 403: `Missing required permission \`Ibl.CRM/Pipelines/delete\`.`,
23590
+ 404: `Pipeline not found.`,
23591
+ 409: `Pipeline still has Deals attached.`
23592
+ }
23593
+ });
23594
+ }
23595
+ }
23596
+
21691
23597
  class PlatformsService {
21692
23598
  /**
21693
23599
  * Check whether the authenticated user has payment access to an item on a scoped platform.
@@ -23916,6 +25822,7 @@ class TransactionsService {
23916
25822
 
23917
25823
  exports.AccessCheckService = AccessCheckService;
23918
25824
  exports.AccountService = AccountService;
25825
+ exports.ActivitiesService = ActivitiesService;
23919
25826
  exports.AiAnalyticsService = AiAnalyticsService;
23920
25827
  exports.AnalyticsService = AnalyticsService;
23921
25828
  exports.ApiError = ApiError;
@@ -23931,13 +25838,16 @@ exports.CredentialsService = CredentialsService;
23931
25838
  exports.CreditsService = CreditsService;
23932
25839
  exports.CrmService = CrmService;
23933
25840
  exports.CustomDomainsService = CustomDomainsService;
25841
+ exports.DealsService = DealsService;
23934
25842
  exports.FeaturesService = FeaturesService;
23935
25843
  exports.ItemsService = ItemsService;
25844
+ exports.LeadSourcesService = LeadSourcesService;
23936
25845
  exports.MediaService = MediaService;
23937
25846
  exports.NotificationsService = NotificationsService;
23938
25847
  exports.OpenAPI = OpenAPI;
23939
25848
  exports.OrganizationsService = OrganizationsService;
23940
25849
  exports.PersonsService = PersonsService;
25850
+ exports.PipelinesService = PipelinesService;
23941
25851
  exports.PlatformsService = PlatformsService;
23942
25852
  exports.PricesService = PricesService;
23943
25853
  exports.RecommendationsService = RecommendationsService;