create

fun DirectMessageEvents.create(    userId: Long,     text: String,     type: String = "message_create",     vararg options: Option): JsonObjectApiAction<DirectMessageEvent.Show>

Publishes a new message_create event resulting in a Direct Message sent to a specified user from the authenticating user. Returns an event if successful. Supports publishing Direct Messages with optional Quick Reply and media attachment. Replaces behavior currently provided by POST direct_messages/new. Requires a JSON POST body and Content-Type header to be set to application/json. Setting Content-Length may also be required if it is not automatically.

Twitter API reference

Receiver

DirectMessageEvents endpoint instance.

Return

JsonObjectApiAction for DirectMessageEvent.Show model.

Parameters

userId

The ID of the user who should receive the direct message.

text

The Message Data Object defining the content to deliver to the recipient.

type

The type of event you are posting. For Direct Messages, use message_create.

options

Optional. Custom parameters of this request.