Skip to content

Analytics API reference

View as Markdown

Account-owned datasets with principal RBAC. Write-key analytics event ingestion.

Published contracts: @socra/analytics-api@0.1.0.

Authenticated request and response

Use an Account access token with authorization for the dataset. Account-owned datasets use principal roles (admin, viewer or writer); Project IAM alone does not grant dataset access. /v1/events:batch uses a dataset write_key in its body; the authenticated dataset and managed-delivery paths have separate contracts below. Retention and cost depend on the current service terms.

This illustrative read uses an existing access token. Set ACCESS_TOKEN through your authorized credential provider; keep it out of source, logs and shared shell history. The identifiers and response below are fictional, validated against the published package. They are not a runtime execution receipt.

sh
curl --fail-with-body --silent --show-error \
  --header "Authorization: Bearer $ACCESS_TOKEN" \
  --header 'Accept: application/json' \
  'https://analytics.socra.cloud/v1/datasets?limit=1'

Example successful response body:

JSON
{
  "data": [
    {
      "id": "dataset_01m00000000000000000000000",
      "name": "Example dataset",
      "environment": "production",
      "retention_days": 90,
      "status": "active",
      "created_at": "2026-10-20T12:00:00.000Z",
      "updated_at": "2026-10-20T12:00:00.000Z",
      "account_id": "00000000-0000-4000-8000-000000000001",
      "roles": [
        "viewer"
      ]
    }
  ],
  "has_more": false
}

For body requests, send JSON with Content-Type: application/json and the exact body fields listed under the operation. Required scopes, when declared, appear with the operation. A token and a valid request shape do not replace the service's authorization rules.

Handle unsuccessful responses

Inspect the HTTP status and response body before taking another action. The published API client retains status, method, URL and body on APIError. It accepts a JSON error object with optional error, message, code and details fields; it also preserves a text or empty body. The method contracts below do not declare a complete per-operation error catalog.

An illustrative JSON error body (field names follow the client contract; the message is an example):

JSON
{
  "message": "The request was rejected. Check the status and service permissions."
}
  • For 400 or another validation response, compare the named field, required fields, types, bounds and accepted values with this reference before correcting the request.
  • For 401, obtain or refresh your token through the supported authorization path. Never paste a token into a bug report.
  • For 403, stop and ask the resource owner to verify the intended principal, Account or Project, required permission and service enablement. An access denial is not evidence of a runtime defect.
  • For 404, verify the exact resource identifier and Account or Project context with its owner; do not recreate a resource merely because a read failed.
  • For 429, follow Retry-After if the service supplies it. These contracts specify no universal rate limit or retry interval.
  • For a 5xx response or interrupted connection after a write, inspect supported resource state before retrying. The effect may be uncertain; automatic replay can duplicate work.

These are status-based troubleshooting steps, not a promise that each operation returns each status or the sample body. Preserve the exact status and redacted body when requesting help.

Base URL

https://analytics.socra.cloud

Analytics explorations

Authorized storage-side analytics without raw SQL.

Aggregate events

POST/v1/datasets/{dataset_id}/query

Path parameters

dataset_idstringrequired

Account-owned dataset identifier. Serialized with the dataset_ prefix.

Request body

start_timestringrequired
format: date-time · pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
end_timestringrequired
format: date-time · pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
measuresobject[]optional
default: [{"name":"count","op":"count"}] · min items: 1 · max items: 10
namestringrequired
pattern: ^[a-z][a-z0-9_]{0,39}$
op"count" | "distinct" | "sum" | "avg" | "min" | "max" | "percentile"required
fieldstringoptional
max length: 160 · pattern: ^(name|source|distinct_id|session_id|application_project|properties\.[A-Za-z0-9_][A-Za-z0-9_.-]{0,127})$
percentilenumberoptional
min: 0 · max: 100
group_bystring[]optional
default: [] · max items: 3
interval"hour" | "day" | "week" | "month"optional
timezonestringoptional
default: "UTC" · min length: 1 · max length: 100
filterobjectoptional

Event filter: a leaf with field/op and optional value/values, or an and/or group. At most 5 group levels, 20 children per group and 100 total nodes. Leaf operators: eq, ne, in, exists, gt, gte, lt, lte. Field accepts name, source, distinct_id, session_id, application_project or properties.<path>. in uses values (1–100 scalars); exists can omit value.

