> ## Documentation Index
> Fetch the complete documentation index at: https://docs.indm.social/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Create a key, make your first call, and put your newest reel to work.

By the end of this page your newest reel answers every comment that says `GUIDE` with a DM carrying your link. You need an inDM workspace with an Instagram account connected.

**1. Create an API key**

In the inDM app, open **Settings → API keys** and choose **Create key**. Give it a name you'll recognise later, choose **Full access**, and keep the default expiry of 90 days.

The secret is shown once. Copy it straight into your environment:

```bash theme={null}
export INDM_API_KEY="indm_..."
```

Every example below reads the key from `INDM_API_KEY`. Keep it out of your code and out of any browser. [Authentication](https://docs.indm.social/authentication.md) explains why.

**2. Check that it works**

Ask who you are. If this answers, your key works.

```bash curl theme={null}
curl https://api.indm.social/v1/workspace \
  -H "Authorization: Bearer $INDM_API_KEY"
```

```javascript Node theme={null}
const res = await fetch("https://api.indm.social/v1/workspace", {
  headers: { Authorization: `Bearer ${process.env.INDM_API_KEY}` },
});
console.log(await res.json());
```

```python Python theme={null}
import os
import requests

res = requests.get(
    "https://api.indm.social/v1/workspace",
    headers={"Authorization": f"Bearer {os.environ['INDM_API_KEY']}"},
)
print(res.json())
```

```json Response theme={null}
{
  "id": "2c5e8a1b-7f3d-4c9e-b0a2-5d6e7f8a9b0c",
  "name": "Maya's Studio",
  "plan": "growth",
  "key": {
    "id": "5e7d9c1b-3a2f-4e6d-8b0c-9a1f2e3d4c5b",
    "name": "Quickstart",
    "scope": "full",
    "prefix": "indm_7Kq",
    "expires_at": "2027-02-03T09:14:00Z"
  }
}
```

**3. Find your newest reel**

[List media](https://docs.indm.social/api-reference/media/list-media.md) returns what inDM has synced, newest first. Take the first item whose `type` is `reel`.

```bash curl theme={null}
curl "https://api.indm.social/v1/media?limit=10" \
  -H "Authorization: Bearer $INDM_API_KEY"
```

```javascript Node theme={null}
const headers = { Authorization: `Bearer ${process.env.INDM_API_KEY}` };

const media = await fetch("https://api.indm.social/v1/media?limit=10", { headers })
  .then((r) => r.json());
const reel = media.data.find((item) => item.type === "reel");
console.log(reel.id, reel.caption);
```

```python Python theme={null}
headers = {"Authorization": f"Bearer {os.environ['INDM_API_KEY']}"}

media = requests.get(
    "https://api.indm.social/v1/media",
    params={"limit": 10},
    headers=headers,
).json()
reel = next(item for item in media["data"] if item["type"] == "reel")
print(reel["id"], reel["caption"])
```

> [!TIP]
>
> Published it a minute ago and it isn't there yet? inDM syncs on a schedule. [Refresh, then automate the post you just published](https://docs.indm.social/recipes/refresh-then-automate.md) pulls it in now.

**4. Build the automation**

[Create an automation](https://docs.indm.social/api-reference/automations/create-automation.md) on that reel. Anyone who comments `GUIDE` gets a public reply and a DM with your link. It is saved as a `draft`, so nothing reaches anyone yet.

```bash curl theme={null}
curl https://api.indm.social/v1/automations \
  -H "Authorization: Bearer $INDM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "media_id": "3d2a7f10-9c4e-4b8a-a1f2-6e0b5d7c9a31",
    "keywords": ["GUIDE"],
    "public_reply": "Sent it to your DMs.",
    "dm_message": "Here is the spring planting guide. Enjoy it.",
    "button_label": "Send me the guide",
    "link_url": "https://example.com/spring-guide"
  }'
```

```javascript Node theme={null}
const automation = await fetch("https://api.indm.social/v1/automations", {
  method: "POST",
  headers: { ...headers, "Content-Type": "application/json" },
  body: JSON.stringify({
    media_id: reel.id,
    keywords: ["GUIDE"],
    public_reply: "Sent it to your DMs.",
    dm_message: "Here is the spring planting guide. Enjoy it.",
    button_label: "Send me the guide",
    link_url: "https://example.com/spring-guide",
  }),
}).then((r) => r.json());
console.log(automation.id, automation.status); // "draft"
```

```python Python theme={null}
automation = requests.post(
    "https://api.indm.social/v1/automations",
    headers=headers,
    json={
        "media_id": reel["id"],
        "keywords": ["GUIDE"],
        "public_reply": "Sent it to your DMs.",
        "dm_message": "Here is the spring planting guide. Enjoy it.",
        "button_label": "Send me the guide",
        "link_url": "https://example.com/spring-guide",
    },
).json()
print(automation["id"], automation["status"])  # "draft"
```

The response is the automation as saved. If anything was adjusted on the way in, `caveats` says what.

**5. Set it live**

One call, and the reel starts answering.

```bash curl theme={null}
curl https://api.indm.social/v1/automations/9a4b1c7e-2d3f-4a5b-8c6d-1e2f3a4b5c6d/status \
  -H "Authorization: Bearer $INDM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"status": "live"}'
```

```javascript Node theme={null}
await fetch(`https://api.indm.social/v1/automations/${automation.id}/status`, {
  method: "POST",
  headers: { ...headers, "Content-Type": "application/json" },
  body: JSON.stringify({ status: "live" }),
});
```

```python Python theme={null}
requests.post(
    f"https://api.indm.social/v1/automations/{automation['id']}/status",
    headers=headers,
    json={"status": "live"},
)
```

It's live. Your reel is working for you now: comment `GUIDE` from another account and watch the DM arrive.

## Where to next

> [card] [Instagram's rules](https://docs.indm.social/instagram-rules.md)
>
> One private reply per comment, the 24-hour window, three links. Worth five minutes before you build more.

> [card] [Read how it's doing](https://docs.indm.social/recipes/read-automation-results.md)
>
> Pull stats into your own reporting.

> [card] [Errors](https://docs.indm.social/errors.md)
>
> Every error code, what it means, and the fix.

> [card] [API reference](https://docs.indm.social/api-reference/introduction.md)
>
> Every endpoint and field.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.