> ## Documentation Index
> Fetch the complete documentation index at: https://domoinc-openapi-sync-dataflows.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Subscribe user to an alert



## OpenAPI

````yaml /openapi/product/alerts.yaml post /api/social/v4/alerts/{alertId}/subscriptions
openapi: 3.0.0
info:
  title: Alerts API
  description: >-
    Domo Alerts allow users to subscribe to various events and receive timely
    notifications as changes occur. Find out more about Alerts by reading this
    article. The Alerts API can be used to manage alerts in your Domo instance.
  version: '4.0'
servers:
  - url: https://{instance}.domo.com
    description: Domo instance
    variables:
      instance:
        default: YOUR_INSTANCE
        description: Your Domo instance name
security:
  - BearerAuth: []
paths:
  /api/social/v4/alerts/{alertId}/subscriptions:
    post:
      tags:
        - Alerts
      summary: Subscribe user to an alert
      operationId: subscribe-user-to-an-alert
      parameters:
        - name: alertId
          in: path
          required: true
          schema:
            type: integer
          description: The alertId
      responses:
        '200':
          description: >-
            Returns the parameter of success or error based on the alert id
            being valid.
          content:
            application/json:
              schema:
                type: object
      x-codeSamples:
        - lang: JavaScript
          source: >-
            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();}
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````