@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/sdk_schema.yml CHANGED
@@ -1,7 +1,7 @@
1
1
  openapi: 3.0.3
2
2
  info:
3
3
  title: ibl-data-manager
4
- version: 4.265.1-core
4
+ version: 4.265.2-core
5
5
  description: API for iblai
6
6
  paths:
7
7
  /access-check/{item_type}/{item_id}/:
@@ -137,6 +137,317 @@ paths:
137
137
  schema:
138
138
  $ref: '#/components/schemas/CreditAccountInfo'
139
139
  description: ''
140
+ /activities/:
141
+ get:
142
+ operationId: activities_list
143
+ description: |-
144
+ 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`.
145
+
146
+ **Required permission:** `Ibl.CRM/Activities/list`.
147
+ summary: List activities
148
+ parameters:
149
+ - in: query
150
+ name: deal
151
+ schema:
152
+ type: number
153
+ - in: query
154
+ name: is_done
155
+ schema:
156
+ type: boolean
157
+ - in: query
158
+ name: metadata__has_key
159
+ schema:
160
+ type: string
161
+ - in: query
162
+ name: owner
163
+ schema:
164
+ type: number
165
+ - name: page
166
+ required: false
167
+ in: query
168
+ description: A page number within the paginated result set.
169
+ schema:
170
+ type: integer
171
+ - name: page_size
172
+ required: false
173
+ in: query
174
+ description: Number of results to return per page.
175
+ schema:
176
+ type: integer
177
+ - in: query
178
+ name: person
179
+ schema:
180
+ type: string
181
+ format: uuid
182
+ - in: query
183
+ name: schedule_from__gte
184
+ schema:
185
+ type: string
186
+ format: date-time
187
+ - in: query
188
+ name: schedule_from__lte
189
+ schema:
190
+ type: string
191
+ format: date-time
192
+ - in: query
193
+ name: type
194
+ schema:
195
+ type: string
196
+ enum:
197
+ - call
198
+ - deadline
199
+ - email
200
+ - lunch
201
+ - meeting
202
+ - note
203
+ - task
204
+ description: |-
205
+ Interaction kind.
206
+
207
+ * `call` - Call
208
+ * `meeting` - Meeting
209
+ * `email` - Email
210
+ * `note` - Note
211
+ * `task` - Task
212
+ * `lunch` - Lunch
213
+ * `deadline` - Deadline
214
+ tags:
215
+ - activities
216
+ security:
217
+ - PlatformApiKeyAuthentication: []
218
+ responses:
219
+ '200':
220
+ content:
221
+ application/json:
222
+ schema:
223
+ $ref: '#/components/schemas/PaginatedActivityList'
224
+ description: ''
225
+ '401':
226
+ description: Authentication required.
227
+ '403':
228
+ description: Missing required permission `Ibl.CRM/Activities/list`.
229
+ post:
230
+ operationId: activities_create
231
+ description: |-
232
+ Creates an Activity. Either `deal` or `person` must be supplied; both must belong to your Platform.
233
+
234
+ **Required permission:** `Ibl.CRM/Activities/write`.
235
+ summary: Create an activity
236
+ tags:
237
+ - activities
238
+ requestBody:
239
+ content:
240
+ application/json:
241
+ schema:
242
+ $ref: '#/components/schemas/Activity'
243
+ application/scim+json:
244
+ schema:
245
+ $ref: '#/components/schemas/Activity'
246
+ application/x-www-form-urlencoded:
247
+ schema:
248
+ $ref: '#/components/schemas/Activity'
249
+ multipart/form-data:
250
+ schema:
251
+ $ref: '#/components/schemas/Activity'
252
+ '*/*':
253
+ schema:
254
+ $ref: '#/components/schemas/Activity'
255
+ required: true
256
+ security:
257
+ - PlatformApiKeyAuthentication: []
258
+ responses:
259
+ '201':
260
+ content:
261
+ application/json:
262
+ schema:
263
+ $ref: '#/components/schemas/Activity'
264
+ description: ''
265
+ '400':
266
+ description: Validation error.
267
+ '403':
268
+ description: Missing required permission `Ibl.CRM/Activities/write`.
269
+ /activities/{id}/:
270
+ get:
271
+ operationId: activities_retrieve
272
+ description: |-
273
+ Returns a single Activity by id.
274
+
275
+ **Required permission:** `Ibl.CRM/Activities/read`.
276
+ summary: Retrieve an activity
277
+ parameters:
278
+ - in: path
279
+ name: id
280
+ schema:
281
+ type: integer
282
+ description: A unique integer value identifying this activity.
283
+ required: true
284
+ tags:
285
+ - activities
286
+ security:
287
+ - PlatformApiKeyAuthentication: []
288
+ responses:
289
+ '200':
290
+ content:
291
+ application/json:
292
+ schema:
293
+ $ref: '#/components/schemas/Activity'
294
+ description: ''
295
+ '403':
296
+ description: Missing required permission `Ibl.CRM/Activities/read`.
297
+ '404':
298
+ description: Activity not found.
299
+ put:
300
+ operationId: activities_update
301
+ description: |-
302
+ Replaces all editable fields on the Activity.
303
+
304
+ **Required permission:** `Ibl.CRM/Activities/write`.
305
+ summary: Replace an activity
306
+ parameters:
307
+ - in: path
308
+ name: id
309
+ schema:
310
+ type: integer
311
+ description: A unique integer value identifying this activity.
312
+ required: true
313
+ tags:
314
+ - activities
315
+ requestBody:
316
+ content:
317
+ application/json:
318
+ schema:
319
+ $ref: '#/components/schemas/Activity'
320
+ application/scim+json:
321
+ schema:
322
+ $ref: '#/components/schemas/Activity'
323
+ application/x-www-form-urlencoded:
324
+ schema:
325
+ $ref: '#/components/schemas/Activity'
326
+ multipart/form-data:
327
+ schema:
328
+ $ref: '#/components/schemas/Activity'
329
+ '*/*':
330
+ schema:
331
+ $ref: '#/components/schemas/Activity'
332
+ required: true
333
+ security:
334
+ - PlatformApiKeyAuthentication: []
335
+ responses:
336
+ '200':
337
+ content:
338
+ application/json:
339
+ schema:
340
+ $ref: '#/components/schemas/Activity'
341
+ description: ''
342
+ '400':
343
+ description: Validation error.
344
+ '403':
345
+ description: Missing required permission `Ibl.CRM/Activities/write`.
346
+ '404':
347
+ description: Activity not found.
348
+ patch:
349
+ operationId: activities_partial_update
350
+ description: |-
351
+ Updates only the supplied fields on the Activity.
352
+
353
+ **Required permission:** `Ibl.CRM/Activities/write`.
354
+ summary: Update an activity
355
+ parameters:
356
+ - in: path
357
+ name: id
358
+ schema:
359
+ type: integer
360
+ description: A unique integer value identifying this activity.
361
+ required: true
362
+ tags:
363
+ - activities
364
+ requestBody:
365
+ content:
366
+ application/json:
367
+ schema:
368
+ $ref: '#/components/schemas/PatchedActivity'
369
+ application/scim+json:
370
+ schema:
371
+ $ref: '#/components/schemas/PatchedActivity'
372
+ application/x-www-form-urlencoded:
373
+ schema:
374
+ $ref: '#/components/schemas/PatchedActivity'
375
+ multipart/form-data:
376
+ schema:
377
+ $ref: '#/components/schemas/PatchedActivity'
378
+ '*/*':
379
+ schema:
380
+ $ref: '#/components/schemas/PatchedActivity'
381
+ security:
382
+ - PlatformApiKeyAuthentication: []
383
+ responses:
384
+ '200':
385
+ content:
386
+ application/json:
387
+ schema:
388
+ $ref: '#/components/schemas/Activity'
389
+ description: ''
390
+ '400':
391
+ description: Validation error.
392
+ '403':
393
+ description: Missing required permission `Ibl.CRM/Activities/write`.
394
+ '404':
395
+ description: Activity not found.
396
+ delete:
397
+ operationId: activities_destroy
398
+ description: |-
399
+ Deletes the Activity.
400
+
401
+ **Required permission:** `Ibl.CRM/Activities/delete`.
402
+ summary: Delete an activity
403
+ parameters:
404
+ - in: path
405
+ name: id
406
+ schema:
407
+ type: integer
408
+ description: A unique integer value identifying this activity.
409
+ required: true
410
+ tags:
411
+ - activities
412
+ security:
413
+ - PlatformApiKeyAuthentication: []
414
+ responses:
415
+ '204':
416
+ description: Deleted.
417
+ '403':
418
+ description: Missing required permission `Ibl.CRM/Activities/delete`.
419
+ '404':
420
+ description: Activity not found.
421
+ /activities/{id}/done/:
422
+ post:
423
+ operationId: activities_done_create
424
+ description: |-
425
+ 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`.
426
+
427
+ **Required permission:** `Ibl.CRM/Activities/write`.
428
+ summary: Mark an activity as done
429
+ parameters:
430
+ - in: path
431
+ name: id
432
+ schema:
433
+ type: integer
434
+ description: A unique integer value identifying this activity.
435
+ required: true
436
+ tags:
437
+ - activities
438
+ security:
439
+ - PlatformApiKeyAuthentication: []
440
+ responses:
441
+ '200':
442
+ content:
443
+ application/json:
444
+ schema:
445
+ $ref: '#/components/schemas/Activity'
446
+ description: ''
447
+ '403':
448
+ description: Missing required permission `Ibl.CRM/Activities/write`.
449
+ '404':
450
+ description: Activity not found.
140
451
  /api/analytics/content/:
141
452
  get:
142
453
  operationId: get_content_analytics
@@ -24886,17 +25197,25 @@ paths:
24886
25197
  schema:
24887
25198
  $ref: '#/components/schemas/Assertion'
24888
25199
  description: ''
24889
- /api/crm/organizations/:
25200
+ /api/crm/activities/:
24890
25201
  get:
24891
- operationId: crm_organizations_list
25202
+ operationId: crm_activities_list
24892
25203
  description: |-
24893
- Returns a paginated list of organizations in your Platform. Supports filtering by `owner` and by `name` (case-insensitive substring match).
25204
+ 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`.
24894
25205
 
24895
- **Required permission:** `Ibl.CRM/Organizations/list`.
24896
- summary: List organizations
25206
+ **Required permission:** `Ibl.CRM/Activities/list`.
25207
+ summary: List activities
24897
25208
  parameters:
24898
25209
  - in: query
24899
- name: name
25210
+ name: deal
25211
+ schema:
25212
+ type: number
25213
+ - in: query
25214
+ name: is_done
25215
+ schema:
25216
+ type: boolean
25217
+ - in: query
25218
+ name: metadata__has_key
24900
25219
  schema:
24901
25220
  type: string
24902
25221
  - in: query
@@ -24915,6 +25234,43 @@ paths:
24915
25234
  description: Number of results to return per page.
24916
25235
  schema:
24917
25236
  type: integer
25237
+ - in: query
25238
+ name: person
25239
+ schema:
25240
+ type: string
25241
+ format: uuid
25242
+ - in: query
25243
+ name: schedule_from__gte
25244
+ schema:
25245
+ type: string
25246
+ format: date-time
25247
+ - in: query
25248
+ name: schedule_from__lte
25249
+ schema:
25250
+ type: string
25251
+ format: date-time
25252
+ - in: query
25253
+ name: type
25254
+ schema:
25255
+ type: string
25256
+ enum:
25257
+ - call
25258
+ - deadline
25259
+ - email
25260
+ - lunch
25261
+ - meeting
25262
+ - note
25263
+ - task
25264
+ description: |-
25265
+ Interaction kind.
25266
+
25267
+ * `call` - Call
25268
+ * `meeting` - Meeting
25269
+ * `email` - Email
25270
+ * `note` - Note
25271
+ * `task` - Task
25272
+ * `lunch` - Lunch
25273
+ * `deadline` - Deadline
24918
25274
  tags:
24919
25275
  - crm
24920
25276
  security:
@@ -24924,38 +25280,38 @@ paths:
24924
25280
  content:
24925
25281
  application/json:
24926
25282
  schema:
24927
- $ref: '#/components/schemas/PaginatedOrganizationList'
25283
+ $ref: '#/components/schemas/PaginatedActivityList'
24928
25284
  description: ''
24929
25285
  '401':
24930
25286
  description: Authentication required.
24931
25287
  '403':
24932
- description: Missing required permission `Ibl.CRM/Organizations/list`.
25288
+ description: Missing required permission `Ibl.CRM/Activities/list`.
24933
25289
  post:
24934
- operationId: crm_organizations_create
25290
+ operationId: crm_activities_create
24935
25291
  description: |-
24936
- Creates a new organization in your Platform. The Platform is inferred from your credentials. `name` must be unique within your Platform.
25292
+ Creates an Activity. Either `deal` or `person` must be supplied; both must belong to your Platform.
24937
25293
 
24938
- **Required permission:** `Ibl.CRM/Organizations/write`.
24939
- summary: Create an organization
25294
+ **Required permission:** `Ibl.CRM/Activities/write`.
25295
+ summary: Create an activity
24940
25296
  tags:
24941
25297
  - crm
24942
25298
  requestBody:
24943
25299
  content:
24944
25300
  application/json:
24945
25301
  schema:
24946
- $ref: '#/components/schemas/Organization'
25302
+ $ref: '#/components/schemas/Activity'
24947
25303
  application/scim+json:
24948
25304
  schema:
24949
- $ref: '#/components/schemas/Organization'
25305
+ $ref: '#/components/schemas/Activity'
24950
25306
  application/x-www-form-urlencoded:
24951
25307
  schema:
24952
- $ref: '#/components/schemas/Organization'
25308
+ $ref: '#/components/schemas/Activity'
24953
25309
  multipart/form-data:
24954
25310
  schema:
24955
- $ref: '#/components/schemas/Organization'
25311
+ $ref: '#/components/schemas/Activity'
24956
25312
  '*/*':
24957
25313
  schema:
24958
- $ref: '#/components/schemas/Organization'
25314
+ $ref: '#/components/schemas/Activity'
24959
25315
  required: true
24960
25316
  security:
24961
25317
  - PlatformApiKeyAuthentication: []
@@ -24964,27 +25320,26 @@ paths:
24964
25320
  content:
24965
25321
  application/json:
24966
25322
  schema:
24967
- $ref: '#/components/schemas/Organization'
25323
+ $ref: '#/components/schemas/Activity'
24968
25324
  description: ''
24969
25325
  '400':
24970
- description: Validation error (for example, duplicate name).
25326
+ description: Validation error.
24971
25327
  '403':
24972
- description: Missing required permission `Ibl.CRM/Organizations/write`.
24973
- /api/crm/organizations/{id}/:
25328
+ description: Missing required permission `Ibl.CRM/Activities/write`.
25329
+ /api/crm/activities/{id}/:
24974
25330
  get:
24975
- operationId: crm_organizations_retrieve
25331
+ operationId: crm_activities_retrieve
24976
25332
  description: |-
24977
- Returns a single organization by id.
25333
+ Returns a single Activity by id.
24978
25334
 
24979
- **Required permission:** `Ibl.CRM/Organizations/read`.
24980
- summary: Retrieve an organization
25335
+ **Required permission:** `Ibl.CRM/Activities/read`.
25336
+ summary: Retrieve an activity
24981
25337
  parameters:
24982
25338
  - in: path
24983
25339
  name: id
24984
25340
  schema:
24985
- type: string
24986
- format: uuid
24987
- description: Opaque UUID — used in API URLs and external references.
25341
+ type: integer
25342
+ description: A unique integer value identifying this activity.
24988
25343
  required: true
24989
25344
  tags:
24990
25345
  - crm
@@ -24995,26 +25350,25 @@ paths:
24995
25350
  content:
24996
25351
  application/json:
24997
25352
  schema:
24998
- $ref: '#/components/schemas/Organization'
25353
+ $ref: '#/components/schemas/Activity'
24999
25354
  description: ''
25000
25355
  '403':
25001
- description: Missing required permission `Ibl.CRM/Organizations/read`.
25356
+ description: Missing required permission `Ibl.CRM/Activities/read`.
25002
25357
  '404':
25003
- description: Organization not found.
25358
+ description: Activity not found.
25004
25359
  put:
25005
- operationId: crm_organizations_update
25360
+ operationId: crm_activities_update
25006
25361
  description: |-
25007
- Replaces all editable fields on the organization.
25362
+ Replaces all editable fields on the Activity.
25008
25363
 
25009
- **Required permission:** `Ibl.CRM/Organizations/write`.
25010
- summary: Replace an organization
25364
+ **Required permission:** `Ibl.CRM/Activities/write`.
25365
+ summary: Replace an activity
25011
25366
  parameters:
25012
25367
  - in: path
25013
25368
  name: id
25014
25369
  schema:
25015
- type: string
25016
- format: uuid
25017
- description: Opaque UUID — used in API URLs and external references.
25370
+ type: integer
25371
+ description: A unique integer value identifying this activity.
25018
25372
  required: true
25019
25373
  tags:
25020
25374
  - crm
@@ -25022,19 +25376,19 @@ paths:
25022
25376
  content:
25023
25377
  application/json:
25024
25378
  schema:
25025
- $ref: '#/components/schemas/Organization'
25379
+ $ref: '#/components/schemas/Activity'
25026
25380
  application/scim+json:
25027
25381
  schema:
25028
- $ref: '#/components/schemas/Organization'
25382
+ $ref: '#/components/schemas/Activity'
25029
25383
  application/x-www-form-urlencoded:
25030
25384
  schema:
25031
- $ref: '#/components/schemas/Organization'
25385
+ $ref: '#/components/schemas/Activity'
25032
25386
  multipart/form-data:
25033
25387
  schema:
25034
- $ref: '#/components/schemas/Organization'
25388
+ $ref: '#/components/schemas/Activity'
25035
25389
  '*/*':
25036
25390
  schema:
25037
- $ref: '#/components/schemas/Organization'
25391
+ $ref: '#/components/schemas/Activity'
25038
25392
  required: true
25039
25393
  security:
25040
25394
  - PlatformApiKeyAuthentication: []
@@ -25043,28 +25397,27 @@ paths:
25043
25397
  content:
25044
25398
  application/json:
25045
25399
  schema:
25046
- $ref: '#/components/schemas/Organization'
25400
+ $ref: '#/components/schemas/Activity'
25047
25401
  description: ''
25048
25402
  '400':
25049
25403
  description: Validation error.
25050
25404
  '403':
25051
- description: Missing required permission `Ibl.CRM/Organizations/write`.
25405
+ description: Missing required permission `Ibl.CRM/Activities/write`.
25052
25406
  '404':
25053
- description: Organization not found.
25407
+ description: Activity not found.
25054
25408
  patch:
25055
- operationId: crm_organizations_partial_update
25409
+ operationId: crm_activities_partial_update
25056
25410
  description: |-
25057
- Updates only the supplied fields on the organization.
25411
+ Updates only the supplied fields on the Activity.
25058
25412
 
25059
- **Required permission:** `Ibl.CRM/Organizations/write`.
25060
- summary: Update an organization
25413
+ **Required permission:** `Ibl.CRM/Activities/write`.
25414
+ summary: Update an activity
25061
25415
  parameters:
25062
25416
  - in: path
25063
25417
  name: id
25064
25418
  schema:
25065
- type: string
25066
- format: uuid
25067
- description: Opaque UUID — used in API URLs and external references.
25419
+ type: integer
25420
+ description: A unique integer value identifying this activity.
25068
25421
  required: true
25069
25422
  tags:
25070
25423
  - crm
@@ -25072,19 +25425,19 @@ paths:
25072
25425
  content:
25073
25426
  application/json:
25074
25427
  schema:
25075
- $ref: '#/components/schemas/PatchedOrganization'
25428
+ $ref: '#/components/schemas/PatchedActivity'
25076
25429
  application/scim+json:
25077
25430
  schema:
25078
- $ref: '#/components/schemas/PatchedOrganization'
25431
+ $ref: '#/components/schemas/PatchedActivity'
25079
25432
  application/x-www-form-urlencoded:
25080
25433
  schema:
25081
- $ref: '#/components/schemas/PatchedOrganization'
25434
+ $ref: '#/components/schemas/PatchedActivity'
25082
25435
  multipart/form-data:
25083
25436
  schema:
25084
- $ref: '#/components/schemas/PatchedOrganization'
25437
+ $ref: '#/components/schemas/PatchedActivity'
25085
25438
  '*/*':
25086
25439
  schema:
25087
- $ref: '#/components/schemas/PatchedOrganization'
25440
+ $ref: '#/components/schemas/PatchedActivity'
25088
25441
  security:
25089
25442
  - PlatformApiKeyAuthentication: []
25090
25443
  responses:
@@ -25092,28 +25445,27 @@ paths:
25092
25445
  content:
25093
25446
  application/json:
25094
25447
  schema:
25095
- $ref: '#/components/schemas/Organization'
25448
+ $ref: '#/components/schemas/Activity'
25096
25449
  description: ''
25097
25450
  '400':
25098
25451
  description: Validation error.
25099
25452
  '403':
25100
- description: Missing required permission `Ibl.CRM/Organizations/write`.
25453
+ description: Missing required permission `Ibl.CRM/Activities/write`.
25101
25454
  '404':
25102
- description: Organization not found.
25455
+ description: Activity not found.
25103
25456
  delete:
25104
- operationId: crm_organizations_destroy
25457
+ operationId: crm_activities_destroy
25105
25458
  description: |-
25106
- Deletes the organization. Any persons linked to it are kept; their organization reference is cleared.
25459
+ Deletes the Activity.
25107
25460
 
25108
- **Required permission:** `Ibl.CRM/Organizations/delete`.
25109
- summary: Delete an organization
25461
+ **Required permission:** `Ibl.CRM/Activities/delete`.
25462
+ summary: Delete an activity
25110
25463
  parameters:
25111
25464
  - in: path
25112
25465
  name: id
25113
25466
  schema:
25114
- type: string
25115
- format: uuid
25116
- description: Opaque UUID — used in API URLs and external references.
25467
+ type: integer
25468
+ description: A unique integer value identifying this activity.
25117
25469
  required: true
25118
25470
  tags:
25119
25471
  - crm
@@ -25123,17 +25475,47 @@ paths:
25123
25475
  '204':
25124
25476
  description: Deleted.
25125
25477
  '403':
25126
- description: Missing required permission `Ibl.CRM/Organizations/delete`.
25478
+ description: Missing required permission `Ibl.CRM/Activities/delete`.
25127
25479
  '404':
25128
- description: Organization not found.
25129
- /api/crm/persons/:
25480
+ description: Activity not found.
25481
+ /api/crm/activities/{id}/done/:
25482
+ post:
25483
+ operationId: crm_activities_done_create
25484
+ description: |-
25485
+ 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`.
25486
+
25487
+ **Required permission:** `Ibl.CRM/Activities/write`.
25488
+ summary: Mark an activity as done
25489
+ parameters:
25490
+ - in: path
25491
+ name: id
25492
+ schema:
25493
+ type: integer
25494
+ description: A unique integer value identifying this activity.
25495
+ required: true
25496
+ tags:
25497
+ - crm
25498
+ security:
25499
+ - PlatformApiKeyAuthentication: []
25500
+ responses:
25501
+ '200':
25502
+ content:
25503
+ application/json:
25504
+ schema:
25505
+ $ref: '#/components/schemas/Activity'
25506
+ description: ''
25507
+ '403':
25508
+ description: Missing required permission `Ibl.CRM/Activities/write`.
25509
+ '404':
25510
+ description: Activity not found.
25511
+ /api/crm/deals/:
25130
25512
  get:
