Metrics
KPI snapshots and metric preferences.
API key obtained from Operalta Settings → API Keys. Format: op_xxxxx. Pass as Authorization: Bearer op_....
In: header
Query Parameters
UUID of the company. Alternatively, pass as X-Company-Id request header.
uuidHeader Parameters
Company UUID. Alternative to the companyId query parameter.
uuidResponse 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": {}
}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": {}
}API key obtained from Operalta Settings → API Keys. Format: op_xxxxx. Pass as Authorization: Bearer op_....
In: header
Path Parameters
UUID of the grant to revoke.
uuidQuery Parameters
UUID of the company. Alternatively, pass as X-Company-Id request header.
uuidHeader Parameters
Company UUID. Alternative to the companyId query parameter.
uuidResponse 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": {}
}Authorization
SessionCookie 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
UUID of the VC company whose display preferences to read.
uuidResponse 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": {}
}Authorization
SessionCookie 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": {}
}Authorization
BearerAuth API key obtained from Operalta Settings → API Keys. Format: op_xxxxx. Pass as Authorization: Bearer op_....
In: header
Path Parameters
UUID of the company whose published metrics to read.
uuidQuery Parameters
Optional published period key (YYYY-MM). When omitted, returns the latest allowed publication or historical set based on the grant.
^\d{4}-\d{2}$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",
"missingPublication": true,
"company": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"vertical": "string",
"stage": "string"
},
"metrics": {
"summary": {},
"periods": [
{
"periodKey": "string",
"periodType": "string",
"reportId": "836df459-dc40-4aa1-972a-6eb0a864dff9",
"versionNumber": 0,
"sentAt": "2019-08-24T14:15:22Z",
"data": {}
}
]
},
"publication": {
"reportId": "836df459-dc40-4aa1-972a-6eb0a864dff9",
"periodKey": "string",
"versionNumber": 0,
"sentAt": "2019-08-24T14:15:22Z",
"shareToken": "string",
"viewerPolicy": {}
}
}{
"error": "string",
"status": 0,
"details": {}
}{
"error": "string",
"status": 0,
"details": {}
}{
"error": "string",
"status": 0,
"details": {}
}{
"error": "string",
"status": 0,
"details": {}
}