Sökningen laddas först när du använder den. Bläddra bland alla kategorier nedan.

Analys och insikter

Spara en version av ett anpassat mätvärde

Spara en version av ett anpassat mätvärde. Använder den uttryckligen angivna och granskade datamängden och versionen; källan uppdateras inte automatiskt. Indata för rendering kan skickas via en pipe till sosoapi report render --output FILE.

POST /analytics-api/reporting/metrics/save

Kontrakt granskat: · sha256:d6e85a113e8fb367

Översikt

Spara en version av ett anpassat mätvärde. Använder den uttryckligen angivna och granskade datamängden och versionen; källan uppdateras inte automatiskt. Indata för rendering kan skickas via en pipe till sosoapi report render --output FILE.

Ett lyckat HTTP-svar kan betyda att en begäran accepterats snarare än slutförts. Spara returnerat ID för bakgrundsarbete och kontrollera samma åtgärd tills den är klar. Ett schemalagt eller accepterat inlägg är publicerat först när plattformen bekräftar det; en klienttimeout fastställer inte resultatet.

Autentisering och behörigheter

Godtagna typer av autentiseringsuppgifter
user_session, delegated_oauth, personal_access_token
Delegerad funktion
agent:operate
Lägsta arbetsyteroll
editor
Åtkomstomfång
Resurser som denna användare har behörighet att komma åt
Samtycke för alla arbetsytor krävs
Nej
Ändrar tillstånd
Ja
När åtgärden är klar
synchronous_http_response

En token får endast använda ägarens rättigheter. Varje anrop kontrollerar arbetsytemedlemskap, resursägarskap, valda arbetsytor och beviljade funktioner. Profilerna core och full ändrar vilka verktyg som visas; de ger ingen åtkomst.

Anropsfält

Obligatoriskt betyder obligatoriskt inom sitt överordnade objekt och vald gren. Ett obligatoriskt underfält gör inte ett valfritt överordnat objekt obligatoriskt. Regler och fältnamn nedan kopieras från kontraktet.

Anropsfält
Fält / grenTyp / obligatorisktBegränsningar
$objectObligatoriskt i överordnat objekt
  • additionalProperties: false
workspace_idstringObligatoriskt i överordnat objekt
  • format: "uuid"
  • pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
formulaobjectObligatoriskt i överordnat objekt
  • additionalProperties: false
formula.contractVersionstringObligatoriskt i överordnat objekt
  • const: "analytics-metric/v1"
formula.idstringObligatoriskt i överordnat objekt
  • format: "uuid"
  • pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
formula.workspaceIdstringObligatoriskt i överordnat objekt
  • format: "uuid"
  • pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
formula.namestringObligatoriskt i överordnat objekt
  • minLength: 1
  • maxLength: 100
formula.versionintegerObligatoriskt i överordnat objekt
  • minimum: 1
  • maximum: 1000000
formula.expressionstringObligatoriskt i överordnat objekt
  • minLength: 1
  • maxLength: 1000
formula.fieldsarrayObligatoriskt i överordnat objekt
  • maxItems: 32
formula.fields[]objectValfritt / objekt
  • additionalProperties: false
formula.fields[].identifierstringObligatoriskt i överordnat objekt
  • pattern: "^[a-z][a-z0-9_]{0,63}$"
formula.fields[].selectorobjectObligatoriskt i överordnat objekt
  • additionalProperties: false
formula.fields[].selector.platformstringObligatoriskt i överordnat objekt
  • enum: ["facebook","instagram","threads","youtube"]
formula.fields[].selector.keystringObligatoriskt i överordnat objekt
  • pattern: "^[A-Za-z][A-Za-z0-9_]{0,100}$"
formula.fields[].selector.definitionstringObligatoriskt i överordnat objekt
  • minLength: 1
  • maxLength: 500
formula.fields[].selector.unitstringObligatoriskt i överordnat objekt
  • enum: ["count","seconds","minutes","percent","ratio"]
formula.fields[].selector.grainstringObligatoriskt i överordnat objekt
  • enum: ["post","account"]
formula.fields[].selector.measurementKindstringObligatoriskt i överordnat objekt
  • enum: ["lifetime","snapshot","period","unknown"]
formula.fields[].selector.nativePeriodstring | nullObligatoriskt i överordnat objekt—
formula.fields[].selector.nativePeriodanyOf 1stringObligatoriskt i överordnat objekt
  • minLength: 1
  • maxLength: 64
formula.fields[].selector.nativePeriodanyOf 2nullObligatoriskt i överordnat objekt—
formula.fields[].selector.timezonestring | nullObligatoriskt i överordnat objekt—
formula.fields[].selector.timezoneanyOf 1stringObligatoriskt i överordnat objekt
  • minLength: 1
  • maxLength: 100
formula.fields[].selector.timezoneanyOf 2nullObligatoriskt i överordnat objekt—
formula.fields[].aggregationstringObligatoriskt i överordnat objekt
  • enum: ["single","sum"]
formula.roundingobjectObligatoriskt i överordnat objekt
  • additionalProperties: false
formula.rounding.decimalPlacesintegerObligatoriskt i överordnat objekt
  • minimum: 0
  • maximum: 8
formula.rounding.modestringObligatoriskt i överordnat objekt
  • const: "half_away_from_zero"
datasetobjectObligatoriskt i överordnat objekt
  • additionalProperties: false
dataset.contractVersionstringObligatoriskt i överordnat objekt
  • const: "analytics-report/v1"
dataset.idstringObligatoriskt i överordnat objekt
  • format: "uuid"
  • pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
dataset.reviewedAtstringObligatoriskt i överordnat objekt
  • 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)))$"
dataset.selectionobjectObligatoriskt i överordnat objekt
  • additionalProperties: false
dataset.selection.workspaceIdstringObligatoriskt i överordnat objekt
  • format: "uuid"
  • pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
dataset.selection.accountIdsarrayObligatoriskt i överordnat objekt
  • minItems: 1
  • maxItems: 50
dataset.selection.accountIds[]stringValfritt / objekt
  • format: "uuid"
  • pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
dataset.selection.platformsarrayObligatoriskt i överordnat objekt
  • minItems: 1
  • maxItems: 4
dataset.selection.platforms[]stringValfritt / objekt
  • enum: ["facebook","instagram","threads","youtube"]
dataset.selection.startDatestringObligatoriskt i överordnat objekt
  • pattern: "^\\d{4}-\\d{2}-\\d{2}$"
dataset.selection.endDatestringObligatoriskt i överordnat objekt
  • pattern: "^\\d{4}-\\d{2}-\\d{2}$"
dataset.selection.timezonestringObligatoriskt i överordnat objekt
  • minLength: 1
  • maxLength: 100
dataset.accountsarrayObligatoriskt i överordnat objekt
  • maxItems: 50
dataset.accounts[]objectValfritt / objekt
  • additionalProperties: false
dataset.accounts[].idstringObligatoriskt i överordnat objekt
  • format: "uuid"
  • pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
dataset.accounts[].workspaceIdstringObligatoriskt i överordnat objekt
  • format: "uuid"
  • pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
dataset.accounts[].platformstringObligatoriskt i överordnat objekt
  • enum: ["facebook","instagram","threads","youtube"]
dataset.accounts[].namestringObligatoriskt i överordnat objekt
  • maxLength: 500
dataset.accounts[].connectionStatusstringValfritt / objekt
  • maxLength: 100
dataset.accounts[].healthMessagestringValfritt / objekt
  • maxLength: 1000
dataset.postsarrayObligatoriskt i överordnat objekt
  • maxItems: 1000
dataset.posts[]objectValfritt / objekt
  • additionalProperties: false
dataset.posts[].social_post_idstringObligatoriskt i överordnat objekt
  • format: "uuid"
  • pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
dataset.posts[].workspace_idstringObligatoriskt i överordnat objekt
  • format: "uuid"
  • pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
dataset.posts[].social_account_idstringObligatoriskt i överordnat objekt
  • format: "uuid"
  • pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
dataset.posts[].platformstringObligatoriskt i överordnat objekt
  • enum: ["instagram","facebook","threads","youtube"]
dataset.posts[].provider_post_idstringObligatoriskt i överordnat objekt
  • minLength: 1
  • maxLength: 512
dataset.posts[].provider_published_atstring | nullObligatoriskt i överordnat objekt—
dataset.posts[].provider_published_atanyOf 1stringObligatoriskt i överordnat objekt
  • 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)))$"
dataset.posts[].provider_published_atanyOf 2nullObligatoriskt i överordnat objekt—
dataset.posts[].content_formatstring | nullObligatoriskt i överordnat objekt—
dataset.posts[].content_formatanyOf 1stringObligatoriskt i överordnat objekt
  • minLength: 1
  • maxLength: 100
dataset.posts[].content_formatanyOf 2nullObligatoriskt i överordnat objekt—
dataset.posts[].permalinkstring | nullObligatoriskt i överordnat objekt—
dataset.posts[].permalinkanyOf 1stringObligatoriskt i överordnat objekt
  • format: "uri"
  • maxLength: 2048
dataset.posts[].permalinkanyOf 2nullObligatoriskt i överordnat objekt—
dataset.posts[].provider_statestringObligatoriskt i överordnat objekt
  • enum: ["available","deleted","unavailable","unknown"]
dataset.posts[].first_seen_atstringObligatoriskt i överordnat objekt
  • 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)))$"
dataset.posts[].last_seen_atstringObligatoriskt i överordnat objekt
  • 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)))$"
dataset.posts[].scheduled_post_idstring | nullObligatoriskt i överordnat objekt—
dataset.posts[].scheduled_post_idanyOf 1stringObligatoriskt i överordnat objekt
  • format: "uuid"
  • pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
dataset.posts[].scheduled_post_idanyOf 2nullObligatoriskt i överordnat objekt—
dataset.posts[].provenanceobjectObligatoriskt i överordnat objekt
  • additionalProperties: false
dataset.posts[].provenance.providerstringObligatoriskt i överordnat objekt
  • enum: ["instagram","facebook","threads","youtube"]
dataset.posts[].provenance.sourcestringObligatoriskt i överordnat objekt
  • enum: ["provider_api","provider_webhook","publication_outcome","backfill"]
dataset.posts[].provenance.source_job_idstring | nullObligatoriskt i överordnat objekt—
dataset.posts[].provenance.source_job_idanyOf 1stringObligatoriskt i överordnat objekt
  • format: "uuid"
  • pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
dataset.posts[].provenance.source_job_idanyOf 2nullObligatoriskt i överordnat objekt—
dataset.posts[].provenance.provider_api_versionstring | nullObligatoriskt i överordnat objekt—
dataset.posts[].provenance.provider_api_versionanyOf 1stringObligatoriskt i överordnat objekt
  • minLength: 1
  • maxLength: 200
