//native
/**
* Retrieve User
* Get a person or bot by user ID. Needs the user information capability; emails need the capability that includes them.
*/
export async function main(auth: RT.Notion, user_id: string) {
const response = await fetch(`https://api.notion.com/v1/users/${user_id}`, {
headers: {
Authorization: `Bearer ${auth.token}`,
Accept: "application/json",
"Notion-Version": "2026-03-11",
},
})
if (!response.ok) {
throw new Error(`${response.status} ${await response.text()}`)
}
return await response.json()
}
Submitted by hugo989 4 hours ago