The role of the contact. Accepted values are user or lead.
async
(params, auths) => {
}
// See the API docs here: https://developers.intercom.com/intercom-api-reference/reference#create-contact
const config = {
method: "post",
url: `https://api.intercom.io/contacts`,
headers: {
Authorization: `Bearer ${auths.intercom.oauth_access_token}`,
Accept: 'application/json',
'Content-Type': 'application/json'
},
data:{
role: params.role,
external_id: params.external_id,
email: params.email,
phone: params.phone,
name: params.name,
avatar: params.avatar,
signed_up_at: params.signed_up_at,
last_seen_at: params.last_seen_at,
owner_id: params.owner_id,
unsubscribed_from_emails: params.unsubscribed_from_emails,
custom_attributes: typeof params.custom_attributes == 'undefined' ? params.custom_attributes : JSON.parse(params.custom_attributes)
}
}
return await require("@pipedreamhq/platform").axios(this, config)