0

Get a comment

by
Published Oct 17, 2025

Get a single comment by ID. To view comments on records, you will need the `object_configuration:read` and `record_permission:read` scopes. To view comments on list entries, you will need the `list_configuration:read` and `list_entry:read` scopes. Required scopes: `comment: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
 * Get a comment
7
 * Get a single comment by ID.
8

9
To view comments on records, you will need the `object_configuration:read` and `record_permission:read` scopes.
10

11
To view comments on list entries, you will need the `list_configuration:read` and `list_entry:read` scopes.
12

13
Required scopes: `comment:read`.
14
 */
15
export async function main(auth: Attio, comment_id: string) {
16
  const url = new URL(`https://api.attio.com/v2/comments/${comment_id}`);
17

18
  const response = await fetch(url, {
19
    method: "GET",
20
    headers: {
21
      Authorization: "Bearer " + auth.token,
22
    },
23
    body: undefined,
24
  });
25
  if (!response.ok) {
26
    const text = await response.text();
27
    throw new Error(`${response.status} ${text}`);
28
  }
29
  return await response.json();
30
}
31