Endpoints
Call these through the okoro proxy at https://okoro.ai/p/google-analytics
| Action | Method | Path | Min scope |
|---|---|---|---|
| Run report | POST | read | |
| Run realtime report | POST | read | |
| Run funnel report | POST | read | |
| Batch run reports | POST | read | |
| Batch run pivot reports | POST | read | |
| Check compatibility | POST | read | |
| Get metadata | GET | read |
Examples
Every request requires a short-lived operation token scoped to a single action.
1. Get an operation token
Exchange your service token for a short-lived operation token scoped to a single action.
TOKEN=$(curl -sX POST "https://okoro.ai/t/tokens" \
-H "Authorization: Bearer $OKORO_SERVICE_TOKEN" \
-H "Content-Type: application/json" \
-d '{"provider": "google-analytics", "scope": "read", "intent": "describe what you are doing"}' \
| jq -r '.token')2. Call the API
Use the operation token as a Bearer token. The proxy forwards the request to Google Analytics and logs the action.
Run report
curl -X POST "https://okoro.ai/p/google-analytics/properties/{id}/runReport" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{}'Run realtime report
curl -X POST "https://okoro.ai/p/google-analytics/properties/{id}/runRealtimeReport" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{}'Run funnel report
curl -X POST "https://okoro.ai/p/google-analytics/properties/{id}/runFunnelReport" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{}'Batch run reports
curl -X POST "https://okoro.ai/p/google-analytics/properties/{id}/batchRunReports" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{}'Batch run pivot reports
curl -X POST "https://okoro.ai/p/google-analytics/properties/{id}/batchRunPivotReports" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{}'Check compatibility
curl -X POST "https://okoro.ai/p/google-analytics/properties/{id}/checkCompatibility" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{}'Get metadata
curl -X GET "https://okoro.ai/p/google-analytics/properties/{id}/metadata" \
-H "Authorization: Bearer $TOKEN"Scopes
Your service token must be configured with at least the required scope level.
readGET
POST/properties/*/runReport
/properties/*/runRealtimeReport
/properties/*/runFunnelReport
/properties/*/batchRunReports
/properties/*/batchRunPivotReports
/properties/*/checkCompatibility
/properties/*/metadata
/properties/*writeGET
POST/properties/*/runReport
/properties/*/runRealtimeReport
/properties/*/runFunnelReport
/properties/*/batchRunReports
/properties/*/batchRunPivotReports
/properties/*/checkCompatibility
/properties/*/metadata
/properties/*updateGET
POST/properties/*/runReport
/properties/*/runRealtimeReport
/properties/*/runFunnelReport
/properties/*/batchRunReports
/properties/*/batchRunPivotReports
/properties/*/checkCompatibility
/properties/*/metadata
/properties/*deleteGET
POST/properties/*allGET
POST/**