I can not send DM from '/statuses/update end point' with SMS "D" command


Hi All,

I can not send DM from ‘/statuses/update end point’ with SMS “D” command.
Maybe from today.
I added an enable_dm_commands (true) and a fail_dm_commands (false) in request.
But, caught an error code “151” and message “There was an error sending your message: DM commands are no longer allowed!.”.
I think that this function will be completely discontinued from November 1.

Any thoughts?


From October 1, Direct Message commands now always fail on the statuses/update endpoint, and the Tweet will not be posted unless you also add enable_dm_commands=false parameter - in which case the status will be posted as a Tweet, not as a Direct Message. This is part of the transitional period removing the Direct Message commands from the status API. The next stage will be to remove the override-to-Tweet parameter, in November.


Hi @andypiper,

Isee, I understood it.

Thank you.
sorry for late reply.


HI Andy, as a newb on this forum, my question is this: How now, then, can I send DMs via a script. A link will do. Tx.


How were you sending them previously via your script?

You should use the direct_messages endpoints instead of the statuses/update endpoint.

Legacy endpoint is https://developer.twitter.com/en/docs/direct-messages/sending-and-receiving/api-reference/new-message-deprecated and the new modern endpoint is https://developer.twitter.com/en/docs/direct-messages/sending-and-receiving/api-reference/new-event


Thanks All –

The solution provided to me by a kind person was:

The error is coming from Twitter. It looks like they’re retiring the DM command codes. Try sending your direct message with api.send_direct_message(screen_name=user, text=‘Hello World’).

Worked correctly.