order_byobject[]optional
default: [] · max items: 5
fieldstringrequired
max length: 160
direction"asc" | "desc"optional
default: "desc"
limitintegeroptional
default: 1000 · min: 1 · max: 10000
fillbooleanoptional
default: true
compare"previous_period"optional

Response

7 fields

truncatedbooleanrequired
columnsstring[]required
rowsobject[]required
start_timestringrequired
end_timestringrequired
timezonestringrequired
comparisonobjectoptional
truncatedbooleanrequired
start_timestringrequired
end_timestringrequired
rowsobject[]required

Discover schema

GET/v1/datasets/{dataset_id}/schema

Path parameters

dataset_idstringrequired

Account-owned dataset identifier. Serialized with the dataset_ prefix.

Query parameters

start_timestringoptional
format: date-time · pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
end_timestringoptional
format: date-time · pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$

Response

5 fields

event_namesobject[]required
namestringrequired
countnumberrequired
fieldsobject[]required
fieldstringrequired
typesstring[]required
queryablebooleanrequired
dimensionsstring[]required
sampledfalserequired
property_depth_limit5required

Inspect filtered events

POST/v1/datasets/{dataset_id}/events/search

Path parameters

dataset_idstringrequired

Account-owned dataset identifier. Serialized with the dataset_ prefix.

Request body

start_timestringoptional
format: date-time · pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
end_timestringoptional
format: date-time · pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
filterobjectoptional

Event filter: a leaf with field/op and optional value/values, or an and/or group. At most 5 group levels, 20 children per group and 100 total nodes. Leaf operators: eq, ne, in, exists, gt, gte, lt, lte. Field accepts name, source, distinct_id, session_id, application_project or properties.<path>. in uses values (1–100 scalars); exists can omit value.

limitintegeroptional
default: 20 · min: 1 · max: 100
direction"asc" | "desc"optional
default: "desc"
afterstringoptional
max length: 2048

Response

3 fields

dataobject[]required
has_morebooleanrequired
next_cursorstring | nullrequired

Account datasets

Account-scoped analytics with dataset principal authorization.

Create dataset

POST/v1/datasets

Request body

namestringrequired
min length: 1 · max length: 256
environmentstringoptional
default: "production" · min length: 1 · max length: 64 · pattern: ^[a-z0-9][a-z0-9._-]*$
retention_daysintegeroptional
default: 90 · min: 1 · max: 3650

Response

9 fields

idstringrequired

Account-owned dataset identifier. Serialized with the dataset_ prefix.

namestringrequired
environmentstringrequired
min length: 1 · max length: 64 · pattern: ^[a-z0-9][a-z0-9._-]*$
retention_daysintegerrequired
greater than: 0 · max: 9007199254740991
status"active" | "suspended"required
created_atstringrequired

Time this resource was created, serialized as an ISO 8601 timestamp.

format: date-time · pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
updated_atstringrequired

Time this resource was last updated, serialized as an ISO 8601 timestamp.

format: date-time · pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
account_idstringrequired
format: uuid · pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
roles"admin" | "viewer" | "writer"[]required

List datasets

GET/v1/datasets

Query parameters

limitintegeroptional
min: 1 · max: 100
afterstringoptional

Response

2 fields

dataobject[]required
idstringrequired

Account-owned dataset identifier. Serialized with the dataset_ prefix.

namestringrequired
environmentstringrequired
min length: 1 · max length: 64 · pattern: ^[a-z0-9][a-z0-9._-]*$
retention_daysintegerrequired
greater than: 0 · max: 9007199254740991
status"active" | "suspended"required
created_atstringrequired

Time this resource was created, serialized as an ISO 8601 timestamp.

format: date-time · pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
updated_atstringrequired

Time this resource was last updated, serialized as an ISO 8601 timestamp.

format: date-time · pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
account_idstringrequired
format: uuid · pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
roles"admin" | "viewer" | "writer"[]required
has_morebooleanrequired

Get dataset

GET/v1/datasets/{dataset_id}

Path parameters

dataset_idstringrequired

