Skip to main content
POST
/
api
/
social
/
v4
/
alerts
/
{alertId}
/
subscriptions
JavaScript
async function subscribeToAlert(alertId, userId) {  const url = `/api/social/v4/alerts/${alertId}/subscriptions`;  const response = await fetch(url, {    body: JSON.stringify({ subscriberId: userId, type: 'USER' }),  });  return await response.json();}
{}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

alertId
integer
required

The alertId

Response

200 - application/json

Returns the parameter of success or error based on the alert id being valid.

The response is of type object.