Skip to content
Account and onboarding

List workspaces

Lists the workspaces (companies) the signed-in person can open, with or without a Google Ads property: companyId, companyName, the person's role in it (admin, editor or viewer) and createdAt.

GET /companies

Scope read · Access Read only · Operation id companies.list

Try it

productmetrics runs after productmetrics login; curl needs PM_TOKEN (see Authentication).

productmetrics companies list --json

Response

API response (200):

{
  "data": {
    "companies": [
      {
        "companyId": "2a7d9b3c-1e4f-4a5b-8c6d-7e8f9a0b1c2d",
        "companyName": "Example Store",
        "role": "admin",
        "createdAt": "2026-11-02T09:30:00.000Z"
      }
    ]
  },
  "request_id": "req_01JBY64048KR3WPYVQH7ZV5NRD"
}

CLI output: productmetrics companies list --json prints { "ok": true, "data": …, "request_id": "…" } with the same data.

Before you call

Read it before companies.create: a returning person usually already has one; pass its companyId to setup.get_status as company_id.

Errors

A failure answers with its HTTP status and { error: { code, message, details? }, request_id }. Branch on code (stable, lower_snake); show message to the person. The CLI prints the same error with "ok": false.

{
  "error": {
    "code": "insufficient_scope",
    "message": "This operation needs the read scope; connect again and allow it.",
    "details": {
      "required_scope": "read"
    }
  },
  "request_id": "req_01J0ZJMVGT0YK31BGC5VWCSXMH"
}
StatusCodeWhen
401invalid_tokenThe token is missing, expired or revoked: sign in again (productmetrics login). The WWW-Authenticate header says why.
403insufficient_scopeThe token lacks the read scope (details.required_scope): sign in again and allow it.
429rate_limitedMore than 600 requests a minute for this person: wait the Retry-After seconds (60) and retry.

All Account and onboarding operations