25131
- operationId: crm_persons_list
25513
+ operationId: crm_deals_list
25132
25514
  description: |-
25133
- 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`.
25515
+ 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`.
25134
25516
 
25135
- **Required permission:** `Ibl.CRM/Persons/list`.
25136
- summary: List persons
25517
+ **Required permission:** `Ibl.CRM/Deals/list`.
25518
+ summary: List deals
25137
25519
  parameters:
25138
25520
  - in: query
25139
25521
  name: created_at__gte
@@ -25146,23 +25528,941 @@ paths:
25146
25528
  type: string
25147
25529
  format: date-time
25148
25530
  - in: query
25149
- name: lifecycle_stage
25531
+ name: expected_close_date__gte
25150
25532
  schema:
25151
25533
  type: string
25152
- enum:
25153
- - churned
25154
- - customer
25155
- - lead
25156
- - opportunity
25157
- - qualified
25158
- description: |-
25159
- Funnel position. Free-form transitions in v0.
25160
-
25161
- * `lead` - Lead
25162
- * `qualified` - Qualified
25163
- * `opportunity` - Opportunity
25164
- * `customer` - Customer
25165
- * `churned` - Churned
25534
+ format: date-time
25535
+ - in: query
25536
+ name: expected_close_date__lte
25537
+ schema:
25538
+ type: string
25539
+ format: date-time
25540
+ - in: query
25541
+ name: metadata__has_key
25542
+ schema:
25543
+ type: string
25544
+ - in: query
25545
+ name: organization
25546
+ schema:
25547
+ type: string
25548
+ format: uuid
25549
+ - in: query
25550
+ name: owner
25551
+ schema:
25552
+ type: number
25553
+ - name: page
25554
+ required: false
25555
+ in: query
25556
+ description: A page number within the paginated result set.
25557
+ schema:
25558
+ type: integer
25559
+ - name: page_size
25560
+ required: false
25561
+ in: query
25562
+ description: Number of results to return per page.
25563
+ schema:
25564
+ type: integer
25565
+ - in: query
25566
+ name: person
25567
+ schema:
25568
+ type: string
25569
+ format: uuid
25570
+ - in: query
25571
+ name: pipeline
25572
+ schema:
25573
+ type: number
25574
+ - in: query
25575
+ name: source
25576
+ schema:
25577
+ type: number
25578
+ - in: query
25579
+ name: stage
25580
+ schema:
25581
+ type: number
25582
+ - in: query
25583
+ name: status
25584
+ schema:
25585
+ type: string
25586
+ enum:
25587
+ - lost
25588
+ - open
25589
+ - won
25590
+ description: |-
25591
+ Service-managed (read-only in serializer). Derived from the destination stage's is_won/is_lost.
25592
+
25593
+ * `open` - Open
25594
+ * `won` - Won
25595
+ * `lost` - Lost
25596
+ tags:
25597
+ - crm
25598
+ security:
25599
+ - PlatformApiKeyAuthentication: []
25600
+ responses:
25601
+ '200':
25602
+ content:
25603
+ application/json:
25604
+ schema:
25605
+ $ref: '#/components/schemas/PaginatedDealList'
25606
+ description: ''
25607
+ '401':
25608
+ description: Authentication required.
25609
+ '403':
25610
+ description: Missing required permission `Ibl.CRM/Deals/list`.
25611
+ post:
25612
+ operationId: crm_deals_create
25613
+ description: |-
25614
+ 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`.
25615
+
25616
+ **Required permission:** `Ibl.CRM/Deals/write`.
25617
+ summary: Create a deal
25618
+ tags:
25619
+ - crm
25620
+ requestBody:
25621
+ content:
25622
+ application/json:
25623
+ schema:
25624
+ $ref: '#/components/schemas/Deal'
25625
+ application/scim+json:
25626
+ schema:
25627
+ $ref: '#/components/schemas/Deal'
25628
+ application/x-www-form-urlencoded:
25629
+ schema:
25630
+ $ref: '#/components/schemas/Deal'
25631
+ multipart/form-data:
25632
+ schema:
25633
+ $ref: '#/components/schemas/Deal'
25634
+ '*/*':
25635
+ schema:
25636
+ $ref: '#/components/schemas/Deal'
25637
+ required: true
25638
+ security:
25639
+ - PlatformApiKeyAuthentication: []
25640
+ responses:
25641
+ '201':
25642
+ content:
25643
+ application/json:
25644
+ schema:
25645
+ $ref: '#/components/schemas/Deal'
25646
+ description: ''
25647
+ '400':
25648
+ description: Validation error.
25649
+ '403':
25650
+ description: Missing required permission `Ibl.CRM/Deals/write`.
25651
+ /api/crm/deals/{id}/:
25652
+ get:
25653
+ operationId: crm_deals_retrieve
25654
+ description: |-
25655
+ Returns a single Deal by id.
25656
+
25657
+ **Required permission:** `Ibl.CRM/Deals/read`.
25658
+ summary: Retrieve a deal
25659
+ parameters:
25660
+ - in: path
25661
+ name: id
25662
+ schema:
25663
+ type: integer
25664
+ description: A unique integer value identifying this deal.
25665
+ required: true
25666
+ tags:
25667
+ - crm
25668
+ security:
25669
+ - PlatformApiKeyAuthentication: []
25670
+ responses:
25671
+ '200':
25672
+ content:
25673
+ application/json:
25674
+ schema:
25675
+ $ref: '#/components/schemas/Deal'
25676
+ description: ''
25677
+ '403':
25678
+ description: Missing required permission `Ibl.CRM/Deals/read`.
25679
+ '404':
25680
+ description: Deal not found.
25681
+ put:
25682
+ operationId: crm_deals_update
25683
+ description: |-
25684
+ Replaces all editable fields on the Deal.
25685
+
25686
+ **Required permission:** `Ibl.CRM/Deals/write`.
25687
+ summary: Replace a deal
25688
+ parameters:
25689
+ - in: path
25690
+ name: id
25691
+ schema:
25692
+ type: integer
25693
+ description: A unique integer value identifying this deal.
25694
+ required: true
25695
+ tags:
25696
+ - crm
25697
+ requestBody:
25698
+ content:
25699
+ application/json:
25700
+ schema:
25701
+ $ref: '#/components/schemas/Deal'
25702
+ application/scim+json:
25703
+ schema:
25704
+ $ref: '#/components/schemas/Deal'
25705
+ application/x-www-form-urlencoded:
25706
+ schema:
25707
+ $ref: '#/components/schemas/Deal'
25708
+ multipart/form-data:
25709
+ schema:
25710
+ $ref: '#/components/schemas/Deal'
25711
+ '*/*':
25712
+ schema:
25713
+ $ref: '#/components/schemas/Deal'
25714
+ required: true
25715
+ security:
25716
+ - PlatformApiKeyAuthentication: []
25717
+ responses:
25718
+ '200':
25719
+ content:
25720
+ application/json:
25721
+ schema:
25722
+ $ref: '#/components/schemas/Deal'
25723
+ description: ''
25724
+ '400':
25725
+ description: Validation error.
25726
+ '403':
25727
+ description: Missing required permission `Ibl.CRM/Deals/write`.
25728
+ '404':
25729
+ description: Deal not found.
25730
+ patch:
25731
+ operationId: crm_deals_partial_update
25732
+ description: |-
25733
+ 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/`.
25734
+
25735
+ **Required permission:** `Ibl.CRM/Deals/write`.
25736
+ summary: Update a deal
25737
+ parameters:
25738
+ - in: path
25739
+ name: id
25740
+ schema:
25741
+ type: integer
25742
+ description: A unique integer value identifying this deal.
25743
+ required: true
25744
+ tags:
25745
+ - crm
25746
+ requestBody:
25747
+ content:
25748
+ application/json:
25749
+ schema:
25750
+ $ref: '#/components/schemas/PatchedDeal'
25751
+ application/scim+json:
25752
+ schema:
25753
+ $ref: '#/components/schemas/PatchedDeal'
25754
+ application/x-www-form-urlencoded:
25755
+ schema:
25756
+ $ref: '#/components/schemas/PatchedDeal'
25757
+ multipart/form-data:
25758
+ schema:
25759
+ $ref: '#/components/schemas/PatchedDeal'
25760
+ '*/*':
25761
+ schema:
25762
+ $ref: '#/components/schemas/PatchedDeal'
25763
+ security:
25764
+ - PlatformApiKeyAuthentication: []
25765
+ responses:
25766
+ '200':
25767
+ content:
25768
+ application/json:
25769
+ schema:
25770
+ $ref: '#/components/schemas/Deal'
25771
+ description: ''
25772
+ '400':
25773
+ description: Validation error.
25774
+ '403':
25775
+ description: Missing required permission `Ibl.CRM/Deals/write`.
25776
+ '404':
25777
+ description: Deal not found.
25778
+ delete:
25779
+ operationId: crm_deals_destroy
25780
+ description: |-
25781
+ Deletes the Deal.
25782
+
25783
+ **Required permission:** `Ibl.CRM/Deals/delete`.
25784
+ summary: Delete a deal
25785
+ parameters:
25786
+ - in: path
25787
+ name: id
25788
+ schema:
25789
+ type: integer
25790
+ description: A unique integer value identifying this deal.
25791
+ required: true
25792
+ tags:
25793
+ - crm
25794
+ security:
25795
+ - PlatformApiKeyAuthentication: []
25796
+ responses:
25797
+ '204':
25798
+ description: Deleted.
25799
+ '403':
25800
+ description: Missing required permission `Ibl.CRM/Deals/delete`.
25801
+ '404':
25802
+ description: Deal not found.
25803
+ /api/crm/deals/{id}/lost/:
25804
+ post:
25805
+ operationId: crm_deals_lost_create
25806
+ description: |-
25807
+ 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.
25808
+
25809
+ **Required permission:** `Ibl.CRM/Deals/write`.
25810
+ summary: Mark a deal as lost
25811
+ parameters:
25812
+ - in: path
25813
+ name: id
25814
+ schema:
25815
+ type: integer
25816
+ description: A unique integer value identifying this deal.
25817
+ required: true
25818
+ tags:
25819
+ - crm
25820
+ requestBody:
25821
+ content:
25822
+ application/json:
25823
+ schema:
25824
+ $ref: '#/components/schemas/DealLostRequest'
25825
+ application/scim+json:
25826
+ schema:
25827
+ $ref: '#/components/schemas/DealLostRequest'
25828
+ application/x-www-form-urlencoded:
25829
+ schema:
25830
+ $ref: '#/components/schemas/DealLostRequest'
25831
+ multipart/form-data:
25832
+ schema:
25833
+ $ref: '#/components/schemas/DealLostRequest'
25834
+ '*/*':
25835
+ schema:
25836
+ $ref: '#/components/schemas/DealLostRequest'
25837
+ required: true
25838
+ security:
25839
+ - PlatformApiKeyAuthentication: []
25840
+ responses:
25841
+ '200':
25842
+ content:
25843
+ application/json:
25844
+ schema:
25845
+ $ref: '#/components/schemas/Deal'
25846
+ description: ''
25847
+ '400':
25848
+ description: Missing `lost_reason`, no `is_lost` stage configured, or the
25849
+ supplied stage_code is not flagged is_lost=True.
25850
+ '403':
25851
+ description: Missing required permission `Ibl.CRM/Deals/write`.
25852
+ '404':
25853
+ description: Deal not found.
25854
+ /api/crm/deals/{id}/move-stage/:
25855
+ post:
25856
+ operationId: crm_deals_move_stage_create
25857
+ description: |-
25858
+ 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.
25859
+
25860
+ **Required permission:** `Ibl.CRM/Deals/write`.
25861
+ summary: Move a deal to a different stage
25862
+ parameters:
25863
+ - in: path
25864
+ name: id
25865
+ schema:
25866
+ type: integer
25867
+ description: A unique integer value identifying this deal.
25868
+ required: true
25869
+ tags:
25870
+ - crm
25871
+ requestBody:
25872
+ content:
25873
+ application/json:
25874
+ schema:
25875
+ $ref: '#/components/schemas/DealMoveStageRequest'
25876
+ application/scim+json:
25877
+ schema:
25878
+ $ref: '#/components/schemas/DealMoveStageRequest'
25879
+ application/x-www-form-urlencoded:
25880
+ schema:
25881
+ $ref: '#/components/schemas/DealMoveStageRequest'
25882
+ multipart/form-data:
25883
+ schema:
25884
+ $ref: '#/components/schemas/DealMoveStageRequest'
25885
+ '*/*':
25886
+ schema:
25887
+ $ref: '#/components/schemas/DealMoveStageRequest'
25888
+ security:
25889
+ - PlatformApiKeyAuthentication: []
25890
+ responses:
25891
+ '200':
25892
+ content:
25893
+ application/json:
25894
+ schema:
25895
+ $ref: '#/components/schemas/Deal'
25896
+ description: ''
25897
+ '400':
25898
+ description: Validation error (e.g. stage not in pipeline).
25899
+ '403':
25900
+ description: Missing required permission `Ibl.CRM/Deals/write`.
25901
+ '404':
25902
+ description: Deal or stage not found.
25903
+ /api/crm/deals/{id}/won/:
25904
+ post:
25905
+ operationId: crm_deals_won_create
25906
+ description: |-
25907
+ 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.
25908
+
25909
+ **Required permission:** `Ibl.CRM/Deals/write`.
25910
+ summary: Mark a deal as won
25911
+ parameters:
25912
+ - in: path
25913
+ name: id
25914
+ schema:
25915
+ type: integer
25916
+ description: A unique integer value identifying this deal.
25917
+ required: true
25918
+ tags:
25919
+ - crm
25920
+ requestBody:
25921
+ content:
25922
+ application/json:
25923
+ schema:
25924
+ $ref: '#/components/schemas/DealWonRequest'
25925
+ application/scim+json:
25926
+ schema:
25927
+ $ref: '#/components/schemas/DealWonRequest'
25928
+ application/x-www-form-urlencoded:
25929
+ schema:
25930
+ $ref: '#/components/schemas/DealWonRequest'
25931
+ multipart/form-data:
25932
+ schema:
25933
+ $ref: '#/components/schemas/DealWonRequest'
25934
+ '*/*':
25935
+ schema:
25936
+ $ref: '#/components/schemas/DealWonRequest'
25937
+ security:
25938
+ - PlatformApiKeyAuthentication: []
25939
+ responses:
25940
+ '200':
25941
+ content:
25942
+ application/json:
25943
+ schema:
25944
+ $ref: '#/components/schemas/Deal'
25945
+ description: ''
25946
+ '400':
25947
+ description: No `is_won` stage configured, or the supplied stage_code is
25948
+ not flagged is_won=True.
25949
+ '403':
25950
+ description: Missing required permission `Ibl.CRM/Deals/write`.
25951
+ '404':
25952
+ description: Deal not found.
25953
+ /api/crm/lead-sources/:
25954
+ get:
25955
+ operationId: crm_lead_sources_list
25956
+ description: |-
25957
+ Returns a paginated list of LeadSources in your Platform.
25958
+
25959
+ **Required permission:** `Ibl.CRM/Pipelines/list`.
25960
+ summary: List lead sources
25961
+ parameters:
25962
+ - in: query
25963
+ name: code
25964
+ schema:
25965
+ type: string
25966
+ - in: query
25967
+ name: name
25968
+ schema:
25969
+ type: string
25970
+ - name: page
25971
+ required: false
25972
+ in: query
25973
+ description: A page number within the paginated result set.
25974
+ schema:
25975
+ type: integer
25976
+ - name: page_size
25977
+ required: false
25978
+ in: query
25979
+ description: Number of results to return per page.
25980
+ schema:
25981
+ type: integer
25982
+ tags:
25983
+ - crm
25984
+ security:
25985
+ - PlatformApiKeyAuthentication: []
25986
+ responses:
25987
+ '200':
25988
+ content:
25989
+ application/json:
25990
+ schema:
25991
+ $ref: '#/components/schemas/PaginatedLeadSourceList'
25992
+ description: ''
25993
+ '401':
25994
+ description: Authentication required.
25995
+ '403':
25996
+ description: Missing required permission `Ibl.CRM/Pipelines/list`.
25997
+ post:
25998
+ operationId: crm_lead_sources_create
25999
+ description: |-
26000
+ Creates a new LeadSource in your Platform. `code` must be unique.
26001
+
26002
+ **Required permission:** `Ibl.CRM/Pipelines/write`.
26003
+ summary: Create a lead source
26004
+ tags:
26005
+ - crm
26006
+ requestBody:
26007
+ content:
26008
+ application/json:
26009
+ schema:
26010
+ $ref: '#/components/schemas/LeadSource'
26011
+ application/scim+json:
26012
+ schema:
26013
+ $ref: '#/components/schemas/LeadSource'
26014
+ application/x-www-form-urlencoded:
26015
+ schema:
26016
+ $ref: '#/components/schemas/LeadSource'
26017
+ multipart/form-data:
26018
+ schema:
26019
+ $ref: '#/components/schemas/LeadSource'
26020
+ '*/*':
26021
+ schema:
26022
+ $ref: '#/components/schemas/LeadSource'
26023
+ required: true
26024
+ security:
26025
+ - PlatformApiKeyAuthentication: []
26026
+ responses:
26027
+ '201':
26028
+ content:
26029
+ application/json:
26030
+ schema:
26031
+ $ref: '#/components/schemas/LeadSource'
26032
+ description: ''
26033
+ '400':
26034
+ description: Validation error.
26035
+ '403':
26036
+ description: Missing required permission `Ibl.CRM/Pipelines/write`.
26037
+ /api/crm/lead-sources/{id}/:
26038
+ get:
26039
+ operationId: crm_lead_sources_retrieve
26040
+ description: |-
26041
+ Returns a single LeadSource by id.
26042
+
26043
+ **Required permission:** `Ibl.CRM/Pipelines/read`.
26044
+ summary: Retrieve a lead source
26045
+ parameters:
26046
+ - in: path
26047
+ name: id
26048
+ schema:
26049
+ type: integer
26050
+ description: A unique integer value identifying this lead source.
26051
+ required: true
26052
+ tags:
26053
+ - crm
26054
+ security:
26055
+ - PlatformApiKeyAuthentication: []
26056
+ responses:
26057
+ '200':
26058
+ content:
26059
+ application/json:
26060
+ schema:
26061
+ $ref: '#/components/schemas/LeadSource'
26062
+ description: ''
26063
+ '403':
26064
+ description: Missing required permission `Ibl.CRM/Pipelines/read`.
26065
+ '404':
26066
+ description: LeadSource not found.
26067
+ put:
26068
+ operationId: crm_lead_sources_update
26069
+ description: |-
26070
+ Replaces all editable fields on the LeadSource.
26071
+
26072
+ **Required permission:** `Ibl.CRM/Pipelines/write`.
26073
+ summary: Replace a lead source
26074
+ parameters:
26075
+ - in: path
26076
+ name: id
26077
+ schema:
26078
+ type: integer
26079
+ description: A unique integer value identifying this lead source.
26080
+ required: true
26081
+ tags:
26082
+ - crm
26083
+ requestBody:
26084
+ content:
26085
+ application/json:
26086
+ schema:
26087
+ $ref: '#/components/schemas/LeadSource'
26088
+ application/scim+json:
26089
+ schema:
26090
+ $ref: '#/components/schemas/LeadSource'
26091
+ application/x-www-form-urlencoded:
26092
+ schema:
26093
+ $ref: '#/components/schemas/LeadSource'
26094
+ multipart/form-data:
26095
+ schema:
26096
+ $ref: '#/components/schemas/LeadSource'
26097
+ '*/*':
26098
+ schema:
26099
+ $ref: '#/components/schemas/LeadSource'
26100
+ required: true
26101
+ security:
26102
+ - PlatformApiKeyAuthentication: []
26103
+ responses:
26104
+ '200':
26105
+ content:
26106
+ application/json:
26107
+ schema:
26108
+ $ref: '#/components/schemas/LeadSource'
26109
+ description: ''
26110
+ '400':
26111
+ description: Validation error.
26112
+ '403':
26113
+ description: Missing required permission `Ibl.CRM/Pipelines/write`.
26114
+ '404':
26115
+ description: LeadSource not found.
26116
+ patch:
26117
+ operationId: crm_lead_sources_partial_update
26118
+ description: |-
26119
+ Updates only the supplied fields on the LeadSource.
26120
+
26121
+ **Required permission:** `Ibl.CRM/Pipelines/write`.
26122
+ summary: Update a lead source
26123
+ parameters:
26124
+ - in: path
26125
+ name: id
26126
+ schema:
26127
+ type: integer
26128
+ description: A unique integer value identifying this lead source.
26129
+ required: true
26130
+ tags:
26131
+ - crm
26132
+ requestBody:
26133
+ content:
26134
+ application/json:
26135
+ schema:
26136
+ $ref: '#/components/schemas/PatchedLeadSource'
26137
+ application/scim+json:
26138
+ schema:
26139
+ $ref: '#/components/schemas/PatchedLeadSource'
26140
+ application/x-www-form-urlencoded:
26141
+ schema:
26142
+ $ref: '#/components/schemas/PatchedLeadSource'
26143
+ multipart/form-data:
26144
+ schema:
26145
+ $ref: '#/components/schemas/PatchedLeadSource'
26146
+ '*/*':
26147
+ schema:
26148
+ $ref: '#/components/schemas/PatchedLeadSource'
26149
+ security:
26150
+ - PlatformApiKeyAuthentication: []
26151
+ responses:
26152
+ '200':
26153
+ content:
26154
+ application/json:
26155
+ schema:
26156
+ $ref: '#/components/schemas/LeadSource'
26157
+ description: ''
26158
+ '400':
26159
+ description: Validation error.
26160
+ '403':
26161
+ description: Missing required permission `Ibl.CRM/Pipelines/write`.
26162
+ '404':
26163
+ description: LeadSource not found.
26164
+ delete:
26165
+ operationId: crm_lead_sources_destroy
26166
+ description: |-
26167
+ Deletes the LeadSource. Any Deals referencing it have their `source` cleared.
26168
+
26169
+ **Required permission:** `Ibl.CRM/Pipelines/delete`.
26170
+ summary: Delete a lead source
26171
+ parameters:
26172
+ - in: path
26173
+ name: id
26174
+ schema:
26175
+ type: integer
26176
+ description: A unique integer value identifying this lead source.
26177
+ required: true
26178
+ tags:
26179
+ - crm
26180
+ security:
26181
+ - PlatformApiKeyAuthentication: []
26182
+ responses:
26183
+ '204':
26184
+ description: Deleted.
26185
+ '403':
26186
+ description: Missing required permission `Ibl.CRM/Pipelines/delete`.
26187
+ '404':
26188
+ description: LeadSource not found.
26189
+ /api/crm/organizations/:
26190
+ get:
26191
+ operationId: crm_organizations_list
26192
+ description: |-
26193
+ Returns a paginated list of organizations in your Platform. Supports filtering by `owner` and by `name` (case-insensitive substring match).
26194
+
26195
+ **Required permission:** `Ibl.CRM/Organizations/list`.
26196
+ summary: List organizations
26197
+ parameters:
26198
+ - in: query
26199
+ name: name
26200
+ schema:
26201
+ type: string
26202
+ - in: query
26203
+ name: owner
26204
+ schema:
26205
+ type: number
26206
+ - name: page
26207
+ required: false
26208
+ in: query
26209
+ description: A page number within the paginated result set.
26210
+ schema:
26211
+ type: integer
26212
+ - name: page_size
26213
+ required: false
26214
+ in: query
26215
+ description: Number of results to return per page.
26216
+ schema:
26217
+ type: integer
26218
+ tags:
26219
+ - crm
26220
+ security:
26221
+ - PlatformApiKeyAuthentication: []
26222
+ responses:
26223
+ '200':
26224
+ content:
26225
+ application/json:
26226
+ schema:
26227
+ $ref: '#/components/schemas/PaginatedOrganizationList'
26228
+ description: ''
26229
+ '401':
26230
+ description: Authentication required.
26231
+ '403':
26232
+ description: Missing required permission `Ibl.CRM/Organizations/list`.
26233
+ post:
26234
+ operationId: crm_organizations_create
26235
+ description: |-
26236
+ Creates a new organization in your Platform. The Platform is inferred from your credentials. `name` must be unique within your Platform.
26237
+
26238
+ **Required permission:** `Ibl.CRM/Organizations/write`.
26239
+ summary: Create an organization
26240
+ tags:
26241
+ - crm
26242
+ requestBody:
26243
+ content:
26244
+ application/json:
26245
+ schema:
26246
+ $ref: '#/components/schemas/Organization'
26247
+ application/scim+json:
26248
+ schema:
26249
+ $ref: '#/components/schemas/Organization'
26250
+ application/x-www-form-urlencoded:
26251
+ schema:
26252
+ $ref: '#/components/schemas/Organization'
26253
+ multipart/form-data:
26254
+ schema:
26255
+ $ref: '#/components/schemas/Organization'
26256
+ '*/*':
26257
+ schema:
26258
+ $ref: '#/components/schemas/Organization'
26259
+ required: true
26260
+ security:
26261
+ - PlatformApiKeyAuthentication: []
26262
+ responses:
26263
+ '201':
26264
+ content:
26265
+ application/json:
26266
+ schema:
26267
+ $ref: '#/components/schemas/Organization'
26268
+ description: ''
26269
+ '400':
26270
+ description: Validation error (for example, duplicate name).
26271
+ '403':
26272
+ description: Missing required permission `Ibl.CRM/Organizations/write`.
26273
+ /api/crm/organizations/{id}/:
26274
+ get:
26275
+ operationId: crm_organizations_retrieve
26276
+ description: |-
26277
+ Returns a single organization by id.
26278
+
26279
+ **Required permission:** `Ibl.CRM/Organizations/read`.
26280
+ summary: Retrieve an organization
26281
+ parameters:
26282
+ - in: path
26283
+ name: id
26284
+ schema:
26285
+ type: string
26286
+ format: uuid
26287
+ description: Opaque UUID — used in API URLs and external references.
26288
+ required: true
26289
+ tags:
26290
+ - crm
26291
+ security:
26292
+ - PlatformApiKeyAuthentication: []
26293
+ responses:
26294
+ '200':
26295
+ content:
26296
+ application/json:
26297
+ schema:
26298
+ $ref: '#/components/schemas/Organization'
26299
+ description: ''
26300
+ '403':
26301
+ description: Missing required permission `Ibl.CRM/Organizations/read`.
26302
+ '404':
26303
+ description: Organization not found.
26304
+ put:
26305
+ operationId: crm_organizations_update
26306
+ description: |-
26307
+ Replaces all editable fields on the organization.
26308
+
26309
+ **Required permission:** `Ibl.CRM/Organizations/write`.
26310
+ summary: Replace an organization
26311
+ parameters:
26312
+ - in: path
26313
+ name: id
26314
+ schema:
26315
+ type: string
26316
+ format: uuid
26317
+ description: Opaque UUID — used in API URLs and external references.
26318
+ required: true
26319
+ tags:
26320
+ - crm
26321
+ requestBody:
26322
+ content:
26323
+ application/json:
26324
+ schema:
26325
+ $ref: '#/components/schemas/Organization'
26326
+ application/scim+json:
26327
+ schema:
26328
+ $ref: '#/components/schemas/Organization'
26329
+ application/x-www-form-urlencoded:
26330
+ schema:
26331
+ $ref: '#/components/schemas/Organization'
26332
+ multipart/form-data:
26333
+ schema:
26334
+ $ref: '#/components/schemas/Organization'
26335
+ '*/*':
26336
+ schema:
26337
+ $ref: '#/components/schemas/Organization'
26338
+ required: true
26339
+ security:
26340
+ - PlatformApiKeyAuthentication: []
26341
+ responses:
26342
+ '200':
26343
+ content:
26344
+ application/json:
26345
+ schema:
26346
+ $ref: '#/components/schemas/Organization'
26347
+ description: ''
26348
+ '400':
26349
+ description: Validation error.
26350
+ '403':
26351
+ description: Missing required permission `Ibl.CRM/Organizations/write`.
26352
+ '404':
26353
+ description: Organization not found.
26354
+ patch:
26355
+ operationId: crm_organizations_partial_update
26356
+ description: |-
26357
+ Updates only the supplied fields on the organization.
26358
+
26359
+ **Required permission:** `Ibl.CRM/Organizations/write`.
26360
+ summary: Update an organization
26361
+ parameters:
26362
+ - in: path
26363
+ name: id
26364
+ schema:
26365
+ type: string
26366
+ format: uuid
26367
+ description: Opaque UUID — used in API URLs and external references.
26368
+ required: true
26369
+ tags:
26370
+ - crm
26371
+ requestBody:
26372
+ content:
26373
+ application/json:
26374
+ schema:
26375
+ $ref: '#/components/schemas/PatchedOrganization'
26376
+ application/scim+json:
26377
+ schema:
26378
+ $ref: '#/components/schemas/PatchedOrganization'
26379
+ application/x-www-form-urlencoded:
26380
+ schema:
26381
+ $ref: '#/components/schemas/PatchedOrganization'
26382
+ multipart/form-data:
26383
+ schema:
26384
+ $ref: '#/components/schemas/PatchedOrganization'
26385
+ '*/*':
26386
+ schema:
26387
+ $ref: '#/components/schemas/PatchedOrganization'
26388
+ security:
26389
+ - PlatformApiKeyAuthentication: []
26390
+ responses:
26391
+ '200':
26392
+ content:
26393
+ application/json:
26394
+ schema:
26395
+ $ref: '#/components/schemas/Organization'
26396
+ description: ''
26397
+ '400':
26398
+ description: Validation error.
26399
+ '403':
26400
+ description: Missing required permission `Ibl.CRM/Organizations/write`.
26401
+ '404':
26402
+ description: Organization not found.
26403
+ delete:
26404
+ operationId: crm_organizations_destroy
26405
+ description: |-
26406
+ Deletes the organization. Any persons linked to it are kept; their organization reference is cleared.
26407
+
26408
+ **Required permission:** `Ibl.CRM/Organizations/delete`.
26409
+ summary: Delete an organization
26410
+ parameters:
26411
+ - in: path
26412
+ name: id
26413
+ schema:
26414
+ type: string
26415
+ format: uuid
26416
+ description: Opaque UUID — used in API URLs and external references.
26417
+ required: true
26418
+ tags:
26419
+ - crm
26420
+ security:
26421
+ - PlatformApiKeyAuthentication: []
26422
+ responses:
26423
+ '204':
26424
+ description: Deleted.
26425
+ '403':
26426
+ description: Missing required permission `Ibl.CRM/Organizations/delete`.
26427
+ '404':
26428
+ description: Organization not found.
26429
+ /api/crm/persons/:
26430
+ get:
26431
+ operationId: crm_persons_list
26432
+ description: |-
26433
+ 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`.
26434
+
26435
+ **Required permission:** `Ibl.CRM/Persons/list`.
26436
+ summary: List persons
26437
+ parameters:
26438
+ - in: query
26439
+ name: created_at__gte
26440
+ schema:
26441
+ type: string
26442
+ format: date-time
26443
+ - in: query
26444
+ name: created_at__lte
26445
+ schema:
26446
+ type: string
26447
+ format: date-time
26448
+ - in: query
26449
+ name: lifecycle_stage
26450
+ schema:
26451
+ type: string
26452
+ enum:
26453
+ - churned
26454
+ - customer
26455
+ - lead
26456
+ - opportunity
26457
+ - qualified
26458
+ description: |-
26459
+ Funnel position. Transitions are unrestricted — any stage may move to any other.
26460
+
26461
+ * `lead` - Lead
26462
+ * `qualified` - Qualified
26463
+ * `opportunity` - Opportunity
26464
+ * `customer` - Customer
26465
+ * `churned` - Churned
25166
26466
  - in: query
25167
26467
  name: metadata__has_key
25168
26468
  schema:
@@ -25559,6 +26859,519 @@ paths:
25559
26859
  description: Missing required permission `Ibl.CRM/Persons/write`.
25560
26860
  '404':
25561
26861
  description: Primary person not found.
26862
+ /api/crm/pipelines/:
26863
+ get:
26864
+ operationId: crm_pipelines_list
26865
+ description: |-
26866
+ Returns a paginated list of Pipelines in your Platform. Each Pipeline includes its ordered `stages` inline.
26867
+
26868
+ **Required permission:** `Ibl.CRM/Pipelines/list`.
26869
+ summary: List pipelines
26870
+ parameters:
26871
+ - in: query
26872
+ name: code
26873
+ schema:
26874
+ type: string
26875
+ - in: query
26876
+ name: is_default
26877
+ schema:
26878
+ type: boolean
26879
+ - in: query
26880
+ name: name
26881
+ schema:
26882
+ type: string
26883
+ - name: page
26884
+ required: false
26885
+ in: query
26886
+ description: A page number within the paginated result set.
26887
+ schema:
26888
+ type: integer
26889
+ - name: page_size
26890
+ required: false
26891
+ in: query
26892
+ description: Number of results to return per page.
26893
+ schema:
26894
+ type: integer
26895
+ tags:
26896
+ - crm
26897
+ security:
26898
+ - PlatformApiKeyAuthentication: []
26899
+ responses:
26900
+ '200':
26901
+ content:
26902
+ application/json:
26903
+ schema:
26904
+ $ref: '#/components/schemas/PaginatedPipelineList'
26905
+ description: ''
26906
+ '401':
26907
+ description: Authentication required.
26908
+ '403':
26909
+ description: Missing required permission `Ibl.CRM/Pipelines/list`.
26910
+ post:
26911
+ operationId: crm_pipelines_create
26912
+ description: |-
26913
+ 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.
26914
+
26915
+ **Required permission:** `Ibl.CRM/Pipelines/write`.
26916
+ summary: Create a pipeline
26917
+ tags:
26918
+ - crm
26919
+ requestBody:
26920
+ content:
26921
+ application/json:
26922
+ schema:
26923
+ $ref: '#/components/schemas/Pipeline'
26924
+ application/scim+json:
26925
+ schema:
26926
+ $ref: '#/components/schemas/Pipeline'
26927
+ application/x-www-form-urlencoded:
26928
+ schema:
26929
+ $ref: '#/components/schemas/Pipeline'
26930
+ multipart/form-data:
26931
+ schema:
26932
+ $ref: '#/components/schemas/Pipeline'
26933
+ '*/*':
26934
+ schema:
26935
+ $ref: '#/components/schemas/Pipeline'
26936
+ required: true
26937
+ security:
26938
+ - PlatformApiKeyAuthentication: []
26939
+ responses:
26940
+ '201':
26941
+ content:
26942
+ application/json:
26943
+ schema:
26944
+ $ref: '#/components/schemas/Pipeline'
26945
+ description: ''
26946
+ '400':
26947
+ description: Validation error.
26948
+ '403':
26949
+ description: Missing required permission `Ibl.CRM/Pipelines/write`.
26950
+ /api/crm/pipelines/{pipeline_pk}/stages/:
26951
+ get:
26952
+ operationId: crm_pipelines_stages_list
26953
+ description: |-
26954
+ Returns the ordered list of PipelineStages for the given Pipeline.
26955
+
26956
+ **Required permission:** `Ibl.CRM/Pipelines/list`.
26957
+ summary: List stages for a pipeline
26958
+ parameters:
26959
+ - in: query
26960
+ name: code
26961
+ schema:
26962
+ type: string
26963
+ - in: query
26964
+ name: is_lost
26965
+ schema:
26966
+ type: boolean
26967
+ - in: query
26968
+ name: is_won
26969
+ schema:
26970
+ type: boolean
26971
+ - name: page
26972
+ required: false
26973
+ in: query
26974
+ description: A page number within the paginated result set.
26975
+ schema:
26976
+ type: integer
26977
+ - name: page_size
26978
+ required: false
26979
+ in: query
26980
+ description: Number of results to return per page.
26981
+ schema:
26982
+ type: integer
26983
+ - in: path
26984
+ name: pipeline_pk
26985
+ schema:
26986
+ type: integer
26987
+ required: true
26988
+ tags:
26989
+ - crm
26990
+ security:
26991
+ - PlatformApiKeyAuthentication: []
26992
+ responses:
26993
+ '200':
26994
+ content:
26995
+ application/json:
26996
+ schema:
26997
+ $ref: '#/components/schemas/PaginatedPipelineStageList'
26998
+ description: ''
26999
+ '403':
27000
+ description: Missing required permission `Ibl.CRM/Pipelines/list`.
27001
+ '404':
27002
+ description: Pipeline not found.
27003
+ post:
27004
+ operationId: crm_pipelines_stages_create
27005
+ description: |-
27006
+ 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.
27007
+
27008
+ **Required permission:** `Ibl.CRM/Pipelines/write`.
27009
+ summary: Create a stage
27010
+ parameters:
27011
+ - in: path
27012
+ name: pipeline_pk
27013
+ schema:
27014
+ type: integer
27015
+ required: true
27016
+ tags:
27017
+ - crm
27018
+ requestBody:
27019
+ content:
27020
+ application/json:
27021
+ schema:
27022
+ $ref: '#/components/schemas/PipelineStage'
27023
+ application/scim+json:
27024
+ schema:
27025
+ $ref: '#/components/schemas/PipelineStage'
27026
+ application/x-www-form-urlencoded:
27027
+ schema:
27028
+ $ref: '#/components/schemas/PipelineStage'
27029
+ multipart/form-data:
27030
+ schema:
27031
+ $ref: '#/components/schemas/PipelineStage'
27032
+ '*/*':
27033
+ schema:
27034
+ $ref: '#/components/schemas/PipelineStage'
27035
+ required: true
27036
+ security:
27037
+ - PlatformApiKeyAuthentication: []
27038
+ responses:
27039
+ '201':
27040
+ content:
27041
+ application/json:
27042
+ schema:
27043
+ $ref: '#/components/schemas/PipelineStage'
27044
+ description: ''
27045
+ '400':
27046
+ description: Validation error.
27047
+ '403':
27048
+ description: Missing required permission `Ibl.CRM/Pipelines/write`.
27049
+ '404':
27050
+ description: Pipeline not found.
27051
+ /api/crm/pipelines/{pipeline_pk}/stages/{id}/:
27052
+ get:
27053
+ operationId: crm_pipelines_stages_retrieve
27054
+ description: |-
27055
+ Returns a single PipelineStage by id (must belong to the URL Pipeline).
27056
+
27057
+ **Required permission:** `Ibl.CRM/Pipelines/read`.
27058
+ summary: Retrieve a stage
27059
+ parameters:
27060
+ - in: path
27061
+ name: id
27062
+ schema:
27063
+ type: integer
27064
+ required: true
27065
+ - in: path
27066
+ name: pipeline_pk
27067
+ schema:
27068
+ type: integer
27069
+ required: true
27070
+ tags:
27071
+ - crm
27072
+ security:
27073
+ - PlatformApiKeyAuthentication: []
27074
+ responses:
27075
+ '200':
27076
+ content:
27077
+ application/json:
27078
+ schema:
27079
+ $ref: '#/components/schemas/PipelineStage'
27080
+ description: ''
27081
+ '403':
27082
+ description: Missing required permission `Ibl.CRM/Pipelines/read`.
27083
+ '404':
27084
+ description: Stage not found in this Pipeline.
27085
+ put:
27086
+ operationId: crm_pipelines_stages_update
27087
+ description: |-
27088
+ Replaces all editable fields on the PipelineStage.
27089
+
27090
+ **Required permission:** `Ibl.CRM/Pipelines/write`.
27091
+ summary: Replace a stage
27092
+ parameters:
27093
+ - in: path
27094
+ name: id
27095
+ schema:
27096
+ type: integer
27097
+ required: true
27098
+ - in: path
27099
+ name: pipeline_pk
27100
+ schema:
27101
+ type: integer
27102
+ required: true
27103
+ tags:
27104
+ - crm
27105
+ requestBody:
27106
+ content:
27107
+ application/json:
27108
+ schema:
27109
+ $ref: '#/components/schemas/PipelineStage'
27110
+ application/scim+json:
27111
+ schema:
27112
+ $ref: '#/components/schemas/PipelineStage'
27113
+ application/x-www-form-urlencoded:
27114
+ schema:
27115
+ $ref: '#/components/schemas/PipelineStage'
27116
+ multipart/form-data:
27117
+ schema:
27118
+ $ref: '#/components/schemas/PipelineStage'
27119
+ '*/*':
27120
+ schema:
27121
+ $ref: '#/components/schemas/PipelineStage'
27122
+ required: true
27123
+ security:
27124
+ - PlatformApiKeyAuthentication: []
27125
+ responses:
27126
+ '200':
27127
+ content:
27128
+ application/json:
27129
+ schema:
27130
+ $ref: '#/components/schemas/PipelineStage'
27131
+ description: ''
27132
+ '400':
27133
+ description: Validation error.
27134
+ '403':
27135
+ description: Missing required permission `Ibl.CRM/Pipelines/write`.
27136
+ '404':
27137
+ description: Stage not found in this Pipeline.
27138
+ patch:
27139
+ operationId: crm_pipelines_stages_partial_update
27140
+ description: |-
27141
+ Updates only the supplied fields on the PipelineStage.
27142
+
27143
+ **Required permission:** `Ibl.CRM/Pipelines/write`.
27144
+ summary: Update a stage
27145
+ parameters:
27146
+ - in: path
27147
+ name: id
27148
+ schema:
27149
+ type: integer
27150
+ required: true
27151
+ - in: path
27152
+ name: pipeline_pk
27153
+ schema:
27154
+ type: integer
27155
+ required: true
27156
+ tags:
27157
+ - crm
27158
+ requestBody:
27159
+ content:
27160
+ application/json:
27161
+ schema:
27162
+ $ref: '#/components/schemas/PatchedPipelineStage'
27163
+ application/scim+json:
27164
+ schema:
27165
+ $ref: '#/components/schemas/PatchedPipelineStage'
27166
+ application/x-www-form-urlencoded:
27167
+ schema:
27168
+ $ref: '#/components/schemas/PatchedPipelineStage'
27169
+ multipart/form-data:
27170
+ schema:
27171
+ $ref: '#/components/schemas/PatchedPipelineStage'
27172
+ '*/*':
27173
+ schema:
27174
+ $ref: '#/components/schemas/PatchedPipelineStage'
27175
+ security:
27176
+ - PlatformApiKeyAuthentication: []
27177
+ responses:
27178
+ '200':
27179
+ content:
27180
+ application/json:
27181
+ schema:
27182
+ $ref: '#/components/schemas/PipelineStage'
27183
+ description: ''
27184
+ '400':
27185
+ description: Validation error.
27186
+ '403':
27187
+ description: Missing required permission `Ibl.CRM/Pipelines/write`.
27188
+ '404':
27189
+ description: Stage not found in this Pipeline.
27190
+ delete:
27191
+ operationId: crm_pipelines_stages_destroy
27192
+ description: |-
27193
+ Deletes the PipelineStage. Fails with `409 Conflict` if any Deal still references it (FK is PROTECTed).
27194
+
27195
+ **Required permission:** `Ibl.CRM/Pipelines/delete`.
27196
+ summary: Delete a stage
27197
+ parameters:
27198
+ - in: path
27199
+ name: id
27200
+ schema:
27201
+ type: integer
27202
+ required: true
27203
+ - in: path
27204
+ name: pipeline_pk
27205
+ schema:
27206
+ type: integer
27207
+ required: true
27208
+ tags:
27209
+ - crm
27210
+ security:
27211
+ - PlatformApiKeyAuthentication: []
27212
+ responses:
27213
+ '204':
27214
+ description: Deleted.
27215
+ '403':
27216
+ description: Missing required permission `Ibl.CRM/Pipelines/delete`.
27217
+ '404':
27218
+ description: Stage not found in this Pipeline.
27219
+ '409':
27220
+ description: Stage still has Deals attached.
27221
+ /api/crm/pipelines/{id}/:
27222
+ get:
27223
+ operationId: crm_pipelines_retrieve
27224
+ description: |-
27225
+ Returns a single Pipeline by id, including its ordered `stages`.
27226
+
27227
+ **Required permission:** `Ibl.CRM/Pipelines/read`.
27228
+ summary: Retrieve a pipeline
27229
+ parameters:
27230
+ - in: path
27231
+ name: id
27232
+ schema:
27233
+ type: integer
27234
+ description: A unique integer value identifying this pipeline.
27235
+ required: true
27236
+ tags:
27237
+ - crm
27238
+ security:
27239
+ - PlatformApiKeyAuthentication: []
27240
+ responses:
27241
+ '200':
27242
+ content:
27243
+ application/json:
27244
+ schema:
27245
+ $ref: '#/components/schemas/Pipeline'
27246
+ description: ''
27247
+ '403':
27248
+ description: Missing required permission `Ibl.CRM/Pipelines/read`.
27249
+ '404':
27250
+ description: Pipeline not found.
27251
+ put:
27252
+ operationId: crm_pipelines_update
27253
+ description: |-
27254
+ Replaces all editable fields on the Pipeline.
27255
+
27256
+ **Required permission:** `Ibl.CRM/Pipelines/write`.
27257
+ summary: Replace a pipeline
27258
+ parameters:
27259
+ - in: path
27260
+ name: id
27261
+ schema:
27262
+ type: integer
27263
+ description: A unique integer value identifying this pipeline.
27264
+ required: true
27265
+ tags:
27266
+ - crm
27267
+ requestBody:
27268
+ content:
27269
+ application/json:
27270
+ schema:
27271
+ $ref: '#/components/schemas/Pipeline'
27272
+ application/scim+json:
27273
+ schema:
27274
+ $ref: '#/components/schemas/Pipeline'
27275
+ application/x-www-form-urlencoded:
27276
+ schema:
27277
+ $ref: '#/components/schemas/Pipeline'
27278
+ multipart/form-data:
27279
+ schema:
27280
+ $ref: '#/components/schemas/Pipeline'
27281
+ '*/*':
27282
+ schema:
27283
+ $ref: '#/components/schemas/Pipeline'
27284
+ required: true
27285
+ security:
27286
+ - PlatformApiKeyAuthentication: []
27287
+ responses:
27288
+ '200':
27289
+ content:
27290
+ application/json:
27291
+ schema:
27292
+ $ref: '#/components/schemas/Pipeline'
27293
+ description: ''
27294
+ '400':
27295
+ description: Validation error.
27296
+ '403':
27297
+ description: Missing required permission `Ibl.CRM/Pipelines/write`.
27298
+ '404':
27299
+ description: Pipeline not found.
27300
+ patch:
27301
+ operationId: crm_pipelines_partial_update
27302
+ description: |-
27303
+ Updates only the supplied fields on the Pipeline.
27304
+
27305
+ **Required permission:** `Ibl.CRM/Pipelines/write`.
27306
+ summary: Update a pipeline
27307
+ parameters:
27308
+ - in: path
27309
+ name: id
27310
+ schema:
27311
+ type: integer
27312
+ description: A unique integer value identifying this pipeline.
27313
+ required: true
27314
+ tags:
27315
+ - crm
27316
+ requestBody:
27317
+ content:
27318
+ application/json:
27319
+ schema:
27320
+ $ref: '#/components/schemas/PatchedPipeline'
27321
+ application/scim+json:
27322
+ schema:
27323
+ $ref: '#/components/schemas/PatchedPipeline'
27324
+ application/x-www-form-urlencoded:
27325
+ schema:
27326
+ $ref: '#/components/schemas/PatchedPipeline'
27327
+ multipart/form-data:
27328
+ schema:
27329
+ $ref: '#/components/schemas/PatchedPipeline'
27330
+ '*/*':
27331
+ schema:
27332
+ $ref: '#/components/schemas/PatchedPipeline'
27333
+ security:
27334
+ - PlatformApiKeyAuthentication: []
27335
+ responses:
27336
+ '200':
27337
+ content:
27338
+ application/json:
27339
+ schema:
27340
+ $ref: '#/components/schemas/Pipeline'
27341
+ description: ''
27342
+ '400':
27343
+ description: Validation error.
27344
+ '403':
27345
+ description: Missing required permission `Ibl.CRM/Pipelines/write`.
27346
+ '404':
27347
+ description: Pipeline not found.
27348
+ delete:
27349
+ operationId: crm_pipelines_destroy
27350
+ description: |-
27351
+ Deletes the Pipeline. Fails with `409 Conflict` if any Deal still references it (FK is PROTECTed).
27352
+
27353
+ **Required permission:** `Ibl.CRM/Pipelines/delete`.
27354
+ summary: Delete a pipeline
27355
+ parameters:
27356
+ - in: path
27357
+ name: id
27358
+ schema:
27359
+ type: integer
27360
+ description: A unique integer value identifying this pipeline.
27361
+ required: true
27362
+ tags:
27363
+ - crm
27364
+ security:
27365
+ - PlatformApiKeyAuthentication: []
27366
+ responses:
27367
+ '204':
27368
+ description: Deleted.
27369
+ '403':
27370
+ description: Missing required permission `Ibl.CRM/Pipelines/delete`.
27371
+ '404':
27372
+ description: Pipeline not found.
27373
+ '409':
27374
+ description: Pipeline still has Deals attached.
25562
27375
  /api/custom-domains/:
25563
27376
  get:
25564
27377
  operationId: custom_domains_retrieve
@@ -37028,11 +38841,574 @@ paths:
37028
38841
  - in: query
37029
38842
  name: start_date
37030
38843
  schema:
37031
- type: string
37032
- format: date
37033
- description: Filter by learners date_joined. Start date. ISO 8601
38844
+ type: string
38845
+ format: date
38846
+ description: Filter by learners date_joined. Start date. ISO 8601
38847
+ tags:
38848
+ - core
38849
+ security:
38850
+ - PlatformApiKeyAuthentication: []
38851
+ responses:
38852
+ '200':
38853
+ content:
38854
+ application/json:
38855
+ schema:
38856
+ $ref: '#/components/schemas/GroupList'
38857
+ description: ''
38858
+ /auto-recharge/trigger/:
38859
+ post:
38860
+ operationId: auto_recharge_trigger_create
38861
+ description: 'With amount_usd: manual top-up (charge that amount, add credits;
38862
+ no threshold/limit/cooldown). Without amount_usd: run auto-recharge once if
38863
+ enabled and balance below threshold. Returns 400 if skipped or failed (e.g.
38864
+ no payment method, cooldown). Pass platform_key in request body.'
38865
+ summary: Trigger auto-recharge or manual top-up
38866
+ tags:
38867
+ - auto-recharge
38868
+ requestBody:
38869
+ content:
38870
+ application/json:
38871
+ schema:
38872
+ $ref: '#/components/schemas/AutoRechargeTriggerRequest'
38873
+ application/scim+json:
38874
+ schema:
38875
+ $ref: '#/components/schemas/AutoRechargeTriggerRequest'
38876
+ application/x-www-form-urlencoded:
38877
+ schema:
38878
+ $ref: '#/components/schemas/AutoRechargeTriggerRequest'
38879
+ multipart/form-data:
38880
+ schema:
38881
+ $ref: '#/components/schemas/AutoRechargeTriggerRequest'
38882
+ '*/*':
38883
+ schema:
38884
+ $ref: '#/components/schemas/AutoRechargeTriggerRequest'
38885
+ security:
38886
+ - PlatformApiKeyAuthentication: []
38887
+ responses:
38888
+ '200':
38889
+ content:
38890
+ application/json:
38891
+ schema:
38892
+ $ref: '#/components/schemas/AutoRechargeTriggerResponse'
38893
+ description: ''
38894
+ '400':
38895
+ content:
38896
+ application/json:
38897
+ schema:
38898
+ $ref: '#/components/schemas/ErrorDetail'
38899
+ description: ''
38900
+ /credits/sample-action/:
38901
+ post:
38902
+ operationId: credits_sample_action_create
38903
+ description: |-
38904
+ Sample endpoint protected by @consume_credits (opt-in).
38905
+
38906
+ Balance is checked before the view runs. If insufficient, 402 with
38907
+ pricing_table is returned; otherwise the view runs and 1 credit is consumed.
38908
+ tags:
38909
+ - credits
38910
+ security:
38911
+ - PlatformApiKeyAuthentication: []
38912
+ responses:
38913
+ '200':
38914
+ description: No response body
38915
+ /deals/:
38916
+ get:
38917
+ operationId: deals_list
38918
+ description: |-
38919
+ 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`.
38920
+
38921
+ **Required permission:** `Ibl.CRM/Deals/list`.
38922
+ summary: List deals
38923
+ parameters:
38924
+ - in: query
38925
+ name: created_at__gte
38926
+ schema:
38927
+ type: string
38928
+ format: date-time
38929
+ - in: query
38930
+ name: created_at__lte
38931
+ schema:
38932
+ type: string
38933
+ format: date-time
38934
+ - in: query
38935
+ name: expected_close_date__gte
38936
+ schema:
38937
+ type: string
38938
+ format: date-time
38939
+ - in: query
38940
+ name: expected_close_date__lte
38941
+ schema:
38942
+ type: string
38943
+ format: date-time
38944
+ - in: query
38945
+ name: metadata__has_key
38946
+ schema:
38947
+ type: string
38948
+ - in: query
38949
+ name: organization
38950
+ schema:
38951
+ type: string
38952
+ format: uuid
38953
+ - in: query
38954
+ name: owner
38955
+ schema:
38956
+ type: number
38957
+ - name: page
38958
+ required: false
38959
+ in: query
38960
+ description: A page number within the paginated result set.
38961
+ schema:
38962
+ type: integer
38963
+ - name: page_size
38964
+ required: false
38965
+ in: query
38966
+ description: Number of results to return per page.
38967
+ schema:
38968
+ type: integer
38969
+ - in: query
38970
+ name: person
38971
+ schema:
38972
+ type: string
38973
+ format: uuid
38974
+ - in: query
38975
+ name: pipeline
38976
+ schema:
38977
+ type: number
38978
+ - in: query
38979
+ name: source
38980
+ schema:
38981
+ type: number
38982
+ - in: query
38983
+ name: stage
38984
+ schema:
38985
+ type: number
38986
+ - in: query
38987
+ name: status
38988
+ schema:
38989
+ type: string
38990
+ enum:
38991
+ - lost
38992
+ - open
38993
+ - won
38994
+ description: |-
38995
+ Service-managed (read-only in serializer). Derived from the destination stage's is_won/is_lost.
38996
+
38997
+ * `open` - Open
38998
+ * `won` - Won
38999
+ * `lost` - Lost
39000
+ tags:
39001
+ - deals
39002
+ security:
39003
+ - PlatformApiKeyAuthentication: []
39004
+ responses:
39005
+ '200':
39006
+ content:
39007
+ application/json:
39008
+ schema:
39009
+ $ref: '#/components/schemas/PaginatedDealList'
39010
+ description: ''
39011
+ '401':
39012
+ description: Authentication required.
39013
+ '403':
39014
+ description: Missing required permission `Ibl.CRM/Deals/list`.
39015
+ post:
39016
+ operationId: deals_create
39017
+ description: |-
39018
+ 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`.
39019
+
39020
+ **Required permission:** `Ibl.CRM/Deals/write`.
39021
+ summary: Create a deal
39022
+ tags:
39023
+ - deals
39024
+ requestBody:
39025
+ content:
39026
+ application/json:
39027
+ schema:
39028
+ $ref: '#/components/schemas/Deal'
39029
+ application/scim+json:
39030
+ schema:
39031
+ $ref: '#/components/schemas/Deal'
39032
+ application/x-www-form-urlencoded:
39033
+ schema:
39034
+ $ref: '#/components/schemas/Deal'
39035
+ multipart/form-data:
39036
+ schema:
39037
+ $ref: '#/components/schemas/Deal'
39038
+ '*/*':
39039
+ schema:
39040
+ $ref: '#/components/schemas/Deal'
39041
+ required: true
39042
+ security:
39043
+ - PlatformApiKeyAuthentication: []
39044
+ responses:
39045
+ '201':
39046
+ content:
39047
+ application/json:
39048
+ schema:
39049
+ $ref: '#/components/schemas/Deal'
39050
+ description: ''
39051
+ '400':
39052
+ description: Validation error.
39053
+ '403':
39054
+ description: Missing required permission `Ibl.CRM/Deals/write`.
39055
+ /deals/{id}/:
39056
+ get:
39057
+ operationId: deals_retrieve
39058
+ description: |-
39059
+ Returns a single Deal by id.
39060
+
39061
+ **Required permission:** `Ibl.CRM/Deals/read`.
39062
+ summary: Retrieve a deal
39063
+ parameters:
39064
+ - in: path
39065
+ name: id
39066
+ schema:
39067
+ type: integer
39068
+ description: A unique integer value identifying this deal.
39069
+ required: true
39070
+ tags:
39071
+ - deals
39072
+ security:
39073
+ - PlatformApiKeyAuthentication: []
39074
+ responses:
39075
+ '200':
39076
+ content:
39077
+ application/json:
39078
+ schema:
39079
+ $ref: '#/components/schemas/Deal'
39080
+ description: ''
39081
+ '403':
39082
+ description: Missing required permission `Ibl.CRM/Deals/read`.
39083
+ '404':
39084
+ description: Deal not found.
39085
+ put:
39086
+ operationId: deals_update
39087
+ description: |-
39088
+ Replaces all editable fields on the Deal.
39089
+
39090
+ **Required permission:** `Ibl.CRM/Deals/write`.
39091
+ summary: Replace a deal
39092
+ parameters:
39093
+ - in: path
39094
+ name: id
39095
+ schema:
39096
+ type: integer
39097
+ description: A unique integer value identifying this deal.
39098
+ required: true
39099
+ tags:
39100
+ - deals
39101
+ requestBody:
39102
+ content:
39103
+ application/json:
39104
+ schema:
39105
+ $ref: '#/components/schemas/Deal'
39106
+ application/scim+json:
39107
+ schema:
39108
+ $ref: '#/components/schemas/Deal'
39109
+ application/x-www-form-urlencoded:
39110
+ schema:
39111
+ $ref: '#/components/schemas/Deal'
39112
+ multipart/form-data:
39113
+ schema:
39114
+ $ref: '#/components/schemas/Deal'
39115
+ '*/*':
39116
+ schema:
39117
+ $ref: '#/components/schemas/Deal'
39118
+ required: true
39119
+ security:
39120
+ - PlatformApiKeyAuthentication: []
39121
+ responses:
39122
+ '200':
39123
+ content:
39124
+ application/json:
39125
+ schema:
39126
+ $ref: '#/components/schemas/Deal'
39127
+ description: ''
39128
+ '400':
39129
+ description: Validation error.
39130
+ '403':
39131
+ description: Missing required permission `Ibl.CRM/Deals/write`.
39132
+ '404':
39133
+ description: Deal not found.
39134
+ patch:
39135
+ operationId: deals_partial_update
39136
+ description: |-
39137
+ 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/`.
39138
+
39139
+ **Required permission:** `Ibl.CRM/Deals/write`.
39140
+ summary: Update a deal
39141
+ parameters:
39142
+ - in: path
39143
+ name: id
39144
+ schema:
39145
+ type: integer
39146
+ description: A unique integer value identifying this deal.
39147
+ required: true
39148
+ tags:
39149
+ - deals
39150
+ requestBody:
39151
+ content:
39152
+ application/json:
39153
+ schema:
39154
+ $ref: '#/components/schemas/PatchedDeal'
39155
+ application/scim+json:
39156
+ schema:
39157
+ $ref: '#/components/schemas/PatchedDeal'
39158
+ application/x-www-form-urlencoded:
39159
+ schema:
39160
+ $ref: '#/components/schemas/PatchedDeal'
39161
+ multipart/form-data:
39162
+ schema:
39163
+ $ref: '#/components/schemas/PatchedDeal'
39164
+ '*/*':
39165
+ schema:
39166
+ $ref: '#/components/schemas/PatchedDeal'
39167
+ security:
39168
+ - PlatformApiKeyAuthentication: []
39169
+ responses:
39170
+ '200':
39171
+ content:
39172
+ application/json:
39173
+ schema:
39174
+ $ref: '#/components/schemas/Deal'
39175
+ description: ''
39176
+ '400':
39177
+ description: Validation error.
39178
+ '403':
39179
+ description: Missing required permission `Ibl.CRM/Deals/write`.
39180
+ '404':
39181
+ description: Deal not found.
39182
+ delete:
39183
+ operationId: deals_destroy
39184
+ description: |-
39185
+ Deletes the Deal.
39186
+
39187
+ **Required permission:** `Ibl.CRM/Deals/delete`.
39188
+ summary: Delete a deal
39189
+ parameters:
39190
+ - in: path
39191
+ name: id
39192
+ schema:
39193
+ type: integer
39194
+ description: A unique integer value identifying this deal.
39195
+ required: true
39196
+ tags:
39197
+ - deals
39198
+ security:
39199
+ - PlatformApiKeyAuthentication: []
39200
+ responses:
39201
+ '204':
39202
+ description: Deleted.
39203
+ '403':
39204
+ description: Missing required permission `Ibl.CRM/Deals/delete`.
39205
+ '404':
39206
+ description: Deal not found.
39207
+ /deals/{id}/lost/:
39208
+ post:
39209
+ operationId: deals_lost_create
39210
+ description: |-
39211
+ 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.
39212
+
39213
+ **Required permission:** `Ibl.CRM/Deals/write`.
39214
+ summary: Mark a deal as lost
39215
+ parameters:
39216
+ - in: path
39217
+ name: id
39218
+ schema:
39219
+ type: integer
39220
+ description: A unique integer value identifying this deal.
39221
+ required: true
39222
+ tags:
39223
+ - deals
39224
+ requestBody:
39225
+ content:
39226
+ application/json:
39227
+ schema:
39228
+ $ref: '#/components/schemas/DealLostRequest'
39229
+ application/scim+json:
39230
+ schema:
39231
+ $ref: '#/components/schemas/DealLostRequest'
39232
+ application/x-www-form-urlencoded:
39233
+ schema:
39234
+ $ref: '#/components/schemas/DealLostRequest'
39235
+ multipart/form-data:
39236
+ schema:
39237
+ $ref: '#/components/schemas/DealLostRequest'
39238
+ '*/*':
39239
+ schema:
39240
+ $ref: '#/components/schemas/DealLostRequest'
39241
+ required: true
39242
+ security:
39243
+ - PlatformApiKeyAuthentication: []
39244
+ responses:
39245
+ '200':
39246
+ content:
39247
+ application/json:
39248
+ schema:
39249
+ $ref: '#/components/schemas/Deal'
39250
+ description: ''
39251
+ '400':
39252
+ description: Missing `lost_reason`, no `is_lost` stage configured, or the
39253
+ supplied stage_code is not flagged is_lost=True.
39254
+ '403':
39255
+ description: Missing required permission `Ibl.CRM/Deals/write`.
39256
+ '404':
39257
+ description: Deal not found.
39258
+ /deals/{id}/move-stage/:
39259
+ post:
39260
+ operationId: deals_move_stage_create
39261
+ description: |-
39262
+ 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.
39263
+
39264
+ **Required permission:** `Ibl.CRM/Deals/write`.
39265
+ summary: Move a deal to a different stage
39266
+ parameters:
39267
+ - in: path
39268
+ name: id
39269
+ schema:
39270
+ type: integer
39271
+ description: A unique integer value identifying this deal.
39272
+ required: true
39273
+ tags:
39274
+ - deals
39275
+ requestBody:
39276
+ content:
39277
+ application/json:
39278
+ schema:
39279
+ $ref: '#/components/schemas/DealMoveStageRequest'
39280
+ application/scim+json:
39281
+ schema:
39282
+ $ref: '#/components/schemas/DealMoveStageRequest'
39283
+ application/x-www-form-urlencoded:
39284
+ schema:
39285
+ $ref: '#/components/schemas/DealMoveStageRequest'
39286
+ multipart/form-data:
39287
+ schema:
39288
+ $ref: '#/components/schemas/DealMoveStageRequest'
39289
+ '*/*':
39290
+ schema:
39291
+ $ref: '#/components/schemas/DealMoveStageRequest'
39292
+ security:
39293
+ - PlatformApiKeyAuthentication: []
39294
+ responses:
39295
+ '200':
39296
+ content:
39297
+ application/json:
39298
+ schema:
39299
+ $ref: '#/components/schemas/Deal'
39300
+ description: ''
39301
+ '400':
39302
+ description: Validation error (e.g. stage not in pipeline).
39303
+ '403':
39304
+ description: Missing required permission `Ibl.CRM/Deals/write`.
39305
+ '404':
39306
+ description: Deal or stage not found.
39307
+ /deals/{id}/won/:
39308
+ post:
39309
+ operationId: deals_won_create
39310
+ description: |-
39311
+ 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.
39312
+
39313
+ **Required permission:** `Ibl.CRM/Deals/write`.
39314
+ summary: Mark a deal as won
39315
+ parameters:
39316
+ - in: path
39317
+ name: id
39318
+ schema:
39319
+ type: integer
39320
+ description: A unique integer value identifying this deal.
39321
+ required: true
39322
+ tags:
39323
+ - deals
39324
+ requestBody:
39325
+ content:
39326
+ application/json:
39327
+ schema:
39328
+ $ref: '#/components/schemas/DealWonRequest'
39329
+ application/scim+json:
39330
+ schema:
39331
+ $ref: '#/components/schemas/DealWonRequest'
39332
+ application/x-www-form-urlencoded:
39333
+ schema:
39334
+ $ref: '#/components/schemas/DealWonRequest'
39335
+ multipart/form-data:
39336
+ schema:
39337
+ $ref: '#/components/schemas/DealWonRequest'
39338
+ '*/*':
39339
+ schema:
39340
+ $ref: '#/components/schemas/DealWonRequest'
39341
+ security:
39342
+ - PlatformApiKeyAuthentication: []
39343
+ responses:
39344
+ '200':
39345
+ content:
39346
+ application/json:
39347
+ schema:
39348
+ $ref: '#/components/schemas/Deal'
39349
+ description: ''
39350
+ '400':
39351
+ description: No `is_won` stage configured, or the supplied stage_code is
39352
+ not flagged is_won=True.
39353
+ '403':
39354
+ description: Missing required permission `Ibl.CRM/Deals/write`.
39355
+ '404':
39356
+ description: Deal not found.
39357
+ /items/{config_unique_id}/public-pricing/:
39358
+ get:
39359
+ operationId: items_public_pricing_retrieve
39360
+ description: Looks up the paywall config by its unique_id and delegates to the
39361
+ standard public pricing endpoint.
39362
+ summary: Get public pricing by paywall config unique_id
39363
+ parameters:
39364
+ - in: path
39365
+ name: config_unique_id
39366
+ schema:
39367
+ type: string
39368
+ format: uuid
39369
+ required: true
39370
+ tags:
39371
+ - items
39372
+ security:
39373
+ - {}
39374
+ responses:
39375
+ '200':
39376
+ content:
39377
+ application/json:
39378
+ schema:
39379
+ $ref: '#/components/schemas/PublicItemPricing'
39380
+ description: ''
39381
+ /lead-sources/:
39382
+ get:
39383
+ operationId: lead_sources_list
39384
+ description: |-
39385
+ Returns a paginated list of LeadSources in your Platform.
39386
+
39387
+ **Required permission:** `Ibl.CRM/Pipelines/list`.
39388
+ summary: List lead sources
39389
+ parameters:
39390
+ - in: query
39391
+ name: code
39392
+ schema:
39393
+ type: string
39394
+ - in: query
39395
+ name: name
39396
+ schema:
39397
+ type: string
39398
+ - name: page
39399
+ required: false
39400
+ in: query
39401
+ description: A page number within the paginated result set.
39402
+ schema:
39403
+ type: integer
39404
+ - name: page_size
39405
+ required: false
39406
+ in: query
39407
+ description: Number of results to return per page.
39408
+ schema:
39409
+ type: integer
37034
39410
  tags:
