---
title: "List services linked to a project"
method: GET
path: "/external-services/projects/{project_id}"
tags: ["External Services"]
---

# List services linked to a project

`GET /external-services/projects/{project_id}`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/external-services/projects/{project_id}`
- Auth: none declared

## Path parameters

- `project_id` integer, required

## Query parameters

- `page` integer
- `page_size` integer
- `sort_by` string
- `sort_order` string

## Response `200`

List of services linked to project

- ProjectServiceInfo[]
  - `custom_database_name` string, nullable
  - `database_provisioning_mode` 'project' | 'project_environment' | 'custom', required: Controls which logical database a deployment receives through a project-to-service link.
  - `id` integer, required
  - `project` ProjectInfo, required
    - `created_at` string, required
    - `id` integer, required
    - `slug` string, required
  - `service` ExternalServiceInfo, required
    - `connection_info` string, nullable
    - `continuous_archive_pinned_at` string, nullable: When `continuous_archive_s3_source_id` was last set. Null alongside a non-null source id means it was set by the original provisioning flow rather than an explicit repoint.
    - `continuous_archive_s3_source_id` integer, nullable: S3 source ID that this service's continuous archiving (Postgres/ Timescale WAL-G `archive_command`, or MariaDB's binlog shipper) currently writes to. Null for service types with no continuous archiving concept, or a Postgres/MariaDB service that has never had one provisioned. Change it with `repoint_continuous_archive_source`.
    - `created_at` string, required
    - `error_message` string, nullable: Error message from failed initialization.
    - `id` integer, required
    - `members` ServiceMemberInfo[]: Cluster members (empty for standalone services).
      - `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
    - `metrics_enabled` boolean: Whether metric collection is enabled for this service. The UI uses this to decide whether to poll the monitoring endpoints.
    - `name` string, required
    - `node_id` integer, nullable: Node ID where the service runs. Null means control plane (local).
    - `readiness` ServiceReadiness, nullable: Startup readiness of a service that is `starting` or failed to start.
      - `deadline_secs` integer, required: How long the gate waits before reporting failure.
      - `failure` InitializationFailure, nullable: A failed initialization, as shown to the operator.
        - `kind` 'store_init_failed' | 'restart_loop' | 'timeout', required: Why the gate gave up.
        - `log_excerpt` string[], required: Container log lines that explain the failure, oldest first. Secrets are redacted. Empty when the logs could not be read.
        - `next_actions` ReadinessNextAction[], required: Suggested next steps, most useful first.
        - `reason` string, required: What happened, including the last probe's typed reason.
      - `phase` 'starting' | 'failed', required: Where the gate is for a service.
      - `reason` string, nullable: Latest reason the service is not usable yet, from the engine's authenticated probe. Null before the first probe.
      - `restart_count` integer, required: Container restarts since the gate started.
      - `started_at` string, required: When the gate started waiting (ISO 8601, UTC).
    - `service_type` 'mariadb' | 'mongodb' | 'postgres' | 'redis' | 's3' | 'kv' | 'blob' | 'rustfs' | 'minio', required
    - `status` string, required
    - `topology` string, required: Service topology: "standalone" (single container) or "cluster" (HA multi-member).
    - `updated_at` string, required
    - `version` string, nullable

## Other responses

- `404`: Project not found
- `500`: Internal server error

## Changes

- **2026-10-09** `c2e6bffeca6c`: 1 info
  - added the optional property `items/service/readiness` to the response with the `200` status
- **2026-09-11** `ab8f07233f81`: 2 info
  - added the optional property `items/custom_database_name` to the response with the `200` status
  - added the required property `items/database_provisioning_mode` to the response with the `200` status
- **2026-09-11** `cac7526901ad`: 1 breaking, 1 warning
  - removed the required property `items/database_provisioning_mode` from the response with the `200` status
  - removed the optional property `items/custom_database_name` from the response with the `200` status
- **2026-09-11** `8b0ca7a1320f`: 2 info
  - added the optional property `items/custom_database_name` to the response with the `200` status
  - added the required property `items/database_provisioning_mode` to the response with the `200` status
- **2026-09-07** `cfd9d4606e8c`: 2 info
  - added the optional property `items/service/continuous_archive_pinned_at` to the response with the `200` status
  - added the optional property `items/service/continuous_archive_s3_source_id` to the response with the `200` status

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/external-services/projects/:project_id/get.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)
