---
updatedAt: 2025-06-04T21:28:20.000Z
agentTools:
  projectIndex: https://developer.simpplr.com/llms.txt
---

# Create an Alert

Use this API to create a new Alert.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "simpplr-api-gateway",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://api.ec.simpplr.com/api"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "oauth2",
        "flows": {}
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/alerts": {
      "post": {
        "summary": "Create an Alert",
        "description": "Use this API to create a new Alert.",
        "operationId": "create-a-new-alert",
        "parameters": [
          {
            "name": "x-user-email",
            "in": "header",
            "description": "User's email to login into Salesforce",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "message",
                  "display-from",
                  "display-to",
                  "is-dismissible",
                  "has-url",
                  "recipient"
                ],
                "properties": {
                  "message": {
                    "type": "string",
                    "description": "The Alert message to be displayed on the pop up",
                    "default": "This is an alert message"
                  },
                  "display-from": {
                    "type": "string",
                    "description": "Time from which this Alert should be displayed. Format : YYYY-MM-DDTH:mm:ss+05:30",
                    "default": "2022-02-12T00:00:00+05:30"
                  },
                  "display-to": {
                    "type": "string",
                    "description": "Time till which the Alert should be displayed. By default it will be 24 hours from the display-from value.  Format: YYYY-MM-DDTH:mm:ss+05:30",
                    "default": "2022-03-12T00:00:00+05:30"
                  },
                  "segment-id": {
                    "type": "string",
                    "description": "ID of the Segment in which this Alert should be created. Note: Will work only if Segmentation is enabled for your org",
                    "default": "null"
                  },
                  "is-dismissible": {
                    "type": "boolean",
                    "description": "true: The Alert can be dismissed by users.   false: The Alert cannot be dismissed by users.",
                    "default": false
                  },
                  "members-type": {
                    "type": "string",
                    "description": "Which group of members should this Alert be displayed to. Note: Applicable only if the recipient is set as Site",
                    "default": "site_members",
                    "enum": [
                      "site_members",
                      "site_members_and_followers"
                    ]
                  },
                  "has-url": {
                    "type": "boolean",
                    "description": "Will this Alert have a hyperlink to redirect the users to a particular page",
                    "default": false
                  },
                  "url": {
                    "type": "string",
                    "description": "Target link for the Alert (REQUIRED if has-url is true)"
                  },
                  "recipient": {
                    "type": "string",
                    "description": "Recipient group for this Alert",
                    "default": "site",
                    "enum": [
                      "everyone",
                      "audience",
                      "site",
                      "segment"
                    ]
                  },
                  "site-id": {
                    "type": "string",
                    "description": "ID of the target site (If recipient is chosen as site)"
                  },
                  "audience-id": {
                    "type": "string",
                    "description": "Audience ID"
                  },
                  "audience-count": {
                    "type": "integer",
                    "description": "Audience Count",
                    "format": "int32"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n    \"status\": \"success\",\n    \"result\": {\n        \"attributes\": {\n            \"type\": \"Alert__c\",\n            \"url\": \"/services/data/v52.0/sobjects/Alert__c/a025e000008Vvxxxxx\"\n        },\n        \"Alert_Message__c\": \"This is alert message\",\n        \"Alert_Url__c\": null,\n        \"Author__c\": \"a115e000002FFxxxxx\",\n        \"Display_From_DateTime__c\": \"2021-12-09T05:33:04.000+0000\",\n        \"Display_To_DateTime__c\": \"2021-12-10T05:33:04.000+0000\",\n        \"Is_Dismissible__c\": false,\n        \"Is_Link_Alert__c\": false,\n        \"Members_Type__c\": \"site_members\",\n        \"Recipient__c\": \"everyone\",\n        \"Recipient_Count__c\": 5,\n        \"Recipient_Site__c\": null,\n        \"Audience__c\": null,\n        \"Id\": \"a025e000008Vvxxxxx\"\n    },\n    \"responseTimeStamp\": \"1631615203892\",\n    \"message\": \"\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": "success"
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "attributes": {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string",
                              "example": "Alert__c"
                            },
                            "url": {
                              "type": "string",
                              "example": "/services/data/v52.0/sobjects/Alert__c/a025e000008Vvxxxxx"
                            }
                          }
                        },
                        "Alert_Message__c": {
                          "type": "string",
                          "example": "This is alert message"
                        },
                        "Alert_Url__c": {},
                        "Author__c": {
                          "type": "string",
                          "example": "a115e000002FFxxxxx"
                        },
                        "Display_From_DateTime__c": {
                          "type": "string",
                          "example": "2021-12-09T05:33:04.000+0000"
                        },
                        "Display_To_DateTime__c": {
                          "type": "string",
                          "example": "2021-12-10T05:33:04.000+0000"
                        },
                        "Is_Dismissible__c": {
                          "type": "boolean",
                          "example": false,
                          "default": true
                        },
                        "Is_Link_Alert__c": {
                          "type": "boolean",
                          "example": false,
                          "default": true
                        },
                        "Members_Type__c": {
                          "type": "string",
                          "example": "site_members"
                        },
                        "Recipient__c": {
                          "type": "string",
                          "example": "everyone"
                        },
                        "Recipient_Count__c": {
                          "type": "integer",
                          "example": 5,
                          "default": 0
                        },
                        "Recipient_Site__c": {},
                        "Audience__c": {},
                        "Id": {
                          "type": "string",
                          "example": "a025e000008Vvxxxxx"
                        }
                      }
                    },
                    "responseTimeStamp": {
                      "type": "string",
                      "example": "1631615203892"
                    },
                    "message": {
                      "type": "string",
                      "example": ""
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n    \"statusCode\": 400,\n    \"status\": \"error\",\n    \"message\": \"\",\n    \"data\": {}\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 400,
                      "default": 0
                    },
                    "status": {
                      "type": "string",
                      "example": "error"
                    },
                    "message": {
                      "type": "string",
                      "example": ""
                    },
                    "data": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "401",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n    \"status\": \"error\",\n    \"message\": \"SESSION_TIMEOUT\",\n    \"i18nmessage\": \"SESSION_TIMEOUT\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": "error"
                    },
                    "message": {
                      "type": "string",
                      "example": "SESSION_TIMEOUT"
                    },
                    "i18nmessage": {
                      "type": "string",
                      "example": "SESSION_TIMEOUT"
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```