37035
- - core
39411
+ - lead-sources
37036
39412
  security:
37037
39413
  - PlatformApiKeyAuthentication: []
37038
39414
  responses:
@@ -37040,89 +39416,204 @@ paths:
37040
39416
  content:
37041
39417
  application/json:
37042
39418
  schema:
37043
- $ref: '#/components/schemas/GroupList'
39419
+ $ref: '#/components/schemas/PaginatedLeadSourceList'
37044
39420
  description: ''
37045
- /auto-recharge/trigger/:
39421
+ '401':
39422
+ description: Authentication required.
39423
+ '403':
39424
+ description: Missing required permission `Ibl.CRM/Pipelines/list`.
37046
39425
  post:
37047
- operationId: auto_recharge_trigger_create
37048
- description: 'With amount_usd: manual top-up (charge that amount, add credits;
37049
- no threshold/limit/cooldown). Without amount_usd: run auto-recharge once if
37050
- enabled and balance below threshold. Returns 400 if skipped or failed (e.g.
37051
- no payment method, cooldown). Pass platform_key in request body.'
37052
- summary: Trigger auto-recharge or manual top-up
39426
+ operationId: lead_sources_create
39427
+ description: |-
39428
+ Creates a new LeadSource in your Platform. `code` must be unique.
39429
+
39430
+ **Required permission:** `Ibl.CRM/Pipelines/write`.
39431
+ summary: Create a lead source
37053
39432
  tags:
37054
- - auto-recharge
39433
+ - lead-sources
37055
39434
  requestBody:
37056
39435
  content:
37057
39436
  application/json:
37058
39437
  schema:
37059
- $ref: '#/components/schemas/AutoRechargeTriggerRequest'
39438
+ $ref: '#/components/schemas/LeadSource'
37060
39439
  application/scim+json:
37061
39440
  schema:
37062
- $ref: '#/components/schemas/AutoRechargeTriggerRequest'
39441
+ $ref: '#/components/schemas/LeadSource'
37063
39442
  application/x-www-form-urlencoded:
37064
39443
  schema:
37065
- $ref: '#/components/schemas/AutoRechargeTriggerRequest'
39444
+ $ref: '#/components/schemas/LeadSource'
37066
39445
  multipart/form-data:
37067
39446
  schema:
37068
- $ref: '#/components/schemas/AutoRechargeTriggerRequest'
39447
+ $ref: '#/components/schemas/LeadSource'
37069
39448
  '*/*':
37070
39449
  schema:
37071
- $ref: '#/components/schemas/AutoRechargeTriggerRequest'
39450
+ $ref: '#/components/schemas/LeadSource'
39451
+ required: true
37072
39452
  security:
37073
39453
  - PlatformApiKeyAuthentication: []
