Initializing Operalta...

Metrics

Live KPIs, historical series, published snapshots, and metric preferences.

Audience
Developer
Truth
Mixed sources
Surface
API
Status
Active

Related documentation: Developer documentation

GET
/api/company/metrics

Authorization

BearerAuth
AuthorizationBearer <token>

API key obtained from Operalta Settings → API Keys. Format: op_xxxxx. Pass as Authorization: Bearer op_....

In: header

Query Parameters

companyId*string

UUID of the company. Alternatively, pass as X-Company-Id request header.

Formatuuid
period?string

Only the latest live actuals are available on this endpoint. Use /api/metrics/series for history.

Default"current"
Value in"current"

Header Parameters

X-Company-Id?string

Company UUID. Alternative to the companyId query parameter.

Formatuuid

Response Body

application/json

application/json

application/json

curl -X GET "https://example.com/api/company/metrics?companyId=497f6eca-6276-4993-bfeb-53cbbbba6f08"
{
  "metrics": {
    "mrr": 0,
    "arr": 0,
    "runway": 0,
    "headcount": 0,
    "customer_count": 0,
    "churn_rate": 0,
    "mrr_growth": 0,
    "burn": 0,
    "nrr": 0,
    "ltv": 0,
    "cac": 0,
    "ltv_cac_ratio": 0,
    "property1": 0,
    "property2": 0
  },
  "source": "company_metrics_actual",
  "mode": "live_actual",
  "currency": "string",
  "periodKey": "string",
  "period": "string",
  "asOf": "2019-08-24T14:15:22Z"
}
{
  "error": "string",
  "status": 0,
  "details": {}
}
{
  "error": "string",
  "status": 0,
  "details": {}
}
GET
/api/metrics/catalog

Authorization

BearerAuth
AuthorizationBearer <token>

API key obtained from Operalta Settings → API Keys. Format: op_xxxxx. Pass as Authorization: Bearer op_....

In: header

Query Parameters

companyId?string

Optional authorized company override. Otherwise the company bound to the OAuth session or API key is used.

Formatuuid

Header Parameters

X-Company-Id?string

Company UUID. Alternative to the companyId query parameter.

Formatuuid

Response Body

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/api/metrics/catalog"
{
  "companyId": "8bb73d03-06b4-47c7-80c7-59301f770eda",
  "currency": "string",
  "sourceBoundary": "company_internal",
  "definitions": [
    {
      "metricId": "string",
      "label": "string",
      "unit": "string",
      "unitLabel": "string",
      "cadence": "string",
      "aggregation": "string",
      "valueSemantics": "string",
      "direction": "string",
      "description": "string",
      "custom": true,
      "archived": true
    }
  ]
}
{
  "error": "string",
  "status": 0,
  "details": {}
}
{
  "error": "string",
  "status": 0,
  "details": {}
}
{
  "error": "string",
  "status": 0,
  "details": {}
}
GET
/api/metrics/grants

Authorization

AuthorizationBearer <token>

API key obtained from Operalta Settings → API Keys. Format: op_xxxxx. Pass as Authorization: Bearer op_....

In: header

Query Parameters

companyId*string

UUID of the company. Alternatively, pass as X-Company-Id request header.

Formatuuid

Header Parameters

X-Company-Id?string

Company UUID. Alternative to the companyId query parameter.

Formatuuid

Response Body

application/json

application/json

