Send Instagram DM
Input
username requiredInstagram handle without @, e.g. f1
dry_run optionalWhen true, everything runs — the conversation opens, the text is typed and the attachment is staged in the composer — and then the run stops before anything is sent. Nothing is delivered: messageId and mediaMessageId come back null and dry_run is true. Use it to verify a recipient, a message and an attachment are accepted without sending a real DM.
message optionalPlain text message to send. At least one of message, attachment or fileBase64 is required.
filename optionalFilename to send the attachment as, e.g. photo.png or clip.mp4. Required when fileBase64 is set; not used by the attachment input, which is stored under its own name.
mimeType optionalMIME type of the attachment; inferred from the filename extension when omitted. Applies to fileBase64 only.
threadUrl optionalOptional. An existing conversation URL (https://www.instagram.com/direct/t/<thread_id>/, from get_inbox). Use this to reach an account whose profile shows no Message control — a non-followed account renders only a Follow button, so the profile route cannot reach it even once a conversation exists.
attachment optionalAn image to attach, supplied as a file rather than base64. Preferred over fileBase64: it carries no payload size ceiling. The file is delivered to Instagram under the name 'attachment', since a file input's key is its stored filename.
fileBase64 optionalAttachment contents, base64-encoded (no data: prefix). Fallback for callers that cannot bind a file; prefer the attachment input. At least one of message, attachment or fileBase64 is required.
Output
username requirednotice optionalRecipient-side restriction banner visible in the thread right after sending, else null. May lag the server push — null does not guarantee delivery, and a stale banner has been observed on a send that landed.
dry_run optionalTrue when this run stopped before sending anything. The text was still typed and the attachment still staged — only the submit was skipped.
message optionalfilename optionalmessageId optionalid of the sent text message, null if no message was sent and null on a dry run
timestampMs optionalmediaMessageId optionalid of the sent image message, null if no image was sent and null on a dry run
mediaTimestampMs optional