dataset.posts[].provenance.provider_api_versionanyOf 2nullObligatoriskt i överordnat objekt—
dataset.posts[].provenance.schema_versionstring | nullObligatoriskt i överordnat objekt—
dataset.posts[].provenance.schema_versionanyOf 1stringObligatoriskt i överordnat objekt
  • minLength: 1
  • maxLength: 200
dataset.posts[].provenance.schema_versionanyOf 2nullObligatoriskt i överordnat objekt—
dataset.sourcesarrayObligatoriskt i överordnat objekt
  • maxItems: 30
dataset.sources[]objectValfritt / objekt
  • additionalProperties: false
dataset.sources[].accountIdstringObligatoriskt i överordnat objekt
  • format: "uuid"
  • pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
dataset.sources[].platformstringObligatoriskt i överordnat objekt
  • enum: ["facebook","instagram","threads","youtube"]
dataset.sources[].resourceKindstringObligatoriskt i överordnat objekt
  • enum: ["account","post"]
dataset.sources[].providerResourceIdstring | nullObligatoriskt i överordnat objekt—
dataset.sources[].providerResourceIdanyOf 1stringObligatoriskt i överordnat objekt
  • maxLength: 512
dataset.sources[].providerResourceIdanyOf 2nullObligatoriskt i överordnat objekt—
dataset.sources[].requestIdstring | nullObligatoriskt i överordnat objekt—
dataset.sources[].requestIdanyOf 1stringObligatoriskt i överordnat objekt
  • format: "uuid"
  • pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
dataset.sources[].requestIdanyOf 2nullObligatoriskt i överordnat objekt—
dataset.sources[].statusstringObligatoriskt i överordnat objekt
  • enum: ["available","partial","not_returned","unsupported","permission_required","threshold_not_met","no_data","failed","pending","stale"]
dataset.sources[].reasonstring | nullObligatoriskt i överordnat objekt—
dataset.sources[].reasonanyOf 1stringObligatoriskt i överordnat objekt
  • maxLength: 8000
dataset.sources[].reasonanyOf 2nullObligatoriskt i överordnat objekt—
dataset.sources[].envelopeobject | nullObligatoriskt i överordnat objekt—
dataset.sources[].envelopeanyOf 1objectObligatoriskt i överordnat objekt
  • additionalProperties: false
dataset.sources[].envelope.contract_versionanyOf 1stringObligatoriskt i överordnat objekt
  • const: "provider-insights/v1"
dataset.sources[].envelope.request_idanyOf 1stringObligatoriskt i överordnat objekt
  • format: "uuid"
  • pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
dataset.sources[].envelope.platformanyOf 1stringObligatoriskt i överordnat objekt
  • enum: ["facebook","instagram","threads","youtube"]
dataset.sources[].envelope.resourceanyOf 1objectObligatoriskt i överordnat objekt
  • additionalProperties: false
dataset.sources[].envelope.resource.kindanyOf 1stringObligatoriskt i överordnat objekt
  • enum: ["account","post"]
dataset.sources[].envelope.resource.social_account_idanyOf 1stringObligatoriskt i överordnat objekt
  • format: "uuid"
  • pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
dataset.sources[].envelope.resource.provider_resource_idanyOf 1string | nullObligatoriskt i överordnat objekt—
dataset.sources[].envelope.provider_api_versionanyOf 1stringObligatoriskt i överordnat objekt
  • minLength: 1
  • maxLength: 100
dataset.sources[].envelope.fetched_atanyOf 1stringObligatoriskt i överordnat objekt
  • 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)))$"
dataset.sources[].envelope.statusanyOf 1stringObligatoriskt i överordnat objekt
  • enum: ["available","partial","unavailable"]
dataset.sources[].envelope.availabilityanyOf 1arrayObligatoriskt i överordnat objekt
  • minItems: 1
  • maxItems: 64
dataset.sources[].envelope.availability[]anyOf 1objectValfritt / objekt
  • additionalProperties: false
dataset.sources[].envelope.availability[].scopeanyOf 1stringObligatoriskt i överordnat objekt
  • minLength: 1
  • maxLength: 200
dataset.sources[].envelope.availability[].statusanyOf 1stringObligatoriskt i överordnat objekt
  • enum: ["available","partial","not_returned","unsupported","permission_required","threshold_not_met","no_data","failed"]
dataset.sources[].envelope.availability[].reasonanyOf 1stringValfritt / objekt
  • minLength: 1
  • maxLength: 2000
dataset.sources[].envelope.availability[].diagnosticsanyOf 1objectValfritt / objekt
  • additionalProperties: false
dataset.sources[].envelope.availability[].diagnostics.http_statusanyOf 1integerObligatoriskt i överordnat objekt
  • minimum: 0
  • maximum: 599
dataset.sources[].envelope.availability[].diagnostics.failed_stepanyOf 1stringValfritt / objekt
  • minLength: 1
  • maxLength: 200
dataset.sources[].envelope.availability[].diagnostics.provider_codeanyOf 1number | stringValfritt / objekt—
dataset.sources[].envelope.availability[].diagnostics.provider_codeanyOf 1 / anyOf 1numberValfritt / objekt—
dataset.sources[].envelope.availability[].diagnostics.provider_codeanyOf 1 / anyOf 2stringValfritt / objekt
  • maxLength: 100
dataset.sources[].envelope.availability[].diagnostics.provider_subcodeanyOf 1number | stringValfritt / objekt—
dataset.sources[].envelope.availability[].diagnostics.provider_subcodeanyOf 1 / anyOf 1numberValfritt / objekt—
dataset.sources[].envelope.availability[].diagnostics.provider_subcodeanyOf 1 / anyOf 2stringValfritt / objekt
  • maxLength: 100
dataset.sources[].envelope.availability[].diagnostics.provider_typeanyOf 1stringValfritt / objekt
  • maxLength: 200
dataset.sources[].envelope.availability[].diagnostics.is_transientanyOf 1booleanValfritt / objekt—
dataset.sources[].envelope.availability[].diagnostics.provider_request_idanyOf 1stringValfritt / objekt
  • maxLength: 200
dataset.sources[].envelope.availability[].diagnostics.accessanyOf 1objectValfritt / objekt
  • additionalProperties: false
dataset.sources[].envelope.availability[].diagnostics.access.login_modeanyOf 1stringObligatoriskt i överordnat objekt
  • enum: ["instagram_login","facebook_login","threads_user"]
dataset.sources[].envelope.availability[].diagnostics.access.provider_hostanyOf 1stringObligatoriskt i överordnat objekt
  • maxLength: 200
dataset.sources[].envelope.availability[].diagnostics.access.required_permissionsanyOf 1arrayObligatoriskt i överordnat objekt
  • maxItems: 16
dataset.sources[].envelope.availability[].diagnostics.access.required_permissions[]anyOf 1stringValfritt / objekt
  • maxLength: 100
dataset.sources[].envelope.availability[].diagnostics.access.current_connection_policy_permissionsanyOf 1arrayObligatoriskt i överordnat objekt
  • maxItems: 16
dataset.sources[].envelope.availability[].diagnostics.access.current_connection_policy_permissions[]anyOf 1stringValfritt / objekt
  • maxLength: 100
dataset.sources[].envelope.availability[].diagnostics.access.granted_permissionsanyOf 1array | nullObligatoriskt i överordnat objekt—
dataset.sources[].envelope.availability[].diagnostics.access.granted_permissionsanyOf 1 / anyOf 1arrayObligatoriskt i överordnat objekt
  • maxItems: 128
dataset.sources[].envelope.availability[].diagnostics.access.granted_permissions[]anyOf 1 / anyOf 1stringValfritt / objekt
  • maxLength: 100
dataset.sources[].envelope.availability[].diagnostics.access.granted_permissionsanyOf 1 / anyOf 2nullObligatoriskt i överordnat objekt—
dataset.sources[].envelope.availability[].diagnostics.access.grant_evidenceanyOf 1stringObligatoriskt i överordnat objekt
  • enum: ["exact","unknown"]
dataset.sources[].envelope.availability[].diagnostics.access.permission_stateanyOf 1stringObligatoriskt i överordnat objekt
  • enum: ["granted","missing","unknown"]
dataset.sources[].envelope.availability[].diagnostics.access.grant_observed_atanyOf 1stringValfritt / objekt
  • 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)))$"
dataset.sources[].envelope.availability[].diagnostics.access.app_accessanyOf 1stringObligatoriskt i överordnat objekt
  • const: "unverified"
dataset.sources[].envelope.availability[].diagnostics.access.next_stepanyOf 1stringObligatoriskt i överordnat objekt
  • maxLength: 1500
dataset.sources[].envelope.provider_dataanyOf 1any JSON value | nullObligatoriskt i överordnat objekt—
dataset.sources[].envelope.provider_dataanyOf 1 / anyOf 1any JSON valueObligatoriskt i överordnat objekt—
dataset.sources[].envelope.provider_dataanyOf 1 / anyOf 2nullObligatoriskt i överordnat objekt—
dataset.sources[].envelope.requested_date_rangeanyOf 1object | nullObligatoriskt i överordnat objekt—
dataset.sources[].envelope.requested_date_rangeanyOf 1 / anyOf 1objectObligatoriskt i överordnat objekt
  • additionalProperties: false
dataset.sources[].envelope.requested_date_range.start_dateanyOf 1 / anyOf 1stringObligatoriskt i överordnat objekt
  • pattern: "^\\d{4}-\\d{2}-\\d{2}$"
dataset.sources[].envelope.requested_date_range.end_dateanyOf 1 / anyOf 1stringObligatoriskt i överordnat objekt
  • pattern: "^\\d{4}-\\d{2}-\\d{2}$"
dataset.sources[].envelope.requested_date_rangeanyOf 1 / anyOf 2nullObligatoriskt i överordnat objekt—
dataset.sources[].envelope.cacheanyOf 1objectObligatoriskt i överordnat objekt
  • additionalProperties: false
dataset.sources[].envelope.cache.authoritativeanyOf 1booleanObligatoriskt i överordnat objekt
  • const: false
dataset.sources[].envelope.cache.statusanyOf 1stringObligatoriskt i överordnat objekt
  • enum: ["stored","hit","bypassed"]
dataset.sources[].envelope.cache.expires_atanyOf 1stringObligatoriskt i överordnat objekt
  • 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)))$"
dataset.sources[].envelopeanyOf 2nullObligatoriskt i överordnat objekt—
dataset.sources[].metricsarrayObligatoriskt i överordnat objekt
  • maxItems: 5000
dataset.sources[].metrics[]objectValfritt / objekt
  • additionalProperties: false