curl -X GET "https://example.com/api/metrics/grants?companyId=497f6eca-6276-4993-bfeb-53cbbbba6f08"
{
  "grants": [
    {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "company_id": "b2e6a1c3-1a5e-44ae-a8fd-81f76fd715cf",
      "granted_by": "a8e4a498-f971-4203-a849-4967743579d4",
      "recipient_company_id": "ba825776-f958-472b-98bb-035551940fe9",
      "recipient_user_id": "771fbdeb-44ee-40ed-804a-b56382184d65",
      "scope": [
        "metrics"
      ],
      "metric_ids": [
        "string"
      ],
      "include_historical": true,
      "status": "active",
      "note": "string",
      "expires_at": "2019-08-24T14:15:22Z",
      "revoked_at": "2019-08-24T14:15:22Z",
      "revoked_by": "609d09bf-be33-45e0-963a-ff4cf608e85c",
      "created_at": "2019-08-24T14:15:22Z",
      "updated_at": "2019-08-24T14:15:22Z"
    }
  ]
}
{
  "error": "string",
  "status": 0,
  "details": {}
}
POST
/api/metrics/grants

Authorization

AuthorizationBearer <token>

API key obtained from Operalta Settings → API Keys. Format: op_xxxxx. Pass as Authorization: Bearer op_....

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/metrics/grants" \  -H "Content-Type: application/json" \  -d '{    "companyId": "8bb73d03-06b4-47c7-80c7-59301f770eda",    "scope": [      "metrics"    ]  }'
{
  "grant": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "company_id": "b2e6a1c3-1a5e-44ae-a8fd-81f76fd715cf",
    "granted_by": "a8e4a498-f971-4203-a849-4967743579d4",
    "recipient_company_id": "ba825776-f958-472b-98bb-035551940fe9",
    "recipient_user_id": "771fbdeb-44ee-40ed-804a-b56382184d65",
    "scope": [
      "metrics"
    ],
    "metric_ids": [
      "string"
    ],
    "include_historical": true,
    "status": "active",
    "note": "string",
    "expires_at": "2019-08-24T14:15:22Z",
    "revoked_at": "2019-08-24T14:15:22Z",
    "revoked_by": "609d09bf-be33-45e0-963a-ff4cf608e85c",
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z"
  }
}
{
  "error": "string",
  "status": 0,
  "details": {}
}
{
  "error": "string",
  "status": 0,
  "details": {}
}
{
  "error": "string",
  "status": 0,
  "details": {}
}
PATCH
/api/metrics/grants/{id}/revoke

Authorization

AuthorizationBearer <token>

API key obtained from Operalta Settings → API Keys. Format: op_xxxxx. Pass as Authorization: Bearer op_....

In: header

Path Parameters

id*string

UUID of the grant to revoke.

Formatuuid

Query Parameters

companyId*string

UUID of the company. Alternatively, pass as X-Company-Id request header.

Formatuuid

Header Parameters

X-Company-Id?string

Company UUID. Alternative to the companyId query parameter.

Formatuuid

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X PATCH "https://example.com/api/metrics/grants/497f6eca-6276-4993-bfeb-53cbbbba6f08/revoke?companyId=497f6eca-6276-4993-bfeb-53cbbbba6f08"
{
  "grant": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "company_id": "b2e6a1c3-1a5e-44ae-a8fd-81f76fd715cf",
    "granted_by": "a8e4a498-f971-4203-a849-4967743579d4",
    "recipient_company_id": "ba825776-f958-472b-98bb-035551940fe9",
    "recipient_user_id": "771fbdeb-44ee-40ed-804a-b56382184d65",
    "scope": [
      "metrics"
    ],
    "metric_ids": [
      "string"
    ],
    "include_historical": true,
    "status": "active",
    "note": "string",
    "expires_at": "2019-08-24T14:15:22Z",
    "revoked_at": "2019-08-24T14:15:22Z",
    "revoked_by": "609d09bf-be33-45e0-963a-ff4cf608e85c",
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z"
  }
}
{
  "error": "string",
  "status": 0,
  "details": {}
}
{
  "error": "string",
  "status": 0,
  "details": {}
}
{
  "error": "string",
  "status": 0,
  "details": {}
}
{
  "error": "string",
  "status": 0,
  "details": {}
}
{
  "error": "string",
  "status": 0,
  "details": {}
}
GET
/api/metrics/preferences

Authorization

SessionCookie
Cookie<token>

