---
agentTools:
  projectIndex: https://sendinblue.readme.io/llms.txt
---

# Send an automated message to a visitor

Example of automated messages: order status, announce new features in your web app, etc.

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "contact": {
      "email": "contact@brevo.com",
      "name": "Brevo Support",
      "url": "https://account.brevo.com/support"
    },
    "description": "Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to :\n  - Manage your campaigns and get the statistics\n  - Manage your contacts\n  - Send transactional Emails and SMS\n  - and much more...\n\nYou can download our wrappers at https://github.com/orgs/brevo\n**Possible responses**\n  | Code | Message |\n  | :-------------: | ------------- |\n  | 200  | OK. Successful Request  |\n  | 201  | OK. Successful Creation |\n  | 202  | OK. Request accepted |\n  | 204  | OK. Successful Update/Deletion  |\n  | 400  | Error. Bad Request  |\n  | 401  | Error. Authentication Needed  |\n  | 402  | Error. Not enough credit, plan upgrade needed  |\n  | 403  | Error. Permission denied  |\n  | 404  | Error. Object does not exist |\n  | 405  | Error. Method not allowed  |\n  | 406  | Error. Not Acceptable  |\n  | 422  | Error. Unprocessable Entity |\n",
    "license": {
      "name": "MIT",
      "url": "http://opensource.org/licenses/MIT"
    },
    "title": "Brevo API",
    "version": "3.0.0"
  },
  "servers": [
    {
      "url": "https://api.brevo.com/v3"
    }
  ],
  "security": [
    {
      "api-key": []
    },
    {
      "partner-key": []
    }
  ],
  "paths": {
    "/conversations/pushedMessages": {
      "post": {
        "description": "Example of automated messages: order status, announce new features in your web app, etc.",
        "requestBody": {
          "content": {
            "application/json": {
              "examples": {
                "Agent group": {
                  "description": "Send a message on behalf of a random agent from one of your agent groups",
                  "value": {
                    "groupId": "PjRBMhWGen6aRHjif",
                    "text": "Your order has shipped! Here’s your tracking number: 9114 5847 3325 9667 4328 88",
                    "visitorId": "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg"
                  }
                },
                "Random agent": {
                  "value": {
                    "text": "Your order has shipped! Here’s your tracking number: 9114 5847 3325 9667 4328 88",
                    "visitorId": "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg"
                  }
                },
                "Specific agent": {
                  "description": "Send a message on behalf of a specific agent",
                  "value": {
                    "agentId": "d9nKoegKSjmCtyK78",
                    "text": "Your order has shipped! Here’s your tracking number: 9114 5847 3325 9667 4328 88",
                    "visitorId": "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg"
                  }
                }
              },
              "schema": {
                "properties": {
                  "agentId": {
                    "description": "agent ID. It can be found on agent’s page or received <a href=\"https://developers.brevo.com/docs/conversations-webhooks\">from a webhook</a>."
                  },
                  "groupId": {
                    "description": "group ID. It can be found on group’s page."
                  },
                  "text": {
                    "description": "message text"
                  },
                  "visitorId": {
                    "description": "visitor’s ID received <a href=\"https://developers.brevo.com/docs/conversations-webhooks\">from a webhook</a> or generated by you to <a href=\"https://developers.brevo.com/docs/customize-the-widget#identifying-existing-users\"><a href=\"https://developers.brevo.com/docs/customize-the-widget#identifying-existing-users\">bind existing user account to Conversations</a></a>"
                  }
                },
                "required": [
                  "visitorId",
                  "text"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "examples": {
                  "response": {
                    "value": {
                      "agentId": "d9nKoegKSjmCtyK78",
                      "createdAt": 1470222622433,
                      "html": "Your order has shipped! Here’s your tracking number: 9114 5847 3325 9667 4328 88",
                      "id": "AXCR3k9bpSY7bpuh7",
                      "isMissed": false,
                      "isMissedByVisitor": false,
                      "isPushed": true,
                      "isTrigger": false,
                      "text": "Your order has shipped! Here’s your tracking number: 9114 5847 3325 9667 4328 88",
                      "type": "agent",
                      "visitorId": "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ConversationsMessage"
                }
              }
            },
            "description": "Newly created message is returned as a response"
          },
          "400": {
            "$ref": "#/components/responses/errorModel"
          }
        },
        "summary": "Send an automated message to a visitor",
        "tags": [
          "Conversations"
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "api-key": {
        "description": "The API key should be passed in the request headers as `api-key` for authentication.",
        "in": "header",
        "name": "api-key",
        "type": "apiKey"
      },
      "partner-key": {
        "description": "The partner key should be passed in the request headers as `partner-key` along with `api-key` pair for successful authentication of partner (Optional).",
        "in": "header",
        "name": "partner-key",
        "type": "apiKey"
      }
    },
    "schemas": {
      "ConversationsMessage": {
        "description": "a Conversations message",
        "properties": {
          "agentId": {
            "description": "ID of the agent on whose behalf the message was sent (only in messages sent by an agent).",
            "example": "d9nKoegKSjmCtyK78",
            "type": "string"
          },
          "agentName": {
            "description": "Agent’s name as displayed to the visitor. Only in the messages sent by an agent.",
            "example": "Liz",
            "type": "string"
          },
          "agentUserpic": {
            "description": "Only set if the agent has uploaded a profile picture.",
            "example": "https://www.brevo.com/",
            "type": "string"
          },
          "attachments": {
            "description": "An array of file attachments.",
            "items": {
              "properties": {
                "fileName": {
                  "description": "The name of the file.",
                  "type": "string"
                },
                "inlineId": {
                  "description": "The ID of the inline file.",
                  "type": "string"
                },
                "isImage": {
                  "description": "`true` for images.",
                  "type": "boolean"
                },
                "isInline": {
                  "description": "`true` for inline files.",
                  "type": "string"
                },
                "size": {
                  "description": "The size of the file in bytes.",
                  "format": "int64",
                  "type": "integer"
                },
                "url": {
                  "description": "The URL of the file.",
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "bcc": {
            "description": "An array containing details of the blind carbon copy (BCC) recipients (applicable only to messages in email threads).",
            "items": {
              "properties": {
                "email": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "cc": {
            "description": "An array containing details of the carbon copy (CC) recipients (applicable only to messages in email threads).",
            "items": {
              "properties": {
                "email": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "createdAt": {
            "description": "Timestamp in milliseconds.",
            "example": 1470222622433,
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "file": {
            "properties": {
              "filename": {
                "description": "Name of the file",
                "example": "conversations.png",
                "type": "string"
              },
              "imageInfo": {
                "description": "image info is passed in case the file is an image",
                "properties": {
                  "height": {
                    "description": "height of the image",
                    "example": 525,
                    "format": "int64",
                    "minimum": 0,
                    "type": "integer"
                  },
                  "previewUrl": {
                    "description": "URL of the preview",
                    "example": "https://ucarecdn.com/03cd56cd-1de9-4f65-996d-08afdf27fa1b/-/preview/800x800/-/quality/lighter/",
                    "format": "url",
                    "type": "string"
                  },
                  "width": {
                    "description": "Width of the image",
                    "example": 1129,
                    "format": "int64",
                    "minimum": 0,
                    "type": "integer"
                  }
                },
                "type": "object"
              },
              "isImage": {
                "description": "Whether the file is an image",
                "example": true,
                "type": "boolean"
              },
              "size": {
                "description": "Size in bytes",
                "example": 15538,
                "format": "int64",
                "minimum": 0,
                "type": "integer"
              },
              "url": {
                "description": "URL of the file",
                "example": "https://ucarecdn.com/cee5c10c-8302-45c1-b1fb-43860ca941a9/",
                "format": "url",
                "type": "string"
              }
            },
            "type": "object"
          },
          "forwardedToSourceStatus": {
            "description": "Status of the message forwarding to the source.",
            "properties": {
              "error": {
                "type": "string"
              },
              "isSuccess": {
                "type": "boolean"
              }
            },
            "type": "object"
          },
          "from": {
            "description": "An object containing details about the email sender (applicable only to messages in email threads).",
            "properties": {
              "email": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "type": "object"
          },
          "html": {
            "description": "The HTML content of the message.",
            "example": "Good morning!<br>How can I help you?",
            "type": "string"
          },
          "id": {
            "description": "Message ID. It can be used for further manipulations with the message.",
            "example": "eYBEm3gq3zc5ayE2g",
            "type": "string"
          },
          "integrations": {
            "description": "Integration details.",
            "type": "object"
          },
          "isBot": {
            "description": "`true` for automated messages generated by an AI bot.",
            "type": "boolean"
          },
          "isMissed": {
            "description": "`true` for missed and offline messages.",
            "example": false,
            "type": "boolean"
          },
          "isMissedByVisitor": {
            "description": "`true` for unread agent’s messages in finished chats.",
            "example": false,
            "type": "boolean"
          },
          "isPushed": {
            "description": "`true` for pushed messages",
            "example": true,
            "type": "boolean"
          },
          "isTrigger": {
            "description": "`true` for automatic messages from “Targeted chats & triggers” and API (https://developers.brevo.com/docs/javascript-api-reference#sendautomessage)",
            "example": false,
            "type": "boolean"
          },
          "rawUnsafeHtml": {
            "description": "Unescaped HTML content of the message (may include unsafe HTML).",
            "example": "Good morning!<br>How can I help you?",
            "type": "string"
          },
          "receivedFrom": {
            "description": "In two-way integrations, messages sent via REST API can be marked with receivedFrom property and then filtered out when received in a webhook to avoid infinite loop.",
            "example": "SuperAwesomeHelpdesk",
            "type": "string"
          },
          "replyTo": {
            "description": "An object containing details of the reply-to email address (applicable only to messages in email threads).",
            "properties": {
              "email": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "type": "object"
          },
          "sourceMessageId": {
            "description": "The ID of the message assigned by the integration source.",
            "type": "string"
          },
          "subject": {
            "description": "The subject line of the email message (only for messages sent to email threads).",
            "example": "Invitation to a meeting",
            "type": "string"
          },
          "text": {
            "description": "Message text or name of the attached file",
            "example": "Good morning! How can I help you?",
            "type": "string"
          },
          "to": {
            "description": "An array containing details of the recipients (applicable only to messages in email threads).",
            "items": {
              "properties": {
                "email": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "type": {
            "description": "`\"agent\"` for agents’ messages, `\"visitor\"` for visitors’ messages.",
            "enum": [
              "agent",
              "visitor"
            ],
            "example": "agent",
            "type": "string"
          },
          "visitorId": {
            "description": "visitor’s ID",
            "example": "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg",
            "type": "string"
          }
        },
        "type": "object"
      }
    },
    "responses": {
      "errorModel": {
        "content": {
          "application/json": {
            "schema": {
              "properties": {
                "code": {
                  "description": "Error code displayed in case of a failure",
                  "enum": [
                    "invalid_parameter",
                    "missing_parameter",
                    "out_of_range",
                    "campaign_processing",
                    "campaign_sent",
                    "document_not_found",
                    "not_enough_credits",
                    "permission_denied",
                    "duplicate_parameter",
                    "duplicate_request",
                    "method_not_allowed",
                    "unauthorized",
                    "account_under_validation",
                    "not_acceptable",
                    "bad_request",
                    "unprocessable_entity",
                    "Domain does not exist",
                    "Contact email not found",
                    "Attribute not found",
                    "Category id not found",
                    "Invalid parameters passed",
                    "Record(s) for identifier not found",
                    "Returned when query params are invalid",
                    "Returned when invalid data posted",
                    "Feed not found",
                    "Campaign ID not found",
                    "api-key not found",
                    "DMARC policy requires domain authentication",
                    "DNS records not properly configured",
                    "Invalid OTP code provided",
                    "OTP code has expired",
                    "Domain already exists in your account",
                    "The sum of all IP weights must equal 100",
                    "Authentication failed",
                    "Insufficient credits",
                    "Request already processed"
                  ],
                  "example": "method_not_allowed",
                  "type": "string"
                },
                "message": {
                  "description": "Readable message associated to the failure",
                  "example": "POST Method is not allowed on this path",
                  "type": "string"
                }
              },
              "required": [
                "code",
                "message"
              ],
              "type": "object"
            }
          }
        },
        "description": "bad request"
      }
    }
  },
  "x-samples-languages": [
    "curl"
  ],
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "_id": {
    "buffer": {
      "0": 91,
      "1": 104,
      "2": 180,
      "3": 205,
      "4": 240,
      "5": 82,
      "6": 207,
      "7": 0,
      "8": 3,
      "9": 36,
      "10": 63,
      "11": 142
    }
  }
}
```