dataset.sources[].metrics[].keystringObligatoriskt i överordnat objekt
  • minLength: 1
  • maxLength: 150
dataset.sources[].metrics[].definitionstringObligatoriskt i överordnat objekt
  • minLength: 1
  • maxLength: 1000
dataset.sources[].metrics[].unitstringObligatoriskt i överordnat objekt
  • minLength: 1
  • maxLength: 100
dataset.sources[].metrics[].grainstringObligatoriskt i överordnat objekt
  • enum: ["post","account"]
dataset.sources[].metrics[].valuenumber | nullObligatoriskt i överordnat objekt—
dataset.sources[].metrics[].availabilitystringObligatoriskt i överordnat objekt
  • enum: ["available","partial","not_returned","unsupported","permission_required","threshold_not_met","no_data","failed","pending","stale"]
dataset.sources[].metrics[].reasonstring | nullObligatoriskt i överordnat objekt—
dataset.sources[].metrics[].reasonanyOf 1stringObligatoriskt i överordnat objekt
  • maxLength: 4000
dataset.sources[].metrics[].reasonanyOf 2nullObligatoriskt i överordnat objekt—
dataset.sources[].metrics[].measurementobjectObligatoriskt i överordnat objekt
  • additionalProperties: false
dataset.sources[].metrics[].measurement.kindstringObligatoriskt i överordnat objekt
  • enum: ["lifetime","snapshot","period","unknown"]
dataset.sources[].metrics[].measurement.periodstring | nullObligatoriskt i överordnat objekt—
dataset.sources[].metrics[].measurement.periodanyOf 1stringObligatoriskt i överordnat objekt
  • maxLength: 100
dataset.sources[].metrics[].measurement.periodanyOf 2nullObligatoriskt i överordnat objekt—
dataset.sources[].metrics[].measurement.startstring | nullObligatoriskt i överordnat objekt—
dataset.sources[].metrics[].measurement.startanyOf 1stringObligatoriskt i överordnat objekt
  • maxLength: 100
dataset.sources[].metrics[].measurement.startanyOf 2nullObligatoriskt i överordnat objekt—
dataset.sources[].metrics[].measurement.endstring | nullObligatoriskt i överordnat objekt—
dataset.sources[].metrics[].measurement.endanyOf 1stringObligatoriskt i överordnat objekt
  • maxLength: 100
dataset.sources[].metrics[].measurement.endanyOf 2nullObligatoriskt i överordnat objekt—
dataset.sources[].metrics[].measurement.timezonestring | nullObligatoriskt i överordnat objekt—
dataset.sources[].metrics[].measurement.timezoneanyOf 1stringObligatoriskt i överordnat objekt
  • maxLength: 100
dataset.sources[].metrics[].measurement.timezoneanyOf 2nullObligatoriskt i överordnat objekt—
dataset.sources[].metrics[].sourcePathstringObligatoriskt i överordnat objekt
  • minLength: 1
  • maxLength: 2000
dataset.coverageobjectObligatoriskt i överordnat objekt
  • additionalProperties: false
dataset.coverage.populationstringObligatoriskt i överordnat objekt
  • const: "discovered_posts"
dataset.coverage.postsCompletebooleanObligatoriskt i överordnat objekt—
dataset.coverage.nextCursorstring | nullObligatoriskt i överordnat objekt—
dataset.coverage.nextCursoranyOf 1stringObligatoriskt i överordnat objekt
  • maxLength: 16384
dataset.coverage.nextCursoranyOf 2nullObligatoriskt i överordnat objekt—
dataset.coverage.postLimitintegerObligatoriskt i överordnat objekt
  • minimum: 0
  • maximum: 1000
dataset.coverage.postInsightsLimitintegerObligatoriskt i överordnat objekt
  • minimum: 0
  • maximum: 20
dataset.coverage.omittedPostInsightsintegerObligatoriskt i överordnat objekt
  • minimum: 0
  • maximum: 9007199254740991
dataset.coverage.notesarrayObligatoriskt i överordnat objekt
  • maxItems: 50
dataset.coverage.notes[]stringValfritt / objekt
  • maxLength: 2000
dataset.customMetricsarrayObligatoriskt i överordnat objekt
  • maxItems: 50
dataset.customMetrics[]objectValfritt / objekt
  • additionalProperties: false
dataset.customMetrics[].idstringObligatoriskt i överordnat objekt
  • format: "uuid"
  • pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
dataset.customMetrics[].namestringObligatoriskt i överordnat objekt
  • minLength: 1
  • maxLength: 100
dataset.customMetrics[].versionintegerObligatoriskt i överordnat objekt
  • maximum: 9007199254740991
  • exclusiveMinimum: 0
dataset.customMetrics[].expressionstringObligatoriskt i överordnat objekt
  • minLength: 1
  • maxLength: 1000
dataset.customMetrics[].definitionstringObligatoriskt i överordnat objekt
  • maxLength: 1000
dataset.customMetrics[].unitstringObligatoriskt i överordnat objekt
  • maxLength: 100
dataset.customMetrics[].grainstringObligatoriskt i överordnat objekt
  • enum: ["post","account","compatible_sum"]
dataset.customMetrics[].roundingobjectObligatoriskt i överordnat objekt
  • additionalProperties: false
dataset.customMetrics[].rounding.decimalPlacesintegerObligatoriskt i överordnat objekt
  • minimum: 0
  • maximum: 8
dataset.customMetrics[].rounding.modestringObligatoriskt i överordnat objekt
  • const: "half_away_from_zero"
dataset.customMetrics[].inputsarrayObligatoriskt i överordnat objekt
  • maxItems: 5000
dataset.customMetrics[].inputs[]objectValfritt / objekt
  • additionalProperties: false
dataset.customMetrics[].inputs[].requestIdstring | nullObligatoriskt i överordnat objekt—
dataset.customMetrics[].inputs[].requestIdanyOf 1stringObligatoriskt i överordnat objekt
  • format: "uuid"
  • pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
dataset.customMetrics[].inputs[].requestIdanyOf 2nullObligatoriskt i överordnat objekt—
dataset.customMetrics[].inputs[].sourcePathstringObligatoriskt i överordnat objekt
  • maxLength: 2000
dataset.customMetrics[].inputs[].valuenumber | nullObligatoriskt i överordnat objekt—
dataset.customMetrics[].inputs[].availabilitystringObligatoriskt i överordnat objekt
  • enum: ["available","partial","not_returned","unsupported","permission_required","threshold_not_met","no_data","failed","pending","stale"]
dataset.customMetrics[].valuenumber | nullObligatoriskt i överordnat objekt—
dataset.customMetrics[].availabilitystringObligatoriskt i överordnat objekt
  • enum: ["available","partial","not_returned","unsupported","permission_required","threshold_not_met","no_data","failed","pending","stale"]
dataset.customMetrics[].reasonstring | nullObligatoriskt i överordnat objekt—
dataset.customMetrics[].reasonanyOf 1stringObligatoriskt i överordnat objekt
  • maxLength: 4000
dataset.customMetrics[].reasonanyOf 2nullObligatoriskt i överordnat objekt—
dataset.customMetrics[].formulaobjectValfritt / objekt
  • additionalProperties: false
dataset.customMetrics[].formula.contractVersionstringObligatoriskt i överordnat objekt
  • const: "analytics-metric/v1"
dataset.customMetrics[].formula.idstringObligatoriskt i överordnat objekt
  • format: "uuid"
  • pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
dataset.customMetrics[].formula.workspaceIdstringObligatoriskt i överordnat objekt
  • format: "uuid"
  • pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
dataset.customMetrics[].formula.namestringObligatoriskt i överordnat objekt
  • minLength: 1
  • maxLength: 100
dataset.customMetrics[].formula.versionintegerObligatoriskt i överordnat objekt
  • minimum: 1
  • maximum: 1000000
dataset.customMetrics[].formula.expressionstringObligatoriskt i överordnat objekt
  • minLength: 1
  • maxLength: 1000
dataset.customMetrics[].formula.fieldsarrayObligatoriskt i överordnat objekt
  • maxItems: 32
dataset.customMetrics[].formula.fields[]objectValfritt / objekt
  • additionalProperties: false
dataset.customMetrics[].formula.fields[].identifierstringObligatoriskt i överordnat objekt
  • pattern: "^[a-z][a-z0-9_]{0,63}$"
dataset.customMetrics[].formula.fields[].selectorobjectObligatoriskt i överordnat objekt
  • additionalProperties: false
dataset.customMetrics[].formula.fields[].selector.platformstringObligatoriskt i överordnat objekt
  • enum: ["facebook","instagram","threads","youtube"]
dataset.customMetrics[].formula.fields[].selector.keystringObligatoriskt i överordnat objekt
  • pattern: "^[A-Za-z][A-Za-z0-9_]{0,100}$"
dataset.customMetrics[].formula.fields[].selector.definitionstringObligatoriskt i överordnat objekt
  • minLength: 1
  • maxLength: 500
dataset.customMetrics[].formula.fields[].selector.unitstringObligatoriskt i överordnat objekt
  • enum: ["count","seconds","minutes","percent","ratio"]
dataset.customMetrics[].formula.fields[].selector.grainstringObligatoriskt i överordnat objekt
  • enum: ["post","account"]
dataset.customMetrics[].formula.fields[].selector.measurementKindstringObligatoriskt i överordnat objekt
  • enum: ["lifetime","snapshot","period","unknown"]
dataset.customMetrics[].formula.fields[].selector.nativePeriodstring | nullObligatoriskt i överordnat objekt—
dataset.customMetrics[].formula.fields[].selector.nativePeriodanyOf 1stringObligatoriskt i överordnat objekt
  • minLength: 1
  • maxLength: 64
dataset.customMetrics[].formula.fields[].selector.nativePeriodanyOf 2nullObligatoriskt i överordnat objekt—
dataset.customMetrics[].formula.fields[].selector.timezonestring | nullObligatoriskt i överordnat objekt—
dataset.customMetrics[].formula.fields[].selector.timezoneanyOf 1stringObligatoriskt i överordnat objekt
  • minLength: 1
  • maxLength: 100
dataset.customMetrics[].formula.fields[].selector.timezoneanyOf 2nullObligatoriskt i överordnat objekt—
dataset.customMetrics[].formula.fields[].aggregationstringObligatoriskt i överordnat objekt
  • enum: ["single","sum"]
dataset.customMetrics[].formula.roundingobjectObligatoriskt i överordnat objekt
  • additionalProperties: false
dataset.customMetrics[].formula.rounding.decimalPlacesintegerObligatoriskt i överordnat objekt
  • minimum: 0
  • maximum: 8
