> ## 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.

# Share an alert



## OpenAPI

````yaml /openapi/product/alerts.yaml post /api/social/v4/alerts/{alertId}/share
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}/share:
    post:
      tags:
        - Alerts
      summary: Share an alert
      operationId: share-an-alert
      parameters:
        - name: alertId
          in: path
          required: true
          schema:
            type: integer
          description: The alertId
      requestBody:
        description: >-
          - **userMessage** (String) Required: The message you want to send to
          the person

          - **alertSubscriptions** (Object[]) Required: The entities you want to
          share the alert with. See above for entity params.

          - **sendEmail** (Boolean) : Whether or not to send an email to the
          person once the alert is shared

          - **metaData** (Object) : 
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                userMessage:
                  type: string
                  description: The message you want to send to the person
                alertSubscriptions:
                  type: array
                  items:
                    type: object
                  description: >-
                    The entities you want to share the alert with. See above for
                    entity params.
                sendEmail:
                  type: boolean
                  description: >-
                    Whether or not to send an email to the person once the alert
                    is shared
                metaData:
                  type: object
              required:
                - userMessage
                - alertSubscriptions
      responses:
        '200':
          description: >-
            Returns the parameter of success or error based on the alert id
            being valid.
          content:
            application/json:
              schema:
                type: object
              example: >-
                {  "userMessage": "I think you'll find this alert useful", 
                "alertSubscriptions": [{ "subscriberId": 12345, "type": "USER"
                }],  "sendEmail": true,  "metaData": {}}
      x-codeSamples:
        - lang: JavaScript
          source: >-
            async function shareAlert(alertId, userId, message, email) {  const
            url = `/api/social/v4/alerts/${alertId}/share`;  const payload =
            {    userMessage: message,    alertSubscriptions: [{ subscriberId:
            userId, type: 'USER' }],    sendEmail,    metaData: {},  };  const
            response = await fetch(url, {    body: JSON.stringify(payload), 
            });  return await response.json();}
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````