Platform

Preview — pending review

This reference is generated from the platform API contract and is still under review. Operations, fields, and descriptions can change before publication.

Resolve the current session to a user, the tenant catalog and a default scope

GET
/account/whoami

Returns the identity behind the current session cookie or bearer token together with the full scope catalog the caller may operate in: every tenant the user belongs to, each tenant's subscriptions (with currency and default region) and each subscription's resource groups, plus the resolved default scope (tenant + subscription + project + region) the console should select on first load. The console calls this exactly once at boot and again after tenant switch; it drives the scope picker and the /t/{tenant}/s/{sub}/rg/{project} routing prefix. Validation: the session cookie (publiccloud_session) or bearer token must be present, unexpired and not revoked — anything else maps to 401 ErrUnauthenticated. No request parameters exist, so no field validation applies. Async & state: Synchronous read; no state change. No operations are created and no resource.updated SSE frames are emitted. Errors: 401 when the session/token is missing, expired or revoked; 500 on an internal failure resolving the user or the tenant catalog. A user with zero tenants still gets 200 with an empty tenants array and a null defaultScope. Idempotency/Concurrency: Safe, cacheable; no idempotency key required. Responses may be cached briefly client-side but must be refetched after login, logout or tenant switch.

Authorization

bearerToken
headerAuthorizationBearer <token>

An API token (pc_live_…) or a service-account key (sak_live_…), created in Identity & Access Management and sent as Authorization: Bearer <token>. Requests are rate limited per credential and per tenant: every response carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset, and a refused request gets 429 RATE_LIMITED with Retry-After.

Response Body

The authenticated user, their tenant/subscription/project catalog and default scope.

application/json
  1. response

The caller's identity and every tenant, subscription and project they can reach. Returned by GET /account/whoami.

user*

The authenticated principal.

tenants*array<>

Every tenant the user belongs to, with nested subscriptions and projects.

defaultScope*|null

Scope the console selects on first load. Null when the user has no tenants.

curl -X GET "https://example.com/account/whoami"
{  "user": {    "id": "string",    "name": "string",    "email": "string",    "photoUrl": "string"  },  "tenants": [    {      "id": "string",      "name": "string",      "status": "ACTIVE",      "suspension": {        "reason": "NON_PAYMENT",        "stage": "READ_ONLY",        "since": "2019-08-24T14:15:22Z",        "nextStage": "READ_ONLY",        "nextStageAt": "2019-08-24T14:15:22Z",        "overdueInvoiceCount": 0      },      "verificationStatus": "unverified",      "subscriptions": [        {          "id": "string",          "tenantId": "string",          "name": "string",          "currency": "USD",          "defaultRegion": "string",          "billingCountry": "string",          "pendingBillingCountry": {            "country": "string",            "effectiveFrom": "2019-08-24T14:15:22Z"          },          "projects": [            {              "id": "string",              "subscriptionId": "string",              "name": "string",              "provisioningState": "pending",              "origin": "PROVISIONED",              "importedAt": "2019-08-24T14:15:22Z",              "region": "string",              "permissions": {                "property1": "manage",                "property2": "manage"              }            }          ]        }      ]    }  ],  "defaultScope": {    "tenant": {      "id": "string",      "name": "string",      "status": "ACTIVE",      "suspension": {        "reason": "NON_PAYMENT",        "stage": "READ_ONLY",        "since": "2019-08-24T14:15:22Z",        "nextStage": "READ_ONLY",        "nextStageAt": "2019-08-24T14:15:22Z",        "overdueInvoiceCount": 0      },      "verificationStatus": "unverified"    },    "subscription": {      "id": "string",      "tenantId": "string",      "name": "string",      "currency": "USD",      "defaultRegion": "string",      "billingCountry": "string",      "pendingBillingCountry": {        "country": "string",        "effectiveFrom": "2019-08-24T14:15:22Z"      }    },    "project": {      "id": "string",      "subscriptionId": "string",      "name": "string",      "provisioningState": "pending",      "origin": "PROVISIONED",      "importedAt": "2019-08-24T14:15:22Z",      "region": "string",      "permissions": {        "property1": "manage",        "property2": "manage"      }    },    "region": "string"  }}