List and Get a Tenant

Stable

How to get the list of tenants, details of one tenant, and where to read its PostgreSQL credentials separately.

Updated: March 5, 2026

The list and get operations are needed for resource inventory and for everyday tenant state checks.

List tenants

Through CLI:

spgctl tenant list

Through the API:

GET /v2/tenants

This call is convenient when you want to quickly understand which tenants are available to the current token.

Get details of one tenant

Through CLI:

spgctl tenant get --name acme

Through the API:

GET /v2/tenants/:tenant

In the response, it is usually useful to look at:

  • the tenant name;
  • the creation date;
  • the number of databases;
  • whether the tenant belongs to your access scope.

Where to read credentials

It is important not to confuse get tenant with get tenant credentials.

Tenant PostgreSQL credentials are read through a separate call:

GET /v2/tenants/:tenant/credentials

This route is exactly what returns:

  • pg_user;
  • pg_password;
  • dsn_template.

Practical conclusion

  • use list and get to navigate the resource catalog;
  • use the separate credentials route when you specifically need the DSN and connection secrets;
  • do not store tenant credentials in places where the normal inventory response is enough.