Skip to main content
POST
Targeting X/Twitter? Starting March 31, 2026, all X operations require your own API credentials. After linking X via OAuth, include these 2 headers in your request:

X-Twitter-OAuth1-Api-Key — Your API Key (Consumer Key)
X-Twitter-OAuth1-Api-Secret — Your API Key Secret (Consumer Secret)

One-time setup per Ayrshare account. You create one X Developer App and reuse the same API Key and Secret across every sub-profile / end-user you link. You do not create a new app per customer.

Not linked yet? See the full setup guide to connect your X account.

Your keys are never logged or stored by Ayrshare.
Send a new direct message to a recipient.
Pricing & Limits: Each User Profile can have up to 1,000 active conversations per billing cycle across all social networks. Pricing depends on your plan: Premium plans pay a flat $49 per month add-on, while Launch and Business plans are billed at $0.09 per active conversation. A conversation is counted as active when you send a message to a recipient during the billing cycle; inbound messages alone do not count. The number of messages within an active conversation is unlimited.
  • You can send an emoji as part of the message text.
  • Facebook and Instagram mediaUrls must end in a known extension. Including query parameters will cause the media URL to fail.
WhatsApp 24-hour customer service window. WhatsApp Business only permits free-form outbound messages within 24 hours of the most recent message from the correspondent. After that window, message sends will be rejected by Meta until the correspondent messages again. Templated messages outside the 24-hour window are not currently supported through this endpoint.

Header Parameters

Path Parameters

string
required
The platform to send the message: facebook, instagram, twitter, whatsapp

Body Parameters

string
The ID of the message recipient. Required for Facebook, Instagram, and WhatsApp. For X/Twitter, send recipientId or conversationId.
  • For Facebook, Instagram, and X/Twitter this is the platform-specific user ID (PSID, IGSID, or user ID).
  • For WhatsApp this is the recipient’s phone number in E.164 digits-only format (for example 14155551234, not +1 (415) 555-1234).
string
The message to send to the recipient. Required unless mediaUrls or reaction is sent. Must be left out when sending a reaction.
  • Facebook, Instagram, and WhatsApp message may be an empty string or omitted entirely when mediaUrls is provided.
  • X requires a message of at least one character even if a mediaUrls is provided.
array
Array of media URLs for attaching images, video, audio (including voice messages), or documents.
  • URLs of media items should end in the file extension without additional parameters appended.
  • Facebook and Instagram support multiple media URLs.
  • X only accepts a single media URL.
  • Voice messages are supported on Facebook and Instagram as an aac or wav file.
  • WhatsApp accepts multiple media URLs. Ayrshare fetches each URL and uses its response Content-Type to select the WhatsApp media category. Meta accepts:
    • Image: .jpg, .jpeg, .png
    • Video: .mp4, .3gp
    • Audio: .aac, .amr, .mp3, .m4a, .ogg
    • Document: .txt, .pdf, .ppt, .pptx, .doc, .docx, .xls, .xlsx
string
X/Twitter only. Send the message into an existing conversation instead of to a recipientId. Get the ID from Get Messages.
object
WhatsApp only. React to a message instead of sending one. Do not send message or mediaUrls with a reaction.
  • messageId: Required. The ID of the WhatsApp message to react to.
  • emoji: Required. A single emoji. Send an empty string "" to remove your reaction.