# Instagram on boxd

> Instagram is a social media platform for sharing photos, videos, and stories. Only supports Instagram Business and Creator accounts, not Instagram Personal accounts.

- Page: https://boxd.sh/integrations/instagram/
- CLI: `run instagram` (36 commands, 14 marked common)
- SDK: `import { instagram } from "@boxd/run"`; every parameter and response type is at `@boxd/run/instagram`
- Triggers: none
- Connect: `run auth instagram` (Sign in with Instagram), or https://app.boxd.sh/integrations/detail/instagram
- All integrations: https://boxd.sh/integrations/ (Markdown: https://boxd.sh/integrations/index.md)

## From the shell

```sh
run auth instagram      # once: prints a link to connect your account
run instagram           # list its commands
run instagram get-ig-media --help
```

Parameters are flags (`--flag value`); object and array parameters take a JSON string. Output is YAML, or JSON with `--json`. Calls use your own connection; `--scope <name>` uses a connection shared with your team.

## From a script

```ts
import { every, instagram } from "@boxd/run";

every("1 hour", async () => {
  const result = await instagram.getIgMedia({ ig_media_id: "…" });
  console.log(result);
});
```

Run it with `run instagram.run.ts`. Instagram has no triggers; `every()` polls on a schedule, keeps the script running as a job, and wakes the machine when it is due.

## Commands

Required flags are listed; `run instagram <command> --help` lists the optional ones. "common" marks what `run instagram` shows without `--all`.