dataset.customMetrics[].formula.rounding.modestringObligatoriskt i överordnat objekt
  • const: "half_away_from_zero"
dataset.customMetrics[].calculationobjectValfritt / objekt
  • additionalProperties: false
dataset.customMetrics[].calculation.contractVersionstringObligatoriskt i överordnat objekt
  • const: "analytics-metric/v1"
dataset.customMetrics[].calculation.workspaceIdstringObligatoriskt i överordnat objekt
  • format: "uuid"
  • pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
dataset.customMetrics[].calculation.datasetIdstringObligatoriskt i överordnat objekt
  • minLength: 1
  • maxLength: 100
dataset.customMetrics[].calculation.formulaIdstringObligatoriskt i överordnat objekt
  • format: "uuid"
  • pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
dataset.customMetrics[].calculation.namestringObligatoriskt i överordnat objekt
  • minLength: 1
  • maxLength: 100
dataset.customMetrics[].calculation.versionintegerObligatoriskt i överordnat objekt
  • maximum: 9007199254740991
  • exclusiveMinimum: 0
dataset.customMetrics[].calculation.expressionstringObligatoriskt i överordnat objekt
  • maxLength: 1000
dataset.customMetrics[].calculation.roundingobjectObligatoriskt i överordnat objekt
  • additionalProperties: false
dataset.customMetrics[].calculation.rounding.decimalPlacesintegerObligatoriskt i överordnat objekt
  • minimum: 0
  • maximum: 8
dataset.customMetrics[].calculation.rounding.modestringObligatoriskt i överordnat objekt
  • const: "half_away_from_zero"
dataset.customMetrics[].calculation.valuenumber | nullObligatoriskt i överordnat objekt—
dataset.customMetrics[].calculation.unitstringObligatoriskt i överordnat objekt
  • minLength: 1
  • maxLength: 200
dataset.customMetrics[].calculation.statusstringObligatoriskt i överordnat objekt
  • enum: ["available","not_returned"]
dataset.customMetrics[].calculation.codestringObligatoriskt i överordnat objekt
  • enum: ["ok","invalid_expression","missing_input","incompatible_input","zero_denominator","numeric_limit","workspace_mismatch","ambiguous_input","unknown_exclusion"]
dataset.customMetrics[].calculation.reasonstring | nullObligatoriskt i överordnat objekt—
dataset.customMetrics[].calculation.reasonanyOf 1stringObligatoriskt i överordnat objekt
  • minLength: 1
  • maxLength: 500
dataset.customMetrics[].calculation.reasonanyOf 2nullObligatoriskt i överordnat objekt—
dataset.customMetrics[].calculation.excludedInputIdsarrayObligatoriskt i överordnat objekt
  • maxItems: 5000
dataset.customMetrics[].calculation.excludedInputIds[]stringValfritt / objekt
  • minLength: 1
  • maxLength: 1500
dataset.customMetrics[].calculation.inputsarrayObligatoriskt i överordnat objekt
  • maxItems: 5000
dataset.customMetrics[].calculation.inputs[]objectValfritt / objekt
  • additionalProperties: false
dataset.customMetrics[].calculation.inputs[].inputIdstringObligatoriskt i överordnat objekt
  • minLength: 1
  • maxLength: 1500
dataset.customMetrics[].calculation.inputs[].selectorobjectObligatoriskt i överordnat objekt
  • additionalProperties: false
dataset.customMetrics[].calculation.inputs[].selector.platformstringObligatoriskt i överordnat objekt
  • enum: ["facebook","instagram","threads","youtube"]
dataset.customMetrics[].calculation.inputs[].selector.keystringObligatoriskt i överordnat objekt
  • pattern: "^[A-Za-z][A-Za-z0-9_]{0,100}$"
dataset.customMetrics[].calculation.inputs[].selector.definitionstringObligatoriskt i överordnat objekt
  • minLength: 1
  • maxLength: 500
dataset.customMetrics[].calculation.inputs[].selector.unitstringObligatoriskt i överordnat objekt
  • enum: ["count","seconds","minutes","percent","ratio"]
dataset.customMetrics[].calculation.inputs[].selector.grainstringObligatoriskt i överordnat objekt
  • enum: ["post","account"]
dataset.customMetrics[].calculation.inputs[].selector.measurementKindstringObligatoriskt i överordnat objekt
  • enum: ["lifetime","snapshot","period","unknown"]
dataset.customMetrics[].calculation.inputs[].selector.nativePeriodstring | nullObligatoriskt i överordnat objekt—
dataset.customMetrics[].calculation.inputs[].selector.nativePeriodanyOf 1stringObligatoriskt i överordnat objekt
  • minLength: 1
  • maxLength: 64
dataset.customMetrics[].calculation.inputs[].selector.nativePeriodanyOf 2nullObligatoriskt i överordnat objekt—
dataset.customMetrics[].calculation.inputs[].selector.timezonestring | nullObligatoriskt i överordnat objekt—
dataset.customMetrics[].calculation.inputs[].selector.timezoneanyOf 1stringObligatoriskt i överordnat objekt
  • minLength: 1
  • maxLength: 100
dataset.customMetrics[].calculation.inputs[].selector.timezoneanyOf 2nullObligatoriskt i överordnat objekt—
dataset.customMetrics[].calculation.inputs[].valuenumber | nullObligatoriskt i överordnat objekt—
dataset.customMetrics[].calculation.inputs[].availabilitystringObligatoriskt i överordnat objekt
  • enum: ["available","partial","not_returned","unsupported","permission_required","threshold_not_met","no_data","failed","pending","stale"]
dataset.customMetrics[].calculation.inputs[].reasonstring | nullObligatoriskt i överordnat objekt—
dataset.customMetrics[].calculation.inputs[].reasonanyOf 1stringObligatoriskt i överordnat objekt
  • maxLength: 8000
dataset.customMetrics[].calculation.inputs[].reasonanyOf 2nullObligatoriskt i överordnat objekt—
dataset.customMetrics[].calculation.inputs[].measurementobjectObligatoriskt i överordnat objekt
  • additionalProperties: false
dataset.customMetrics[].calculation.inputs[].measurement.kindstringObligatoriskt i överordnat objekt
  • enum: ["lifetime","snapshot","period","unknown"]
dataset.customMetrics[].calculation.inputs[].measurement.periodstring | nullObligatoriskt i överordnat objekt—
dataset.customMetrics[].calculation.inputs[].measurement.periodanyOf 1stringObligatoriskt i överordnat objekt
  • minLength: 1
  • maxLength: 64
dataset.customMetrics[].calculation.inputs[].measurement.periodanyOf 2nullObligatoriskt i överordnat objekt—
dataset.customMetrics[].calculation.inputs[].measurement.startstring | nullObligatoriskt i överordnat objekt—
dataset.customMetrics[].calculation.inputs[].measurement.startanyOf 1stringObligatoriskt i överordnat objekt
  • minLength: 1
  • maxLength: 64
dataset.customMetrics[].calculation.inputs[].measurement.startanyOf 2nullObligatoriskt i överordnat objekt—
dataset.customMetrics[].calculation.inputs[].measurement.endstring | nullObligatoriskt i överordnat objekt—
dataset.customMetrics[].calculation.inputs[].measurement.endanyOf 1stringObligatoriskt i överordnat objekt
  • minLength: 1
  • maxLength: 64
dataset.customMetrics[].calculation.inputs[].measurement.endanyOf 2nullObligatoriskt i överordnat objekt—
dataset.customMetrics[].calculation.inputs[].measurement.timezonestring | nullObligatoriskt i överordnat objekt—
dataset.customMetrics[].calculation.inputs[].measurement.timezoneanyOf 1stringObligatoriskt i överordnat objekt
  • minLength: 1
  • maxLength: 100
dataset.customMetrics[].calculation.inputs[].measurement.timezoneanyOf 2nullObligatoriskt i överordnat objekt—
dataset.customMetrics[].calculation.inputs[].requestIdstring | nullObligatoriskt i överordnat objekt—
dataset.customMetrics[].calculation.inputs[].requestIdanyOf 1stringObligatoriskt i överordnat objekt
  • format: "uuid"
  • pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
dataset.customMetrics[].calculation.inputs[].requestIdanyOf 2nullObligatoriskt i överordnat objekt—
dataset.customMetrics[].calculation.inputs[].sourcePathstringObligatoriskt i överordnat objekt
  • minLength: 1
  • maxLength: 1000
dataset.customMetrics[].calculation.inputs[].accountIdstringObligatoriskt i överordnat objekt
  • format: "uuid"
  • pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
dataset.customMetrics[].calculation.inputs[].providerResourceIdstring | nullObligatoriskt i överordnat objekt—
dataset.customMetrics[].calculation.inputs[].providerResourceIdanyOf 1stringObligatoriskt i överordnat objekt
  • minLength: 1
  • maxLength: 512
dataset.customMetrics[].calculation.inputs[].providerResourceIdanyOf 2nullObligatoriskt i överordnat objekt—
dataset.customMetrics[].calculation.inputs[].fetchedAtstring | nullObligatoriskt i överordnat objekt—
dataset.customMetrics[].calculation.inputs[].fetchedAtanyOf 1stringObligatoriskt i överordnat objekt
  • 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)))$"
dataset.customMetrics[].calculation.inputs[].fetchedAtanyOf 2nullObligatoriskt i överordnat objekt—
dataset.customMetrics[].calculation.inputs[].identifierstringObligatoriskt i överordnat objekt
  • pattern: "^[a-z][a-z0-9_]{0,63}$"
dataset.customMetrics[].calculation.inputs[].includedbooleanObligatoriskt i överordnat objekt—
excluded_input_idsarrayValfritt / objekt
  • maxItems: 5000
excluded_input_ids[]stringValfritt / objekt
  • maxLength: 4000
expected_versioninteger | nullObligatoriskt i överordnat objekt—
expected_versionanyOf 1integerObligatoriskt i överordnat objekt
  • minimum: 1
  • maximum: 1000000
expected_versionanyOf 2nullObligatoriskt i överordnat objekt—
mutation_idstringObligatoriskt i överordnat objekt
  • format: "uuid"
  • pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
calculationobjectValfritt / objekt
  • additionalProperties: false
calculation.contractVersionstringObligatoriskt i överordnat objekt
  • const: "analytics-metric/v1"
calculation.workspaceIdstringObligatoriskt i överordnat objekt
  • format: "uuid"
  • pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
calculation.datasetIdstringObligatoriskt i överordnat objekt
  • minLength: 1
  • maxLength: 100
calculation.formulaIdstringObligatoriskt i överordnat objekt
  • format: "uuid"
  • pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
calculation.namestringObligatoriskt i överordnat objekt
  • minLength: 1
  • maxLength: 100