Authenticated Operalta web session Cookie header. In practice this usually contains sb-<project-ref>-auth-token=... and may include chunked siblings; use the full Cookie header copied from a logged-in browser session.

In: header

Query Parameters

vcCompanyId*string

UUID of the VC company whose display preferences to read.

Formatuuid

Response Body

application/json

application/json

application/json

curl -X GET "https://example.com/api/metrics/preferences?vcCompanyId=497f6eca-6276-4993-bfeb-53cbbbba6f08"
{
  "preferences": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "vcCompanyId": "6aa49b58-8c9c-4df8-9a0b-8a74a1560b94",
    "requestedMetrics": [
      "string"
    ],
    "tableColumns": [
      "string"
    ],
    "cardPages": [
      {
        "id": "string",
        "title": "string",
        "metricIds": [
          "string"
        ]
      }
    ],
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z"
  }
}
{
  "error": "string",
  "status": 0,
  "details": {}
}
{
  "error": "string",
  "status": 0,
  "details": {}
}
POST
/api/metrics/preferences

Authorization

SessionCookie
Cookie<token>

Authenticated Operalta web session Cookie header. In practice this usually contains sb-<project-ref>-auth-token=... and may include chunked siblings; use the full Cookie header copied from a logged-in browser session.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

curl -X POST "https://example.com/api/metrics/preferences" \  -H "Content-Type: application/json" \  -d '{    "vcCompanyId": "6aa49b58-8c9c-4df8-9a0b-8a74a1560b94"  }'
{
  "preferences": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "vcCompanyId": "6aa49b58-8c9c-4df8-9a0b-8a74a1560b94",
    "requestedMetrics": [
      "string"
    ],
    "tableColumns": [
      "string"
    ],
    "cardPages": [
      {
        "id": "string",
        "title": "string",
        "metricIds": [
          "string"
        ]
      }
    ],
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z"
  }
}
{
  "error": "string",
  "status": 0,
  "details": {}
}
{
  "error": "string",
  "status": 0,
  "details": {}
}
GET
/api/metrics/published/{companyId}

Authorization

BearerAuth
AuthorizationBearer <token>

API key obtained from Operalta Settings → API Keys. Format: op_xxxxx. Pass as Authorization: Bearer op_....

In: header

Path Parameters

companyId*string

UUID of the company whose published metrics to read.

Formatuuid

Query Parameters

period?string

Optional exact published month or quarter. Requires a grant with historical access. When omitted, returns the latest allowed publication or historical set based on the grant.

Match^\d{4}-(?:(?:0[1-9]|1[0-2])|[qQ][1-4])$
from?string

Inclusive lower bound for available publications. Requires a grant with historical access.

Match^\d{4}(?:-(?:0[1-9]|1[0-2]|[qQ][1-4]))?$
to?string

Inclusive upper bound for available publications. Requires a grant with historical access.

Match^\d{4}(?:-(?:0[1-9]|1[0-2]|[qQ][1-4]))?$
limit?integer

Maximum published periods returned in one page.

Default24
Range1 <= value <= 100
cursor?string

Opaque nextCursor from a previous response. Keep the same company, period bounds, and grant context.

