//native
/**
* Update Prospect
* Updates attributes of an existing prospect (e.g. { "title": "VP Sales", "occupation": "Sales" }).
*/
export async function main(
auth: RT.Outreach,
prospect_id: number,
attributes: { [key: string]: any }
) {
const response = await fetch(
`https://api.outreach.io/api/v2/prospects/${prospect_id}`,
{
method: "PATCH",
headers: {
Authorization: `Bearer ${auth.token}`,
"Content-Type": "application/vnd.api+json",
Accept: "application/vnd.api+json",
},
body: JSON.stringify({
data: { type: "prospect", id: prospect_id, attributes },
}),
}
)
if (!response.ok) {
throw new Error(`${response.status} ${await response.text()}`)
}
return await response.json()
}
Submitted by hugo989 5 hours ago