calculation.versionintegerObligatoriskt i överordnat objekt
  • maximum: 9007199254740991
  • exclusiveMinimum: 0
calculation.expressionstringObligatoriskt i överordnat objekt
  • maxLength: 1000
calculation.roundingobjectObligatoriskt i överordnat objekt
  • additionalProperties: false
calculation.rounding.decimalPlacesintegerObligatoriskt i överordnat objekt
  • minimum: 0
  • maximum: 8
calculation.rounding.modestringObligatoriskt i överordnat objekt
  • const: "half_away_from_zero"
calculation.valuenumber | nullObligatoriskt i överordnat objekt—
calculation.unitstringObligatoriskt i överordnat objekt
  • minLength: 1
  • maxLength: 200
calculation.statusstringObligatoriskt i överordnat objekt
  • enum: ["available","not_returned"]
calculation.codestringObligatoriskt i överordnat objekt
  • enum: ["ok","invalid_expression","missing_input","incompatible_input","zero_denominator","numeric_limit","workspace_mismatch","ambiguous_input","unknown_exclusion"]
calculation.reasonstring | nullObligatoriskt i överordnat objekt—
calculation.reasonanyOf 1stringObligatoriskt i överordnat objekt
  • minLength: 1
  • maxLength: 500
calculation.reasonanyOf 2nullObligatoriskt i överordnat objekt—
calculation.excludedInputIdsarrayObligatoriskt i överordnat objekt
  • maxItems: 5000
calculation.excludedInputIds[]stringValfritt / objekt
  • minLength: 1
  • maxLength: 1500
calculation.inputsarrayObligatoriskt i överordnat objekt
  • maxItems: 5000
calculation.inputs[]objectValfritt / objekt
  • additionalProperties: false
calculation.inputs[].inputIdstringObligatoriskt i överordnat objekt
  • minLength: 1
  • maxLength: 1500
calculation.inputs[].selectorobjectObligatoriskt i överordnat objekt
  • additionalProperties: false
calculation.inputs[].selector.platformstringObligatoriskt i överordnat objekt
  • enum: ["facebook","instagram","threads","youtube"]
calculation.inputs[].selector.keystringObligatoriskt i överordnat objekt
  • pattern: "^[A-Za-z][A-Za-z0-9_]{0,100}$"
calculation.inputs[].selector.definitionstringObligatoriskt i överordnat objekt
  • minLength: 1
  • maxLength: 500
calculation.inputs[].selector.unitstringObligatoriskt i överordnat objekt
  • enum: ["count","seconds","minutes","percent","ratio"]
calculation.inputs[].selector.grainstringObligatoriskt i överordnat objekt
  • enum: ["post","account"]
calculation.inputs[].selector.measurementKindstringObligatoriskt i överordnat objekt
  • enum: ["lifetime","snapshot","period","unknown"]
calculation.inputs[].selector.nativePeriodstring | nullObligatoriskt i överordnat objekt—
calculation.inputs[].selector.nativePeriodanyOf 1stringObligatoriskt i överordnat objekt
  • minLength: 1
  • maxLength: 64
calculation.inputs[].selector.nativePeriodanyOf 2nullObligatoriskt i överordnat objekt—
calculation.inputs[].selector.timezonestring | nullObligatoriskt i överordnat objekt—
calculation.inputs[].selector.timezoneanyOf 1stringObligatoriskt i överordnat objekt
  • minLength: 1
  • maxLength: 100
calculation.inputs[].selector.timezoneanyOf 2nullObligatoriskt i överordnat objekt—
calculation.inputs[].valuenumber | nullObligatoriskt i överordnat objekt—
calculation.inputs[].availabilitystringObligatoriskt i överordnat objekt
  • enum: ["available","partial","not_returned","unsupported","permission_required","threshold_not_met","no_data","failed","pending","stale"]
calculation.inputs[].reasonstring | nullObligatoriskt i överordnat objekt—
calculation.inputs[].reasonanyOf 1stringObligatoriskt i överordnat objekt
  • maxLength: 8000
calculation.inputs[].reasonanyOf 2nullObligatoriskt i överordnat objekt—
calculation.inputs[].measurementobjectObligatoriskt i överordnat objekt
  • additionalProperties: false
calculation.inputs[].measurement.kindstringObligatoriskt i överordnat objekt
  • enum: ["lifetime","snapshot","period","unknown"]
calculation.inputs[].measurement.periodstring | nullObligatoriskt i överordnat objekt—
calculation.inputs[].measurement.periodanyOf 1stringObligatoriskt i överordnat objekt
  • minLength: 1
  • maxLength: 64
calculation.inputs[].measurement.periodanyOf 2nullObligatoriskt i överordnat objekt—
calculation.inputs[].measurement.startstring | nullObligatoriskt i överordnat objekt—
calculation.inputs[].measurement.startanyOf 1stringObligatoriskt i överordnat objekt
  • minLength: 1
  • maxLength: 64
calculation.inputs[].measurement.startanyOf 2nullObligatoriskt i överordnat objekt—
calculation.inputs[].measurement.endstring | nullObligatoriskt i överordnat objekt—
calculation.inputs[].measurement.endanyOf 1stringObligatoriskt i överordnat objekt
  • minLength: 1
  • maxLength: 64
calculation.inputs[].measurement.endanyOf 2nullObligatoriskt i överordnat objekt—
calculation.inputs[].measurement.timezonestring | nullObligatoriskt i överordnat objekt—
calculation.inputs[].measurement.timezoneanyOf 1stringObligatoriskt i överordnat objekt
  • minLength: 1
  • maxLength: 100
calculation.inputs[].measurement.timezoneanyOf 2nullObligatoriskt i överordnat objekt—
calculation.inputs[].requestIdstring | nullObligatoriskt i överordnat objekt—
calculation.inputs[].requestIdanyOf 1stringObligatoriskt i överordnat objekt
  • format: "uuid"
  • pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
calculation.inputs[].requestIdanyOf 2nullObligatoriskt i överordnat objekt—
calculation.inputs[].sourcePathstringObligatoriskt i överordnat objekt
  • minLength: 1
  • maxLength: 1000
calculation.inputs[].accountIdstringObligatoriskt i överordnat objekt
  • format: "uuid"
  • pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
calculation.inputs[].providerResourceIdstring | nullObligatoriskt i överordnat objekt—
calculation.inputs[].providerResourceIdanyOf 1stringObligatoriskt i överordnat objekt
  • minLength: 1
  • maxLength: 512
calculation.inputs[].providerResourceIdanyOf 2nullObligatoriskt i överordnat objekt—
calculation.inputs[].fetchedAtstring | nullObligatoriskt i överordnat objekt—
calculation.inputs[].fetchedAtanyOf 1stringObligatoriskt i överordnat objekt
  • 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)))$"
calculation.inputs[].fetchedAtanyOf 2nullObligatoriskt i överordnat objekt—
calculation.inputs[].identifierstringObligatoriskt i överordnat objekt
  • pattern: "^[a-z][a-z0-9_]{0,63}$"