Account-owned dataset identifier. Serialized with the dataset_ prefix.

Query parameters

No query parameters

Response

9 fields

idstringrequired

Account-owned dataset identifier. Serialized with the dataset_ prefix.

namestringrequired
environmentstringrequired
min length: 1 · max length: 64 · pattern: ^[a-z0-9][a-z0-9._-]*$
retention_daysintegerrequired
greater than: 0 · max: 9007199254740991
status"active" | "suspended"required
created_atstringrequired

Time this resource was created, serialized as an ISO 8601 timestamp.

format: date-time · pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
updated_atstringrequired

Time this resource was last updated, serialized as an ISO 8601 timestamp.

format: date-time · pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
account_idstringrequired
format: uuid · pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
roles"admin" | "viewer" | "writer"[]required

Update dataset

PATCH/v1/datasets/{dataset_id}

Path parameters

dataset_idstringrequired

Account-owned dataset identifier. Serialized with the dataset_ prefix.

Request body

namestringoptional
min length: 1 · max length: 256
environmentstringoptional
min length: 1 · max length: 64 · pattern: ^[a-z0-9][a-z0-9._-]*$
retention_daysintegeroptional
min: 1 · max: 3650
status"active" | "suspended"optional

Response

9 fields

idstringrequired

Account-owned dataset identifier. Serialized with the dataset_ prefix.

namestringrequired
environmentstringrequired
min length: 1 · max length: 64 · pattern: ^[a-z0-9][a-z0-9._-]*$
retention_daysintegerrequired
greater than: 0 · max: 9007199254740991
status"active" | "suspended"required
created_atstringrequired

Time this resource was created, serialized as an ISO 8601 timestamp.

format: date-time · pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
updated_atstringrequired

Time this resource was last updated, serialized as an ISO 8601 timestamp.

format: date-time · pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
account_idstringrequired
format: uuid · pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
roles"admin" | "viewer" | "writer"[]required

Delete dataset

DELETE/v1/datasets/{dataset_id}

Path parameters

dataset_idstringrequired

Account-owned dataset identifier. Serialized with the dataset_ prefix.

Query parameters

No query parameters

Response

No response body

Rotate ingestion key

POST/v1/datasets/{dataset_id}/write-key/rotate

Path parameters

dataset_idstringrequired

Account-owned dataset identifier. Serialized with the dataset_ prefix.

Request body

Response

1 field

write_keystringrequired

Dataset authorizations

Account-scoped analytics with dataset principal authorization.

Authorize principal

POST/v1/datasets/{dataset_id}/authorizations

Path parameters

dataset_idstringrequired

Account-owned dataset identifier. Serialized with the dataset_ prefix.

Request body

principalstringrequired
format: uuid · pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
role"admin" | "viewer" | "writer"required

Response

5 fields

idstringrequired

Dataset principal authorization identifier. Serialized with the dsauth_ prefix.

dataset_idstringrequired

Account-owned dataset identifier. Serialized with the dataset_ prefix.

principalstringrequired
format: uuid · pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
role"admin" | "viewer" | "writer"required
created_atstringrequired

Time this resource was created, serialized as an ISO 8601 timestamp.

format: date-time · pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$

List dataset authorizations

GET/v1/datasets/{dataset_id}/authorizations

Path parameters

dataset_idstringrequired

Account-owned dataset identifier. Serialized with the dataset_ prefix.

Query parameters

limitintegeroptional
min: 1 · max: 100
afterstringoptional

Response

2 fields

dataobject[]required
idstringrequired

Dataset principal authorization identifier. Serialized with the dsauth_ prefix.

dataset_idstringrequired

Account-owned dataset identifier. Serialized with the dataset_ prefix.

principalstringrequired
format: uuid · pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
role"admin" | "viewer" | "writer"required
created_atstringrequired

Time this resource was created, serialized as an ISO 8601 timestamp.

format: date-time · pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
has_morebooleanrequired

Update dataset authorization

PATCH/v1/datasets/{dataset_id}/authorizations/{authorization_id}

Path parameters

dataset_idstringrequired

Account-owned dataset identifier. Serialized with the dataset_ prefix.

authorization_idstringrequired