37074
39454
  responses:
37075
- '200':
39455
+ '201':
37076
39456
  content:
37077
39457
  application/json:
37078
39458
  schema:
37079
- $ref: '#/components/schemas/AutoRechargeTriggerResponse'
39459
+ $ref: '#/components/schemas/LeadSource'
37080
39460
  description: ''
37081
39461
  '400':
39462
+ description: Validation error.
39463
+ '403':
39464
+ description: Missing required permission `Ibl.CRM/Pipelines/write`.
39465
+ /lead-sources/{id}/:
39466
+ get:
39467
+ operationId: lead_sources_retrieve
39468
+ description: |-
39469
+ Returns a single LeadSource by id.
39470
+
39471
+ **Required permission:** `Ibl.CRM/Pipelines/read`.
39472
+ summary: Retrieve a lead source
39473
+ parameters:
39474
+ - in: path
39475
+ name: id
39476
+ schema:
39477
+ type: integer
39478
+ description: A unique integer value identifying this lead source.
39479
+ required: true
39480
+ tags:
39481
+ - lead-sources
39482
+ security:
39483
+ - PlatformApiKeyAuthentication: []
39484
+ responses:
39485
+ '200':
37082
39486
  content:
37083
39487
  application/json:
37084
39488
  schema:
37085
- $ref: '#/components/schemas/ErrorDetail'
39489
+ $ref: '#/components/schemas/LeadSource'
37086
39490
  description: ''
37087
- /credits/sample-action/:
37088
- post:
37089
- operationId: credits_sample_action_create
39491
+ '403':
39492
+ description: Missing required permission `Ibl.CRM/Pipelines/read`.
39493
+ '404':
39494
+ description: LeadSource not found.
39495
+ put:
39496
+ operationId: lead_sources_update
37090
39497
  description: |-
37091
- Sample endpoint protected by @consume_credits (opt-in).
39498
+ Replaces all editable fields on the LeadSource.
37092
39499
 
37093
- Balance is checked before the view runs. If insufficient, 402 with
37094
- pricing_table is returned; otherwise the view runs and 1 credit is consumed.
39500
+ **Required permission:** `Ibl.CRM/Pipelines/write`.
39501
+ summary: Replace a lead source
39502
+ parameters:
39503
+ - in: path
39504
+ name: id
39505
+ schema:
39506
+ type: integer
39507
+ description: A unique integer value identifying this lead source.
39508
+ required: true
37095
39509
  tags:
37096
- - credits
39510
+ - lead-sources
39511
+ requestBody:
39512
+ content:
39513
+ application/json:
39514
+ schema:
39515
+ $ref: '#/components/schemas/LeadSource'
39516
+ application/scim+json:
39517
+ schema:
39518
+ $ref: '#/components/schemas/LeadSource'
39519
+ application/x-www-form-urlencoded:
39520
+ schema:
39521
+ $ref: '#/components/schemas/LeadSource'
39522
+ multipart/form-data:
39523
+ schema:
39524
+ $ref: '#/components/schemas/LeadSource'
39525
+ '*/*':
39526
+ schema:
39527
+ $ref: '#/components/schemas/LeadSource'
39528
+ required: true
37097
39529
  security:
37098
39530
  - PlatformApiKeyAuthentication: []
37099
39531
  responses:
37100
39532
  '200':
37101
- description: No response body
37102
- /items/{config_unique_id}/public-pricing/:
37103
- get:
37104
- operationId: items_public_pricing_retrieve
37105
- description: Looks up the paywall config by its unique_id and delegates to the
37106
- standard public pricing endpoint.
37107
- summary: Get public pricing by paywall config unique_id
39533
+ content:
39534
+ application/json:
39535
+ schema:
39536
+ $ref: '#/components/schemas/LeadSource'
39537
+ description: ''
39538
+ '400':
39539
+ description: Validation error.
39540
+ '403':
39541
+ description: Missing required permission `Ibl.CRM/Pipelines/write`.
39542
+ '404':
39543
+ description: LeadSource not found.
39544
+ patch:
39545
+ operationId: lead_sources_partial_update
39546
+ description: |-
39547
+ Updates only the supplied fields on the LeadSource.
39548
+
39549
+ **Required permission:** `Ibl.CRM/Pipelines/write`.
39550
+ summary: Update a lead source
37108
39551
  parameters:
37109
39552
  - in: path
37110
- name: config_unique_id
39553
+ name: id
37111
39554
  schema:
37112
- type: string
37113
- format: uuid
39555
+ type: integer
39556
+ description: A unique integer value identifying this lead source.
37114
39557
  required: true
37115
39558
  tags:
37116
- - items
39559
+ - lead-sources
39560
+ requestBody:
39561
+ content:
39562
+ application/json:
39563
+ schema:
39564
+ $ref: '#/components/schemas/PatchedLeadSource'
39565
+ application/scim+json:
39566
+ schema:
39567
+ $ref: '#/components/schemas/PatchedLeadSource'
39568
+ application/x-www-form-urlencoded:
39569
+ schema:
39570
+ $ref: '#/components/schemas/PatchedLeadSource'
39571
+ multipart/form-data:
39572
+ schema:
39573
+ $ref: '#/components/schemas/PatchedLeadSource'
39574
+ '*/*':
39575
+ schema:
39576
+ $ref: '#/components/schemas/PatchedLeadSource'
37117
39577
  security:
37118
- - {}
39578
+ - PlatformApiKeyAuthentication: []
37119
39579
  responses:
37120
39580
  '200':
37121
39581
  content:
37122
39582
  application/json:
37123
39583
  schema:
37124
- $ref: '#/components/schemas/PublicItemPricing'
39584
+ $ref: '#/components/schemas/LeadSource'
37125
39585
  description: ''
39586
+ '400':
39587
+ description: Validation error.
39588
+ '403':
39589
+ description: Missing required permission `Ibl.CRM/Pipelines/write`.
39590
+ '404':
39591
+ description: LeadSource not found.
39592
+ delete:
39593
+ operationId: lead_sources_destroy
39594
+ description: |-
39595
+ Deletes the LeadSource. Any Deals referencing it have their `source` cleared.
39596
+
39597
+ **Required permission:** `Ibl.CRM/Pipelines/delete`.
39598
+ summary: Delete a lead source
39599
+ parameters:
39600
+ - in: path
39601
+ name: id
39602
+ schema:
39603
+ type: integer
39604
+ description: A unique integer value identifying this lead source.
39605
+ required: true
39606
+ tags:
39607
+ - lead-sources
39608
+ security:
39609
+ - PlatformApiKeyAuthentication: []
39610
+ responses:
39611
+ '204':
39612
+ description: Deleted.
39613
+ '403':
39614
+ description: Missing required permission `Ibl.CRM/Pipelines/delete`.
39615
+ '404':
39616
+ description: LeadSource not found.
37126
39617
  /organizations/:
37127
39618
  get:
37128
39619
  operationId: organizations_list
@@ -37393,7 +39884,7 @@ paths:
37393
39884
  - opportunity
37394
39885
  - qualified
37395
39886
  description: |-
37396
- Funnel position. Free-form transitions in v0.
39887
+ Funnel position. Transitions are unrestricted — any stage may move to any other.
37397
39888
 
37398
39889
  * `lead` - Lead
37399
39890
  * `qualified` - Qualified
@@ -37796,6 +40287,519 @@ paths:
37796
40287
  description: Missing required permission `Ibl.CRM/Persons/write`.
37797
40288
  '404':
37798
40289
  description: Primary person not found.
