---
title: Contacts
icon: users
description: Set up, configure, and run the Reloop contacts 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).


Subscriber profiles, groups, channels, custom properties, and suppression lists.

<Tip>
Run [`bun setup`](/docs/setup) once from the monorepo root. Env files come from `bun setup` / `bun env:setup`.
</Tip>


## Overview

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


## Quick start

```bash
bun be:contacts:dev
```

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


## Environment

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

```bash
PG_URL=postgresql://reloop:reloop123@localhost:5432/reloop
REDIS_URL=redis://:reloop123@localhost:6379
PORT=8014
BASE_URL="https://local.reloop.sh"
NATS_URL=nats://localhost:4222
PREFERENCES_SECRET="reloop-preferences-secret-key-change-in-prod"
NODE_ENV=development
```

`PREFERENCES_SECRET` signs preference-center tokens for [Links](/docs/setup/frontend/links). The service **refuses to start in production** if left at the default.

| Variable | Required | Default |
| :--- | :--- | :--- |
| `PG_URL` | **YES** | `postgresql://...` |
| `REDIS_URL` | **YES** | `redis://...` |
| `PORT` | **YES** | `8014` |
| `BASE_URL` | **YES** | `https://local.reloop.sh` |
| `NATS_URL` | **YES** | `nats://localhost:4222` |
| `PREFERENCES_SECRET` | Prod only | Dev default in `.env.dev` |


## Commands

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


## Architecture

| Layer | Detail |
| :--- | :--- |
| **Audience** | Contacts, groups, channels, and custom properties per organization |
| **Preferences** | Powers the [Links](/docs/setup/frontend/links) preference center |
| **Events** | Lifecycle events published to NATS under `contacts.*` |
| **Schema** | `contact`, `channel`, `group` in `packages/db/src/schema/` |


## Next

<CardGroup cols={2}>
  <Card icon="rocket" title="Setup" href="/setup">
    One-command local bootstrap
  </Card>
  <Card icon="globe" title="Port reference" href="/setup/port">
    Gateway routes and ports
  </Card>
  <Card icon="link" title="Links" href="/setup/frontend/links">
    Preference center UI
  </Card>
  <Card icon="workflow" title="Workflow" href="/setup/backend/workflow">
    Automations triggered by contacts
  </Card>
</CardGroup>