Dataset principal authorization identifier. Serialized with the dsauth_ prefix.

Request body

role"admin" | "viewer" | "writer"required

Response

5 fields

idstringrequired

Dataset principal authorization identifier. Serialized with the dsauth_ prefix.

dataset_idstringrequired

Account-owned dataset identifier. Serialized with the dataset_ prefix.

principalstringrequired
format: uuid · pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
role"admin" | "viewer" | "writer"required
created_atstringrequired

Time this resource was created, serialized as an ISO 8601 timestamp.

format: date-time · pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$

Revoke dataset authorization

DELETE/v1/datasets/{dataset_id}/authorizations/{authorization_id}

Path parameters

dataset_idstringrequired

Account-owned dataset identifier. Serialized with the dataset_ prefix.

authorization_idstringrequired

Dataset principal authorization identifier. Serialized with the dsauth_ prefix.

Query parameters

No query parameters

Response

No response body

Dataset events

Account-scoped analytics with dataset principal authorization.

List dataset events

GET/v1/datasets/{dataset_id}/events

Path parameters

dataset_idstringrequired

Account-owned dataset identifier. Serialized with the dataset_ prefix.

Query parameters

limitintegeroptional
min: 1 · max: 100
afterstringoptional
namestringoptional
min length: 1 · max length: 256
start_timestringoptional
format: date-time · pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
end_timestringoptional
format: date-time · pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$

Response

2 fields

dataobject[]required
namestringrequired
min length: 1 · max length: 256 · pattern: ^[A-Za-z0-9][A-Za-z0-9._:-]*$
occurred_atstringrequired
format: date-time · pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
distinct_idstringoptional
min length: 1 · max length: 256
session_idstringoptional
min length: 1 · max length: 256
sourcestringoptional
min length: 1 · max length: 128
propertiesobjectrequired
default: {}
idstringrequired

Immutable analytics event identifier. Serialized with the event_ prefix.

dataset_idstringrequired

Account-owned dataset identifier. Serialized with the dataset_ prefix.

received_atstringrequired
format: date-time · pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
application_projectstring | nulloptional
has_morebooleanrequired

Ingest authenticated events

POST/v1/datasets/{dataset_id}/events:batch

Path parameters

dataset_idstringrequired

Account-owned dataset identifier. Serialized with the dataset_ prefix.

Request body

eventsobject[]required
min items: 1 · max items: 100
namestringrequired
min length: 1 · max length: 256 · pattern: ^[A-Za-z0-9][A-Za-z0-9._:-]*$
occurred_atstringoptional
format: date-time · pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
distinct_idstringoptional
min length: 1 · max length: 256
session_idstringoptional
min length: 1 · max length: 256
sourcestringoptional
min length: 1 · max length: 128
idempotency_keystringoptional
min length: 1 · max length: 128
propertiesobjectoptional
default: {}

Response

2 fields

acceptedintegerrequired
min: 0 · max: 9007199254740991
event_idsstring[]required

Accepted event identifiers. Serialized with the event_ prefix.

Dataset reports

Account-scoped analytics with dataset principal authorization.

Query dataset report

GET/v1/datasets/{dataset_id}/reports/events

Path parameters

dataset_idstringrequired

Account-owned dataset identifier. Serialized with the dataset_ prefix.

Query parameters

start_timestringrequired
format: date-time · pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
end_timestringrequired
format: date-time · pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
interval"hour" | "day"optional
default: "day"
namestringoptional
min length: 1 · max length: 256

Response

5 fields

start_timestringrequired
format: date-time · pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
end_timestringrequired
format: date-time · pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
interval"hour" | "day"required
totalintegerrequired
min: 0 · max: 9007199254740991
seriesobject[]required
namestringrequired
pointsobject[]required
start_timestringrequired
format: date-time · pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
end_timestringrequired
format: date-time · pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
countintegerrequired
min: 0 · max: 9007199254740991

Dataset deliveries

Revocable grants binding a managed delivery principal and subscription to a dataset.

Authorize managed delivery

POST/v1/datasets/{dataset_id}/deliveries

Path parameters

dataset_idstringrequired

Account-owned dataset identifier. Serialized with the dataset_ prefix.

Request body