calculation.inputs[].includedbooleanObligatoriskt i överordnat objekt—
Fullständigt JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    },
    "formula": {
      "type": "object",
      "properties": {
        "contractVersion": {
          "type": "string",
          "const": "analytics-metric/v1"
        },
        "id": {
          "type": "string",
          "format": "uuid",
          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
        },
        "workspaceId": {
          "type": "string",
          "format": "uuid",
          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
        },
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 100
        },
        "version": {
          "type": "integer",
          "minimum": 1,
          "maximum": 1000000
        },
        "expression": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1000
        },
        "fields": {
          "maxItems": 32,
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "identifier": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_]{0,63}$"
              },
              "selector": {
                "type": "object",
                "properties": {
                  "platform": {
                    "type": "string",
                    "enum": [
                      "facebook",
                      "instagram",
                      "threads",
                      "youtube"
                    ]
                  },
                  "key": {
                    "type": "string",
                    "pattern": "^[A-Za-z][A-Za-z0-9_]{0,100}$"
                  },
                  "definition": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "unit": {
                    "type": "string",
                    "enum": [
                      "count",
                      "seconds",
                      "minutes",
                      "percent",
                      "ratio"
                    ]
                  },
                  "grain": {
                    "type": "string",
                    "enum": [
                      "post",
                      "account"
                    ]
                  },
                  "measurementKind": {
                    "type": "string",
                    "enum": [
                      "lifetime",
                      "snapshot",
                      "period",
                      "unknown"
                    ]
                  },
                  "nativePeriod": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 64
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "timezone": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 100
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "platform",
                  "key",
                  "definition",
                  "unit",
                  "grain",
                  "measurementKind",
                  "nativePeriod",
                  "timezone"
                ],
                "additionalProperties": false
              },
              "aggregation": {
                "type": "string",
                "enum": [
                  "single",
                  "sum"
                ]
              }
            },
            "required": [
              "identifier",
              "selector",
              "aggregation"
            ],
            "additionalProperties": false
          }
        },
        "rounding": {
          "type": "object",
          "properties": {
            "decimalPlaces": {
              "type": "integer",
              "minimum": 0,
              "maximum": 8
            },
            "mode": {
              "type": "string",
              "const": "half_away_from_zero"
            }
          },
          "required": [
            "decimalPlaces",
            "mode"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "contractVersion",
        "id",
        "workspaceId",
        "name",
        "version",
        "expression",
        "fields",
        "rounding"
      ],
      "additionalProperties": false
    },
    "dataset": {
      "type": "object",
      "properties": {
        "contractVersion": {
          "type": "string",
          "const": "analytics-report/v1"
        },
        "id": {
          "type": "string",
          "format": "uuid",
          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
        },
        "reviewedAt": {
          "type": "string",
          "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)))$",
          "format": "date-time"
        },
        "selection": {
          "type": "object",
          "properties": {
            "workspaceId": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            },
            "accountIds": {
              "minItems": 1,
              "maxItems": 50,
              "type": "array",
              "items": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              }
            },
            "platforms": {
              "minItems": 1,
              "maxItems": 4,
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "facebook",
                  "instagram",
                  "threads",
                  "youtube"
                ]
              }
            },
            "startDate": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            },
            "endDate": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            },
            "timezone": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          },
          "required": [
            "workspaceId",
            "accountIds",
            "platforms",
            "startDate",
            "endDate",
            "timezone"
          ],
          "additionalProperties": false
        },
        "accounts": {
          "maxItems": 50,
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              "workspaceId": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              "platform": {
                "type": "string",
                "enum": [
                  "facebook",
                  "instagram",
                  "threads",
                  "youtube"
                ]
              },
              "name": {
                "type": "string",
                "maxLength": 500
              },
              "connectionStatus": {
                "type": "string",
                "maxLength": 100
              },
              "healthMessage": {
                "type": "string",
                "maxLength": 1000
              }
            },
            "required": [
              "id",
              "workspaceId",
              "platform",
              "name"
            ],
            "additionalProperties": false
          }
        },
        "posts": {
          "maxItems": 1000,
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "social_post_id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              "workspace_id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              "social_account_id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              "platform": {
                "type": "string",
                "enum": [
                  "instagram",
                  "facebook",
                  "threads",
                  "youtube"
                ]
              },
              "provider_post_id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 512
              },
              "provider_published_at": {
                "anyOf": [
                  {
                    "type": "string",
                    "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)))$",
                    "format": "date-time"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "content_format": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "permalink": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 2048,
                    "format": "uri"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "provider_state": {
                "type": "string",
                "enum": [
                  "available",
                  "deleted",
                  "unavailable",
                  "unknown"
                ]
              },
              "first_seen_at": {
                "type": "string",
                "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)))$",
                "format": "date-time"
              },
              "last_seen_at": {
                "type": "string",
                "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)))$",
                "format": "date-time"
              },
              "scheduled_post_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "provenance": {
                "type": "object",
                "properties": {
                  "provider": {
                    "type": "string",
                    "enum": [
                      "instagram",
                      "facebook",
                      "threads",
                      "youtube"
                    ]
                  },
                  "source": {
                    "type": "string",
                    "enum": [
                      "provider_api",
                      "provider_webhook",
                      "publication_outcome",
                      "backfill"
                    ]
                  },
                  "source_job_id": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "provider_api_version": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 200
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "schema_version": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 200
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "provider",
                  "source",
                  "source_job_id",
                  "provider_api_version",
                  "schema_version"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "social_post_id",
              "workspace_id",
              "social_account_id",
              "platform",
              "provider_post_id",
              "provider_published_at",
              "content_format",
              "permalink",
              "provider_state",
              "first_seen_at",
              "last_seen_at",
              "scheduled_post_id",
              "provenance"
            ],
            "additionalProperties": false
          }
        },
        "sources": {
          "maxItems": 30,
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "accountId": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              "platform": {
                "type": "string",
                "enum": [
                  "facebook",
                  "instagram",
                  "threads",
                  "youtube"
                ]
              },
              "resourceKind": {
                "type": "string",
                "enum": [
                  "account",
                  "post"
                ]
              },
              "providerResourceId": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 512
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "requestId": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "status": {
                "type": "string",
                "enum": [
                  "available",
                  "partial",
                  "not_returned",
                  "unsupported",
                  "permission_required",
                  "threshold_not_met",
                  "no_data",
                  "failed",
                  "pending",
                  "stale"
                ]
              },
              "reason": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 8000
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "envelope": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "contract_version": {
                        "type": "string",
                        "const": "provider-insights/v1"
                      },
                      "request_id": {
                        "type": "string",
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                      },
                      "platform": {
                        "type": "string",
                        "enum": [
                          "facebook",
                          "instagram",
                          "threads",
                          "youtube"
                        ]
                      },
                      "resource": {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "enum": [
                              "account",
                              "post"
                            ]
                          },
                          "social_account_id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                          },
                          "provider_resource_id": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "kind",
                          "social_account_id",
                          "provider_resource_id"
                        ],
                        "additionalProperties": false
                      },
                      "provider_api_version": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 100
                      },
                      "fetched_at": {
                        "type": "string",
                        "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)))$",
                        "format": "date-time"
                      },
                      "status": {
                        "type": "string",
                        "enum": [
                          "available",
                          "partial",
                          "unavailable"
                        ]
                      },
                      "availability": {
                        "minItems": 1,
                        "maxItems": 64,
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "scope": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 200
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "available",
                                "partial",
                                "not_returned",
                                "unsupported",
                                "permission_required",
                                "threshold_not_met",
                                "no_data",
                                "failed"
                              ]
                            },
                            "reason": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 2000
                            },
                            "diagnostics": {
                              "type": "object",
                              "properties": {
                                "http_status": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 599
                                },
                                "failed_step": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 200
                                },
                                "provider_code": {
                                  "anyOf": [
                                    {
                                      "type": "number"
                                    },
                                    {
                                      "type": "string",
                                      "maxLength": 100
                                    }
                                  ]
                                },
                                "provider_subcode": {
                                  "anyOf": [
                                    {
                                      "type": "number"
                                    },
                                    {
                                      "type": "string",
                                      "maxLength": 100
                                    }
                                  ]
                                },
                                "provider_type": {
                                  "type": "string",
                                  "maxLength": 200
                                },
                                "is_transient": {
                                  "type": "boolean"
                                },
                                "provider_request_id": {
                                  "type": "string",
                                  "maxLength": 200
                                },
                                "access": {
                                  "type": "object",
                                  "properties": {
                                    "login_mode": {
                                      "type": "string",
                                      "enum": [
                                        "instagram_login",
                                        "facebook_login",
                                        "threads_user"
                                      ]
                                    },
                                    "provider_host": {
                                      "type": "string",
                                      "maxLength": 200
                                    },
                                    "required_permissions": {
                                      "maxItems": 16,
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "maxLength": 100
                                      }
                                    },
                                    "current_connection_policy_permissions": {
                                      "maxItems": 16,
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "maxLength": 100
                                      }
                                    },
                                    "granted_permissions": {
                                      "anyOf": [
                                        {
                                          "maxItems": 128,
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "maxLength": 100
                                          }
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "grant_evidence": {
                                      "type": "string",
                                      "enum": [
                                        "exact",
                                        "unknown"
                                      ]
                                    },
                                    "permission_state": {
                                      "type": "string",
                                      "enum": [
                                        "granted",
                                        "missing",
                                        "unknown"
                                      ]
                                    },
                                    "grant_observed_at": {
                                      "type": "string",
                                      "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)))$",
                                      "format": "date-time"
                                    },
                                    "app_access": {
                                      "type": "string",
                                      "const": "unverified"
                                    },
                                    "next_step": {
                                      "type": "string",
                                      "maxLength": 1500
                                    }
                                  },
                                  "required": [
                                    "login_mode",
                                    "provider_host",
                                    "required_permissions",
                                    "current_connection_policy_permissions",
                                    "granted_permissions",
                                    "grant_evidence",
                                    "permission_state",
                                    "app_access",
                                    "next_step"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "http_status"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "required": [
                            "scope",
                            "status"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "provider_data": {
                        "anyOf": [
                          {},
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "requested_date_range": {
                        "anyOf": [
                          {
                            "type": "object",
                            "properties": {
                              "start_date": {
                                "type": "string",
                                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                              },
                              "end_date": {
                                "type": "string",
                                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                              }
                            },
                            "required": [
                              "start_date",
                              "end_date"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "cache": {
                        "type": "object",
                        "properties": {
                          "authoritative": {
                            "type": "boolean",
                            "const": false
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "stored",
                              "hit",
                              "bypassed"
                            ]
                          },
                          "expires_at": {
                            "type": "string",
                            "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)))$",
                            "format": "date-time"
                          }
                        },
                        "required": [
                          "authoritative",
                          "status",
                          "expires_at"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "required": [
                      "contract_version",
                      "request_id",
                      "platform",
                      "resource",
                      "provider_api_version",
                      "fetched_at",
                      "status",
                      "availability",
                      "provider_data",
                      "requested_date_range",
                      "cache"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "metrics": {
                "maxItems": 5000,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "key": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 150
                    },
                    "definition": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 1000
                    },
                    "unit": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 100
                    },
                    "grain": {
                      "type": "string",
                      "enum": [
                        "post",
                        "account"
                      ]
                    },
                    "value": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "availability": {
                      "type": "string",
                      "enum": [
                        "available",
                        "partial",
                        "not_returned",
                        "unsupported",
                        "permission_required",
                        "threshold_not_met",
                        "no_data",
                        "failed",
                        "pending",
                        "stale"
                      ]
                    },
                    "reason": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 4000
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "measurement": {
                      "type": "object",
                      "properties": {
                        "kind": {
                          "type": "string",
                          "enum": [
                            "lifetime",
                            "snapshot",
                            "period",
                            "unknown"
                          ]
                        },
                        "period": {
                          "anyOf": [
                            {
                              "type": "string",
                              "maxLength": 100
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "start": {
                          "anyOf": [
                            {
                              "type": "string",
                              "maxLength": 100
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "end": {
                          "anyOf": [
                            {
                              "type": "string",
                              "maxLength": 100
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "timezone": {
                          "anyOf": [
                            {
                              "type": "string",
                              "maxLength": 100
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "kind",
                        "period",
                        "start",
                        "end",
                        "timezone"
                      ],
                      "additionalProperties": false
                    },
                    "sourcePath": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 2000
                    }
                  },
                  "required": [
                    "key",
                    "definition",
                    "unit",
                    "grain",
                    "value",
                    "availability",
                    "reason",
                    "measurement",
                    "sourcePath"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "accountId",
              "platform",
              "resourceKind",
              "providerResourceId",
              "requestId",
              "status",
              "reason",
              "envelope",
              "metrics"
            ],
            "additionalProperties": false
          }
        },
        "coverage": {
          "type": "object",
          "properties": {
            "population": {
              "type": "string",
              "const": "discovered_posts"
            },
            "postsComplete": {
              "type": "boolean"
            },
            "nextCursor": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 16384
                },
                {
                  "type": "null"
                }
              ]
            },
            "postLimit": {
              "type": "integer",
              "minimum": 0,
              "maximum": 1000
            },
            "postInsightsLimit": {
              "type": "integer",
              "minimum": 0,
              "maximum": 20
            },
            "omittedPostInsights": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "notes": {
              "maxItems": 50,
              "type": "array",
              "items": {
                "type": "string",
                "maxLength": 2000
              }
            }
          },
          "required": [
            "population",
            "postsComplete",
            "nextCursor",
            "postLimit",
            "postInsightsLimit",
            "omittedPostInsights",
            "notes"
          ],
          "additionalProperties": false
        },
        "customMetrics": {
          "maxItems": 50,
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 100
              },
              "version": {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991
              },
              "expression": {
                "type": "string",
                "minLength": 1,
                "maxLength": 1000
              },
              "definition": {
                "type": "string",
                "maxLength": 1000
              },
              "unit": {
                "type": "string",
                "maxLength": 100
              },
              "grain": {
                "type": "string",
                "enum": [
                  "post",
                  "account",
                  "compatible_sum"
                ]
              },
              "rounding": {
                "type": "object",
                "properties": {
                  "decimalPlaces": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 8
                  },
                  "mode": {
                    "type": "string",
                    "const": "half_away_from_zero"
                  }
                },
                "required": [
                  "decimalPlaces",
                  "mode"
                ],
                "additionalProperties": false
              },
              "inputs": {
                "maxItems": 5000,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "requestId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "sourcePath": {
                      "type": "string",
                      "maxLength": 2000
                    },
                    "value": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "availability": {
                      "type": "string",
                      "enum": [
                        "available",
                        "partial",
                        "not_returned",
                        "unsupported",
                        "permission_required",
                        "threshold_not_met",
                        "no_data",
                        "failed",
                        "pending",
                        "stale"
                      ]
                    }
                  },
                  "required": [
                    "requestId",
                    "sourcePath",
                    "value",
                    "availability"
                  ],
                  "additionalProperties": false
                }
              },
              "value": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "availability": {
                "type": "string",
                "enum": [
                  "available",
                  "partial",
                  "not_returned",
                  "unsupported",
                  "permission_required",
                  "threshold_not_met",
                  "no_data",
                  "failed",
                  "pending",
                  "stale"
                ]
              },
              "reason": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 4000
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "formula": {
                "type": "object",
                "properties": {
                  "contractVersion": {
                    "type": "string",
                    "const": "analytics-metric/v1"
                  },
                  "id": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                  },
                  "workspaceId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "version": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 1000000
                  },
                  "expression": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1000
                  },
                  "fields": {
                    "maxItems": 32,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "identifier": {
                          "type": "string",
                          "pattern": "^[a-z][a-z0-9_]{0,63}$"
                        },
                        "selector": {
                          "type": "object",
                          "properties": {
                            "platform": {
                              "type": "string",
                              "enum": [
                                "facebook",
                                "instagram",
                                "threads",
                                "youtube"
                              ]
                            },
                            "key": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]{0,100}$"
                            },
                            "definition": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 500
                            },
                            "unit": {
                              "type": "string",
                              "enum": [
                                "count",
                                "seconds",
                                "minutes",
                                "percent",
                                "ratio"
                              ]
                            },
                            "grain": {
                              "type": "string",
                              "enum": [
                                "post",
                                "account"
                              ]
                            },
                            "measurementKind": {
                              "type": "string",
                              "enum": [
                                "lifetime",
                                "snapshot",
                                "period",
                                "unknown"
                              ]
                            },
                            "nativePeriod": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 64
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "timezone": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 100
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "platform",
                            "key",
                            "definition",
                            "unit",
                            "grain",
                            "measurementKind",
                            "nativePeriod",
                            "timezone"
                          ],
                          "additionalProperties": false
                        },
                        "aggregation": {
                          "type": "string",
                          "enum": [
                            "single",
                            "sum"
                          ]
                        }
                      },
                      "required": [
                        "identifier",
                        "selector",
                        "aggregation"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "rounding": {
                    "type": "object",
                    "properties": {
                      "decimalPlaces": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 8
                      },
                      "mode": {
                        "type": "string",
                        "const": "half_away_from_zero"
                      }
                    },
                    "required": [
                      "decimalPlaces",
                      "mode"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "contractVersion",
                  "id",
                  "workspaceId",
                  "name",
                  "version",
                  "expression",
                  "fields",
                  "rounding"
                ],
                "additionalProperties": false
              },
              "calculation": {
                "type": "object",
                "properties": {
                  "contractVersion": {
                    "type": "string",
                    "const": "analytics-metric/v1"
                  },
                  "workspaceId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                  },
                  "datasetId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "formulaId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "version": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  },
                  "expression": {
                    "type": "string",
                    "maxLength": 1000
                  },
                  "rounding": {
                    "type": "object",
                    "properties": {
                      "decimalPlaces": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 8
                      },
                      "mode": {
                        "type": "string",
                        "const": "half_away_from_zero"
                      }
                    },
                    "required": [
                      "decimalPlaces",
                      "mode"
                    ],
                    "additionalProperties": false
                  },
                  "value": {
                    "type": [
                      "number",
                      "null"
                    ]
                  },
                  "unit": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "available",
                      "not_returned"
                    ]
                  },
                  "code": {
                    "type": "string",
                    "enum": [
                      "ok",
                      "invalid_expression",
                      "missing_input",
                      "incompatible_input",
                      "zero_denominator",
                      "numeric_limit",
                      "workspace_mismatch",
                      "ambiguous_input",
                      "unknown_exclusion"
                    ]
                  },
                  "reason": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "excludedInputIds": {
                    "maxItems": 5000,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 1500
                    }
                  },
                  "inputs": {
                    "maxItems": 5000,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "inputId": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1500
                        },
                        "selector": {
                          "type": "object",
                          "properties": {
                            "platform": {
                              "type": "string",
                              "enum": [
                                "facebook",
                                "instagram",
                                "threads",
                                "youtube"
                              ]
                            },
                            "key": {
                              "type": "string",
                              "pattern": "^[A-Za-z][A-Za-z0-9_]{0,100}$"
                            },
                            "definition": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 500
                            },
                            "unit": {
                              "type": "string",
                              "enum": [
                                "count",
                                "seconds",
                                "minutes",
                                "percent",
                                "ratio"
                              ]
                            },
                            "grain": {
                              "type": "string",
                              "enum": [
                                "post",
                                "account"
                              ]
                            },
                            "measurementKind": {
                              "type": "string",
                              "enum": [
                                "lifetime",
                                "snapshot",
                                "period",
                                "unknown"
                              ]
                            },
                            "nativePeriod": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 64
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "timezone": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 100
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "platform",
                            "key",
                            "definition",
                            "unit",
                            "grain",
                            "measurementKind",
                            "nativePeriod",
                            "timezone"
                          ],
                          "additionalProperties": false
                        },
                        "value": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "availability": {
                          "type": "string",
                          "enum": [
                            "available",
                            "partial",
                            "not_returned",
                            "unsupported",
                            "permission_required",
                            "threshold_not_met",
                            "no_data",
                            "failed",
                            "pending",
                            "stale"
                          ]
                        },
                        "reason": {
                          "anyOf": [
                            {
                              "type": "string",
                              "maxLength": 8000
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "measurement": {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "enum": [
                                "lifetime",
                                "snapshot",
                                "period",
                                "unknown"
                              ]
                            },
                            "period": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 64
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "start": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 64
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "end": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 64
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "timezone": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 100
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "kind",
                            "period",
                            "start",
                            "end",
                            "timezone"
                          ],
                          "additionalProperties": false
                        },
                        "requestId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "sourcePath": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1000
                        },
                        "accountId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                        },
                        "providerResourceId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "fetchedAt": {
                          "anyOf": [
                            {
                              "type": "string",
                              "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)))$",
                              "format": "date-time"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "identifier": {
                          "type": "string",
                          "pattern": "^[a-z][a-z0-9_]{0,63}$"
                        },
                        "included": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "inputId",
                        "selector",
                        "value",
                        "availability",
                        "reason",
                        "measurement",
                        "requestId",
                        "sourcePath",
                        "accountId",
                        "providerResourceId",
                        "fetchedAt",
                        "identifier",
                        "included"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "contractVersion",
                  "workspaceId",
                  "datasetId",
                  "formulaId",
                  "name",
                  "version",
                  "expression",
                  "rounding",
                  "value",
                  "unit",
                  "status",
                  "code",
                  "reason",
                  "excludedInputIds",
                  "inputs"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "id",
              "name",
              "version",
              "expression",
              "definition",
              "unit",
              "grain",
              "rounding",
              "inputs",
              "value",
              "availability",
              "reason"
            ],
            "additionalProperties": false
          }
        }
      },
      "required": [
        "contractVersion",
        "id",
        "reviewedAt",
        "selection",
        "accounts",
        "posts",
        "sources",
        "coverage",
        "customMetrics"
      ],
      "additionalProperties": false
    },
    "excluded_input_ids": {
      "maxItems": 5000,
      "type": "array",
      "items": {
        "type": "string",
        "maxLength": 4000
      }
    },
    "expected_version": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": 1,
          "maximum": 1000000
        },
        {
          "type": "null"
        }
      ]
    },
    "mutation_id": {
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    },
    "calculation": {
      "type": "object",
      "properties": {
        "contractVersion": {
          "type": "string",
          "const": "analytics-metric/v1"
        },
        "workspaceId": {
          "type": "string",
          "format": "uuid",
          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
        },
        "datasetId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 100
        },
        "formulaId": {
          "type": "string",
          "format": "uuid",
          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
        },
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 100
        },
        "version": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "maximum": 9007199254740991
        },
        "expression": {
          "type": "string",
          "maxLength": 1000
        },
        "rounding": {
          "type": "object",
          "properties": {
            "decimalPlaces": {
              "type": "integer",
              "minimum": 0,
              "maximum": 8
            },
            "mode": {
              "type": "string",
              "const": "half_away_from_zero"
            }
          },
          "required": [
            "decimalPlaces",
            "mode"
          ],
          "additionalProperties": false
        },
        "value": {
          "type": [
            "number",
            "null"
          ]
        },
        "unit": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
        },
        "status": {
          "type": "string",
          "enum": [
            "available",
            "not_returned"
          ]
        },
        "code": {
          "type": "string",
          "enum": [
            "ok",
            "invalid_expression",
            "missing_input",
            "incompatible_input",
            "zero_denominator",
            "numeric_limit",
            "workspace_mismatch",
            "ambiguous_input",
            "unknown_exclusion"
          ]
        },
        "reason": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            },
            {
              "type": "null"
            }
          ]
        },
        "excludedInputIds": {
          "maxItems": 5000,
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1500
          }
        },
        "inputs": {
          "maxItems": 5000,
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "inputId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 1500
              },
              "selector": {
                "type": "object",
                "properties": {
                  "platform": {
                    "type": "string",
                    "enum": [
                      "facebook",
                      "instagram",
                      "threads",
                      "youtube"
                    ]
                  },
                  "key": {
                    "type": "string",
                    "pattern": "^[A-Za-z][A-Za-z0-9_]{0,100}$"
                  },
                  "definition": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "unit": {
                    "type": "string",
                    "enum": [
                      "count",
                      "seconds",
                      "minutes",
                      "percent",
                      "ratio"
                    ]
                  },
                  "grain": {
                    "type": "string",
                    "enum": [
                      "post",
                      "account"
                    ]
                  },
                  "measurementKind": {
                    "type": "string",
                    "enum": [
                      "lifetime",
                      "snapshot",
                      "period",
                      "unknown"
                    ]
                  },
                  "nativePeriod": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 64
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "timezone": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 100
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "platform",
                  "key",
                  "definition",
                  "unit",
                  "grain",
                  "measurementKind",
                  "nativePeriod",
                  "timezone"
                ],
                "additionalProperties": false
              },
              "value": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "availability": {
                "type": "string",
                "enum": [
                  "available",
                  "partial",
                  "not_returned",
                  "unsupported",
                  "permission_required",
                  "threshold_not_met",
                  "no_data",
                  "failed",
                  "pending",
                  "stale"
                ]
              },
              "reason": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 8000
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "measurement": {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "enum": [
                      "lifetime",
                      "snapshot",
                      "period",
                      "unknown"
                    ]
                  },
                  "period": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 64
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "start": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 64
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "end": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 64
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "timezone": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 100
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "kind",
                  "period",
                  "start",
                  "end",
                  "timezone"
                ],
                "additionalProperties": false
              },
              "requestId": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "sourcePath": {
                "type": "string",
                "minLength": 1,
                "maxLength": 1000
              },
              "accountId": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              "providerResourceId": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 512
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "fetchedAt": {
                "anyOf": [
                  {
                    "type": "string",
                    "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)))$",
                    "format": "date-time"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "identifier": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_]{0,63}$"
              },
              "included": {
                "type": "boolean"
              }
            },
            "required": [
              "inputId",
              "selector",
              "value",
              "availability",
              "reason",
              "measurement",
              "requestId",
              "sourcePath",
              "accountId",
              "providerResourceId",
              "fetchedAt",
              "identifier",
              "included"
            ],
            "additionalProperties": false
          }
        }
      },
      "required": [
        "contractVersion",
        "workspaceId",
        "datasetId",
        "formulaId",
        "name",
        "version",
        "expression",
        "rounding",
        "value",
        "unit",
        "status",
        "code",
        "reason",
        "excludedInputIds",
        "inputs"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "workspace_id",
    "formula",
    "dataset",
    "expected_version",
    "mutation_id"
  ],
  "additionalProperties": false
}

