Issue one time-bound PostgreSQL credential for Dev or Prod

Owner-authorized direct PostgreSQL login for the project's own database, returned exactly once and never retrievable again. Mode read joins the read-only role, mode write joins the same restricted runtime role the application uses; neither can change schema, and application row-level security policies remain effective. The lifetime is 5 minutes to 24 hours (3600 seconds by default) and PostgreSQL refuses new logins after it; the platform ends remaining sessions within 15 minutes after expiry, at the latest. At most three active credentials exist per project environment. Database compute wakes and is metered normally, and existing credit grace and Stop budgets apply. Revoke the credential as soon as the work is finished and never store the connection URI in files, notes or source.

post/v1/projects/{project_id}/database/access

Request

  • Base URL: https://app.ohmyho.st
  • URL: https://app.ohmyho.st/v1/projects/{project_id}/database/access
  • Auth: HTTP bearer

Path parameters

project_idstring required

Project identifier.

Headers

X-Request-Idstring

Optional caller-provided correlation identifier.

Request body

environment'dev' | 'prod' required
mode'read' | 'write'

read joins the read-only role; write joins the restricted runtime role. Neither can change schema.

ttl_secondsinteger

Credential lifetime between 5 minutes and 24 hours.

labelstring nullable

Optional customer label without control characters or surrounding whitespace.

Response

The connection URI is returned once and is never persisted in plaintext.

access_idstring required
environment'dev' | 'prod' required
mode'read' | 'write' required
role_namestring required
hoststring required
database'neondb' required
labelstring nullable required
state'active' | 'expired' | 'revoked' required
issued_atstring date-time required
expires_atstring date-time required
revoked_atstring date-time nullable required
revocation_reason'principal' | 'expired' | 'budget' | 'creation_failed' | 'data_change' | 'null' nullable required
connection_uristring uri required

Returned exactly once. Use it immediately and never store it in files, notes or source.

psql_commandstring required

The same credential as a ready psql invocation.

Changes

No recorded changes to this operation across all 1 revision of this API.