---
title: "Scoring Run Event"
method: POST
path: "scoring_run.completed"
---

# Scoring Run Event

`POST scoring_run.completed` (webhook)

Sent when a batch of output scoring settles, however it was triggered.

## Payload

- ScoringRunWebhookEvent: Delivered when a scoring run settles. Also raised for the automatic scoring that follows a generation, in which case `data` carries the `inference_id` of the generation whose outputs were judged.
  - `id` string, required: Unique event id, repeated in the webhook-id header.
  - `type` 'inference.completed' | 'inference.failed' | 'inference.cancelled' | 'training.succeeded' | 'training.failed' | 'scoring_run.completed' | 'scoring_run.failed' | 'workflow_run.succeeded' | 'workflow_run.failed' | 'workflow_run.cancelled', required: Every event the public API can deliver. Terminal outcomes only: a job produces exactly one of these, once. The value is what appears as ``type`` in the envelope and as the operation name in the OpenAPI ``webhooks`` block, so it is a public contract.
  - `created_at` string, required: When the event was raised (RFC 3339).
  - `data` GetScoringRunOutput, required
    - `scoring_run_id` string, uuid, required: Unique identifier for this scoring run.
    - `status` 'pending' | 'complete' | 'failed', required
    - `inference_id` string, uuid, nullable: The generation whose outputs this run judged, when it was started automatically.
    - `poll_interval_seconds` integer, nullable: Suggested polling interval in seconds. Present while pending.
    - `requested_pair_count` integer, required: How many (file, rule) pairs the run set out to judge.
    - `completed_pair_count` integer, required: How many produced a verdict. Lower than requested means some pairs went unjudged.
    - `file_ids` string[]: The files the run was asked to judge.
    - `rule_ids` string[]: The rules the run judged against.
    - `scores` ScoringRunFileScore[], nullable: The verdicts recorded. Present once the run is complete.
      - `file_id` string, uuid, required: The file this verdict is about.
      - `rule_id` string, uuid, required: The scoring rule that produced it.
      - `rule_name` string, required: The rule's name as it stood when the verdict was recorded.
      - `score` integer, required: Score in [0, 100] against that rule.
      - `rationale` string: The judge's reasoning, in its own words.
    - `finished_at` string, date-time, nullable: When the run settled. Present once terminal.
    - `error` string, nullable: Error message. Present only on failed.
    - `error_code` string, nullable: Machine-readable error code. Present only on failed.
    - `webhook` WebhookStatusView: What a job's ``GET`` reports about the callback attached to it. The URL is echoed so a caller can tell which of its endpoints a run was aimed at; the rest is how the delivery went, which is the only place a failed delivery is visible.
      - `url` string, required: The callback URL this run was submitted with.
      - `status` 'pending' | 'delivered' | 'failed', required
      - `attempts` integer, required: How many delivery attempts have been made.
      - `last_attempt_at` string, date-time, nullable: When the last attempt was made.
      - `last_response_status` integer, nullable: HTTP status the receiver returned on the last attempt, if it responded.
      - `last_error` string, nullable: Why the last attempt did not succeed. Null once delivered.
  - `metadata` object: Whatever you sent as webhook.metadata.

## Acknowledgement `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/layer/apis/layer-rest-api.md) · [All operations](https://skmtc.dev/layer/apis/layer-rest-api/llms.txt) · [OpenAPI document](https://skmtc.dev/layer/apis/layer-rest-api/revisions/326f3bcdabcc?raw)
