---
title: "POST /v1/{+parent}/trials"
method: POST
path: "/v1/{+parent}/trials"
tags: ["projects"]
---

# POST /v1/{+parent}/trials

`POST /v1/{+parent}/trials`

Adds a user provided trial to a study.

## Path parameters

- `parent` string, required

## Request body

- GoogleCloudMlV1Trial — A message representing a trial.
  - `state` 'STATE_UNSPECIFIED' | 'REQUESTED' | 'ACTIVE' | 'COMPLETED' | 'STOPPING' — The detailed state of a trial.
  - `trialInfeasible` boolean — Output only. If true, the parameters in this trial are not attempted again.
  - `name` string — Output only. Name of the trial assigned by the service.
  - `infeasibleReason` string — Output only. A human readable string describing why the trial is infeasible. This should only be set if trial_infeasible is true.
  - `startTime` string, google-datetime — Output only. Time at which the trial was started.
  - `measurements` GoogleCloudMlV1Measurement[] — A list of measurements that are strictly lexicographically ordered by their induced tuples (steps, elapsed_time). These are used for early stopping computations.
    - `elapsedTime` string, google-duration — Output only. Time that the trial has been running at the point of this measurement.
    - `metrics` GoogleCloudMlV1MeasurementMetric[] — Provides a list of metrics that act as inputs into the objective function.
      - `value` number, double — Required. The value for this metric.
      - `metric` string — Required. Metric name.
    - `stepCount` string, int64 — The number of steps a machine learning model has been trained for. Must be non-negative.
  - `clientId` string — Output only. The identifier of the client that originally requested this trial.
  - `finalMeasurement` GoogleCloudMlV1Measurement — A message representing a measurement.
    - `elapsedTime` string, google-duration — Output only. Time that the trial has been running at the point of this measurement.
    - `metrics` GoogleCloudMlV1MeasurementMetric[] — Provides a list of metrics that act as inputs into the objective function.
      - `value` number, double — Required. The value for this metric.
      - `metric` string — Required. Metric name.
    - `stepCount` string, int64 — The number of steps a machine learning model has been trained for. Must be non-negative.
  - `endTime` string, google-datetime — Output only. Time at which the trial's status changed to COMPLETED.
  - `parameters` GoogleCloudMlV1TrialParameter[] — The parameters of the trial.
    - `stringValue` string — Must be set if ParameterTypeis CATEGORICAL
    - `intValue` string, int64 — Must be set if ParameterType is INTEGER
    - `floatValue` number, double — Must be set if ParameterType is DOUBLE or DISCRETE.
    - `parameter` string — The name of the parameter.

## Response `200`

Successful response

---

[API](https://skmtc.net/google/apis/ml.md) · [All operations](https://skmtc.net/google/apis/ml/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/google/ml/versions/2135f4d5ddf1/schema)
