//native
/**
* Get Current User
* Get the bot user the token belongs to: its name, owner and workspace name and ID.
*/
export async function main(auth: RT.Notion) {
const response = await fetch(`https://api.notion.com/v1/users/me`, {
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