---
title: "Begin adding a single new member to a running cluster."
method: POST
path: "/external-services/{id}/members"
tags: ["External Services"]
---

# Begin adding a single new member to a running cluster.

`POST /external-services/{id}/members`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/external-services/{id}/members`
- Auth: HTTP bearer

Currently only `replica` members can be added at runtime. The
response is **202 Accepted** as soon as the validation passes and
the placeholder `service_members` row is inserted. The actual
container provisioning + DNS registration runs in the background;
poll `GET /external-services/{id}/members/{member_id}` to watch
`provisioning_step` advance through the phases.

## Path parameters

- `id` integer, required

## Request body

- AddClusterMemberRequest: Request body for adding a single member to a running cluster.
  - `node_id` integer, nullable: Target worker node ID. Omit or null to run on the control plane.
  - `role` string, required: Member role. Currently only `replica` is accepted at runtime — monitor is a singleton, primary is elected by pg_auto_failover.

## Response `202`

Cluster member provisioning started

- ServiceMemberInfo: Public info about a cluster member.
  - `compute_ip` string, nullable: Container's IP on the `temps-overlay` multi-host network. Populated by the lifecycle hook (ADR-011 Phase 3); `None` on single-host clusters where the overlay isn't attached.
  - `container_name` string, required
  - `hostname` string, nullable
  - `id` integer, required
  - `live_state` string, nullable: Live FSM state from the pg_auto_failover monitor (`primary`, `secondary`, `catchingup`, `report_lsn`, …). `None` when the monitor is unreachable, the service is not a cluster, or the row is the monitor itself. **The UI must render the role badge from this field**, falling back to `role` only when `live_state` is null. `role` is now config-only (`monitor` or `replica`); flipping the badge to "primary" when the monitor elects a new one used to require a reconciler that lagged ~5s behind real failovers — and during that window the UI showed two primaries. `live_state` is read directly from the monitor on every list, so it can never lag.
  - `node_id` integer, nullable
  - `ordinal` integer, required
  - `port` integer, nullable
  - `provisioning_error` string, nullable: Most recent provisioning failure message, when `status='failed'`. Set by the background task so the UI can show *why* the new replica didn't come up.
  - `provisioning_step` string, nullable: Last-attempted phase of the async `add_cluster_member` background task (e.g. `validating`, `provisioning_container`, `done`, `failed`). `None` for members not created through that flow — the UI falls back to the `status` column for those.
  - `role` string, required: Configured member kind. For a PostgreSQL cluster this is `monitor` or `replica`, and every data node is `replica`, including the current primary: which node is primary is runtime state, read it from `live_state`.
  - `status` string, required

## Other responses

- `400`: Validation failed (wrong topology, status, or role)
- `403`: Insufficient permissions or deployment-token caller
- `404`: Service or requested node not found
- `409`: The member cannot be placed as requested, or this process has no local Docker daemon
- `500`: Internal server error

## Changes

- **2026-11-04** `33d4c89a8028`: 1 info
  - added the non-success response with the status `409`
- **2026-10-20** `7ee3ab1b2020`: 1 info
  - added the non-success response with the status `403`
- **2026-05-30** `b72341d12f63`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/external-services/:id/members/post.md)

---

[API](https://skmtc.dev/gotempsh/apis/temps.md) - [All operations](https://skmtc.dev/gotempsh/apis/temps/llms.txt) - [OpenAPI document](https://skmtc.dev/gotempsh/apis/temps/revisions/3b040526eb43?raw)
