# Training Event

POST

Sent when a training run finishes or fails.

## Authorizations

* **[bearerAuth](/docs/v1/rest-api#bearerauth)**
* **[oauth2](/docs/v1/rest-api#oauth2)**

## Request Bodyrequired

_TrainingWebhookEvent_

Delivered when a training run reaches a terminal state.

object

**id**

required

_Id_

Unique event id, repeated in the webhook-id header.

string

**type**

required

_WebhookEventType_

Training.succeeded or training.failed.

string

Allowed values: 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

**created\_at**

required

_Created At_

When the event was raised (RFC 3339).

string

**data**

required

_GetTrainingRunResponse_

Identical to the body of GET on the training run.

object

**training\_run\_id**

required

_Training Run Id_

string format: uuid

**state**

required

_State_

In\_progress, terminal\_success, or terminal\_failure.

string

Allowed values: in\_progress terminal\_success terminal\_failure

**raw\_status**

required

_Raw Status_

Fine-grained run status.

string

**progress**

required

_Progress_

Training progress in \[0, 1\]; 1.0 when complete.

number

**poll\_interval\_seconds**

_Poll Interval Seconds_

Suggested polling interval in seconds. Present while in\_progress.

integer

nullable

**eta\_at**

_Eta At_

Estimated completion time, if known.

string format: date-time

nullable

**started\_at**

_Started At_

string format: date-time

nullable

**finished\_at**

_Finished At_

string format: date-time

nullable

**error**

_Error_

Error message. Present only on terminal\_failure.

string

nullable

**error\_code**

_Error Code_

Machine-readable error code. Present on terminal\_failure.

string

nullable

**webhook**

Any of:

**WebhookStatusView**

_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.

object

**url**

required

_Url_

The callback URL this run was submitted with.

string

**status**

required

_WebhookDeliveryStatus_

Pending until a delivery settles, then delivered or failed.

string

Allowed values: pending delivered failed

**attempts**

required

_Attempts_

How many delivery attempts have been made.

integer

**last\_attempt\_at**

_Last Attempt At_

When the last attempt was made.

string format: date-time

nullable

**last\_response\_status**

_Last Response Status_

HTTP status the receiver returned on the last attempt, if it responded.

integer

nullable

**last\_error**

_Last Error_

Why the last attempt did not succeed. Null once delivered.

string

nullable

**null**

null

**metadata**

_Metadata_

Whatever you sent as webhook.metadata.

object

**_key_**

additional properties

string

## Responses

### 200

Successful Response

##### Examplegenerated

```json
example
```

### 422

Validation Error

_HTTPValidationError_object

**detail**

_Detail_

Array<object>

_ValidationError_object

**loc**

required

_Location_

Array

**msg**

required

_Message_

string

**type**

required

_Error Type_

string

**input**

_Input_

**ctx**

_Context_object

##### Examplegenerated

```json
{
  "detail": [
    {
      "loc": [
        "example"
      ],
      "msg": "example",
      "type": "example",
      "input": "example",
      "ctx": {}
    }
  ]
}
```
