0

Update a list entry (overwrite multiselect values)

by
Published Oct 17, 2025

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. Required scopes: `list_entry:read-write`, `list_configuration:read`.

Script attio Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
type Attio = {
3
  token: string;
4
};
5
/**
6
 * Update a list entry (overwrite multiselect values)
7
 * 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.
8

9
Required scopes: `list_entry:read-write`, `list_configuration:read`.
10
 */
11
export async function main(
12
  auth: Attio,
13
  list: string,
14
  entry_id: string,
15
  body: { data: { entry_values: {} } },
16
) {
17
  const url = new URL(
18
    `https://api.attio.com/v2/lists/${list}/entries/${entry_id}`,
19
  );
20

21
  const response = await fetch(url, {
22
    method: "PUT",
23
    headers: {
24
      "Content-Type": "application/json",
25
      Authorization: "Bearer " + auth.token,
26
    },
27
    body: JSON.stringify(body),
28
  });
29
  if (!response.ok) {
30
    const text = await response.text();
31
    throw new Error(`${response.status} ${text}`);
32
  }
33
  return await response.json();
34
}
35