Lengthlength <= 500

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/api/metrics/published/497f6eca-6276-4993-bfeb-53cbbbba6f08"
{
  "grantId": "4eda52b3-a1b8-4aae-b545-9c8c3c9c7709",
  "scope": [
    "string"
  ],
  "expiresAt": "2019-08-24T14:15:22Z",
  "mode": "published_grant",
  "source": "report_metric_snapshots",
  "sourceBoundary": "published_snapshot",
  "missingPublication": true,
  "company": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "name": "string",
    "vertical": "string",
    "stage": "string",
    "currency": "string"
  },
  "metrics": {
    "summary": {},
    "periods": [
      {
        "periodKey": "string",
        "periodType": "string",
        "reportId": "836df459-dc40-4aa1-972a-6eb0a864dff9",
        "versionNumber": 0,
        "sentAt": "2019-08-24T14:15:22Z",
        "data": {},
        "units": {
          "property1": "string",
          "property2": "string"
        },
        "unitLabels": {
          "property1": "string",
          "property2": "string"
        },
        "currency": "string"
      }
    ]
  },
  "publication": {
    "reportId": "836df459-dc40-4aa1-972a-6eb0a864dff9",
    "periodKey": "string",
    "versionNumber": 0,
    "sentAt": "2019-08-24T14:15:22Z",
    "shareToken": "string",
    "viewerPolicy": {}
  },
  "truncated": true,
  "nextCursor": "string"
}
{
  "error": "string",
  "status": 0,
  "details": {}
}
{
  "error": "string",
  "status": 0,
  "details": {}
}
{
  "error": "string",
  "status": 0,
  "details": {}
}
{
  "error": "string",
  "status": 0,
  "details": {}
}
GET
/api/metrics/series

Authorization

BearerAuth
AuthorizationBearer <token>

API key obtained from Operalta Settings → API Keys. Format: op_xxxxx. Pass as Authorization: Bearer op_....

In: header

Query Parameters

companyId?string

Optional authorized company override. Otherwise the company bound to the OAuth session or API key is used.

Formatuuid
versions?string

Comma-separated metric versions: actual, budget, and/or forecast. Actuals are stored and available only at month grain and require metrics.actuals:read; plans require metrics.plans:read.

Default"actual"
metricIds?string

Optional comma-separated canonical or company-defined metric identifiers. At most 50.

fromPeriod?string

Inclusive lower period bound matching periodType.

Match^\d{4}(?:-(?:0[1-9]|1[0-2])|-Q[1-4])?$
toPeriod?string

Inclusive upper period bound matching periodType. A bounded window cannot exceed 60 periods.

Match^\d{4}(?:-(?:0[1-9]|1[0-2])|-Q[1-4])?$
periodType*string

Single storage grain for this request. Requests containing actual must use month; quarter and year are available for budget and forecast data.

Value in"month" | "quarter" | "year"
order?string
Default"desc"
Value in"asc" | "desc"
limit?integer

Maximum logical metric rows returned in this page.

Default24
Range1 <= value <= 100
cursor?string

Opaque nextCursor from a previous response with the same periodType, order, versions, metric IDs, and period bounds.

Lengthlength <= 500

Header Parameters

X-Company-Id?string

Company UUID. Alternative to the companyId query parameter.

Formatuuid

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/api/metrics/series?periodType=month"
{
  "companyId": "8bb73d03-06b4-47c7-80c7-59301f770eda",
  "currency": "string",
  "sourceBoundary": "company_internal",
  "query": {
    "metricIds": [
      "string"
    ],
    "fromPeriod": "string",
    "toPeriod": "string",
    "periodType": "month",
    "versions": [
      "actual"
    ],
    "order": "asc",
    "limit": 0
  },
  "items": [
    {
      "periodKey": "string",
      "periodType": "month",
      "version": "actual",
      "metrics": {
        "property1": 0,
        "property2": 0
      },
      "source": "string",
      "updatedAt": "2019-08-24T14:15:22Z"
    }
  ],
  "observations": [
    {
      "metricId": "string",
      "value": 0,
      "unit": "string",
      "currency": "string",
      "periodKey": "string",
      "periodType": "month",
      "version": "actual",
      "sourceBoundary": "company_internal",
      "source": "string",
      "updatedAt": "2019-08-24T14:15:22Z"
    }
  ],
  "nextCursor": "string",
  "truncated": true
}
{
  "error": "string",
  "status": 0,
  "details": {}
}
{
  "error": "string",
  "status": 0,
  "details": {}
}
{
  "error": "string",
  "status": 0,
  "details": {}
}
{
  "error": "string",
  "status": 0,
  "details": {}
}