40290
+ /pipelines/:
40291
+ get:
40292
+ operationId: pipelines_list
40293
+ description: |-
40294
+ Returns a paginated list of Pipelines in your Platform. Each Pipeline includes its ordered `stages` inline.
40295
+
40296
+ **Required permission:** `Ibl.CRM/Pipelines/list`.
40297
+ summary: List pipelines
40298
+ parameters:
40299
+ - in: query
40300
+ name: code
40301
+ schema:
40302
+ type: string
40303
+ - in: query
40304
+ name: is_default
40305
+ schema:
40306
+ type: boolean
40307
+ - in: query
40308
+ name: name
40309
+ schema:
40310
+ type: string
40311
+ - name: page
40312
+ required: false
40313
+ in: query
40314
+ description: A page number within the paginated result set.
40315
+ schema:
40316
+ type: integer
40317
+ - name: page_size
40318
+ required: false
40319
+ in: query
40320
+ description: Number of results to return per page.
40321
+ schema:
40322
+ type: integer
40323
+ tags:
40324
+ - pipelines
40325
+ security:
40326
+ - PlatformApiKeyAuthentication: []
40327
+ responses:
40328
+ '200':
40329
+ content:
40330
+ application/json:
40331
+ schema:
40332
+ $ref: '#/components/schemas/PaginatedPipelineList'
40333
+ description: ''
40334
+ '401':
40335
+ description: Authentication required.
40336
+ '403':
40337
+ description: Missing required permission `Ibl.CRM/Pipelines/list`.
40338
+ post:
40339
+ operationId: pipelines_create
40340
+ description: |-
40341
+ 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.
40342
+
40343
+ **Required permission:** `Ibl.CRM/Pipelines/write`.
40344
+ summary: Create a pipeline
40345
+ tags:
40346
+ - pipelines
40347
+ requestBody:
40348
+ content:
40349
+ application/json:
40350
+ schema:
40351
+ $ref: '#/components/schemas/Pipeline'
40352
+ application/scim+json:
40353
+ schema:
40354
+ $ref: '#/components/schemas/Pipeline'
40355
+ application/x-www-form-urlencoded:
40356
+ schema:
40357
+ $ref: '#/components/schemas/Pipeline'
40358
+ multipart/form-data:
40359
+ schema:
40360
+ $ref: '#/components/schemas/Pipeline'
40361
+ '*/*':
40362
+ schema:
40363
+ $ref: '#/components/schemas/Pipeline'
40364
+ required: true
40365
+ security:
40366
+ - PlatformApiKeyAuthentication: []
40367
+ responses:
40368
+ '201':
40369
+ content:
40370
+ application/json:
40371
+ schema:
40372
+ $ref: '#/components/schemas/Pipeline'
40373
+ description: ''
40374
+ '400':
40375
+ description: Validation error.
40376
+ '403':
40377
+ description: Missing required permission `Ibl.CRM/Pipelines/write`.
40378
+ /pipelines/{pipeline_pk}/stages/:
40379
+ get:
40380
+ operationId: pipelines_stages_list
40381
+ description: |-
40382
+ Returns the ordered list of PipelineStages for the given Pipeline.
40383
+
40384
+ **Required permission:** `Ibl.CRM/Pipelines/list`.
40385
+ summary: List stages for a pipeline
40386
+ parameters:
40387
+ - in: query
40388
+ name: code
40389
+ schema:
40390
+ type: string
40391
+ - in: query
40392
+ name: is_lost
40393
+ schema:
40394
+ type: boolean
40395
+ - in: query
40396
+ name: is_won
40397
+ schema:
40398
+ type: boolean
40399
+ - name: page
40400
+ required: false
40401
+ in: query
40402
+ description: A page number within the paginated result set.
40403
+ schema:
40404
+ type: integer
40405
+ - name: page_size
40406
+ required: false
40407
+ in: query
40408
+ description: Number of results to return per page.
40409
+ schema:
40410
+ type: integer
40411
+ - in: path
40412
+ name: pipeline_pk
40413
+ schema:
40414
+ type: integer
40415
+ required: true
40416
+ tags:
40417
+ - pipelines
40418
+ security:
40419
+ - PlatformApiKeyAuthentication: []
40420
+ responses:
40421
+ '200':
40422
+ content:
40423
+ application/json:
40424
+ schema:
40425
+ $ref: '#/components/schemas/PaginatedPipelineStageList'
40426
+ description: ''
40427
+ '403':
40428
+ description: Missing required permission `Ibl.CRM/Pipelines/list`.
40429
+ '404':
40430
+ description: Pipeline not found.
40431
+ post:
40432
+ operationId: pipelines_stages_create
40433
+ description: |-
40434
+ 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.
40435
+
40436
+ **Required permission:** `Ibl.CRM/Pipelines/write`.
40437
+ summary: Create a stage
40438
+ parameters:
40439
+ - in: path
40440
+ name: pipeline_pk
40441
+ schema:
40442
+ type: integer
40443
+ required: true
40444
+ tags:
40445
+ - pipelines
40446
+ requestBody:
40447
+ content:
40448
+ application/json:
40449
+ schema:
40450
+ $ref: '#/components/schemas/PipelineStage'
40451
+ application/scim+json:
40452
+ schema:
40453
+ $ref: '#/components/schemas/PipelineStage'
40454
+ application/x-www-form-urlencoded:
40455
+ schema:
40456
+ $ref: '#/components/schemas/PipelineStage'
40457
+ multipart/form-data:
40458
+ schema:
40459
+ $ref: '#/components/schemas/PipelineStage'
40460
+ '*/*':
40461
+ schema:
40462
+ $ref: '#/components/schemas/PipelineStage'
40463
+ required: true
40464
+ security:
40465
+ - PlatformApiKeyAuthentication: []
40466
+ responses:
40467
+ '201':
40468
+ content:
40469
+ application/json:
40470
+ schema:
40471
+ $ref: '#/components/schemas/PipelineStage'
40472
+ description: ''
40473
+ '400':
40474
+ description: Validation error.
40475
+ '403':
40476
+ description: Missing required permission `Ibl.CRM/Pipelines/write`.
40477
+ '404':
40478
+ description: Pipeline not found.
40479
+ /pipelines/{pipeline_pk}/stages/{id}/:
40480
+ get:
40481
+ operationId: pipelines_stages_retrieve
40482
+ description: |-
40483
+ Returns a single PipelineStage by id (must belong to the URL Pipeline).
40484
+
40485
+ **Required permission:** `Ibl.CRM/Pipelines/read`.
40486
+ summary: Retrieve a stage
40487
+ parameters:
40488
+ - in: path
40489
+ name: id
40490
+ schema:
40491
+ type: integer
40492
+ required: true
40493
+ - in: path
40494
+ name: pipeline_pk
40495
+ schema:
40496
+ type: integer
40497
+ required: true
40498
+ tags:
40499
+ - pipelines
40500
+ security:
40501
+ - PlatformApiKeyAuthentication: []
40502
+ responses:
40503
+ '200':
40504
+ content:
40505
+ application/json:
40506
+ schema:
40507
+ $ref: '#/components/schemas/PipelineStage'
40508
+ description: ''
40509
+ '403':
40510
+ description: Missing required permission `Ibl.CRM/Pipelines/read`.
40511
+ '404':
40512
+ description: Stage not found in this Pipeline.
40513
+ put:
40514
+ operationId: pipelines_stages_update
40515
+ description: |-
40516
+ Replaces all editable fields on the PipelineStage.
40517
+
40518
+ **Required permission:** `Ibl.CRM/Pipelines/write`.
40519
+ summary: Replace a stage
40520
+ parameters:
40521
+ - in: path
40522
+ name: id
40523
+ schema:
40524
+ type: integer
40525
+ required: true
40526
+ - in: path
40527
+ name: pipeline_pk
40528
+ schema:
40529
+ type: integer
40530
+ required: true
40531
+ tags:
40532
+ - pipelines
40533
+ requestBody:
40534
+ content:
40535
+ application/json:
40536
+ schema:
40537
+ $ref: '#/components/schemas/PipelineStage'
40538
+ application/scim+json:
40539
+ schema:
40540
+ $ref: '#/components/schemas/PipelineStage'
40541
+ application/x-www-form-urlencoded:
40542
+ schema:
40543
+ $ref: '#/components/schemas/PipelineStage'
40544
+ multipart/form-data:
40545
+ schema:
40546
+ $ref: '#/components/schemas/PipelineStage'
40547
+ '*/*':
40548
+ schema:
40549
+ $ref: '#/components/schemas/PipelineStage'
40550
+ required: true
40551
+ security:
40552
+ - PlatformApiKeyAuthentication: []
40553
+ responses:
40554
+ '200':
40555
+ content:
40556
+ application/json:
40557
+ schema:
40558
+ $ref: '#/components/schemas/PipelineStage'
40559
+ description: ''
40560
+ '400':
40561
+ description: Validation error.
40562
+ '403':
40563
+ description: Missing required permission `Ibl.CRM/Pipelines/write`.
40564
+ '404':
40565
+ description: Stage not found in this Pipeline.
40566
+ patch:
40567
+ operationId: pipelines_stages_partial_update
40568
+ description: |-
40569
+ Updates only the supplied fields on the PipelineStage.
40570
+
40571
+ **Required permission:** `Ibl.CRM/Pipelines/write`.
40572
+ summary: Update a stage
40573
+ parameters:
40574
+ - in: path
40575
+ name: id
40576
+ schema:
40577
+ type: integer
40578
+ required: true
40579
+ - in: path
40580
+ name: pipeline_pk
40581
+ schema:
40582
+ type: integer
40583
+ required: true
40584
+ tags:
40585
+ - pipelines
40586
+ requestBody:
40587
+ content:
40588
+ application/json:
40589
+ schema:
40590
+ $ref: '#/components/schemas/PatchedPipelineStage'
40591
+ application/scim+json:
40592
+ schema:
40593
+ $ref: '#/components/schemas/PatchedPipelineStage'
40594
+ application/x-www-form-urlencoded:
40595
+ schema:
40596
+ $ref: '#/components/schemas/PatchedPipelineStage'
40597
+ multipart/form-data:
40598
+ schema:
40599
+ $ref: '#/components/schemas/PatchedPipelineStage'
40600
+ '*/*':
40601
+ schema:
40602
+ $ref: '#/components/schemas/PatchedPipelineStage'
40603
+ security:
40604
+ - PlatformApiKeyAuthentication: []
40605
+ responses:
40606
+ '200':
40607
+ content:
40608
+ application/json:
40609
+ schema:
40610
+ $ref: '#/components/schemas/PipelineStage'
40611
+ description: ''
40612
+ '400':
40613
+ description: Validation error.
40614
+ '403':
40615
+ description: Missing required permission `Ibl.CRM/Pipelines/write`.
40616
+ '404':
40617
+ description: Stage not found in this Pipeline.
40618
+ delete:
40619
+ operationId: pipelines_stages_destroy
40620
+ description: |-
40621
+ Deletes the PipelineStage. Fails with `409 Conflict` if any Deal still references it (FK is PROTECTed).
40622
+
40623
+ **Required permission:** `Ibl.CRM/Pipelines/delete`.
40624
+ summary: Delete a stage
40625
+ parameters:
40626
+ - in: path
40627
+ name: id
40628
+ schema:
40629
+ type: integer
40630
+ required: true
40631
+ - in: path
40632
+ name: pipeline_pk
40633
+ schema:
40634
+ type: integer
40635
+ required: true
40636
+ tags:
40637
+ - pipelines
40638
+ security:
40639
+ - PlatformApiKeyAuthentication: []
40640
+ responses:
40641
+ '204':
40642
+ description: Deleted.
40643
+ '403':
40644
+ description: Missing required permission `Ibl.CRM/Pipelines/delete`.
40645
+ '404':
40646
+ description: Stage not found in this Pipeline.
40647
+ '409':
40648
+ description: Stage still has Deals attached.
40649
+ /pipelines/{id}/:
40650
+ get:
40651
+ operationId: pipelines_retrieve
40652
+ description: |-
40653
+ Returns a single Pipeline by id, including its ordered `stages`.
40654
+
40655
+ **Required permission:** `Ibl.CRM/Pipelines/read`.
40656
+ summary: Retrieve a pipeline
40657
+ parameters:
40658
+ - in: path
40659
+ name: id
40660
+ schema:
40661
+ type: integer
40662
+ description: A unique integer value identifying this pipeline.
40663
+ required: true
40664
+ tags:
40665
+ - pipelines
40666
+ security:
40667
+ - PlatformApiKeyAuthentication: []
40668
+ responses:
40669
+ '200':
40670
+ content:
40671
+ application/json:
40672
+ schema:
40673
+ $ref: '#/components/schemas/Pipeline'
40674
+ description: ''
40675
+ '403':
40676
+ description: Missing required permission `Ibl.CRM/Pipelines/read`.
40677
+ '404':
40678
+ description: Pipeline not found.
40679
+ put:
40680
+ operationId: pipelines_update
40681
+ description: |-
40682
+ Replaces all editable fields on the Pipeline.
40683
+
40684
+ **Required permission:** `Ibl.CRM/Pipelines/write`.
40685
+ summary: Replace a pipeline
40686
+ parameters:
40687
+ - in: path
40688
+ name: id
40689
+ schema:
40690
+ type: integer
40691
+ description: A unique integer value identifying this pipeline.
40692
+ required: true
40693
+ tags:
40694
+ - pipelines
40695
+ requestBody:
40696
+ content:
40697
+ application/json:
40698
+ schema:
40699
+ $ref: '#/components/schemas/Pipeline'
40700
+ application/scim+json:
40701
+ schema:
40702
+ $ref: '#/components/schemas/Pipeline'
40703
+ application/x-www-form-urlencoded:
40704
+ schema:
40705
+ $ref: '#/components/schemas/Pipeline'
40706
+ multipart/form-data:
40707
+ schema:
40708
+ $ref: '#/components/schemas/Pipeline'
40709
+ '*/*':
40710
+ schema:
40711
+ $ref: '#/components/schemas/Pipeline'
40712
+ required: true
40713
+ security:
40714
+ - PlatformApiKeyAuthentication: []
40715
+ responses:
40716
+ '200':
40717
+ content:
40718
+ application/json:
40719
+ schema:
40720
+ $ref: '#/components/schemas/Pipeline'
40721
+ description: ''
40722
+ '400':
40723
+ description: Validation error.
40724
+ '403':
40725
+ description: Missing required permission `Ibl.CRM/Pipelines/write`.
40726
+ '404':
40727
+ description: Pipeline not found.
40728
+ patch:
40729
+ operationId: pipelines_partial_update
40730
+ description: |-
40731
+ Updates only the supplied fields on the Pipeline.
40732
+
40733
+ **Required permission:** `Ibl.CRM/Pipelines/write`.
40734
+ summary: Update a pipeline
40735
+ parameters:
40736
+ - in: path
40737
+ name: id
40738
+ schema:
40739
+ type: integer
40740
+ description: A unique integer value identifying this pipeline.
40741
+ required: true
40742
+ tags:
40743
+ - pipelines
40744
+ requestBody:
40745
+ content:
40746
+ application/json:
40747
+ schema:
40748
+ $ref: '#/components/schemas/PatchedPipeline'
40749
+ application/scim+json:
40750
+ schema:
40751
+ $ref: '#/components/schemas/PatchedPipeline'
40752
+ application/x-www-form-urlencoded:
40753
+ schema:
40754
+ $ref: '#/components/schemas/PatchedPipeline'
40755
+ multipart/form-data:
40756
+ schema:
40757
+ $ref: '#/components/schemas/PatchedPipeline'
40758
+ '*/*':
40759
+ schema:
40760
+ $ref: '#/components/schemas/PatchedPipeline'
40761
+ security:
40762
+ - PlatformApiKeyAuthentication: []
40763
+ responses:
40764
+ '200':
40765
+ content:
40766
+ application/json:
40767
+ schema:
40768
+ $ref: '#/components/schemas/Pipeline'
40769
+ description: ''
40770
+ '400':
40771
+ description: Validation error.
40772
+ '403':
40773
+ description: Missing required permission `Ibl.CRM/Pipelines/write`.
40774
+ '404':
40775
+ description: Pipeline not found.
40776
+ delete:
40777
+ operationId: pipelines_destroy
40778
+ description: |-
40779
+ Deletes the Pipeline. Fails with `409 Conflict` if any Deal still references it (FK is PROTECTed).
40780
+
40781
+ **Required permission:** `Ibl.CRM/Pipelines/delete`.
40782
+ summary: Delete a pipeline
40783
+ parameters:
40784
+ - in: path
40785
+ name: id
40786
+ schema:
40787
+ type: integer
40788
+ description: A unique integer value identifying this pipeline.
40789
+ required: true
40790
+ tags:
40791
+ - pipelines
40792
+ security:
40793
+ - PlatformApiKeyAuthentication: []
40794
+ responses:
40795
+ '204':
40796
+ description: Deleted.
40797
+ '403':
40798
+ description: Missing required permission `Ibl.CRM/Pipelines/delete`.
40799
+ '404':
40800
+ description: Pipeline not found.
40801
+ '409':
40802
+ description: Pipeline still has Deals attached.
37799
40803
  /platforms/{platform_key}/items/{item_type}/{item_id}/access-check/:
37800
40804
  get:
37801
40805
  operationId: platforms_items_access_check_retrieve
@@ -38998,6 +42002,113 @@ components:
38998
42002
  - course_id
38999
42003
  - name
39000
42004
  - user_count
42005
+ Activity:
42006
+ type: object
42007
+ properties:
42008
+ id:
42009
+ type: integer
42010
+ readOnly: true
42011
+ description: Server-assigned id.
42012
+ platform:
42013
+ type: integer
42014
+ readOnly: true
42015
+ description: Platform this Activity belongs to. Set automatically from your
42016
+ credentials; you cannot pass another Platform's id.
42017
+ title:
42018
+ type: string
42019
+ description: Short summary (e.g. 'Discovery call', 'Stage changed').
42020
+ maxLength: 255
42021
+ type:
42022
+ allOf:
42023
+ - $ref: '#/components/schemas/ActivityTypeEnum'
42024
+ description: |-
42025
+ Interaction kind. One of `call`, `meeting`, `email`, `note`, `task`, `lunch`, `deadline`.
42026
+
42027
+ * `call` - Call
42028
+ * `meeting` - Meeting
42029
+ * `email` - Email
42030
+ * `note` - Note
42031
+ * `task` - Task
42032
+ * `lunch` - Lunch
42033
+ * `deadline` - Deadline
42034
+ location:
42035
+ type: string
42036
+ default: ''
42037
+ description: Meeting location / call dial-in / venue.
42038
+ maxLength: 255
42039
+ comment:
42040
+ type: string
42041
+ default: ''
42042
+ description: Free-text notes.
42043
+ schedule_from:
42044
+ type: string
42045
+ format: date-time
42046
+ nullable: true
42047
+ description: Scheduled start. Leave null for instant log entries.
42048
+ schedule_to:
42049
+ type: string
42050
+ format: date-time
42051
+ nullable: true
42052
+ description: Scheduled end.
42053
+ is_done:
42054
+ type: boolean
42055
+ default: false
42056
+ description: Mark the Activity complete. Use `POST /activities/{id}/done/`
42057
+ to flip this and automatically stamp `done_at`.
42058
+ done_at:
42059
+ type: string
42060
+ format: date-time
42061
+ readOnly: true
42062
+ nullable: true
42063
+ description: Read-only. Set automatically the first time `is_done` flips
42064
+ True.
42065
+ deal:
42066
+ type: integer
42067
+ nullable: true
42068
+ description: Id of the Deal this Activity is logged against. Either `deal`
42069
+ or `person` is required.
42070
+ person:
42071
+ type: string
42072
+ format: uuid
42073
+ description: UUID of the Person this Activity is logged against. Either
42074
+ `deal` or `person` is required.
42075
+ nullable: true
42076
+ owner:
42077
+ type: integer
42078
+ description: Id of the user who scheduled / logged this Activity. Defaults
42079
+ to the calling user on create.
42080
+ nullable: true
42081
+ reminder_at:
42082
+ type: string
42083
+ format: date-time
42084
+ nullable: true
42085
+ description: When to remind the owner.
42086
+ reminder_sent:
42087
+ type: boolean
42088
+ readOnly: true
42089
+ description: Marks that a reminder has been sent for this Activity; prevents
42090
+ the same reminder from firing twice.
42091
+ metadata:
42092
+ description: Free-form JSON for Platform-defined attributes.
42093
+ created_at:
42094
+ type: string
42095
+ format: date-time
42096
+ readOnly: true
42097
+ description: Creation timestamp.
42098
+ updated_at:
42099
+ type: string
42100
+ format: date-time
42101
+ readOnly: true
42102
+ description: Last-modified timestamp.
42103
+ required:
42104
+ - created_at
42105
+ - done_at
42106
+ - id
42107
+ - platform
42108
+ - reminder_sent
42109
+ - title
42110
+ - type
42111
+ - updated_at
39001
42112
  ActivityAPI:
39002
42113
  type: object
39003
42114
  properties:
@@ -39066,6 +42177,24 @@ components:
39066
42177
  required:
39067
42178
  - first_activity
39068
42179
  - last_activity
42180
+ ActivityTypeEnum:
42181
+ enum:
42182
+ - call
42183
+ - meeting
42184
+ - email
42185
+ - note
42186
+ - task
42187
+ - lunch
42188
+ - deadline
42189
+ type: string
42190
+ description: |-
42191
+ * `call` - Call
42192
+ * `meeting` - Meeting
42193
+ * `email` - Email
42194
+ * `note` - Note
42195
+ * `task` - Task
42196
+ * `lunch` - Lunch
42197
+ * `deadline` - Deadline
39069
42198
  App:
39070
42199
  type: object
39071
42200
  properties:
@@ -41864,6 +44993,157 @@ components:
41864
44993
  * `completed` - Completed
41865
44994
  * `failed` - Failed
41866
44995
  * `cancelled` - Cancelled
44996
+ Deal:
44997
+ type: object
44998
+ properties:
44999
+ id:
45000
+ type: integer
45001
+ readOnly: true
45002
+ description: Server-assigned id.
45003
+ platform:
45004
+ type: integer
45005
+ readOnly: true
45006
+ description: Platform this Deal belongs to. Set automatically from your
45007
+ credentials; you cannot pass another Platform's id.
45008
+ title:
45009
+ type: string
45010
+ description: Short display name (e.g. 'Acme renewal — 2026').
45011
+ maxLength: 255
45012
+ description:
45013
+ type: string
45014
+ default: ''
45015
+ description: Free-text notes about scope, requirements, etc.
45016
+ lead_value:
45017
+ type: string
45018
+ format: decimal
45019
+ pattern: ^-?\d{0,12}(?:\.\d{0,2})?$
45020
+ default: '0.00'
45021
+ description: Estimated deal value in `currency`.
45022
+ currency:
45023
+ type: string
45024
+ default: USD
45025
+ description: ISO 4217 currency code.
45026
+ maxLength: 3
45027
+ status:
45028
+ allOf:
45029
+ - $ref: '#/components/schemas/DealStatusEnum'
45030
+ readOnly: true
45031
+ description: |-
45032
+ Read-only. Set by the move-stage/won/lost actions and derived from the destination stage's `is_won`/`is_lost`. Direct writes are rejected with `400`; use `POST /deals/{id}/move-stage/` (or `won/` / `lost/`).
45033
+
45034
+ * `open` - Open
45035
+ * `won` - Won
45036
+ * `lost` - Lost
45037
+ lost_reason:
45038
+ type: string
45039
+ default: ''
45040
+ description: Set on a `lost` transition (e.g. 'Chose competitor').
45041
+ maxLength: 255
45042
+ expected_close_date:
45043
+ type: string
45044
+ format: date
45045
+ nullable: true
45046
+ description: Forecasted close date — used by revenue projections.
45047
+ closed_at:
45048
+ type: string
45049
+ format: date-time
45050
+ readOnly: true
45051
+ nullable: true
45052
+ description: Read-only. Set automatically when the Deal enters a won/lost
45053
+ stage and cleared when it re-opens.
45054
+ person:
45055
+ type: string
45056
+ format: uuid
45057
+ description: UUID of the primary contact for this Deal. The person must
45058
+ belong to your Platform.
45059
+ organization:
45060
+ type: string
45061
+ format: uuid
45062
+ description: UUID of an organization the Deal is with. Optional; must belong
45063
+ to your Platform.
45064
+ nullable: true
45065
+ pipeline:
45066
+ type: integer
45067
+ description: Pipeline this Deal flows through. Must belong to your Platform.
45068
+ stage:
45069
+ type: integer
45070
+ description: Current PipelineStage. On create, must belong to `pipeline`.
45071
+ Use `POST /deals/{id}/move-stage/` to change after creation.
45072
+ source:
45073
+ type: integer
45074
+ nullable: true
45075
+ description: Where the Deal originated. Optional; must belong to your Platform.
45076
+ owner:
45077
+ type: integer
45078
+ description: Id of the platform user responsible for this Deal (sales rep).
45079
+ Defaults to the calling user on create.
45080
+ nullable: true
45081
+ metadata:
45082
+ description: Free-form JSON for Platform-defined attributes.
45083
+ created_at:
45084
+ type: string
45085
+ format: date-time
45086
+ readOnly: true
45087
+ description: Creation timestamp.
45088
+ updated_at:
45089
+ type: string
45090
+ format: date-time
45091
+ readOnly: true
45092
+ description: Last-modified timestamp.
45093
+ required:
45094
+ - closed_at
45095
+ - created_at
45096
+ - id
45097
+ - person
45098
+ - pipeline
45099
+ - platform
45100
+ - stage
45101
+ - status
45102
+ - title
45103
+ - updated_at
45104
+ DealLostRequest:
45105
+ type: object
45106
+ properties:
45107
+ lost_reason:
45108
+ type: string
45109
+ description: Free-text reason persisted on `Deal.lost_reason`.
45110
+ maxLength: 255
45111
+ stage_code:
45112
+ type: string
45113
+ description: Optional `code` of a specific `is_lost=True` stage to move
45114
+ to. When omitted, the first lost stage in the pipeline (by sort order)
45115
+ is used.
45116
+ required:
45117
+ - lost_reason
45118
+ DealMoveStageRequest:
45119
+ type: object
45120
+ properties:
45121
+ stage_id:
45122
+ type: integer
45123
+ description: Id of the destination PipelineStage. One of `stage_id` or `stage_code`
45124
+ is required.
45125
+ stage_code:
45126
+ type: string
45127
+ description: Stable `code` of the destination PipelineStage within this
45128
+ Deal's Pipeline. Use this when integrating across environments where ids
45129
+ differ but codes are stable.
45130
+ DealStatusEnum:
45131
+ enum:
45132
+ - open
45133
+ - won
45134
+ - lost
45135
+ type: string
45136
+ description: |-
45137
+ * `open` - Open
45138
+ * `won` - Won
45139
+ * `lost` - Lost
45140
+ DealWonRequest:
45141
+ type: object
45142
+ properties:
45143
+ stage_code:
45144
+ type: string
45145
+ description: Optional `code` of a specific `is_won=True` stage to move to.
45146
+ When omitted, the first won stage in the pipeline (by sort order) is used.
41867
45147
  DemographicsFieldDefinition:
41868
45148
  type: object
41869
45149
  properties:
@@ -43439,6 +46719,47 @@ components:
43439
46719
  required:
43440
46720
  - key
43441
46721
  - user_id
46722
+ LeadSource:
46723
+ type: object
46724
+ properties:
46725
+ id:
46726
+ type: integer
46727
+ readOnly: true
46728
+ description: Server-assigned id. Stable across renames.
46729
+ platform:
46730
+ type: integer
46731
+ readOnly: true
46732
+ description: Platform the LeadSource belongs to. Set automatically from
46733
+ your credentials; you cannot pass another Platform's id.
46734
+ name:
46735
+ type: string
46736
+ description: Display name shown to sales reps when categorizing a Deal.
46737
+ maxLength: 128
46738
+ code:
46739
+ type: string
46740
+ description: Stable slug used in API payloads and reports. Unique per Platform;
46741
+ lowercase letters, digits, and hyphens.
46742
+ maxLength: 64
46743
+ pattern: ^[-a-zA-Z0-9_]+$
46744
+ metadata:
46745
+ description: Free-form JSON for Platform-defined attributes.
46746
+ created_at:
46747
+ type: string
46748
+ format: date-time
46749
+ readOnly: true
46750
+ description: Creation timestamp.
46751
+ updated_at:
46752
+ type: string
46753
+ format: date-time
46754
+ readOnly: true
46755
+ description: Last-modified timestamp.
46756
+ required:
46757
+ - code
46758
+ - created_at
46759
+ - id
46760
+ - name
46761
+ - platform
46762
+ - updated_at
43442
46763
  LearnerAnalyticsResponse:
43443
46764
  type: object
43444
46765
  description: Unified response serializer for learner analytics endpoint.
@@ -44510,6 +47831,9 @@ components:
44510
47831
  * `COURSE_LICENSE_GROUP_ASSIGNMENT` - Course License Group Assignment
44511
47832
  * `COURSE_SCHEDULE_CHANGE` - Course Schedule Change
44512
47833
  * `COURSES_PROGRESS_SUMMARY` - Courses Progress Summary
47834
+ * `CRM_DEAL_STAGE_CHANGED` - Crm Deal Stage Changed
47835
+ * `CRM_PERSON_CREATED` - Crm Person Created
47836
+ * `CRM_PERSON_LINKED_TO_USER` - Crm Person Linked To User
44513
47837
  * `CUSTOM_NOTIFICATION` - Custom Notification
44514
47838
  * `DEFAULT_TEMPLATE` - Default Template
44515
47839
  * `HUMAN_SUPPORT_NOTIFICATION` - Human Support Notification
@@ -44534,7 +47858,7 @@ components:
44534
47858
  * `USER_NOTIF_USER_INACTIVITY` - User Notif User Inactivity
44535
47859
  * `USER_NOTIF_USER_REGISTRATION` - User Notif User Registration
44536
47860
  oneOf:
44537
- - $ref: '#/components/schemas/TypeD36Enum'
47861
+ - $ref: '#/components/schemas/Type4b7Enum'
44538
47862
  - $ref: '#/components/schemas/NullEnum'
44539
47863
  name:
44540
47864
  type: string
@@ -44724,6 +48048,32 @@ components:
44724
48048
  writeOnly: true
44725
48049
  description: 'Custom targets: user: {type, id}; user_group: {type, id};
44726
48050
  rbac_policy: {type, policy_name}'
48051
+ recipients_config:
48052
+ type: string
48053
+ readOnly: true
48054
+ description: Recipients config (recipient mode + optional custom targets)
48055
+ for notification types that opt into the generic recipients model (e.g.
48056
+ CRM_*). Null for types that do not.
48057
+ recipients_recipient_mode:
48058
+ allOf:
48059
+ - $ref: '#/components/schemas/RecipientsRecipientModeEnum'
48060
+ writeOnly: true
48061
+ description: |-
48062
+ Who receives this notification: 'platform_admins_only', 'object_owner_only' (falls back to admins), 'object_owner_only_strict' (no fallback), 'platform_admins_and_object_owner' (default), or 'custom'.
48063
+
48064
+ * `platform_admins_only` - platform_admins_only
48065
+ * `object_owner_only` - object_owner_only
48066
+ * `object_owner_only_strict` - object_owner_only_strict
48067
+ * `platform_admins_and_object_owner` - platform_admins_and_object_owner
48068
+ * `custom` - custom
48069
+ recipients_custom_recipients:
48070
+ type: array
48071
+ items:
48072
+ type: object
48073
+ additionalProperties: {}
48074
+ writeOnly: true
48075
+ description: 'Custom recipient targets (used when recipient_mode=''custom''):
48076
+ user: {type, id}; user_group: {type, id}; rbac_policy: {type, policy_name}.'
44727
48077
  new_content_config:
44728
48078
  type: string
44729
48079
  readOnly: true
@@ -44859,6 +48209,7 @@ components:
44859
48209
  - new_content_config
44860
48210
  - periodic_config
44861
48211
  - policy_config
48212
+ - recipients_config
44862
48213
  - schedule_change_config
44863
48214
  - skill_mastery_config
44864
48215
  - source_platform
@@ -44889,6 +48240,9 @@ components:
44889
48240
  * `COURSE_LICENSE_GROUP_ASSIGNMENT` - Course License Group Assignment
44890
48241
  * `COURSE_SCHEDULE_CHANGE` - Course Schedule Change
44891
48242
  * `COURSES_PROGRESS_SUMMARY` - Courses Progress Summary
48243
+ * `CRM_DEAL_STAGE_CHANGED` - Crm Deal Stage Changed
48244
+ * `CRM_PERSON_CREATED` - Crm Person Created
48245
+ * `CRM_PERSON_LINKED_TO_USER` - Crm Person Linked To User
44892
48246
  * `CUSTOM_NOTIFICATION` - Custom Notification
44893
48247
  * `DEFAULT_TEMPLATE` - Default Template
44894
48248
  * `HUMAN_SUPPORT_NOTIFICATION` - Human Support Notification
@@ -44913,7 +48267,7 @@ components:
44913
48267
  * `USER_NOTIF_USER_INACTIVITY` - User Notif User Inactivity
44914
48268
  * `USER_NOTIF_USER_REGISTRATION` - User Notif User Registration
44915
48269
  oneOf:
44916
- - $ref: '#/components/schemas/TypeD36Enum'
48270
+ - $ref: '#/components/schemas/Type4b7Enum'
44917
48271
  - $ref: '#/components/schemas/BlankEnum'
44918
48272
  - $ref: '#/components/schemas/NullEnum'
44919
48273
  name:
@@ -45081,8 +48435,8 @@ components:
45081
48435
  description: Free-form JSON address (street, city, country, etc.).
45082
48436
  owner:
45083
48437
  type: integer
45084
- description: platform `core.User` id of the internal owner / account manager.
45085
- Optional.
48438
+ description: Id of the Platform user who owns / manages this Organization.
48439
+ Must be an active member of your Platform.
45086
48440
  nullable: true
45087
48441
  metadata:
45088
48442
  description: Free-form JSON for Platform-defined attributes.
@@ -45205,6 +48559,29 @@ components:
45205
48559
  $ref: '#/components/schemas/OvertimeMeta'
45206
48560
  required:
45207
48561
  - meta
48562
+ PaginatedActivityList:
48563
+ type: object
48564
+ required:
48565
+ - count
48566
+ - results
48567
+ properties:
48568
+ count:
48569
+ type: integer
48570
+ example: 123
48571
+ next:
48572
+ type: string
48573
+ nullable: true
48574
+ format: uri
48575
+ example: http://api.example.org/accounts/?page=4
48576
+ previous:
48577
+ type: string
48578
+ nullable: true
48579
+ format: uri
48580
+ example: http://api.example.org/accounts/?page=2
48581
+ results:
48582
+ type: array
48583
+ items:
48584
+ $ref: '#/components/schemas/Activity'
45208
48585
  PaginatedAssertionsResponse:
45209
48586
  type: object
45210
48587
  description: |-
@@ -45432,6 +48809,29 @@ components:
45432
48809
  - next_page
45433
48810
  - previous_page
45434
48811
  - results
48812
+ PaginatedDealList:
48813
+ type: object
48814
+ required:
48815
+ - count
48816
+ - results
48817
+ properties:
48818
+ count:
48819
+ type: integer
48820
+ example: 123
48821
+ next:
48822
+ type: string
48823
+ nullable: true
48824
+ format: uri
48825
+ example: http://api.example.org/accounts/?page=4
48826
+ previous:
48827
+ type: string
48828
+ nullable: true
48829
+ format: uri
48830
+ example: http://api.example.org/accounts/?page=2
48831
+ results:
48832
+ type: array
48833
+ items:
48834
+ $ref: '#/components/schemas/Deal'
45435
48835
  PaginatedItemPaywallConfigList:
45436
48836
  type: object
45437
48837
  required:
@@ -45501,6 +48901,29 @@ components:
45501
48901
  type: array
45502
48902
  items:
45503
48903
  $ref: '#/components/schemas/ItemSubscriptionList'
48904
+ PaginatedLeadSourceList:
48905
+ type: object
48906
+ required:
48907
+ - count
48908
+ - results
48909
+ properties:
48910
+ count:
48911
+ type: integer
48912
+ example: 123
48913
+ next:
48914
+ type: string
48915
+ nullable: true
48916
+ format: uri
48917
+ example: http://api.example.org/accounts/?page=4
48918
+ previous:
48919
+ type: string
48920
+ nullable: true
48921
+ format: uri
48922
+ example: http://api.example.org/accounts/?page=2
48923
+ results:
48924
+ type: array
48925
+ items:
48926
+ $ref: '#/components/schemas/LeadSource'
45504
48927
  PaginatedOrganizationList:
45505
48928
  type: object
45506
48929
  required:
@@ -45601,6 +49024,52 @@ components:
45601
49024
  type: array
45602
49025
  items:
45603
49026
  $ref: '#/components/schemas/Person'
49027
+ PaginatedPipelineList:
49028
+ type: object
49029
+ required:
49030
+ - count
49031
+ - results
49032
+ properties:
49033
+ count:
49034
+ type: integer
49035
+ example: 123
49036
+ next:
49037
+ type: string
49038
+ nullable: true
49039
+ format: uri
49040
+ example: http://api.example.org/accounts/?page=4
49041
+ previous:
49042
+ type: string
49043
+ nullable: true
49044
+ format: uri
49045
+ example: http://api.example.org/accounts/?page=2
49046
+ results:
49047
+ type: array
49048
+ items:
49049
+ $ref: '#/components/schemas/Pipeline'
49050
+ PaginatedPipelineStageList:
49051
+ type: object
49052
+ required:
49053
+ - count
49054
+ - results
49055
+ properties:
49056
+ count:
49057
+ type: integer
49058
+ example: 123
49059
+ next:
49060
+ type: string
49061
+ nullable: true
49062
+ format: uri
49063
+ example: http://api.example.org/accounts/?page=4
49064
+ previous:
49065
+ type: string
49066
+ nullable: true
49067
+ format: uri
49068
+ example: http://api.example.org/accounts/?page=2
49069
+ results:
49070
+ type: array
49071
+ items:
49072
+ $ref: '#/components/schemas/PipelineStage'
45604
49073
  PaginatedPlatformInvitation:
45605
49074
  type: object
45606
49075
  description: Response serializer for paginated platform invitation list
@@ -46195,6 +49664,104 @@ components:
46195
49664
  - previous_page
46196
49665
  - total_pages
46197
49666
  - total_records
49667
+ PatchedActivity:
49668
+ type: object
49669
+ properties:
49670
+ id:
49671
+ type: integer
49672
+ readOnly: true
49673
+ description: Server-assigned id.
49674
+ platform:
49675
+ type: integer
49676
+ readOnly: true
49677
+ description: Platform this Activity belongs to. Set automatically from your
49678
+ credentials; you cannot pass another Platform's id.
49679
+ title:
49680
+ type: string
49681
+ description: Short summary (e.g. 'Discovery call', 'Stage changed').
49682
+ maxLength: 255
49683
+ type:
49684
+ allOf:
49685
+ - $ref: '#/components/schemas/ActivityTypeEnum'
49686
+ description: |-
49687
+ Interaction kind. One of `call`, `meeting`, `email`, `note`, `task`, `lunch`, `deadline`.
49688
+
49689
+ * `call` - Call
49690
+ * `meeting` - Meeting
49691
+ * `email` - Email
49692
+ * `note` - Note
49693
+ * `task` - Task
49694
+ * `lunch` - Lunch
49695
+ * `deadline` - Deadline
49696
+ location:
49697
+ type: string
49698
+ default: ''
49699
+ description: Meeting location / call dial-in / venue.
49700
+ maxLength: 255
49701
+ comment:
49702
+ type: string
49703
+ default: ''
49704
+ description: Free-text notes.
49705
+ schedule_from:
49706
+ type: string
49707
+ format: date-time
49708
+ nullable: true
49709
+ description: Scheduled start. Leave null for instant log entries.
49710
+ schedule_to:
49711
+ type: string
49712
+ format: date-time
49713
+ nullable: true
49714
+ description: Scheduled end.
49715
+ is_done:
49716
+ type: boolean
49717
+ default: false
49718
+ description: Mark the Activity complete. Use `POST /activities/{id}/done/`
49719
+ to flip this and automatically stamp `done_at`.
49720
+ done_at:
49721
+ type: string
49722
+ format: date-time
49723
+ readOnly: true
49724
+ nullable: true
49725
+ description: Read-only. Set automatically the first time `is_done` flips
49726
+ True.
49727
+ deal:
49728
+ type: integer
49729
+ nullable: true
49730
+ description: Id of the Deal this Activity is logged against. Either `deal`
49731
+ or `person` is required.
49732
+ person:
49733
+ type: string
49734
+ format: uuid
49735
+ description: UUID of the Person this Activity is logged against. Either
49736
+ `deal` or `person` is required.
49737
+ nullable: true
49738
+ owner:
49739
+ type: integer
49740
+ description: Id of the user who scheduled / logged this Activity. Defaults
49741
+ to the calling user on create.
49742
+ nullable: true
49743
+ reminder_at:
49744
+ type: string
49745
+ format: date-time
49746
+ nullable: true
49747
+ description: When to remind the owner.
49748
+ reminder_sent:
49749
+ type: boolean
49750
+ readOnly: true
49751
+ description: Marks that a reminder has been sent for this Activity; prevents
49752
+ the same reminder from firing twice.
49753
+ metadata:
49754
+ description: Free-form JSON for Platform-defined attributes.
49755
+ created_at:
49756
+ type: string
49757
+ format: date-time
49758
+ readOnly: true
49759
+ description: Creation timestamp.
49760
+ updated_at:
49761
+ type: string
49762
+ format: date-time
49763
+ readOnly: true
49764
+ description: Last-modified timestamp.
46198
49765
  PatchedCreditAccountAutoRechargeUpdate:
46199
49766
  type: object
46200
49767
  description: Partial update for CreditAccount auto-recharge fields.
@@ -46224,6 +49791,103 @@ components:
46224
49791
  readOnly: true
46225
49792
  description: The platform key to update settings for (read-only in update
46226
49793
  context).
49794
+ PatchedDeal:
49795
+ type: object
49796
+ properties:
49797
+ id:
49798
+ type: integer
49799
+ readOnly: true
49800
+ description: Server-assigned id.
49801
+ platform:
49802
+ type: integer
49803
+ readOnly: true
49804
+ description: Platform this Deal belongs to. Set automatically from your
49805
+ credentials; you cannot pass another Platform's id.
49806
+ title:
49807
+ type: string
49808
+ description: Short display name (e.g. 'Acme renewal — 2026').
49809
+ maxLength: 255
49810
+ description:
49811
+ type: string
49812
+ default: ''
49813
+ description: Free-text notes about scope, requirements, etc.
49814
+ lead_value:
49815
+ type: string
49816
+ format: decimal
49817
+ pattern: ^-?\d{0,12}(?:\.\d{0,2})?$
49818
+ default: '0.00'
49819
+ description: Estimated deal value in `currency`.
49820
+ currency:
49821
+ type: string
49822
+ default: USD
49823
+ description: ISO 4217 currency code.
49824
+ maxLength: 3
49825
+ status:
49826
+ allOf:
49827
+ - $ref: '#/components/schemas/DealStatusEnum'
49828
+ readOnly: true
49829
+ description: |-
49830
+ Read-only. Set by the move-stage/won/lost actions and derived from the destination stage's `is_won`/`is_lost`. Direct writes are rejected with `400`; use `POST /deals/{id}/move-stage/` (or `won/` / `lost/`).
49831
+
49832
+ * `open` - Open
49833
+ * `won` - Won
49834
+ * `lost` - Lost
49835
+ lost_reason:
49836
+ type: string
49837
+ default: ''
49838
+ description: Set on a `lost` transition (e.g. 'Chose competitor').
49839
+ maxLength: 255
49840
+ expected_close_date:
49841
+ type: string
49842
+ format: date
49843
+ nullable: true
49844
+ description: Forecasted close date — used by revenue projections.
49845
+ closed_at:
49846
+ type: string
49847
+ format: date-time
49848
+ readOnly: true
49849
+ nullable: true
49850
+ description: Read-only. Set automatically when the Deal enters a won/lost
49851
+ stage and cleared when it re-opens.
49852
+ person:
49853
+ type: string
49854
+ format: uuid
49855
+ description: UUID of the primary contact for this Deal. The person must
49856
+ belong to your Platform.
49857
+ organization:
49858
+ type: string
49859
+ format: uuid
49860
+ description: UUID of an organization the Deal is with. Optional; must belong
49861
+ to your Platform.
49862
+ nullable: true
49863
+ pipeline:
49864
+ type: integer
49865
+ description: Pipeline this Deal flows through. Must belong to your Platform.
49866
+ stage:
49867
+ type: integer
49868
+ description: Current PipelineStage. On create, must belong to `pipeline`.
49869
+ Use `POST /deals/{id}/move-stage/` to change after creation.
49870
+ source:
49871
+ type: integer
49872
+ nullable: true
49873
+ description: Where the Deal originated. Optional; must belong to your Platform.
49874
+ owner:
49875
+ type: integer
49876
+ description: Id of the platform user responsible for this Deal (sales rep).
49877
+ Defaults to the calling user on create.
49878
+ nullable: true
49879
+ metadata:
49880
+ description: Free-form JSON for Platform-defined attributes.
49881
+ created_at:
49882
+ type: string
49883
+ format: date-time
49884
+ readOnly: true
49885
+ description: Creation timestamp.
49886
+ updated_at:
49887
+ type: string
49888
+ format: date-time
49889
+ readOnly: true
49890
+ description: Last-modified timestamp.
46227
49891
  PatchedDemographicsFieldDefinitionWrite:
46228
49892
  type: object
46229
49893
  properties:
@@ -46264,6 +49928,40 @@ components:
46264
49928
  description:
46265
49929
  type: string
46266
49930
  description: Optional description or instructions shown alongside the field.
49931
+ PatchedLeadSource:
49932
+ type: object
49933
+ properties:
49934
+ id:
49935
+ type: integer
49936
+ readOnly: true
49937
+ description: Server-assigned id. Stable across renames.
49938
+ platform:
49939
+ type: integer
49940
+ readOnly: true
49941
+ description: Platform the LeadSource belongs to. Set automatically from
49942
+ your credentials; you cannot pass another Platform's id.
49943
+ name:
49944
+ type: string
49945
+ description: Display name shown to sales reps when categorizing a Deal.
49946
+ maxLength: 128
49947
+ code:
49948
+ type: string
49949
+ description: Stable slug used in API payloads and reports. Unique per Platform;
49950
+ lowercase letters, digits, and hyphens.
49951
+ maxLength: 64
49952
+ pattern: ^[-a-zA-Z0-9_]+$
49953
+ metadata:
49954
+ description: Free-form JSON for Platform-defined attributes.
49955
+ created_at:
49956
+ type: string
49957
+ format: date-time
49958
+ readOnly: true
49959
+ description: Creation timestamp.
49960
+ updated_at:
49961
+ type: string
49962
+ format: date-time
49963
+ readOnly: true
49964
+ description: Last-modified timestamp.
46267
49965
  PatchedMediaResource:
46268
49966
  type: object
46269
49967
  properties:
@@ -46415,6 +50113,9 @@ components:
46415
50113
  * `COURSE_LICENSE_GROUP_ASSIGNMENT` - Course License Group Assignment
46416
50114
  * `COURSE_SCHEDULE_CHANGE` - Course Schedule Change
46417
50115
  * `COURSES_PROGRESS_SUMMARY` - Courses Progress Summary
50116
+ * `CRM_DEAL_STAGE_CHANGED` - Crm Deal Stage Changed
50117
+ * `CRM_PERSON_CREATED` - Crm Person Created
50118
+ * `CRM_PERSON_LINKED_TO_USER` - Crm Person Linked To User
46418
50119
  * `CUSTOM_NOTIFICATION` - Custom Notification
46419
50120
  * `DEFAULT_TEMPLATE` - Default Template
46420
50121
  * `HUMAN_SUPPORT_NOTIFICATION` - Human Support Notification
@@ -46439,7 +50140,7 @@ components:
46439
50140
  * `USER_NOTIF_USER_INACTIVITY` - User Notif User Inactivity
46440
50141
  * `USER_NOTIF_USER_REGISTRATION` - User Notif User Registration
46441
50142
  oneOf:
46442
- - $ref: '#/components/schemas/TypeD36Enum'
50143
+ - $ref: '#/components/schemas/Type4b7Enum'
46443
50144
  - $ref: '#/components/schemas/NullEnum'
46444
50145
  name:
46445
50146
  type: string
@@ -46629,6 +50330,32 @@ components:
46629
50330
  writeOnly: true
46630
50331
  description: 'Custom targets: user: {type, id}; user_group: {type, id};
46631
50332
  rbac_policy: {type, policy_name}'
50333
+ recipients_config:
50334
+ type: string
50335
+ readOnly: true
50336
+ description: Recipients config (recipient mode + optional custom targets)
50337
+ for notification types that opt into the generic recipients model (e.g.
50338
+ CRM_*). Null for types that do not.
50339
+ recipients_recipient_mode:
50340
+ allOf:
50341
+ - $ref: '#/components/schemas/RecipientsRecipientModeEnum'
50342
+ writeOnly: true
50343
+ description: |-
50344
+ Who receives this notification: 'platform_admins_only', 'object_owner_only' (falls back to admins), 'object_owner_only_strict' (no fallback), 'platform_admins_and_object_owner' (default), or 'custom'.
50345
+
50346
+ * `platform_admins_only` - platform_admins_only
50347
+ * `object_owner_only` - object_owner_only
50348
+ * `object_owner_only_strict` - object_owner_only_strict
50349
+ * `platform_admins_and_object_owner` - platform_admins_and_object_owner
50350
+ * `custom` - custom
50351
+ recipients_custom_recipients:
50352
+ type: array
50353
+ items:
50354
+ type: object
50355
+ additionalProperties: {}
50356
+ writeOnly: true
50357
+ description: 'Custom recipient targets (used when recipient_mode=''custom''):
50358
+ user: {type, id}; user_group: {type, id}; rbac_policy: {type, policy_name}.'
46632
50359
  new_content_config:
46633
50360
  type: string
46634
50361
  readOnly: true
@@ -46786,8 +50513,8 @@ components:
46786
50513
  description: Free-form JSON address (street, city, country, etc.).
46787
50514
  owner:
46788
50515
  type: integer
46789
- description: platform `core.User` id of the internal owner / account manager.
46790
- Optional.
50516
+ description: Id of the Platform user who owns / manages this Organization.
50517
+ Must be an active member of your Platform.
46791
50518
  nullable: true
46792
50519
  metadata:
46793
50520
  description: Free-form JSON for Platform-defined attributes.
@@ -46887,6 +50614,101 @@ components:
46887
50614
  format: date-time
46888
50615
  readOnly: true
46889
50616
  description: Last-modified timestamp.
50617
+ PatchedPipeline:
50618
+ type: object
50619
+ properties:
50620
+ id:
50621
+ type: integer
50622
+ readOnly: true
50623
+ description: Server-assigned id.
50624
+ platform:
50625
+ type: integer
50626
+ readOnly: true
50627
+ description: Platform this Pipeline belongs to. Set automatically from your
50628
+ credentials; you cannot pass another Platform's id.
50629
+ name:
50630
+ type: string
50631
+ description: Display name (e.g. 'B2B Sales', 'Renewals').
50632
+ maxLength: 255
50633
+ code:
50634
+ type: string
50635
+ description: Stable slug used in API payloads. Unique per Platform; lowercase
50636
+ letters, digits, and hyphens.
50637
+ maxLength: 64
50638
+ pattern: ^[-a-zA-Z0-9_]+$
50639
+ is_default:
50640
+ type: boolean
50641
+ default: false
50642
+ description: Mark this as the default Pipeline new Deals land in when none
50643
+ is specified. At most one default per Platform — promoting a new default
50644
+ requires un-flagging the old one in the same call set.
50645
+ rotten_days:
50646
+ type: integer
50647
+ default: 30
50648
+ description: Days a Deal can sit in a stage before it's surfaced as stale.
50649
+ stages:
50650
+ type: array
50651
+ items:
50652
+ $ref: '#/components/schemas/PipelineStage'
50653
+ readOnly: true
50654
+ metadata:
50655
+ description: Free-form JSON for Platform-defined attributes.
50656
+ created_at:
50657
+ type: string
50658
+ format: date-time
50659
+ readOnly: true
50660
+ updated_at:
50661
+ type: string
50662
+ format: date-time
50663
+ readOnly: true
50664
+ PatchedPipelineStage:
50665
+ type: object
50666
+ properties:
50667
+ id:
50668
+ type: integer
50669
+ readOnly: true
50670
+ description: Server-assigned id.
50671
+ pipeline:
50672
+ type: integer
50673
+ readOnly: true
50674
+ description: Pipeline this stage belongs to. Set automatically from the
50675
+ URL path; you cannot move a stage between Pipelines.
50676
+ code:
50677
+ type: string
50678
+ description: Stable identifier referenced by `Deal.stage` payloads. Unique
50679
+ within the Pipeline.
50680
+ maxLength: 64
50681
+ pattern: ^[-a-zA-Z0-9_]+$
50682
+ name:
50683
+ type: string
50684
+ description: Display name shown on Kanban boards.
50685
+ maxLength: 255
50686
+ probability:
50687
+ type: integer
50688
+ default: 0
50689
+ description: Win likelihood at this stage (0–100). Used for revenue forecasting.
50690
+ sort_order:
50691
+ type: integer
50692
+ default: 0
50693
+ description: Left-to-right position on the Kanban board.
50694
+ is_won:
50695
+ type: boolean
50696
+ default: false
50697
+ description: Closed-won terminal stage. Moving a Deal here sets `Deal.status='won'`.
50698
+ is_lost:
50699
+ type: boolean
50700
+ default: false
50701
+ description: Closed-lost terminal stage. Moving a Deal here sets `Deal.status='lost'`.
50702
+ metadata:
50703
+ description: Free-form JSON for Platform-defined attributes.
50704
+ created_at:
50705
+ type: string
50706
+ format: date-time
50707
+ readOnly: true
50708
+ updated_at:
50709
+ type: string
50710
+ format: date-time
50711
+ readOnly: true
46890
50712
  PatchedPlatformPublicImageAsset:
46891
50713
  type: object
46892
50714
  properties:
@@ -48346,6 +52168,116 @@ components:
48346
52168
  - merged_ids
48347
52169
  - primary_id
48348
52170
  - reparented
52171
+ Pipeline:
52172
+ type: object
52173
+ properties:
52174
+ id:
52175
+ type: integer
52176
+ readOnly: true
52177
+ description: Server-assigned id.
52178
+ platform:
52179
+ type: integer
52180
+ readOnly: true
52181
+ description: Platform this Pipeline belongs to. Set automatically from your
52182
+ credentials; you cannot pass another Platform's id.
52183
+ name:
52184
+ type: string
52185
+ description: Display name (e.g. 'B2B Sales', 'Renewals').
52186
+ maxLength: 255
52187
+ code:
52188
+ type: string
52189
+ description: Stable slug used in API payloads. Unique per Platform; lowercase
52190
+ letters, digits, and hyphens.
52191
+ maxLength: 64
52192
+ pattern: ^[-a-zA-Z0-9_]+$
52193
+ is_default:
52194
+ type: boolean
52195
+ default: false
52196
+ description: Mark this as the default Pipeline new Deals land in when none
52197
+ is specified. At most one default per Platform — promoting a new default
52198
+ requires un-flagging the old one in the same call set.
52199
+ rotten_days:
52200
+ type: integer
52201
+ default: 30
52202
+ description: Days a Deal can sit in a stage before it's surfaced as stale.
52203
+ stages:
52204
+ type: array
52205
+ items:
52206
+ $ref: '#/components/schemas/PipelineStage'
52207
+ readOnly: true
52208
+ metadata:
52209
+ description: Free-form JSON for Platform-defined attributes.
52210
+ created_at:
52211
+ type: string
52212
+ format: date-time
52213
+ readOnly: true
52214
+ updated_at:
52215
+ type: string
52216
+ format: date-time
52217
+ readOnly: true
52218
+ required:
52219
+ - code
52220
+ - created_at
52221
+ - id
52222
+ - name
52223
+ - platform
52224
+ - stages
52225
+ - updated_at
52226
+ PipelineStage:
52227
+ type: object
52228
+ properties:
52229
+ id:
52230
+ type: integer
52231
+ readOnly: true
52232
+ description: Server-assigned id.
52233
+ pipeline:
52234
+ type: integer
52235
+ readOnly: true
52236
+ description: Pipeline this stage belongs to. Set automatically from the
52237
+ URL path; you cannot move a stage between Pipelines.
52238
+ code:
52239
+ type: string
52240
+ description: Stable identifier referenced by `Deal.stage` payloads. Unique
52241
+ within the Pipeline.
52242
+ maxLength: 64
52243
+ pattern: ^[-a-zA-Z0-9_]+$
52244
+ name:
52245
+ type: string
52246
+ description: Display name shown on Kanban boards.
52247
+ maxLength: 255
52248
+ probability:
52249
+ type: integer
52250
+ default: 0
52251
+ description: Win likelihood at this stage (0–100). Used for revenue forecasting.
52252
+ sort_order:
52253
+ type: integer
52254
+ default: 0
52255
+ description: Left-to-right position on the Kanban board.
52256
+ is_won:
52257
+ type: boolean
52258
+ default: false
52259
+ description: Closed-won terminal stage. Moving a Deal here sets `Deal.status='won'`.
52260
+ is_lost:
52261
+ type: boolean
52262
+ default: false
52263
+ description: Closed-lost terminal stage. Moving a Deal here sets `Deal.status='lost'`.
52264
+ metadata:
52265
+ description: Free-form JSON for Platform-defined attributes.
52266
+ created_at:
52267
+ type: string
52268
+ format: date-time
52269
+ readOnly: true
52270
+ updated_at:
52271
+ type: string
52272
+ format: date-time
52273
+ readOnly: true
52274
+ required:
52275
+ - code
52276
+ - created_at
52277
+ - id
52278
+ - name
52279
+ - pipeline
52280
+ - updated_at
48349
52281
  Platform:
48350
52282
  type: object
48351
52283
  description: 'Note: Create and update operations deprecated.'
@@ -51051,6 +54983,20 @@ components:
51051
54983
  required:
51052
54984
  - email
51053
54985
  - username
54986
+ RecipientsRecipientModeEnum:
54987
+ enum:
54988
+ - platform_admins_only
54989
+ - object_owner_only
54990
+ - object_owner_only_strict
54991
+ - platform_admins_and_object_owner
54992
+ - custom
54993
+ type: string
54994
+ description: |-
54995
+ * `platform_admins_only` - platform_admins_only
54996
+ * `object_owner_only` - object_owner_only
54997
+ * `object_owner_only_strict` - object_owner_only_strict
54998
+ * `platform_admins_and_object_owner` - platform_admins_and_object_owner
54999
+ * `custom` - custom
51054
55000
  RecommendationSearchAPI:
51055
55001
  type: object
51056
55002
  properties:
@@ -53055,7 +57001,7 @@ components:
53055
57001
  * `release` - Release Reserved Credits
53056
57002
  * `rollover` - Rollover Credits
53057
57003
  * `refund` - Refund Credits
53058
- TypeD36Enum:
57004
+ Type4b7Enum:
53059
57005
  enum:
53060
57006
  - ACTIVITY_COURSE_MILESTONE
53061
57007
  - ACTIVITY_NEW_CONTENT
@@ -53066,6 +57012,9 @@ components:
53066
57012
  - COURSE_LICENSE_GROUP_ASSIGNMENT
53067
57013
  - COURSE_SCHEDULE_CHANGE
53068
57014
  - COURSES_PROGRESS_SUMMARY
57015
+ - CRM_DEAL_STAGE_CHANGED
57016
+ - CRM_PERSON_CREATED
57017
+ - CRM_PERSON_LINKED_TO_USER
53069
57018
  - CUSTOM_NOTIFICATION
53070
57019
  - DEFAULT_TEMPLATE
53071
57020
  - HUMAN_SUPPORT_NOTIFICATION
@@ -53100,6 +57049,9 @@ components:
53100
57049
  * `COURSE_LICENSE_GROUP_ASSIGNMENT` - Course License Group Assignment
53101
57050
  * `COURSE_SCHEDULE_CHANGE` - Course Schedule Change
53102
57051
  * `COURSES_PROGRESS_SUMMARY` - Courses Progress Summary
57052
+ * `CRM_DEAL_STAGE_CHANGED` - Crm Deal Stage Changed
57053
+ * `CRM_PERSON_CREATED` - Crm Person Created
57054
+ * `CRM_PERSON_LINKED_TO_USER` - Crm Person Linked To User
53103
57055
  * `CUSTOM_NOTIFICATION` - Custom Notification
53104
57056
  * `DEFAULT_TEMPLATE` - Default Template
53105
57057
  * `HUMAN_SUPPORT_NOTIFICATION` - Human Support Notification