Instagram API for AI agents
Let your AI agent answer your Instagram DMs and comments: it reads and replies to messages with photos and files, answers comments on your posts, and moves a comment into a private message when Instagram allows it.
What your agent can do on Instagram
- Answer DMs, with photos and files
- Publish feed posts and stories, with a caption and location
- Read and answer comments on your posts
- Turn a comment into a private message, when Instagram allows it
- See how your posts do: likes and comments
Three steps
- Start a trial and connect Instagram. You sign in to Instagram through a secure link and approve the connection.
- Add Spaces to your AI agent with one URL,
https://api.spacesos.com/mcp/instagram, or use the REST API athttps://api.spacesos.com/v1. Steps for each AI client. - Your agent reads and answers. Spaces paces every message inside the limits that keep the account safe.
Or paste this into your agent and let it set things up with you:
Set up Spaces for me by following https://www.spacesos.com/agentsThe core tools
| What it does | MCP tool | REST |
|---|---|---|
| Your conversations, newest first. Filter to unread. | list_messaging_chats | GET …/chats |
| The messages in one conversation. | list_messaging_messages | GET …/chats/{chat_id}/messages |
| An image, file, voice note or video from a message. | get_messaging_attachment | GET …/chats/{chat_id}/messages/{message_id}/attachments/{attachment_id} |
| Reply in a conversation, with text or attachments. | reply_in_chat | POST …/chats/{chat_id}/messages |
| Start a new conversation with someone who expects to hear from you. | start_chat | POST …/chats |
| Send a message at a set local time, inside working hours you choose. | schedule_message | POST /v1/messaging/schedules |
Only on Instagram
| What it does | MCP tool | REST |
|---|---|---|
| Your own posts with their numbers: likes or reactions, comments, reposts, impressions, and on LinkedIn clicks, engagement and reach. | list_own_posts | GET …/posts |
| Publish a post: text, images or video and a link preview on LinkedIn; a feed post or story with a caption and location on Instagram. | create_post | POST …/posts |
| Comments on a post. | list_comments | GET …/posts/{post_id}/comments |
| Comment on a post, or answer a comment. | comment_on_post | POST …/posts/{post_id}/comments |
| Delete one of your comments. | delete_comment | DELETE …/posts/{post_id}/comments/{comment_id} |
| React to a comment. | react_to_comment | POST …/posts/{post_id}/comments/{comment_id}/reactions |
| Answer a comment with a private message, when the platform allows it. | private_reply | POST …/posts/{post_id}/comments/{comment_id}/private-reply |
| Reactions on a post or, with comment_id, a comment. | list_post_reactions | GET …/posts/{post_id}/reactions |
Every Instagram tool · Instagram MCP guide · Full reference
Limits that keep the account safe
Up to 80 messages a day per account, at least 15 seconds apart, with 20 new chats a day at most and a four-week warm-up for new accounts. Instagram limits in full · How accounts are kept safe.
FAQ
Can an AI agent reply to Instagram DMs automatically?
Yes. Your agent reads new DMs and replies in the same chat through Spaces, inside Instagram’s safe limits. Replying to everyone who messages you is fine, just as it is in the app.
Can it answer comments on my posts?
Yes. Your agent can read comments, reply to them, react to them and, where Instagram allows it, answer a comment with a private message.
Do I need a Facebook developer app?
No. You sign in to Instagram through a secure link and approve the connection. There is no app review to wait for.
How much does the Instagram API cost?
Plans from $19 a month for one connected account, with a trial. You pay per connected account, not per message or per contact.