(notes)
Notes are rich text documents that reference a single parent record.
List notes for all records or for a specific record.
Required scopes: note:read
, object_configuration:read
, record_permission:read
.
import { Attio } from "attio-js";
const attio = new Attio({
apiKey: process.env["ATTIO_API_KEY"] ?? "",
});
async function run() {
const result = await attio.notes.list({
limit: 10,
offset: 5,
parentObject: "people",
parentRecordId: "891dcbfc-9141-415d-9b2a-2238a6cc012d",
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { AttioCore } from "attio-js/core.js";
import { notesList } from "attio-js/funcs/notesList.js";
// Use `AttioCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const attio = new AttioCore({
apiKey: process.env["ATTIO_API_KEY"] ?? "",
});
async function run() {
const res = await notesList(attio, {
limit: 10,
offset: 5,
parentObject: "people",
parentRecordId: "891dcbfc-9141-415d-9b2a-2238a6cc012d",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.GetV2NotesRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.GetV2NotesResponse>
Error Type | Status Code | Content Type |
---|---|---|
errors.GetV2ObjectsObjectNotFoundError | 404 | application/json |
errors.APIError | 4XX, 5XX | */* |
Creates a new note for a given record.
Required scopes: note:read-write
, object_configuration:read
, record_permission:read
.
import { Attio } from "attio-js";
const attio = new Attio({
apiKey: process.env["ATTIO_API_KEY"] ?? "",
});
async function run() {
const result = await attio.notes.create({
data: {
parentObject: "people",
parentRecordId: "891dcbfc-9141-415d-9b2a-2238a6cc012d",
title: "Initial Prospecting Call Summary",
format: "plaintext",
content: "Introduction\n" +
"Date and time of the call\n" +
"Participants\n" +
"Purpose of the call\n" +
"Customer Background\n" +
"Company overview (industry, size, location)\n" +
"Key business challenges\n" +
"Current software solutions (if any) and pain points",
createdAt: "2023-01-01T15:00:00.000000000Z",
},
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { AttioCore } from "attio-js/core.js";
import { notesCreate } from "attio-js/funcs/notesCreate.js";
// Use `AttioCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const attio = new AttioCore({
apiKey: process.env["ATTIO_API_KEY"] ?? "",
});
async function run() {
const res = await notesCreate(attio, {
data: {
parentObject: "people",
parentRecordId: "891dcbfc-9141-415d-9b2a-2238a6cc012d",
title: "Initial Prospecting Call Summary",
format: "plaintext",
content: "Introduction\n" +
"Date and time of the call\n" +
"Participants\n" +
"Purpose of the call\n" +
"Customer Background\n" +
"Company overview (industry, size, location)\n" +
"Key business challenges\n" +
"Current software solutions (if any) and pain points",
createdAt: "2023-01-01T15:00:00.000000000Z",
},
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.PostV2NotesRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.PostV2NotesResponse>
Error Type | Status Code | Content Type |
---|---|---|
errors.GetV2ObjectsObjectNotFoundError | 404 | application/json |
errors.APIError | 4XX, 5XX | */* |
Get a single note by ID.
Required scopes: note:read
, object_configuration:read
, record_permission:read
.
import { Attio } from "attio-js";
const attio = new Attio({
apiKey: process.env["ATTIO_API_KEY"] ?? "",
});
async function run() {
const result = await attio.notes.get({
noteId: "ff3f3bd4-40f4-4f80-8187-cd02385af424",
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { AttioCore } from "attio-js/core.js";
import { notesGet } from "attio-js/funcs/notesGet.js";
// Use `AttioCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const attio = new AttioCore({
apiKey: process.env["ATTIO_API_KEY"] ?? "",
});
async function run() {
const res = await notesGet(attio, {
noteId: "ff3f3bd4-40f4-4f80-8187-cd02385af424",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.GetV2NotesNoteIdRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.GetV2NotesNoteIdResponse>
Error Type | Status Code | Content Type |
---|---|---|
errors.GetV2NotesNoteIdNotFoundError | 404 | application/json |
errors.APIError | 4XX, 5XX | */* |
Delete a single note by ID.
Required scopes: note:read-write
.
import { Attio } from "attio-js";
const attio = new Attio({
apiKey: process.env["ATTIO_API_KEY"] ?? "",
});
async function run() {
const result = await attio.notes.delete({
noteId: "ff3f3bd4-40f4-4f80-8187-cd02385af424",
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { AttioCore } from "attio-js/core.js";
import { notesDelete } from "attio-js/funcs/notesDelete.js";
// Use `AttioCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const attio = new AttioCore({
apiKey: process.env["ATTIO_API_KEY"] ?? "",
});
async function run() {
const res = await notesDelete(attio, {
noteId: "ff3f3bd4-40f4-4f80-8187-cd02385af424",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.DeleteV2NotesNoteIdRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.DeleteV2NotesNoteIdResponse>
Error Type | Status Code | Content Type |
---|---|---|
errors.GetV2NotesNoteIdNotFoundError | 404 | application/json |
errors.APIError | 4XX, 5XX | */* |