Send Direct Message

twitter.send_direct_message
ActionChat & messagingconnection required

Calls the X (Twitter) API with the connection's credentials.

Send a direct message to one user, starting the conversation if needed.

Connection

Required
Yes — the node will not save without one
Auth type
Bearer token
Providers
X (Twitter)
Secret shape
the X OAuth2 user-context access token, or {"access_token": "…"}
Resolved by
config.connection_id, else node.connection_id

Configuration

3 fields, 1 required. A dotted path is a nested object and name[] an array of objects — the editor renders the same tree.

FieldTypeRequiredDefaultConstraintsExample
participant_id
Numeric id of the user to message — from twitter.get_user_by_username.
stringYes——2244994945
text
Message text. Optional when media_id is set. Supports {{ }}.
stringNo——Thanks for the report — we are on it.
media_id
A media id from twitter.upload_media (uploaded with a dm_* category).
stringNo———
  • At least one of text, media_id must be set.

Example configuration

Every value below is the contract’s own example or default — nothing invented.

{
  "participant_id": "2244994945",
  "text": "Thanks for the report — we are on it."
}

Output

One shape.

result

FieldTypeExample
dm_conversation_id
The conversation the message landed in.
string—
dm_event_id
Id of the message event that was created.
string—
{
  "dm_conversation_id": "",
  "dm_event_id": ""
}

Notes

  • X API access is tiered and metered: most read endpoints need a paid plan, and since 6 February 2026 new developers get pay-per-use credits rather than a free tier. A 403 here usually means the plan, not the code.
  • The connection's access token must already carry the scopes this node needs; X does not grant them per call, so a missing scope is a 401 on every run.
  • Needs the OAuth2 scopes dm.write, tweet.read, users.read.
  • X refuses the message unless the recipient's settings allow a DM from this account, which is a 403 rather than a delivery failure.

See Send Direct Message run in a workflow.

In a technical demo we add the X (Twitter) connection, drop the node on the canvas and let Workflow Health pre-flight it before the first real run.