| Command | SDK method | Required flags | Optional | Description |
|---|---|---|---|---|
| `create-carousel-container` ·common | `instagram.createCarouselContainer()` | `--ig-user-id` | 9 | Create a draft carousel post with multiple images/videos before publishing |
| `create-media-container` ·common ·deprecated | `instagram.createMediaContainer()` | — | 14 | Use post-ig-user-media instead |
| `create-post` ·common ·deprecated | `instagram.createPost()` | `--creation-id` `--ig-user-id` | 1 | Use post-ig-user-media-publish instead |
| `delete-comment` | `instagram.deleteComment()` | `--ig-comment-id` | 1 | Delete a comment on Instagram media |
| `delete-messenger-profile` | `instagram.deleteMessengerProfile()` | `--fields` `--ig-user-id` | 1 | Delete ice breakers or a persistent menu from an Instagram messenger profile |
| `get-conversation` | `instagram.getConversation()` | `--conversation-id` | 1 | Get details about a specific Instagram DM conversation (participants, etc) |
| `get-ig-comment-replies` | `instagram.getIgCommentReplies()` | `--ig-comment-id` | 5 | Get replies to a specific Instagram comment |
| `get-ig-media` ·common | `instagram.getIgMedia()` | `--ig-media-id` | 2 | Get a published Instagram Media object (photo, video, story, reel, or carousel) |
| `get-ig-media-children` | `instagram.getIgMediaChildren()` | `--ig-media-id` | 2 | Get media objects (images/videos) that are children of an Instagram carousel/album post |
| `get-ig-media-comments` ·common | `instagram.getIgMediaComments()` | `--ig-media-id` | 5 | Retrieve comments on an Instagram media object |
| `get-ig-media-insights` ·common | `instagram.getIgMediaInsights()` | `--ig-media-id` `--metric` | 3 | Get insights and metrics for Instagram media objects (photos, videos, reels, carousel albums) |
| `get-ig-user-content-publishing-limit` | `instagram.getIgUserContentPublishingLimit()` | — | 4 | Get an Instagram Business Account's current content publishing usage |
| `get-ig-user-live-media` | `instagram.getIgUserLiveMedia()` | — | 3 | Get live media objects during an active Instagram broadcast |
| `get-ig-user-media` ·common | `instagram.getIgUserMedia()` | `--ig-user-id` | 8 | Get Instagram user's media collection (posts, photos, videos, reels, carousels) |
| `get-ig-user-stories` | `instagram.getIgUserStories()` | — | 6 | Get active story media objects for an Instagram Business or Creator account |
| `get-ig-user-tags` ·deprecated | `instagram.getIgUserTags()` | `--ig-user-id` | 5 | because the Instagram API with Instagram Login does not support tagging |
| `get-messenger-profile` | `instagram.getMessengerProfile()` | `--ig-user-id` | 2 | Get the messenger profile settings for an Instagram account |
| `get-page-conversations` ·common | `instagram.getPageConversations()` | `--ig-user-id` | 4 | Get Instagram conversations for a Page connected to an Instagram Business account |
| `get-post-comments` ·deprecated | `instagram.getPostComments()` | `--ig-post-id` | 5 | Use get-ig-media-comments instead |
| `get-post-insights` ·deprecated | `instagram.getPostInsights()` | `--ig-post-id` | 3 | Use get-ig-media-insights instead |
| `get-post-status` ·deprecated | `instagram.getPostStatus()` | `--creation-id` | 1 | Use GetIgMedia instead |
| `get-user-info` | `instagram.getUserInfo()` | — | 2 | Get Instagram Business Account info including profile details and statistics |
| `get-user-insights` | `instagram.getUserInsights()` | — | 9 | Get Instagram account-level insights and analytics (profile views, reach, follower count, etc.) |
| `get-user-media` ·deprecated | `instagram.getUserMedia()` | — | 4 | Use get-ig-user-media instead |
| `list-all-conversations` | `instagram.listAllConversations()` | — | 6 | List all Instagram DM conversations for the authenticated user |
| `list-all-messages` | `instagram.listAllMessages()` | `--conversation-id` | 3 | List all messages from a specific Instagram DM conversation |
| `mark-seen` | `instagram.markSeen()` | `--recipient-id` | 2 | Mark Instagram DM messages as read/seen for a specific user |
| `post-ig-comment-replies` ·common | `instagram.postIgCommentReplies()` | `--ig-comment-id` `--message` | 1 | Create a reply to an Instagram comment |
| `post-ig-media-comments` ·common | `instagram.postIgMediaComments()` | `--ig-media-id` `--message` | 1 | Create a comment on an Instagram media object |
| `post-ig-user-media` ·common | `instagram.postIgUserMedia()` | `--ig-user-id` | 16 | Create a media container for Instagram posts |
| `post-ig-user-media-publish` ·common | `instagram.postIgUserMediaPublish()` | `--creation-id` `--ig-user-id` | 3 | Publish a media container to an Instagram Business account |
| `post-ig-user-mentions` | `instagram.postIgUserMentions()` | `--ig-user-id` `--media-id` `--message` | 2 | Reply to a mention of your Instagram Business or Creator account |
| `reply-to-comment` ·deprecated | `instagram.replyToComment()` | `--ig-comment-id` `--message` | 1 | Use post-ig-comment-replies instead |
| `send-image` | `instagram.sendImage()` | `--image-url` `--recipient-id` | 2 | Send an image via Instagram DM to a specific user |
| `send-text-message` ·common | `instagram.sendTextMessage()` | `--recipient-id` `--text` | 3 | Send a text message to an Instagram user via DM in an existing conversation |
| `update-messenger-profile` ·common | `instagram.updateMessengerProfile()` | `--ice-breakers` `--ig-user-id` | 1 | Update the messenger profile settings for an Instagram account |

## Docs

- [run CLI](https://docs.boxd.sh/cli/run): Call connected integrations from the shell, connect new ones, and run automations.
- [Quickstart](https://docs.boxd.sh/guides/integrations/quickstart): Connect an integration, call it from the shell, and turn a script into an automation.
- [Connections](https://docs.boxd.sh/guides/integrations/connections): Connect an account once, for yourself or for your whole organization.
- [Scripts](https://docs.boxd.sh/guides/automations/scripts): Typed integrations, triggers, schedules and state in a .run.ts file.
- [Jobs](https://docs.boxd.sh/guides/automations/jobs): How a script becomes a background job: states, retries, sleep and wake.
- [Beyond the catalog](https://docs.boxd.sh/guides/automations/beyond-the-catalog): Reach your own APIs, databases and cloud accounts from a script.