subscriptionstringrequired
pattern: ^projects\/proj_[0-9a-hjkmnp-tv-z]{26}\/subscriptions\/[a-z][a-z0-9]*(?:[-_.][a-z0-9]+)*$
principalstringrequired
format: uuid · pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
delivery_projectstringrequired

Project identifier. Serialized with the proj_ prefix.

Response

7 fields

idstringrequired

Managed dataset delivery grant identifier. Serialized with the dsdelivery_ prefix.

dataset_idstringrequired

Account-owned dataset identifier. Serialized with the dataset_ prefix.

subscriptionstringrequired
principalstringrequired
format: uuid · pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
delivery_projectstringrequired

Project identifier. Serialized with the proj_ prefix.

status"active" | "revoked"required
created_atstringrequired

Time this resource was created, serialized as an ISO 8601 timestamp.

format: date-time · pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$

List managed deliveries

GET/v1/datasets/{dataset_id}/deliveries

Path parameters

dataset_idstringrequired

Account-owned dataset identifier. Serialized with the dataset_ prefix.

Query parameters

limitintegeroptional
min: 1 · max: 100
afterstringoptional

Response

2 fields

dataobject[]required
idstringrequired

Managed dataset delivery grant identifier. Serialized with the dsdelivery_ prefix.

dataset_idstringrequired

Account-owned dataset identifier. Serialized with the dataset_ prefix.

subscriptionstringrequired
principalstringrequired
format: uuid · pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
delivery_projectstringrequired

Project identifier. Serialized with the proj_ prefix.

status"active" | "revoked"required
created_atstringrequired

Time this resource was created, serialized as an ISO 8601 timestamp.

format: date-time · pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
has_morebooleanrequired

Revoke managed delivery

DELETE/v1/datasets/{dataset_id}/deliveries/{delivery_id}

Path parameters

dataset_idstringrequired

Account-owned dataset identifier. Serialized with the dataset_ prefix.

delivery_idstringrequired

Managed dataset delivery grant identifier. Serialized with the dsdelivery_ prefix.

Query parameters

No query parameters

Response

No response body

Managed deliveries

Ingest only as the specific service principal authorized by a dataset grant.

Get delivery identity

GET/v1/delivery-identity

Query parameters

Response

2 fields

principalstringrequired
format: uuid · pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
projectstringrequired

Project identifier. Serialized with the proj_ prefix.

Deliver events

POST/v1/deliveries/{delivery_id}/events:batch

Path parameters

delivery_idstringrequired

Managed dataset delivery grant identifier. Serialized with the dsdelivery_ prefix.

Request body

subscriptionstringrequired
eventsobject[]required
min items: 1 · max items: 100
namestringrequired
min length: 1 · max length: 256 · pattern: ^[A-Za-z0-9][A-Za-z0-9._:-]*$
occurred_atstringoptional
format: date-time · pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
distinct_idstringoptional
min length: 1 · max length: 256
session_idstringoptional
min length: 1 · max length: 256
sourcestringoptional
min length: 1 · max length: 128
idempotency_keystringoptional
min length: 1 · max length: 128
propertiesobjectoptional
default: {}

Response

2 fields

acceptedintegerrequired
min: 0 · max: 9007199254740991
event_idsstring[]required

Accepted event identifiers. Serialized with the event_ prefix.

Base URL

https://analytics.socra.cloud

Event ingestion

Write-key event collection for browser, mobile, desktop, and server clients.

Ingest event batch

POST/v1/events:batch

Request body

write_keystringrequired
min length: 16 · max length: 256
eventsobject[]required
min items: 1 · max items: 100
namestringrequired
min length: 1 · max length: 256 · pattern: ^[A-Za-z0-9][A-Za-z0-9._:-]*$
occurred_atstringoptional
format: date-time · pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
distinct_idstringoptional
min length: 1 · max length: 256
session_idstringoptional
min length: 1 · max length: 256
sourcestringoptional
min length: 1 · max length: 128
idempotency_keystringoptional
min length: 1 · max length: 128
propertiesobjectoptional
default: {}

Response

2 fields

acceptedintegerrequired
min: 0 · max: 9007199254740991
event_idsstring[]required

Accepted event identifiers. Serialized with the event_ prefix.