Svar och slutförande

HTTP-status vid framgång: 200. När åtgärden är klar: synchronous_http_response.

Ett lyckat HTTP-svar kan betyda att en begäran accepterats snarare än slutförts. Spara returnerat ID för bakgrundsarbete och kontrollera samma åtgärd tills den är klar. Ett schemalagt eller accepterat inlägg är publicerat först när plattformen bekräftar det; en klienttimeout fastställer inte resultatet.

Obligatoriskt betyder obligatoriskt inom sitt överordnade objekt och vald gren. Ett obligatoriskt underfält gör inte ett valfritt överordnat objekt obligatoriskt. Regler och fältnamn nedan kopieras från kontraktet.

Svar och slutförande
Fält / grenTyp / obligatorisktBegränsningar
$objectObligatoriskt i överordnat objekt—
definitionobjectObligatoriskt i överordnat objekt—
definition.idstringObligatoriskt i överordnat objekt
  • format: "uuid"
  • pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
definition.kindstringObligatoriskt i överordnat objekt
  • enum: ["metric","template"]
definition.workspace_idstringObligatoriskt i överordnat objekt
  • format: "uuid"
  • pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
definition.definition_idstringObligatoriskt i överordnat objekt
  • format: "uuid"
  • pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
definition.versionintegerObligatoriskt i överordnat objekt
  • minimum: 1
  • maximum: 1000000
