@livespace/api 0.0.0-stage → 0.1.1

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.
@@ -0,0 +1,2389 @@
1
+ import type { UserApiCallOptions } from "../options.js";
2
+ import type * as T from "./types.js";
3
+ /**
4
+ * The User API: v2's resources, as the viewing user. Each call goes through the `invoke` the façade was built with: from a plugin, a message to its host; from a Livespace micro-app, a request.
5
+ */
6
+ export interface UserApi {
7
+ users: UserApiUsers;
8
+ emails: UserApiEmails;
9
+ people: UserApiPeople;
10
+ companies: UserApiCompanies;
11
+ deals: UserApiDeals;
12
+ notes: UserApiNotes;
13
+ calls: UserApiCalls;
14
+ notifications: UserApiNotifications;
15
+ dictionaries: UserApiDictionaries;
16
+ relations: UserApiRelations;
17
+ salesProcesses: UserApiSalesProcesses;
18
+ tasks: UserApiTasks;
19
+ products: UserApiProducts;
20
+ metadata: UserApiMetadata;
21
+ productGroups: UserApiProductGroups;
22
+ costs: UserApiCosts;
23
+ costGroups: UserApiCostGroups;
24
+ /**
25
+ * Searches people, companies, deals, notes, spaces and users
26
+ *
27
+ * Searches people, companies, deals, notes, spaces and users by a phrase, ordered by relevance. Only the types the key may read are searched, and spaces and users come with any of the four read scopes.
28
+ *
29
+ * Needs one of the scopes: `crm:person:read`, `crm:company:read`, `crm:deal:read`, `crm:note:read`.
30
+ */
31
+ search(query: {
32
+ /**
33
+ * The search phrase, 2 to 100 characters after normalization. Matching is by prefix and ignores accents.
34
+ */
35
+ q: string;
36
+ /**
37
+ * Comma-separated types to search; `system` is not one of them. Left out, every type the key may read is searched, with `space` and `user`.
38
+ */
39
+ types?: ("person" | "company" | "deal" | "note" | "space" | "user")[];
40
+ /**
41
+ * Page number, 1-based. Default 1, maximum 200; a larger value is refused, never clamped.
42
+ */
43
+ page?: number;
44
+ /**
45
+ * Page size. Default 50, maximum 50; a larger value is refused, never clamped.
46
+ */
47
+ perPage?: number;
48
+ }, options?: UserApiCallOptions): Promise<T.SearchListEnvelope>;
49
+ }
50
+ export interface UserApiCostGroups {
51
+ members: UserApiCostGroupsMembers;
52
+ /**
53
+ * Lists cost groups
54
+ *
55
+ * Lists every cost group, empty groups included, ordered by `name` and then id.
56
+ *
57
+ * Needs one of the scopes: `crm:cost-catalog:read`.
58
+ */
59
+ list(query?: {
60
+ /**
61
+ * Page number, 1-based. Default 1, maximum 10000.
62
+ */
63
+ page?: number;
64
+ /**
65
+ * Page size. Default 100, maximum 500; a larger value is refused, never clamped.
66
+ */
67
+ perPage?: number;
68
+ }, options?: UserApiCallOptions): Promise<T.CatalogGroupListEnvelope>;
69
+ /**
70
+ * Creates a cost group
71
+ *
72
+ * Creates a cost group; the name is trimmed and need not be unique.
73
+ *
74
+ * Needs one of the scopes: `crm:cost-catalog:write`.
75
+ */
76
+ create(body: T.CreateCatalogGroupRequest, options?: UserApiCallOptions): Promise<T.CatalogGroupEnvelope>;
77
+ /**
78
+ * Returns one cost group
79
+ *
80
+ * Returns the cost group; a product group id answers `404`.
81
+ *
82
+ * Needs one of the scopes: `crm:cost-catalog:read`.
83
+ *
84
+ * @param id The cost group's id, 8-4-4-4-12 hexadecimal.
85
+ */
86
+ get(id: T.PublicId, options?: UserApiCallOptions): Promise<T.CatalogGroupEnvelope>;
87
+ /**
88
+ * Renames a cost group
89
+ *
90
+ * Renames the cost group, which changes the name every deal line and entry shows; an empty body changes nothing.
91
+ *
92
+ * Needs one of the scopes: `crm:cost-catalog:write`.
93
+ *
94
+ * @param id The cost group's id, 8-4-4-4-12 hexadecimal; a product group id answers `404`.
95
+ */
96
+ update(id: T.PublicId, body: T.UpdateCatalogGroupRequest, options?: UserApiCallOptions): Promise<T.CatalogGroupEnvelope>;
97
+ /**
98
+ * Deletes a cost group
99
+ *
100
+ * Deletes the cost group and first ungroups every entry in it, which moves the `updatedAt` of its active entries; a group with members is never refused.
101
+ *
102
+ * Needs one of the scopes: `crm:cost-catalog:delete`.
103
+ *
104
+ * @param id The cost group's id, 8-4-4-4-12 hexadecimal; a product group id answers `404`.
105
+ */
106
+ delete(id: T.PublicId, options?: UserApiCallOptions): Promise<void>;
107
+ }
108
+ export interface UserApiCostGroupsMembers {
109
+ /**
110
+ * Lists the costs of one cost group
111
+ *
112
+ * Lists the costs in the cost group by `name`, entries without a name last, then id, as `POST /costs/searches` with `group.id eq {id}` and `name asc` would. A product group id answers `404`.
113
+ *
114
+ * Needs one of the scopes: `crm:cost-catalog:read`.
115
+ *
116
+ * @param id The cost group's id, 8-4-4-4-12 hexadecimal.
117
+ */
118
+ list(id: T.PublicId, query?: {
119
+ /**
120
+ * Page number, 1-based. Default 1, maximum 10000.
121
+ */
122
+ page?: number;
123
+ /**
124
+ * Page size. Default 100, maximum 500; a larger value is refused, never clamped.
125
+ */
126
+ perPage?: number;
127
+ }, options?: UserApiCallOptions): Promise<T.CostListEnvelope>;
128
+ /**
129
+ * Moves costs into a cost group
130
+ *
131
+ * Moves every listed cost into the cost group, all or nothing, out of its previous group; a cost already there is not written, so a repeat changes nothing.
132
+ *
133
+ * Needs one of the scopes: `crm:cost-catalog:write`.
134
+ *
135
+ * @param id The cost group's id, 8-4-4-4-12 hexadecimal; a product group id answers `404`.
136
+ */
137
+ add(id: T.PublicId, body: T.MoveCatalogGroupMembersRequest, options?: UserApiCallOptions): Promise<void>;
138
+ }
139
+ export interface UserApiCosts {
140
+ /**
141
+ * Creates a cost
142
+ *
143
+ * Creates a cost in the cost catalog.
144
+ *
145
+ * Needs one of the scopes: `crm:cost-catalog:write`.
146
+ */
147
+ create(body: T.CreateCostRequest, options?: UserApiCallOptions): Promise<T.CostEnvelope>;
148
+ /**
149
+ * Searches costs
150
+ *
151
+ * Lists the costs that match a filter, sorted (by default `name asc`, entries without a name last) and paged, each as `GET /costs/{id}` returns it. The cost search has no `sku` field.
152
+ *
153
+ * Needs one of the scopes: `crm:cost-catalog:read`.
154
+ */
155
+ search(body: T.SearchCostsRequest, options?: UserApiCallOptions): Promise<T.CostSearchEnvelope>;
156
+ /**
157
+ * Returns one cost
158
+ *
159
+ * Returns the cost. A cost in a product group shows `group: null`.
160
+ *
161
+ * Needs one of the scopes: `crm:cost-catalog:read`.
162
+ *
163
+ * @param id The cost's id, 8-4-4-4-12 hexadecimal.
164
+ */
165
+ get(id: T.PublicId, options?: UserApiCallOptions): Promise<T.CostEnvelope>;
166
+ /**
167
+ * Updates a cost
168
+ *
169
+ * Updates the keys the body carries; an empty body changes nothing, and a key sent with its current value still moves `updatedAt`.
170
+ *
171
+ * Needs one of the scopes: `crm:cost-catalog:write`.
172
+ *
173
+ * @param id The cost's id, 8-4-4-4-12 hexadecimal; a product id answers `404`.
174
+ */
175
+ update(id: T.PublicId, body: T.UpdateCostRequest, options?: UserApiCallOptions): Promise<T.CostEnvelope>;
176
+ /**
177
+ * Deletes a cost
178
+ *
179
+ * Deletes the cost; deal lines that name it keep it.
180
+ *
181
+ * Needs one of the scopes: `crm:cost-catalog:delete`.
182
+ *
183
+ * @param id The cost's id, 8-4-4-4-12 hexadecimal; a product id answers `404`.
184
+ */
185
+ delete(id: T.PublicId, options?: UserApiCallOptions): Promise<void>;
186
+ }
187
+ export interface UserApiProductGroups {
188
+ members: UserApiProductGroupsMembers;
189
+ /**
190
+ * Lists product groups
191
+ *
192
+ * Lists every product group, empty groups included, ordered by `name` and then id.
193
+ *
194
+ * Needs one of the scopes: `crm:product-catalog:read`.
195
+ */
196
+ list(query?: {
197
+ /**
198
+ * Page number, 1-based. Default 1, maximum 10000.
199
+ */
200
+ page?: number;
201
+ /**
202
+ * Page size. Default 100, maximum 500; a larger value is refused, never clamped.
203
+ */
204
+ perPage?: number;
205
+ }, options?: UserApiCallOptions): Promise<T.CatalogGroupListEnvelope>;
206
+ /**
207
+ * Creates a product group
208
+ *
209
+ * Creates a product group; the name is trimmed and need not be unique.
210
+ *
211
+ * Needs one of the scopes: `crm:product-catalog:write`.
212
+ */
213
+ create(body: T.CreateCatalogGroupRequest, options?: UserApiCallOptions): Promise<T.CatalogGroupEnvelope>;
214
+ /**
215
+ * Returns one product group
216
+ *
217
+ * Returns the product group; a cost group id answers `404`.
218
+ *
219
+ * Needs one of the scopes: `crm:product-catalog:read`.
220
+ *
221
+ * @param id The product group's id, 8-4-4-4-12 hexadecimal.
222
+ */
223
+ get(id: T.PublicId, options?: UserApiCallOptions): Promise<T.CatalogGroupEnvelope>;
224
+ /**
225
+ * Renames a product group
226
+ *
227
+ * Renames the product group, which changes the name every deal line and entry shows; an empty body changes nothing.
228
+ *
229
+ * Needs one of the scopes: `crm:product-catalog:write`.
230
+ *
231
+ * @param id The product group's id, 8-4-4-4-12 hexadecimal; a cost group id answers `404`.
232
+ */
233
+ update(id: T.PublicId, body: T.UpdateCatalogGroupRequest, options?: UserApiCallOptions): Promise<T.CatalogGroupEnvelope>;
234
+ /**
235
+ * Deletes a product group
236
+ *
237
+ * Deletes the product group and first ungroups every entry in it, which moves the `updatedAt` of its active entries; a group with members is never refused.
238
+ *
239
+ * Needs one of the scopes: `crm:product-catalog:delete`.
240
+ *
241
+ * @param id The product group's id, 8-4-4-4-12 hexadecimal; a cost group id answers `404`.
242
+ */
243
+ delete(id: T.PublicId, options?: UserApiCallOptions): Promise<void>;
244
+ }
245
+ export interface UserApiProductGroupsMembers {
246
+ /**
247
+ * Lists the products of one product group
248
+ *
249
+ * Lists the products in the product group by `name`, entries without a name last, then id, as `POST /products/searches` with `group.id eq {id}` and `name asc` would. A cost group id answers `404`.
250
+ *
251
+ * Needs one of the scopes: `crm:product-catalog:read`.
252
+ *
253
+ * @param id The product group's id, 8-4-4-4-12 hexadecimal.
254
+ */
255
+ list(id: T.PublicId, query?: {
256
+ /**
257
+ * Page number, 1-based. Default 1, maximum 10000.
258
+ */
259
+ page?: number;
260
+ /**
261
+ * Page size. Default 100, maximum 500; a larger value is refused, never clamped.
262
+ */
263
+ perPage?: number;
264
+ }, options?: UserApiCallOptions): Promise<T.ProductListEnvelope>;
265
+ /**
266
+ * Moves products into a product group
267
+ *
268
+ * Moves every listed product into the product group, all or nothing, out of its previous group; a product already there is not written, so a repeat changes nothing.
269
+ *
270
+ * Needs one of the scopes: `crm:product-catalog:write`.
271
+ *
272
+ * @param id The product group's id, 8-4-4-4-12 hexadecimal; a cost group id answers `404`.
273
+ */
274
+ add(id: T.PublicId, body: T.MoveCatalogGroupMembersRequest, options?: UserApiCallOptions): Promise<void>;
275
+ }
276
+ export interface UserApiMetadata {
277
+ products: UserApiMetadataProducts;
278
+ }
279
+ export interface UserApiMetadataProducts {
280
+ capabilities: UserApiMetadataProductsCapabilities;
281
+ }
282
+ export interface UserApiMetadataProductsCapabilities {
283
+ /**
284
+ * Reads the product and cost catalog capabilities
285
+ *
286
+ * Returns how products and costs on deals are configured for the account. The amount, date and cycle settings apply only while `productsEnabled` is `true`, and catalog writes do not depend on them.
287
+ *
288
+ * Needs one of the scopes: `crm:product-catalog:read`, `crm:cost-catalog:read`.
289
+ */
290
+ get(options?: UserApiCallOptions): Promise<T.ProductCapabilitiesEnvelope>;
291
+ }
292
+ export interface UserApiProducts {
293
+ /**
294
+ * Creates a product
295
+ *
296
+ * Creates a product in the product catalog.
297
+ *
298
+ * Needs one of the scopes: `crm:product-catalog:write`.
299
+ */
300
+ create(body: T.CreateProductRequest, options?: UserApiCallOptions): Promise<T.ProductEnvelope>;
301
+ /**
302
+ * Searches products
303
+ *
304
+ * Lists the products that match a filter, sorted (by default `name asc`, entries without a name last) and paged, each as `GET /products/{id}` returns it. Several SKUs are an `or` group of `eq` conditions.
305
+ *
306
+ * Needs one of the scopes: `crm:product-catalog:read`.
307
+ */
308
+ search(body: T.SearchProductsRequest, options?: UserApiCallOptions): Promise<T.ProductSearchEnvelope>;
309
+ /**
310
+ * Returns one product
311
+ *
312
+ * Returns the product. A product in a cost group shows `group: null`.
313
+ *
314
+ * Needs one of the scopes: `crm:product-catalog:read`.
315
+ *
316
+ * @param id The product's id, 8-4-4-4-12 hexadecimal.
317
+ */
318
+ get(id: T.PublicId, options?: UserApiCallOptions): Promise<T.ProductEnvelope>;
319
+ /**
320
+ * Updates a product
321
+ *
322
+ * Updates the keys the body carries; an empty body changes nothing, and a key sent with its current value still moves `updatedAt`.
323
+ *
324
+ * Needs one of the scopes: `crm:product-catalog:write`.
325
+ *
326
+ * @param id The product's id, 8-4-4-4-12 hexadecimal; a cost id answers `404`.
327
+ */
328
+ update(id: T.PublicId, body: T.UpdateProductRequest, options?: UserApiCallOptions): Promise<T.ProductEnvelope>;
329
+ /**
330
+ * Deletes a product
331
+ *
332
+ * Deletes the product; deal lines that name it keep it.
333
+ *
334
+ * Needs one of the scopes: `crm:product-catalog:delete`.
335
+ *
336
+ * @param id The product's id, 8-4-4-4-12 hexadecimal; a cost id answers `404`.
337
+ */
338
+ delete(id: T.PublicId, options?: UserApiCallOptions): Promise<void>;
339
+ }
340
+ export interface UserApiTasks {
341
+ /**
342
+ * Searches tasks
343
+ *
344
+ * Lists the open and completed tasks the caller sees, as [Task visibility](/conventions/#task-visibility) defines them, that match a filter, sorted (by default `updatedAt desc`) and paged. A task without a start matches on `startsAt` only `isEmpty`, and sorts last on `startsAt asc`.
345
+ *
346
+ * Needs one of the scopes: `crm:task:read`, `crm:task:write`.
347
+ */
348
+ search(body: T.SearchTasksRequest, options: UserApiCallOptions & {
349
+ representation: "minimal";
350
+ }): Promise<T.TaskMinimalListEnvelope>;
351
+ /**
352
+ * Searches tasks
353
+ *
354
+ * Lists the open and completed tasks the caller sees, as [Task visibility](/conventions/#task-visibility) defines them, that match a filter, sorted (by default `updatedAt desc`) and paged. A task without a start matches on `startsAt` only `isEmpty`, and sorts last on `startsAt asc`.
355
+ *
356
+ * Needs one of the scopes: `crm:task:read`, `crm:task:write`.
357
+ */
358
+ search(body: T.SearchTasksRequest, options?: UserApiCallOptions & {
359
+ representation?: "default";
360
+ }): Promise<T.TaskListEnvelope>;
361
+ /**
362
+ * Creates a task
363
+ *
364
+ * Creates a task linked to the people, companies and deals in the body, or to none, and fires the `task.created` webhook. If the key can no longer read the task, `data` holds only its id.
365
+ *
366
+ * Needs one of the scopes: `crm:task:write`.
367
+ */
368
+ create(body: T.CreateTaskWithLinksRequest, options?: UserApiCallOptions): Promise<T.TaskEnvelope | T.WrittenRecordIdEnvelope>;
369
+ /**
370
+ * Returns one task
371
+ *
372
+ * Returns the task if the caller may see it; [Task visibility](/conventions/#task-visibility) lists which tasks a key or a user sees.
373
+ *
374
+ * Needs one of the scopes: `crm:task:read`, `crm:task:write`.
375
+ *
376
+ * @param id The task's id, 8-4-4-4-12 hexadecimal.
377
+ */
378
+ get(id: T.PublicId, options: UserApiCallOptions & {
379
+ representation: "minimal";
380
+ }): Promise<T.TaskMinimalEnvelope>;
381
+ /**
382
+ * Returns one task
383
+ *
384
+ * Returns the task if the caller may see it; [Task visibility](/conventions/#task-visibility) lists which tasks a key or a user sees.
385
+ *
386
+ * Needs one of the scopes: `crm:task:read`, `crm:task:write`.
387
+ *
388
+ * @param id The task's id, 8-4-4-4-12 hexadecimal.
389
+ */
390
+ get(id: T.PublicId, options?: UserApiCallOptions & {
391
+ representation?: "default";
392
+ }): Promise<T.TaskEnvelope>;
393
+ /**
394
+ * Updates a task
395
+ *
396
+ * Updates the task and the people, companies and deals it is linked to under `application/json`, or completes or reopens it with an empty body under `application/vnd.ls-api.task-complete.v2+json` or `application/vnd.ls-api.task-reopen.v2+json`. Completing a completed task or reopening an open one changes nothing.
397
+ *
398
+ * Needs one of the scopes: `crm:task:write`.
399
+ *
400
+ * @param id The task's id, 8-4-4-4-12 hexadecimal.
401
+ */
402
+ update(id: T.PublicId, body?: T.UpdateTaskWithLinksRequest, options?: UserApiCallOptions): Promise<T.TaskEnvelope | T.WrittenRecordIdEnvelope>;
403
+ /**
404
+ * Completes a task
405
+ *
406
+ * Updates the task and the people, companies and deals it is linked to under `application/json`, or completes or reopens it with an empty body under `application/vnd.ls-api.task-complete.v2+json` or `application/vnd.ls-api.task-reopen.v2+json`. Completing a completed task or reopening an open one changes nothing.
407
+ *
408
+ * Needs one of the scopes: `crm:task:write`.
409
+ *
410
+ * @param id The task's id, 8-4-4-4-12 hexadecimal.
411
+ */
412
+ complete(id: T.PublicId, options?: UserApiCallOptions): Promise<T.TaskEnvelope | T.WrittenRecordIdEnvelope>;
413
+ /**
414
+ * Reopens a task
415
+ *
416
+ * Updates the task and the people, companies and deals it is linked to under `application/json`, or completes or reopens it with an empty body under `application/vnd.ls-api.task-complete.v2+json` or `application/vnd.ls-api.task-reopen.v2+json`. Completing a completed task or reopening an open one changes nothing.
417
+ *
418
+ * Needs one of the scopes: `crm:task:write`.
419
+ *
420
+ * @param id The task's id, 8-4-4-4-12 hexadecimal.
421
+ */
422
+ reopen(id: T.PublicId, options?: UserApiCallOptions): Promise<T.TaskEnvelope | T.WrittenRecordIdEnvelope>;
423
+ /**
424
+ * Deletes a task
425
+ *
426
+ * Deletes the task; its links, participants, reminders and calendar shares stay. A task that belongs to a recurrence cannot be deleted.
427
+ *
428
+ * Needs one of the scopes: `crm:task:delete`.
429
+ *
430
+ * @param id The task's id, 8-4-4-4-12 hexadecimal.
431
+ */
432
+ delete(id: T.PublicId, options?: UserApiCallOptions): Promise<void>;
433
+ }
434
+ export interface UserApiSalesProcesses {
435
+ /**
436
+ * Lists sales processes
437
+ *
438
+ * Lists the sales processes with their stages, steps and field bindings: the default process first, then the selectable ones, then those switched off. A deleted process is not listed, but `GET /sales-processes/{id}` still returns it.
439
+ *
440
+ * Needs one of the scopes: `crm:deal:read`, `crm:deal:write`, `crm:sales-process:read`.
441
+ */
442
+ list(query?: {
443
+ /**
444
+ * Page number, 1-based. Default 1, maximum 10000.
445
+ */
446
+ page?: number;
447
+ /**
448
+ * Page size. Default 100, maximum 500; a larger value is refused, never clamped.
449
+ */
450
+ perPage?: number;
451
+ }, options?: UserApiCallOptions): Promise<T.DictionaryProcessListEnvelope>;
452
+ /**
453
+ * Creates a sales process
454
+ *
455
+ * Creates a sales process with its stages, steps and field bindings, not selectable and not the default; omitted members take their defaults.
456
+ *
457
+ * Needs one of the scopes: `crm:sales-process:write`.
458
+ */
459
+ create(body: T.SalesProcessCreateRequest, options?: UserApiCallOptions): Promise<T.DictionaryProcessEnvelope>;
460
+ /**
461
+ * Returns one sales process
462
+ *
463
+ * Returns the sales process with its stages, steps and field bindings. A deleted or switched-off process is returned with `selectable: false`.
464
+ *
465
+ * Needs one of the scopes: `crm:deal:read`, `crm:deal:write`, `crm:sales-process:read`.
466
+ *
467
+ * @param id The process's id, 8-4-4-4-12 hexadecimal.
468
+ */
469
+ get(id: T.PublicId, options?: UserApiCallOptions): Promise<T.DictionaryProcessEnvelope>;
470
+ /**
471
+ * Updates a sales process
472
+ *
473
+ * Updates the sales process: a key left out keeps its value, and a sent `stages` is the whole structure, matched by `id`, where a stage, step or binding left out is removed. Deals on a removed step move to their furthest completed active step.
474
+ *
475
+ * Needs one of the scopes: `crm:sales-process:write`.
476
+ *
477
+ * @param id The process's id, 8-4-4-4-12 hexadecimal; a deleted process answers `404`.
478
+ */
479
+ update(id: T.PublicId, body: T.SalesProcessUpdateRequest, options?: UserApiCallOptions): Promise<T.DictionaryProcessEnvelope>;
480
+ /**
481
+ * Deletes a sales process
482
+ *
483
+ * Deletes the sales process with its stages and steps; deals that use it keep it, and the default process cannot be deleted.
484
+ *
485
+ * Needs one of the scopes: `crm:sales-process:delete`.
486
+ *
487
+ * @param id The process's id, 8-4-4-4-12 hexadecimal; a deleted process answers `404`.
488
+ */
489
+ delete(id: T.PublicId, options?: UserApiCallOptions): Promise<void>;
490
+ }
491
+ export interface UserApiRelations {
492
+ /**
493
+ * Links two records
494
+ *
495
+ * Links record `from` to record `to` under an active relation type of `GET /dictionaries/relation-types` whose sides they match. The key needs the write scope of each person, company or deal end, and the caller may edit each one.
496
+ *
497
+ * Needs the scopes of the record types it touches, from: `crm:person:write`, `crm:company:write`, `crm:deal:write`.
498
+ */
499
+ create(body: T.CreateRelationRequest, options?: UserApiCallOptions): Promise<T.RelationEnvelope | T.WrittenRecordIdEnvelope>;
500
+ /**
501
+ * Reads one relation
502
+ *
503
+ * Returns the relation with both of its ends. The key needs a read or write scope of one person, company or deal end, and the caller must see that end.
504
+ *
505
+ * Needs the scopes of the record types it touches, from: `crm:person:read`, `crm:person:write`, `crm:company:read`, `crm:company:write`, `crm:deal:read`, `crm:deal:write`.
506
+ *
507
+ * @param id The relation's id, 8-4-4-4-12 hexadecimal.
508
+ */
509
+ get(id: T.PublicId, options?: UserApiCallOptions): Promise<T.RelationEnvelope>;
510
+ /**
511
+ * Unlinks two records
512
+ *
513
+ * Removes the relation, also one of a deleted type but never one of a system type; to relink, delete and recreate it. The key needs the write scope of each person, company or deal end, and the caller must be allowed to edit each.
514
+ *
515
+ * Needs the scopes of the record types it touches, from: `crm:person:write`, `crm:company:write`, `crm:deal:write`.
516
+ *
517
+ * @param id The relation's id, 8-4-4-4-12 hexadecimal.
518
+ */
519
+ delete(id: T.PublicId, options?: UserApiCallOptions): Promise<void>;
520
+ }
521
+ export interface UserApiDictionaries {
522
+ sources: UserApiDictionariesSources;
523
+ consentStatuses: UserApiDictionariesConsentStatuses;
524
+ positions: UserApiDictionariesPositions;
525
+ dealReasons: UserApiDictionariesDealReasons;
526
+ personGroups: UserApiDictionariesPersonGroups;
527
+ dealGroups: UserApiDictionariesDealGroups;
528
+ people: UserApiDictionariesPeople;
529
+ teams: UserApiDictionariesTeams;
530
+ roles: UserApiDictionariesRoles;
531
+ currencies: UserApiDictionariesCurrencies;
532
+ relationTypes: UserApiDictionariesRelationTypes;
533
+ tasks: UserApiDictionariesTasks;
534
+ processes: UserApiDictionariesProcesses;
535
+ companies: UserApiDictionariesCompanies;
536
+ addresses: UserApiDictionariesAddresses;
537
+ deals: UserApiDictionariesDeals;
538
+ taskTypes: UserApiDictionariesTaskTypes;
539
+ taskStatuses: UserApiDictionariesTaskStatuses;
540
+ tags: UserApiDictionariesTags;
541
+ }
542
+ export interface UserApiDictionariesTags {
543
+ /**
544
+ * Lists tag names
545
+ *
546
+ * Lists the names of every tag on the account as JSON strings, with no id and no `selectable`, ordered by name. `q` keeps the names that contain it, case-insensitive, with `%`, `_` and `\` matched literally; names differing only in case are separate items.
547
+ *
548
+ * Needs one of the scopes: `crm:person:read`, `crm:person:write`, `crm:company:read`, `crm:company:write`, `crm:deal:read`, `crm:deal:write`.
549
+ */
550
+ list(query?: {
551
+ /**
552
+ * Page number, 1-based. Default 1, maximum 10000.
553
+ */
554
+ page?: number;
555
+ /**
556
+ * Page size. Default 100, maximum 500; a larger value is refused, never clamped.
557
+ */
558
+ perPage?: number;
559
+ /**
560
+ * Text a tag name must contain, case-insensitive and at most 255 characters, with `%`, `_` and `\` matched literally. A missing or blank `q` lists every tag.
561
+ */
562
+ q?: string;
563
+ }, options?: UserApiCallOptions): Promise<T.DictionaryTagListEnvelope>;
564
+ }
565
+ export interface UserApiDictionariesTaskStatuses {
566
+ /**
567
+ * Lists task statuses
568
+ *
569
+ * Lists the selectable task statuses a task can carry as `status.id`, in the order Livespace shows them, then by id. The list is empty while task statuses are switched off for the account; a retired status is still returned by id.
570
+ *
571
+ * Needs one of the scopes: `crm:task:read`, `crm:task:write`, `crm:dictionary:read`.
572
+ */
573
+ list(query?: {
574
+ /**
575
+ * Page number, 1-based. Default 1, maximum 10000.
576
+ */
577
+ page?: number;
578
+ /**
579
+ * Page size. Default 100, maximum 500; a larger value is refused, never clamped.
580
+ */
581
+ perPage?: number;
582
+ }, options?: UserApiCallOptions): Promise<T.DictionaryTaskStatusListEnvelope>;
583
+ /**
584
+ * Creates a task status
585
+ *
586
+ * Creates a task status that a task can carry as `status.id`.
587
+ *
588
+ * Needs one of the scopes: `crm:dictionary:write`.
589
+ */
590
+ create(body: T.TaskStatusCreateRequest, options?: UserApiCallOptions): Promise<T.DictionaryTaskStatusEnvelope>;
591
+ /**
592
+ * Returns one task status
593
+ *
594
+ * Returns the task status; a retired status, and every status while task statuses are switched off, comes back with `selectable: false`.
595
+ *
596
+ * Needs one of the scopes: `crm:task:read`, `crm:task:write`, `crm:dictionary:read`.
597
+ *
598
+ * @param id The task status's id, 8-4-4-4-12 hexadecimal.
599
+ */
600
+ get(id: T.PublicId, options?: UserApiCallOptions): Promise<T.DictionaryTaskStatusEnvelope>;
601
+ /**
602
+ * Updates a task status
603
+ *
604
+ * Renames a task status or changes its colour, and `color: null` removes it. A rename changes the name that integrations filtering tasks by name use, so such a filter stops finding this status's tasks.
605
+ *
606
+ * Needs one of the scopes: `crm:dictionary:write`.
607
+ *
608
+ * @param id The task status's id, 8-4-4-4-12 hexadecimal; a deleted status answers `404`.
609
+ */
610
+ update(id: T.PublicId, body: T.TaskStatusUpdateRequest, options?: UserApiCallOptions): Promise<T.DictionaryTaskStatusEnvelope>;
611
+ /**
612
+ * Deletes a task status
613
+ *
614
+ * Retires a task status: it is no longer listed, and tasks that carry it keep it.
615
+ *
616
+ * Needs one of the scopes: `crm:dictionary:delete`.
617
+ *
618
+ * @param id The task status's id, 8-4-4-4-12 hexadecimal; a deleted status answers `404`.
619
+ */
620
+ delete(id: T.PublicId, options?: UserApiCallOptions): Promise<void>;
621
+ }
622
+ export interface UserApiDictionariesTaskTypes {
623
+ /**
624
+ * Lists task types
625
+ *
626
+ * Lists the selectable task types a task can carry as `type.id`, in the order of the Livespace task pickers and then by id. A retired type is not listed but still returned by id, because a task can still reference it.
627
+ *
628
+ * Needs one of the scopes: `crm:task:read`, `crm:task:write`, `crm:dictionary:read`.
629
+ */
630
+ list(query?: {
631
+ /**
632
+ * Page number, 1-based. Default 1, maximum 10000.
633
+ */
634
+ page?: number;
635
+ /**
636
+ * Page size. Default 100, maximum 500; a larger value is refused, never clamped.
637
+ */
638
+ perPage?: number;
639
+ }, options?: UserApiCallOptions): Promise<T.DictionaryTaskTypeListEnvelope>;
640
+ /**
641
+ * Creates a task type
642
+ *
643
+ * Creates a task type that a task can carry as `type.id`; an `icon` left out is `1`.
644
+ *
645
+ * Needs one of the scopes: `crm:dictionary:write`.
646
+ */
647
+ create(body: T.TaskTypeCreateRequest, options?: UserApiCallOptions): Promise<T.DictionaryTaskTypeEnvelope>;
648
+ /**
649
+ * Returns one task type
650
+ *
651
+ * Returns the task type; a retired type comes back with `selectable: false`, because a task can still reference it.
652
+ *
653
+ * Needs one of the scopes: `crm:task:read`, `crm:task:write`, `crm:dictionary:read`.
654
+ *
655
+ * @param id The task type's id, 8-4-4-4-12 hexadecimal.
656
+ */
657
+ get(id: T.PublicId, options?: UserApiCallOptions): Promise<T.DictionaryTaskTypeEnvelope>;
658
+ /**
659
+ * Updates a task type
660
+ *
661
+ * Renames a task type or changes its icon; a member you leave out is unchanged, and tasks of the type keep their history. A rename changes the name that integrations filtering tasks by name use, so such a filter stops finding this type's tasks.
662
+ *
663
+ * Needs one of the scopes: `crm:dictionary:write`.
664
+ *
665
+ * @param id The task type's id, 8-4-4-4-12 hexadecimal; a deleted type answers `404`.
666
+ */
667
+ update(id: T.PublicId, body: T.TaskTypeUpdateRequest, options?: UserApiCallOptions): Promise<T.DictionaryTaskTypeEnvelope>;
668
+ /**
669
+ * Deletes a task type
670
+ *
671
+ * Retires a task type: it is no longer listed, and tasks that carry it keep it and their history unchanged.
672
+ *
673
+ * Needs one of the scopes: `crm:dictionary:delete`.
674
+ *
675
+ * @param id The task type's id, 8-4-4-4-12 hexadecimal; a deleted type answers `404`.
676
+ */
677
+ delete(id: T.PublicId, options?: UserApiCallOptions): Promise<void>;
678
+ }
679
+ export interface UserApiDictionariesDeals {
680
+ fields: UserApiDictionariesDealsFields;
681
+ }
682
+ export interface UserApiDictionariesDealsFields {
683
+ /**
684
+ * Lists the additional fields on the deal form
685
+ *
686
+ * Lists the additional fields a deal write may send, in deal form order; `requiredForWin` marks a field a win requires. A user sees only the fields their account roles allow, so a field editable through a record role may be missing or `readOnly`.
687
+ *
688
+ * Needs one of the scopes: `crm:deal:read`, `crm:deal:write`.
689
+ */
690
+ list(query?: {
691
+ /**
692
+ * Page number, 1-based. Default 1, maximum 10000.
693
+ */
694
+ page?: number;
695
+ /**
696
+ * Page size. Default 100, maximum 500; a larger value is refused, never clamped.
697
+ */
698
+ perPage?: number;
699
+ }, options?: UserApiCallOptions): Promise<T.DictionaryDealFieldListEnvelope>;
700
+ /**
701
+ * Returns one deal field
702
+ *
703
+ * Returns the field, also one no longer offered on the deal form, which comes back with `selectable: false`. A field the user's account roles may not see answers `404`; a record role such as owner is not counted.
704
+ *
705
+ * Needs one of the scopes: `crm:deal:read`, `crm:deal:write`.
706
+ *
707
+ * @param id The field's id, 8-4-4-4-12 hexadecimal.
708
+ */
709
+ get(id: T.PublicId, options?: UserApiCallOptions): Promise<T.DictionaryDealFieldEnvelope>;
710
+ }
711
+ export interface UserApiDictionariesAddresses {
712
+ fields: UserApiDictionariesAddressesFields;
713
+ }
714
+ export interface UserApiDictionariesAddressesFields {
715
+ /**
716
+ * Lists the additional fields on the address form
717
+ *
718
+ * Lists the additional fields a person or company address may send in `addresses[].additionalFields`, with input types and choice options, in address form order. A user sees only the fields their account roles allow.
719
+ *
720
+ * Needs one of the scopes: `crm:person:read`, `crm:person:write`, `crm:company:read`, `crm:company:write`.
721
+ */
722
+ list(query?: {
723
+ /**
724
+ * Page number, 1-based. Default 1, maximum 10000.
725
+ */
726
+ page?: number;
727
+ /**
728
+ * Page size. Default 100, maximum 500; a larger value is refused, never clamped.
729
+ */
730
+ perPage?: number;
731
+ }, options?: UserApiCallOptions): Promise<T.DictionaryFieldListEnvelope>;
732
+ /**
733
+ * Returns one address field
734
+ *
735
+ * Returns the address field, also one no longer offered on the address form, which comes back with `selectable: false`. A field the user's account roles may not see answers `404`.
736
+ *
737
+ * Needs one of the scopes: `crm:person:read`, `crm:person:write`, `crm:company:read`, `crm:company:write`.
738
+ *
739
+ * @param id The field's id, 8-4-4-4-12 hexadecimal.
740
+ */
741
+ get(id: T.PublicId, options?: UserApiCallOptions): Promise<T.DictionaryFieldEnvelope>;
742
+ }
743
+ export interface UserApiDictionariesCompanies {
744
+ fields: UserApiDictionariesCompaniesFields;
745
+ }
746
+ export interface UserApiDictionariesCompaniesFields {
747
+ /**
748
+ * Lists the additional fields on the company form
749
+ *
750
+ * Lists the additional fields a company write may send, with input types and choice options, in company form order. A user sees only the fields their account roles allow, so a field editable through a record role may be missing or `readOnly`.
751
+ *
752
+ * Needs one of the scopes: `crm:company:read`, `crm:company:write`.
753
+ */
754
+ list(query?: {
755
+ /**
756
+ * Page number, 1-based. Default 1, maximum 10000.
757
+ */
758
+ page?: number;
759
+ /**
760
+ * Page size. Default 100, maximum 500; a larger value is refused, never clamped.
761
+ */
762
+ perPage?: number;
763
+ }, options?: UserApiCallOptions): Promise<T.DictionaryFieldListEnvelope>;
764
+ /**
765
+ * Returns one company field
766
+ *
767
+ * Returns the field, also one no longer offered on the company form, which comes back with `selectable: false`. A field the user's account roles may not see answers `404`; a record role such as owner is not counted.
768
+ *
769
+ * Needs one of the scopes: `crm:company:read`, `crm:company:write`.
770
+ *
771
+ * @param id The field's id, 8-4-4-4-12 hexadecimal.
772
+ */
773
+ get(id: T.PublicId, options?: UserApiCallOptions): Promise<T.DictionaryFieldEnvelope>;
774
+ }
775
+ export interface UserApiDictionariesProcesses {
776
+ /**
777
+ * Lists sales processes
778
+ *
779
+ * Deprecated: use `GET /sales-processes`, which returns the same body. Lists the sales processes with their stages, steps and field bindings, ordered by `name` and then id; a switched-off process is listed with `selectable: false`, a deleted one is not.
780
+ *
781
+ * Needs one of the scopes: `crm:deal:read`, `crm:deal:write`, `crm:sales-process:read`.
782
+ *
783
+ * @deprecated
784
+ */
785
+ list(query?: {
786
+ /**
787
+ * Page number, 1-based. Default 1, maximum 10000.
788
+ */
789
+ page?: number;
790
+ /**
791
+ * Page size. Default 100, maximum 500; a larger value is refused, never clamped.
792
+ */
793
+ perPage?: number;
794
+ }, options?: UserApiCallOptions): Promise<T.DictionaryProcessListEnvelope>;
795
+ /**
796
+ * Returns one sales process
797
+ *
798
+ * Deprecated: use `GET /sales-processes/{id}`, which returns the same body. Returns the sales process with its stages, steps and field bindings; a deleted or switched-off process comes back with `selectable: false`.
799
+ *
800
+ * Needs one of the scopes: `crm:deal:read`, `crm:deal:write`, `crm:sales-process:read`.
801
+ *
802
+ * @param id The process's id, 8-4-4-4-12 hexadecimal.
803
+ *
804
+ * @deprecated
805
+ */
806
+ get(id: T.PublicId, options?: UserApiCallOptions): Promise<T.DictionaryProcessEnvelope>;
807
+ }
808
+ export interface UserApiDictionariesTasks {
809
+ fields: UserApiDictionariesTasksFields;
810
+ }
811
+ export interface UserApiDictionariesTasksFields {
812
+ /**
813
+ * Lists the additional fields on the task form
814
+ *
815
+ * Lists the additional fields a task write may send, with input types and choice options, in task form order. A user sees only the fields their account roles allow, so a field editable through a record role may be missing or `readOnly`.
816
+ *
817
+ * Needs one of the scopes: `crm:task:read`, `crm:task:write`.
818
+ */
819
+ list(query?: {
820
+ /**
821
+ * Page number, 1-based. Default 1, maximum 10000.
822
+ */
823
+ page?: number;
824
+ /**
825
+ * Page size. Default 100, maximum 500; a larger value is refused, never clamped.
826
+ */
827
+ perPage?: number;
828
+ }, options?: UserApiCallOptions): Promise<T.DictionaryFieldListEnvelope>;
829
+ /**
830
+ * Returns one task field
831
+ *
832
+ * Returns the field, also one no longer offered on the task form, which comes back with `selectable: false`. A field the user's account roles may not see answers `404`; a record role such as owner is not counted.
833
+ *
834
+ * Needs one of the scopes: `crm:task:read`, `crm:task:write`.
835
+ *
836
+ * @param id The field's id, 8-4-4-4-12 hexadecimal.
837
+ */
838
+ get(id: T.PublicId, options?: UserApiCallOptions): Promise<T.DictionaryFieldEnvelope>;
839
+ }
840
+ export interface UserApiDictionariesRelationTypes {
841
+ /**
842
+ * Lists relation types
843
+ *
844
+ * Lists the active relation types between people, companies, deals and users, ordered by `nameFrom` and then id; `nameFrom` and `nameTo` are the directional labels. A retired type is not listed but still returned by id, because a relation can still reference it.
845
+ *
846
+ * Needs one of the scopes: `crm:person:read`, `crm:person:write`, `crm:company:read`, `crm:company:write`, `crm:deal:read`, `crm:deal:write`, `crm:dictionary:read`.
847
+ */
848
+ list(query?: {
849
+ /**
850
+ * Page number, 1-based. Default 1, maximum 10000.
851
+ */
852
+ page?: number;
853
+ /**
854
+ * Page size. Default 100, maximum 500; a larger value is refused, never clamped.
855
+ */
856
+ perPage?: number;
857
+ }, options?: UserApiCallOptions): Promise<T.DictionaryRelationTypeListEnvelope>;
858
+ /**
859
+ * Creates a relation type
860
+ *
861
+ * Creates a selectable relation type from a person, company or deal (`from`) to a person, company, deal or user (`to`); its sides cannot change later.
862
+ *
863
+ * Needs one of the scopes: `crm:dictionary:write`.
864
+ */
865
+ create(body: T.RelationTypeCreateRequest, options?: UserApiCallOptions): Promise<T.DictionaryRelationTypeEnvelope>;
866
+ /**
867
+ * Returns one relation type
868
+ *
869
+ * Returns the relation type; a deleted one comes back with `selectable: false`, because a relation can still reference it, and so does a system type. A type with a side other than a person, company, deal or user answers `404`.
870
+ *
871
+ * Needs one of the scopes: `crm:person:read`, `crm:person:write`, `crm:company:read`, `crm:company:write`, `crm:deal:read`, `crm:deal:write`, `crm:dictionary:read`.
872
+ *
873
+ * @param id The relation type's id, 8-4-4-4-12 hexadecimal.
874
+ */
875
+ get(id: T.PublicId, options?: UserApiCallOptions): Promise<T.DictionaryRelationTypeEnvelope>;
876
+ /**
877
+ * Relabels a relation type
878
+ *
879
+ * Changes `nameFrom`, `nameTo` or both, and existing relations of the type show the new labels; the sides and a system type cannot be changed.
880
+ *
881
+ * Needs one of the scopes: `crm:dictionary:write`.
882
+ *
883
+ * @param id The relation type's id, 8-4-4-4-12 hexadecimal.
884
+ */
885
+ update(id: T.PublicId, body: T.RelationTypeUpdateRequest, options?: UserApiCallOptions): Promise<T.DictionaryRelationTypeEnvelope>;
886
+ /**
887
+ * Deletes a relation type
888
+ *
889
+ * Retires the relation type: new relations cannot use it, it reads as `selectable: false`, and existing relations stay readable and removable. A system type, or one an active sales process step uses, cannot be deleted.
890
+ *
891
+ * Needs one of the scopes: `crm:dictionary:delete`.
892
+ *
893
+ * @param id The relation type's id, 8-4-4-4-12 hexadecimal.
894
+ */
895
+ delete(id: T.PublicId, options?: UserApiCallOptions): Promise<void>;
896
+ }
897
+ export interface UserApiDictionariesCurrencies {
898
+ /**
899
+ * Lists currencies
900
+ *
901
+ * Lists the currency codes of the account, the default first, then the selectable ones, then the rest, each by code; `id` is the code itself. A switched-off code stays listed with `selectable: false`, and a deal budget write refuses it.
902
+ *
903
+ * Needs one of the scopes: `crm:deal:read`, `crm:deal:write`.
904
+ */
905
+ list(query?: {
906
+ /**
907
+ * Page number, 1-based. Default 1, maximum 10000.
908
+ */
909
+ page?: number;
910
+ /**
911
+ * Page size. Default 100, maximum 500; a larger value is refused, never clamped.
912
+ */
913
+ perPage?: number;
914
+ }, options?: UserApiCallOptions): Promise<T.DictionaryCurrencyListEnvelope>;
915
+ /**
916
+ * Returns one currency
917
+ *
918
+ * Returns the currency whose code matches `{code}` exactly, with no case folding. `selectable` is true when the currency is switched on.
919
+ *
920
+ * Needs one of the scopes: `crm:deal:read`, `crm:deal:write`.
921
+ *
922
+ * @param code The currency code, 1 to 3 letters or digits, matched exactly.
923
+ */
924
+ get(code: string, options?: UserApiCallOptions): Promise<T.DictionaryCurrencyEnvelope>;
925
+ }
926
+ export interface UserApiDictionariesRoles {
927
+ /**
928
+ * Lists roles
929
+ *
930
+ * Lists the active roles a user can hold on a person, company or deal, ordered by `name` and then id.
931
+ *
932
+ * Needs one of the scopes: `crm:person:read`, `crm:person:write`, `crm:company:read`, `crm:company:write`, `crm:deal:read`, `crm:deal:write`.
933
+ */
934
+ list(query?: {
935
+ /**
936
+ * Page number, 1-based. Default 1, maximum 10000.
937
+ */
938
+ page?: number;
939
+ /**
940
+ * Page size. Default 100, maximum 500; a larger value is refused, never clamped.
941
+ */
942
+ perPage?: number;
943
+ }, options?: UserApiCallOptions): Promise<T.DictionaryRoleListEnvelope>;
944
+ /**
945
+ * Returns one role
946
+ *
947
+ * Returns a role a user can hold on a person, a company or a deal. An inactive role has `selectable` false, and any other role answers `404`.
948
+ *
949
+ * Needs one of the scopes: `crm:person:read`, `crm:person:write`, `crm:company:read`, `crm:company:write`, `crm:deal:read`, `crm:deal:write`.
950
+ *
951
+ * @param id The role's id, 8-4-4-4-12 hexadecimal.
952
+ */
953
+ get(id: T.PublicId, options?: UserApiCallOptions): Promise<T.DictionaryRoleEnvelope>;
954
+ }
955
+ export interface UserApiDictionariesTeams {
956
+ members: UserApiDictionariesTeamsMembers;
957
+ /**
958
+ * Lists teams
959
+ *
960
+ * Lists the active teams and the root team in tree order, each after its parent, with `level` giving the depth; the root has `selectable: false`. Every `parent.id` in the list is itself listed.
961
+ *
962
+ * Needs one of the scopes: `crm:person:read`, `crm:person:write`, `crm:company:read`, `crm:company:write`, `crm:deal:read`, `crm:deal:write`.
963
+ */
964
+ list(query?: {
965
+ /**
966
+ * Page number, 1-based. Default 1, maximum 10000.
967
+ */
968
+ page?: number;
969
+ /**
970
+ * Page size. Default 100, maximum 500; a larger value is refused, never clamped.
971
+ */
972
+ perPage?: number;
973
+ }, options?: UserApiCallOptions): Promise<T.DictionaryTeamListEnvelope>;
974
+ /**
975
+ * Returns one team
976
+ *
977
+ * Returns the team with its `parent` and `level`; a team that is not selectable comes back with `selectable: false`.
978
+ *
979
+ * Needs one of the scopes: `crm:person:read`, `crm:person:write`, `crm:company:read`, `crm:company:write`, `crm:deal:read`, `crm:deal:write`.
980
+ *
981
+ * @param id The team's id, 8-4-4-4-12 hexadecimal.
982
+ */
983
+ get(id: T.PublicId, options?: UserApiCallOptions): Promise<T.DictionaryTeamEnvelope>;
984
+ }
985
+ export interface UserApiDictionariesTeamsMembers {
986
+ /**
987
+ * Lists the members of a team
988
+ *
989
+ * Lists the users of the team who also appear on `GET /users`, each once, ordered by last name, first name and then id. `isMain` is true for the user's main team only, as `team` on `GET /users` reports it.
990
+ *
991
+ * Needs one of the scopes: `crm:person:read`, `crm:person:write`, `crm:company:read`, `crm:company:write`, `crm:deal:read`, `crm:deal:write`.
992
+ *
993
+ * @param id The team's id, 8-4-4-4-12 hexadecimal.
994
+ */
995
+ list(id: T.PublicId, query?: {
996
+ /**
997
+ * Page number, 1-based. Default 1, maximum 10000.
998
+ */
999
+ page?: number;
1000
+ /**
1001
+ * Page size. Default 100, maximum 500; a larger value is refused, never clamped.
1002
+ */
1003
+ perPage?: number;
1004
+ }, options?: UserApiCallOptions): Promise<T.DictionaryTeamMemberListEnvelope>;
1005
+ }
1006
+ export interface UserApiDictionariesPeople {
1007
+ fields: UserApiDictionariesPeopleFields;
1008
+ }
1009
+ export interface UserApiDictionariesPeopleFields {
1010
+ /**
1011
+ * Lists the additional fields on the person form
1012
+ *
1013
+ * Lists the additional fields a person write may send, with input types and choice options, in person form order. A user sees only the fields their account roles allow, so a field editable through a record role may be missing or `readOnly`.
1014
+ *
1015
+ * Needs one of the scopes: `crm:person:read`, `crm:person:write`.
1016
+ */
1017
+ list(query?: {
1018
+ /**
1019
+ * Page number, 1-based. Default 1, maximum 10000.
1020
+ */
1021
+ page?: number;
1022
+ /**
1023
+ * Page size. Default 100, maximum 500; a larger value is refused, never clamped.
1024
+ */
1025
+ perPage?: number;
1026
+ }, options?: UserApiCallOptions): Promise<T.DictionaryFieldListEnvelope>;
1027
+ /**
1028
+ * Returns one person field
1029
+ *
1030
+ * Returns the field, also one no longer offered on the person form, which comes back with `selectable: false`. A field the user's account roles may not see answers `404`; a record role such as owner is not counted.
1031
+ *
1032
+ * Needs one of the scopes: `crm:person:read`, `crm:person:write`.
1033
+ *
1034
+ * @param id The field's id, 8-4-4-4-12 hexadecimal.
1035
+ */
1036
+ get(id: T.PublicId, options?: UserApiCallOptions): Promise<T.DictionaryFieldEnvelope>;
1037
+ }
1038
+ export interface UserApiDictionariesDealGroups {
1039
+ /**
1040
+ * Lists deal groups
1041
+ *
1042
+ * Lists every deal group a deal write accepts in `groups[]`, whoever owns it, ordered by `name` and then id.
1043
+ *
1044
+ * Needs one of the scopes: `crm:deal:read`, `crm:deal:write`, `crm:dictionary:read`.
1045
+ */
1046
+ list(query?: {
1047
+ /**
1048
+ * Page number, 1-based. Default 1, maximum 10000.
1049
+ */
1050
+ page?: number;
1051
+ /**
1052
+ * Page size. Default 100, maximum 500; a larger value is refused, never clamped.
1053
+ */
1054
+ perPage?: number;
1055
+ }, options?: UserApiCallOptions): Promise<T.DictionaryDealGroupListEnvelope>;
1056
+ /**
1057
+ * Creates a deal group
1058
+ *
1059
+ * Creates a deal group every user of the account sees; the name is trimmed plain text and need not be unique. The group has no members until a deal write lists it in `groups[]`.
1060
+ *
1061
+ * Needs one of the scopes: `crm:dictionary:write`.
1062
+ */
1063
+ create(body: T.DealGroupCreateRequest, options?: UserApiCallOptions): Promise<T.DictionaryDealGroupEnvelope>;
1064
+ /**
1065
+ * Returns one deal group
1066
+ *
1067
+ * Returns the deal group, whoever owns it.
1068
+ *
1069
+ * Needs one of the scopes: `crm:deal:read`, `crm:deal:write`, `crm:dictionary:read`.
1070
+ *
1071
+ * @param id The deal group's id, 8-4-4-4-12 hexadecimal.
1072
+ */
1073
+ get(id: T.PublicId, options?: UserApiCallOptions): Promise<T.DictionaryDealGroupEnvelope>;
1074
+ /**
1075
+ * Renames a deal group
1076
+ *
1077
+ * Renames the deal group, which every deal in it then shows; who it is shared with stays.
1078
+ *
1079
+ * Needs one of the scopes: `crm:dictionary:write`.
1080
+ *
1081
+ * @param id The deal group's id, 8-4-4-4-12 hexadecimal.
1082
+ */
1083
+ update(id: T.PublicId, body: T.DealGroupUpdateRequest, options?: UserApiCallOptions): Promise<T.DictionaryDealGroupEnvelope>;
1084
+ /**
1085
+ * Deletes a deal group
1086
+ *
1087
+ * Deletes the deal group and takes every deal out of it. A group shared with a team cannot be deleted; remove the sharing first.
1088
+ *
1089
+ * Needs one of the scopes: `crm:dictionary:delete`.
1090
+ *
1091
+ * @param id The deal group's id, 8-4-4-4-12 hexadecimal.
1092
+ */
1093
+ delete(id: T.PublicId, options?: UserApiCallOptions): Promise<void>;
1094
+ }
1095
+ export interface UserApiDictionariesPersonGroups {
1096
+ /**
1097
+ * Lists person groups
1098
+ *
1099
+ * Lists the person groups a person write accepts in `groups[]`, ordered by `name` and then id. Groups shared across the account and groups owned by other users are both listed.
1100
+ *
1101
+ * Needs one of the scopes: `crm:person:read`, `crm:person:write`, `crm:dictionary:read`.
1102
+ */
1103
+ list(query?: {
1104
+ /**
1105
+ * Page number, 1-based. Default 1, maximum 10000.
1106
+ */
1107
+ page?: number;
1108
+ /**
1109
+ * Page size. Default 100, maximum 500; a larger value is refused, never clamped.
1110
+ */
1111
+ perPage?: number;
1112
+ }, options?: UserApiCallOptions): Promise<T.DictionaryPersonGroupListEnvelope>;
1113
+ /**
1114
+ * Creates a person group
1115
+ *
1116
+ * Creates a group of people and companies; the name is trimmed plain text and need not be unique.
1117
+ *
1118
+ * Needs one of the scopes: `crm:dictionary:write`.
1119
+ */
1120
+ create(body: T.PersonGroupCreateRequest, options?: UserApiCallOptions): Promise<T.DictionaryPersonGroupEnvelope>;
1121
+ /**
1122
+ * Returns one person group
1123
+ *
1124
+ * Returns the person group, also one shared across the account or owned by another user, because a person write accepts both.
1125
+ *
1126
+ * Needs one of the scopes: `crm:person:read`, `crm:person:write`, `crm:dictionary:read`.
1127
+ *
1128
+ * @param id The person group's id, 8-4-4-4-12 hexadecimal.
1129
+ */
1130
+ get(id: T.PublicId, options?: UserApiCallOptions): Promise<T.DictionaryPersonGroupEnvelope>;
1131
+ /**
1132
+ * Renames a person group
1133
+ *
1134
+ * Renames the person group and leaves its members and team sharing as they are.
1135
+ *
1136
+ * Needs one of the scopes: `crm:dictionary:write`.
1137
+ *
1138
+ * @param id The person group's id, 8-4-4-4-12 hexadecimal.
1139
+ */
1140
+ update(id: T.PublicId, body: T.PersonGroupUpdateRequest, options?: UserApiCallOptions): Promise<T.DictionaryPersonGroupEnvelope>;
1141
+ /**
1142
+ * Deletes a person group
1143
+ *
1144
+ * Deletes the person group and removes it from every person and company. A group shared with a team answers `409`.
1145
+ *
1146
+ * Needs one of the scopes: `crm:dictionary:delete`.
1147
+ *
1148
+ * @param id The person group's id, 8-4-4-4-12 hexadecimal.
1149
+ */
1150
+ delete(id: T.PublicId, options?: UserApiCallOptions): Promise<void>;
1151
+ }
1152
+ export interface UserApiDictionariesDealReasons {
1153
+ /**
1154
+ * Lists deal reasons
1155
+ *
1156
+ * Lists the selectable deal reasons a deal write can send as `wonReason.id`, `lostReason.id` or `outdatedReason.id`, ordered by `name` and then id. `kind` narrows the list to the reasons for one status, `won`, `lost` or `outdated`.
1157
+ *
1158
+ * Needs one of the scopes: `crm:deal:read`, `crm:deal:write`, `crm:dictionary:read`.
1159
+ */
1160
+ list(query?: {
1161
+ /**
1162
+ * Page number, 1-based. Default 1, maximum 10000.
1163
+ */
1164
+ page?: number;
1165
+ /**
1166
+ * Page size. Default 100, maximum 500; a larger value is refused, never clamped.
1167
+ */
1168
+ perPage?: number;
1169
+ /**
1170
+ * Narrows the list to the deal status the reason is for. Any other value is `400`.
1171
+ */
1172
+ kind?: "won" | "lost" | "outdated";
1173
+ }, options?: UserApiCallOptions): Promise<T.DictionaryDealReasonListEnvelope>;
1174
+ /**
1175
+ * Creates a deal reason
1176
+ *
1177
+ * Creates a won, lost or outdated deal reason; the name is trimmed and need not be unique.
1178
+ *
1179
+ * Needs one of the scopes: `crm:dictionary:write`.
1180
+ */
1181
+ create(body: T.DealReasonCreateRequest, options?: UserApiCallOptions): Promise<T.DictionaryDealReasonEnvelope>;
1182
+ /**
1183
+ * Returns one deal reason
1184
+ *
1185
+ * Returns the deal reason; a retired reason comes back with `selectable: false`, because a deal can still reference it.
1186
+ *
1187
+ * Needs one of the scopes: `crm:deal:read`, `crm:deal:write`, `crm:dictionary:read`.
1188
+ *
1189
+ * @param id The deal reason's id, 8-4-4-4-12 hexadecimal.
1190
+ */
1191
+ get(id: T.PublicId, options?: UserApiCallOptions): Promise<T.DictionaryDealReasonEnvelope>;
1192
+ /**
1193
+ * Updates a deal reason
1194
+ *
1195
+ * Renames the reason or changes its kind. Deals keep the reason, but after a `kind` change a later deal write that sends it is refused.
1196
+ *
1197
+ * Needs one of the scopes: `crm:dictionary:write`.
1198
+ *
1199
+ * @param id The deal reason's id, 8-4-4-4-12 hexadecimal.
1200
+ */
1201
+ update(id: T.PublicId, body: T.DealReasonUpdateRequest, options?: UserApiCallOptions): Promise<T.DictionaryDealReasonEnvelope>;
1202
+ /**
1203
+ * Deletes a deal reason
1204
+ *
1205
+ * Retires the reason: it reads back with `selectable: false`, and the deals that hold it keep it. A reason a sales process closes deals with is refused.
1206
+ *
1207
+ * Needs one of the scopes: `crm:dictionary:delete`.
1208
+ *
1209
+ * @param id The deal reason's id, 8-4-4-4-12 hexadecimal.
1210
+ */
1211
+ delete(id: T.PublicId, options?: UserApiCallOptions): Promise<void>;
1212
+ }
1213
+ export interface UserApiDictionariesPositions {
1214
+ /**
1215
+ * Lists person positions
1216
+ *
1217
+ * Lists the positions a person write can send as `position.id`, ordered by `name` and then id. Positions have no archived state, so every listed position is selectable; a position with a blank name is not listed.
1218
+ *
1219
+ * Needs one of the scopes: `crm:person:read`, `crm:person:write`.
1220
+ */
1221
+ list(query?: {
1222
+ /**
1223
+ * Page number, 1-based. Default 1, maximum 10000.
1224
+ */
1225
+ page?: number;
1226
+ /**
1227
+ * Page size. Default 100, maximum 500; a larger value is refused, never clamped.
1228
+ */
1229
+ perPage?: number;
1230
+ }, options?: UserApiCallOptions): Promise<T.DictionaryPositionListEnvelope>;
1231
+ /**
1232
+ * Returns one person position
1233
+ *
1234
+ * Returns the position; `selectable` is always `true`, because positions have no archived state. A position with a blank name answers `404`.
1235
+ *
1236
+ * Needs one of the scopes: `crm:person:read`, `crm:person:write`.
1237
+ *
1238
+ * @param id The position's id, 8-4-4-4-12 hexadecimal.
1239
+ */
1240
+ get(id: T.PublicId, options?: UserApiCallOptions): Promise<T.DictionaryPositionEnvelope>;
1241
+ }
1242
+ export interface UserApiDictionariesConsentStatuses {
1243
+ /**
1244
+ * Lists consent statuses
1245
+ *
1246
+ * Lists the active consent statuses: the four system statuses first, then the custom ones by `name` and then id. `meaning` gives the fixed meaning of a system status, whatever its name.
1247
+ *
1248
+ * Needs one of the scopes: `crm:dictionary:read`, `crm:person:read`, `crm:person:write`, `crm:company:read`, `crm:company:write`.
1249
+ */
1250
+ list(query?: {
1251
+ /**
1252
+ * Page number, 1-based. Default 1, maximum 10000.
1253
+ */
1254
+ page?: number;
1255
+ /**
1256
+ * Page size. Default 100, maximum 500; a larger value is refused, never clamped.
1257
+ */
1258
+ perPage?: number;
1259
+ }, options?: UserApiCallOptions): Promise<T.DictionaryConsentStatusListEnvelope>;
1260
+ /**
1261
+ * Creates a consent status
1262
+ *
1263
+ * Creates a custom consent status. Two statuses may share a name.
1264
+ *
1265
+ * Needs one of the scopes: `crm:dictionary:write`.
1266
+ */
1267
+ create(body: T.ConsentStatusCreateRequest, options?: UserApiCallOptions): Promise<T.DictionaryConsentStatusEnvelope>;
1268
+ /**
1269
+ * Returns one consent status
1270
+ *
1271
+ * Returns the consent status; a deleted status comes back with `selectable: false`.
1272
+ *
1273
+ * Needs one of the scopes: `crm:dictionary:read`, `crm:person:read`, `crm:person:write`, `crm:company:read`, `crm:company:write`.
1274
+ *
1275
+ * @param id The source's id, 8-4-4-4-12 hexadecimal.
1276
+ */
1277
+ get(id: T.PublicId, options?: UserApiCallOptions): Promise<T.DictionaryConsentStatusEnvelope>;
1278
+ /**
1279
+ * Renames a consent status
1280
+ *
1281
+ * Changes the name of a custom status, and every consent already given with it shows the new name, also in the data-subject export.
1282
+ *
1283
+ * Needs one of the scopes: `crm:dictionary:write`.
1284
+ *
1285
+ * @param id The source's id, 8-4-4-4-12 hexadecimal.
1286
+ */
1287
+ rename(id: T.PublicId, body: T.ConsentStatusUpdateRequest, options?: UserApiCallOptions): Promise<T.DictionaryConsentStatusEnvelope>;
1288
+ /**
1289
+ * Deletes a consent status
1290
+ *
1291
+ * The custom status stops being selectable, consents given with it keep it, and the next edit of such a person in Livespace asks for a new status.
1292
+ *
1293
+ * Needs one of the scopes: `crm:dictionary:delete`.
1294
+ *
1295
+ * @param id The source's id, 8-4-4-4-12 hexadecimal.
1296
+ */
1297
+ delete(id: T.PublicId, options?: UserApiCallOptions): Promise<void>;
1298
+ }
1299
+ export interface UserApiDictionariesSources {
1300
+ /**
1301
+ * Lists acquisition sources
1302
+ *
1303
+ * Lists the active acquisition sources a person write can send as `source.id`, ordered by `name` and then id.
1304
+ *
1305
+ * Needs one of the scopes: `crm:person:read`, `crm:person:write`, `crm:dictionary:read`.
1306
+ */
1307
+ list(query?: {
1308
+ /**
1309
+ * Page number, 1-based. Default 1, maximum 10000.
1310
+ */
1311
+ page?: number;
1312
+ /**
1313
+ * Page size. Default 100, maximum 500; a larger value is refused, never clamped.
1314
+ */
1315
+ perPage?: number;
1316
+ }, options?: UserApiCallOptions): Promise<T.DictionarySourceListEnvelope>;
1317
+ /**
1318
+ * Creates a source
1319
+ *
1320
+ * Creates a top-level source. Two sources may share a name.
1321
+ *
1322
+ * Needs one of the scopes: `crm:dictionary:write`.
1323
+ */
1324
+ create(body: T.SourceCreateRequest, options?: UserApiCallOptions): Promise<T.DictionarySourceEnvelope>;
1325
+ /**
1326
+ * Returns one acquisition source
1327
+ *
1328
+ * Returns the source; an inactive source comes back with `selectable: false`.
1329
+ *
1330
+ * Needs one of the scopes: `crm:person:read`, `crm:person:write`, `crm:dictionary:read`.
1331
+ *
1332
+ * @param id The source's id, 8-4-4-4-12 hexadecimal.
1333
+ */
1334
+ get(id: T.PublicId, options?: UserApiCallOptions): Promise<T.DictionarySourceEnvelope>;
1335
+ /**
1336
+ * Renames a source
1337
+ *
1338
+ * Changes the name of the source.
1339
+ *
1340
+ * Needs one of the scopes: `crm:dictionary:write`.
1341
+ *
1342
+ * @param id The source's id, 8-4-4-4-12 hexadecimal.
1343
+ */
1344
+ rename(id: T.PublicId, body: T.SourceUpdateRequest, options?: UserApiCallOptions): Promise<T.DictionarySourceEnvelope>;
1345
+ /**
1346
+ * Deletes a source
1347
+ *
1348
+ * The source stops being selectable, and people, companies and deals that carry it keep it.
1349
+ *
1350
+ * Needs one of the scopes: `crm:dictionary:delete`.
1351
+ *
1352
+ * @param id The source's id, 8-4-4-4-12 hexadecimal.
1353
+ */
1354
+ delete(id: T.PublicId, options?: UserApiCallOptions): Promise<void>;
1355
+ }
1356
+ export interface UserApiNotifications {
1357
+ /**
1358
+ * Creates a notification
1359
+ *
1360
+ * Creates a notification in Livespace for a user, by default the integration user of the key. It sends no email or push message.
1361
+ *
1362
+ * Needs one of the scopes: `crm:notification:write`.
1363
+ */
1364
+ create(body: T.CreateNotificationRequest, options?: UserApiCallOptions): Promise<T.CreatedNotificationEnvelope>;
1365
+ }
1366
+ export interface UserApiCalls {
1367
+ /**
1368
+ * Returns one call
1369
+ *
1370
+ * Returns the call. Not found unless you see at least one record the call belongs to at full access.
1371
+ *
1372
+ * Needs one of the scopes: `crm:call:read`.
1373
+ *
1374
+ * @param id The call's id, 8-4-4-4-12 hexadecimal.
1375
+ */
1376
+ get(id: string, options?: UserApiCallOptions): Promise<T.CallEnvelope>;
1377
+ /**
1378
+ * Updates a call
1379
+ *
1380
+ * Updates the listed fields of the call; `number`, `direction`, `date` and `duration` change only on a call logged through this API. If the key can no longer read the call, `data` holds only its id.
1381
+ *
1382
+ * Needs one of the scopes: `crm:call:write`.
1383
+ *
1384
+ * @param id The call's id, 8-4-4-4-12 hexadecimal.
1385
+ */
1386
+ update(id: T.PublicId, body: T.UpdateCallRequest, options?: UserApiCallOptions): Promise<T.CallEnvelope | T.WrittenRecordIdEnvelope>;
1387
+ /**
1388
+ * Deletes a call
1389
+ *
1390
+ * Deletes the call from every timeline it is on; its `externalId` can then be used by a new call.
1391
+ *
1392
+ * Needs one of the scopes: `crm:call:delete`.
1393
+ *
1394
+ * @param id The call's id, 8-4-4-4-12 hexadecimal.
1395
+ */
1396
+ delete(id: T.PublicId, options?: UserApiCallOptions): Promise<void>;
1397
+ }
1398
+ export interface UserApiNotes {
1399
+ /**
1400
+ * Lists every note the caller may read
1401
+ *
1402
+ * Lists the active notes the caller may read, newest first: dashboard notes and notes on no record, on a visible task, or on a person, company, deal or space seen in full. `source`, `createdBy`, `dateFrom` and `dateTo` narrow the list.
1403
+ *
1404
+ * Needs one of the scopes: `crm:note:read`.
1405
+ */
1406
+ list(query?: {
1407
+ /**
1408
+ * Page number, 1-based. Default 1, maximum 10000.
1409
+ */
1410
+ page?: number;
1411
+ /**
1412
+ * Page size. Default 100, maximum 500; a larger value is refused, never clamped.
1413
+ */
1414
+ perPage?: number;
1415
+ /**
1416
+ * `dashboard` keeps notes on the dashboard, `record` keeps notes on a person, company, deal or space the caller sees in full. Absent: every note the caller may read.
1417
+ */
1418
+ source?: "dashboard" | "record";
1419
+ /**
1420
+ * The author's public user id. An unknown id is an empty page, not `400`.
1421
+ */
1422
+ createdBy?: string;
1423
+ /**
1424
+ * Inclusive lower bound on the note date. RFC 3339 with an offset, e.g. `2024-03-01T00:00:00Z`.
1425
+ */
1426
+ dateFrom?: string;
1427
+ /**
1428
+ * Inclusive upper bound on the note date, RFC 3339 with an offset, not before `dateFrom`.
1429
+ */
1430
+ dateTo?: string;
1431
+ }, options?: UserApiCallOptions): Promise<T.NoteListEnvelope>;
1432
+ /**
1433
+ * Creates a dashboard note
1434
+ *
1435
+ * Creates a note on the dashboard, attached to no record and written by the integration user of the key.
1436
+ *
1437
+ * Needs one of the scopes: `crm:note:write`.
1438
+ */
1439
+ create(body: T.CreateNoteRequest, options?: UserApiCallOptions): Promise<T.NoteEnvelope | T.WrittenRecordIdEnvelope>;
1440
+ /**
1441
+ * Returns one note
1442
+ *
1443
+ * Returns the note with its Livespace URL and `parents`, the active people, companies and deals it belongs to that the caller sees in full. A dashboard note, or one only on a space or a task, has `parents` `[]`.
1444
+ *
1445
+ * Needs one of the scopes: `crm:note:read`.
1446
+ *
1447
+ * @param id The note's id, 8-4-4-4-12 hexadecimal.
1448
+ */
1449
+ get(id: string, options?: UserApiCallOptions): Promise<T.NoteReadEnvelope>;
1450
+ /**
1451
+ * Updates a note
1452
+ *
1453
+ * Updates the listed fields of the note, as `UpdateNoteRequest` describes.
1454
+ *
1455
+ * Needs one of the scopes: `crm:note:write`.
1456
+ *
1457
+ * @param id The note's id, 8-4-4-4-12 hexadecimal.
1458
+ */
1459
+ update(id: string, body: T.UpdateNoteRequest, options?: UserApiCallOptions): Promise<T.NoteReadEnvelope | T.WrittenRecordIdEnvelope>;
1460
+ /**
1461
+ * Deletes a note
1462
+ *
1463
+ * Deletes the note and its tags.
1464
+ *
1465
+ * Needs one of the scopes: `crm:note:delete`.
1466
+ *
1467
+ * @param id The note's id, 8-4-4-4-12 hexadecimal.
1468
+ */
1469
+ delete(id: string, options?: UserApiCallOptions): Promise<void>;
1470
+ }
1471
+ export interface UserApiDeals {
1472
+ notes: UserApiDealsNotes;
1473
+ emails: UserApiDealsEmails;
1474
+ calls: UserApiDealsCalls;
1475
+ products: UserApiDealsProducts;
1476
+ costs: UserApiDealsCosts;
1477
+ budget: UserApiDealsBudget;
1478
+ process: UserApiDealsProcess;
1479
+ tasks: UserApiDealsTasks;
1480
+ /**
1481
+ * Creates or copies a deal
1482
+ *
1483
+ * Creates an open deal on the first active stage of a selectable process under `application/json` with `CreateDealRequest`, or copies a deal into a process under `application/vnd.ls-api.deal-copy.v2+json` with `CopyDealRequest`. If the key can no longer read the deal it wrote, `data` holds only its id (`WrittenRecordIdEnvelope`).
1484
+ *
1485
+ * Needs one of the scopes: `crm:deal:write`.
1486
+ */
1487
+ create(body: T.CreateDealRequest, options?: UserApiCallOptions): Promise<T.DealEnvelope | T.WrittenRecordIdEnvelope>;
1488
+ /**
1489
+ * Copies a deal into another sales process
1490
+ *
1491
+ * Creates an open deal on the first active stage of a selectable process under `application/json` with `CreateDealRequest`, or copies a deal into a process under `application/vnd.ls-api.deal-copy.v2+json` with `CopyDealRequest`. If the key can no longer read the deal it wrote, `data` holds only its id (`WrittenRecordIdEnvelope`).
1492
+ *
1493
+ * Needs one of the scopes: `crm:deal:write`.
1494
+ */
1495
+ copy(body: T.CopyDealRequest, options?: UserApiCallOptions): Promise<T.DealEnvelope | T.WrittenRecordIdEnvelope>;
1496
+ /**
1497
+ * Searches deals
1498
+ *
1499
+ * Lists the active deals that match a filter, sorted (by default `updatedAt desc`) and paged. Under `Accept: application/vnd.ls-api.extended.v2+json` each item is the full deal and a page holds at most 50 items.
1500
+ *
1501
+ * Needs one of the scopes: `crm:deal:read`.
1502
+ */
1503
+ search(body: T.SearchDealsRequest, options: UserApiCallOptions & {
1504
+ representation: "minimal";
1505
+ }): Promise<T.DealMinimalListEnvelope>;
1506
+ /**
1507
+ * Searches deals
1508
+ *
1509
+ * Lists the active deals that match a filter, sorted (by default `updatedAt desc`) and paged. Under `Accept: application/vnd.ls-api.extended.v2+json` each item is the full deal and a page holds at most 50 items.
1510
+ *
1511
+ * Needs one of the scopes: `crm:deal:read`.
1512
+ */
1513
+ search(body: T.SearchDealsRequest, options: UserApiCallOptions & {
1514
+ representation: "extended";
1515
+ }): Promise<T.DealExtendedListEnvelope>;
1516
+ /**
1517
+ * Searches deals
1518
+ *
1519
+ * Lists the active deals that match a filter, sorted (by default `updatedAt desc`) and paged. Under `Accept: application/vnd.ls-api.extended.v2+json` each item is the full deal and a page holds at most 50 items.
1520
+ *
1521
+ * Needs one of the scopes: `crm:deal:read`.
1522
+ */
1523
+ search(body: T.SearchDealsRequest, options?: UserApiCallOptions & {
1524
+ representation?: "default";
1525
+ }): Promise<T.DealListEnvelope>;
1526
+ /**
1527
+ * Returns one deal
1528
+ *
1529
+ * Returns the deal; at limited access it keeps its identity, status, visibility, dates, `process`, `currentStage` and `url`. Under `Accept: application/vnd.ls-api.minimal.v2+json` it returns the minimal representation.
1530
+ *
1531
+ * Needs one of the scopes: `crm:deal:read`.
1532
+ *
1533
+ * @param id The deal's id, 8-4-4-4-12 hexadecimal.
1534
+ */
1535
+ get(id: string, options: UserApiCallOptions & {
1536
+ representation: "minimal";
1537
+ }): Promise<T.DealMinimalEnvelope>;
1538
+ /**
1539
+ * Returns one deal
1540
+ *
1541
+ * Returns the deal; at limited access it keeps its identity, status, visibility, dates, `process`, `currentStage` and `url`. Under `Accept: application/vnd.ls-api.minimal.v2+json` it returns the minimal representation.
1542
+ *
1543
+ * Needs one of the scopes: `crm:deal:read`.
1544
+ *
1545
+ * @param id The deal's id, 8-4-4-4-12 hexadecimal.
1546
+ */
1547
+ get(id: string, options?: UserApiCallOptions & {
1548
+ representation?: "default";
1549
+ }): Promise<T.DealEnvelope>;
1550
+ /**
1551
+ * Updates a deal
1552
+ *
1553
+ * Updates the deal under `application/json` with `UpdateDealRequest`, or changes its status under `application/vnd.ls-api.deal-status.v2+json` with `ChangeDealStatusRequest`. A move to `won` is refused while a mandatory step is open, a required product line is missing or a field required for a win is empty.
1554
+ *
1555
+ * Needs one of the scopes: `crm:deal:write`.
1556
+ *
1557
+ * @param id The deal's id, 8-4-4-4-12 hexadecimal.
1558
+ */
1559
+ update(id: T.PublicId, body: T.UpdateDealRequest, options?: UserApiCallOptions): Promise<T.DealEnvelope | T.WrittenRecordIdEnvelope>;
1560
+ /**
1561
+ * Changes a deal's status
1562
+ *
1563
+ * Updates the deal under `application/json` with `UpdateDealRequest`, or changes its status under `application/vnd.ls-api.deal-status.v2+json` with `ChangeDealStatusRequest`. A move to `won` is refused while a mandatory step is open, a required product line is missing or a field required for a win is empty.
1564
+ *
1565
+ * Needs one of the scopes: `crm:deal:write`.
1566
+ *
1567
+ * @param id The deal's id, 8-4-4-4-12 hexadecimal.
1568
+ */
1569
+ changeStatus(id: T.PublicId, body: T.ChangeDealStatusRequest, options?: UserApiCallOptions): Promise<T.DealEnvelope | T.WrittenRecordIdEnvelope>;
1570
+ /**
1571
+ * Deletes a deal
1572
+ *
1573
+ * Deletes the deal; its lines, notes and other linked entries stay.
1574
+ *
1575
+ * Needs one of the scopes: `crm:deal:delete`.
1576
+ *
1577
+ * @param id The deal's id, 8-4-4-4-12 hexadecimal.
1578
+ */
1579
+ delete(id: T.PublicId, options?: UserApiCallOptions): Promise<void>;
1580
+ }
1581
+ export interface UserApiDealsTasks {
1582
+ /**
1583
+ * Creates a task on a deal
1584
+ *
1585
+ * Creates a task linked to the deal and fires the `task.created` webhook. If the key can no longer read the task, `data` holds only its id.
1586
+ *
1587
+ * Needs one of the scopes: `crm:task:write`.
1588
+ *
1589
+ * @param id The deal's id, 8-4-4-4-12 hexadecimal.
1590
+ */
1591
+ create(id: T.PublicId, body: T.CreateTaskRequest, options?: UserApiCallOptions): Promise<T.TaskEnvelope | T.WrittenRecordIdEnvelope>;
1592
+ /**
1593
+ * Updates a task on a deal
1594
+ *
1595
+ * Updates the task linked to the deal under `application/json`, or completes or reopens it with an empty body under `application/vnd.ls-api.task-complete.v2+json` or `application/vnd.ls-api.task-reopen.v2+json`. Completing a completed task or reopening an open one changes nothing.
1596
+ *
1597
+ * Needs one of the scopes: `crm:task:write`.
1598
+ *
1599
+ * @param id The deal's id, 8-4-4-4-12 hexadecimal.
1600
+ *
1601
+ * @param taskId The task's id, 8-4-4-4-12 hexadecimal. A task not linked to `{id}` answers `404`.
1602
+ */
1603
+ update(id: T.PublicId, taskId: T.PublicId, body?: T.UpdateTaskRequest, options?: UserApiCallOptions): Promise<T.TaskEnvelope | T.WrittenRecordIdEnvelope>;
1604
+ /**
1605
+ * Completes a task on a deal
1606
+ *
1607
+ * Updates the task linked to the deal under `application/json`, or completes or reopens it with an empty body under `application/vnd.ls-api.task-complete.v2+json` or `application/vnd.ls-api.task-reopen.v2+json`. Completing a completed task or reopening an open one changes nothing.
1608
+ *
1609
+ * Needs one of the scopes: `crm:task:write`.
1610
+ *
1611
+ * @param id The deal's id, 8-4-4-4-12 hexadecimal.
1612
+ *
1613
+ * @param taskId The task's id, 8-4-4-4-12 hexadecimal. A task not linked to `{id}` answers `404`.
1614
+ */
1615
+ complete(id: T.PublicId, taskId: T.PublicId, options?: UserApiCallOptions): Promise<T.TaskEnvelope | T.WrittenRecordIdEnvelope>;
1616
+ /**
1617
+ * Reopens a task on a deal
1618
+ *
1619
+ * Updates the task linked to the deal under `application/json`, or completes or reopens it with an empty body under `application/vnd.ls-api.task-complete.v2+json` or `application/vnd.ls-api.task-reopen.v2+json`. Completing a completed task or reopening an open one changes nothing.
1620
+ *
1621
+ * Needs one of the scopes: `crm:task:write`.
1622
+ *
1623
+ * @param id The deal's id, 8-4-4-4-12 hexadecimal.
1624
+ *
1625
+ * @param taskId The task's id, 8-4-4-4-12 hexadecimal. A task not linked to `{id}` answers `404`.
1626
+ */
1627
+ reopen(id: T.PublicId, taskId: T.PublicId, options?: UserApiCallOptions): Promise<T.TaskEnvelope | T.WrittenRecordIdEnvelope>;
1628
+ }
1629
+ export interface UserApiDealsProcess {
1630
+ /**
1631
+ * Reads the process progress of a deal
1632
+ *
1633
+ * Returns the deal's process with its current stage and its active stages and steps in order, each stage with its `state`. `stages` is empty when you see the deal at basic access.
1634
+ *
1635
+ * Needs one of the scopes: `crm:deal:read`.
1636
+ *
1637
+ * @param id The deal's id, 8-4-4-4-12 hexadecimal.
1638
+ */
1639
+ get(id: string, options?: UserApiCallOptions): Promise<T.DealProcessEnvelope>;
1640
+ /**
1641
+ * Completes or reopens steps of a deal's process
1642
+ *
1643
+ * Completes or reopens the listed steps of the deal's process, in any stage, and returns the process as `GET /deals/{id}/process` shows it. If one step is refused, no step changes; the stage and probability follow the furthest completed step.
1644
+ *
1645
+ * Needs one of the scopes: `crm:deal:write`.
1646
+ *
1647
+ * @param id The deal's id, 8-4-4-4-12 hexadecimal.
1648
+ */
1649
+ update(id: T.PublicId, body: T.UpdateDealProcessRequest, options?: UserApiCallOptions): Promise<T.DealProcessEnvelope | T.WrittenRecordIdEnvelope>;
1650
+ }
1651
+ export interface UserApiDealsBudget {
1652
+ /**
1653
+ * Reads the budget summary of a deal
1654
+ *
1655
+ * Returns the deal's budget summary as Livespace last computed it from the lines: revenue, cost, margin and quantity, each forecast and executed, in the deal's currency. At limited access `data` is `null`.
1656
+ *
1657
+ * Needs one of the scopes: `crm:deal:read`.
1658
+ *
1659
+ * @param id The deal's id, 8-4-4-4-12 hexadecimal.
1660
+ */
1661
+ get(id: string, options?: UserApiCallOptions): Promise<T.DealBudgetSummaryEnvelope>;
1662
+ }
1663
+ export interface UserApiDealsCosts {
1664
+ /**
1665
+ * Lists the cost lines of a deal
1666
+ *
1667
+ * Lists the active cost lines of the deal in line order, every line of a recurring cycle included, whatever `costsEnabled` says. At limited access the list is empty.
1668
+ *
1669
+ * Needs one of the scopes: `crm:deal:read`.
1670
+ *
1671
+ * @param id The deal's id, 8-4-4-4-12 hexadecimal.
1672
+ */
1673
+ list(id: string, query?: {
1674
+ /**
1675
+ * Page number, 1-based. Default 1, maximum 10000.
1676
+ */
1677
+ page?: number;
1678
+ /**
1679
+ * Page size. Default 100, maximum 500; a larger value is refused, never clamped.
1680
+ */
1681
+ perPage?: number;
1682
+ }, options?: UserApiCallOptions): Promise<T.DealCostLineListEnvelope>;
1683
+ /**
1684
+ * Adds a cost line to a deal
1685
+ *
1686
+ * Adds one cost line, or with `application/vnd.ls-api.deal-lines.v2+json` up to 100 together or none, each with a required `unitPrice` and no margin, and updates the budget summary. Refused while `costsEnabled` is off; the caller needs full access to the deal and the right to edit it.
1687
+ *
1688
+ * Needs one of the scopes: `crm:deal:write`.
1689
+ *
1690
+ * @param id The deal's id, 8-4-4-4-12 hexadecimal.
1691
+ */
1692
+ create(id: T.PublicId, body: T.DealCostLineCreate, options?: UserApiCallOptions): Promise<T.DealCostLineEnvelope | T.DealCostLinesBatchEnvelope>;
1693
+ /**
1694
+ * Adds several cost lines to a deal, all or none
1695
+ *
1696
+ * Adds one cost line, or with `application/vnd.ls-api.deal-lines.v2+json` up to 100 together or none, each with a required `unitPrice` and no margin, and updates the budget summary. Refused while `costsEnabled` is off; the caller needs full access to the deal and the right to edit it.
1697
+ *
1698
+ * Needs one of the scopes: `crm:deal:write`.
1699
+ *
1700
+ * @param id The deal's id, 8-4-4-4-12 hexadecimal.
1701
+ */
1702
+ createMany(id: T.PublicId, body: T.DealCostLinesBatchRequest, options?: UserApiCallOptions): Promise<T.DealCostLineEnvelope | T.DealCostLinesBatchEnvelope>;
1703
+ /**
1704
+ * Reads one cost line of a deal
1705
+ *
1706
+ * Returns the cost line. At limited access, and for a revenue line, it answers `404`.
1707
+ *
1708
+ * Needs one of the scopes: `crm:deal:read`.
1709
+ *
1710
+ * @param id The deal's id, 8-4-4-4-12 hexadecimal.
1711
+ *
1712
+ * @param lineId The line's id, 8-4-4-4-12 hexadecimal. A line of another deal, a revenue line, a removed line or a later line of a recurring cycle answers `404`.
1713
+ */
1714
+ get(id: T.PublicId, lineId: T.PublicId, options?: UserApiCallOptions): Promise<T.DealCostLineEnvelope>;
1715
+ /**
1716
+ * Changes a cost line of a deal
1717
+ *
1718
+ * Updates the keys the body carries and recomputes every amount of the line; an empty body changes nothing. It is refused while `costsEnabled` is off, and the caller needs full access to the deal and the right to edit it.
1719
+ *
1720
+ * Needs one of the scopes: `crm:deal:write`.
1721
+ *
1722
+ * @param id The deal's id, 8-4-4-4-12 hexadecimal.
1723
+ *
1724
+ * @param lineId The line's id, 8-4-4-4-12 hexadecimal. A line of another deal, a revenue line, a removed line or a later line of a recurring cycle answers `404`.
1725
+ */
1726
+ update(id: T.PublicId, lineId: T.PublicId, body: T.DealCostLineUpdate, options?: UserApiCallOptions): Promise<T.DealCostLineEnvelope>;
1727
+ /**
1728
+ * Removes a cost line from a deal
1729
+ *
1730
+ * Removes the cost line and updates the deal's budget summary; the main line of a recurring cycle cannot be removed. It is refused while `costsEnabled` is off, and the caller needs full access to the deal and the right to edit it.
1731
+ *
1732
+ * Needs one of the scopes: `crm:deal:write`.
1733
+ *
1734
+ * @param id The deal's id, 8-4-4-4-12 hexadecimal.
1735
+ *
1736
+ * @param lineId The line's id, 8-4-4-4-12 hexadecimal. A line of another deal, a revenue line, a removed line or a later line of a recurring cycle answers `404`.
1737
+ */
1738
+ delete(id: T.PublicId, lineId: T.PublicId, options?: UserApiCallOptions): Promise<void>;
1739
+ }
1740
+ export interface UserApiDealsProducts {
1741
+ /**
1742
+ * Lists the product lines of a deal
1743
+ *
1744
+ * Lists the active revenue lines of the deal in line order, every line of a recurring cycle included. At limited access the list is empty.
1745
+ *
1746
+ * Needs one of the scopes: `crm:deal:read`.
1747
+ *
1748
+ * @param id The deal's id, 8-4-4-4-12 hexadecimal.
1749
+ */
1750
+ list(id: string, query?: {
1751
+ /**
1752
+ * Page number, 1-based. Default 1, maximum 10000.
1753
+ */
1754
+ page?: number;
1755
+ /**
1756
+ * Page size. Default 100, maximum 500; a larger value is refused, never clamped.
1757
+ */
1758
+ perPage?: number;
1759
+ }, options?: UserApiCallOptions): Promise<T.DealProductLineListEnvelope>;
1760
+ /**
1761
+ * Adds a product line to a deal
1762
+ *
1763
+ * Adds one revenue line, or with `application/vnd.ls-api.deal-lines.v2+json` up to 100 lines together or none, in the deal's currency, and updates the deal's budget summary. The caller needs full access to the deal and the right to edit it.
1764
+ *
1765
+ * Needs one of the scopes: `crm:deal:write`.
1766
+ *
1767
+ * @param id The deal's id, 8-4-4-4-12 hexadecimal.
1768
+ */
1769
+ create(id: T.PublicId, body: T.DealProductLineCreate, options?: UserApiCallOptions): Promise<T.DealProductLineEnvelope | T.DealProductLinesBatchEnvelope>;
1770
+ /**
1771
+ * Adds several product lines to a deal, all or none
1772
+ *
1773
+ * Adds one revenue line, or with `application/vnd.ls-api.deal-lines.v2+json` up to 100 lines together or none, in the deal's currency, and updates the deal's budget summary. The caller needs full access to the deal and the right to edit it.
1774
+ *
1775
+ * Needs one of the scopes: `crm:deal:write`.
1776
+ *
1777
+ * @param id The deal's id, 8-4-4-4-12 hexadecimal.
1778
+ */
1779
+ createMany(id: T.PublicId, body: T.DealProductLinesBatchRequest, options?: UserApiCallOptions): Promise<T.DealProductLineEnvelope | T.DealProductLinesBatchEnvelope>;
1780
+ /**
1781
+ * Reads one product line of a deal
1782
+ *
1783
+ * Returns the revenue line. At limited access, and for a cost line, it answers `404`.
1784
+ *
1785
+ * Needs one of the scopes: `crm:deal:read`.
1786
+ *
1787
+ * @param id The deal's id, 8-4-4-4-12 hexadecimal.
1788
+ *
1789
+ * @param lineId The line's id, 8-4-4-4-12 hexadecimal. A line of another deal, a cost line, a removed line or a later line of a recurring cycle answers `404`.
1790
+ */
1791
+ get(id: T.PublicId, lineId: T.PublicId, options?: UserApiCallOptions): Promise<T.DealProductLineEnvelope>;
1792
+ /**
1793
+ * Changes a product line of a deal
1794
+ *
1795
+ * Updates the keys the body carries and recomputes every amount of the line; an empty body changes nothing. The caller needs full access to the deal and the right to edit it.
1796
+ *
1797
+ * Needs one of the scopes: `crm:deal:write`.
1798
+ *
1799
+ * @param id The deal's id, 8-4-4-4-12 hexadecimal.
1800
+ *
1801
+ * @param lineId The line's id, 8-4-4-4-12 hexadecimal. A line of another deal, a cost line, a removed line or a later line of a recurring cycle answers `404`.
1802
+ */
1803
+ update(id: T.PublicId, lineId: T.PublicId, body: T.DealProductLineUpdate, options?: UserApiCallOptions): Promise<T.DealProductLineEnvelope>;
1804
+ /**
1805
+ * Removes a product line from a deal
1806
+ *
1807
+ * Removes the line and updates the deal's budget summary; the main line of a recurring cycle cannot be removed. The caller needs full access to the deal and the right to edit it.
1808
+ *
1809
+ * Needs one of the scopes: `crm:deal:write`.
1810
+ *
1811
+ * @param id The deal's id, 8-4-4-4-12 hexadecimal.
1812
+ *
1813
+ * @param lineId The line's id, 8-4-4-4-12 hexadecimal. A line of another deal, a cost line, a removed line or a later line of a recurring cycle answers `404`.
1814
+ */
1815
+ delete(id: T.PublicId, lineId: T.PublicId, options?: UserApiCallOptions): Promise<void>;
1816
+ }
1817
+ export interface UserApiDealsCalls {
1818
+ /**
1819
+ * Lists calls for a deal
1820
+ *
1821
+ * Lists the calls on this deal's own timeline, newest first, each call on its own even when calls share a timeline entry. Empty when you see the record at basic access.
1822
+ *
1823
+ * Needs one of the scopes: `crm:call:read`.
1824
+ *
1825
+ * @param id The deal's id, 8-4-4-4-12 hexadecimal.
1826
+ */
1827
+ list(id: string, query?: {
1828
+ /**
1829
+ * Page number, 1-based. Default 1, maximum 10000.
1830
+ */
1831
+ page?: number;
1832
+ /**
1833
+ * Page size. Default 100, maximum 500; a larger value is refused, never clamped.
1834
+ */
1835
+ perPage?: number;
1836
+ }, options?: UserApiCallOptions): Promise<T.CallListEnvelope>;
1837
+ /**
1838
+ * Logs a call on a deal
1839
+ *
1840
+ * Logs a call on the deal, attributed to `user` when the key names one, otherwise to the integration user of the key.
1841
+ *
1842
+ * Needs one of the scopes: `crm:call:write`.
1843
+ *
1844
+ * @param id The deal's id, 8-4-4-4-12 hexadecimal.
1845
+ */
1846
+ create(id: string, body: T.CreateCallRequest, options?: UserApiCallOptions): Promise<T.CallEnvelope>;
1847
+ }
1848
+ export interface UserApiDealsEmails {
1849
+ /**
1850
+ * Lists emails for a deal
1851
+ *
1852
+ * Lists the emails on this deal's own timeline, newest first, without those only on its company or person. Empty when you see the record at basic access.
1853
+ *
1854
+ * Needs one of the scopes: `crm:email:read`.
1855
+ *
1856
+ * @param id The deal's id, 8-4-4-4-12 hexadecimal.
1857
+ */
1858
+ list(id: string, query?: {
1859
+ /**
1860
+ * Page number, 1-based. Default 1, maximum 10000.
1861
+ */
1862
+ page?: number;
1863
+ /**
1864
+ * Page size. Default 100, maximum 500; a larger value is refused, never clamped.
1865
+ */
1866
+ perPage?: number;
1867
+ }, options?: UserApiCallOptions): Promise<T.NestedEmailListEnvelope>;
1868
+ }
1869
+ export interface UserApiDealsNotes {
1870
+ /**
1871
+ * Lists notes for a deal
1872
+ *
1873
+ * Lists the notes on this deal's own timeline, newest `date` first, without those only on its company or person. Empty when you see the record at basic access.
1874
+ *
1875
+ * Needs one of the scopes: `crm:note:read`.
1876
+ *
1877
+ * @param id The deal's id, 8-4-4-4-12 hexadecimal.
1878
+ */
1879
+ list(id: string, query?: {
1880
+ /**
1881
+ * Page number, 1-based. Default 1, maximum 10000.
1882
+ */
1883
+ page?: number;
1884
+ /**
1885
+ * Page size. Default 100, maximum 500; a larger value is refused, never clamped.
1886
+ */
1887
+ perPage?: number;
1888
+ }, options?: UserApiCallOptions): Promise<T.NoteListEnvelope>;
1889
+ /**
1890
+ * Creates a note on a deal
1891
+ *
1892
+ * Creates a note on the deal, written by the integration user of the key; `data.url` links the note in Livespace.
1893
+ *
1894
+ * Needs one of the scopes: `crm:note:write`.
1895
+ *
1896
+ * @param id The deal's id, 8-4-4-4-12 hexadecimal.
1897
+ */
1898
+ create(id: string, body: T.CreateNoteRequest, options?: UserApiCallOptions): Promise<T.NoteEnvelope>;
1899
+ }
1900
+ export interface UserApiCompanies {
1901
+ notes: UserApiCompaniesNotes;
1902
+ emails: UserApiCompaniesEmails;
1903
+ calls: UserApiCompaniesCalls;
1904
+ tasks: UserApiCompaniesTasks;
1905
+ /**
1906
+ * Creates a company
1907
+ *
1908
+ * Creates a company; `name` is required. If the key can no longer read the company it wrote, `data` holds only its id (`WrittenRecordIdEnvelope`).
1909
+ *
1910
+ * Needs one of the scopes: `crm:company:write`.
1911
+ */
1912
+ create(body: T.CreateCompanyRequest, options?: UserApiCallOptions): Promise<T.CompanyEnvelope | T.WrittenRecordIdEnvelope>;
1913
+ /**
1914
+ * Searches companies
1915
+ *
1916
+ * Lists the active companies that match a filter, sorted and paged; the default sort is `updatedAt desc`. A condition on `taxId` ignores spaces and dashes, and at limited access a condition on `owners` still matches.
1917
+ *
1918
+ * Needs one of the scopes: `crm:company:read`.
1919
+ */
1920
+ search(body: T.SearchCompaniesRequest, options: UserApiCallOptions & {
1921
+ representation: "minimal";
1922
+ }): Promise<T.CompanyMinimalListEnvelope>;
1923
+ /**
1924
+ * Searches companies
1925
+ *
1926
+ * Lists the active companies that match a filter, sorted and paged; the default sort is `updatedAt desc`. A condition on `taxId` ignores spaces and dashes, and at limited access a condition on `owners` still matches.
1927
+ *
1928
+ * Needs one of the scopes: `crm:company:read`.
1929
+ */
1930
+ search(body: T.SearchCompaniesRequest, options?: UserApiCallOptions & {
1931
+ representation?: "default";
1932
+ }): Promise<T.CompanyListEnvelope>;
1933
+ /**
1934
+ * Returns one company
1935
+ *
1936
+ * Returns the company. Under `Accept: application/vnd.ls-api.minimal.v2+json` it returns the minimal representation, whose `extra.permissions.additionalFields` is always `{}`.
1937
+ *
1938
+ * Needs one of the scopes: `crm:company:read`.
1939
+ *
1940
+ * @param id The company's id, 8-4-4-4-12 hexadecimal.
1941
+ */
1942
+ get(id: T.PublicId, options: UserApiCallOptions & {
1943
+ representation: "minimal";
1944
+ }): Promise<T.CompanyMinimalEnvelope>;
1945
+ /**
1946
+ * Returns one company
1947
+ *
1948
+ * Returns the company. Under `Accept: application/vnd.ls-api.minimal.v2+json` it returns the minimal representation, whose `extra.permissions.additionalFields` is always `{}`.
1949
+ *
1950
+ * Needs one of the scopes: `crm:company:read`.
1951
+ *
1952
+ * @param id The company's id, 8-4-4-4-12 hexadecimal.
1953
+ */
1954
+ get(id: T.PublicId, options?: UserApiCallOptions & {
1955
+ representation?: "default";
1956
+ }): Promise<T.CompanyEnvelope>;
1957
+ /**
1958
+ * Updates a company
1959
+ *
1960
+ * Updates the company: a key left out stays, `null` clears a nullable field and a list replaces the whole list. If the key can no longer read the company, `data` holds only its id.
1961
+ *
1962
+ * Needs one of the scopes: `crm:company:write`.
1963
+ *
1964
+ * @param id The company's id, 8-4-4-4-12 hexadecimal.
1965
+ */
1966
+ update(id: T.PublicId, body: T.UpdateCompanyRequest, options?: UserApiCallOptions): Promise<T.CompanyEnvelope | T.WrittenRecordIdEnvelope>;
1967
+ /**
1968
+ * Deletes a company
1969
+ *
1970
+ * Deletes the company.
1971
+ *
1972
+ * Needs one of the scopes: `crm:company:delete`.
1973
+ *
1974
+ * @param id The company's id, 8-4-4-4-12 hexadecimal.
1975
+ */
1976
+ delete(id: T.PublicId, options?: UserApiCallOptions): Promise<void>;
1977
+ }
1978
+ export interface UserApiCompaniesTasks {
1979
+ /**
1980
+ * Creates a task on a company
1981
+ *
1982
+ * Creates a task linked to the company and fires the `task.created` webhook. If the key can no longer read the task, `data` holds only its id.
1983
+ *
1984
+ * Needs one of the scopes: `crm:task:write`.
1985
+ *
1986
+ * @param id The company's id, 8-4-4-4-12 hexadecimal.
1987
+ */
1988
+ create(id: T.PublicId, body: T.CreateTaskRequest, options?: UserApiCallOptions): Promise<T.TaskEnvelope | T.WrittenRecordIdEnvelope>;
1989
+ /**
1990
+ * Updates a task on a company
1991
+ *
1992
+ * Updates the task linked to the company under `application/json`, or completes or reopens it with an empty body under `application/vnd.ls-api.task-complete.v2+json` or `application/vnd.ls-api.task-reopen.v2+json`. Completing a completed task or reopening an open one changes nothing.
1993
+ *
1994
+ * Needs one of the scopes: `crm:task:write`.
1995
+ *
1996
+ * @param id The company's id, 8-4-4-4-12 hexadecimal.
1997
+ *
1998
+ * @param taskId The task's id, 8-4-4-4-12 hexadecimal. A task not linked to `{id}` answers `404`.
1999
+ */
2000
+ update(id: T.PublicId, taskId: T.PublicId, body?: T.UpdateTaskRequest, options?: UserApiCallOptions): Promise<T.TaskEnvelope | T.WrittenRecordIdEnvelope>;
2001
+ /**
2002
+ * Completes a task on a company
2003
+ *
2004
+ * Updates the task linked to the company under `application/json`, or completes or reopens it with an empty body under `application/vnd.ls-api.task-complete.v2+json` or `application/vnd.ls-api.task-reopen.v2+json`. Completing a completed task or reopening an open one changes nothing.
2005
+ *
2006
+ * Needs one of the scopes: `crm:task:write`.
2007
+ *
2008
+ * @param id The company's id, 8-4-4-4-12 hexadecimal.
2009
+ *
2010
+ * @param taskId The task's id, 8-4-4-4-12 hexadecimal. A task not linked to `{id}` answers `404`.
2011
+ */
2012
+ complete(id: T.PublicId, taskId: T.PublicId, options?: UserApiCallOptions): Promise<T.TaskEnvelope | T.WrittenRecordIdEnvelope>;
2013
+ /**
2014
+ * Reopens a task on a company
2015
+ *
2016
+ * Updates the task linked to the company under `application/json`, or completes or reopens it with an empty body under `application/vnd.ls-api.task-complete.v2+json` or `application/vnd.ls-api.task-reopen.v2+json`. Completing a completed task or reopening an open one changes nothing.
2017
+ *
2018
+ * Needs one of the scopes: `crm:task:write`.
2019
+ *
2020
+ * @param id The company's id, 8-4-4-4-12 hexadecimal.
2021
+ *
2022
+ * @param taskId The task's id, 8-4-4-4-12 hexadecimal. A task not linked to `{id}` answers `404`.
2023
+ */
2024
+ reopen(id: T.PublicId, taskId: T.PublicId, options?: UserApiCallOptions): Promise<T.TaskEnvelope | T.WrittenRecordIdEnvelope>;
2025
+ }
2026
+ export interface UserApiCompaniesCalls {
2027
+ /**
2028
+ * Lists calls for a company
2029
+ *
2030
+ * Lists the calls on this company's own timeline, newest first, each call on its own even when calls share a timeline entry. Empty when you see the record at basic access.
2031
+ *
2032
+ * Needs one of the scopes: `crm:call:read`.
2033
+ *
2034
+ * @param id The company's id, 8-4-4-4-12 hexadecimal.
2035
+ */
2036
+ list(id: string, query?: {
2037
+ /**
2038
+ * Page number, 1-based. Default 1, maximum 10000.
2039
+ */
2040
+ page?: number;
2041
+ /**
2042
+ * Page size. Default 100, maximum 500; a larger value is refused, never clamped.
2043
+ */
2044
+ perPage?: number;
2045
+ }, options?: UserApiCallOptions): Promise<T.CallListEnvelope>;
2046
+ /**
2047
+ * Logs a call on a company
2048
+ *
2049
+ * Logs a call on the company, attributed to `user` when the key names one, otherwise to the integration user of the key.
2050
+ *
2051
+ * Needs one of the scopes: `crm:call:write`.
2052
+ *
2053
+ * @param id The company's id, 8-4-4-4-12 hexadecimal.
2054
+ */
2055
+ create(id: string, body: T.CreateCallRequest, options?: UserApiCallOptions): Promise<T.CallEnvelope>;
2056
+ }
2057
+ export interface UserApiCompaniesEmails {
2058
+ /**
2059
+ * Lists emails for a company
2060
+ *
2061
+ * Lists the emails on this company's own timeline, newest first, without those only on its people or deals. Empty when you see the record at basic access.
2062
+ *
2063
+ * Needs one of the scopes: `crm:email:read`.
2064
+ *
2065
+ * @param id The company's id, 8-4-4-4-12 hexadecimal.
2066
+ */
2067
+ list(id: string, query?: {
2068
+ /**
2069
+ * Page number, 1-based. Default 1, maximum 10000.
2070
+ */
2071
+ page?: number;
2072
+ /**
2073
+ * Page size. Default 100, maximum 500; a larger value is refused, never clamped.
2074
+ */
2075
+ perPage?: number;
2076
+ }, options?: UserApiCallOptions): Promise<T.NestedEmailListEnvelope>;
2077
+ }
2078
+ export interface UserApiCompaniesNotes {
2079
+ /**
2080
+ * Lists notes for a company
2081
+ *
2082
+ * Lists the notes on this company's own timeline, newest `date` first, without those only on its people or deals. Empty when you see the record at basic access.
2083
+ *
2084
+ * Needs one of the scopes: `crm:note:read`.
2085
+ *
2086
+ * @param id The company's id, 8-4-4-4-12 hexadecimal.
2087
+ */
2088
+ list(id: string, query?: {
2089
+ /**
2090
+ * Page number, 1-based. Default 1, maximum 10000.
2091
+ */
2092
+ page?: number;
2093
+ /**
2094
+ * Page size. Default 100, maximum 500; a larger value is refused, never clamped.
2095
+ */
2096
+ perPage?: number;
2097
+ }, options?: UserApiCallOptions): Promise<T.NoteListEnvelope>;
2098
+ /**
2099
+ * Creates a note on a company
2100
+ *
2101
+ * Creates a note on the company, written by the integration user of the key; `data.url` links the note in Livespace.
2102
+ *
2103
+ * Needs one of the scopes: `crm:note:write`.
2104
+ *
2105
+ * @param id The company's id, 8-4-4-4-12 hexadecimal.
2106
+ */
2107
+ create(id: string, body: T.CreateNoteRequest, options?: UserApiCallOptions): Promise<T.NoteEnvelope>;
2108
+ }
2109
+ export interface UserApiPeople {
2110
+ notes: UserApiPeopleNotes;
2111
+ emails: UserApiPeopleEmails;
2112
+ calls: UserApiPeopleCalls;
2113
+ tasks: UserApiPeopleTasks;
2114
+ /**
2115
+ * Creates a person
2116
+ *
2117
+ * Creates a person under `application/json` with `CreatePersonRequest`, or a person together with a new company under `application/vnd.ls-api.person-with-company.v2+json` with `CreatePersonWithCompanyRequest`, which writes both or neither. If the key can no longer read the person it wrote, `data` holds only its id (`WrittenRecordIdEnvelope`).
2118
+ *
2119
+ * Needs one of the scopes: `crm:person:write`.
2120
+ */
2121
+ create(body: T.CreatePersonRequest, options?: UserApiCallOptions): Promise<T.PersonEnvelope | T.WrittenRecordIdEnvelope>;
2122
+ /**
2123
+ * Creates a person together with a new company
2124
+ *
2125
+ * Creates a person under `application/json` with `CreatePersonRequest`, or a person together with a new company under `application/vnd.ls-api.person-with-company.v2+json` with `CreatePersonWithCompanyRequest`, which writes both or neither. If the key can no longer read the person it wrote, `data` holds only its id (`WrittenRecordIdEnvelope`).
2126
+ *
2127
+ * Needs one of the scopes: `crm:person:write`.
2128
+ */
2129
+ createWithCompany(body: T.CreatePersonWithCompanyRequest, options?: UserApiCallOptions): Promise<T.PersonEnvelope | T.WrittenRecordIdEnvelope>;
2130
+ /**
2131
+ * Searches people
2132
+ *
2133
+ * Lists the active people that match a filter, sorted and paged; the default sort is `updatedAt desc`. At limited access a condition on `owners` still matches, because the owner users stay visible.
2134
+ *
2135
+ * Needs one of the scopes: `crm:person:read`.
2136
+ */
2137
+ search(body: T.SearchPeopleRequest, options: UserApiCallOptions & {
2138
+ representation: "minimal";
2139
+ }): Promise<T.PersonMinimalListEnvelope>;
2140
+ /**
2141
+ * Searches people
2142
+ *
2143
+ * Lists the active people that match a filter, sorted and paged; the default sort is `updatedAt desc`. At limited access a condition on `owners` still matches, because the owner users stay visible.
2144
+ *
2145
+ * Needs one of the scopes: `crm:person:read`.
2146
+ */
2147
+ search(body: T.SearchPeopleRequest, options?: UserApiCallOptions & {
2148
+ representation?: "default";
2149
+ }): Promise<T.PersonListEnvelope>;
2150
+ /**
2151
+ * Returns one person
2152
+ *
2153
+ * Returns the person. Under `Accept: application/vnd.ls-api.minimal.v2+json` it returns the minimal representation, whose `extra.permissions.additionalFields` is always `{}`.
2154
+ *
2155
+ * Needs one of the scopes: `crm:person:read`.
2156
+ *
2157
+ * @param id The person's id, 8-4-4-4-12 hexadecimal.
2158
+ */
2159
+ get(id: T.PublicId, options: UserApiCallOptions & {
2160
+ representation: "minimal";
2161
+ }): Promise<T.PersonMinimalEnvelope>;
2162
+ /**
2163
+ * Returns one person
2164
+ *
2165
+ * Returns the person. Under `Accept: application/vnd.ls-api.minimal.v2+json` it returns the minimal representation, whose `extra.permissions.additionalFields` is always `{}`.
2166
+ *
2167
+ * Needs one of the scopes: `crm:person:read`.
2168
+ *
2169
+ * @param id The person's id, 8-4-4-4-12 hexadecimal.
2170
+ */
2171
+ get(id: T.PublicId, options?: UserApiCallOptions & {
2172
+ representation?: "default";
2173
+ }): Promise<T.PersonEnvelope>;
2174
+ /**
2175
+ * Updates a person
2176
+ *
2177
+ * Updates the person: a key left out stays, `null` clears a nullable field and a list replaces the whole list. If the key can no longer read the person, `data` holds only its id.
2178
+ *
2179
+ * Needs one of the scopes: `crm:person:write`.
2180
+ *
2181
+ * @param id The person's id, 8-4-4-4-12 hexadecimal.
2182
+ */
2183
+ update(id: T.PublicId, body: T.UpdatePersonRequest, options?: UserApiCallOptions): Promise<T.PersonEnvelope | T.WrittenRecordIdEnvelope>;
2184
+ /**
2185
+ * Deletes a person
2186
+ *
2187
+ * Deletes the person.
2188
+ *
2189
+ * Needs one of the scopes: `crm:person:delete`.
2190
+ *
2191
+ * @param id The person's id, 8-4-4-4-12 hexadecimal.
2192
+ */
2193
+ delete(id: T.PublicId, options?: UserApiCallOptions): Promise<void>;
2194
+ }
2195
+ export interface UserApiPeopleTasks {
2196
+ /**
2197
+ * Creates a task on a person
2198
+ *
2199
+ * Creates a task linked to the person and fires the `task.created` webhook. If the key can no longer read the task, `data` holds only its id.
2200
+ *
2201
+ * Needs one of the scopes: `crm:task:write`.
2202
+ *
2203
+ * @param id The person's id, 8-4-4-4-12 hexadecimal.
2204
+ */
2205
+ create(id: T.PublicId, body: T.CreateTaskRequest, options?: UserApiCallOptions): Promise<T.TaskEnvelope | T.WrittenRecordIdEnvelope>;
2206
+ /**
2207
+ * Updates a task on a person
2208
+ *
2209
+ * Updates the task linked to the person under `application/json`, or completes or reopens it with an empty body under `application/vnd.ls-api.task-complete.v2+json` or `application/vnd.ls-api.task-reopen.v2+json`. Completing a completed task or reopening an open one changes nothing.
2210
+ *
2211
+ * Needs one of the scopes: `crm:task:write`.
2212
+ *
2213
+ * @param id The person's id, 8-4-4-4-12 hexadecimal.
2214
+ *
2215
+ * @param taskId The task's id, 8-4-4-4-12 hexadecimal. A task not linked to `{id}` answers `404`.
2216
+ */
2217
+ update(id: T.PublicId, taskId: T.PublicId, body?: T.UpdateTaskRequest, options?: UserApiCallOptions): Promise<T.TaskEnvelope | T.WrittenRecordIdEnvelope>;
2218
+ /**
2219
+ * Completes a task on a person
2220
+ *
2221
+ * Updates the task linked to the person under `application/json`, or completes or reopens it with an empty body under `application/vnd.ls-api.task-complete.v2+json` or `application/vnd.ls-api.task-reopen.v2+json`. Completing a completed task or reopening an open one changes nothing.
2222
+ *
2223
+ * Needs one of the scopes: `crm:task:write`.
2224
+ *
2225
+ * @param id The person's id, 8-4-4-4-12 hexadecimal.
2226
+ *
2227
+ * @param taskId The task's id, 8-4-4-4-12 hexadecimal. A task not linked to `{id}` answers `404`.
2228
+ */
2229
+ complete(id: T.PublicId, taskId: T.PublicId, options?: UserApiCallOptions): Promise<T.TaskEnvelope | T.WrittenRecordIdEnvelope>;
2230
+ /**
2231
+ * Reopens a task on a person
2232
+ *
2233
+ * Updates the task linked to the person under `application/json`, or completes or reopens it with an empty body under `application/vnd.ls-api.task-complete.v2+json` or `application/vnd.ls-api.task-reopen.v2+json`. Completing a completed task or reopening an open one changes nothing.
2234
+ *
2235
+ * Needs one of the scopes: `crm:task:write`.
2236
+ *
2237
+ * @param id The person's id, 8-4-4-4-12 hexadecimal.
2238
+ *
2239
+ * @param taskId The task's id, 8-4-4-4-12 hexadecimal. A task not linked to `{id}` answers `404`.
2240
+ */
2241
+ reopen(id: T.PublicId, taskId: T.PublicId, options?: UserApiCallOptions): Promise<T.TaskEnvelope | T.WrittenRecordIdEnvelope>;
2242
+ }
2243
+ export interface UserApiPeopleCalls {
2244
+ /**
2245
+ * Lists calls for a person
2246
+ *
2247
+ * Lists the calls on this person's own timeline, newest first, each call on its own even when calls share a timeline entry. Empty when you see the record at basic access.
2248
+ *
2249
+ * Needs one of the scopes: `crm:call:read`.
2250
+ *
2251
+ * @param id The person's id, 8-4-4-4-12 hexadecimal.
2252
+ */
2253
+ list(id: string, query?: {
2254
+ /**
2255
+ * Page number, 1-based. Default 1, maximum 10000.
2256
+ */
2257
+ page?: number;
2258
+ /**
2259
+ * Page size. Default 100, maximum 500; a larger value is refused, never clamped.
2260
+ */
2261
+ perPage?: number;
2262
+ }, options?: UserApiCallOptions): Promise<T.CallListEnvelope>;
2263
+ /**
2264
+ * Logs a call on a person
2265
+ *
2266
+ * Logs a call on the person, attributed to `user` when the key names one, otherwise to the integration user of the key.
2267
+ *
2268
+ * Needs one of the scopes: `crm:call:write`.
2269
+ *
2270
+ * @param id The person's id, 8-4-4-4-12 hexadecimal.
2271
+ */
2272
+ create(id: string, body: T.CreateCallRequest, options?: UserApiCallOptions): Promise<T.CallEnvelope>;
2273
+ }
2274
+ export interface UserApiPeopleEmails {
2275
+ /**
2276
+ * Lists emails for a person
2277
+ *
2278
+ * Lists the emails on this person's own timeline, newest first, without those only on its company or deals. Empty when you see the record at basic access.
2279
+ *
2280
+ * Needs one of the scopes: `crm:email:read`.
2281
+ *
2282
+ * @param id The person's id, 8-4-4-4-12 hexadecimal.
2283
+ */
2284
+ list(id: string, query?: {
2285
+ /**
2286
+ * Page number, 1-based. Default 1, maximum 10000.
2287
+ */
2288
+ page?: number;
2289
+ /**
2290
+ * Page size. Default 100, maximum 500; a larger value is refused, never clamped.
2291
+ */
2292
+ perPage?: number;
2293
+ }, options?: UserApiCallOptions): Promise<T.NestedEmailListEnvelope>;
2294
+ }
2295
+ export interface UserApiPeopleNotes {
2296
+ /**
2297
+ * Lists notes for a person
2298
+ *
2299
+ * Lists the notes on this person's own timeline, newest `date` first, without those only on its company or deals. Empty when you see the record at basic access.
2300
+ *
2301
+ * Needs one of the scopes: `crm:note:read`.
2302
+ *
2303
+ * @param id The person's id, 8-4-4-4-12 hexadecimal.
2304
+ */
2305
+ list(id: string, query?: {
2306
+ /**
2307
+ * Page number, 1-based. Default 1, maximum 10000.
2308
+ */
2309
+ page?: number;
2310
+ /**
2311
+ * Page size. Default 100, maximum 500; a larger value is refused, never clamped.
2312
+ */
2313
+ perPage?: number;
2314
+ }, options?: UserApiCallOptions): Promise<T.NoteListEnvelope>;
2315
+ /**
2316
+ * Creates a note on a person
2317
+ *
2318
+ * Creates a note on the person, written by the integration user of the key; `data.url` links the note in Livespace.
2319
+ *
2320
+ * Needs one of the scopes: `crm:note:write`.
2321
+ *
2322
+ * @param id The person's id, 8-4-4-4-12 hexadecimal.
2323
+ */
2324
+ create(id: string, body: T.CreateNoteRequest, options?: UserApiCallOptions): Promise<T.NoteEnvelope>;
2325
+ }
2326
+ export interface UserApiEmails {
2327
+ /**
2328
+ * Lists emails for a related person, company or deal
2329
+ *
2330
+ * Lists the emails of the person, company or deal named by `related_type` and `related_id`.
2331
+ *
2332
+ * Needs one of the scopes: `crm:email:read`.
2333
+ */
2334
+ list(query: {
2335
+ /**
2336
+ * The type of the related record: `person`, `company` or `deal`.
2337
+ */
2338
+ related_type: "person" | "company" | "deal";
2339
+ /**
2340
+ * The id of the related record, required with `related_type`. An unknown or malformed id matches no record and returns an empty list.
2341
+ */
2342
+ related_id: string;
2343
+ /**
2344
+ * Page number, 1-based. Default 1, maximum 10000.
2345
+ */
2346
+ page?: number;
2347
+ /**
2348
+ * Page size. Default 100, maximum 500; a larger value is refused, never clamped.
2349
+ */
2350
+ perPage?: number;
2351
+ }, options?: UserApiCallOptions): Promise<T.EmailHistoryEnvelope>;
2352
+ }
2353
+ export interface UserApiUsers {
2354
+ /**
2355
+ * Lists users
2356
+ *
2357
+ * Lists the active users a record may name as its owner, ordered by last name and first name. Each item carries the user's main team, or `null` when the user has none.
2358
+ *
2359
+ * Needs one of the scopes: `crm:person:read`, `crm:person:write`, `crm:company:read`, `crm:company:write`, `crm:deal:read`, `crm:deal:write`, `crm:note:read`, `crm:email:read`, `crm:call:read`.
2360
+ */
2361
+ list(query?: {
2362
+ /**
2363
+ * Page number, 1-based. Default 1, maximum 10000.
2364
+ */
2365
+ page?: number;
2366
+ /**
2367
+ * Page size. Default 100, maximum 500; a larger value is refused, never clamped.
2368
+ */
2369
+ perPage?: number;
2370
+ }, options?: UserApiCallOptions): Promise<T.UserListEnvelope>;
2371
+ /**
2372
+ * Returns the integration user bound to this key
2373
+ *
2374
+ * Returns the integration user bound to this key. Any valid key can call it; it needs no scope.
2375
+ *
2376
+ * Needs no scope.
2377
+ */
2378
+ me(options?: UserApiCallOptions): Promise<T.CurrentUserEnvelope>;
2379
+ /**
2380
+ * Returns one user
2381
+ *
2382
+ * Returns the user.
2383
+ *
2384
+ * Needs one of the scopes: `crm:person:read`, `crm:company:read`, `crm:deal:read`, `crm:note:read`, `crm:email:read`, `crm:call:read`.
2385
+ *
2386
+ * @param id The user's id, 8-4-4-4-12 hexadecimal.
2387
+ */
2388
+ get(id: string, options?: UserApiCallOptions): Promise<T.PublicUserEnvelope>;
2389
+ }