@hiro5409/attio-cli 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.
- package/LICENSE +21 -0
- package/README.md +174 -2
- package/bin/attio-api +2 -0
- package/dist/cli-cTGHeWUi.mjs +4747 -0
- package/dist/cli-cTGHeWUi.mjs.map +1 -0
- package/dist/main.mjs +7 -0
- package/dist/main.mjs.map +1 -0
- package/dist/package-lsdxDgro.mjs +70 -0
- package/dist/package-lsdxDgro.mjs.map +1 -0
- package/package.json +70 -3
- package/skills/attio-cli/SKILL.md +26 -0
|
@@ -0,0 +1,4747 @@
|
|
|
1
|
+
import { cli, define } from "gunshi";
|
|
2
|
+
import { renderHeader } from "gunshi/renderer";
|
|
3
|
+
import ky, { isHTTPError } from "ky";
|
|
4
|
+
import * as v from "valibot";
|
|
5
|
+
//#region src/errors.ts
|
|
6
|
+
var CliError = class extends Error {
|
|
7
|
+
options;
|
|
8
|
+
constructor(message, options) {
|
|
9
|
+
super(message);
|
|
10
|
+
this.name = "CliError";
|
|
11
|
+
this.options = options;
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
const AttioErrorBody = v.object({
|
|
15
|
+
code: v.optional(v.string()),
|
|
16
|
+
message: v.optional(v.string()),
|
|
17
|
+
type: v.optional(v.string())
|
|
18
|
+
});
|
|
19
|
+
const HTTP_FAILURES = {
|
|
20
|
+
400: {
|
|
21
|
+
code: "BAD_REQUEST",
|
|
22
|
+
exitCode: 2,
|
|
23
|
+
hint: "Correct the options or the body against the operation's page in Attio's API reference."
|
|
24
|
+
},
|
|
25
|
+
401: {
|
|
26
|
+
code: "UNAUTHORIZED",
|
|
27
|
+
exitCode: 2,
|
|
28
|
+
hint: "Set ATTIO_ACCESS_TOKEN to a valid Attio access token."
|
|
29
|
+
},
|
|
30
|
+
403: {
|
|
31
|
+
code: "FORBIDDEN",
|
|
32
|
+
exitCode: 3,
|
|
33
|
+
hint: "Attio's message names what is missing: a scope on the token, access to the resource, or a plan that allows the operation."
|
|
34
|
+
},
|
|
35
|
+
404: {
|
|
36
|
+
code: "NOT_FOUND",
|
|
37
|
+
exitCode: 1
|
|
38
|
+
},
|
|
39
|
+
429: {
|
|
40
|
+
code: "RATE_LIMITED",
|
|
41
|
+
exitCode: 4,
|
|
42
|
+
hint: "Wait before running the command again."
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
/** Turns an HTTP failure and the body Attio sent with it into a CLI error. */
|
|
46
|
+
function httpError(status, body) {
|
|
47
|
+
const parsed = v.safeParse(AttioErrorBody, body);
|
|
48
|
+
const { code, message, type } = parsed.success ? parsed.output : {};
|
|
49
|
+
return new CliError(message || `Attio returned HTTP ${status}.`, {
|
|
50
|
+
...HTTP_FAILURES[status] ?? {
|
|
51
|
+
code: "API_ERROR",
|
|
52
|
+
exitCode: 1
|
|
53
|
+
},
|
|
54
|
+
attio: {
|
|
55
|
+
code,
|
|
56
|
+
type
|
|
57
|
+
},
|
|
58
|
+
status
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
/** Describes a command line that the CLI cannot act on. */
|
|
62
|
+
function usageError(message) {
|
|
63
|
+
return new CliError(message, {
|
|
64
|
+
code: "INVALID_ARGUMENT",
|
|
65
|
+
exitCode: 2
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
/** Describes a request that never produced a response from Attio. */
|
|
69
|
+
function networkError(cause) {
|
|
70
|
+
return new CliError(`Could not reach Attio${cause instanceof Error && cause.message ? ` (${cause.message})` : ""}.`, {
|
|
71
|
+
code: "NETWORK_ERROR",
|
|
72
|
+
exitCode: 1,
|
|
73
|
+
hint: "Check the network connection. A write may have reached Attio, so check before retrying."
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
/** Writes the failure to stderr as JSON and returns the process exit code. */
|
|
77
|
+
function reportError(error) {
|
|
78
|
+
if (error instanceof AggregateError) return reportError(usageError(error.errors.map((item) => item instanceof Error ? item.message : String(item)).filter(Boolean).join("; ") || "Invalid command arguments."));
|
|
79
|
+
if (error instanceof CliError) {
|
|
80
|
+
const { exitCode, ...details } = error.options;
|
|
81
|
+
console.error(JSON.stringify({ error: {
|
|
82
|
+
...details,
|
|
83
|
+
message: error.message
|
|
84
|
+
} }, null, 2));
|
|
85
|
+
return exitCode;
|
|
86
|
+
}
|
|
87
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
88
|
+
console.error(JSON.stringify({ error: {
|
|
89
|
+
code: "UNEXPECTED",
|
|
90
|
+
message
|
|
91
|
+
} }, null, 2));
|
|
92
|
+
return 1;
|
|
93
|
+
}
|
|
94
|
+
//#endregion
|
|
95
|
+
//#region src/types/attio/core/bodySerializer.gen.ts
|
|
96
|
+
const jsonBodySerializer = { bodySerializer: (body) => JSON.stringify(body, (_key, value) => typeof value === "bigint" ? value.toString() : value) };
|
|
97
|
+
Object.entries({
|
|
98
|
+
$body_: "body",
|
|
99
|
+
$headers_: "headers",
|
|
100
|
+
$path_: "path",
|
|
101
|
+
$query_: "query"
|
|
102
|
+
});
|
|
103
|
+
//#endregion
|
|
104
|
+
//#region src/types/attio/core/serverSentEvents.gen.ts
|
|
105
|
+
function createSseClient({ onRequest, onSseError, onSseEvent, responseTransformer, responseValidator, sseDefaultRetryDelay, sseMaxRetryAttempts, sseMaxRetryDelay, sseSleepFn, url, ...options }) {
|
|
106
|
+
let lastEventId;
|
|
107
|
+
const sleep = sseSleepFn ?? ((ms) => new Promise((resolve) => setTimeout(resolve, ms)));
|
|
108
|
+
const createStream = async function* () {
|
|
109
|
+
let retryDelay = sseDefaultRetryDelay ?? 3e3;
|
|
110
|
+
let attempt = 0;
|
|
111
|
+
const signal = options.signal ?? new AbortController().signal;
|
|
112
|
+
while (true) {
|
|
113
|
+
if (signal.aborted) break;
|
|
114
|
+
attempt++;
|
|
115
|
+
const headers = options.headers instanceof Headers ? options.headers : new Headers(options.headers);
|
|
116
|
+
if (lastEventId !== void 0) headers.set("Last-Event-ID", lastEventId);
|
|
117
|
+
try {
|
|
118
|
+
const requestInit = {
|
|
119
|
+
redirect: "follow",
|
|
120
|
+
...options,
|
|
121
|
+
body: options.serializedBody,
|
|
122
|
+
headers,
|
|
123
|
+
signal
|
|
124
|
+
};
|
|
125
|
+
let request = new Request(url, requestInit);
|
|
126
|
+
if (onRequest) request = await onRequest(url, requestInit);
|
|
127
|
+
const response = await (options.fetch ?? globalThis.fetch)(request);
|
|
128
|
+
if (!response.ok) throw new Error(`SSE failed: ${response.status} ${response.statusText}`);
|
|
129
|
+
if (!response.body) throw new Error("No body in SSE response");
|
|
130
|
+
const reader = response.body.pipeThrough(new TextDecoderStream()).getReader();
|
|
131
|
+
let buffer = "";
|
|
132
|
+
const abortHandler = () => {
|
|
133
|
+
try {
|
|
134
|
+
reader.cancel();
|
|
135
|
+
} catch {}
|
|
136
|
+
};
|
|
137
|
+
signal.addEventListener("abort", abortHandler);
|
|
138
|
+
try {
|
|
139
|
+
while (true) {
|
|
140
|
+
const { done, value } = await reader.read();
|
|
141
|
+
if (done) break;
|
|
142
|
+
buffer += value;
|
|
143
|
+
buffer = buffer.replace(/\r\n?/g, "\n");
|
|
144
|
+
const chunks = buffer.split("\n\n");
|
|
145
|
+
buffer = chunks.pop() ?? "";
|
|
146
|
+
for (const chunk of chunks) {
|
|
147
|
+
const lines = chunk.split("\n");
|
|
148
|
+
const dataLines = [];
|
|
149
|
+
let eventName;
|
|
150
|
+
for (const line of lines) if (line.startsWith("data:")) dataLines.push(line.replace(/^data:\s*/, ""));
|
|
151
|
+
else if (line.startsWith("event:")) eventName = line.replace(/^event:\s*/, "");
|
|
152
|
+
else if (line.startsWith("id:")) lastEventId = line.replace(/^id:\s*/, "");
|
|
153
|
+
else if (line.startsWith("retry:")) {
|
|
154
|
+
const parsed = Number.parseInt(line.replace(/^retry:\s*/, ""), 10);
|
|
155
|
+
if (!Number.isNaN(parsed)) retryDelay = parsed;
|
|
156
|
+
}
|
|
157
|
+
let data;
|
|
158
|
+
let parsedJson = false;
|
|
159
|
+
if (dataLines.length) {
|
|
160
|
+
const rawData = dataLines.join("\n");
|
|
161
|
+
try {
|
|
162
|
+
data = JSON.parse(rawData);
|
|
163
|
+
parsedJson = true;
|
|
164
|
+
} catch {
|
|
165
|
+
data = rawData;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
if (parsedJson) {
|
|
169
|
+
if (responseValidator) await responseValidator(data);
|
|
170
|
+
if (responseTransformer) data = await responseTransformer(data);
|
|
171
|
+
}
|
|
172
|
+
onSseEvent?.({
|
|
173
|
+
data,
|
|
174
|
+
event: eventName,
|
|
175
|
+
id: lastEventId,
|
|
176
|
+
retry: retryDelay
|
|
177
|
+
});
|
|
178
|
+
if (dataLines.length) yield data;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
} finally {
|
|
182
|
+
signal.removeEventListener("abort", abortHandler);
|
|
183
|
+
reader.releaseLock();
|
|
184
|
+
}
|
|
185
|
+
break;
|
|
186
|
+
} catch (error) {
|
|
187
|
+
onSseError?.(error);
|
|
188
|
+
if (sseMaxRetryAttempts !== void 0 && attempt >= sseMaxRetryAttempts) break;
|
|
189
|
+
const backoff = Math.min(retryDelay * 2 ** (attempt - 1), sseMaxRetryDelay ?? 3e4);
|
|
190
|
+
await sleep(backoff);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
};
|
|
194
|
+
return { stream: createStream() };
|
|
195
|
+
}
|
|
196
|
+
//#endregion
|
|
197
|
+
//#region src/types/attio/core/pathSerializer.gen.ts
|
|
198
|
+
const separatorArrayExplode = (style) => {
|
|
199
|
+
switch (style) {
|
|
200
|
+
case "label": return ".";
|
|
201
|
+
case "matrix": return ";";
|
|
202
|
+
case "simple": return ",";
|
|
203
|
+
default: return "&";
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
const separatorArrayNoExplode = (style) => {
|
|
207
|
+
switch (style) {
|
|
208
|
+
case "form": return ",";
|
|
209
|
+
case "pipeDelimited": return "|";
|
|
210
|
+
case "spaceDelimited": return "%20";
|
|
211
|
+
default: return ",";
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
const separatorObjectExplode = (style) => {
|
|
215
|
+
switch (style) {
|
|
216
|
+
case "label": return ".";
|
|
217
|
+
case "matrix": return ";";
|
|
218
|
+
case "simple": return ",";
|
|
219
|
+
default: return "&";
|
|
220
|
+
}
|
|
221
|
+
};
|
|
222
|
+
const serializeArrayParam = ({ allowReserved, explode, name, style, value }) => {
|
|
223
|
+
if (!explode) {
|
|
224
|
+
const joinedValues = (allowReserved ? value : value.map((v) => encodeURIComponent(v))).join(separatorArrayNoExplode(style));
|
|
225
|
+
switch (style) {
|
|
226
|
+
case "label": return `.${joinedValues}`;
|
|
227
|
+
case "matrix": return `;${name}=${joinedValues}`;
|
|
228
|
+
case "simple": return joinedValues;
|
|
229
|
+
default: return `${name}=${joinedValues}`;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
const separator = separatorArrayExplode(style);
|
|
233
|
+
const joinedValues = value.map((v) => {
|
|
234
|
+
if (style === "label" || style === "simple") return allowReserved ? v : encodeURIComponent(v);
|
|
235
|
+
return serializePrimitiveParam({
|
|
236
|
+
allowReserved,
|
|
237
|
+
name,
|
|
238
|
+
value: v
|
|
239
|
+
});
|
|
240
|
+
}).join(separator);
|
|
241
|
+
return style === "label" || style === "matrix" ? separator + joinedValues : joinedValues;
|
|
242
|
+
};
|
|
243
|
+
const serializePrimitiveParam = ({ allowReserved, name, value }) => {
|
|
244
|
+
if (value === void 0 || value === null) return "";
|
|
245
|
+
if (typeof value === "object") throw new Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");
|
|
246
|
+
return `${name}=${allowReserved ? value : encodeURIComponent(value)}`;
|
|
247
|
+
};
|
|
248
|
+
const serializeObjectParam = ({ allowReserved, explode, name, style, value, valueOnly }) => {
|
|
249
|
+
if (value instanceof Date) return valueOnly ? value.toISOString() : `${name}=${value.toISOString()}`;
|
|
250
|
+
if (style !== "deepObject" && !explode) {
|
|
251
|
+
let values = [];
|
|
252
|
+
Object.entries(value).forEach(([key, v]) => {
|
|
253
|
+
values = [
|
|
254
|
+
...values,
|
|
255
|
+
key,
|
|
256
|
+
allowReserved ? v : encodeURIComponent(v)
|
|
257
|
+
];
|
|
258
|
+
});
|
|
259
|
+
const joinedValues = values.join(",");
|
|
260
|
+
switch (style) {
|
|
261
|
+
case "form": return `${name}=${joinedValues}`;
|
|
262
|
+
case "label": return `.${joinedValues}`;
|
|
263
|
+
case "matrix": return `;${name}=${joinedValues}`;
|
|
264
|
+
default: return joinedValues;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
const separator = separatorObjectExplode(style);
|
|
268
|
+
const joinedValues = Object.entries(value).map(([key, v]) => serializePrimitiveParam({
|
|
269
|
+
allowReserved,
|
|
270
|
+
name: style === "deepObject" ? `${name}[${key}]` : key,
|
|
271
|
+
value: v
|
|
272
|
+
})).join(separator);
|
|
273
|
+
return style === "label" || style === "matrix" ? separator + joinedValues : joinedValues;
|
|
274
|
+
};
|
|
275
|
+
//#endregion
|
|
276
|
+
//#region src/types/attio/core/utils.gen.ts
|
|
277
|
+
const PATH_PARAM_RE = /\{[^{}]+\}/g;
|
|
278
|
+
const defaultPathSerializer = ({ path, url: _url }) => {
|
|
279
|
+
let url = _url;
|
|
280
|
+
const matches = _url.match(PATH_PARAM_RE);
|
|
281
|
+
if (matches) for (const match of matches) {
|
|
282
|
+
let explode = false;
|
|
283
|
+
let name = match.substring(1, match.length - 1);
|
|
284
|
+
let style = "simple";
|
|
285
|
+
if (name.endsWith("*")) {
|
|
286
|
+
explode = true;
|
|
287
|
+
name = name.substring(0, name.length - 1);
|
|
288
|
+
}
|
|
289
|
+
if (name.startsWith(".")) {
|
|
290
|
+
name = name.substring(1);
|
|
291
|
+
style = "label";
|
|
292
|
+
} else if (name.startsWith(";")) {
|
|
293
|
+
name = name.substring(1);
|
|
294
|
+
style = "matrix";
|
|
295
|
+
}
|
|
296
|
+
const value = path[name];
|
|
297
|
+
if (value === void 0 || value === null) continue;
|
|
298
|
+
if (Array.isArray(value)) {
|
|
299
|
+
url = url.replace(match, serializeArrayParam({
|
|
300
|
+
explode,
|
|
301
|
+
name,
|
|
302
|
+
style,
|
|
303
|
+
value
|
|
304
|
+
}));
|
|
305
|
+
continue;
|
|
306
|
+
}
|
|
307
|
+
if (typeof value === "object") {
|
|
308
|
+
url = url.replace(match, serializeObjectParam({
|
|
309
|
+
explode,
|
|
310
|
+
name,
|
|
311
|
+
style,
|
|
312
|
+
value,
|
|
313
|
+
valueOnly: true
|
|
314
|
+
}));
|
|
315
|
+
continue;
|
|
316
|
+
}
|
|
317
|
+
if (style === "matrix") {
|
|
318
|
+
url = url.replace(match, `;${serializePrimitiveParam({
|
|
319
|
+
name,
|
|
320
|
+
value
|
|
321
|
+
})}`);
|
|
322
|
+
continue;
|
|
323
|
+
}
|
|
324
|
+
const replaceValue = encodeURIComponent(style === "label" ? `.${value}` : value);
|
|
325
|
+
url = url.replace(match, replaceValue);
|
|
326
|
+
}
|
|
327
|
+
return url;
|
|
328
|
+
};
|
|
329
|
+
const getUrl = ({ baseUrl, path, query, querySerializer, url: _url }) => {
|
|
330
|
+
const pathUrl = _url.startsWith("/") ? _url : `/${_url}`;
|
|
331
|
+
let url = (baseUrl ?? "") + pathUrl;
|
|
332
|
+
if (path) url = defaultPathSerializer({
|
|
333
|
+
path,
|
|
334
|
+
url
|
|
335
|
+
});
|
|
336
|
+
let search = query ? querySerializer(query) : "";
|
|
337
|
+
if (search.startsWith("?")) search = search.substring(1);
|
|
338
|
+
if (search) url += `?${search}`;
|
|
339
|
+
return url;
|
|
340
|
+
};
|
|
341
|
+
function getValidRequestBody(options) {
|
|
342
|
+
const hasBody = options.body !== void 0;
|
|
343
|
+
if (hasBody && options.bodySerializer) {
|
|
344
|
+
if ("serializedBody" in options) return options.serializedBody !== void 0 && options.serializedBody !== "" ? options.serializedBody : null;
|
|
345
|
+
return options.body !== "" ? options.body : null;
|
|
346
|
+
}
|
|
347
|
+
if (hasBody) return options.body;
|
|
348
|
+
}
|
|
349
|
+
//#endregion
|
|
350
|
+
//#region src/types/attio/core/auth.gen.ts
|
|
351
|
+
const getAuthToken = async (auth, callback) => {
|
|
352
|
+
const token = typeof callback === "function" ? await callback(auth) : callback;
|
|
353
|
+
if (!token) return;
|
|
354
|
+
if (auth.scheme === "bearer") return `Bearer ${token}`;
|
|
355
|
+
if (auth.scheme === "basic") return `Basic ${btoa(token)}`;
|
|
356
|
+
return token;
|
|
357
|
+
};
|
|
358
|
+
//#endregion
|
|
359
|
+
//#region src/types/attio/client/utils.gen.ts
|
|
360
|
+
const createQuerySerializer = ({ parameters = {}, ...args } = {}) => {
|
|
361
|
+
const querySerializer = (queryParams) => {
|
|
362
|
+
const search = [];
|
|
363
|
+
if (queryParams && typeof queryParams === "object") for (const name in queryParams) {
|
|
364
|
+
const value = queryParams[name];
|
|
365
|
+
if (value === void 0 || value === null) continue;
|
|
366
|
+
const options = parameters[name] || args;
|
|
367
|
+
if (Array.isArray(value)) {
|
|
368
|
+
const serializedArray = serializeArrayParam({
|
|
369
|
+
allowReserved: options.allowReserved,
|
|
370
|
+
explode: true,
|
|
371
|
+
name,
|
|
372
|
+
style: "form",
|
|
373
|
+
value,
|
|
374
|
+
...options.array
|
|
375
|
+
});
|
|
376
|
+
if (serializedArray) search.push(serializedArray);
|
|
377
|
+
} else if (typeof value === "object") {
|
|
378
|
+
const serializedObject = serializeObjectParam({
|
|
379
|
+
allowReserved: options.allowReserved,
|
|
380
|
+
explode: true,
|
|
381
|
+
name,
|
|
382
|
+
style: "deepObject",
|
|
383
|
+
value,
|
|
384
|
+
...options.object
|
|
385
|
+
});
|
|
386
|
+
if (serializedObject) search.push(serializedObject);
|
|
387
|
+
} else {
|
|
388
|
+
const serializedPrimitive = serializePrimitiveParam({
|
|
389
|
+
allowReserved: options.allowReserved,
|
|
390
|
+
name,
|
|
391
|
+
value
|
|
392
|
+
});
|
|
393
|
+
if (serializedPrimitive) search.push(serializedPrimitive);
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
return search.join("&");
|
|
397
|
+
};
|
|
398
|
+
return querySerializer;
|
|
399
|
+
};
|
|
400
|
+
/**
|
|
401
|
+
* Infers parseAs value from provided Content-Type header.
|
|
402
|
+
*/
|
|
403
|
+
const getParseAs = (contentType) => {
|
|
404
|
+
if (!contentType) return "stream";
|
|
405
|
+
const cleanContent = contentType.split(";")[0]?.trim();
|
|
406
|
+
if (!cleanContent) return;
|
|
407
|
+
if (cleanContent.startsWith("application/json") || cleanContent.endsWith("+json")) return "json";
|
|
408
|
+
if (cleanContent === "multipart/form-data") return "formData";
|
|
409
|
+
if ([
|
|
410
|
+
"application/",
|
|
411
|
+
"audio/",
|
|
412
|
+
"image/",
|
|
413
|
+
"video/"
|
|
414
|
+
].some((type) => cleanContent.startsWith(type))) return "blob";
|
|
415
|
+
if (cleanContent.startsWith("text/")) return "text";
|
|
416
|
+
};
|
|
417
|
+
const checkForExistence = (options, name) => {
|
|
418
|
+
if (!name) return false;
|
|
419
|
+
if (options.headers.has(name) || options.query?.[name] || options.headers.get("Cookie")?.includes(`${name}=`)) return true;
|
|
420
|
+
return false;
|
|
421
|
+
};
|
|
422
|
+
async function setAuthParams(options) {
|
|
423
|
+
for (const auth of options.security ?? []) {
|
|
424
|
+
if (checkForExistence(options, auth.name)) continue;
|
|
425
|
+
const token = await getAuthToken(auth, options.auth);
|
|
426
|
+
if (!token) continue;
|
|
427
|
+
const name = auth.name ?? "Authorization";
|
|
428
|
+
switch (auth.in) {
|
|
429
|
+
case "query":
|
|
430
|
+
if (!options.query) options.query = {};
|
|
431
|
+
options.query[name] = token;
|
|
432
|
+
break;
|
|
433
|
+
case "cookie":
|
|
434
|
+
options.headers.append("Cookie", `${name}=${token}`);
|
|
435
|
+
break;
|
|
436
|
+
default: options.headers.set(name, token);
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
const buildUrl = (options) => getUrl({
|
|
441
|
+
baseUrl: options.baseUrl,
|
|
442
|
+
path: options.path,
|
|
443
|
+
query: options.query,
|
|
444
|
+
querySerializer: typeof options.querySerializer === "function" ? options.querySerializer : createQuerySerializer(options.querySerializer),
|
|
445
|
+
url: options.url
|
|
446
|
+
});
|
|
447
|
+
const mergeConfigs = (a, b) => {
|
|
448
|
+
const config = {
|
|
449
|
+
...a,
|
|
450
|
+
...b
|
|
451
|
+
};
|
|
452
|
+
if (config.baseUrl?.endsWith("/")) config.baseUrl = config.baseUrl.substring(0, config.baseUrl.length - 1);
|
|
453
|
+
config.headers = mergeHeaders(a.headers, b.headers);
|
|
454
|
+
return config;
|
|
455
|
+
};
|
|
456
|
+
const headersEntries = (headers) => {
|
|
457
|
+
const entries = [];
|
|
458
|
+
headers.forEach((value, key) => {
|
|
459
|
+
entries.push([key, value]);
|
|
460
|
+
});
|
|
461
|
+
return entries;
|
|
462
|
+
};
|
|
463
|
+
const mergeHeaders = (...headers) => {
|
|
464
|
+
const mergedHeaders = new Headers();
|
|
465
|
+
for (const header of headers) {
|
|
466
|
+
if (!header) continue;
|
|
467
|
+
const iterator = header instanceof Headers ? headersEntries(header) : Object.entries(header);
|
|
468
|
+
for (const [key, value] of iterator) if (value === null) mergedHeaders.delete(key);
|
|
469
|
+
else if (Array.isArray(value)) for (const v of value) mergedHeaders.append(key, v);
|
|
470
|
+
else if (value !== void 0) mergedHeaders.set(key, typeof value === "object" ? JSON.stringify(value) : value);
|
|
471
|
+
}
|
|
472
|
+
return mergedHeaders;
|
|
473
|
+
};
|
|
474
|
+
var Interceptors = class {
|
|
475
|
+
fns = [];
|
|
476
|
+
clear() {
|
|
477
|
+
this.fns = [];
|
|
478
|
+
}
|
|
479
|
+
eject(id) {
|
|
480
|
+
const index = this.getInterceptorIndex(id);
|
|
481
|
+
if (this.fns[index]) this.fns[index] = null;
|
|
482
|
+
}
|
|
483
|
+
exists(id) {
|
|
484
|
+
const index = this.getInterceptorIndex(id);
|
|
485
|
+
return Boolean(this.fns[index]);
|
|
486
|
+
}
|
|
487
|
+
getInterceptorIndex(id) {
|
|
488
|
+
if (typeof id === "number") return this.fns[id] ? id : -1;
|
|
489
|
+
return this.fns.indexOf(id);
|
|
490
|
+
}
|
|
491
|
+
update(id, fn) {
|
|
492
|
+
const index = this.getInterceptorIndex(id);
|
|
493
|
+
if (this.fns[index]) {
|
|
494
|
+
this.fns[index] = fn;
|
|
495
|
+
return id;
|
|
496
|
+
}
|
|
497
|
+
return false;
|
|
498
|
+
}
|
|
499
|
+
use(fn) {
|
|
500
|
+
this.fns.push(fn);
|
|
501
|
+
return this.fns.length - 1;
|
|
502
|
+
}
|
|
503
|
+
};
|
|
504
|
+
const createInterceptors = () => ({
|
|
505
|
+
error: new Interceptors(),
|
|
506
|
+
request: new Interceptors(),
|
|
507
|
+
response: new Interceptors()
|
|
508
|
+
});
|
|
509
|
+
const defaultQuerySerializer = createQuerySerializer({
|
|
510
|
+
allowReserved: false,
|
|
511
|
+
array: {
|
|
512
|
+
explode: true,
|
|
513
|
+
style: "form"
|
|
514
|
+
},
|
|
515
|
+
object: {
|
|
516
|
+
explode: true,
|
|
517
|
+
style: "deepObject"
|
|
518
|
+
}
|
|
519
|
+
});
|
|
520
|
+
const defaultHeaders = { "Content-Type": "application/json" };
|
|
521
|
+
const createConfig = (override = {}) => ({
|
|
522
|
+
...jsonBodySerializer,
|
|
523
|
+
headers: defaultHeaders,
|
|
524
|
+
parseAs: "auto",
|
|
525
|
+
querySerializer: defaultQuerySerializer,
|
|
526
|
+
...override
|
|
527
|
+
});
|
|
528
|
+
//#endregion
|
|
529
|
+
//#region src/types/attio/client/client.gen.ts
|
|
530
|
+
const createClient = (config = {}) => {
|
|
531
|
+
let _config = mergeConfigs(createConfig(), config);
|
|
532
|
+
const getConfig = () => ({ ..._config });
|
|
533
|
+
const setConfig = (config) => {
|
|
534
|
+
_config = mergeConfigs(_config, config);
|
|
535
|
+
return getConfig();
|
|
536
|
+
};
|
|
537
|
+
const interceptors = createInterceptors();
|
|
538
|
+
const beforeRequest = async (options) => {
|
|
539
|
+
const opts = {
|
|
540
|
+
..._config,
|
|
541
|
+
...options,
|
|
542
|
+
fetch: options.fetch ?? _config.fetch ?? globalThis.fetch,
|
|
543
|
+
headers: mergeHeaders(_config.headers, options.headers),
|
|
544
|
+
serializedBody: void 0
|
|
545
|
+
};
|
|
546
|
+
if (opts.security) await setAuthParams(opts);
|
|
547
|
+
if (opts.requestValidator) await opts.requestValidator(opts);
|
|
548
|
+
if (opts.body !== void 0 && opts.bodySerializer) opts.serializedBody = opts.bodySerializer(opts.body);
|
|
549
|
+
if (opts.body === void 0 || opts.serializedBody === "") opts.headers.delete("Content-Type");
|
|
550
|
+
const resolvedOpts = opts;
|
|
551
|
+
return {
|
|
552
|
+
opts: resolvedOpts,
|
|
553
|
+
url: buildUrl(resolvedOpts)
|
|
554
|
+
};
|
|
555
|
+
};
|
|
556
|
+
const request = async (options) => {
|
|
557
|
+
const throwOnError = options.throwOnError ?? _config.throwOnError;
|
|
558
|
+
const responseStyle = options.responseStyle ?? _config.responseStyle;
|
|
559
|
+
let request;
|
|
560
|
+
let response;
|
|
561
|
+
try {
|
|
562
|
+
const { opts, url } = await beforeRequest(options);
|
|
563
|
+
const requestInit = {
|
|
564
|
+
redirect: "follow",
|
|
565
|
+
...opts,
|
|
566
|
+
body: getValidRequestBody(opts)
|
|
567
|
+
};
|
|
568
|
+
request = new Request(url, requestInit);
|
|
569
|
+
for (const fn of interceptors.request.fns) if (fn) request = await fn(request, opts);
|
|
570
|
+
const _fetch = opts.fetch;
|
|
571
|
+
response = await _fetch(request);
|
|
572
|
+
for (const fn of interceptors.response.fns) if (fn) response = await fn(response, request, opts);
|
|
573
|
+
const result = {
|
|
574
|
+
request,
|
|
575
|
+
response
|
|
576
|
+
};
|
|
577
|
+
if (response.ok) {
|
|
578
|
+
const parseAs = (opts.parseAs === "auto" ? getParseAs(response.headers.get("Content-Type")) : opts.parseAs) ?? "json";
|
|
579
|
+
if (response.status === 204 || response.headers.get("Content-Length") === "0") {
|
|
580
|
+
let emptyData;
|
|
581
|
+
switch (parseAs) {
|
|
582
|
+
case "arrayBuffer":
|
|
583
|
+
case "blob":
|
|
584
|
+
case "text":
|
|
585
|
+
emptyData = await response[parseAs]();
|
|
586
|
+
break;
|
|
587
|
+
case "formData":
|
|
588
|
+
emptyData = new FormData();
|
|
589
|
+
break;
|
|
590
|
+
case "stream":
|
|
591
|
+
emptyData = response.body;
|
|
592
|
+
break;
|
|
593
|
+
default: emptyData = {};
|
|
594
|
+
}
|
|
595
|
+
return opts.responseStyle === "data" ? emptyData : {
|
|
596
|
+
data: emptyData,
|
|
597
|
+
...result
|
|
598
|
+
};
|
|
599
|
+
}
|
|
600
|
+
let data;
|
|
601
|
+
switch (parseAs) {
|
|
602
|
+
case "arrayBuffer":
|
|
603
|
+
case "blob":
|
|
604
|
+
case "formData":
|
|
605
|
+
case "text":
|
|
606
|
+
data = await response[parseAs]();
|
|
607
|
+
break;
|
|
608
|
+
case "json": {
|
|
609
|
+
const text = await response.text();
|
|
610
|
+
data = text ? JSON.parse(text) : {};
|
|
611
|
+
break;
|
|
612
|
+
}
|
|
613
|
+
case "stream": return opts.responseStyle === "data" ? response.body : {
|
|
614
|
+
data: response.body,
|
|
615
|
+
...result
|
|
616
|
+
};
|
|
617
|
+
}
|
|
618
|
+
if (parseAs === "json") {
|
|
619
|
+
if (opts.responseValidator) await opts.responseValidator(data);
|
|
620
|
+
if (opts.responseTransformer) data = await opts.responseTransformer(data);
|
|
621
|
+
}
|
|
622
|
+
return opts.responseStyle === "data" ? data : {
|
|
623
|
+
data,
|
|
624
|
+
...result
|
|
625
|
+
};
|
|
626
|
+
}
|
|
627
|
+
const textError = await response.text();
|
|
628
|
+
let jsonError;
|
|
629
|
+
try {
|
|
630
|
+
jsonError = JSON.parse(textError);
|
|
631
|
+
} catch {}
|
|
632
|
+
throw jsonError ?? textError;
|
|
633
|
+
} catch (error) {
|
|
634
|
+
let finalError = error;
|
|
635
|
+
for (const fn of interceptors.error.fns) if (fn) finalError = await fn(finalError, response, request, options);
|
|
636
|
+
finalError = finalError || {};
|
|
637
|
+
if (throwOnError) throw finalError;
|
|
638
|
+
return responseStyle === "data" ? void 0 : {
|
|
639
|
+
error: finalError,
|
|
640
|
+
request,
|
|
641
|
+
response
|
|
642
|
+
};
|
|
643
|
+
}
|
|
644
|
+
};
|
|
645
|
+
const makeMethodFn = (method) => (options) => request({
|
|
646
|
+
...options,
|
|
647
|
+
method
|
|
648
|
+
});
|
|
649
|
+
const makeSseFn = (method) => async (options) => {
|
|
650
|
+
const { opts, url } = await beforeRequest(options);
|
|
651
|
+
return createSseClient({
|
|
652
|
+
...opts,
|
|
653
|
+
body: opts.body,
|
|
654
|
+
method,
|
|
655
|
+
onRequest: async (url, init) => {
|
|
656
|
+
let request = new Request(url, init);
|
|
657
|
+
for (const fn of interceptors.request.fns) if (fn) request = await fn(request, opts);
|
|
658
|
+
return request;
|
|
659
|
+
},
|
|
660
|
+
serializedBody: getValidRequestBody(opts),
|
|
661
|
+
url
|
|
662
|
+
});
|
|
663
|
+
};
|
|
664
|
+
const _buildUrl = (options) => buildUrl({
|
|
665
|
+
..._config,
|
|
666
|
+
...options
|
|
667
|
+
});
|
|
668
|
+
return {
|
|
669
|
+
buildUrl: _buildUrl,
|
|
670
|
+
connect: makeMethodFn("CONNECT"),
|
|
671
|
+
delete: makeMethodFn("DELETE"),
|
|
672
|
+
get: makeMethodFn("GET"),
|
|
673
|
+
getConfig,
|
|
674
|
+
head: makeMethodFn("HEAD"),
|
|
675
|
+
interceptors,
|
|
676
|
+
options: makeMethodFn("OPTIONS"),
|
|
677
|
+
patch: makeMethodFn("PATCH"),
|
|
678
|
+
post: makeMethodFn("POST"),
|
|
679
|
+
put: makeMethodFn("PUT"),
|
|
680
|
+
request,
|
|
681
|
+
setConfig,
|
|
682
|
+
sse: {
|
|
683
|
+
connect: makeSseFn("CONNECT"),
|
|
684
|
+
delete: makeSseFn("DELETE"),
|
|
685
|
+
get: makeSseFn("GET"),
|
|
686
|
+
head: makeSseFn("HEAD"),
|
|
687
|
+
options: makeSseFn("OPTIONS"),
|
|
688
|
+
patch: makeSseFn("PATCH"),
|
|
689
|
+
post: makeSseFn("POST"),
|
|
690
|
+
put: makeSseFn("PUT"),
|
|
691
|
+
trace: makeSseFn("TRACE")
|
|
692
|
+
},
|
|
693
|
+
trace: makeMethodFn("TRACE")
|
|
694
|
+
};
|
|
695
|
+
};
|
|
696
|
+
//#endregion
|
|
697
|
+
//#region src/api/client.ts
|
|
698
|
+
/** The methods Ky does not repeat by default, because repeating them is not safe in general. */
|
|
699
|
+
const WRITE_METHODS = /* @__PURE__ */ new Set(["PATCH", "POST"]);
|
|
700
|
+
/** Attio does not process a rate-limited request, so that is the one failure after which a write is repeated. */
|
|
701
|
+
const writeRetry = {
|
|
702
|
+
methods: ["patch", "post"],
|
|
703
|
+
shouldRetry: ({ error }) => isHTTPError(error) && error.response.status === 429
|
|
704
|
+
};
|
|
705
|
+
/** Sends a request through Ky for its timeout and its retries. */
|
|
706
|
+
async function transport(...input) {
|
|
707
|
+
const request = new Request(...input);
|
|
708
|
+
const pending = ky(request, WRITE_METHODS.has(request.method) ? { retry: writeRetry } : {});
|
|
709
|
+
const [response, body] = await Promise.all([pending, pending.text()]);
|
|
710
|
+
return new Response(body || null, response);
|
|
711
|
+
}
|
|
712
|
+
function attioClient(env) {
|
|
713
|
+
const accessToken = env.ATTIO_ACCESS_TOKEN?.trim();
|
|
714
|
+
if (!accessToken) throw new CliError("No Attio access token is configured.", {
|
|
715
|
+
code: "AUTH_REQUIRED",
|
|
716
|
+
exitCode: 2,
|
|
717
|
+
hint: "Set ATTIO_ACCESS_TOKEN to an Attio access token."
|
|
718
|
+
});
|
|
719
|
+
const client = createClient({
|
|
720
|
+
auth: accessToken,
|
|
721
|
+
baseUrl: "https://api.attio.com",
|
|
722
|
+
fetch: transport,
|
|
723
|
+
throwOnError: true
|
|
724
|
+
});
|
|
725
|
+
client.interceptors.error.use((error, response) => {
|
|
726
|
+
if (isHTTPError(error)) return httpError(error.response.status, error.data);
|
|
727
|
+
return response ? error : networkError(error);
|
|
728
|
+
});
|
|
729
|
+
return client;
|
|
730
|
+
}
|
|
731
|
+
//#endregion
|
|
732
|
+
//#region src/commands/operation.ts
|
|
733
|
+
/**
|
|
734
|
+
* Wraps an SDK function so every operation runs the same way. Command-line input has no static
|
|
735
|
+
* type, and Attio is what validates it.
|
|
736
|
+
*/
|
|
737
|
+
function operation(definition) {
|
|
738
|
+
const { call, ...details } = definition;
|
|
739
|
+
return {
|
|
740
|
+
...details,
|
|
741
|
+
run: async (client, input) => {
|
|
742
|
+
const { data } = await call({
|
|
743
|
+
...input,
|
|
744
|
+
client
|
|
745
|
+
});
|
|
746
|
+
return data;
|
|
747
|
+
}
|
|
748
|
+
};
|
|
749
|
+
}
|
|
750
|
+
const ARGUMENT_TYPES = {
|
|
751
|
+
boolean: "boolean",
|
|
752
|
+
integer: "number",
|
|
753
|
+
string: "string"
|
|
754
|
+
};
|
|
755
|
+
function optionName(parameter) {
|
|
756
|
+
return parameter.replaceAll("_", "-");
|
|
757
|
+
}
|
|
758
|
+
function parseBody(text) {
|
|
759
|
+
try {
|
|
760
|
+
return JSON.parse(text);
|
|
761
|
+
} catch {
|
|
762
|
+
throw usageError("--body must be valid JSON.");
|
|
763
|
+
}
|
|
764
|
+
}
|
|
765
|
+
/** Builds the CLI command that runs one operation with the options given on the command line. */
|
|
766
|
+
function operationCommand(name, source, env) {
|
|
767
|
+
const args = {};
|
|
768
|
+
for (const option of source.options) args[optionName(option.name)] = {
|
|
769
|
+
description: option.description,
|
|
770
|
+
required: option.required || void 0,
|
|
771
|
+
type: ARGUMENT_TYPES[option.type]
|
|
772
|
+
};
|
|
773
|
+
if (source.body !== "none") args.body = {
|
|
774
|
+
description: "Request body as JSON",
|
|
775
|
+
required: source.body === "required" || void 0,
|
|
776
|
+
type: "string"
|
|
777
|
+
};
|
|
778
|
+
return define({
|
|
779
|
+
name,
|
|
780
|
+
description: source.description,
|
|
781
|
+
args,
|
|
782
|
+
run: async (ctx) => {
|
|
783
|
+
const values = ctx.values;
|
|
784
|
+
const input = {};
|
|
785
|
+
for (const option of source.options) {
|
|
786
|
+
const value = values[optionName(option.name)];
|
|
787
|
+
if (value !== void 0) (input[option.in] ??= {})[option.name] = value;
|
|
788
|
+
}
|
|
789
|
+
if (typeof values.body === "string") input.body = parseBody(values.body);
|
|
790
|
+
return JSON.stringify(await source.run(attioClient(env), input), null, 2);
|
|
791
|
+
}
|
|
792
|
+
});
|
|
793
|
+
}
|
|
794
|
+
//#endregion
|
|
795
|
+
//#region src/types/attio/client.gen.ts
|
|
796
|
+
const client = createClient(createConfig({
|
|
797
|
+
baseUrl: "https://api.attio.com",
|
|
798
|
+
throwOnError: true
|
|
799
|
+
}));
|
|
800
|
+
//#endregion
|
|
801
|
+
//#region src/types/attio/sdk.gen.ts
|
|
802
|
+
/**
|
|
803
|
+
* List objects
|
|
804
|
+
*
|
|
805
|
+
* Lists all system-defined and user-defined objects in your workspace.
|
|
806
|
+
*
|
|
807
|
+
* Required scopes: `object_configuration:read`.
|
|
808
|
+
*
|
|
809
|
+
* Supported token levels: `workspace`, `user`.
|
|
810
|
+
*/
|
|
811
|
+
const getV2Objects = (options) => (options?.client ?? client).get({
|
|
812
|
+
security: [{
|
|
813
|
+
scheme: "bearer",
|
|
814
|
+
type: "http"
|
|
815
|
+
}],
|
|
816
|
+
url: "/v2/objects",
|
|
817
|
+
...options
|
|
818
|
+
});
|
|
819
|
+
/**
|
|
820
|
+
* Create an object
|
|
821
|
+
*
|
|
822
|
+
* Creates a new custom object in your workspace.
|
|
823
|
+
*
|
|
824
|
+
* Required scopes: `object_configuration:read-write`.
|
|
825
|
+
*
|
|
826
|
+
* Supported token levels: `workspace`, `user`.
|
|
827
|
+
*/
|
|
828
|
+
const postV2Objects = (options) => (options.client ?? client).post({
|
|
829
|
+
security: [{
|
|
830
|
+
scheme: "bearer",
|
|
831
|
+
type: "http"
|
|
832
|
+
}],
|
|
833
|
+
url: "/v2/objects",
|
|
834
|
+
...options,
|
|
835
|
+
headers: {
|
|
836
|
+
"Content-Type": "application/json",
|
|
837
|
+
...options.headers
|
|
838
|
+
}
|
|
839
|
+
});
|
|
840
|
+
/**
|
|
841
|
+
* Delete an object
|
|
842
|
+
*
|
|
843
|
+
* Deletes a single object by its `object_id` or slug, along with all of its records. Only custom objects can be deleted; system objects, such as people and companies, cannot.
|
|
844
|
+
*
|
|
845
|
+
* This endpoint should be used with caution as it has the potential to remove a large amount of potentially valuable data.
|
|
846
|
+
*
|
|
847
|
+
* Required scopes: `object_configuration:read-write`, `record_permission:read-write`.
|
|
848
|
+
*
|
|
849
|
+
* Supported token levels: `workspace`, `user`.
|
|
850
|
+
*/
|
|
851
|
+
const deleteV2ObjectsByObject = (options) => (options.client ?? client).delete({
|
|
852
|
+
security: [{
|
|
853
|
+
scheme: "bearer",
|
|
854
|
+
type: "http"
|
|
855
|
+
}],
|
|
856
|
+
url: "/v2/objects/{object}",
|
|
857
|
+
...options
|
|
858
|
+
});
|
|
859
|
+
/**
|
|
860
|
+
* Get an object
|
|
861
|
+
*
|
|
862
|
+
* Gets a single object by its `object_id` or slug.
|
|
863
|
+
*
|
|
864
|
+
* Required scopes: `object_configuration:read`.
|
|
865
|
+
*
|
|
866
|
+
* Supported token levels: `workspace`, `user`.
|
|
867
|
+
*/
|
|
868
|
+
const getV2ObjectsByObject = (options) => (options.client ?? client).get({
|
|
869
|
+
security: [{
|
|
870
|
+
scheme: "bearer",
|
|
871
|
+
type: "http"
|
|
872
|
+
}],
|
|
873
|
+
url: "/v2/objects/{object}",
|
|
874
|
+
...options
|
|
875
|
+
});
|
|
876
|
+
/**
|
|
877
|
+
* Update an object
|
|
878
|
+
*
|
|
879
|
+
* Updates a single object. The object to be updated is identified by its `object_id`.
|
|
880
|
+
*
|
|
881
|
+
* Required scopes: `object_configuration:read-write`.
|
|
882
|
+
*
|
|
883
|
+
* Supported token levels: `workspace`, `user`.
|
|
884
|
+
*/
|
|
885
|
+
const patchV2ObjectsByObject = (options) => (options.client ?? client).patch({
|
|
886
|
+
security: [{
|
|
887
|
+
scheme: "bearer",
|
|
888
|
+
type: "http"
|
|
889
|
+
}],
|
|
890
|
+
url: "/v2/objects/{object}",
|
|
891
|
+
...options,
|
|
892
|
+
headers: {
|
|
893
|
+
"Content-Type": "application/json",
|
|
894
|
+
...options.headers
|
|
895
|
+
}
|
|
896
|
+
});
|
|
897
|
+
/**
|
|
898
|
+
* List views for object
|
|
899
|
+
*
|
|
900
|
+
* Lists saved views for an object. Results are ordered by view ID (`id.view_id` ascending).
|
|
901
|
+
*
|
|
902
|
+
* Required scopes: `object_configuration:read`.
|
|
903
|
+
*
|
|
904
|
+
* Supported token levels: `workspace`, `user`.
|
|
905
|
+
*/
|
|
906
|
+
const getV2ObjectsByObjectViews = (options) => (options.client ?? client).get({
|
|
907
|
+
security: [{
|
|
908
|
+
scheme: "bearer",
|
|
909
|
+
type: "http"
|
|
910
|
+
}],
|
|
911
|
+
url: "/v2/objects/{object}/views",
|
|
912
|
+
...options
|
|
913
|
+
});
|
|
914
|
+
/**
|
|
915
|
+
* List activities
|
|
916
|
+
*
|
|
917
|
+
* Lists all system-defined and user-defined activities in your workspace.
|
|
918
|
+
*
|
|
919
|
+
* This endpoint is in alpha and may be subject to breaking changes as we gather feedback.
|
|
920
|
+
*
|
|
921
|
+
* Required scopes: `activity_configuration:read`.
|
|
922
|
+
*
|
|
923
|
+
* Supported token levels: `workspace`, `user`.
|
|
924
|
+
*/
|
|
925
|
+
const getV2Activities = (options) => (options?.client ?? client).get({
|
|
926
|
+
security: [{
|
|
927
|
+
scheme: "bearer",
|
|
928
|
+
type: "http"
|
|
929
|
+
}],
|
|
930
|
+
url: "/v2/activities",
|
|
931
|
+
...options
|
|
932
|
+
});
|
|
933
|
+
/**
|
|
934
|
+
* Create an activity
|
|
935
|
+
*
|
|
936
|
+
* Creates a new custom activity in your workspace. Your workspace must have the custom activities billing feature enabled. Public apps may instead create activities with the integration activities billing feature.
|
|
937
|
+
*
|
|
938
|
+
* This endpoint is in alpha and may be subject to breaking changes as we gather feedback.
|
|
939
|
+
*
|
|
940
|
+
* Required scopes: `activity_configuration:read-write`.
|
|
941
|
+
*
|
|
942
|
+
* Supported token levels: `workspace`, `user`.
|
|
943
|
+
*/
|
|
944
|
+
const postV2Activities = (options) => (options.client ?? client).post({
|
|
945
|
+
security: [{
|
|
946
|
+
scheme: "bearer",
|
|
947
|
+
type: "http"
|
|
948
|
+
}],
|
|
949
|
+
url: "/v2/activities",
|
|
950
|
+
...options,
|
|
951
|
+
headers: {
|
|
952
|
+
"Content-Type": "application/json",
|
|
953
|
+
...options.headers
|
|
954
|
+
}
|
|
955
|
+
});
|
|
956
|
+
/**
|
|
957
|
+
* Delete an activity
|
|
958
|
+
*
|
|
959
|
+
* Deletes a single activity by its `activity_id` or slug, along with all of its records. Archived activities can also be deleted.
|
|
960
|
+
*
|
|
961
|
+
* This endpoint should be used with caution as it has the potential to remove a large amount of potentially valuable data.
|
|
962
|
+
*
|
|
963
|
+
* This endpoint is in alpha and may be subject to breaking changes as we gather feedback.
|
|
964
|
+
*
|
|
965
|
+
* Required scopes: `activity_configuration:read-write`, `activity_record:read-write`.
|
|
966
|
+
*
|
|
967
|
+
* Supported token levels: `workspace`, `user`.
|
|
968
|
+
*/
|
|
969
|
+
const deleteV2ActivitiesByActivity = (options) => (options.client ?? client).delete({
|
|
970
|
+
security: [{
|
|
971
|
+
scheme: "bearer",
|
|
972
|
+
type: "http"
|
|
973
|
+
}],
|
|
974
|
+
url: "/v2/activities/{activity}",
|
|
975
|
+
...options
|
|
976
|
+
});
|
|
977
|
+
/**
|
|
978
|
+
* Get an activity
|
|
979
|
+
*
|
|
980
|
+
* Gets a single activity by its `activity_id` or slug.
|
|
981
|
+
*
|
|
982
|
+
* This endpoint is in alpha and may be subject to breaking changes as we gather feedback.
|
|
983
|
+
*
|
|
984
|
+
* Required scopes: `activity_configuration:read`.
|
|
985
|
+
*
|
|
986
|
+
* Supported token levels: `workspace`, `user`.
|
|
987
|
+
*/
|
|
988
|
+
const getV2ActivitiesByActivity = (options) => (options.client ?? client).get({
|
|
989
|
+
security: [{
|
|
990
|
+
scheme: "bearer",
|
|
991
|
+
type: "http"
|
|
992
|
+
}],
|
|
993
|
+
url: "/v2/activities/{activity}",
|
|
994
|
+
...options
|
|
995
|
+
});
|
|
996
|
+
/**
|
|
997
|
+
* Update an activity
|
|
998
|
+
*
|
|
999
|
+
* Updates a single activity by its `activity_id` or slug. The schema an activity extends is fixed after creation, so `extends` cannot be changed.
|
|
1000
|
+
*
|
|
1001
|
+
* This endpoint is in alpha and may be subject to breaking changes as we gather feedback.
|
|
1002
|
+
*
|
|
1003
|
+
* Required scopes: `activity_configuration:read-write`.
|
|
1004
|
+
*
|
|
1005
|
+
* Supported token levels: `workspace`, `user`.
|
|
1006
|
+
*/
|
|
1007
|
+
const patchV2ActivitiesByActivity = (options) => (options.client ?? client).patch({
|
|
1008
|
+
security: [{
|
|
1009
|
+
scheme: "bearer",
|
|
1010
|
+
type: "http"
|
|
1011
|
+
}],
|
|
1012
|
+
url: "/v2/activities/{activity}",
|
|
1013
|
+
...options,
|
|
1014
|
+
headers: {
|
|
1015
|
+
"Content-Type": "application/json",
|
|
1016
|
+
...options.headers
|
|
1017
|
+
}
|
|
1018
|
+
});
|
|
1019
|
+
/**
|
|
1020
|
+
* List activity records
|
|
1021
|
+
*
|
|
1022
|
+
* Lists activity records, with the option to filter and sort results.
|
|
1023
|
+
*
|
|
1024
|
+
* This endpoint is in alpha and may be subject to breaking changes as we gather feedback.
|
|
1025
|
+
*
|
|
1026
|
+
* Required scopes: `activity_record:read`, `activity_configuration:read`, `object_configuration:read`, `record_permission:read`.
|
|
1027
|
+
*
|
|
1028
|
+
* Supported token levels: `workspace`, `user`.
|
|
1029
|
+
*/
|
|
1030
|
+
const postV2ActivitiesByActivityRecordsQuery = (options) => (options.client ?? client).post({
|
|
1031
|
+
security: [{
|
|
1032
|
+
scheme: "bearer",
|
|
1033
|
+
type: "http"
|
|
1034
|
+
}],
|
|
1035
|
+
url: "/v2/activities/{activity}/records/query",
|
|
1036
|
+
...options,
|
|
1037
|
+
headers: {
|
|
1038
|
+
"Content-Type": "application/json",
|
|
1039
|
+
...options.headers
|
|
1040
|
+
}
|
|
1041
|
+
});
|
|
1042
|
+
/**
|
|
1043
|
+
* Create an activity record
|
|
1044
|
+
*
|
|
1045
|
+
* Creates a new activity record, for example one specific phone call.
|
|
1046
|
+
*
|
|
1047
|
+
* This endpoint is in alpha and may be subject to breaking changes as we gather feedback.
|
|
1048
|
+
*
|
|
1049
|
+
* Required scopes: `activity_record:read-write`, `activity_configuration:read`, `object_configuration:read`, `record_permission:read`.
|
|
1050
|
+
*
|
|
1051
|
+
* Supported token levels: `workspace`, `user`.
|
|
1052
|
+
*/
|
|
1053
|
+
const postV2ActivitiesByActivityRecords = (options) => (options.client ?? client).post({
|
|
1054
|
+
security: [{
|
|
1055
|
+
scheme: "bearer",
|
|
1056
|
+
type: "http"
|
|
1057
|
+
}],
|
|
1058
|
+
url: "/v2/activities/{activity}/records",
|
|
1059
|
+
...options,
|
|
1060
|
+
headers: {
|
|
1061
|
+
"Content-Type": "application/json",
|
|
1062
|
+
...options.headers
|
|
1063
|
+
}
|
|
1064
|
+
});
|
|
1065
|
+
/**
|
|
1066
|
+
* Upsert an activity record
|
|
1067
|
+
*
|
|
1068
|
+
* Use this endpoint to create or update an activity record. A matching attribute is used to search for existing activity records. If a record is found with the same value for the matching attribute, that record will be updated. If no record with the same value for the matching attribute is found, a new record will be created instead. If you would like to avoid matching, please use the create activity record endpoint.
|
|
1069
|
+
*
|
|
1070
|
+
* If the matching attribute is a multiselect attribute, new values will be added and existing values will not be deleted. For any other multiselect attribute, all values will be either created or deleted as necessary to match the list of supplied values.
|
|
1071
|
+
*
|
|
1072
|
+
* This endpoint is in alpha and may be subject to breaking changes as we gather feedback.
|
|
1073
|
+
*
|
|
1074
|
+
* Required scopes: `activity_record:read-write`, `activity_configuration:read`, `object_configuration:read`, `record_permission:read`.
|
|
1075
|
+
*
|
|
1076
|
+
* Supported token levels: `workspace`, `user`.
|
|
1077
|
+
*/
|
|
1078
|
+
const putV2ActivitiesByActivityRecords = (options) => (options.client ?? client).put({
|
|
1079
|
+
security: [{
|
|
1080
|
+
scheme: "bearer",
|
|
1081
|
+
type: "http"
|
|
1082
|
+
}],
|
|
1083
|
+
url: "/v2/activities/{activity}/records",
|
|
1084
|
+
...options,
|
|
1085
|
+
headers: {
|
|
1086
|
+
"Content-Type": "application/json",
|
|
1087
|
+
...options.headers
|
|
1088
|
+
}
|
|
1089
|
+
});
|
|
1090
|
+
/**
|
|
1091
|
+
* Delete an activity record
|
|
1092
|
+
*
|
|
1093
|
+
* Deletes a single activity record by its `record_id`.
|
|
1094
|
+
*
|
|
1095
|
+
* This endpoint is in alpha and may be subject to breaking changes as we gather feedback.
|
|
1096
|
+
*
|
|
1097
|
+
* Required scopes: `activity_record:read-write`, `activity_configuration:read`, `object_configuration:read`, `record_permission:read`.
|
|
1098
|
+
*
|
|
1099
|
+
* Supported token levels: `workspace`, `user`.
|
|
1100
|
+
*/
|
|
1101
|
+
const deleteV2ActivitiesByActivityRecordsByRecordId = (options) => (options.client ?? client).delete({
|
|
1102
|
+
security: [{
|
|
1103
|
+
scheme: "bearer",
|
|
1104
|
+
type: "http"
|
|
1105
|
+
}],
|
|
1106
|
+
url: "/v2/activities/{activity}/records/{record_id}",
|
|
1107
|
+
...options
|
|
1108
|
+
});
|
|
1109
|
+
/**
|
|
1110
|
+
* Get an activity record
|
|
1111
|
+
*
|
|
1112
|
+
* Gets a single activity record by its `record_id`.
|
|
1113
|
+
*
|
|
1114
|
+
* This endpoint is in alpha and may be subject to breaking changes as we gather feedback.
|
|
1115
|
+
*
|
|
1116
|
+
* Required scopes: `activity_record:read`, `activity_configuration:read`, `object_configuration:read`, `record_permission:read`.
|
|
1117
|
+
*
|
|
1118
|
+
* Supported token levels: `workspace`, `user`.
|
|
1119
|
+
*/
|
|
1120
|
+
const getV2ActivitiesByActivityRecordsByRecordId = (options) => (options.client ?? client).get({
|
|
1121
|
+
security: [{
|
|
1122
|
+
scheme: "bearer",
|
|
1123
|
+
type: "http"
|
|
1124
|
+
}],
|
|
1125
|
+
url: "/v2/activities/{activity}/records/{record_id}",
|
|
1126
|
+
...options
|
|
1127
|
+
});
|
|
1128
|
+
/**
|
|
1129
|
+
* Update an activity record (append multiselect values)
|
|
1130
|
+
*
|
|
1131
|
+
* Use this endpoint to update activity records by `record_id`. If the update payload includes multiselect attributes, the values supplied will be created and prepended to the list of values that already exist (if any). Use the `PUT` endpoint to overwrite or remove multiselect attribute values.
|
|
1132
|
+
*
|
|
1133
|
+
* This endpoint is in alpha and may be subject to breaking changes as we gather feedback.
|
|
1134
|
+
*
|
|
1135
|
+
* Required scopes: `activity_record:read-write`, `activity_configuration:read`, `object_configuration:read`, `record_permission:read`.
|
|
1136
|
+
*
|
|
1137
|
+
* Supported token levels: `workspace`, `user`.
|
|
1138
|
+
*/
|
|
1139
|
+
const patchV2ActivitiesByActivityRecordsByRecordId = (options) => (options.client ?? client).patch({
|
|
1140
|
+
security: [{
|
|
1141
|
+
scheme: "bearer",
|
|
1142
|
+
type: "http"
|
|
1143
|
+
}],
|
|
1144
|
+
url: "/v2/activities/{activity}/records/{record_id}",
|
|
1145
|
+
...options,
|
|
1146
|
+
headers: {
|
|
1147
|
+
"Content-Type": "application/json",
|
|
1148
|
+
...options.headers
|
|
1149
|
+
}
|
|
1150
|
+
});
|
|
1151
|
+
/**
|
|
1152
|
+
* Update an activity record (overwrite multiselect values)
|
|
1153
|
+
*
|
|
1154
|
+
* Use this endpoint to update activity records by `record_id`. If the update payload includes multiselect attributes, the values supplied will overwrite/remove the list of values that already exist (if any). Use the `PATCH` endpoint to append multiselect values without removing those that already exist.
|
|
1155
|
+
*
|
|
1156
|
+
* This endpoint is in alpha and may be subject to breaking changes as we gather feedback.
|
|
1157
|
+
*
|
|
1158
|
+
* Required scopes: `activity_record:read-write`, `activity_configuration:read`, `object_configuration:read`, `record_permission:read`.
|
|
1159
|
+
*
|
|
1160
|
+
* Supported token levels: `workspace`, `user`.
|
|
1161
|
+
*/
|
|
1162
|
+
const putV2ActivitiesByActivityRecordsByRecordId = (options) => (options.client ?? client).put({
|
|
1163
|
+
security: [{
|
|
1164
|
+
scheme: "bearer",
|
|
1165
|
+
type: "http"
|
|
1166
|
+
}],
|
|
1167
|
+
url: "/v2/activities/{activity}/records/{record_id}",
|
|
1168
|
+
...options,
|
|
1169
|
+
headers: {
|
|
1170
|
+
"Content-Type": "application/json",
|
|
1171
|
+
...options.headers
|
|
1172
|
+
}
|
|
1173
|
+
});
|
|
1174
|
+
/**
|
|
1175
|
+
* List attributes
|
|
1176
|
+
*
|
|
1177
|
+
* Lists all attributes defined on a specific object or list. Attributes are returned in the order that they are sorted by in the UI.
|
|
1178
|
+
*
|
|
1179
|
+
* When `target` is `objects`, the required scopes are `object_configuration:read`. When `target` is `lists`, the required scopes are `list_configuration:read`.
|
|
1180
|
+
*
|
|
1181
|
+
* Supported token levels: `workspace`, `user`.
|
|
1182
|
+
*/
|
|
1183
|
+
const getV2ByTargetByIdentifierAttributes = (options) => (options.client ?? client).get({
|
|
1184
|
+
security: [{
|
|
1185
|
+
scheme: "bearer",
|
|
1186
|
+
type: "http"
|
|
1187
|
+
}],
|
|
1188
|
+
url: "/v2/{target}/{identifier}/attributes",
|
|
1189
|
+
...options
|
|
1190
|
+
});
|
|
1191
|
+
/**
|
|
1192
|
+
* Create an attribute
|
|
1193
|
+
*
|
|
1194
|
+
* Creates a new attribute on either an object or a list.
|
|
1195
|
+
*
|
|
1196
|
+
* For record-reference attributes, you can optionally create a bidirectional relationship by providing a `relationship` object. This will create two entangled attributes: one on the specified object and a reverse attribute on the related object.
|
|
1197
|
+
*
|
|
1198
|
+
* To create an attribute on an object, you must also have the `object_configuration:read-write` scope.
|
|
1199
|
+
*
|
|
1200
|
+
* To create an attribute on a list, you must also have the `list_configuration:read-write` scope.
|
|
1201
|
+
*
|
|
1202
|
+
* Supported token levels: `workspace`, `user`.
|
|
1203
|
+
*/
|
|
1204
|
+
const postV2ByTargetByIdentifierAttributes = (options) => (options.client ?? client).post({
|
|
1205
|
+
security: [{
|
|
1206
|
+
scheme: "bearer",
|
|
1207
|
+
type: "http"
|
|
1208
|
+
}],
|
|
1209
|
+
url: "/v2/{target}/{identifier}/attributes",
|
|
1210
|
+
...options,
|
|
1211
|
+
headers: {
|
|
1212
|
+
"Content-Type": "application/json",
|
|
1213
|
+
...options.headers
|
|
1214
|
+
}
|
|
1215
|
+
});
|
|
1216
|
+
/**
|
|
1217
|
+
* Get an attribute
|
|
1218
|
+
*
|
|
1219
|
+
* Gets information about a single attribute on either an object or a list.
|
|
1220
|
+
*
|
|
1221
|
+
* When `target` is `objects`, the required scopes are `object_configuration:read`. When `target` is `lists`, the required scopes are `list_configuration:read`.
|
|
1222
|
+
*
|
|
1223
|
+
* Supported token levels: `workspace`, `user`.
|
|
1224
|
+
*/
|
|
1225
|
+
const getV2ByTargetByIdentifierAttributesByAttribute = (options) => (options.client ?? client).get({
|
|
1226
|
+
security: [{
|
|
1227
|
+
scheme: "bearer",
|
|
1228
|
+
type: "http"
|
|
1229
|
+
}],
|
|
1230
|
+
url: "/v2/{target}/{identifier}/attributes/{attribute}",
|
|
1231
|
+
...options
|
|
1232
|
+
});
|
|
1233
|
+
/**
|
|
1234
|
+
* Update an attribute
|
|
1235
|
+
*
|
|
1236
|
+
* Updates a single attribute on a given object or list.
|
|
1237
|
+
*
|
|
1238
|
+
* When `target` is `objects`, the required scopes are `object_configuration:read-write`. When `target` is `lists`, the required scopes are `list_configuration:read-write`.
|
|
1239
|
+
*
|
|
1240
|
+
* Supported token levels: `workspace`, `user`.
|
|
1241
|
+
*/
|
|
1242
|
+
const patchV2ByTargetByIdentifierAttributesByAttribute = (options) => (options.client ?? client).patch({
|
|
1243
|
+
security: [{
|
|
1244
|
+
scheme: "bearer",
|
|
1245
|
+
type: "http"
|
|
1246
|
+
}],
|
|
1247
|
+
url: "/v2/{target}/{identifier}/attributes/{attribute}",
|
|
1248
|
+
...options,
|
|
1249
|
+
headers: {
|
|
1250
|
+
"Content-Type": "application/json",
|
|
1251
|
+
...options.headers
|
|
1252
|
+
}
|
|
1253
|
+
});
|
|
1254
|
+
/**
|
|
1255
|
+
* List select options
|
|
1256
|
+
*
|
|
1257
|
+
* Lists all select options for a particular attribute on either an object or a list.
|
|
1258
|
+
*
|
|
1259
|
+
* When `target` is `objects`, the required scopes are `object_configuration:read`. When `target` is `lists`, the required scopes are `list_configuration:read`.
|
|
1260
|
+
*
|
|
1261
|
+
* Supported token levels: `workspace`, `user`.
|
|
1262
|
+
*/
|
|
1263
|
+
const getV2ByTargetByIdentifierAttributesByAttributeOptions = (options) => (options.client ?? client).get({
|
|
1264
|
+
security: [{
|
|
1265
|
+
scheme: "bearer",
|
|
1266
|
+
type: "http"
|
|
1267
|
+
}],
|
|
1268
|
+
url: "/v2/{target}/{identifier}/attributes/{attribute}/options",
|
|
1269
|
+
...options
|
|
1270
|
+
});
|
|
1271
|
+
/**
|
|
1272
|
+
* Create a select option
|
|
1273
|
+
*
|
|
1274
|
+
* Adds a select option to a select attribute on an object or a list.
|
|
1275
|
+
*
|
|
1276
|
+
* When `target` is `objects`, the required scopes are `object_configuration:read-write`. When `target` is `lists`, the required scopes are `list_configuration:read-write`.
|
|
1277
|
+
*
|
|
1278
|
+
* Supported token levels: `workspace`, `user`.
|
|
1279
|
+
*/
|
|
1280
|
+
const postV2ByTargetByIdentifierAttributesByAttributeOptions = (options) => (options.client ?? client).post({
|
|
1281
|
+
security: [{
|
|
1282
|
+
scheme: "bearer",
|
|
1283
|
+
type: "http"
|
|
1284
|
+
}],
|
|
1285
|
+
url: "/v2/{target}/{identifier}/attributes/{attribute}/options",
|
|
1286
|
+
...options,
|
|
1287
|
+
headers: {
|
|
1288
|
+
"Content-Type": "application/json",
|
|
1289
|
+
...options.headers
|
|
1290
|
+
}
|
|
1291
|
+
});
|
|
1292
|
+
/**
|
|
1293
|
+
* Update a select option
|
|
1294
|
+
*
|
|
1295
|
+
* Updates a select option on an attribute on either an object or a list.
|
|
1296
|
+
*
|
|
1297
|
+
* When `target` is `objects`, the required scopes are `object_configuration:read-write`. When `target` is `lists`, the required scopes are `list_configuration:read-write`.
|
|
1298
|
+
*
|
|
1299
|
+
* Supported token levels: `workspace`, `user`.
|
|
1300
|
+
*/
|
|
1301
|
+
const patchV2ByTargetByIdentifierAttributesByAttributeOptionsByOption = (options) => (options.client ?? client).patch({
|
|
1302
|
+
security: [{
|
|
1303
|
+
scheme: "bearer",
|
|
1304
|
+
type: "http"
|
|
1305
|
+
}],
|
|
1306
|
+
url: "/v2/{target}/{identifier}/attributes/{attribute}/options/{option}",
|
|
1307
|
+
...options,
|
|
1308
|
+
headers: {
|
|
1309
|
+
"Content-Type": "application/json",
|
|
1310
|
+
...options.headers
|
|
1311
|
+
}
|
|
1312
|
+
});
|
|
1313
|
+
/**
|
|
1314
|
+
* List statuses
|
|
1315
|
+
*
|
|
1316
|
+
* Lists all statuses for a particular status attribute on either an object or a list.
|
|
1317
|
+
*
|
|
1318
|
+
* When `target` is `objects`, the required scopes are `object_configuration:read`. When `target` is `lists`, the required scopes are `list_configuration:read`.
|
|
1319
|
+
*
|
|
1320
|
+
* Supported token levels: `workspace`, `user`.
|
|
1321
|
+
*/
|
|
1322
|
+
const getV2ByTargetByIdentifierAttributesByAttributeStatuses = (options) => (options.client ?? client).get({
|
|
1323
|
+
security: [{
|
|
1324
|
+
scheme: "bearer",
|
|
1325
|
+
type: "http"
|
|
1326
|
+
}],
|
|
1327
|
+
url: "/v2/{target}/{identifier}/attributes/{attribute}/statuses",
|
|
1328
|
+
...options
|
|
1329
|
+
});
|
|
1330
|
+
/**
|
|
1331
|
+
* Create a status
|
|
1332
|
+
*
|
|
1333
|
+
* Add a new status to a status attribute on either an object or a list.
|
|
1334
|
+
*
|
|
1335
|
+
* When `target` is `objects`, the required scopes are `object_configuration:read-write`. When `target` is `lists`, the required scopes are `list_configuration:read-write`.
|
|
1336
|
+
*
|
|
1337
|
+
* Supported token levels: `workspace`, `user`.
|
|
1338
|
+
*/
|
|
1339
|
+
const postV2ByTargetByIdentifierAttributesByAttributeStatuses = (options) => (options.client ?? client).post({
|
|
1340
|
+
security: [{
|
|
1341
|
+
scheme: "bearer",
|
|
1342
|
+
type: "http"
|
|
1343
|
+
}],
|
|
1344
|
+
url: "/v2/{target}/{identifier}/attributes/{attribute}/statuses",
|
|
1345
|
+
...options,
|
|
1346
|
+
headers: {
|
|
1347
|
+
"Content-Type": "application/json",
|
|
1348
|
+
...options.headers
|
|
1349
|
+
}
|
|
1350
|
+
});
|
|
1351
|
+
/**
|
|
1352
|
+
* Update a status
|
|
1353
|
+
*
|
|
1354
|
+
* Update a status on an status attribute on either an object or a list.
|
|
1355
|
+
*
|
|
1356
|
+
* When `target` is `objects`, the required scopes are `object_configuration:read-write`. When `target` is `lists`, the required scopes are `list_configuration:read-write`.
|
|
1357
|
+
*
|
|
1358
|
+
* Supported token levels: `workspace`, `user`.
|
|
1359
|
+
*/
|
|
1360
|
+
const patchV2ByTargetByIdentifierAttributesByAttributeStatusesByStatus = (options) => (options.client ?? client).patch({
|
|
1361
|
+
security: [{
|
|
1362
|
+
scheme: "bearer",
|
|
1363
|
+
type: "http"
|
|
1364
|
+
}],
|
|
1365
|
+
url: "/v2/{target}/{identifier}/attributes/{attribute}/statuses/{status}",
|
|
1366
|
+
...options,
|
|
1367
|
+
headers: {
|
|
1368
|
+
"Content-Type": "application/json",
|
|
1369
|
+
...options.headers
|
|
1370
|
+
}
|
|
1371
|
+
});
|
|
1372
|
+
/**
|
|
1373
|
+
* List records
|
|
1374
|
+
*
|
|
1375
|
+
* Lists people, company or other records, with the option to filter and sort results.
|
|
1376
|
+
*
|
|
1377
|
+
* Required scopes: `record_permission:read`, `object_configuration:read`.
|
|
1378
|
+
*
|
|
1379
|
+
* Supported token levels: `workspace`, `user`.
|
|
1380
|
+
*/
|
|
1381
|
+
const postV2ObjectsByObjectRecordsQuery = (options) => (options.client ?? client).post({
|
|
1382
|
+
security: [{
|
|
1383
|
+
scheme: "bearer",
|
|
1384
|
+
type: "http"
|
|
1385
|
+
}],
|
|
1386
|
+
url: "/v2/objects/{object}/records/query",
|
|
1387
|
+
...options,
|
|
1388
|
+
headers: {
|
|
1389
|
+
"Content-Type": "application/json",
|
|
1390
|
+
...options.headers
|
|
1391
|
+
}
|
|
1392
|
+
});
|
|
1393
|
+
/**
|
|
1394
|
+
* Create a record
|
|
1395
|
+
*
|
|
1396
|
+
* Creates a new person, company or other record. This endpoint will throw on conflicts of unique attributes. If you would prefer to update records on conflicts, please use the [Upsert record endpoint](/rest-api/endpoint-reference/records/upsert-a-record) instead.
|
|
1397
|
+
*
|
|
1398
|
+
* Required scopes: `record_permission:read-write`, `object_configuration:read`.
|
|
1399
|
+
*
|
|
1400
|
+
* Supported token levels: `workspace`, `user`.
|
|
1401
|
+
*/
|
|
1402
|
+
const postV2ObjectsByObjectRecords = (options) => (options.client ?? client).post({
|
|
1403
|
+
security: [{
|
|
1404
|
+
scheme: "bearer",
|
|
1405
|
+
type: "http"
|
|
1406
|
+
}],
|
|
1407
|
+
url: "/v2/objects/{object}/records",
|
|
1408
|
+
...options,
|
|
1409
|
+
headers: {
|
|
1410
|
+
"Content-Type": "application/json",
|
|
1411
|
+
...options.headers
|
|
1412
|
+
}
|
|
1413
|
+
});
|
|
1414
|
+
/**
|
|
1415
|
+
* Upsert a record
|
|
1416
|
+
*
|
|
1417
|
+
* Use this endpoint to create or update people, companies and other records. A matching attribute is used to search for existing records. If a record is found with the same value for the matching attribute, that record will be updated. If no record with the same value for the matching attribute is found, a new record will be created instead. If you would like to avoid matching, please use the [Create record endpoint](/rest-api/endpoint-reference/records/create-a-record).
|
|
1418
|
+
*
|
|
1419
|
+
* If the matching attribute is a multiselect attribute, new values will be added and existing values will not be deleted. For any other multiselect attribute, all values will be either created or deleted as necessary to match the list of supplied values.
|
|
1420
|
+
*
|
|
1421
|
+
* Required scopes: `record_permission:read-write`, `object_configuration:read`.
|
|
1422
|
+
*
|
|
1423
|
+
* Supported token levels: `workspace`, `user`.
|
|
1424
|
+
*/
|
|
1425
|
+
const putV2ObjectsByObjectRecords = (options) => (options.client ?? client).put({
|
|
1426
|
+
security: [{
|
|
1427
|
+
scheme: "bearer",
|
|
1428
|
+
type: "http"
|
|
1429
|
+
}],
|
|
1430
|
+
url: "/v2/objects/{object}/records",
|
|
1431
|
+
...options,
|
|
1432
|
+
headers: {
|
|
1433
|
+
"Content-Type": "application/json",
|
|
1434
|
+
...options.headers
|
|
1435
|
+
}
|
|
1436
|
+
});
|
|
1437
|
+
/**
|
|
1438
|
+
* Delete a record
|
|
1439
|
+
*
|
|
1440
|
+
* Deletes a single record (e.g. a company or person) by ID.
|
|
1441
|
+
*
|
|
1442
|
+
* Required scopes: `object_configuration:read`, `record_permission:read-write`.
|
|
1443
|
+
*
|
|
1444
|
+
* Supported token levels: `workspace`, `user`.
|
|
1445
|
+
*/
|
|
1446
|
+
const deleteV2ObjectsByObjectRecordsByRecordId = (options) => (options.client ?? client).delete({
|
|
1447
|
+
security: [{
|
|
1448
|
+
scheme: "bearer",
|
|
1449
|
+
type: "http"
|
|
1450
|
+
}],
|
|
1451
|
+
url: "/v2/objects/{object}/records/{record_id}",
|
|
1452
|
+
...options
|
|
1453
|
+
});
|
|
1454
|
+
/**
|
|
1455
|
+
* Get a record
|
|
1456
|
+
*
|
|
1457
|
+
* Gets a single person, company or other record by its `record_id`.
|
|
1458
|
+
*
|
|
1459
|
+
* Required scopes: `record_permission:read`, `object_configuration:read`.
|
|
1460
|
+
*
|
|
1461
|
+
* Supported token levels: `workspace`, `user`.
|
|
1462
|
+
*/
|
|
1463
|
+
const getV2ObjectsByObjectRecordsByRecordId = (options) => (options.client ?? client).get({
|
|
1464
|
+
security: [{
|
|
1465
|
+
scheme: "bearer",
|
|
1466
|
+
type: "http"
|
|
1467
|
+
}],
|
|
1468
|
+
url: "/v2/objects/{object}/records/{record_id}",
|
|
1469
|
+
...options
|
|
1470
|
+
});
|
|
1471
|
+
/**
|
|
1472
|
+
* Update a record (append multiselect values)
|
|
1473
|
+
*
|
|
1474
|
+
* Use this endpoint to update people, companies, and other records by `record_id`. If the update payload includes multiselect attributes, the values supplied will be created and prepended to the list of values that already exist (if any). Use the `PUT` endpoint to overwrite or remove multiselect attribute values.
|
|
1475
|
+
*
|
|
1476
|
+
* Required scopes: `record_permission:read-write`, `object_configuration:read`.
|
|
1477
|
+
*
|
|
1478
|
+
* Supported token levels: `workspace`, `user`.
|
|
1479
|
+
*/
|
|
1480
|
+
const patchV2ObjectsByObjectRecordsByRecordId = (options) => (options.client ?? client).patch({
|
|
1481
|
+
security: [{
|
|
1482
|
+
scheme: "bearer",
|
|
1483
|
+
type: "http"
|
|
1484
|
+
}],
|
|
1485
|
+
url: "/v2/objects/{object}/records/{record_id}",
|
|
1486
|
+
...options,
|
|
1487
|
+
headers: {
|
|
1488
|
+
"Content-Type": "application/json",
|
|
1489
|
+
...options.headers
|
|
1490
|
+
}
|
|
1491
|
+
});
|
|
1492
|
+
/**
|
|
1493
|
+
* Update a record (overwrite multiselect values)
|
|
1494
|
+
*
|
|
1495
|
+
* Use this endpoint to update people, companies, and other records by `record_id`. If the update payload includes multiselect attributes, the values supplied will overwrite/remove the list of values that already exist (if any). Use the `PATCH` endpoint to append multiselect values without removing those that already exist.
|
|
1496
|
+
*
|
|
1497
|
+
* Required scopes: `record_permission:read-write`, `object_configuration:read`.
|
|
1498
|
+
*
|
|
1499
|
+
* Supported token levels: `workspace`, `user`.
|
|
1500
|
+
*/
|
|
1501
|
+
const putV2ObjectsByObjectRecordsByRecordId = (options) => (options.client ?? client).put({
|
|
1502
|
+
security: [{
|
|
1503
|
+
scheme: "bearer",
|
|
1504
|
+
type: "http"
|
|
1505
|
+
}],
|
|
1506
|
+
url: "/v2/objects/{object}/records/{record_id}",
|
|
1507
|
+
...options,
|
|
1508
|
+
headers: {
|
|
1509
|
+
"Content-Type": "application/json",
|
|
1510
|
+
...options.headers
|
|
1511
|
+
}
|
|
1512
|
+
});
|
|
1513
|
+
/**
|
|
1514
|
+
* Merge two records
|
|
1515
|
+
*
|
|
1516
|
+
* Merges two records of the same object together. Where both records have a value for the same attribute, the primary record's value takes precedence.
|
|
1517
|
+
*
|
|
1518
|
+
* Merging produces a **new** record, so the `new_record_id` returned will match neither of the records supplied in the request. Both of the original records are marked as merged and can no longer be read or written.
|
|
1519
|
+
*
|
|
1520
|
+
* Large merges are completed asynchronously. A `200` response means the merged record is readable immediately. A `202` response means the merge has been accepted but is still being applied, and reading the merged record will return a `404` with the `merge_in_progress` error code until it completes.
|
|
1521
|
+
*
|
|
1522
|
+
* This endpoint is not idempotent. Because both original records are marked as merged, repeating the same request returns `404`.
|
|
1523
|
+
*
|
|
1524
|
+
* This endpoint is rate limited to 5 requests per second.
|
|
1525
|
+
*
|
|
1526
|
+
* This endpoint is in beta. We will aim to avoid breaking changes, but small updates may be made as we roll out to more users.
|
|
1527
|
+
*
|
|
1528
|
+
* Required scopes: `record_permission:read-write`, `object_configuration:read`.
|
|
1529
|
+
*
|
|
1530
|
+
* Supported token levels: `workspace`, `user`.
|
|
1531
|
+
*/
|
|
1532
|
+
const postV2ObjectsByObjectRecordsMerge = (options) => (options.client ?? client).post({
|
|
1533
|
+
security: [{
|
|
1534
|
+
scheme: "bearer",
|
|
1535
|
+
type: "http"
|
|
1536
|
+
}],
|
|
1537
|
+
url: "/v2/objects/{object}/records/merge",
|
|
1538
|
+
...options,
|
|
1539
|
+
headers: {
|
|
1540
|
+
"Content-Type": "application/json",
|
|
1541
|
+
...options.headers
|
|
1542
|
+
}
|
|
1543
|
+
});
|
|
1544
|
+
/**
|
|
1545
|
+
* List record attribute values
|
|
1546
|
+
*
|
|
1547
|
+
* Gets all values for a given attribute on a record. Historic values can be queried using the `show_historic` query param. Historic values cannot be queried on COMINT (Communication Intelligence) or enriched attributes and the endpoint will return a 400 error if this is attempted. Historic values are sorted from oldest to newest (by `active_from`). Some attributes are subject to billing status and will return an empty array of values if theworkspace being queried does not have the required billing flag enabled.
|
|
1548
|
+
*
|
|
1549
|
+
* Required scopes: `record_permission:read`, `object_configuration:read`.
|
|
1550
|
+
*
|
|
1551
|
+
* Supported token levels: `workspace`, `user`.
|
|
1552
|
+
*/
|
|
1553
|
+
const getV2ObjectsByObjectRecordsByRecordIdAttributesByAttributeValues = (options) => (options.client ?? client).get({
|
|
1554
|
+
security: [{
|
|
1555
|
+
scheme: "bearer",
|
|
1556
|
+
type: "http"
|
|
1557
|
+
}],
|
|
1558
|
+
url: "/v2/objects/{object}/records/{record_id}/attributes/{attribute}/values",
|
|
1559
|
+
...options
|
|
1560
|
+
});
|
|
1561
|
+
/**
|
|
1562
|
+
* Write record attribute values
|
|
1563
|
+
*
|
|
1564
|
+
* Replaces the entire value history of a single attribute on a record, primarily to migrate historic data from an external source. Every value the attribute currently has is destroyed, including values not present in the request, and the supplied values are written with the `active_from` and `active_until` timestamps given.
|
|
1565
|
+
*
|
|
1566
|
+
* Values may be supplied in any order and gaps between intervals are allowed. For attributes that accept a single value, at most one value may be active at a time, so intervals may not overlap and at most one may have a `null` `active_until`. At least one value is required.
|
|
1567
|
+
*
|
|
1568
|
+
* Webhooks and workflow triggers do not fire for these writes, so migrating history does not replay automations. Search indexes and caches are still updated, and formula attributes that depend on this attribute are still recalculated.
|
|
1569
|
+
*
|
|
1570
|
+
* Value history cannot be written for relationship attributes, formula attributes, enriched attributes, or immutable system attributes such as the entry's parent record.
|
|
1571
|
+
*
|
|
1572
|
+
* This endpoint is in beta. We will aim to avoid breaking changes, but small updates may be made as we roll out to more users.
|
|
1573
|
+
*
|
|
1574
|
+
* Required scopes: `record_permission:read-write`, `object_configuration:read`.
|
|
1575
|
+
*
|
|
1576
|
+
* Supported token levels: `workspace`, `user`.
|
|
1577
|
+
*/
|
|
1578
|
+
const putV2ObjectsByObjectRecordsByRecordIdAttributesByAttributeValues = (options) => (options.client ?? client).put({
|
|
1579
|
+
security: [{
|
|
1580
|
+
scheme: "bearer",
|
|
1581
|
+
type: "http"
|
|
1582
|
+
}],
|
|
1583
|
+
url: "/v2/objects/{object}/records/{record_id}/attributes/{attribute}/values",
|
|
1584
|
+
...options,
|
|
1585
|
+
headers: {
|
|
1586
|
+
"Content-Type": "application/json",
|
|
1587
|
+
...options.headers
|
|
1588
|
+
}
|
|
1589
|
+
});
|
|
1590
|
+
/**
|
|
1591
|
+
* List record entries
|
|
1592
|
+
*
|
|
1593
|
+
* List all entries, across all lists, for which this record is the parent. The response includes metadata for each entry, including `entry_id`, `list_id`, and `created_at`, but does not include entry values. To retrieve the values, call [Get a list entry](/rest-api/endpoint-reference/entries/get-a-list-entry) separately for each entry.
|
|
1594
|
+
*
|
|
1595
|
+
* Required scopes: `record_permission:read`, `object_configuration:read`, `list_entry:read`.
|
|
1596
|
+
*
|
|
1597
|
+
* Supported token levels: `workspace`, `user`.
|
|
1598
|
+
*/
|
|
1599
|
+
const getV2ObjectsByObjectRecordsByRecordIdEntries = (options) => (options.client ?? client).get({
|
|
1600
|
+
security: [{
|
|
1601
|
+
scheme: "bearer",
|
|
1602
|
+
type: "http"
|
|
1603
|
+
}],
|
|
1604
|
+
url: "/v2/objects/{object}/records/{record_id}/entries",
|
|
1605
|
+
...options
|
|
1606
|
+
});
|
|
1607
|
+
/**
|
|
1608
|
+
* Search records
|
|
1609
|
+
*
|
|
1610
|
+
* The search records endpoint provides a convenient way to fuzzy search for records across one or more objects.
|
|
1611
|
+
* The matching strategy employed in this endpoint follows the in-product strategy and will match names, domains, emails, phone numbers and social handles on people and companies, and labels on all other objects.
|
|
1612
|
+
* Please note, results returned from this endpoint are eventually consistent. For results which are guaranteed to be up to date, please use the record query endpoint instead.
|
|
1613
|
+
*
|
|
1614
|
+
* This endpoint is in beta. We will aim to avoid breaking changes, but small updates may be made as we roll out to more users.
|
|
1615
|
+
*
|
|
1616
|
+
* Required scopes: `record_permission:read`, `object_configuration:read`.
|
|
1617
|
+
*
|
|
1618
|
+
* Supported token levels: `workspace`, `user`.
|
|
1619
|
+
*/
|
|
1620
|
+
const postV2ObjectsRecordsSearch = (options) => (options.client ?? client).post({
|
|
1621
|
+
security: [{
|
|
1622
|
+
scheme: "bearer",
|
|
1623
|
+
type: "http"
|
|
1624
|
+
}],
|
|
1625
|
+
url: "/v2/objects/records/search",
|
|
1626
|
+
...options,
|
|
1627
|
+
headers: {
|
|
1628
|
+
"Content-Type": "application/json",
|
|
1629
|
+
...options.headers
|
|
1630
|
+
}
|
|
1631
|
+
});
|
|
1632
|
+
/**
|
|
1633
|
+
* Query SQL
|
|
1634
|
+
*
|
|
1635
|
+
* Query records and lists with SQL. Your workspace must be on the Enterprise plan in order to access this endpoint.
|
|
1636
|
+
*
|
|
1637
|
+
* This endpoint is rate limited to 2 requests per second.
|
|
1638
|
+
*
|
|
1639
|
+
* This endpoint is in beta. We will aim to avoid breaking changes, but small updates may be made as we roll out to more users.
|
|
1640
|
+
*
|
|
1641
|
+
* Required scopes: `record_permission:read`, `object_configuration:read`.
|
|
1642
|
+
*
|
|
1643
|
+
* Supported token levels: `workspace`, `user`.
|
|
1644
|
+
*/
|
|
1645
|
+
const postV2Sql = (options) => (options.client ?? client).post({
|
|
1646
|
+
security: [{
|
|
1647
|
+
scheme: "bearer",
|
|
1648
|
+
type: "http"
|
|
1649
|
+
}],
|
|
1650
|
+
url: "/v2/sql",
|
|
1651
|
+
...options,
|
|
1652
|
+
headers: {
|
|
1653
|
+
"Content-Type": "application/json",
|
|
1654
|
+
...options.headers
|
|
1655
|
+
}
|
|
1656
|
+
});
|
|
1657
|
+
/**
|
|
1658
|
+
* List all lists
|
|
1659
|
+
*
|
|
1660
|
+
* List all lists that your access token has access to. lists are returned in the order that they are sorted in the sidebar.
|
|
1661
|
+
*
|
|
1662
|
+
* Required scopes: `list_configuration:read`.
|
|
1663
|
+
*
|
|
1664
|
+
* Supported token levels: `workspace`, `user`.
|
|
1665
|
+
*/
|
|
1666
|
+
const getV2Lists = (options) => (options?.client ?? client).get({
|
|
1667
|
+
security: [{
|
|
1668
|
+
scheme: "bearer",
|
|
1669
|
+
type: "http"
|
|
1670
|
+
}],
|
|
1671
|
+
url: "/v2/lists",
|
|
1672
|
+
...options
|
|
1673
|
+
});
|
|
1674
|
+
/**
|
|
1675
|
+
* Create a list
|
|
1676
|
+
*
|
|
1677
|
+
* Creates a new list.
|
|
1678
|
+
*
|
|
1679
|
+
* Once you have your list, add attributes to it using the [Create attribute](/rest-api/endpoint-reference/attributes/create-an-attribute) API, and add records to it using the [Add records to list](/rest-api/endpoint-reference/entries/create-an-entry-add-record-to-list) API.
|
|
1680
|
+
*
|
|
1681
|
+
* New lists must specify which records can be added with the `parent_object` parameter which accepts either an object slug or an object ID. Permissions for the list are controlled with the `workspace_access` and `workspace_member_access` parameters.
|
|
1682
|
+
*
|
|
1683
|
+
* Please note that new lists must have either `workspace_access` set to `"full-access"` or one or more element of `workspace_member_access` with a `"full-access"` level. It is also possible to receive a `403` billing error if your workspace is not on a plan that supports either advanced workspace or workspace member-level access for lists.
|
|
1684
|
+
*
|
|
1685
|
+
* Required scopes: `list_configuration:read-write`.
|
|
1686
|
+
*
|
|
1687
|
+
* Supported token levels: `workspace`, `user`.
|
|
1688
|
+
*/
|
|
1689
|
+
const postV2Lists = (options) => (options.client ?? client).post({
|
|
1690
|
+
security: [{
|
|
1691
|
+
scheme: "bearer",
|
|
1692
|
+
type: "http"
|
|
1693
|
+
}],
|
|
1694
|
+
url: "/v2/lists",
|
|
1695
|
+
...options,
|
|
1696
|
+
headers: {
|
|
1697
|
+
"Content-Type": "application/json",
|
|
1698
|
+
...options.headers
|
|
1699
|
+
}
|
|
1700
|
+
});
|
|
1701
|
+
/**
|
|
1702
|
+
* Get a list
|
|
1703
|
+
*
|
|
1704
|
+
* Gets a single list in your workspace that your access token has access to.
|
|
1705
|
+
*
|
|
1706
|
+
* Required scopes: `list_configuration:read`.
|
|
1707
|
+
*
|
|
1708
|
+
* Supported token levels: `workspace`, `user`.
|
|
1709
|
+
*/
|
|
1710
|
+
const getV2ListsByList = (options) => (options.client ?? client).get({
|
|
1711
|
+
security: [{
|
|
1712
|
+
scheme: "bearer",
|
|
1713
|
+
type: "http"
|
|
1714
|
+
}],
|
|
1715
|
+
url: "/v2/lists/{list}",
|
|
1716
|
+
...options
|
|
1717
|
+
});
|
|
1718
|
+
/**
|
|
1719
|
+
* Update a list
|
|
1720
|
+
*
|
|
1721
|
+
* Updates an existing list. Permissions for the list are controlled with the `workspace_access` and `workspace_member_access` parameters. Please note that lists must have either `workspace_access` set to `"full-access"` or one or more element of `workspace_member_access` with a `"full-access"` level. It is also possible to receive a `403` billing error if your workspace is not on a plan that supports either advanced workspace or workspace member level access for lists. Changing the parent object of a list is not possible through the API as it can have unintended side-effects that should be considered carefully. If you wish to carry out a parent object change you should do so through the UI.
|
|
1722
|
+
*
|
|
1723
|
+
* Required scopes: `list_configuration:read-write`.
|
|
1724
|
+
*
|
|
1725
|
+
* Supported token levels: `workspace`, `user`.
|
|
1726
|
+
*/
|
|
1727
|
+
const patchV2ListsByList = (options) => (options.client ?? client).patch({
|
|
1728
|
+
security: [{
|
|
1729
|
+
scheme: "bearer",
|
|
1730
|
+
type: "http"
|
|
1731
|
+
}],
|
|
1732
|
+
url: "/v2/lists/{list}",
|
|
1733
|
+
...options,
|
|
1734
|
+
headers: {
|
|
1735
|
+
"Content-Type": "application/json",
|
|
1736
|
+
...options.headers
|
|
1737
|
+
}
|
|
1738
|
+
});
|
|
1739
|
+
/**
|
|
1740
|
+
* List views for list
|
|
1741
|
+
*
|
|
1742
|
+
* Lists saved views for a list. Results are ordered by view ID (`id.view_id` ascending).
|
|
1743
|
+
*
|
|
1744
|
+
* Required scopes: `list_configuration:read`.
|
|
1745
|
+
*
|
|
1746
|
+
* Supported token levels: `workspace`, `user`.
|
|
1747
|
+
*/
|
|
1748
|
+
const getV2ListsByListViews = (options) => (options.client ?? client).get({
|
|
1749
|
+
security: [{
|
|
1750
|
+
scheme: "bearer",
|
|
1751
|
+
type: "http"
|
|
1752
|
+
}],
|
|
1753
|
+
url: "/v2/lists/{list}/views",
|
|
1754
|
+
...options
|
|
1755
|
+
});
|
|
1756
|
+
/**
|
|
1757
|
+
* List entries
|
|
1758
|
+
*
|
|
1759
|
+
* Lists entries in a given list, with the option to filter and sort results.
|
|
1760
|
+
*
|
|
1761
|
+
* Required scopes: `list_entry:read`, `list_configuration:read`.
|
|
1762
|
+
*
|
|
1763
|
+
* Supported token levels: `workspace`, `user`.
|
|
1764
|
+
*/
|
|
1765
|
+
const postV2ListsByListEntriesQuery = (options) => (options.client ?? client).post({
|
|
1766
|
+
security: [{
|
|
1767
|
+
scheme: "bearer",
|
|
1768
|
+
type: "http"
|
|
1769
|
+
}],
|
|
1770
|
+
url: "/v2/lists/{list}/entries/query",
|
|
1771
|
+
...options,
|
|
1772
|
+
headers: {
|
|
1773
|
+
"Content-Type": "application/json",
|
|
1774
|
+
...options.headers
|
|
1775
|
+
}
|
|
1776
|
+
});
|
|
1777
|
+
/**
|
|
1778
|
+
* Create an entry (add record to list)
|
|
1779
|
+
*
|
|
1780
|
+
* Adds a record to a list as a new list entry. This endpoint will throw on conflicts of unique attributes. Multiple list entries are allowed for the same parent record
|
|
1781
|
+
*
|
|
1782
|
+
* Required scopes: `list_entry:read-write`, `list_configuration:read`.
|
|
1783
|
+
*
|
|
1784
|
+
* Supported token levels: `workspace`, `user`.
|
|
1785
|
+
*/
|
|
1786
|
+
const postV2ListsByListEntries = (options) => (options.client ?? client).post({
|
|
1787
|
+
security: [{
|
|
1788
|
+
scheme: "bearer",
|
|
1789
|
+
type: "http"
|
|
1790
|
+
}],
|
|
1791
|
+
url: "/v2/lists/{list}/entries",
|
|
1792
|
+
...options,
|
|
1793
|
+
headers: {
|
|
1794
|
+
"Content-Type": "application/json",
|
|
1795
|
+
...options.headers
|
|
1796
|
+
}
|
|
1797
|
+
});
|
|
1798
|
+
/**
|
|
1799
|
+
* Upsert a list entry by parent
|
|
1800
|
+
*
|
|
1801
|
+
* Use this endpoint to create or update a list entry for a given parent record. If an entry with the specified parent record is found, that entry will be updated. If no such entry is found, a new entry will be created instead. If there are multiple entries with the same parent record, this endpoint with return the "MULTIPLE_MATCH_RESULTS" error. When writing to multi-select attributes, all values will be either created or deleted as necessary to match the list of values supplied in the request body.
|
|
1802
|
+
*
|
|
1803
|
+
* Required scopes: `list_entry:read-write`, `list_configuration:read`.
|
|
1804
|
+
*
|
|
1805
|
+
* Supported token levels: `workspace`, `user`.
|
|
1806
|
+
*/
|
|
1807
|
+
const putV2ListsByListEntries = (options) => (options.client ?? client).put({
|
|
1808
|
+
security: [{
|
|
1809
|
+
scheme: "bearer",
|
|
1810
|
+
type: "http"
|
|
1811
|
+
}],
|
|
1812
|
+
url: "/v2/lists/{list}/entries",
|
|
1813
|
+
...options,
|
|
1814
|
+
headers: {
|
|
1815
|
+
"Content-Type": "application/json",
|
|
1816
|
+
...options.headers
|
|
1817
|
+
}
|
|
1818
|
+
});
|
|
1819
|
+
/**
|
|
1820
|
+
* Delete a list entry
|
|
1821
|
+
*
|
|
1822
|
+
* Deletes a single list entry by its `entry_id`.
|
|
1823
|
+
*
|
|
1824
|
+
* Required scopes: `list_entry:read-write`, `list_configuration:read`.
|
|
1825
|
+
*
|
|
1826
|
+
* Supported token levels: `workspace`, `user`.
|
|
1827
|
+
*/
|
|
1828
|
+
const deleteV2ListsByListEntriesByEntryId = (options) => (options.client ?? client).delete({
|
|
1829
|
+
security: [{
|
|
1830
|
+
scheme: "bearer",
|
|
1831
|
+
type: "http"
|
|
1832
|
+
}],
|
|
1833
|
+
url: "/v2/lists/{list}/entries/{entry_id}",
|
|
1834
|
+
...options
|
|
1835
|
+
});
|
|
1836
|
+
/**
|
|
1837
|
+
* Get a list entry
|
|
1838
|
+
*
|
|
1839
|
+
* Gets a single list entry by its `entry_id`.
|
|
1840
|
+
*
|
|
1841
|
+
* Required scopes: `list_entry:read`, `list_configuration:read`.
|
|
1842
|
+
*
|
|
1843
|
+
* Supported token levels: `workspace`, `user`.
|
|
1844
|
+
*/
|
|
1845
|
+
const getV2ListsByListEntriesByEntryId = (options) => (options.client ?? client).get({
|
|
1846
|
+
security: [{
|
|
1847
|
+
scheme: "bearer",
|
|
1848
|
+
type: "http"
|
|
1849
|
+
}],
|
|
1850
|
+
url: "/v2/lists/{list}/entries/{entry_id}",
|
|
1851
|
+
...options
|
|
1852
|
+
});
|
|
1853
|
+
/**
|
|
1854
|
+
* Update a list entry (append multiselect values)
|
|
1855
|
+
*
|
|
1856
|
+
* Use this endpoint to update list entries by `entry_id`. If the update payload includes multiselect attributes, the values supplied will be created and prepended to the list of values that already exist (if any). Use the `PUT` endpoint to overwrite or remove multiselect attribute values.
|
|
1857
|
+
*
|
|
1858
|
+
* Required scopes: `list_entry:read-write`, `list_configuration:read`.
|
|
1859
|
+
*
|
|
1860
|
+
* Supported token levels: `workspace`, `user`.
|
|
1861
|
+
*/
|
|
1862
|
+
const patchV2ListsByListEntriesByEntryId = (options) => (options.client ?? client).patch({
|
|
1863
|
+
security: [{
|
|
1864
|
+
scheme: "bearer",
|
|
1865
|
+
type: "http"
|
|
1866
|
+
}],
|
|
1867
|
+
url: "/v2/lists/{list}/entries/{entry_id}",
|
|
1868
|
+
...options,
|
|
1869
|
+
headers: {
|
|
1870
|
+
"Content-Type": "application/json",
|
|
1871
|
+
...options.headers
|
|
1872
|
+
}
|
|
1873
|
+
});
|
|
1874
|
+
/**
|
|
1875
|
+
* Update a list entry (overwrite multiselect values)
|
|
1876
|
+
*
|
|
1877
|
+
* Use this endpoint to update list entries by `entry_id`. If the update payload includes multiselect attributes, the values supplied will overwrite/remove the list of values that already exist (if any). Use the `PATCH` endpoint to add multiselect attribute values without removing those value that already exist.
|
|
1878
|
+
*
|
|
1879
|
+
* Required scopes: `list_entry:read-write`, `list_configuration:read`.
|
|
1880
|
+
*
|
|
1881
|
+
* Supported token levels: `workspace`, `user`.
|
|
1882
|
+
*/
|
|
1883
|
+
const putV2ListsByListEntriesByEntryId = (options) => (options.client ?? client).put({
|
|
1884
|
+
security: [{
|
|
1885
|
+
scheme: "bearer",
|
|
1886
|
+
type: "http"
|
|
1887
|
+
}],
|
|
1888
|
+
url: "/v2/lists/{list}/entries/{entry_id}",
|
|
1889
|
+
...options,
|
|
1890
|
+
headers: {
|
|
1891
|
+
"Content-Type": "application/json",
|
|
1892
|
+
...options.headers
|
|
1893
|
+
}
|
|
1894
|
+
});
|
|
1895
|
+
/**
|
|
1896
|
+
* List attribute values for a list entry
|
|
1897
|
+
*
|
|
1898
|
+
* Gets all values for a given attribute on a list entry. This endpoint has the ability to return all historic values using the `show_historic` query param. Historic values are sorted from oldest to newest (by `active_from`).
|
|
1899
|
+
*
|
|
1900
|
+
* Required scopes: `list_entry:read`, `list_configuration:read`.
|
|
1901
|
+
*
|
|
1902
|
+
* Supported token levels: `workspace`, `user`.
|
|
1903
|
+
*/
|
|
1904
|
+
const getV2ListsByListEntriesByEntryIdAttributesByAttributeValues = (options) => (options.client ?? client).get({
|
|
1905
|
+
security: [{
|
|
1906
|
+
scheme: "bearer",
|
|
1907
|
+
type: "http"
|
|
1908
|
+
}],
|
|
1909
|
+
url: "/v2/lists/{list}/entries/{entry_id}/attributes/{attribute}/values",
|
|
1910
|
+
...options
|
|
1911
|
+
});
|
|
1912
|
+
/**
|
|
1913
|
+
* Write list entry attribute values
|
|
1914
|
+
*
|
|
1915
|
+
* Replaces the entire value history of a single attribute on a list entry, primarily to migrate historic data from an external source. Every value the attribute currently has is destroyed, including values not present in the request, and the supplied values are written with the `active_from` and `active_until` timestamps given.
|
|
1916
|
+
*
|
|
1917
|
+
* Values may be supplied in any order and gaps between intervals are allowed. For attributes that accept a single value, at most one value may be active at a time, so intervals may not overlap and at most one may have a `null` `active_until`. At least one value is required.
|
|
1918
|
+
*
|
|
1919
|
+
* Webhooks and workflow triggers do not fire for these writes, so migrating history does not replay automations. Search indexes and caches are still updated, and formula attributes that depend on this attribute are still recalculated.
|
|
1920
|
+
*
|
|
1921
|
+
* Value history cannot be written for relationship attributes, formula attributes, enriched attributes, or immutable system attributes such as the entry's parent record.
|
|
1922
|
+
*
|
|
1923
|
+
* This endpoint is in beta. We will aim to avoid breaking changes, but small updates may be made as we roll out to more users.
|
|
1924
|
+
*
|
|
1925
|
+
* Required scopes: `list_entry:read-write`, `list_configuration:read`.
|
|
1926
|
+
*
|
|
1927
|
+
* Supported token levels: `workspace`, `user`.
|
|
1928
|
+
*/
|
|
1929
|
+
const putV2ListsByListEntriesByEntryIdAttributesByAttributeValues = (options) => (options.client ?? client).put({
|
|
1930
|
+
security: [{
|
|
1931
|
+
scheme: "bearer",
|
|
1932
|
+
type: "http"
|
|
1933
|
+
}],
|
|
1934
|
+
url: "/v2/lists/{list}/entries/{entry_id}/attributes/{attribute}/values",
|
|
1935
|
+
...options,
|
|
1936
|
+
headers: {
|
|
1937
|
+
"Content-Type": "application/json",
|
|
1938
|
+
...options.headers
|
|
1939
|
+
}
|
|
1940
|
+
});
|
|
1941
|
+
/**
|
|
1942
|
+
* List workspace members
|
|
1943
|
+
*
|
|
1944
|
+
* Lists all workspace members in the workspace.
|
|
1945
|
+
*
|
|
1946
|
+
* Required scopes: `user_management:read`.
|
|
1947
|
+
*
|
|
1948
|
+
* Supported token levels: `workspace`, `user`.
|
|
1949
|
+
*/
|
|
1950
|
+
const getV2WorkspaceMembers = (options) => (options?.client ?? client).get({
|
|
1951
|
+
security: [{
|
|
1952
|
+
scheme: "bearer",
|
|
1953
|
+
type: "http"
|
|
1954
|
+
}],
|
|
1955
|
+
url: "/v2/workspace_members",
|
|
1956
|
+
...options
|
|
1957
|
+
});
|
|
1958
|
+
/**
|
|
1959
|
+
* Get a workspace member
|
|
1960
|
+
*
|
|
1961
|
+
* Gets a single workspace member by ID.
|
|
1962
|
+
*
|
|
1963
|
+
* Required scopes: `user_management:read`.
|
|
1964
|
+
*
|
|
1965
|
+
* Supported token levels: `workspace`, `user`.
|
|
1966
|
+
*/
|
|
1967
|
+
const getV2WorkspaceMembersByWorkspaceMemberId = (options) => (options.client ?? client).get({
|
|
1968
|
+
security: [{
|
|
1969
|
+
scheme: "bearer",
|
|
1970
|
+
type: "http"
|
|
1971
|
+
}],
|
|
1972
|
+
url: "/v2/workspace_members/{workspace_member_id}",
|
|
1973
|
+
...options
|
|
1974
|
+
});
|
|
1975
|
+
/**
|
|
1976
|
+
* List notes
|
|
1977
|
+
*
|
|
1978
|
+
* List notes for all records or for a specific record.
|
|
1979
|
+
*
|
|
1980
|
+
* This endpoint is temporarily rate limited to 10 requests per second.
|
|
1981
|
+
*
|
|
1982
|
+
* Required scopes: `note:read`, `object_configuration:read`, `record_permission:read`.
|
|
1983
|
+
*
|
|
1984
|
+
* Supported token levels: `workspace`, `user`.
|
|
1985
|
+
*/
|
|
1986
|
+
const getV2Notes = (options) => (options?.client ?? client).get({
|
|
1987
|
+
security: [{
|
|
1988
|
+
scheme: "bearer",
|
|
1989
|
+
type: "http"
|
|
1990
|
+
}],
|
|
1991
|
+
url: "/v2/notes",
|
|
1992
|
+
...options
|
|
1993
|
+
});
|
|
1994
|
+
/**
|
|
1995
|
+
* Create a note
|
|
1996
|
+
*
|
|
1997
|
+
* Creates a new note for a given record.
|
|
1998
|
+
*
|
|
1999
|
+
* Required scopes: `note:read-write`, `object_configuration:read`, `record_permission:read`.
|
|
2000
|
+
*
|
|
2001
|
+
* Supported token levels: `workspace`, `user`.
|
|
2002
|
+
*/
|
|
2003
|
+
const postV2Notes = (options) => (options.client ?? client).post({
|
|
2004
|
+
security: [{
|
|
2005
|
+
scheme: "bearer",
|
|
2006
|
+
type: "http"
|
|
2007
|
+
}],
|
|
2008
|
+
url: "/v2/notes",
|
|
2009
|
+
...options,
|
|
2010
|
+
headers: {
|
|
2011
|
+
"Content-Type": "application/json",
|
|
2012
|
+
...options.headers
|
|
2013
|
+
}
|
|
2014
|
+
});
|
|
2015
|
+
/**
|
|
2016
|
+
* Delete a note
|
|
2017
|
+
*
|
|
2018
|
+
* Delete a single note by ID.
|
|
2019
|
+
*
|
|
2020
|
+
* Required scopes: `note:read-write`.
|
|
2021
|
+
*
|
|
2022
|
+
* Supported token levels: `workspace`, `user`.
|
|
2023
|
+
*/
|
|
2024
|
+
const deleteV2NotesByNoteId = (options) => (options.client ?? client).delete({
|
|
2025
|
+
security: [{
|
|
2026
|
+
scheme: "bearer",
|
|
2027
|
+
type: "http"
|
|
2028
|
+
}],
|
|
2029
|
+
url: "/v2/notes/{note_id}",
|
|
2030
|
+
...options
|
|
2031
|
+
});
|
|
2032
|
+
/**
|
|
2033
|
+
* Get a note
|
|
2034
|
+
*
|
|
2035
|
+
* Get a single note by ID.
|
|
2036
|
+
*
|
|
2037
|
+
* Required scopes: `note:read`, `object_configuration:read`, `record_permission:read`.
|
|
2038
|
+
*
|
|
2039
|
+
* Supported token levels: `workspace`, `user`.
|
|
2040
|
+
*/
|
|
2041
|
+
const getV2NotesByNoteId = (options) => (options.client ?? client).get({
|
|
2042
|
+
security: [{
|
|
2043
|
+
scheme: "bearer",
|
|
2044
|
+
type: "http"
|
|
2045
|
+
}],
|
|
2046
|
+
url: "/v2/notes/{note_id}",
|
|
2047
|
+
...options
|
|
2048
|
+
});
|
|
2049
|
+
/**
|
|
2050
|
+
* Update a note
|
|
2051
|
+
*
|
|
2052
|
+
* Updates an existing note's title and/or content. Only the fields you provide are changed, and any field you omit is left untouched. Providing `content` replaces the note's entire content. A note's parent record cannot be changed.
|
|
2053
|
+
*
|
|
2054
|
+
* Required scopes: `note:read-write`, `object_configuration:read`, `record_permission:read`.
|
|
2055
|
+
*
|
|
2056
|
+
* Supported token levels: `workspace`, `user`.
|
|
2057
|
+
*/
|
|
2058
|
+
const patchV2NotesByNoteId = (options) => (options.client ?? client).patch({
|
|
2059
|
+
security: [{
|
|
2060
|
+
scheme: "bearer",
|
|
2061
|
+
type: "http"
|
|
2062
|
+
}],
|
|
2063
|
+
url: "/v2/notes/{note_id}",
|
|
2064
|
+
...options,
|
|
2065
|
+
headers: {
|
|
2066
|
+
"Content-Type": "application/json",
|
|
2067
|
+
...options.headers
|
|
2068
|
+
}
|
|
2069
|
+
});
|
|
2070
|
+
/**
|
|
2071
|
+
* List tasks
|
|
2072
|
+
*
|
|
2073
|
+
* List all tasks. Results are sorted by creation date, from oldest to newest.
|
|
2074
|
+
*
|
|
2075
|
+
* Required scopes: `task:read`, `object_configuration:read`, `record_permission:read`, `user_management:read`.
|
|
2076
|
+
*
|
|
2077
|
+
* Supported token levels: `workspace`, `user`.
|
|
2078
|
+
*/
|
|
2079
|
+
const getV2Tasks = (options) => (options?.client ?? client).get({
|
|
2080
|
+
security: [{
|
|
2081
|
+
scheme: "bearer",
|
|
2082
|
+
type: "http"
|
|
2083
|
+
}],
|
|
2084
|
+
url: "/v2/tasks",
|
|
2085
|
+
...options
|
|
2086
|
+
});
|
|
2087
|
+
/**
|
|
2088
|
+
* Create a task
|
|
2089
|
+
*
|
|
2090
|
+
* Creates a new task.
|
|
2091
|
+
*
|
|
2092
|
+
* At present, tasks can only be created from plaintext without record reference formatting.
|
|
2093
|
+
*
|
|
2094
|
+
* Required scopes: `task:read-write`, `object_configuration:read`, `record_permission:read`, `user_management:read`.
|
|
2095
|
+
*
|
|
2096
|
+
* Supported token levels: `workspace`, `user`.
|
|
2097
|
+
*/
|
|
2098
|
+
const postV2Tasks = (options) => (options.client ?? client).post({
|
|
2099
|
+
security: [{
|
|
2100
|
+
scheme: "bearer",
|
|
2101
|
+
type: "http"
|
|
2102
|
+
}],
|
|
2103
|
+
url: "/v2/tasks",
|
|
2104
|
+
...options,
|
|
2105
|
+
headers: {
|
|
2106
|
+
"Content-Type": "application/json",
|
|
2107
|
+
...options.headers
|
|
2108
|
+
}
|
|
2109
|
+
});
|
|
2110
|
+
/**
|
|
2111
|
+
* Delete a task
|
|
2112
|
+
*
|
|
2113
|
+
* Delete a task by ID.
|
|
2114
|
+
*
|
|
2115
|
+
* Required scopes: `task:read-write`.
|
|
2116
|
+
*
|
|
2117
|
+
* Supported token levels: `workspace`, `user`.
|
|
2118
|
+
*/
|
|
2119
|
+
const deleteV2TasksByTaskId = (options) => (options.client ?? client).delete({
|
|
2120
|
+
security: [{
|
|
2121
|
+
scheme: "bearer",
|
|
2122
|
+
type: "http"
|
|
2123
|
+
}],
|
|
2124
|
+
url: "/v2/tasks/{task_id}",
|
|
2125
|
+
...options
|
|
2126
|
+
});
|
|
2127
|
+
/**
|
|
2128
|
+
* Get a task
|
|
2129
|
+
*
|
|
2130
|
+
* Get a single task by ID.
|
|
2131
|
+
*
|
|
2132
|
+
* Required scopes: `task:read`, `object_configuration:read`, `record_permission:read`, `user_management:read`.
|
|
2133
|
+
*
|
|
2134
|
+
* Supported token levels: `workspace`, `user`.
|
|
2135
|
+
*/
|
|
2136
|
+
const getV2TasksByTaskId = (options) => (options.client ?? client).get({
|
|
2137
|
+
security: [{
|
|
2138
|
+
scheme: "bearer",
|
|
2139
|
+
type: "http"
|
|
2140
|
+
}],
|
|
2141
|
+
url: "/v2/tasks/{task_id}",
|
|
2142
|
+
...options
|
|
2143
|
+
});
|
|
2144
|
+
/**
|
|
2145
|
+
* Update a task
|
|
2146
|
+
*
|
|
2147
|
+
* Updates an existing task by `task_id`. At present, only the `deadline_at`, `is_completed`, `linked_records`, and `assignees` fields can be updated.
|
|
2148
|
+
*
|
|
2149
|
+
* Required scopes: `task:read-write`, `object_configuration:read`, `record_permission:read`, `user_management:read`.
|
|
2150
|
+
*
|
|
2151
|
+
* Supported token levels: `workspace`, `user`.
|
|
2152
|
+
*/
|
|
2153
|
+
const patchV2TasksByTaskId = (options) => (options.client ?? client).patch({
|
|
2154
|
+
security: [{
|
|
2155
|
+
scheme: "bearer",
|
|
2156
|
+
type: "http"
|
|
2157
|
+
}],
|
|
2158
|
+
url: "/v2/tasks/{task_id}",
|
|
2159
|
+
...options,
|
|
2160
|
+
headers: {
|
|
2161
|
+
"Content-Type": "application/json",
|
|
2162
|
+
...options.headers
|
|
2163
|
+
}
|
|
2164
|
+
});
|
|
2165
|
+
/**
|
|
2166
|
+
* List threads
|
|
2167
|
+
*
|
|
2168
|
+
* List threads of comments on a record or list entry.
|
|
2169
|
+
*
|
|
2170
|
+
* Each thread in the response includes at most `80` replies, starting with the oldest. When a thread holds more, its `has_more_comments` is `true`; use [Get a thread and its comments](/rest-api/endpoint-reference/threads/get-a-thread-and-its-comments) to page through every comment in that thread.
|
|
2171
|
+
*
|
|
2172
|
+
* To view threads on records, you will need the `object_configuration:read` and `record_permission:read` scopes.
|
|
2173
|
+
*
|
|
2174
|
+
* To view threads on list entries, you will need the `list_configuration:read` and `list_entry:read` scopes.
|
|
2175
|
+
*
|
|
2176
|
+
* Required scopes: `comment:read`.
|
|
2177
|
+
*
|
|
2178
|
+
* Supported token levels: `workspace`, `user`.
|
|
2179
|
+
*/
|
|
2180
|
+
const getV2Threads = (options) => (options?.client ?? client).get({
|
|
2181
|
+
security: [{
|
|
2182
|
+
scheme: "bearer",
|
|
2183
|
+
type: "http"
|
|
2184
|
+
}],
|
|
2185
|
+
url: "/v2/threads",
|
|
2186
|
+
...options
|
|
2187
|
+
});
|
|
2188
|
+
/**
|
|
2189
|
+
* Get a thread and its comments
|
|
2190
|
+
*
|
|
2191
|
+
* Get a thread and page through its comments, oldest first, starting with the comment that opened it.
|
|
2192
|
+
*
|
|
2193
|
+
* Comments are paginated: at most `250` are returned per request. Keep paginating for as long as a `next_cursor` is returned.
|
|
2194
|
+
*
|
|
2195
|
+
* Supply `created_after` to return only the comments created after a timestamp, which is useful when polling a thread for new replies. The comment that opened the thread is returned only when it also satisfies the filter.
|
|
2196
|
+
*
|
|
2197
|
+
* To view threads on records, you will need the `object_configuration:read` and `record_permission:read` scopes.
|
|
2198
|
+
*
|
|
2199
|
+
* To view threads on list entries, you will need the `list_configuration:read` and `list_entry:read` scopes.
|
|
2200
|
+
*
|
|
2201
|
+
* Required scopes: `comment:read`.
|
|
2202
|
+
*
|
|
2203
|
+
* Supported token levels: `workspace`, `user`.
|
|
2204
|
+
*/
|
|
2205
|
+
const getV2ThreadsByThreadId = (options) => (options.client ?? client).get({
|
|
2206
|
+
security: [{
|
|
2207
|
+
scheme: "bearer",
|
|
2208
|
+
type: "http"
|
|
2209
|
+
}],
|
|
2210
|
+
url: "/v2/threads/{thread_id}",
|
|
2211
|
+
...options
|
|
2212
|
+
});
|
|
2213
|
+
/**
|
|
2214
|
+
* Create a comment
|
|
2215
|
+
*
|
|
2216
|
+
* Creates a new comment related to an existing thread, record or entry.
|
|
2217
|
+
*
|
|
2218
|
+
* To create comments on records, you will need the `object_configuration:read` and `record_permission:read` scopes.
|
|
2219
|
+
*
|
|
2220
|
+
* To create comments on list entries, you will need the `list_configuration:read` and `list_entry:read` scopes.
|
|
2221
|
+
*
|
|
2222
|
+
* Required scopes: `comment:read-write`.
|
|
2223
|
+
*
|
|
2224
|
+
* Supported token levels: `workspace`, `user`.
|
|
2225
|
+
*/
|
|
2226
|
+
const postV2Comments = (options) => (options.client ?? client).post({
|
|
2227
|
+
security: [{
|
|
2228
|
+
scheme: "bearer",
|
|
2229
|
+
type: "http"
|
|
2230
|
+
}],
|
|
2231
|
+
url: "/v2/comments",
|
|
2232
|
+
...options,
|
|
2233
|
+
headers: {
|
|
2234
|
+
"Content-Type": "application/json",
|
|
2235
|
+
...options.headers
|
|
2236
|
+
}
|
|
2237
|
+
});
|
|
2238
|
+
/**
|
|
2239
|
+
* Delete a comment
|
|
2240
|
+
*
|
|
2241
|
+
* Deletes a comment by ID. If deleting a comment at the head of a thread, all messages in the thread are also deleted.
|
|
2242
|
+
*
|
|
2243
|
+
* A workspace-level access token may delete any comment. A user-level access token may only delete comments authored by the member it acts for.
|
|
2244
|
+
*
|
|
2245
|
+
* Required scopes: `comment:read-write`.
|
|
2246
|
+
*
|
|
2247
|
+
* Supported token levels: `workspace`, `user`.
|
|
2248
|
+
*/
|
|
2249
|
+
const deleteV2CommentsByCommentId = (options) => (options.client ?? client).delete({
|
|
2250
|
+
security: [{
|
|
2251
|
+
scheme: "bearer",
|
|
2252
|
+
type: "http"
|
|
2253
|
+
}],
|
|
2254
|
+
url: "/v2/comments/{comment_id}",
|
|
2255
|
+
...options
|
|
2256
|
+
});
|
|
2257
|
+
/**
|
|
2258
|
+
* Get a comment
|
|
2259
|
+
*
|
|
2260
|
+
* Get a single comment by ID.
|
|
2261
|
+
*
|
|
2262
|
+
* To view comments on records, you will need the `object_configuration:read` and `record_permission:read` scopes.
|
|
2263
|
+
*
|
|
2264
|
+
* To view comments on list entries, you will need the `list_configuration:read` and `list_entry:read` scopes.
|
|
2265
|
+
*
|
|
2266
|
+
* Required scopes: `comment:read`.
|
|
2267
|
+
*
|
|
2268
|
+
* Supported token levels: `workspace`, `user`.
|
|
2269
|
+
*/
|
|
2270
|
+
const getV2CommentsByCommentId = (options) => (options.client ?? client).get({
|
|
2271
|
+
security: [{
|
|
2272
|
+
scheme: "bearer",
|
|
2273
|
+
type: "http"
|
|
2274
|
+
}],
|
|
2275
|
+
url: "/v2/comments/{comment_id}",
|
|
2276
|
+
...options
|
|
2277
|
+
});
|
|
2278
|
+
/**
|
|
2279
|
+
* List emails
|
|
2280
|
+
*
|
|
2281
|
+
* Lists email metadata from your workspace's connected mailboxes. Email content is never returned.
|
|
2282
|
+
*
|
|
2283
|
+
* At least one of `linked_object` with `linked_record_ids`, `participants`, or `domain` must be supplied; there is no way to list every email. When several are supplied they are combined with OR: emails matching any of the filters are returned.
|
|
2284
|
+
*
|
|
2285
|
+
* > **Requesting access:** this endpoint is enabled per workspace and per app while it is in alpha. Contact [support@attio.com](mailto:support@attio.com) to request access.
|
|
2286
|
+
*
|
|
2287
|
+
* **Things to know**
|
|
2288
|
+
*
|
|
2289
|
+
* - Filters that identify your own workspace are ignored. This covers a member's or invited member's address, one of your mailboxes, and any of their domains. If every filter you supply is ignored, an empty page is returned.
|
|
2290
|
+
* - A filter that names a protected recipient in your workspace is rejected rather than ignored. This covers an address or a domain you supply directly. A record whose address or domain is a protected recipient is ignored instead, in the same way as the filters above.
|
|
2291
|
+
* - Emails from a mailbox shared with your workspace as metadata only are returned without a subject line. An email is left out entirely when it has no participant you may see — that is, when every participant outside your workspace is a protected recipient.
|
|
2292
|
+
* - An email that reached more than one of your mailboxes is returned once, and `id.mailbox_id` identifies whichever copy was readable.
|
|
2293
|
+
* - `linked_records` is derived when you make the request rather than stored, so it reflects your records as they are now.
|
|
2294
|
+
* - Emails are returned newest first, ordered by when they were sent. Each request scans a bounded number of emails, so a page can hold fewer emails than `limit`, or none at all, while more are still available. Keep paginating for as long as a `next_cursor` is returned, rather than stopping on a short page.
|
|
2295
|
+
*
|
|
2296
|
+
* This endpoint is in alpha and may be subject to breaking changes as we gather feedback.
|
|
2297
|
+
*
|
|
2298
|
+
* Required scopes: `email:read`, `record_permission:read`, `object_configuration:read`.
|
|
2299
|
+
*
|
|
2300
|
+
* Supported token levels: `workspace`.
|
|
2301
|
+
*/
|
|
2302
|
+
const getV2Emails = (options) => (options?.client ?? client).get({
|
|
2303
|
+
security: [{
|
|
2304
|
+
scheme: "bearer",
|
|
2305
|
+
type: "http"
|
|
2306
|
+
}],
|
|
2307
|
+
url: "/v2/emails",
|
|
2308
|
+
...options
|
|
2309
|
+
});
|
|
2310
|
+
/**
|
|
2311
|
+
* Add emails to the unsubscribe list
|
|
2312
|
+
*
|
|
2313
|
+
* Adds email addresses to the workspace's sequence unsubscribe list. Email addresses on the unsubscribe list cannot be enrolled in any sequence, and any of their active sequence runs are exited. Email addresses that are already on the unsubscribe list are ignored, so this endpoint is safe to retry.
|
|
2314
|
+
*
|
|
2315
|
+
* This endpoint is in beta. We will aim to avoid breaking changes, but small updates may be made as we roll out to more users.
|
|
2316
|
+
*
|
|
2317
|
+
* Required scopes: `sequence_unsubscribe:read-write`.
|
|
2318
|
+
*
|
|
2319
|
+
* Supported token levels: `workspace`, `user`.
|
|
2320
|
+
*/
|
|
2321
|
+
const postV2SequencesUnsubscribedEmails = (options) => (options.client ?? client).post({
|
|
2322
|
+
security: [{
|
|
2323
|
+
scheme: "bearer",
|
|
2324
|
+
type: "http"
|
|
2325
|
+
}],
|
|
2326
|
+
url: "/v2/sequences/unsubscribed_emails",
|
|
2327
|
+
...options,
|
|
2328
|
+
headers: {
|
|
2329
|
+
"Content-Type": "application/json",
|
|
2330
|
+
...options.headers
|
|
2331
|
+
}
|
|
2332
|
+
});
|
|
2333
|
+
/**
|
|
2334
|
+
* List meetings
|
|
2335
|
+
*
|
|
2336
|
+
* Lists all meetings in the workspace using a deterministic sort order. When both the `participants` and `linked_record_id` filters are supplied, they are combined with OR: meetings that match either filter are returned.
|
|
2337
|
+
*
|
|
2338
|
+
* This endpoint is in beta. We will aim to avoid breaking changes, but small updates may be made as we roll out to more users.
|
|
2339
|
+
*
|
|
2340
|
+
* Required scopes: `meeting:read`, `record_permission:read`.
|
|
2341
|
+
*
|
|
2342
|
+
* Supported token levels: `workspace`.
|
|
2343
|
+
*/
|
|
2344
|
+
const getV2Meetings = (options) => (options?.client ?? client).get({
|
|
2345
|
+
security: [{
|
|
2346
|
+
scheme: "bearer",
|
|
2347
|
+
type: "http"
|
|
2348
|
+
}],
|
|
2349
|
+
url: "/v2/meetings",
|
|
2350
|
+
...options
|
|
2351
|
+
});
|
|
2352
|
+
/**
|
|
2353
|
+
* Create a meeting
|
|
2354
|
+
*
|
|
2355
|
+
* Creates a new meeting. [See here](/rest-api/guides/syncing-meetings) for guidance on avoiding duplicate meetings.
|
|
2356
|
+
*
|
|
2357
|
+
* This endpoint is in beta. We will aim to avoid breaking changes, but small updates may be made as we roll out to more users.
|
|
2358
|
+
*
|
|
2359
|
+
* Required scopes: `meeting:read-write`, `record_permission:read`.
|
|
2360
|
+
*
|
|
2361
|
+
* Supported token levels: `workspace`, `user`.
|
|
2362
|
+
*/
|
|
2363
|
+
const postV2Meetings = (options) => (options.client ?? client).post({
|
|
2364
|
+
security: [{
|
|
2365
|
+
scheme: "bearer",
|
|
2366
|
+
type: "http"
|
|
2367
|
+
}],
|
|
2368
|
+
url: "/v2/meetings",
|
|
2369
|
+
...options,
|
|
2370
|
+
headers: {
|
|
2371
|
+
"Content-Type": "application/json",
|
|
2372
|
+
...options.headers
|
|
2373
|
+
}
|
|
2374
|
+
});
|
|
2375
|
+
/**
|
|
2376
|
+
* Delete a meeting
|
|
2377
|
+
*
|
|
2378
|
+
* Deletes a single meeting by ID.
|
|
2379
|
+
*
|
|
2380
|
+
* Meetings created by calendar sync cannot be deleted through the API. Delete the underlying calendar event, or disconnect the calendar, instead.
|
|
2381
|
+
*
|
|
2382
|
+
* This endpoint is in beta. We will aim to avoid breaking changes, but small updates may be made as we roll out to more users.
|
|
2383
|
+
*
|
|
2384
|
+
* Required scopes: `meeting:read-write`.
|
|
2385
|
+
*
|
|
2386
|
+
* Supported token levels: `workspace`, `user`.
|
|
2387
|
+
*/
|
|
2388
|
+
const deleteV2MeetingsByMeetingId = (options) => (options.client ?? client).delete({
|
|
2389
|
+
security: [{
|
|
2390
|
+
scheme: "bearer",
|
|
2391
|
+
type: "http"
|
|
2392
|
+
}],
|
|
2393
|
+
url: "/v2/meetings/{meeting_id}",
|
|
2394
|
+
...options
|
|
2395
|
+
});
|
|
2396
|
+
/**
|
|
2397
|
+
* Get a meeting
|
|
2398
|
+
*
|
|
2399
|
+
* Get a single meeting by ID.
|
|
2400
|
+
*
|
|
2401
|
+
* This endpoint is in beta. We will aim to avoid breaking changes, but small updates may be made as we roll out to more users.
|
|
2402
|
+
*
|
|
2403
|
+
* Required scopes: `meeting:read`, `record_permission:read`.
|
|
2404
|
+
*
|
|
2405
|
+
* Supported token levels: `workspace`, `user`.
|
|
2406
|
+
*/
|
|
2407
|
+
const getV2MeetingsByMeetingId = (options) => (options.client ?? client).get({
|
|
2408
|
+
security: [{
|
|
2409
|
+
scheme: "bearer",
|
|
2410
|
+
type: "http"
|
|
2411
|
+
}],
|
|
2412
|
+
url: "/v2/meetings/{meeting_id}",
|
|
2413
|
+
...options
|
|
2414
|
+
});
|
|
2415
|
+
/**
|
|
2416
|
+
* Update a meeting (append linked records)
|
|
2417
|
+
*
|
|
2418
|
+
* Links records to a meeting. The records supplied are added to the meeting's existing linked records, and records which are already linked are ignored. Use the `PUT` endpoint to replace or remove linked records.
|
|
2419
|
+
*
|
|
2420
|
+
* No other meeting fields can be updated. Attio automatically links the meeting participants' companies to the meeting; this behavior is asynchronous.
|
|
2421
|
+
*
|
|
2422
|
+
* This endpoint is in beta. We will aim to avoid breaking changes, but small updates may be made as we roll out to more users.
|
|
2423
|
+
*
|
|
2424
|
+
* Required scopes: `meeting:read-write`, `record_permission:read`.
|
|
2425
|
+
*
|
|
2426
|
+
* Supported token levels: `workspace`, `user`.
|
|
2427
|
+
*/
|
|
2428
|
+
const patchV2MeetingsByMeetingId = (options) => (options.client ?? client).patch({
|
|
2429
|
+
security: [{
|
|
2430
|
+
scheme: "bearer",
|
|
2431
|
+
type: "http"
|
|
2432
|
+
}],
|
|
2433
|
+
url: "/v2/meetings/{meeting_id}",
|
|
2434
|
+
...options,
|
|
2435
|
+
headers: {
|
|
2436
|
+
"Content-Type": "application/json",
|
|
2437
|
+
...options.headers
|
|
2438
|
+
}
|
|
2439
|
+
});
|
|
2440
|
+
/**
|
|
2441
|
+
* Update a meeting (overwrite linked records)
|
|
2442
|
+
*
|
|
2443
|
+
* Replaces a meeting's linked records with the records supplied. Any record which is currently linked and is not in the request is unlinked, including records which Attio linked automatically from the meeting's participants. Passing an empty array unlinks every record. Use the `PATCH` endpoint to add linked records without removing the records which already exist.
|
|
2444
|
+
*
|
|
2445
|
+
* No other meeting fields can be updated. Attio automatically links the meeting participants' companies to the meeting; this behavior is asynchronous, so a company which is linked after this request completes is not removed by it.
|
|
2446
|
+
*
|
|
2447
|
+
* This endpoint is in beta. We will aim to avoid breaking changes, but small updates may be made as we roll out to more users.
|
|
2448
|
+
*
|
|
2449
|
+
* Required scopes: `meeting:read-write`, `record_permission:read`.
|
|
2450
|
+
*
|
|
2451
|
+
* Supported token levels: `workspace`, `user`.
|
|
2452
|
+
*/
|
|
2453
|
+
const putV2MeetingsByMeetingId = (options) => (options.client ?? client).put({
|
|
2454
|
+
security: [{
|
|
2455
|
+
scheme: "bearer",
|
|
2456
|
+
type: "http"
|
|
2457
|
+
}],
|
|
2458
|
+
url: "/v2/meetings/{meeting_id}",
|
|
2459
|
+
...options,
|
|
2460
|
+
headers: {
|
|
2461
|
+
"Content-Type": "application/json",
|
|
2462
|
+
...options.headers
|
|
2463
|
+
}
|
|
2464
|
+
});
|
|
2465
|
+
/**
|
|
2466
|
+
* List call recordings
|
|
2467
|
+
*
|
|
2468
|
+
* List all call recordings for a meeting.
|
|
2469
|
+
*
|
|
2470
|
+
* This endpoint is in beta. We will aim to avoid breaking changes, but small updates may be made as we roll out to more users.
|
|
2471
|
+
*
|
|
2472
|
+
* Required scopes: `meeting:read`, `call_recording:read`.
|
|
2473
|
+
*
|
|
2474
|
+
* Supported token levels: `workspace`, `user`.
|
|
2475
|
+
*/
|
|
2476
|
+
const getV2MeetingsByMeetingIdCallRecordings = (options) => (options.client ?? client).get({
|
|
2477
|
+
security: [{
|
|
2478
|
+
scheme: "bearer",
|
|
2479
|
+
type: "http"
|
|
2480
|
+
}],
|
|
2481
|
+
url: "/v2/meetings/{meeting_id}/call_recordings",
|
|
2482
|
+
...options
|
|
2483
|
+
});
|
|
2484
|
+
/**
|
|
2485
|
+
* Create call recording
|
|
2486
|
+
*
|
|
2487
|
+
* Create a call recording for a meeting. This endpoint is rate limited to 1 request per second.
|
|
2488
|
+
*
|
|
2489
|
+
* A `transcript` should always be provided — it is technically optional for backwards compatibility, but a call recording created without one will be missing summaries and other transcript-derived features. `video_url` is optional, and a transcript-only call recording (with no video) is fully supported.
|
|
2490
|
+
*
|
|
2491
|
+
* This endpoint is in beta. We will aim to avoid breaking changes, but small updates may be made as we roll out to more users.
|
|
2492
|
+
*
|
|
2493
|
+
* Required scopes: `meeting:read`, `call_recording:read-write`.
|
|
2494
|
+
*
|
|
2495
|
+
* Supported token levels: `workspace`, `user`.
|
|
2496
|
+
*/
|
|
2497
|
+
const postV2MeetingsByMeetingIdCallRecordings = (options) => (options.client ?? client).post({
|
|
2498
|
+
security: [{
|
|
2499
|
+
scheme: "bearer",
|
|
2500
|
+
type: "http"
|
|
2501
|
+
}],
|
|
2502
|
+
url: "/v2/meetings/{meeting_id}/call_recordings",
|
|
2503
|
+
...options,
|
|
2504
|
+
headers: {
|
|
2505
|
+
"Content-Type": "application/json",
|
|
2506
|
+
...options.headers
|
|
2507
|
+
}
|
|
2508
|
+
});
|
|
2509
|
+
/**
|
|
2510
|
+
* Delete call recording
|
|
2511
|
+
*
|
|
2512
|
+
* Deletes the specified call recording. This will remove the call recording and all associated data.
|
|
2513
|
+
*
|
|
2514
|
+
* This endpoint is in beta. We will aim to avoid breaking changes, but small updates may be made as we roll out to more users.
|
|
2515
|
+
*
|
|
2516
|
+
* Required scopes: `meeting:read`, `call_recording:read-write`.
|
|
2517
|
+
*
|
|
2518
|
+
* Supported token levels: `workspace`, `user`.
|
|
2519
|
+
*/
|
|
2520
|
+
const deleteV2MeetingsByMeetingIdCallRecordingsByCallRecordingId = (options) => (options.client ?? client).delete({
|
|
2521
|
+
security: [{
|
|
2522
|
+
scheme: "bearer",
|
|
2523
|
+
type: "http"
|
|
2524
|
+
}],
|
|
2525
|
+
url: "/v2/meetings/{meeting_id}/call_recordings/{call_recording_id}",
|
|
2526
|
+
...options
|
|
2527
|
+
});
|
|
2528
|
+
/**
|
|
2529
|
+
* Get call recording
|
|
2530
|
+
*
|
|
2531
|
+
* Get a single call recording by ID.
|
|
2532
|
+
*
|
|
2533
|
+
* This endpoint is in beta. We will aim to avoid breaking changes, but small updates may be made as we roll out to more users.
|
|
2534
|
+
*
|
|
2535
|
+
* Required scopes: `meeting:read`, `call_recording:read`.
|
|
2536
|
+
*
|
|
2537
|
+
* Supported token levels: `workspace`, `user`.
|
|
2538
|
+
*/
|
|
2539
|
+
const getV2MeetingsByMeetingIdCallRecordingsByCallRecordingId = (options) => (options.client ?? client).get({
|
|
2540
|
+
security: [{
|
|
2541
|
+
scheme: "bearer",
|
|
2542
|
+
type: "http"
|
|
2543
|
+
}],
|
|
2544
|
+
url: "/v2/meetings/{meeting_id}/call_recordings/{call_recording_id}",
|
|
2545
|
+
...options
|
|
2546
|
+
});
|
|
2547
|
+
/**
|
|
2548
|
+
* Deprecated: Get call transcript
|
|
2549
|
+
*
|
|
2550
|
+
* Deprecated: prefer using `GET /v2/meetings/:meeting_id/call_recordings/:call_recording_id` to get the transcript for a call recording.
|
|
2551
|
+
*
|
|
2552
|
+
* This endpoint is in beta. We will aim to avoid breaking changes, but small updates may be made as we roll out to more users.
|
|
2553
|
+
*
|
|
2554
|
+
* Required scopes: `meeting:read`, `call_recording:read`.
|
|
2555
|
+
*
|
|
2556
|
+
* Supported token levels: `workspace`.
|
|
2557
|
+
*/
|
|
2558
|
+
const getV2MeetingsByMeetingIdCallRecordingsByCallRecordingIdTranscript = (options) => (options.client ?? client).get({
|
|
2559
|
+
security: [{
|
|
2560
|
+
scheme: "bearer",
|
|
2561
|
+
type: "http"
|
|
2562
|
+
}],
|
|
2563
|
+
url: "/v2/meetings/{meeting_id}/call_recordings/{call_recording_id}/transcript",
|
|
2564
|
+
...options
|
|
2565
|
+
});
|
|
2566
|
+
/**
|
|
2567
|
+
* List files
|
|
2568
|
+
*
|
|
2569
|
+
* Lists internal files, externally connected files and folders for a specific record. Use the `object` and `record_id` query parameters to specify the record. Optional query parameters may be provided to filter results by storage provider or parent folder.
|
|
2570
|
+
*
|
|
2571
|
+
* This endpoint is in beta. We will aim to avoid breaking changes, but small updates may be made as we roll out to more users.
|
|
2572
|
+
*
|
|
2573
|
+
* Required scopes: `object_configuration:read`, `record_permission:read`, `file:read`.
|
|
2574
|
+
*
|
|
2575
|
+
* Supported token levels: `workspace`, `user`.
|
|
2576
|
+
*/
|
|
2577
|
+
const getV2Files = (options) => (options.client ?? client).get({
|
|
2578
|
+
security: [{
|
|
2579
|
+
scheme: "bearer",
|
|
2580
|
+
type: "http"
|
|
2581
|
+
}],
|
|
2582
|
+
url: "/v2/files",
|
|
2583
|
+
...options
|
|
2584
|
+
});
|
|
2585
|
+
/**
|
|
2586
|
+
* Create a folder
|
|
2587
|
+
*
|
|
2588
|
+
* Creates a native folder entry or a connected file/folder entry on an object record.
|
|
2589
|
+
*
|
|
2590
|
+
* This endpoint is in beta. We will aim to avoid breaking changes, but small updates may be made as we roll out to more users.
|
|
2591
|
+
*
|
|
2592
|
+
* Required scopes: `file:read-write`, `object_configuration:read`, `record_permission:read`.
|
|
2593
|
+
*
|
|
2594
|
+
* Supported token levels: `workspace`, `user`.
|
|
2595
|
+
*/
|
|
2596
|
+
const postV2Files = (options) => (options.client ?? client).post({
|
|
2597
|
+
security: [{
|
|
2598
|
+
scheme: "bearer",
|
|
2599
|
+
type: "http"
|
|
2600
|
+
}],
|
|
2601
|
+
url: "/v2/files",
|
|
2602
|
+
...options,
|
|
2603
|
+
headers: {
|
|
2604
|
+
"Content-Type": "application/json",
|
|
2605
|
+
...options.headers
|
|
2606
|
+
}
|
|
2607
|
+
});
|
|
2608
|
+
/**
|
|
2609
|
+
* Delete a file
|
|
2610
|
+
*
|
|
2611
|
+
* Delete a single file by ID. Deleting a folder will delete all of its descendants.
|
|
2612
|
+
*
|
|
2613
|
+
* This endpoint is in beta. We will aim to avoid breaking changes, but small updates may be made as we roll out to more users.
|
|
2614
|
+
*
|
|
2615
|
+
* Required scopes: `file:read-write`, `object_configuration:read`, `record_permission:read`.
|
|
2616
|
+
*
|
|
2617
|
+
* Supported token levels: `workspace`, `user`.
|
|
2618
|
+
*/
|
|
2619
|
+
const deleteV2FilesByFileId = (options) => (options.client ?? client).delete({
|
|
2620
|
+
security: [{
|
|
2621
|
+
scheme: "bearer",
|
|
2622
|
+
type: "http"
|
|
2623
|
+
}],
|
|
2624
|
+
url: "/v2/files/{file_id}",
|
|
2625
|
+
...options
|
|
2626
|
+
});
|
|
2627
|
+
/**
|
|
2628
|
+
* Get a file
|
|
2629
|
+
*
|
|
2630
|
+
* Get a single file entry by ID.
|
|
2631
|
+
*
|
|
2632
|
+
* This endpoint is in beta. We will aim to avoid breaking changes, but small updates may be made as we roll out to more users.
|
|
2633
|
+
*
|
|
2634
|
+
* Required scopes: `file:read`, `object_configuration:read`, `record_permission:read`.
|
|
2635
|
+
*
|
|
2636
|
+
* Supported token levels: `workspace`, `user`.
|
|
2637
|
+
*/
|
|
2638
|
+
const getV2FilesByFileId = (options) => (options.client ?? client).get({
|
|
2639
|
+
security: [{
|
|
2640
|
+
scheme: "bearer",
|
|
2641
|
+
type: "http"
|
|
2642
|
+
}],
|
|
2643
|
+
url: "/v2/files/{file_id}",
|
|
2644
|
+
...options
|
|
2645
|
+
});
|
|
2646
|
+
/**
|
|
2647
|
+
* List webhooks
|
|
2648
|
+
*
|
|
2649
|
+
* Get all of the webhooks in your workspace.
|
|
2650
|
+
*
|
|
2651
|
+
* Required scopes: `webhook:read`.
|
|
2652
|
+
*
|
|
2653
|
+
* Supported token levels: `workspace`.
|
|
2654
|
+
*/
|
|
2655
|
+
const getV2Webhooks = (options) => (options?.client ?? client).get({
|
|
2656
|
+
security: [{
|
|
2657
|
+
scheme: "bearer",
|
|
2658
|
+
type: "http"
|
|
2659
|
+
}],
|
|
2660
|
+
url: "/v2/webhooks",
|
|
2661
|
+
...options
|
|
2662
|
+
});
|
|
2663
|
+
/**
|
|
2664
|
+
* Create a webhook
|
|
2665
|
+
*
|
|
2666
|
+
* Create a webhook and associated subscriptions.
|
|
2667
|
+
*
|
|
2668
|
+
* Each combination of target URL, event type and filter must be unique within your workspace; duplicates are rejected with a 409.
|
|
2669
|
+
*
|
|
2670
|
+
* Required scopes: `webhook:read-write`.
|
|
2671
|
+
*
|
|
2672
|
+
* Supported token levels: `workspace`.
|
|
2673
|
+
*/
|
|
2674
|
+
const postV2Webhooks = (options) => (options.client ?? client).post({
|
|
2675
|
+
security: [{
|
|
2676
|
+
scheme: "bearer",
|
|
2677
|
+
type: "http"
|
|
2678
|
+
}],
|
|
2679
|
+
url: "/v2/webhooks",
|
|
2680
|
+
...options,
|
|
2681
|
+
headers: {
|
|
2682
|
+
"Content-Type": "application/json",
|
|
2683
|
+
...options.headers
|
|
2684
|
+
}
|
|
2685
|
+
});
|
|
2686
|
+
/**
|
|
2687
|
+
* Delete a webhook
|
|
2688
|
+
*
|
|
2689
|
+
* Delete a webhook by ID.
|
|
2690
|
+
*
|
|
2691
|
+
* Required scopes: `webhook:read-write`.
|
|
2692
|
+
*
|
|
2693
|
+
* Supported token levels: `workspace`.
|
|
2694
|
+
*/
|
|
2695
|
+
const deleteV2WebhooksByWebhookId = (options) => (options.client ?? client).delete({
|
|
2696
|
+
security: [{
|
|
2697
|
+
scheme: "bearer",
|
|
2698
|
+
type: "http"
|
|
2699
|
+
}],
|
|
2700
|
+
url: "/v2/webhooks/{webhook_id}",
|
|
2701
|
+
...options
|
|
2702
|
+
});
|
|
2703
|
+
/**
|
|
2704
|
+
* Get a webhook
|
|
2705
|
+
*
|
|
2706
|
+
* Get a single webhook.
|
|
2707
|
+
*
|
|
2708
|
+
* Required scopes: `webhook:read`.
|
|
2709
|
+
*
|
|
2710
|
+
* Supported token levels: `workspace`.
|
|
2711
|
+
*/
|
|
2712
|
+
const getV2WebhooksByWebhookId = (options) => (options.client ?? client).get({
|
|
2713
|
+
security: [{
|
|
2714
|
+
scheme: "bearer",
|
|
2715
|
+
type: "http"
|
|
2716
|
+
}],
|
|
2717
|
+
url: "/v2/webhooks/{webhook_id}",
|
|
2718
|
+
...options
|
|
2719
|
+
});
|
|
2720
|
+
/**
|
|
2721
|
+
* Update a webhook
|
|
2722
|
+
*
|
|
2723
|
+
* Update a webhook and associated subscriptions.
|
|
2724
|
+
*
|
|
2725
|
+
* Each combination of target URL, event type and filter must be unique within your workspace; duplicates are rejected with a 409. Changing the target URL re-checks the webhook's existing subscriptions against the new URL.
|
|
2726
|
+
*
|
|
2727
|
+
* Required scopes: `webhook:read-write`.
|
|
2728
|
+
*
|
|
2729
|
+
* Supported token levels: `workspace`.
|
|
2730
|
+
*/
|
|
2731
|
+
const patchV2WebhooksByWebhookId = (options) => (options.client ?? client).patch({
|
|
2732
|
+
security: [{
|
|
2733
|
+
scheme: "bearer",
|
|
2734
|
+
type: "http"
|
|
2735
|
+
}],
|
|
2736
|
+
url: "/v2/webhooks/{webhook_id}",
|
|
2737
|
+
...options,
|
|
2738
|
+
headers: {
|
|
2739
|
+
"Content-Type": "application/json",
|
|
2740
|
+
...options.headers
|
|
2741
|
+
}
|
|
2742
|
+
});
|
|
2743
|
+
/**
|
|
2744
|
+
* Identify
|
|
2745
|
+
*
|
|
2746
|
+
* Identify the current access token, the workspace it is linked to, and any permissions it has.
|
|
2747
|
+
*
|
|
2748
|
+
* Every kind of Attio access token can be introspected:
|
|
2749
|
+
*
|
|
2750
|
+
* - **Workspace access tokens**, created from a workspace's settings. These have no OAuth client, so `client_id` and `aud` contain the workspace access token's own ID.
|
|
2751
|
+
* - **OAuth access tokens**, granted to an app through the OAuth 2.0 authorization code flow. `client_id` and `aud` contain the app ID.
|
|
2752
|
+
* - **App access tokens**, issued to an app installation and exposed to that app's server functions as `ATTIO_API_TOKEN`. `client_id` and `aud` contain the app ID.
|
|
2753
|
+
*
|
|
2754
|
+
* Per [RFC 7662](https://www.rfc-editor.org/rfc/rfc7662), `active` is the only member guaranteed to be present. `exp` is always `null`, because Attio access tokens do not currently expire.
|
|
2755
|
+
* All other members are optional, and are omitted rather than returned as `null` when they are not present.
|
|
2756
|
+
*
|
|
2757
|
+
* Unknown, revoked, and deleted tokens are not treated as an error. They return `200` with `{"active": false}` and no other members.
|
|
2758
|
+
*/
|
|
2759
|
+
const getV2Self = (options) => (options?.client ?? client).get({
|
|
2760
|
+
security: [{
|
|
2761
|
+
scheme: "bearer",
|
|
2762
|
+
type: "http"
|
|
2763
|
+
}],
|
|
2764
|
+
url: "/v2/self",
|
|
2765
|
+
...options
|
|
2766
|
+
});
|
|
2767
|
+
//#endregion
|
|
2768
|
+
//#region src/types/attio/commands.gen.ts
|
|
2769
|
+
const groups = {
|
|
2770
|
+
objects: {
|
|
2771
|
+
commands: {
|
|
2772
|
+
"list-objects": operation({
|
|
2773
|
+
body: "none",
|
|
2774
|
+
call: getV2Objects,
|
|
2775
|
+
description: "List objects",
|
|
2776
|
+
options: []
|
|
2777
|
+
}),
|
|
2778
|
+
"create-an-object": operation({
|
|
2779
|
+
body: "required",
|
|
2780
|
+
call: postV2Objects,
|
|
2781
|
+
description: "Create an object",
|
|
2782
|
+
options: []
|
|
2783
|
+
}),
|
|
2784
|
+
"delete-an-object": operation({
|
|
2785
|
+
body: "none",
|
|
2786
|
+
call: deleteV2ObjectsByObject,
|
|
2787
|
+
description: "Delete an object",
|
|
2788
|
+
options: [{
|
|
2789
|
+
description: "A UUID or slug to identify the object.",
|
|
2790
|
+
in: "path",
|
|
2791
|
+
name: "object",
|
|
2792
|
+
required: true,
|
|
2793
|
+
type: "string"
|
|
2794
|
+
}]
|
|
2795
|
+
}),
|
|
2796
|
+
"get-an-object": operation({
|
|
2797
|
+
body: "none",
|
|
2798
|
+
call: getV2ObjectsByObject,
|
|
2799
|
+
description: "Get an object",
|
|
2800
|
+
options: [{
|
|
2801
|
+
description: "A UUID or slug to identify the object.",
|
|
2802
|
+
in: "path",
|
|
2803
|
+
name: "object",
|
|
2804
|
+
required: true,
|
|
2805
|
+
type: "string"
|
|
2806
|
+
}]
|
|
2807
|
+
}),
|
|
2808
|
+
"update-an-object": operation({
|
|
2809
|
+
body: "required",
|
|
2810
|
+
call: patchV2ObjectsByObject,
|
|
2811
|
+
description: "Update an object",
|
|
2812
|
+
options: [{
|
|
2813
|
+
description: "A UUID or slug to identify the object.",
|
|
2814
|
+
in: "path",
|
|
2815
|
+
name: "object",
|
|
2816
|
+
required: true,
|
|
2817
|
+
type: "string"
|
|
2818
|
+
}]
|
|
2819
|
+
}),
|
|
2820
|
+
"list-views-for-object": operation({
|
|
2821
|
+
body: "none",
|
|
2822
|
+
call: getV2ObjectsByObjectViews,
|
|
2823
|
+
description: "List views for object",
|
|
2824
|
+
options: [
|
|
2825
|
+
{
|
|
2826
|
+
description: "A UUID or slug to identify the object.",
|
|
2827
|
+
in: "path",
|
|
2828
|
+
name: "object",
|
|
2829
|
+
required: true,
|
|
2830
|
+
type: "string"
|
|
2831
|
+
},
|
|
2832
|
+
{
|
|
2833
|
+
description: "`true` to include archived views. See our [archiving guide](/docs/archiving-vs-deleting) for more information on archiving.",
|
|
2834
|
+
in: "query",
|
|
2835
|
+
name: "show_archived",
|
|
2836
|
+
required: false,
|
|
2837
|
+
type: "boolean"
|
|
2838
|
+
},
|
|
2839
|
+
{
|
|
2840
|
+
description: "The maximum number of views to return. Must be between 1 and 1000. Defaults to 500.",
|
|
2841
|
+
in: "query",
|
|
2842
|
+
name: "limit",
|
|
2843
|
+
required: false,
|
|
2844
|
+
type: "integer"
|
|
2845
|
+
},
|
|
2846
|
+
{
|
|
2847
|
+
description: "A pagination cursor from a previous response's `pagination.next_cursor`. Omit for the first page.",
|
|
2848
|
+
in: "query",
|
|
2849
|
+
name: "cursor",
|
|
2850
|
+
required: false,
|
|
2851
|
+
type: "string"
|
|
2852
|
+
}
|
|
2853
|
+
]
|
|
2854
|
+
})
|
|
2855
|
+
},
|
|
2856
|
+
description: "Objects are the core data models inside of Attio."
|
|
2857
|
+
},
|
|
2858
|
+
activities: {
|
|
2859
|
+
commands: {
|
|
2860
|
+
"list-activities": operation({
|
|
2861
|
+
body: "none",
|
|
2862
|
+
call: getV2Activities,
|
|
2863
|
+
description: "List activities",
|
|
2864
|
+
options: [{
|
|
2865
|
+
description: "The maximum number of activities to return. Must be between 1 and 1000. Defaults to 100.",
|
|
2866
|
+
in: "query",
|
|
2867
|
+
name: "limit",
|
|
2868
|
+
required: false,
|
|
2869
|
+
type: "integer"
|
|
2870
|
+
}, {
|
|
2871
|
+
description: "A pagination cursor used to fetch the next page of activities. Responses with more activities will include a cursor for you to use here. If not provided, the first page will be returned.",
|
|
2872
|
+
in: "query",
|
|
2873
|
+
name: "cursor",
|
|
2874
|
+
required: false,
|
|
2875
|
+
type: "string"
|
|
2876
|
+
}]
|
|
2877
|
+
}),
|
|
2878
|
+
"create-an-activity": operation({
|
|
2879
|
+
body: "required",
|
|
2880
|
+
call: postV2Activities,
|
|
2881
|
+
description: "Create an activity",
|
|
2882
|
+
options: []
|
|
2883
|
+
}),
|
|
2884
|
+
"delete-an-activity": operation({
|
|
2885
|
+
body: "none",
|
|
2886
|
+
call: deleteV2ActivitiesByActivity,
|
|
2887
|
+
description: "Delete an activity",
|
|
2888
|
+
options: [{
|
|
2889
|
+
description: "A UUID or slug to identify the activity.",
|
|
2890
|
+
in: "path",
|
|
2891
|
+
name: "activity",
|
|
2892
|
+
required: true,
|
|
2893
|
+
type: "string"
|
|
2894
|
+
}]
|
|
2895
|
+
}),
|
|
2896
|
+
"get-an-activity": operation({
|
|
2897
|
+
body: "none",
|
|
2898
|
+
call: getV2ActivitiesByActivity,
|
|
2899
|
+
description: "Get an activity",
|
|
2900
|
+
options: [{
|
|
2901
|
+
description: "A UUID or slug to identify the activity.",
|
|
2902
|
+
in: "path",
|
|
2903
|
+
name: "activity",
|
|
2904
|
+
required: true,
|
|
2905
|
+
type: "string"
|
|
2906
|
+
}]
|
|
2907
|
+
}),
|
|
2908
|
+
"update-an-activity": operation({
|
|
2909
|
+
body: "required",
|
|
2910
|
+
call: patchV2ActivitiesByActivity,
|
|
2911
|
+
description: "Update an activity",
|
|
2912
|
+
options: [{
|
|
2913
|
+
description: "A UUID or slug to identify the activity.",
|
|
2914
|
+
in: "path",
|
|
2915
|
+
name: "activity",
|
|
2916
|
+
required: true,
|
|
2917
|
+
type: "string"
|
|
2918
|
+
}]
|
|
2919
|
+
})
|
|
2920
|
+
},
|
|
2921
|
+
description: ""
|
|
2922
|
+
},
|
|
2923
|
+
"activity-records": {
|
|
2924
|
+
commands: {
|
|
2925
|
+
"list-activity-records": operation({
|
|
2926
|
+
body: "required",
|
|
2927
|
+
call: postV2ActivitiesByActivityRecordsQuery,
|
|
2928
|
+
description: "List activity records",
|
|
2929
|
+
options: [{
|
|
2930
|
+
description: "A UUID or slug to identify the activity.",
|
|
2931
|
+
in: "path",
|
|
2932
|
+
name: "activity",
|
|
2933
|
+
required: true,
|
|
2934
|
+
type: "string"
|
|
2935
|
+
}]
|
|
2936
|
+
}),
|
|
2937
|
+
"create-an-activity-record": operation({
|
|
2938
|
+
body: "required",
|
|
2939
|
+
call: postV2ActivitiesByActivityRecords,
|
|
2940
|
+
description: "Create an activity record",
|
|
2941
|
+
options: [{
|
|
2942
|
+
description: "A UUID or slug to identify the activity.",
|
|
2943
|
+
in: "path",
|
|
2944
|
+
name: "activity",
|
|
2945
|
+
required: true,
|
|
2946
|
+
type: "string"
|
|
2947
|
+
}]
|
|
2948
|
+
}),
|
|
2949
|
+
"upsert-an-activity-record": operation({
|
|
2950
|
+
body: "required",
|
|
2951
|
+
call: putV2ActivitiesByActivityRecords,
|
|
2952
|
+
description: "Upsert an activity record",
|
|
2953
|
+
options: [{
|
|
2954
|
+
description: "A UUID or slug to identify the activity.",
|
|
2955
|
+
in: "path",
|
|
2956
|
+
name: "activity",
|
|
2957
|
+
required: true,
|
|
2958
|
+
type: "string"
|
|
2959
|
+
}, {
|
|
2960
|
+
description: "The ID or slug of the attribute to use to check if an activity record already exists. The attribute must be unique.",
|
|
2961
|
+
in: "query",
|
|
2962
|
+
name: "matching_attribute",
|
|
2963
|
+
required: true,
|
|
2964
|
+
type: "string"
|
|
2965
|
+
}]
|
|
2966
|
+
}),
|
|
2967
|
+
"delete-an-activity-record": operation({
|
|
2968
|
+
body: "none",
|
|
2969
|
+
call: deleteV2ActivitiesByActivityRecordsByRecordId,
|
|
2970
|
+
description: "Delete an activity record",
|
|
2971
|
+
options: [{
|
|
2972
|
+
description: "A UUID or slug to identify the activity.",
|
|
2973
|
+
in: "path",
|
|
2974
|
+
name: "activity",
|
|
2975
|
+
required: true,
|
|
2976
|
+
type: "string"
|
|
2977
|
+
}, {
|
|
2978
|
+
description: "A UUID identifying the activity record to delete.",
|
|
2979
|
+
in: "path",
|
|
2980
|
+
name: "record_id",
|
|
2981
|
+
required: true,
|
|
2982
|
+
type: "string"
|
|
2983
|
+
}]
|
|
2984
|
+
}),
|
|
2985
|
+
"get-an-activity-record": operation({
|
|
2986
|
+
body: "none",
|
|
2987
|
+
call: getV2ActivitiesByActivityRecordsByRecordId,
|
|
2988
|
+
description: "Get an activity record",
|
|
2989
|
+
options: [{
|
|
2990
|
+
description: "A UUID or slug to identify the activity.",
|
|
2991
|
+
in: "path",
|
|
2992
|
+
name: "activity",
|
|
2993
|
+
required: true,
|
|
2994
|
+
type: "string"
|
|
2995
|
+
}, {
|
|
2996
|
+
description: "A UUID identifying the activity record.",
|
|
2997
|
+
in: "path",
|
|
2998
|
+
name: "record_id",
|
|
2999
|
+
required: true,
|
|
3000
|
+
type: "string"
|
|
3001
|
+
}]
|
|
3002
|
+
}),
|
|
3003
|
+
"update-an-activity-record-append-multiselect-values": operation({
|
|
3004
|
+
body: "required",
|
|
3005
|
+
call: patchV2ActivitiesByActivityRecordsByRecordId,
|
|
3006
|
+
description: "Update an activity record (append multiselect values)",
|
|
3007
|
+
options: [{
|
|
3008
|
+
description: "A UUID or slug to identify the activity.",
|
|
3009
|
+
in: "path",
|
|
3010
|
+
name: "activity",
|
|
3011
|
+
required: true,
|
|
3012
|
+
type: "string"
|
|
3013
|
+
}, {
|
|
3014
|
+
description: "A UUID identifying the activity record to update.",
|
|
3015
|
+
in: "path",
|
|
3016
|
+
name: "record_id",
|
|
3017
|
+
required: true,
|
|
3018
|
+
type: "string"
|
|
3019
|
+
}]
|
|
3020
|
+
}),
|
|
3021
|
+
"update-an-activity-record-overwrite-multiselect-values": operation({
|
|
3022
|
+
body: "required",
|
|
3023
|
+
call: putV2ActivitiesByActivityRecordsByRecordId,
|
|
3024
|
+
description: "Update an activity record (overwrite multiselect values)",
|
|
3025
|
+
options: [{
|
|
3026
|
+
description: "A UUID or slug to identify the activity.",
|
|
3027
|
+
in: "path",
|
|
3028
|
+
name: "activity",
|
|
3029
|
+
required: true,
|
|
3030
|
+
type: "string"
|
|
3031
|
+
}, {
|
|
3032
|
+
description: "A UUID identifying the activity record to update.",
|
|
3033
|
+
in: "path",
|
|
3034
|
+
name: "record_id",
|
|
3035
|
+
required: true,
|
|
3036
|
+
type: "string"
|
|
3037
|
+
}]
|
|
3038
|
+
})
|
|
3039
|
+
},
|
|
3040
|
+
description: ""
|
|
3041
|
+
},
|
|
3042
|
+
attributes: {
|
|
3043
|
+
commands: {
|
|
3044
|
+
"list-attributes": operation({
|
|
3045
|
+
body: "none",
|
|
3046
|
+
call: getV2ByTargetByIdentifierAttributes,
|
|
3047
|
+
description: "List attributes",
|
|
3048
|
+
options: [
|
|
3049
|
+
{
|
|
3050
|
+
description: "Whether the attributes are on an object or a list.",
|
|
3051
|
+
in: "path",
|
|
3052
|
+
name: "target",
|
|
3053
|
+
required: true,
|
|
3054
|
+
type: "string"
|
|
3055
|
+
},
|
|
3056
|
+
{
|
|
3057
|
+
description: "A UUID or slug to identify the object or list the attributes belong to.",
|
|
3058
|
+
in: "path",
|
|
3059
|
+
name: "identifier",
|
|
3060
|
+
required: true,
|
|
3061
|
+
type: "string"
|
|
3062
|
+
},
|
|
3063
|
+
{
|
|
3064
|
+
description: "The maximum number of results to return. See the [full guide to pagination here](/rest-api/guides/pagination).",
|
|
3065
|
+
in: "query",
|
|
3066
|
+
name: "limit",
|
|
3067
|
+
required: false,
|
|
3068
|
+
type: "integer"
|
|
3069
|
+
},
|
|
3070
|
+
{
|
|
3071
|
+
description: "The number of results to skip over before returning. See the [full guide to pagination here](/rest-api/guides/pagination).",
|
|
3072
|
+
in: "query",
|
|
3073
|
+
name: "offset",
|
|
3074
|
+
required: false,
|
|
3075
|
+
type: "integer"
|
|
3076
|
+
},
|
|
3077
|
+
{
|
|
3078
|
+
description: "Whether archived attributes should be included in the results. See the [full guide to archiving here](/docs/archiving-vs-deleting).",
|
|
3079
|
+
in: "query",
|
|
3080
|
+
name: "show_archived",
|
|
3081
|
+
required: false,
|
|
3082
|
+
type: "boolean"
|
|
3083
|
+
}
|
|
3084
|
+
]
|
|
3085
|
+
}),
|
|
3086
|
+
"create-an-attribute": operation({
|
|
3087
|
+
body: "required",
|
|
3088
|
+
call: postV2ByTargetByIdentifierAttributes,
|
|
3089
|
+
description: "Create an attribute",
|
|
3090
|
+
options: [{
|
|
3091
|
+
description: "Whether the attribute is to be created on an object or a list.",
|
|
3092
|
+
in: "path",
|
|
3093
|
+
name: "target",
|
|
3094
|
+
required: true,
|
|
3095
|
+
type: "string"
|
|
3096
|
+
}, {
|
|
3097
|
+
description: "A UUID or slug to identify the object or list the attribute belongs to.",
|
|
3098
|
+
in: "path",
|
|
3099
|
+
name: "identifier",
|
|
3100
|
+
required: true,
|
|
3101
|
+
type: "string"
|
|
3102
|
+
}]
|
|
3103
|
+
}),
|
|
3104
|
+
"get-an-attribute": operation({
|
|
3105
|
+
body: "none",
|
|
3106
|
+
call: getV2ByTargetByIdentifierAttributesByAttribute,
|
|
3107
|
+
description: "Get an attribute",
|
|
3108
|
+
options: [
|
|
3109
|
+
{
|
|
3110
|
+
description: "Whether the attribute is on an object or a list.",
|
|
3111
|
+
in: "path",
|
|
3112
|
+
name: "target",
|
|
3113
|
+
required: true,
|
|
3114
|
+
type: "string"
|
|
3115
|
+
},
|
|
3116
|
+
{
|
|
3117
|
+
description: "A UUID or slug to identify the object or list the attribute belongs to.",
|
|
3118
|
+
in: "path",
|
|
3119
|
+
name: "identifier",
|
|
3120
|
+
required: true,
|
|
3121
|
+
type: "string"
|
|
3122
|
+
},
|
|
3123
|
+
{
|
|
3124
|
+
description: "A UUID or slug to identify the attribute.",
|
|
3125
|
+
in: "path",
|
|
3126
|
+
name: "attribute",
|
|
3127
|
+
required: true,
|
|
3128
|
+
type: "string"
|
|
3129
|
+
}
|
|
3130
|
+
]
|
|
3131
|
+
}),
|
|
3132
|
+
"update-an-attribute": operation({
|
|
3133
|
+
body: "required",
|
|
3134
|
+
call: patchV2ByTargetByIdentifierAttributesByAttribute,
|
|
3135
|
+
description: "Update an attribute",
|
|
3136
|
+
options: [
|
|
3137
|
+
{
|
|
3138
|
+
description: "Whether the attribute is on an object or a list.",
|
|
3139
|
+
in: "path",
|
|
3140
|
+
name: "target",
|
|
3141
|
+
required: true,
|
|
3142
|
+
type: "string"
|
|
3143
|
+
},
|
|
3144
|
+
{
|
|
3145
|
+
description: "A UUID or slug to identify the object or list the attribute belongs to.",
|
|
3146
|
+
in: "path",
|
|
3147
|
+
name: "identifier",
|
|
3148
|
+
required: true,
|
|
3149
|
+
type: "string"
|
|
3150
|
+
},
|
|
3151
|
+
{
|
|
3152
|
+
description: "A UUID or slug to identify the attribute.",
|
|
3153
|
+
in: "path",
|
|
3154
|
+
name: "attribute",
|
|
3155
|
+
required: true,
|
|
3156
|
+
type: "string"
|
|
3157
|
+
}
|
|
3158
|
+
]
|
|
3159
|
+
}),
|
|
3160
|
+
"list-select-options": operation({
|
|
3161
|
+
body: "none",
|
|
3162
|
+
call: getV2ByTargetByIdentifierAttributesByAttributeOptions,
|
|
3163
|
+
description: "List select options",
|
|
3164
|
+
options: [
|
|
3165
|
+
{
|
|
3166
|
+
description: "Whether the attribute is on an object or a list.",
|
|
3167
|
+
in: "path",
|
|
3168
|
+
name: "target",
|
|
3169
|
+
required: true,
|
|
3170
|
+
type: "string"
|
|
3171
|
+
},
|
|
3172
|
+
{
|
|
3173
|
+
description: "A UUID or slug to identify the object or list the select attribute belongs to.",
|
|
3174
|
+
in: "path",
|
|
3175
|
+
name: "identifier",
|
|
3176
|
+
required: true,
|
|
3177
|
+
type: "string"
|
|
3178
|
+
},
|
|
3179
|
+
{
|
|
3180
|
+
description: "A UUID or slug to identify the attribute you want to list select options on.",
|
|
3181
|
+
in: "path",
|
|
3182
|
+
name: "attribute",
|
|
3183
|
+
required: true,
|
|
3184
|
+
type: "string"
|
|
3185
|
+
},
|
|
3186
|
+
{
|
|
3187
|
+
description: "`true` if you want the results to include archived select options.",
|
|
3188
|
+
in: "query",
|
|
3189
|
+
name: "show_archived",
|
|
3190
|
+
required: false,
|
|
3191
|
+
type: "boolean"
|
|
3192
|
+
}
|
|
3193
|
+
]
|
|
3194
|
+
}),
|
|
3195
|
+
"create-a-select-option": operation({
|
|
3196
|
+
body: "required",
|
|
3197
|
+
call: postV2ByTargetByIdentifierAttributesByAttributeOptions,
|
|
3198
|
+
description: "Create a select option",
|
|
3199
|
+
options: [
|
|
3200
|
+
{
|
|
3201
|
+
description: "Whether the attribute is on an object or a list.",
|
|
3202
|
+
in: "path",
|
|
3203
|
+
name: "target",
|
|
3204
|
+
required: true,
|
|
3205
|
+
type: "string"
|
|
3206
|
+
},
|
|
3207
|
+
{
|
|
3208
|
+
description: "A UUID or slug to identify the object or list the select attribute belongs to.",
|
|
3209
|
+
in: "path",
|
|
3210
|
+
name: "identifier",
|
|
3211
|
+
required: true,
|
|
3212
|
+
type: "string"
|
|
3213
|
+
},
|
|
3214
|
+
{
|
|
3215
|
+
description: "A UUID or slug to identify the attribute to create a select option on.",
|
|
3216
|
+
in: "path",
|
|
3217
|
+
name: "attribute",
|
|
3218
|
+
required: true,
|
|
3219
|
+
type: "string"
|
|
3220
|
+
}
|
|
3221
|
+
]
|
|
3222
|
+
}),
|
|
3223
|
+
"update-a-select-option": operation({
|
|
3224
|
+
body: "required",
|
|
3225
|
+
call: patchV2ByTargetByIdentifierAttributesByAttributeOptionsByOption,
|
|
3226
|
+
description: "Update a select option",
|
|
3227
|
+
options: [
|
|
3228
|
+
{
|
|
3229
|
+
description: "Whether the attribute is on an object or a list.",
|
|
3230
|
+
in: "path",
|
|
3231
|
+
name: "target",
|
|
3232
|
+
required: true,
|
|
3233
|
+
type: "string"
|
|
3234
|
+
},
|
|
3235
|
+
{
|
|
3236
|
+
description: "A UUID or slug to identify the object or list the select attribute belongs to.",
|
|
3237
|
+
in: "path",
|
|
3238
|
+
name: "identifier",
|
|
3239
|
+
required: true,
|
|
3240
|
+
type: "string"
|
|
3241
|
+
},
|
|
3242
|
+
{
|
|
3243
|
+
description: "A UUID or slug to identify the select attribute.",
|
|
3244
|
+
in: "path",
|
|
3245
|
+
name: "attribute",
|
|
3246
|
+
required: true,
|
|
3247
|
+
type: "string"
|
|
3248
|
+
},
|
|
3249
|
+
{
|
|
3250
|
+
description: "A UUID or select option title to identify the select option you would like to update.",
|
|
3251
|
+
in: "path",
|
|
3252
|
+
name: "option",
|
|
3253
|
+
required: true,
|
|
3254
|
+
type: "string"
|
|
3255
|
+
}
|
|
3256
|
+
]
|
|
3257
|
+
}),
|
|
3258
|
+
"list-statuses": operation({
|
|
3259
|
+
body: "none",
|
|
3260
|
+
call: getV2ByTargetByIdentifierAttributesByAttributeStatuses,
|
|
3261
|
+
description: "List statuses",
|
|
3262
|
+
options: [
|
|
3263
|
+
{
|
|
3264
|
+
description: "Whether the attribute is on an object or a list.",
|
|
3265
|
+
in: "path",
|
|
3266
|
+
name: "target",
|
|
3267
|
+
required: true,
|
|
3268
|
+
type: "string"
|
|
3269
|
+
},
|
|
3270
|
+
{
|
|
3271
|
+
description: "A UUID or slug to identify the object or list the status attribute belongs to.",
|
|
3272
|
+
in: "path",
|
|
3273
|
+
name: "identifier",
|
|
3274
|
+
required: true,
|
|
3275
|
+
type: "string"
|
|
3276
|
+
},
|
|
3277
|
+
{
|
|
3278
|
+
description: "A UUID or slug to identify the attribute you want to list statuses on.",
|
|
3279
|
+
in: "path",
|
|
3280
|
+
name: "attribute",
|
|
3281
|
+
required: true,
|
|
3282
|
+
type: "string"
|
|
3283
|
+
},
|
|
3284
|
+
{
|
|
3285
|
+
description: "`true` if you want the results to include archived statuses. See our [archiving guide](/docs/archiving-vs-deleting) for more information on archiving.",
|
|
3286
|
+
in: "query",
|
|
3287
|
+
name: "show_archived",
|
|
3288
|
+
required: false,
|
|
3289
|
+
type: "boolean"
|
|
3290
|
+
}
|
|
3291
|
+
]
|
|
3292
|
+
}),
|
|
3293
|
+
"create-a-status": operation({
|
|
3294
|
+
body: "required",
|
|
3295
|
+
call: postV2ByTargetByIdentifierAttributesByAttributeStatuses,
|
|
3296
|
+
description: "Create a status",
|
|
3297
|
+
options: [
|
|
3298
|
+
{
|
|
3299
|
+
description: "Whether the attribute is on an object or a list.",
|
|
3300
|
+
in: "path",
|
|
3301
|
+
name: "target",
|
|
3302
|
+
required: true,
|
|
3303
|
+
type: "string"
|
|
3304
|
+
},
|
|
3305
|
+
{
|
|
3306
|
+
description: "A UUID or slug to identify the object or list the status attribute belongs to.",
|
|
3307
|
+
in: "path",
|
|
3308
|
+
name: "identifier",
|
|
3309
|
+
required: true,
|
|
3310
|
+
type: "string"
|
|
3311
|
+
},
|
|
3312
|
+
{
|
|
3313
|
+
description: "A UUID or slug to identify the attribute the status will belong to.",
|
|
3314
|
+
in: "path",
|
|
3315
|
+
name: "attribute",
|
|
3316
|
+
required: true,
|
|
3317
|
+
type: "string"
|
|
3318
|
+
}
|
|
3319
|
+
]
|
|
3320
|
+
}),
|
|
3321
|
+
"update-a-status": operation({
|
|
3322
|
+
body: "required",
|
|
3323
|
+
call: patchV2ByTargetByIdentifierAttributesByAttributeStatusesByStatus,
|
|
3324
|
+
description: "Update a status",
|
|
3325
|
+
options: [
|
|
3326
|
+
{
|
|
3327
|
+
description: "Whether the attribute is on an object or a list.",
|
|
3328
|
+
in: "path",
|
|
3329
|
+
name: "target",
|
|
3330
|
+
required: true,
|
|
3331
|
+
type: "string"
|
|
3332
|
+
},
|
|
3333
|
+
{
|
|
3334
|
+
description: "A UUID or slug to identify the object or list the status attribute belongs to.",
|
|
3335
|
+
in: "path",
|
|
3336
|
+
name: "identifier",
|
|
3337
|
+
required: true,
|
|
3338
|
+
type: "string"
|
|
3339
|
+
},
|
|
3340
|
+
{
|
|
3341
|
+
description: "A UUID or slug to identify the attribute to update the status on.",
|
|
3342
|
+
in: "path",
|
|
3343
|
+
name: "attribute",
|
|
3344
|
+
required: true,
|
|
3345
|
+
type: "string"
|
|
3346
|
+
},
|
|
3347
|
+
{
|
|
3348
|
+
description: "A UUID or status title to identify the status to update.",
|
|
3349
|
+
in: "path",
|
|
3350
|
+
name: "status",
|
|
3351
|
+
required: true,
|
|
3352
|
+
type: "string"
|
|
3353
|
+
}
|
|
3354
|
+
]
|
|
3355
|
+
})
|
|
3356
|
+
},
|
|
3357
|
+
description: "Attributes model properties of objects and lists."
|
|
3358
|
+
},
|
|
3359
|
+
records: {
|
|
3360
|
+
commands: {
|
|
3361
|
+
"list-records": operation({
|
|
3362
|
+
body: "required",
|
|
3363
|
+
call: postV2ObjectsByObjectRecordsQuery,
|
|
3364
|
+
description: "List records",
|
|
3365
|
+
options: [{
|
|
3366
|
+
description: "A UUID or slug to identify the object to list records for.",
|
|
3367
|
+
in: "path",
|
|
3368
|
+
name: "object",
|
|
3369
|
+
required: true,
|
|
3370
|
+
type: "string"
|
|
3371
|
+
}]
|
|
3372
|
+
}),
|
|
3373
|
+
"create-a-record": operation({
|
|
3374
|
+
body: "required",
|
|
3375
|
+
call: postV2ObjectsByObjectRecords,
|
|
3376
|
+
description: "Create a record",
|
|
3377
|
+
options: [{
|
|
3378
|
+
description: "The UUID or slug identifying the object the created record should belong to.",
|
|
3379
|
+
in: "path",
|
|
3380
|
+
name: "object",
|
|
3381
|
+
required: true,
|
|
3382
|
+
type: "string"
|
|
3383
|
+
}]
|
|
3384
|
+
}),
|
|
3385
|
+
"upsert-a-record": operation({
|
|
3386
|
+
body: "required",
|
|
3387
|
+
call: putV2ObjectsByObjectRecords,
|
|
3388
|
+
description: "Upsert a record",
|
|
3389
|
+
options: [{
|
|
3390
|
+
description: "A UUID or slug to identify the object the record should belong to.",
|
|
3391
|
+
in: "path",
|
|
3392
|
+
name: "object",
|
|
3393
|
+
required: true,
|
|
3394
|
+
type: "string"
|
|
3395
|
+
}, {
|
|
3396
|
+
description: "The ID or slug of the attribute to use to check if a record already exists. The attribute must be unique.",
|
|
3397
|
+
in: "query",
|
|
3398
|
+
name: "matching_attribute",
|
|
3399
|
+
required: true,
|
|
3400
|
+
type: "string"
|
|
3401
|
+
}]
|
|
3402
|
+
}),
|
|
3403
|
+
"delete-a-record": operation({
|
|
3404
|
+
body: "none",
|
|
3405
|
+
call: deleteV2ObjectsByObjectRecordsByRecordId,
|
|
3406
|
+
description: "Delete a record",
|
|
3407
|
+
options: [{
|
|
3408
|
+
description: "The UUID or slug of the object the record belongs to.",
|
|
3409
|
+
in: "path",
|
|
3410
|
+
name: "object",
|
|
3411
|
+
required: true,
|
|
3412
|
+
type: "string"
|
|
3413
|
+
}, {
|
|
3414
|
+
description: "The UUID of the record to delete.",
|
|
3415
|
+
in: "path",
|
|
3416
|
+
name: "record_id",
|
|
3417
|
+
required: true,
|
|
3418
|
+
type: "string"
|
|
3419
|
+
}]
|
|
3420
|
+
}),
|
|
3421
|
+
"get-a-record": operation({
|
|
3422
|
+
body: "none",
|
|
3423
|
+
call: getV2ObjectsByObjectRecordsByRecordId,
|
|
3424
|
+
description: "Get a record",
|
|
3425
|
+
options: [{
|
|
3426
|
+
description: "A UUID or slug identifying the object that the record belongs to.",
|
|
3427
|
+
in: "path",
|
|
3428
|
+
name: "object",
|
|
3429
|
+
required: true,
|
|
3430
|
+
type: "string"
|
|
3431
|
+
}, {
|
|
3432
|
+
description: "A UUID identifying the record.",
|
|
3433
|
+
in: "path",
|
|
3434
|
+
name: "record_id",
|
|
3435
|
+
required: true,
|
|
3436
|
+
type: "string"
|
|
3437
|
+
}]
|
|
3438
|
+
}),
|
|
3439
|
+
"update-a-record-append-multiselect-values": operation({
|
|
3440
|
+
body: "required",
|
|
3441
|
+
call: patchV2ObjectsByObjectRecordsByRecordId,
|
|
3442
|
+
description: "Update a record (append multiselect values)",
|
|
3443
|
+
options: [{
|
|
3444
|
+
description: "A UUID or slug of the object the record belongs to.",
|
|
3445
|
+
in: "path",
|
|
3446
|
+
name: "object",
|
|
3447
|
+
required: true,
|
|
3448
|
+
type: "string"
|
|
3449
|
+
}, {
|
|
3450
|
+
description: "A UUID of the record to update.",
|
|
3451
|
+
in: "path",
|
|
3452
|
+
name: "record_id",
|
|
3453
|
+
required: true,
|
|
3454
|
+
type: "string"
|
|
3455
|
+
}]
|
|
3456
|
+
}),
|
|
3457
|
+
"update-a-record-overwrite-multiselect-values": operation({
|
|
3458
|
+
body: "required",
|
|
3459
|
+
call: putV2ObjectsByObjectRecordsByRecordId,
|
|
3460
|
+
description: "Update a record (overwrite multiselect values)",
|
|
3461
|
+
options: [{
|
|
3462
|
+
description: "A UUID or slug of the object the record belongs to.",
|
|
3463
|
+
in: "path",
|
|
3464
|
+
name: "object",
|
|
3465
|
+
required: true,
|
|
3466
|
+
type: "string"
|
|
3467
|
+
}, {
|
|
3468
|
+
description: "A UUID of the record to update.",
|
|
3469
|
+
in: "path",
|
|
3470
|
+
name: "record_id",
|
|
3471
|
+
required: true,
|
|
3472
|
+
type: "string"
|
|
3473
|
+
}]
|
|
3474
|
+
}),
|
|
3475
|
+
"merge-two-records": operation({
|
|
3476
|
+
body: "required",
|
|
3477
|
+
call: postV2ObjectsByObjectRecordsMerge,
|
|
3478
|
+
description: "Merge two records",
|
|
3479
|
+
options: [{
|
|
3480
|
+
description: "A UUID or slug of the object both records belong to.",
|
|
3481
|
+
in: "path",
|
|
3482
|
+
name: "object",
|
|
3483
|
+
required: true,
|
|
3484
|
+
type: "string"
|
|
3485
|
+
}]
|
|
3486
|
+
}),
|
|
3487
|
+
"list-record-attribute-values": operation({
|
|
3488
|
+
body: "none",
|
|
3489
|
+
call: getV2ObjectsByObjectRecordsByRecordIdAttributesByAttributeValues,
|
|
3490
|
+
description: "List record attribute values",
|
|
3491
|
+
options: [
|
|
3492
|
+
{
|
|
3493
|
+
description: "A UUID or slug to identify the object the record belongs to.",
|
|
3494
|
+
in: "path",
|
|
3495
|
+
name: "object",
|
|
3496
|
+
required: true,
|
|
3497
|
+
type: "string"
|
|
3498
|
+
},
|
|
3499
|
+
{
|
|
3500
|
+
description: "A UUID to identify the record you want to query values on.",
|
|
3501
|
+
in: "path",
|
|
3502
|
+
name: "record_id",
|
|
3503
|
+
required: true,
|
|
3504
|
+
type: "string"
|
|
3505
|
+
},
|
|
3506
|
+
{
|
|
3507
|
+
description: "A UUID or slug to identify the attribute you want to query values on.",
|
|
3508
|
+
in: "path",
|
|
3509
|
+
name: "attribute",
|
|
3510
|
+
required: true,
|
|
3511
|
+
type: "string"
|
|
3512
|
+
},
|
|
3513
|
+
{
|
|
3514
|
+
description: "If `true`, the endpoint will return all historic values for the attribute. If `false`, the endpoint will only return the currently active value(s). Defaults to `false`. Cannot be set to `true` for COMINT attributes or enriched attributes on people/company objects.",
|
|
3515
|
+
in: "query",
|
|
3516
|
+
name: "show_historic",
|
|
3517
|
+
required: false,
|
|
3518
|
+
type: "boolean"
|
|
3519
|
+
},
|
|
3520
|
+
{
|
|
3521
|
+
description: "The maximum number of results to return. See the [full guide to pagination here](/rest-api/guides/pagination).",
|
|
3522
|
+
in: "query",
|
|
3523
|
+
name: "limit",
|
|
3524
|
+
required: false,
|
|
3525
|
+
type: "integer"
|
|
3526
|
+
},
|
|
3527
|
+
{
|
|
3528
|
+
description: "The number of results to skip over before returning. See the [full guide to pagination here](/rest-api/guides/pagination).",
|
|
3529
|
+
in: "query",
|
|
3530
|
+
name: "offset",
|
|
3531
|
+
required: false,
|
|
3532
|
+
type: "integer"
|
|
3533
|
+
}
|
|
3534
|
+
]
|
|
3535
|
+
}),
|
|
3536
|
+
"write-record-attribute-values": operation({
|
|
3537
|
+
body: "required",
|
|
3538
|
+
call: putV2ObjectsByObjectRecordsByRecordIdAttributesByAttributeValues,
|
|
3539
|
+
description: "Write record attribute values",
|
|
3540
|
+
options: [
|
|
3541
|
+
{
|
|
3542
|
+
description: "A UUID or slug to identify the object the record belongs to.",
|
|
3543
|
+
in: "path",
|
|
3544
|
+
name: "object",
|
|
3545
|
+
required: true,
|
|
3546
|
+
type: "string"
|
|
3547
|
+
},
|
|
3548
|
+
{
|
|
3549
|
+
description: "A UUID to identify the record you want to query values on.",
|
|
3550
|
+
in: "path",
|
|
3551
|
+
name: "record_id",
|
|
3552
|
+
required: true,
|
|
3553
|
+
type: "string"
|
|
3554
|
+
},
|
|
3555
|
+
{
|
|
3556
|
+
description: "A UUID or slug to identify the attribute you want to query values on.",
|
|
3557
|
+
in: "path",
|
|
3558
|
+
name: "attribute",
|
|
3559
|
+
required: true,
|
|
3560
|
+
type: "string"
|
|
3561
|
+
}
|
|
3562
|
+
]
|
|
3563
|
+
}),
|
|
3564
|
+
"list-record-entries": operation({
|
|
3565
|
+
body: "none",
|
|
3566
|
+
call: getV2ObjectsByObjectRecordsByRecordIdEntries,
|
|
3567
|
+
description: "List record entries",
|
|
3568
|
+
options: [
|
|
3569
|
+
{
|
|
3570
|
+
description: "A UUID or slug identifying the object that the record belongs to.",
|
|
3571
|
+
in: "path",
|
|
3572
|
+
name: "object",
|
|
3573
|
+
required: true,
|
|
3574
|
+
type: "string"
|
|
3575
|
+
},
|
|
3576
|
+
{
|
|
3577
|
+
description: "A UUID identifying the record.",
|
|
3578
|
+
in: "path",
|
|
3579
|
+
name: "record_id",
|
|
3580
|
+
required: true,
|
|
3581
|
+
type: "string"
|
|
3582
|
+
},
|
|
3583
|
+
{
|
|
3584
|
+
description: "The maximum number of results to return. The default is `100` and the maximum is `1000`. See the [full guide to pagination here](/rest-api/guides/pagination).",
|
|
3585
|
+
in: "query",
|
|
3586
|
+
name: "limit",
|
|
3587
|
+
required: false,
|
|
3588
|
+
type: "integer"
|
|
3589
|
+
},
|
|
3590
|
+
{
|
|
3591
|
+
description: "The number of results to skip over before returning. The default is `0`. See the [full guide to pagination here](/rest-api/guides/pagination).",
|
|
3592
|
+
in: "query",
|
|
3593
|
+
name: "offset",
|
|
3594
|
+
required: false,
|
|
3595
|
+
type: "integer"
|
|
3596
|
+
}
|
|
3597
|
+
]
|
|
3598
|
+
}),
|
|
3599
|
+
"search-records": operation({
|
|
3600
|
+
body: "required",
|
|
3601
|
+
call: postV2ObjectsRecordsSearch,
|
|
3602
|
+
description: "Search records",
|
|
3603
|
+
options: []
|
|
3604
|
+
})
|
|
3605
|
+
},
|
|
3606
|
+
description: "Records are individual instances of objects e.g. a specific person or company."
|
|
3607
|
+
},
|
|
3608
|
+
sql: {
|
|
3609
|
+
commands: { "query-sql": operation({
|
|
3610
|
+
body: "required",
|
|
3611
|
+
call: postV2Sql,
|
|
3612
|
+
description: "Query SQL",
|
|
3613
|
+
options: []
|
|
3614
|
+
}) },
|
|
3615
|
+
description: "Query records and list entries across your workspace using SQL."
|
|
3616
|
+
},
|
|
3617
|
+
lists: {
|
|
3618
|
+
commands: {
|
|
3619
|
+
"list-all-lists": operation({
|
|
3620
|
+
body: "none",
|
|
3621
|
+
call: getV2Lists,
|
|
3622
|
+
description: "List all lists",
|
|
3623
|
+
options: []
|
|
3624
|
+
}),
|
|
3625
|
+
"create-a-list": operation({
|
|
3626
|
+
body: "required",
|
|
3627
|
+
call: postV2Lists,
|
|
3628
|
+
description: "Create a list",
|
|
3629
|
+
options: []
|
|
3630
|
+
}),
|
|
3631
|
+
"get-a-list": operation({
|
|
3632
|
+
body: "none",
|
|
3633
|
+
call: getV2ListsByList,
|
|
3634
|
+
description: "Get a list",
|
|
3635
|
+
options: [{
|
|
3636
|
+
description: "A UUID or slug to identify the list.",
|
|
3637
|
+
in: "path",
|
|
3638
|
+
name: "list",
|
|
3639
|
+
required: true,
|
|
3640
|
+
type: "string"
|
|
3641
|
+
}]
|
|
3642
|
+
}),
|
|
3643
|
+
"update-a-list": operation({
|
|
3644
|
+
body: "required",
|
|
3645
|
+
call: patchV2ListsByList,
|
|
3646
|
+
description: "Update a list",
|
|
3647
|
+
options: [{
|
|
3648
|
+
description: "A UUID or slug to identify the list to update.",
|
|
3649
|
+
in: "path",
|
|
3650
|
+
name: "list",
|
|
3651
|
+
required: true,
|
|
3652
|
+
type: "string"
|
|
3653
|
+
}]
|
|
3654
|
+
}),
|
|
3655
|
+
"list-views-for-list": operation({
|
|
3656
|
+
body: "none",
|
|
3657
|
+
call: getV2ListsByListViews,
|
|
3658
|
+
description: "List views for list",
|
|
3659
|
+
options: [
|
|
3660
|
+
{
|
|
3661
|
+
description: "A UUID or slug to identify the list.",
|
|
3662
|
+
in: "path",
|
|
3663
|
+
name: "list",
|
|
3664
|
+
required: true,
|
|
3665
|
+
type: "string"
|
|
3666
|
+
},
|
|
3667
|
+
{
|
|
3668
|
+
description: "`true` to include archived views. See our [archiving guide](/docs/archiving-vs-deleting) for more information on archiving.",
|
|
3669
|
+
in: "query",
|
|
3670
|
+
name: "show_archived",
|
|
3671
|
+
required: false,
|
|
3672
|
+
type: "boolean"
|
|
3673
|
+
},
|
|
3674
|
+
{
|
|
3675
|
+
description: "The maximum number of views to return. Must be between 1 and 1000. Defaults to 500.",
|
|
3676
|
+
in: "query",
|
|
3677
|
+
name: "limit",
|
|
3678
|
+
required: false,
|
|
3679
|
+
type: "integer"
|
|
3680
|
+
},
|
|
3681
|
+
{
|
|
3682
|
+
description: "A pagination cursor from a previous response's `pagination.next_cursor`. Omit for the first page.",
|
|
3683
|
+
in: "query",
|
|
3684
|
+
name: "cursor",
|
|
3685
|
+
required: false,
|
|
3686
|
+
type: "string"
|
|
3687
|
+
}
|
|
3688
|
+
]
|
|
3689
|
+
})
|
|
3690
|
+
},
|
|
3691
|
+
description: "Lists are used to model a particular process."
|
|
3692
|
+
},
|
|
3693
|
+
entries: {
|
|
3694
|
+
commands: {
|
|
3695
|
+
"list-entries": operation({
|
|
3696
|
+
body: "required",
|
|
3697
|
+
call: postV2ListsByListEntriesQuery,
|
|
3698
|
+
description: "List entries",
|
|
3699
|
+
options: [{
|
|
3700
|
+
description: "A UUID or slug to identify the list to retrieve entries from.",
|
|
3701
|
+
in: "path",
|
|
3702
|
+
name: "list",
|
|
3703
|
+
required: true,
|
|
3704
|
+
type: "string"
|
|
3705
|
+
}]
|
|
3706
|
+
}),
|
|
3707
|
+
"create-an-entry-add-record-to-list": operation({
|
|
3708
|
+
body: "required",
|
|
3709
|
+
call: postV2ListsByListEntries,
|
|
3710
|
+
description: "Create an entry (add record to list)",
|
|
3711
|
+
options: [{
|
|
3712
|
+
description: "The UUID or slug identifying the list that the created list entry should belong to.",
|
|
3713
|
+
in: "path",
|
|
3714
|
+
name: "list",
|
|
3715
|
+
required: true,
|
|
3716
|
+
type: "string"
|
|
3717
|
+
}]
|
|
3718
|
+
}),
|
|
3719
|
+
"upsert-a-list-entry-by-parent": operation({
|
|
3720
|
+
body: "required",
|
|
3721
|
+
call: putV2ListsByListEntries,
|
|
3722
|
+
description: "Upsert a list entry by parent",
|
|
3723
|
+
options: [{
|
|
3724
|
+
description: "A UUID or slug of the list the list entry belongs to.",
|
|
3725
|
+
in: "path",
|
|
3726
|
+
name: "list",
|
|
3727
|
+
required: true,
|
|
3728
|
+
type: "string"
|
|
3729
|
+
}]
|
|
3730
|
+
}),
|
|
3731
|
+
"delete-a-list-entry": operation({
|
|
3732
|
+
body: "none",
|
|
3733
|
+
call: deleteV2ListsByListEntriesByEntryId,
|
|
3734
|
+
description: "Delete a list entry",
|
|
3735
|
+
options: [{
|
|
3736
|
+
description: "A UUID or slug identifying the list the entry is in.",
|
|
3737
|
+
in: "path",
|
|
3738
|
+
name: "list",
|
|
3739
|
+
required: true,
|
|
3740
|
+
type: "string"
|
|
3741
|
+
}, {
|
|
3742
|
+
description: "A UUID identifying the entry to delete.",
|
|
3743
|
+
in: "path",
|
|
3744
|
+
name: "entry_id",
|
|
3745
|
+
required: true,
|
|
3746
|
+
type: "string"
|
|
3747
|
+
}]
|
|
3748
|
+
}),
|
|
3749
|
+
"get-a-list-entry": operation({
|
|
3750
|
+
body: "none",
|
|
3751
|
+
call: getV2ListsByListEntriesByEntryId,
|
|
3752
|
+
description: "Get a list entry",
|
|
3753
|
+
options: [{
|
|
3754
|
+
description: "A UUID or slug identifying the list the entry is in.",
|
|
3755
|
+
in: "path",
|
|
3756
|
+
name: "list",
|
|
3757
|
+
required: true,
|
|
3758
|
+
type: "string"
|
|
3759
|
+
}, {
|
|
3760
|
+
description: "A UUID identifying the entry.",
|
|
3761
|
+
in: "path",
|
|
3762
|
+
name: "entry_id",
|
|
3763
|
+
required: true,
|
|
3764
|
+
type: "string"
|
|
3765
|
+
}]
|
|
3766
|
+
}),
|
|
3767
|
+
"update-a-list-entry-append-multiselect-values": operation({
|
|
3768
|
+
body: "required",
|
|
3769
|
+
call: patchV2ListsByListEntriesByEntryId,
|
|
3770
|
+
description: "Update a list entry (append multiselect values)",
|
|
3771
|
+
options: [{
|
|
3772
|
+
description: "A UUID or slug of the list the list entry belongs to.",
|
|
3773
|
+
in: "path",
|
|
3774
|
+
name: "list",
|
|
3775
|
+
required: true,
|
|
3776
|
+
type: "string"
|
|
3777
|
+
}, {
|
|
3778
|
+
description: "A UUID of the list entry to update.",
|
|
3779
|
+
in: "path",
|
|
3780
|
+
name: "entry_id",
|
|
3781
|
+
required: true,
|
|
3782
|
+
type: "string"
|
|
3783
|
+
}]
|
|
3784
|
+
}),
|
|
3785
|
+
"update-a-list-entry-overwrite-multiselect-values": operation({
|
|
3786
|
+
body: "required",
|
|
3787
|
+
call: putV2ListsByListEntriesByEntryId,
|
|
3788
|
+
description: "Update a list entry (overwrite multiselect values)",
|
|
3789
|
+
options: [{
|
|
3790
|
+
description: "A UUID or slug of the list the list entry belongs to.",
|
|
3791
|
+
in: "path",
|
|
3792
|
+
name: "list",
|
|
3793
|
+
required: true,
|
|
3794
|
+
type: "string"
|
|
3795
|
+
}, {
|
|
3796
|
+
description: "A UUID of the list entry to update.",
|
|
3797
|
+
in: "path",
|
|
3798
|
+
name: "entry_id",
|
|
3799
|
+
required: true,
|
|
3800
|
+
type: "string"
|
|
3801
|
+
}]
|
|
3802
|
+
}),
|
|
3803
|
+
"list-attribute-values-for-a-list-entry": operation({
|
|
3804
|
+
body: "none",
|
|
3805
|
+
call: getV2ListsByListEntriesByEntryIdAttributesByAttributeValues,
|
|
3806
|
+
description: "List attribute values for a list entry",
|
|
3807
|
+
options: [
|
|
3808
|
+
{
|
|
3809
|
+
description: "A UUID or slug identifying the list the entry is in.",
|
|
3810
|
+
in: "path",
|
|
3811
|
+
name: "list",
|
|
3812
|
+
required: true,
|
|
3813
|
+
type: "string"
|
|
3814
|
+
},
|
|
3815
|
+
{
|
|
3816
|
+
description: "A UUID identifying the entry.",
|
|
3817
|
+
in: "path",
|
|
3818
|
+
name: "entry_id",
|
|
3819
|
+
required: true,
|
|
3820
|
+
type: "string"
|
|
3821
|
+
},
|
|
3822
|
+
{
|
|
3823
|
+
description: "A UUID or slug to identify the attribute you want to query values on.",
|
|
3824
|
+
in: "path",
|
|
3825
|
+
name: "attribute",
|
|
3826
|
+
required: true,
|
|
3827
|
+
type: "string"
|
|
3828
|
+
},
|
|
3829
|
+
{
|
|
3830
|
+
description: "If `true`, the endpoint will return all historic values for the attribute. If `false`, the endpoint will only return the currently active value(s). Defaults to `false`. Can only be set to `true` for attributes which support historic data; the endpoint will throw if set to `true` for non-historic attributes.",
|
|
3831
|
+
in: "query",
|
|
3832
|
+
name: "show_historic",
|
|
3833
|
+
required: false,
|
|
3834
|
+
type: "boolean"
|
|
3835
|
+
},
|
|
3836
|
+
{
|
|
3837
|
+
description: "The maximum number of results to return. See the [full guide to pagination here](/rest-api/guides/pagination).",
|
|
3838
|
+
in: "query",
|
|
3839
|
+
name: "limit",
|
|
3840
|
+
required: false,
|
|
3841
|
+
type: "integer"
|
|
3842
|
+
},
|
|
3843
|
+
{
|
|
3844
|
+
description: "The number of results to skip over before returning. See the [full guide to pagination here](/rest-api/guides/pagination).",
|
|
3845
|
+
in: "query",
|
|
3846
|
+
name: "offset",
|
|
3847
|
+
required: false,
|
|
3848
|
+
type: "integer"
|
|
3849
|
+
}
|
|
3850
|
+
]
|
|
3851
|
+
}),
|
|
3852
|
+
"write-list-entry-attribute-values": operation({
|
|
3853
|
+
body: "required",
|
|
3854
|
+
call: putV2ListsByListEntriesByEntryIdAttributesByAttributeValues,
|
|
3855
|
+
description: "Write list entry attribute values",
|
|
3856
|
+
options: [
|
|
3857
|
+
{
|
|
3858
|
+
description: "A UUID or slug identifying the list the entry is in.",
|
|
3859
|
+
in: "path",
|
|
3860
|
+
name: "list",
|
|
3861
|
+
required: true,
|
|
3862
|
+
type: "string"
|
|
3863
|
+
},
|
|
3864
|
+
{
|
|
3865
|
+
description: "A UUID identifying the entry.",
|
|
3866
|
+
in: "path",
|
|
3867
|
+
name: "entry_id",
|
|
3868
|
+
required: true,
|
|
3869
|
+
type: "string"
|
|
3870
|
+
},
|
|
3871
|
+
{
|
|
3872
|
+
description: "A UUID or slug to identify the attribute you want to query values on.",
|
|
3873
|
+
in: "path",
|
|
3874
|
+
name: "attribute",
|
|
3875
|
+
required: true,
|
|
3876
|
+
type: "string"
|
|
3877
|
+
}
|
|
3878
|
+
]
|
|
3879
|
+
})
|
|
3880
|
+
},
|
|
3881
|
+
description: "Entries are elements in a list that reference a single parent record."
|
|
3882
|
+
},
|
|
3883
|
+
"workspace-members": {
|
|
3884
|
+
commands: {
|
|
3885
|
+
"list-workspace-members": operation({
|
|
3886
|
+
body: "none",
|
|
3887
|
+
call: getV2WorkspaceMembers,
|
|
3888
|
+
description: "List workspace members",
|
|
3889
|
+
options: []
|
|
3890
|
+
}),
|
|
3891
|
+
"get-a-workspace-member": operation({
|
|
3892
|
+
body: "none",
|
|
3893
|
+
call: getV2WorkspaceMembersByWorkspaceMemberId,
|
|
3894
|
+
description: "Get a workspace member",
|
|
3895
|
+
options: [{
|
|
3896
|
+
description: "A UUID to identify the workspace member.",
|
|
3897
|
+
in: "path",
|
|
3898
|
+
name: "workspace_member_id",
|
|
3899
|
+
required: true,
|
|
3900
|
+
type: "string"
|
|
3901
|
+
}]
|
|
3902
|
+
})
|
|
3903
|
+
},
|
|
3904
|
+
description: "Workspace members represent a user with access to a workspace."
|
|
3905
|
+
},
|
|
3906
|
+
notes: {
|
|
3907
|
+
commands: {
|
|
3908
|
+
"list-notes": operation({
|
|
3909
|
+
body: "none",
|
|
3910
|
+
call: getV2Notes,
|
|
3911
|
+
description: "List notes",
|
|
3912
|
+
options: [
|
|
3913
|
+
{
|
|
3914
|
+
description: "The maximum number of results to return. The default is `10` and the maximum is `50`. See the [full guide to pagination here](/rest-api/guides/pagination).",
|
|
3915
|
+
in: "query",
|
|
3916
|
+
name: "limit",
|
|
3917
|
+
required: false,
|
|
3918
|
+
type: "integer"
|
|
3919
|
+
},
|
|
3920
|
+
{
|
|
3921
|
+
description: "The number of results to skip over before returning. The default is `0`. See the [full guide to pagination here](/rest-api/guides/pagination).",
|
|
3922
|
+
in: "query",
|
|
3923
|
+
name: "offset",
|
|
3924
|
+
required: false,
|
|
3925
|
+
type: "integer"
|
|
3926
|
+
},
|
|
3927
|
+
{
|
|
3928
|
+
description: "The slug or ID of the parent object the notes belong to.",
|
|
3929
|
+
in: "query",
|
|
3930
|
+
name: "parent_object",
|
|
3931
|
+
required: false,
|
|
3932
|
+
type: "string"
|
|
3933
|
+
},
|
|
3934
|
+
{
|
|
3935
|
+
description: "The ID of the parent record the notes belong to.",
|
|
3936
|
+
in: "query",
|
|
3937
|
+
name: "parent_record_id",
|
|
3938
|
+
required: false,
|
|
3939
|
+
type: "string"
|
|
3940
|
+
}
|
|
3941
|
+
]
|
|
3942
|
+
}),
|
|
3943
|
+
"create-a-note": operation({
|
|
3944
|
+
body: "required",
|
|
3945
|
+
call: postV2Notes,
|
|
3946
|
+
description: "Create a note",
|
|
3947
|
+
options: []
|
|
3948
|
+
}),
|
|
3949
|
+
"delete-a-note": operation({
|
|
3950
|
+
body: "none",
|
|
3951
|
+
call: deleteV2NotesByNoteId,
|
|
3952
|
+
description: "Delete a note",
|
|
3953
|
+
options: [{
|
|
3954
|
+
description: "A UUID which identifies the note to delete.",
|
|
3955
|
+
in: "path",
|
|
3956
|
+
name: "note_id",
|
|
3957
|
+
required: true,
|
|
3958
|
+
type: "string"
|
|
3959
|
+
}]
|
|
3960
|
+
}),
|
|
3961
|
+
"get-a-note": operation({
|
|
3962
|
+
body: "none",
|
|
3963
|
+
call: getV2NotesByNoteId,
|
|
3964
|
+
description: "Get a note",
|
|
3965
|
+
options: [{
|
|
3966
|
+
description: "A UUID which identifies the note.",
|
|
3967
|
+
in: "path",
|
|
3968
|
+
name: "note_id",
|
|
3969
|
+
required: true,
|
|
3970
|
+
type: "string"
|
|
3971
|
+
}]
|
|
3972
|
+
}),
|
|
3973
|
+
"update-a-note": operation({
|
|
3974
|
+
body: "required",
|
|
3975
|
+
call: patchV2NotesByNoteId,
|
|
3976
|
+
description: "Update a note",
|
|
3977
|
+
options: [{
|
|
3978
|
+
description: "A UUID which identifies the note to update.",
|
|
3979
|
+
in: "path",
|
|
3980
|
+
name: "note_id",
|
|
3981
|
+
required: true,
|
|
3982
|
+
type: "string"
|
|
3983
|
+
}]
|
|
3984
|
+
})
|
|
3985
|
+
},
|
|
3986
|
+
description: "Notes are rich text documents that reference a single parent record."
|
|
3987
|
+
},
|
|
3988
|
+
tasks: {
|
|
3989
|
+
commands: {
|
|
3990
|
+
"list-tasks": operation({
|
|
3991
|
+
body: "none",
|
|
3992
|
+
call: getV2Tasks,
|
|
3993
|
+
description: "List tasks",
|
|
3994
|
+
options: [
|
|
3995
|
+
{
|
|
3996
|
+
description: "The maximum number of results to return. Defaults to 500. See the [full guide to pagination here](/rest-api/guides/pagination).",
|
|
3997
|
+
in: "query",
|
|
3998
|
+
name: "limit",
|
|
3999
|
+
required: false,
|
|
4000
|
+
type: "integer"
|
|
4001
|
+
},
|
|
4002
|
+
{
|
|
4003
|
+
description: "The number of results to skip over before returning. Defaults to 0. See the [full guide to pagination here](/rest-api/guides/pagination).",
|
|
4004
|
+
in: "query",
|
|
4005
|
+
name: "offset",
|
|
4006
|
+
required: false,
|
|
4007
|
+
type: "integer"
|
|
4008
|
+
},
|
|
4009
|
+
{
|
|
4010
|
+
description: "Optionally sort the results. \"created_at:asc\" returns oldest results first, \"created_at:desc\" returns the newest results first. \"completed_at:asc\" and \"completed_at:desc\" sort by completion time. With \"completed_at:asc\", incomplete tasks (no completion date) appear first, followed by completed tasks oldest-first. With \"completed_at:desc\", completed tasks appear first (newest-first), followed by incomplete tasks. To exclude incomplete tasks, filter by is_completed. If unspecified, defaults to \"created_at:asc\" (oldest results first).",
|
|
4011
|
+
in: "query",
|
|
4012
|
+
name: "sort",
|
|
4013
|
+
required: false,
|
|
4014
|
+
type: "string"
|
|
4015
|
+
},
|
|
4016
|
+
{
|
|
4017
|
+
description: "Pass a value to this parameter to filter results to only those tasks that contain the specified record in the `linked_records` property of the task. This parameter should identify the object that the linked record belongs to. For example, if filtering to tasks that link to a specific person record, this parameter should be `people`. If provided, `linked_record_id` must also be provided.",
|
|
4018
|
+
in: "query",
|
|
4019
|
+
name: "linked_object",
|
|
4020
|
+
required: false,
|
|
4021
|
+
type: "string"
|
|
4022
|
+
},
|
|
4023
|
+
{
|
|
4024
|
+
description: "Pass a value to this parameter to filter results to only those tasks that contain the specified record in the `linked_records` property of the task. This parameter should contain the record ID of the linked record. If provided, `linked_object` must also be provided.",
|
|
4025
|
+
in: "query",
|
|
4026
|
+
name: "linked_record_id",
|
|
4027
|
+
required: false,
|
|
4028
|
+
type: "string"
|
|
4029
|
+
},
|
|
4030
|
+
{
|
|
4031
|
+
description: "Filter tasks by workspace member assignees. Workspace members can be referenced by either their email address or ID. Pass an empty value or the string `null` to find tasks with no assignee.",
|
|
4032
|
+
in: "query",
|
|
4033
|
+
name: "assignee",
|
|
4034
|
+
required: false,
|
|
4035
|
+
type: "string"
|
|
4036
|
+
},
|
|
4037
|
+
{
|
|
4038
|
+
description: "Filter tasks by whether they have been completed. By default, both completed and non-completed tasks are returned. Specify `true` to only return completed tasks, or `false` to only return non-completed tasks.",
|
|
4039
|
+
in: "query",
|
|
4040
|
+
name: "is_completed",
|
|
4041
|
+
required: false,
|
|
4042
|
+
type: "boolean"
|
|
4043
|
+
}
|
|
4044
|
+
]
|
|
4045
|
+
}),
|
|
4046
|
+
"create-a-task": operation({
|
|
4047
|
+
body: "required",
|
|
4048
|
+
call: postV2Tasks,
|
|
4049
|
+
description: "Create a task",
|
|
4050
|
+
options: []
|
|
4051
|
+
}),
|
|
4052
|
+
"delete-a-task": operation({
|
|
4053
|
+
body: "none",
|
|
4054
|
+
call: deleteV2TasksByTaskId,
|
|
4055
|
+
description: "Delete a task",
|
|
4056
|
+
options: [{
|
|
4057
|
+
description: "The ID of the task to delete.",
|
|
4058
|
+
in: "path",
|
|
4059
|
+
name: "task_id",
|
|
4060
|
+
required: true,
|
|
4061
|
+
type: "string"
|
|
4062
|
+
}]
|
|
4063
|
+
}),
|
|
4064
|
+
"get-a-task": operation({
|
|
4065
|
+
body: "none",
|
|
4066
|
+
call: getV2TasksByTaskId,
|
|
4067
|
+
description: "Get a task",
|
|
4068
|
+
options: [{
|
|
4069
|
+
description: "The ID of the task.",
|
|
4070
|
+
in: "path",
|
|
4071
|
+
name: "task_id",
|
|
4072
|
+
required: true,
|
|
4073
|
+
type: "string"
|
|
4074
|
+
}]
|
|
4075
|
+
}),
|
|
4076
|
+
"update-a-task": operation({
|
|
4077
|
+
body: "required",
|
|
4078
|
+
call: patchV2TasksByTaskId,
|
|
4079
|
+
description: "Update a task",
|
|
4080
|
+
options: [{
|
|
4081
|
+
description: "The ID of the task to update.",
|
|
4082
|
+
in: "path",
|
|
4083
|
+
name: "task_id",
|
|
4084
|
+
required: true,
|
|
4085
|
+
type: "string"
|
|
4086
|
+
}]
|
|
4087
|
+
})
|
|
4088
|
+
},
|
|
4089
|
+
description: "A task is a defined, actionable item with references to linked records and assigned workspace members."
|
|
4090
|
+
},
|
|
4091
|
+
threads: {
|
|
4092
|
+
commands: {
|
|
4093
|
+
"list-threads": operation({
|
|
4094
|
+
body: "none",
|
|
4095
|
+
call: getV2Threads,
|
|
4096
|
+
description: "List threads",
|
|
4097
|
+
options: [
|
|
4098
|
+
{
|
|
4099
|
+
description: "Use this parameter to filter to threads on a specific record. Must be passed with `object`.",
|
|
4100
|
+
in: "query",
|
|
4101
|
+
name: "record_id",
|
|
4102
|
+
required: false,
|
|
4103
|
+
type: "string"
|
|
4104
|
+
},
|
|
4105
|
+
{
|
|
4106
|
+
description: "Use this parameter to filter to threads on a specific record. Must be passed with `record_id`. Accepts either a slug or an ID.",
|
|
4107
|
+
in: "query",
|
|
4108
|
+
name: "object",
|
|
4109
|
+
required: false,
|
|
4110
|
+
type: "string"
|
|
4111
|
+
},
|
|
4112
|
+
{
|
|
4113
|
+
description: "Use this parameter to filter to threads on a specific entry. Must be passed with `list`.",
|
|
4114
|
+
in: "query",
|
|
4115
|
+
name: "entry_id",
|
|
4116
|
+
required: false,
|
|
4117
|
+
type: "string"
|
|
4118
|
+
},
|
|
4119
|
+
{
|
|
4120
|
+
description: "Use this parameter to filter to threads on a specific entry. Must be passed with `entry_id`. Accepts either a slug or an ID.",
|
|
4121
|
+
in: "query",
|
|
4122
|
+
name: "list",
|
|
4123
|
+
required: false,
|
|
4124
|
+
type: "string"
|
|
4125
|
+
},
|
|
4126
|
+
{
|
|
4127
|
+
description: "The maximum number of results to return. The default is `10` and the maximum is `50`. See the [full guide to pagination here](/rest-api/guides/pagination).",
|
|
4128
|
+
in: "query",
|
|
4129
|
+
name: "limit",
|
|
4130
|
+
required: false,
|
|
4131
|
+
type: "integer"
|
|
4132
|
+
},
|
|
4133
|
+
{
|
|
4134
|
+
description: "The number of results to skip over before returning. The default is `0`. See the [full guide to pagination here](/rest-api/guides/pagination).",
|
|
4135
|
+
in: "query",
|
|
4136
|
+
name: "offset",
|
|
4137
|
+
required: false,
|
|
4138
|
+
type: "integer"
|
|
4139
|
+
}
|
|
4140
|
+
]
|
|
4141
|
+
}),
|
|
4142
|
+
"get-a-thread-and-its-comments": operation({
|
|
4143
|
+
body: "none",
|
|
4144
|
+
call: getV2ThreadsByThreadId,
|
|
4145
|
+
description: "Get a thread and its comments",
|
|
4146
|
+
options: [
|
|
4147
|
+
{
|
|
4148
|
+
description: "A UUID which identifies the thread.",
|
|
4149
|
+
in: "path",
|
|
4150
|
+
name: "thread_id",
|
|
4151
|
+
required: true,
|
|
4152
|
+
type: "string"
|
|
4153
|
+
},
|
|
4154
|
+
{
|
|
4155
|
+
description: "The maximum number of comments to return. Defaults to `250`, which is also the maximum.",
|
|
4156
|
+
in: "query",
|
|
4157
|
+
name: "limit",
|
|
4158
|
+
required: false,
|
|
4159
|
+
type: "integer"
|
|
4160
|
+
},
|
|
4161
|
+
{
|
|
4162
|
+
description: "A cursor for pagination. Use the `next_cursor` from the previous response to get the next page of comments.",
|
|
4163
|
+
in: "query",
|
|
4164
|
+
name: "cursor",
|
|
4165
|
+
required: false,
|
|
4166
|
+
type: "string"
|
|
4167
|
+
},
|
|
4168
|
+
{
|
|
4169
|
+
description: "Only return comments created after this timestamp.",
|
|
4170
|
+
in: "query",
|
|
4171
|
+
name: "created_after",
|
|
4172
|
+
required: false,
|
|
4173
|
+
type: "string"
|
|
4174
|
+
}
|
|
4175
|
+
]
|
|
4176
|
+
})
|
|
4177
|
+
},
|
|
4178
|
+
description: "Threads are groups of comments on either a record or entry."
|
|
4179
|
+
},
|
|
4180
|
+
comments: {
|
|
4181
|
+
commands: {
|
|
4182
|
+
"create-a-comment": operation({
|
|
4183
|
+
body: "required",
|
|
4184
|
+
call: postV2Comments,
|
|
4185
|
+
description: "Create a comment",
|
|
4186
|
+
options: []
|
|
4187
|
+
}),
|
|
4188
|
+
"delete-a-comment": operation({
|
|
4189
|
+
body: "none",
|
|
4190
|
+
call: deleteV2CommentsByCommentId,
|
|
4191
|
+
description: "Delete a comment",
|
|
4192
|
+
options: [{
|
|
4193
|
+
description: "The ID of the comment to delete.",
|
|
4194
|
+
in: "path",
|
|
4195
|
+
name: "comment_id",
|
|
4196
|
+
required: true,
|
|
4197
|
+
type: "string"
|
|
4198
|
+
}]
|
|
4199
|
+
}),
|
|
4200
|
+
"get-a-comment": operation({
|
|
4201
|
+
body: "none",
|
|
4202
|
+
call: getV2CommentsByCommentId,
|
|
4203
|
+
description: "Get a comment",
|
|
4204
|
+
options: [{
|
|
4205
|
+
description: "A UUID which identifies the comment.",
|
|
4206
|
+
in: "path",
|
|
4207
|
+
name: "comment_id",
|
|
4208
|
+
required: true,
|
|
4209
|
+
type: "string"
|
|
4210
|
+
}]
|
|
4211
|
+
})
|
|
4212
|
+
},
|
|
4213
|
+
description: "Comments are messages on a thread."
|
|
4214
|
+
},
|
|
4215
|
+
emails: {
|
|
4216
|
+
commands: { "list-emails": operation({
|
|
4217
|
+
body: "none",
|
|
4218
|
+
call: getV2Emails,
|
|
4219
|
+
description: "List emails",
|
|
4220
|
+
options: [
|
|
4221
|
+
{
|
|
4222
|
+
description: "The maximum number of emails to return. Must be between 1 and 50. Defaults to 25.",
|
|
4223
|
+
in: "query",
|
|
4224
|
+
name: "limit",
|
|
4225
|
+
required: false,
|
|
4226
|
+
type: "integer"
|
|
4227
|
+
},
|
|
4228
|
+
{
|
|
4229
|
+
description: "A pagination cursor used to fetch the next page of emails. Responses with more emails will include a cursor for you to use here. If not provided, the first page will be returned.",
|
|
4230
|
+
in: "query",
|
|
4231
|
+
name: "cursor",
|
|
4232
|
+
required: false,
|
|
4233
|
+
type: "string"
|
|
4234
|
+
},
|
|
4235
|
+
{
|
|
4236
|
+
description: "The object to filter emails by. Must be the slug or ID of either the people or companies object. If provided, linked_record_ids must also be provided.",
|
|
4237
|
+
in: "query",
|
|
4238
|
+
name: "linked_object",
|
|
4239
|
+
required: false,
|
|
4240
|
+
type: "string"
|
|
4241
|
+
},
|
|
4242
|
+
{
|
|
4243
|
+
description: "A comma-separated list of up to 10 record IDs to filter emails by. All IDs must belong to the object given in `linked_object`, so filtering by both people and companies requires two requests. If provided, linked_object must also be provided.",
|
|
4244
|
+
in: "query",
|
|
4245
|
+
name: "linked_record_ids",
|
|
4246
|
+
required: false,
|
|
4247
|
+
type: "string"
|
|
4248
|
+
},
|
|
4249
|
+
{
|
|
4250
|
+
description: "A comma-separated list of up to 10 email addresses. Emails that include at least one of them as a participant are returned.",
|
|
4251
|
+
in: "query",
|
|
4252
|
+
name: "participants",
|
|
4253
|
+
required: false,
|
|
4254
|
+
type: "string"
|
|
4255
|
+
},
|
|
4256
|
+
{
|
|
4257
|
+
description: "A domain to filter emails by. Emails with at least one participant at this domain are returned.",
|
|
4258
|
+
in: "query",
|
|
4259
|
+
name: "domain",
|
|
4260
|
+
required: false,
|
|
4261
|
+
type: "string"
|
|
4262
|
+
},
|
|
4263
|
+
{
|
|
4264
|
+
description: "Only return emails sent after this timestamp. `sent_after` is exclusive, so an email sent at exactly this timestamp is not returned.",
|
|
4265
|
+
in: "query",
|
|
4266
|
+
name: "sent_after",
|
|
4267
|
+
required: false,
|
|
4268
|
+
type: "string"
|
|
4269
|
+
},
|
|
4270
|
+
{
|
|
4271
|
+
description: "Only return emails sent before this timestamp. `sent_before` is exclusive, so an email sent at exactly this timestamp is not returned.",
|
|
4272
|
+
in: "query",
|
|
4273
|
+
name: "sent_before",
|
|
4274
|
+
required: false,
|
|
4275
|
+
type: "string"
|
|
4276
|
+
},
|
|
4277
|
+
{
|
|
4278
|
+
description: "If `true`, an email is only returned when at least one participant outside your workspace looks like a person rather than an automated sender (`notifications@`, `no-reply@`, meeting notetakers, …). Defaults to `false`, which returns every email regardless of who sent it.",
|
|
4279
|
+
in: "query",
|
|
4280
|
+
name: "exclude_automated_participants",
|
|
4281
|
+
required: false,
|
|
4282
|
+
type: "boolean"
|
|
4283
|
+
}
|
|
4284
|
+
]
|
|
4285
|
+
}) },
|
|
4286
|
+
description: "Emails are messages synced from connected mailboxes."
|
|
4287
|
+
},
|
|
4288
|
+
sequences: {
|
|
4289
|
+
commands: { "add-emails-to-the-unsubscribe-list": operation({
|
|
4290
|
+
body: "required",
|
|
4291
|
+
call: postV2SequencesUnsubscribedEmails,
|
|
4292
|
+
description: "Add emails to the unsubscribe list",
|
|
4293
|
+
options: []
|
|
4294
|
+
}) },
|
|
4295
|
+
description: "Sequences are automated email campaigns sent from Attio."
|
|
4296
|
+
},
|
|
4297
|
+
meetings: {
|
|
4298
|
+
commands: {
|
|
4299
|
+
"list-meetings": operation({
|
|
4300
|
+
body: "none",
|
|
4301
|
+
call: getV2Meetings,
|
|
4302
|
+
description: "List meetings",
|
|
4303
|
+
options: [
|
|
4304
|
+
{
|
|
4305
|
+
description: "The maximum number of meetings to return. Must be between 1 and 200. Defaults to 50.",
|
|
4306
|
+
in: "query",
|
|
4307
|
+
name: "limit",
|
|
4308
|
+
required: false,
|
|
4309
|
+
type: "integer"
|
|
4310
|
+
},
|
|
4311
|
+
{
|
|
4312
|
+
description: "A pagination cursor used to fetch the next page of meetings. Responses with more meetings will include a cursor for you to use here. If not provided, the first page will be returned.",
|
|
4313
|
+
in: "query",
|
|
4314
|
+
name: "cursor",
|
|
4315
|
+
required: false,
|
|
4316
|
+
type: "string"
|
|
4317
|
+
},
|
|
4318
|
+
{
|
|
4319
|
+
description: "The object to filter meetings by. Must be a valid object slug or ID. If provided, linked_record_id must also be provided.",
|
|
4320
|
+
in: "query",
|
|
4321
|
+
name: "linked_object",
|
|
4322
|
+
required: false,
|
|
4323
|
+
type: "string"
|
|
4324
|
+
},
|
|
4325
|
+
{
|
|
4326
|
+
description: "Used to filter meetings to only those values that include a specific linked record. Must be a valid record ID. If provided, linked_object must also be provided. When combined with `participants`, the filters are combined with OR: meetings matching either filter are returned.",
|
|
4327
|
+
in: "query",
|
|
4328
|
+
name: "linked_record_id",
|
|
4329
|
+
required: false,
|
|
4330
|
+
type: "string"
|
|
4331
|
+
},
|
|
4332
|
+
{
|
|
4333
|
+
description: "A comma-separated list of emails to filter meetings by. If provided, meetings will be filtered to only include meetings that include at least one of the provided emails as participants. When combined with `linked_record_id`, the filters are combined with OR: meetings matching either filter are returned.",
|
|
4334
|
+
in: "query",
|
|
4335
|
+
name: "participants",
|
|
4336
|
+
required: false,
|
|
4337
|
+
type: "string"
|
|
4338
|
+
},
|
|
4339
|
+
{
|
|
4340
|
+
description: "The order in which to sort the meetings. Defaults to start_asc.",
|
|
4341
|
+
in: "query",
|
|
4342
|
+
name: "sort",
|
|
4343
|
+
required: false,
|
|
4344
|
+
type: "string"
|
|
4345
|
+
},
|
|
4346
|
+
{
|
|
4347
|
+
description: "Use `ends_from` to filter meetings to only those that end after the specified timestamp. `ends_from` is inclusive, meaning that meetings that end at the exact timestamp will be included in results. When evaluating all-day meetings, we filter results from the perspective of a specific timezone (see `timezone` for more information).",
|
|
4348
|
+
in: "query",
|
|
4349
|
+
name: "ends_from",
|
|
4350
|
+
required: false,
|
|
4351
|
+
type: "string"
|
|
4352
|
+
},
|
|
4353
|
+
{
|
|
4354
|
+
description: "Use `starts_before` to filter meetings to only those that start before the specified timestamp. `starts_before` is exclusive, meaning that meetings that start at the exact timestamp will not be included in results. When evaluating all-day meetings, we filter results from the perspective of a specific timezone (see `timezone` for more information).",
|
|
4355
|
+
in: "query",
|
|
4356
|
+
name: "starts_before",
|
|
4357
|
+
required: false,
|
|
4358
|
+
type: "string"
|
|
4359
|
+
},
|
|
4360
|
+
{
|
|
4361
|
+
description: "The timezone to use when filtering meetings using `ends_from` and `starts_before`. Defaults to UTC. This property has no effect for non-all-day meetings.",
|
|
4362
|
+
in: "query",
|
|
4363
|
+
name: "timezone",
|
|
4364
|
+
required: false,
|
|
4365
|
+
type: "string"
|
|
4366
|
+
}
|
|
4367
|
+
]
|
|
4368
|
+
}),
|
|
4369
|
+
"create-a-meeting": operation({
|
|
4370
|
+
body: "required",
|
|
4371
|
+
call: postV2Meetings,
|
|
4372
|
+
description: "Create a meeting",
|
|
4373
|
+
options: []
|
|
4374
|
+
}),
|
|
4375
|
+
"delete-a-meeting": operation({
|
|
4376
|
+
body: "none",
|
|
4377
|
+
call: deleteV2MeetingsByMeetingId,
|
|
4378
|
+
description: "Delete a meeting",
|
|
4379
|
+
options: [{
|
|
4380
|
+
description: "A UUID which identifies the meeting to delete.",
|
|
4381
|
+
in: "path",
|
|
4382
|
+
name: "meeting_id",
|
|
4383
|
+
required: true,
|
|
4384
|
+
type: "string"
|
|
4385
|
+
}]
|
|
4386
|
+
}),
|
|
4387
|
+
"get-a-meeting": operation({
|
|
4388
|
+
body: "none",
|
|
4389
|
+
call: getV2MeetingsByMeetingId,
|
|
4390
|
+
description: "Get a meeting",
|
|
4391
|
+
options: [{
|
|
4392
|
+
description: "A UUID which identifies the meeting.",
|
|
4393
|
+
in: "path",
|
|
4394
|
+
name: "meeting_id",
|
|
4395
|
+
required: true,
|
|
4396
|
+
type: "string"
|
|
4397
|
+
}]
|
|
4398
|
+
}),
|
|
4399
|
+
"update-a-meeting-append-linked-records": operation({
|
|
4400
|
+
body: "required",
|
|
4401
|
+
call: patchV2MeetingsByMeetingId,
|
|
4402
|
+
description: "Update a meeting (append linked records)",
|
|
4403
|
+
options: [{
|
|
4404
|
+
description: "A UUID which identifies the meeting to update.",
|
|
4405
|
+
in: "path",
|
|
4406
|
+
name: "meeting_id",
|
|
4407
|
+
required: true,
|
|
4408
|
+
type: "string"
|
|
4409
|
+
}]
|
|
4410
|
+
}),
|
|
4411
|
+
"update-a-meeting-overwrite-linked-records": operation({
|
|
4412
|
+
body: "required",
|
|
4413
|
+
call: putV2MeetingsByMeetingId,
|
|
4414
|
+
description: "Update a meeting (overwrite linked records)",
|
|
4415
|
+
options: [{
|
|
4416
|
+
description: "A UUID which identifies the meeting to update.",
|
|
4417
|
+
in: "path",
|
|
4418
|
+
name: "meeting_id",
|
|
4419
|
+
required: true,
|
|
4420
|
+
type: "string"
|
|
4421
|
+
}]
|
|
4422
|
+
})
|
|
4423
|
+
},
|
|
4424
|
+
description: "Meetings are events synced from your calendar, added manually or added from third-party integrations."
|
|
4425
|
+
},
|
|
4426
|
+
"call-recordings": {
|
|
4427
|
+
commands: {
|
|
4428
|
+
"list-call-recordings": operation({
|
|
4429
|
+
body: "none",
|
|
4430
|
+
call: getV2MeetingsByMeetingIdCallRecordings,
|
|
4431
|
+
description: "List call recordings",
|
|
4432
|
+
options: [
|
|
4433
|
+
{
|
|
4434
|
+
description: "The ID of the meeting to list call recordings for.",
|
|
4435
|
+
in: "path",
|
|
4436
|
+
name: "meeting_id",
|
|
4437
|
+
required: true,
|
|
4438
|
+
type: "string"
|
|
4439
|
+
},
|
|
4440
|
+
{
|
|
4441
|
+
description: "The maximum number of results to return. Defaults to 50 with a maximum of 200.",
|
|
4442
|
+
in: "query",
|
|
4443
|
+
name: "limit",
|
|
4444
|
+
required: false,
|
|
4445
|
+
type: "integer"
|
|
4446
|
+
},
|
|
4447
|
+
{
|
|
4448
|
+
description: "A cursor for pagination. Use the `next_cursor` from the previous response to get the next page of results.",
|
|
4449
|
+
in: "query",
|
|
4450
|
+
name: "cursor",
|
|
4451
|
+
required: false,
|
|
4452
|
+
type: "string"
|
|
4453
|
+
}
|
|
4454
|
+
]
|
|
4455
|
+
}),
|
|
4456
|
+
"create-call-recording": operation({
|
|
4457
|
+
body: "required",
|
|
4458
|
+
call: postV2MeetingsByMeetingIdCallRecordings,
|
|
4459
|
+
description: "Create call recording",
|
|
4460
|
+
options: [{
|
|
4461
|
+
description: "The ID of the meeting this recording belongs to.",
|
|
4462
|
+
in: "path",
|
|
4463
|
+
name: "meeting_id",
|
|
4464
|
+
required: true,
|
|
4465
|
+
type: "string"
|
|
4466
|
+
}]
|
|
4467
|
+
}),
|
|
4468
|
+
"delete-call-recording": operation({
|
|
4469
|
+
body: "none",
|
|
4470
|
+
call: deleteV2MeetingsByMeetingIdCallRecordingsByCallRecordingId,
|
|
4471
|
+
description: "Delete call recording",
|
|
4472
|
+
options: [{
|
|
4473
|
+
description: "The ID of the meeting this call recording belongs to.",
|
|
4474
|
+
in: "path",
|
|
4475
|
+
name: "meeting_id",
|
|
4476
|
+
required: true,
|
|
4477
|
+
type: "string"
|
|
4478
|
+
}, {
|
|
4479
|
+
description: "The ID of the call recording to delete.",
|
|
4480
|
+
in: "path",
|
|
4481
|
+
name: "call_recording_id",
|
|
4482
|
+
required: true,
|
|
4483
|
+
type: "string"
|
|
4484
|
+
}]
|
|
4485
|
+
}),
|
|
4486
|
+
"get-call-recording": operation({
|
|
4487
|
+
body: "none",
|
|
4488
|
+
call: getV2MeetingsByMeetingIdCallRecordingsByCallRecordingId,
|
|
4489
|
+
description: "Get call recording",
|
|
4490
|
+
options: [{
|
|
4491
|
+
description: "The ID of the meeting this recording belongs to.",
|
|
4492
|
+
in: "path",
|
|
4493
|
+
name: "meeting_id",
|
|
4494
|
+
required: true,
|
|
4495
|
+
type: "string"
|
|
4496
|
+
}, {
|
|
4497
|
+
description: "The ID of the call recording to retrieve.",
|
|
4498
|
+
in: "path",
|
|
4499
|
+
name: "call_recording_id",
|
|
4500
|
+
required: true,
|
|
4501
|
+
type: "string"
|
|
4502
|
+
}]
|
|
4503
|
+
})
|
|
4504
|
+
},
|
|
4505
|
+
description: "Call recordings store video, audio, transcript and speaker information for calls."
|
|
4506
|
+
},
|
|
4507
|
+
transcripts: {
|
|
4508
|
+
commands: { "deprecated-get-call-transcript": operation({
|
|
4509
|
+
body: "none",
|
|
4510
|
+
call: getV2MeetingsByMeetingIdCallRecordingsByCallRecordingIdTranscript,
|
|
4511
|
+
description: "Deprecated: Get call transcript",
|
|
4512
|
+
options: [
|
|
4513
|
+
{
|
|
4514
|
+
description: "The ID of the meeting.",
|
|
4515
|
+
in: "path",
|
|
4516
|
+
name: "meeting_id",
|
|
4517
|
+
required: true,
|
|
4518
|
+
type: "string"
|
|
4519
|
+
},
|
|
4520
|
+
{
|
|
4521
|
+
description: "The ID of the call recording to get the transcript for.",
|
|
4522
|
+
in: "path",
|
|
4523
|
+
name: "call_recording_id",
|
|
4524
|
+
required: true,
|
|
4525
|
+
type: "string"
|
|
4526
|
+
},
|
|
4527
|
+
{
|
|
4528
|
+
description: "A cursor for pagination through transcript segments. Use the `next_cursor` from the previous response to get the next page of speech segments within this transcript.",
|
|
4529
|
+
in: "query",
|
|
4530
|
+
name: "cursor",
|
|
4531
|
+
required: false,
|
|
4532
|
+
type: "string"
|
|
4533
|
+
}
|
|
4534
|
+
]
|
|
4535
|
+
}) },
|
|
4536
|
+
description: "Transcripts contain the speech segments and speaker information for a call recording."
|
|
4537
|
+
},
|
|
4538
|
+
files: {
|
|
4539
|
+
commands: {
|
|
4540
|
+
"list-files": operation({
|
|
4541
|
+
body: "none",
|
|
4542
|
+
call: getV2Files,
|
|
4543
|
+
description: "List files",
|
|
4544
|
+
options: [
|
|
4545
|
+
{
|
|
4546
|
+
description: "The object slug or ID.",
|
|
4547
|
+
in: "query",
|
|
4548
|
+
name: "object",
|
|
4549
|
+
required: true,
|
|
4550
|
+
type: "string"
|
|
4551
|
+
},
|
|
4552
|
+
{
|
|
4553
|
+
description: "The record ID for the specific record whose files you want to list.",
|
|
4554
|
+
in: "query",
|
|
4555
|
+
name: "record_id",
|
|
4556
|
+
required: true,
|
|
4557
|
+
type: "string"
|
|
4558
|
+
},
|
|
4559
|
+
{
|
|
4560
|
+
description: "Filter results by storage provider.",
|
|
4561
|
+
in: "query",
|
|
4562
|
+
name: "storage_provider",
|
|
4563
|
+
required: false,
|
|
4564
|
+
type: "string"
|
|
4565
|
+
},
|
|
4566
|
+
{
|
|
4567
|
+
description: "Filter by parent folder ID. Each file entry has provided optioanl parent_folder_id that can be used to filter results by folder. When omitted, entries at all nesting levels are returned.",
|
|
4568
|
+
in: "query",
|
|
4569
|
+
name: "parent_folder_id",
|
|
4570
|
+
required: false,
|
|
4571
|
+
type: "string"
|
|
4572
|
+
},
|
|
4573
|
+
{
|
|
4574
|
+
description: "The maximum number of files to return. Must be between 1 and 200. Defaults to 50.",
|
|
4575
|
+
in: "query",
|
|
4576
|
+
name: "limit",
|
|
4577
|
+
required: false,
|
|
4578
|
+
type: "integer"
|
|
4579
|
+
},
|
|
4580
|
+
{
|
|
4581
|
+
description: "A pagination cursor used to fetch the next page of files. Responses with more files will include a cursor for you to use here. If not provided, the first page will be returned.",
|
|
4582
|
+
in: "query",
|
|
4583
|
+
name: "cursor",
|
|
4584
|
+
required: false,
|
|
4585
|
+
type: "string"
|
|
4586
|
+
}
|
|
4587
|
+
]
|
|
4588
|
+
}),
|
|
4589
|
+
"create-a-folder": operation({
|
|
4590
|
+
body: "required",
|
|
4591
|
+
call: postV2Files,
|
|
4592
|
+
description: "Create a folder",
|
|
4593
|
+
options: []
|
|
4594
|
+
}),
|
|
4595
|
+
"delete-a-file": operation({
|
|
4596
|
+
body: "none",
|
|
4597
|
+
call: deleteV2FilesByFileId,
|
|
4598
|
+
description: "Delete a file",
|
|
4599
|
+
options: [{
|
|
4600
|
+
description: "A UUID which identifies the file to delete.",
|
|
4601
|
+
in: "path",
|
|
4602
|
+
name: "file_id",
|
|
4603
|
+
required: true,
|
|
4604
|
+
type: "string"
|
|
4605
|
+
}]
|
|
4606
|
+
}),
|
|
4607
|
+
"get-a-file": operation({
|
|
4608
|
+
body: "none",
|
|
4609
|
+
call: getV2FilesByFileId,
|
|
4610
|
+
description: "Get a file",
|
|
4611
|
+
options: [{
|
|
4612
|
+
description: "A UUID which identifies the file entry.",
|
|
4613
|
+
in: "path",
|
|
4614
|
+
name: "file_id",
|
|
4615
|
+
required: true,
|
|
4616
|
+
type: "string"
|
|
4617
|
+
}]
|
|
4618
|
+
})
|
|
4619
|
+
},
|
|
4620
|
+
description: "Files are documents and folders linked to records, stored either in Attio or connected via external storage providers."
|
|
4621
|
+
},
|
|
4622
|
+
webhooks: {
|
|
4623
|
+
commands: {
|
|
4624
|
+
"list-webhooks": operation({
|
|
4625
|
+
body: "none",
|
|
4626
|
+
call: getV2Webhooks,
|
|
4627
|
+
description: "List webhooks",
|
|
4628
|
+
options: [{
|
|
4629
|
+
description: "The maximum number of results to return, between 10 and 100, defaults to 10. See the [full guide to pagination here](/rest-api/guides/pagination).",
|
|
4630
|
+
in: "query",
|
|
4631
|
+
name: "limit",
|
|
4632
|
+
required: false,
|
|
4633
|
+
type: "integer"
|
|
4634
|
+
}, {
|
|
4635
|
+
description: "The number of results to skip over before returning, defaults to 0. See the [full guide to pagination here](/rest-api/guides/pagination).",
|
|
4636
|
+
in: "query",
|
|
4637
|
+
name: "offset",
|
|
4638
|
+
required: false,
|
|
4639
|
+
type: "integer"
|
|
4640
|
+
}]
|
|
4641
|
+
}),
|
|
4642
|
+
"create-a-webhook": operation({
|
|
4643
|
+
body: "required",
|
|
4644
|
+
call: postV2Webhooks,
|
|
4645
|
+
description: "Create a webhook",
|
|
4646
|
+
options: []
|
|
4647
|
+
}),
|
|
4648
|
+
"delete-a-webhook": operation({
|
|
4649
|
+
body: "none",
|
|
4650
|
+
call: deleteV2WebhooksByWebhookId,
|
|
4651
|
+
description: "Delete a webhook",
|
|
4652
|
+
options: [{
|
|
4653
|
+
description: "A UUID identifying the webhook to delete.",
|
|
4654
|
+
in: "path",
|
|
4655
|
+
name: "webhook_id",
|
|
4656
|
+
required: true,
|
|
4657
|
+
type: "string"
|
|
4658
|
+
}]
|
|
4659
|
+
}),
|
|
4660
|
+
"get-a-webhook": operation({
|
|
4661
|
+
body: "none",
|
|
4662
|
+
call: getV2WebhooksByWebhookId,
|
|
4663
|
+
description: "Get a webhook",
|
|
4664
|
+
options: [{
|
|
4665
|
+
description: "A UUID which identifies the webhook.",
|
|
4666
|
+
in: "path",
|
|
4667
|
+
name: "webhook_id",
|
|
4668
|
+
required: true,
|
|
4669
|
+
type: "string"
|
|
4670
|
+
}]
|
|
4671
|
+
}),
|
|
4672
|
+
"update-a-webhook": operation({
|
|
4673
|
+
body: "required",
|
|
4674
|
+
call: patchV2WebhooksByWebhookId,
|
|
4675
|
+
description: "Update a webhook",
|
|
4676
|
+
options: [{
|
|
4677
|
+
description: "A UUID which identifies the webhook.",
|
|
4678
|
+
in: "path",
|
|
4679
|
+
name: "webhook_id",
|
|
4680
|
+
required: true,
|
|
4681
|
+
type: "string"
|
|
4682
|
+
}]
|
|
4683
|
+
})
|
|
4684
|
+
},
|
|
4685
|
+
description: "Webhooks allow you to listen for changes to data in Attio, for example when a record is updated."
|
|
4686
|
+
},
|
|
4687
|
+
meta: {
|
|
4688
|
+
commands: { identify: operation({
|
|
4689
|
+
body: "none",
|
|
4690
|
+
call: getV2Self,
|
|
4691
|
+
description: "Identify",
|
|
4692
|
+
options: []
|
|
4693
|
+
}) },
|
|
4694
|
+
description: "Meta endpoints are used to get information about the API token."
|
|
4695
|
+
}
|
|
4696
|
+
};
|
|
4697
|
+
//#endregion
|
|
4698
|
+
//#region src/cli.ts
|
|
4699
|
+
const rootCommand = define({
|
|
4700
|
+
name: "attio-api",
|
|
4701
|
+
description: "Agent-friendly access to the Attio API",
|
|
4702
|
+
run: () => "Run \"attio --help\" for usage information."
|
|
4703
|
+
});
|
|
4704
|
+
/** One command per group of operations, with the group's operations beneath it. */
|
|
4705
|
+
function commandTree(env) {
|
|
4706
|
+
const tree = {};
|
|
4707
|
+
for (const [group, { commands, description }] of Object.entries(groups)) {
|
|
4708
|
+
const subCommands = {};
|
|
4709
|
+
for (const [name, source] of Object.entries(commands)) subCommands[name] = operationCommand(name, source, env);
|
|
4710
|
+
tree[group] = define({
|
|
4711
|
+
name: group,
|
|
4712
|
+
description,
|
|
4713
|
+
run: () => `Run "attio-api ${group} --help" for usage information.`,
|
|
4714
|
+
subCommands
|
|
4715
|
+
});
|
|
4716
|
+
}
|
|
4717
|
+
return tree;
|
|
4718
|
+
}
|
|
4719
|
+
async function main(argv = process.argv.slice(2), env = process.env) {
|
|
4720
|
+
try {
|
|
4721
|
+
const pkg = await import("./package-lsdxDgro.mjs");
|
|
4722
|
+
await cli(argv, rootCommand, {
|
|
4723
|
+
name: "attio-api",
|
|
4724
|
+
version: pkg.default.version,
|
|
4725
|
+
strict: true,
|
|
4726
|
+
subCommands: commandTree(env),
|
|
4727
|
+
renderHeader: (ctx) => ctx.values.help ? renderHeader(ctx) : Promise.resolve(""),
|
|
4728
|
+
renderValidationErrors: null,
|
|
4729
|
+
onBeforeCommand: (ctx) => {
|
|
4730
|
+
if (ctx.validationError || ctx.values.help || ctx.values.version) return;
|
|
4731
|
+
const unexpected = [...ctx.positionals.slice(ctx.commandPath.length), ...ctx.rest];
|
|
4732
|
+
if (unexpected.length > 0) throw usageError(`Unexpected argument: ${unexpected.join(" ")}`);
|
|
4733
|
+
},
|
|
4734
|
+
onAfterCommand: (ctx, result) => {
|
|
4735
|
+
if (ctx.values.help || ctx.values.version) return;
|
|
4736
|
+
if (result) console.log(result);
|
|
4737
|
+
}
|
|
4738
|
+
});
|
|
4739
|
+
return 0;
|
|
4740
|
+
} catch (error) {
|
|
4741
|
+
return reportError(error);
|
|
4742
|
+
}
|
|
4743
|
+
}
|
|
4744
|
+
//#endregion
|
|
4745
|
+
export { main };
|
|
4746
|
+
|
|
4747
|
+
//# sourceMappingURL=cli-cTGHeWUi.mjs.map
|