# App Home

> Give each person a Home tab in your app's conversation with views.publish, and know when they open it with app_home_opened.

Every bot has its own conversation with each person. When your app publishes a Home view, that conversation gets a **Home** tab next to **Messages** — a personal dashboard built from [blocks](https://workstation.repzo.com/docs/developers/block-kit/blocks), with working buttons, menus and pickers.

## Publish a Home tab

```http
POST /api/bot/views.publish
Authorization: Bearer foxa-…
```

```json
{
  "user_id": "42bc76d7-…",
  "view": {
    "type": "home",
    "blocks": [
      { "type": "header", "text": { "type": "plain_text", "text": "Your refunds" } },
      {
        "type": "section",
        "text": { "type": "mrkdwn", "text": "*3* refunds are waiting for you." },
        "accessory": { "type": "button", "action_id": "open_form", "style": "primary", "text": { "type": "plain_text", "text": "New refund" } }
      }
    ]
  }
}
```

Each person has one Home view per app; publishing again replaces it, and the open tab updates at once. Pass the `hash` from the last publish to avoid overwriting a newer one (`hash_conflict`). The view holds up to 100 blocks and no title or submit button.

Controls in the Home tab send `block_actions` with `container: { "type": "view", "view_id": "…" }` and a `trigger_id`, so a Home button can [open a modal](https://workstation.repzo.com/docs/developers/chat-apps/modals).

## Know when it's opened

Subscribe your bot to the `app_home_opened` event (an event subscription listing it, or the API: `POST /api/v1/events/subscriptions`). When the person opens the conversation, you get:

```json
{
  "type": "event_callback",
  "event_id": "evt_…",
  "event": {
    "type": "app_home_opened",
    "user": "42bc76d7-…",
    "channel": "3f5b15e4-…",
    "tab": "home",
    "view": { "id": "235b2941-…", "type": "home", … }
  }
}
```

`tab` is `home` or `messages`; `view` is there when you have already published one. A good pattern is to publish (or refresh) the Home view whenever you get this event.

> **Differs from Slack**
>
> Slack sends `app_home_opened` every time; Workstation sends it at most once a minute per person and tab. There is no **About** tab.

The Home tab shows when your app has published a view for the person or subscribes to `app_home_opened`.

## Related

- [Modals](https://workstation.repzo.com/docs/developers/chat-apps/modals)
- [Interactivity](https://workstation.repzo.com/docs/developers/chat-apps/interactivity)
- [Blocks](https://workstation.repzo.com/docs/developers/block-kit/blocks)
