POST/api/notifications

Notification

This endpoint allows you to send an informational message to the user via the channels you specify. Unlike a validation, a notification does not await a response, does not generate a token, cannot be queried later, and does not trigger a webhook. The message also does not include a confirmation link.

Request

  • Name
    locale
    Type
    string
    is optional
    Description

    Defines the language to use in ISO 639-1 format

    Allowed values:esenptit
    Example:es
    Max length:2
    Min length:2
  • Name
    message
    Type
    string
    is Required
    REQUIRED
    Description

    Message that will be displayed in the email.

    Example:this is a very long and generic message
  • Name
    kind
    Type
    string
    is optional
    Description

    Field used to classify a request

    Example:Horus
    Max length:50
  • Name
    channels
    Type
    object
    is Required
    REQUIRED
    Description

    Structure required to define the channel details to use

  • Name
    site_id
    Type
    integer
    is optional
    Description

    ID of the site associated with the tenant. Only applies when using SMS or WhatsApp channels and the tenant has SiteMiddleware configured; otherwise it is ignored.

    Example:123

Request

POST
/api/notifications
curl -X "POST" {{baseURl}}/api/notifications \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <token>" \
  -d '{
    "locale": "en",
    "message": "This is a very long and generic message",
    "kind": "Horus",
    "site_id": 123,
    "channels": {
      "sms": {
        "phone_number": "+573124567890",
        "short_message": "SMS Message"
      },
      "whatsapp": {
        "phone_number": "+573124567890",
        "template": {
          "name": "hello_world",
          "lang": "en_US",
          "parameters": [
            "name"
          ]
        }
      },
      "email": {
        "email": "[email protected]",
        "subject": "email subject"
      }
    }
  }'

Response

The message was sent successfully.

  • Name
    status
    Type
    object
    is optional
    Description

Response

POST
/api/notifications
{
  "status": {
    "status": "OK",
    "reason": null,
    "message": "The message was sent successfully",
    "date": "2022-08-12T15:44:17+00:00"
  }
}