Add a contact method (email, sms, slack DM, etc.) for a user.
const url = 'https://api.siteqwality.com/user/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/contact_method';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"type":"email","details":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.siteqwality.com/user/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/contact_method \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "type": "email", "details": "example" }'Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”User identifier
Request Body required
Section titled “Request Body required ”object
method_type is the field the dashboard used to send. Accept both so
a stale client still creates a row the engine can page.
Email {email}, Slack DM {slack_token, channel}, SMS {phone_number, country}
(ISO 3166-1 alpha-2), {phone_number, country_code}, {e164} or a + number.
Responses
Section titled “ Responses ”Contact method created. The user’s sign-in email is created verified; anything else starts unverified. Default high and low rules are added for urgencies the user has none for when the method can be used in a rule.
object
Stored details with a Slack DM token masked.
A Slack DM linked from /oncall sends through this Slack integration; no token is stored.
The linked Slack integration’s name, while it is connected.
Example
{ "type": "email"}Invalid request body, or a phone number without a country or invalid for its country
Missing or invalid authentication
Only the user or an admin may change a user’s contact methods
User not found
The user already has 20 contact methods (contact_method_limit_reached)
Internal server error