---
title: Inbox
icon: inbox
description: Set up, configure, and run the Reloop inbox microservice locally.
---
> For the complete documentation index, see [llms-docs.txt](/llms-docs.txt) or the site index [llms.txt](/llms.txt). Full docs corpus: [llms-full-docs.txt](/llms-full-docs.txt). Prefer markdown URLs (append `.md`) for agent consumption. Product skill: [skill.md](/skill.md).


Agent Inbox API — mailboxes, threads, and messages from inbound email via NATS.

<Tip>
Run [`bun setup`](/docs/setup) once from the monorepo root. That starts Docker including [inbound](/docs/setup/backend/inbound) for live MX on port `25`.
</Tip>


## Overview

| Property | Value |
| :--- | :--- |
| **Directory** | `apps/backend/inbox` |
| **Port** | `8021` |
| **Local URL** | [https://local.reloop.sh/api/inbox](https://local.reloop.sh/api/inbox) |
| **Swagger UI** | [https://local.reloop.sh/api/inbox/openapi](https://local.reloop.sh/api/inbox/openapi) |
| **Stack** | ElysiaJS · PostgreSQL · Redis · NATS |


## Quick start

```bash
bun be:inbox:dev
```

Or `bun backend:dev` / `bun dev`.


## Environment

`apps/backend/inbox/.env` — from `bun setup` / `bun env:setup`.

```bash
PG_URL=postgresql://reloop:reloop123@localhost:5432/reloop
REDIS_URL=redis://:reloop123@localhost:6379
PORT=8021
BASE_URL="https://local.reloop.sh"
NATS_URL=nats://localhost:4222
NODE_ENV=development
```

| Variable | Required | Default |
| :--- | :--- | :--- |
| `PG_URL` | **YES** | `postgresql://...` |
| `REDIS_URL` | **YES** | `redis://...` |
| `PORT` | **YES** | `8021` |
| `NATS_URL` | **YES** | `nats://localhost:4222` |


## Commands

| Command | Description |
| :--- | :--- |
| `bun be:inbox:dev` | Start dev server with hot reloading |
| `bun run --filter=be-inbox build` | Compile production bundle |
| `bun run --filter=be-inbox start` | Run compiled production build |
| `bun run --filter=be-inbox check-types` | TypeScript type-check |


## Architecture

| Layer | Detail |
| :--- | :--- |
| **Inbound flow** | [inbound](/docs/setup/backend/inbound) MTA → NATS → inbox persistence |
| **Attachments** | File storage via [upload](/docs/setup/backend/upload) (no direct S3 config on inbox) |
| **Dashboard API** | Mailboxes, threads, and messages at `/api/inbox` |


## Next

<CardGroup cols={2}>
  <Card icon="rocket" title="Setup" href="/setup">
    One-command local bootstrap
  </Card>
  <Card icon="mail-receive" title="Inbound" href="/setup/backend/inbound">
    MX edge that feeds this service
  </Card>
  <Card icon="image-upload" title="Upload" href="/setup/backend/upload">
    Attachment storage
  </Card>
  <Card icon="home" title="Dashboard" href="/setup/frontend/dashboard">
    Agent Inbox UI
  </Card>
</CardGroup>
