---
title: "Issue live connection credentials for a service in an environment"
method: POST
path: "/external-services/{id}/projects/{project_id}/environments/{environment_id}/runtime-credentials"
tags: ["External Services"]
---

# Issue live connection credentials for a service in an environment

`POST /external-services/{id}/projects/{project_id}/environments/{environment_id}/runtime-credentials`

## 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}/projects/{project_id}/environments/{environment_id}/runtime-credentials`
- Auth: HTTP bearer

Provisions the per-tenant database if it does not exist yet, then returns
the connection variables in plaintext — the same values a deployment gets
injected at runtime.

**This is a POST because it is not a read.** It creates a database as a
side effect, and its response is a live credential: a GET would be
prefetchable, cacheable, and liable to end up in a proxy access log with
the whole connection in the URL's neighbourhood. Nothing about it is safe
or idempotent in the HTTP sense.

Intended for callers that need to *connect* an application to a managed
service — the console's own deploy path does this in-process; external
plugins reach it here. For inspecting configuration, use the masked bulk
read or the single-variable reveal instead.

## Path parameters

- `id` integer, required
- `project_id` integer, required
- `environment_id` integer, required

## Response `200`

Connection credentials issued

- RuntimeCredentialsResponse: Live connection variables for a service in one environment. Every value is plaintext — this is the response of the audited issuance endpoint, not of the masked bulk read. Callers must treat it as a credential: do not log it, do not cache it, do not put it in an error.
  - `variables` object, required: Connection variables, e.g. `POSTGRES_URL`, `POSTGRES_PASSWORD`.

## Other responses

- `400`: The service type or its stored configuration cannot issue connection credentials
- `403`: Plaintext secret access is not permitted
- `404`: Service, project, or environment not found
- `409`: Service is not linked to the project
- `500`: Internal server error

## Changes

- **2026-11-04** `aa6ea92a9415`: 1 info
  - added the non-success response with the status `400`
- **2026-09-07** `38e97c3c35dd`: 1 info
  - endpoint added
- **2026-09-07** `f7404eb7ac98`: 1 breaking
  - api path removed without deprecation
- **2026-08-11** `c24b47a04260`: 1 info
  - endpoint added

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