//native
/**
* Get Account
* Retrieves a single account by its ID.
*/
export async function main(auth: RT.Outreach, account_id: number) {
const response = await fetch(
`https://api.outreach.io/api/v2/accounts/${account_id}`,
{
headers: {
Authorization: `Bearer ${auth.token}`,
Accept: "application/vnd.api+json",
},
}
)
if (!response.ok) {
throw new Error(`${response.status} ${await response.text()}`)
}
return await response.json()
}
Submitted by hugo989 5 hours ago