---
title: "HTTP request metric"
method: POST
path: "HttpRequestMetric"
tags: ["Metric"]
---

# HTTP request metric

`POST HttpRequestMetric` (webhook)

What an HTTP request metric sends to your endpoint, and the answer it expects. Roark sends it once per call the metric grades, live or simulated, after the call is analysed.

With no body template, Roark POSTs the payload below. A body template fills `{{path}}` placeholders from the same payload, for example `{{call.properties.cardId}}` or `{{simulation.variables.newPin}}`. A placeholder the call has no value for (a run variable on a live call) skips the request and records the metric as missing data.

Answer with HTTP 200 and `{"passed": true | false, "reason": "..."}` within 30 seconds. Timeouts, connection failures and 5xx responses are retried twice with the same `requestId`, so drop a request you have already answered. Any other answer records an error on the metric, never a fail. Redirects are not followed.

## Payload

- HttpRequestMetricPayload
  - `version` '1.0', required: Payload schema version
  - `requestId` string, uuid, required: Unique per request. Quote it when reporting a problem.
  - `metric` object, required
    - `id` string, uuid, required
    - `name` string, required
  - `call` object, required
    - `id` string, uuid, required
    - `projectId` string, uuid, required
    - `callDirection` string, required: INBOUND or OUTBOUND
    - `startedAt` string, date-time, required
    - `endedAt` string, date-time, nullable, required
    - `durationMs` number, nullable, required
    - `endedStatus` string, nullable, required
    - `externalId` string, nullable, required: Your correlation id, if you sent one with the call
    - `agents` object[], required
      - `id` string, uuid, required: Roark agent id
      - `endpoint` object, nullable, required: The endpoint the call reached the agent on, when known
        - `id` string, uuid, required
        - `environment` string, required
        - `phoneNumberE164` string, nullable, required
    - `customers` object[], required
      - `phoneNumberE164` string, nullable, required
      - `label` string, nullable, required
    - `properties` object, required: The custom properties on the call
  - `simulation` object, nullable, required: Set when the call is a Roark simulation, null on a live call
    - `jobId` string, uuid, required
    - `runPlanJobId` string, uuid, nullable, required
    - `flow` object, nullable, required
      - `id` string, uuid, required
      - `title` string, required
    - `testCase` object, nullable, required: The test case of the flow this call ran. isDefault is true for the happy path.
      - `id` string, uuid, required
      - `title` string, required
      - `isDefault` boolean, required
    - `variables` object, required: The run variables this simulation ran with
    - `persona` object, required: The persona the simulated caller played

## Acknowledgement `200`

The verdict for this call.

- HttpRequestMetricVerdict
  - `passed` boolean, required: Whether the call did what it should
  - `reason` string: Shown next to the result in Roark. Longer than 1000 characters is cut.

---

[API](https://skmtc.dev/roarkhq/apis/roark-analytics-api.md) - [All operations](https://skmtc.dev/roarkhq/apis/roark-analytics-api/llms.txt) - [OpenAPI document](https://skmtc.dev/roarkhq/apis/roark-analytics-api/revisions/1a91a5c90e44?raw)
