GMetri Webhooks

You can use Webhooks to get data from GMetri into your system/platform. Webhooks are supported for viewer's variable changes, session creations, and rule triggers.

GMetri Webhooks are pseudo real-time with a max delay of 60 seconds.

If there are a large number of responses, GMetri will batch responses in groups of 500, sent with a minimum gap of 200ms between consecutive queries.

GMetri doesn't have the ability to resend/retry webhooks incase of an error response.

Webhook Response

POST https://example.com/user/endpoint/gmetri-webhook

This webhook sends back an array of responses (viewer updates, session creation). Responses could be one of three types - variables, rules, session. Viewers are identified by their identifier, which depends on the authentication mechanism selected for the deployment.

Two inputs are needed from you to enable this webhook:

1) Webhook URL (POST API)

2) Webhook Basic Auth String (Any cryptographically secure string, >16 characters recommended)

Headers

NameTypeDescription

Authorization*

Basic <credentials>

Request Body

NameTypeDescription

type*

String

variables | rules | session

data*

JSON

WebhookData (described below)

type WebhookBody = {
  type: "variables" | "session" | "rules",
  data: { //WebhookData
    orgSlug: string,
    depSlug: string,    
    rows: (VariableWebhookData | SessionWebhookData | RuleWebhookData)[]
  }  
}

Last updated