definition.namestringObligatoriskt i överordnat objekt
  • maxLength: 100
definition.payloadobjectObligatoriskt i överordnat objekt
  • additionalProperties: {}
definition.payload.*any JSON valueValfritt / objekt—
definition.source_object_keystring | nullObligatoriskt i överordnat objekt—
definition.source_sha256string | nullObligatoriskt i överordnat objekt—
definition.created_atstringObligatoriskt i överordnat objekt
  • 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)))$"
definition.archivedbooleanObligatoriskt i överordnat objekt—
replayedbooleanObligatoriskt i överordnat objekt—
Fullständigt JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "definition": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
        },
        "kind": {
          "type": "string",
          "enum": [
            "metric",
            "template"
          ]
        },
        "workspace_id": {
          "type": "string",
          "format": "uuid",
          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
        },
        "definition_id": {
          "type": "string",
          "format": "uuid",
          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
        },
        "version": {
          "type": "integer",
          "minimum": 1,
          "maximum": 1000000
        },
        "name": {
          "type": "string",
          "maxLength": 100
        },
        "payload": {
          "type": "object",
          "propertyNames": {
            "type": "string"
          },
          "additionalProperties": {}
        },
        "source_object_key": {
          "type": [
            "string",
            "null"
          ]
        },
        "source_sha256": {
          "type": [
            "string",
            "null"
          ]
        },
        "created_at": {
          "type": "string",
          "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)))$",
          "format": "date-time"
        },
        "archived": {
          "type": "boolean"
        }
      },
      "required": [
        "id",
        "kind",
        "workspace_id",
        "definition_id",
        "version",
        "name",
        "payload",
        "source_object_key",
        "source_sha256",
        "created_at",
        "archived"
      ]
    },
    "replayed": {
      "type": "boolean"
    }
  },
  "required": [
    "definition",
    "replayed"
  ]
}

Fel och säkra nya försök

Kontrollera HTTP-status och svarskropp. Ett valideringsfel med 400 kan innehålla ZodError; hanterarfel använder fälten error, message och code. Spara request_id eller x-request-id för felsökning, utan inloggningsuppgifter. Åtgärda åtkomstfel med 401/403 innan du försöker igen och följ Retry-After vid 429. Om en skrivning är osäker eller returnerar 5xx, läs först det befintliga resultatet. Återanvänd en idempotensnyckel endast där det stöds; försöksbeteendet varierar mellan åtgärder och garanterar inte leverans exakt en gång.

Felsökningsguide

Exempel

Exemplen använder fiktiva värden som kontrollerats mot schemana. Ersätt ID:n med sådana du får använda, medier med färdiga mediefiler och datum med din bekräftade publiceringstid. Kontrollera kontots behörighet före en skrivning. Denna sida skickar inga API-anrop.

Sätt SOSOAPI_ACCESS_TOKEN på servern till en autentiseringsuppgift som åtgärden godtar och håll den borta från webbläsarkod. För en agent använder du sosoapi auth login för att logga in via webbläsaren och låter CLI förnya sina uppgifter.

request.json

{
  "workspace_id": "11111111-1111-4111-8111-111111111111",
  "formula": {
    "contractVersion": "analytics-metric/v1",
    "id": "11111111-1111-4111-8111-111111111111",
    "workspaceId": "11111111-1111-4111-8111-111111111111",
    "name": "example",
    "version": 1,
    "expression": "example",
    "fields": [],
    "rounding": {
      "decimalPlaces": 0,
      "mode": "half_away_from_zero"
    }
  },
  "dataset": {
    "contractVersion": "analytics-report/v1",
    "id": "11111111-1111-4111-8111-111111111111",
    "reviewedAt": "2099-01-15T09:00:00Z",
    "selection": {
      "workspaceId": "11111111-1111-4111-8111-111111111111",
      "accountIds": [
        "11111111-1111-4111-8111-111111111111"
      ],
      "platforms": [
        "facebook"
      ],
      "startDate": "2099-01-15",
      "endDate": "2099-01-15",
      "timezone": "UTC"
    },
    "accounts": [
      {
        "id": "11111111-1111-4111-8111-111111111111",
        "workspaceId": "11111111-1111-4111-8111-111111111111",
        "platform": "facebook",
        "name": "Fictional report account"
      }
    ],
    "posts": [],
    "sources": [],
    "coverage": {
      "population": "discovered_posts",
      "postsComplete": false,
      "nextCursor": null,
      "postLimit": 0,
      "postInsightsLimit": 0,
      "omittedPostInsights": 0,
      "notes": []
    },
    "customMetrics": []
  },
  "expected_version": null,
  "mutation_id": "11111111-1111-4111-8111-111111111111"
}

cURL

curl --request POST \
  "https://gqeshlawtcexsapabaui.supabase.co/functions/v1/analytics-api/reporting/metrics/save" \
  -H "Authorization: Bearer $SOSOAPI_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  --data-binary @request.json

JavaScript

// Server-side JavaScript. Do not print tokens or credential-bearing responses.
const token = process.env.SOSOAPI_ACCESS_TOKEN;
if (!token) throw new Error("Set an accepted credential for this operation");
const response = await fetch("https://gqeshlawtcexsapabaui.supabase.co/functions/v1/analytics-api/reporting/metrics/save", {
  method: "POST",
  headers: { "Content-Type": "application/json", Authorization: "Bearer " + token },
  body: JSON.stringify({
  "workspace_id": "11111111-1111-4111-8111-111111111111",
  "formula": {
    "contractVersion": "analytics-metric/v1",
    "id": "11111111-1111-4111-8111-111111111111",
    "workspaceId": "11111111-1111-4111-8111-111111111111",
    "name": "example",
    "version": 1,
    "expression": "example",
    "fields": [],
    "rounding": {
      "decimalPlaces": 0,
      "mode": "half_away_from_zero"
    }
  },
  "dataset": {
    "contractVersion": "analytics-report/v1",
    "id": "11111111-1111-4111-8111-111111111111",
    "reviewedAt": "2099-01-15T09:00:00Z",
    "selection": {
      "workspaceId": "11111111-1111-4111-8111-111111111111",
      "accountIds": [
        "11111111-1111-4111-8111-111111111111"
      ],
      "platforms": [
        "facebook"
      ],
      "startDate": "2099-01-15",
      "endDate": "2099-01-15",
      "timezone": "UTC"
    },
    "accounts": [
      {
        "id": "11111111-1111-4111-8111-111111111111",
        "workspaceId": "11111111-1111-4111-8111-111111111111",
        "platform": "facebook",
        "name": "Fictional report account"
      }
    ],
    "posts": [],
    "sources": [],
    "coverage": {
      "population": "discovered_posts",
      "postsComplete": false,
      "nextCursor": null,
      "postLimit": 0,
      "postInsightsLimit": 0,
      "omittedPostInsights": 0,
      "notes": []
    },
    "customMetrics": []
  },
  "expected_version": null,
  "mutation_id": "11111111-1111-4111-8111-111111111111"
})
});
const result = await response.json();
// Check response.ok, the operation-specific body and completion state before continuing.

CLI

npx sosoapi api post /analytics-api/reporting/metrics/save < request.json

Syntetiskt svarsexempel

{
  "definition": {
    "id": "11111111-1111-4111-8111-111111111111",
    "kind": "metric",
    "workspace_id": "11111111-1111-4111-8111-111111111111",
    "definition_id": "11111111-1111-4111-8111-111111111111",
    "version": 1,
    "name": "example",
    "payload": {},
    "source_object_key": "example",
    "source_sha256": "example",
    "created_at": "2099-01-15T09:00:00Z",
    "archived": false
  },
  "replayed": false
}

MCP: sosoapi_save_custom_metric