---
title: "Training Event"
method: POST
path: "training.succeeded"
---

# Training Event

`POST training.succeeded` (webhook)

Sent when a training run finishes or fails.

## Payload

- TrainingWebhookEvent: Delivered when a training run reaches a terminal state.
  - `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` GetTrainingRunResponse, required
    - `training_run_id` string, uuid, required
    - `state` 'in_progress' | 'terminal_success' | 'terminal_failure', required: in_progress, terminal_success, or terminal_failure.
    - `raw_status` string, required: Fine-grained run status.
    - `progress` number, required: Training progress in [0, 1]; 1.0 when complete.
    - `poll_interval_seconds` integer, nullable: Suggested polling interval in seconds. Present while in_progress.
    - `eta_at` string, date-time, nullable: Estimated completion time, if known.
    - `started_at` string, date-time, nullable
    - `finished_at` string, date-time, nullable
    - `error` string, nullable: Error message. Present only on terminal_failure.
    - `error_code` string, nullable: Machine-readable error code. Present on terminal_failure.
    - `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)
