//native
type Attio = {
token: string;
};
/**
* List all lists
* List all lists that your access token has access to. lists are returned in the order that they are sorted in the sidebar.
Required scopes: `list_configuration:read`.
*/
export async function main(auth: Attio) {
const url = new URL(`https://api.attio.com/v2/lists`);
const response = await fetch(url, {
method: "GET",
headers: {
Authorization: "Bearer " + auth.token,
},
body: undefined,
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.json();
}
Submitted by hugo697 51 days ago