Sends a new message.

This method requires the following permissions: messages.

Parameters

to
string

Comma-separated list of user identifiers for recipients.

subject
string

The subject line of the message.

body
string

The text of the message. Required if there are no attachments. This parameter supports formatted text, the format is determined by the text_format parameter.

text_format
enum

The format of the message text passed in body. By default, the user’s preference is used.

Possible values: markdown, html, plain.

attachments
array of objects

JSON array representing the media attachments to be added to this message. See the separate page for the object description. Required if there is no body.

guid
string

A unique identifier used to prevent accidentally sending multiple messages on unreliable connections. If messages.send was previously called with this guid in the last hour, no new message will be sent, the ID of that previously sent message will be returned instead. Recommended for mobile apps.

reply_to
string

Identifier of the message to reply to. If this is specified, the to parameter is ignored.

Result

Returns the message identifier on success.

Errors

Global errors may occur when calling this method.