Twitter / X API
Twitter / X Messaging API
List conversations, read message history, and send Twitter/X direct messages programmatically. PostPeer gives you one unified endpoint and handles OAuth so you never touch the developer portal.
- List DM conversations with participants and last message
- Load full message history for any conversation
- Send direct messages from one unified endpoint
- OAuth handled, no Twitter developer app needed
No credit card required.
POST https://api.postpeer.dev/v1/posts
{ "platforms": ["twitter", "linkedin"], "content": "Hello world!" }
{ "platforms": ["twitter", "linkedin"], "content": "Hello world!" }
Published
2 platformsTwitterLinkedIn
All posts delivered
Scheduled
queue12
Queued
847
Sent
Next: in 15 min
Platforms
connectedXLIFBTT
One API, every platform
DF
"I was up and running on six different platforms in under 30 minutes. Strongly recommend!"
David Flor, Founder at Darklight Interactive
"Couldn't figure out the official Pinterest API. PostPeer was smooth. Using it daily."
Divanshu Khatter, Marketing Manager at Sembark
"Great integration experience. Jonathan ships fixes within hours. Mad respect for the speed."
Het Tikawala, Founder at Kalizzle AI Studio
How It Works
Add social media to your product in three steps.
01
Get Your API Key
Sign up and get your API key instantly — no sales calls, no complex onboarding.
02
Integrate in Minutes
A single endpoint to post, schedule, and manage content. Drop it into your product and go.
03
Your Users Post Everywhere
Your product now supports every major social platform — without you maintaining a single integration.
API Response Format
Clean, structured JSON that's easy to parse and integrate
Request
POST
curl "https://api.postpeer.dev/v1/messages?platform=twitter&accountId=acc_tw_123&limit=20" \
-H "x-access-key: your-api-key"Response
JSON
{
"success": true,
"selfId": "44196397",
"selfUsername": "yourbrand",
"conversations": [
{
"id": "44196397-2233445566",
"participants": [
{
"id": "2233445566",
"name": "Jane Doe",
"username": "jane_doe",
"profilePictureUrl": "https://pbs.twimg.com/profile_images/..."
},
{
"id": "44196397",
"name": "Your Brand",
"username": "yourbrand",
"profilePictureUrl": "https://pbs.twimg.com/profile_images/..."
}
],
"lastMessage": {
"id": "1560000000000000001",
"text": "Can you help with my order?",
"from": {
"id": "2233445566",
"name": "Jane Doe"
},
"timestamp": "2026-08-05T16:40:00Z"
},
"updatedTime": "2026-08-05T16:40:00Z"
}
],
"nextCursor": "QVFIUl9..."
}Everything You Need for Twitter/X DMs
Read and send direct messages without wrestling the Twitter API. List conversations, load history, and send DMs from one endpoint.
List Conversations
Fetch DM conversations for a connected Twitter/X account with each participant name, username, and profile picture, plus the most recent message and updated time.
Read Message History
Load the messages in a DM conversation, paginated, each with the sender and a timestamp. Rebuild the full thread on your side.
Send Direct Messages
Send a DM to a recipient with one call. The response returns the sent message ID so you can track delivery and reconcile it against your inbox.
OAuth Handled
Your users connect their Twitter/X account through PostPeer's OAuth flow. No developer app, no token refreshes, and no rate-limit wrangling on your side.
Build Your Own Inbox
Everything the PostPeer dashboard inbox uses is available through the API, so you can build a branded support inbox or route DMs into your own tooling.
One Endpoint Across Platforms
The Twitter/X Messages surface uses the same `/v1/messages` request and response shape as every other PostPeer messaging endpoint. One integration covers them all.
Frequently Asked Questions
Ready to Add Social Media to Your Product?
One API. Every platform. Start building with free credits.
Start Posting for FreeNo credit card required.
POST https://api.postpeer.dev/v1/posts
{ "platforms": ["twitter", "linkedin"], "content": "Hello world!" }
{ "platforms": ["twitter", "linkedin"], "content": "Hello world!" }
Published
2 platformsTwitterLinkedIn
All posts delivered
Scheduled
queue12
Queued
847
Sent
Next: in 15 min
Platforms
connectedXLIFBTT
One API, every platform