Twitter DM API | Read the Inbox and Send Messages
Direct Messages: Read your account's DM inbox and the message history of a single conversation, and send new messages, all acting as the account behind your registered session.
Read your account's DM inbox and the message history of a single conversation, and send new messages, all acting as the account behind your registered session.
The usual flow is /dm/list to page through conversation threads (each carries a conversation_id and participant list), then /dm/conversation with that id to pull the full message history for one thread. /dm/send posts as your account. All three act on behalf of one X account, so each call authenticates with either a registered session (POST /customer/session) or per-call x-auth-token and x-ct0 headers, which is what lets one API key poll or send from many different accounts. All three are flat $0.0016 per call regardless of message count, so paging a long conversation costs the same as reading a short one.
This category has 3 endpoints. Each is a pay-per-call REST endpoint with bearer auth, JSON in and out.
| Method | Path | Cost | Description |
|---|---|---|---|
POST | /dm/send | $0.0016 | Send a direct message from your authenticated account. |
GET | /dm/list | $0.0016 | List the Direct Message conversations for your registered account. |
GET | /dm/conversation | $0.0016 | Read the message history of one DM conversation by conversation_id. |
Delete Tweet POST
Delete a tweet owned by the account behind your registered session. Identify it by id or url (read from the query string). Requires a registered session. Billed at $0.0008 per call, the same as a standard read. Cost: $0.0008 per call.
DM Inbox GET
List the DM conversations (inbox) for the account behind your session. Returns each conversation's ID, type, and participant user IDs. Pass a conversation_id to GET /dm/conversation to read its messages. Authenticate with a registered session (POST /customer/session) or per-call x-auth-token and x-ct0 headers, so one API key can poll the inboxes of many accounts. Read-only: this does not send DMs. Cost: $0.0016 per call.