Skip to main content
POST
Requires version 1.1.12 or later of the Archetype platform.

Overview

This endpoint cancels a pending or running optimization and returns it in its cancelled state. It also cancels any non-terminal trials, so the trial list does not leave a stale row behind. Trials that had already completed keep their results and stay counted in progress.completed. A cancelled run still picks a winner: if any feasible trial completed, the best of them is set as best_trial_id. For a run in a project, you get 403 when you can see the project but not modify it, and 404 when you cannot see the project. v2.0.0+ A run that is already terminal — that is, one whose status is one of completed, failed, or cancelled — has nothing to cancel and returns HTTP status code 409.
One use case for this endpoint is to cancel a running optimization prior to deleting it using Delete Optimization, since deleting an optimization will fail with a 409 HTTP status code if its state is non-terminal.

Request

string
required
Optimization opt_ id.

Response

Returns the cancelled run, in the same format returned by Get Optimization.
string
required
The run’s opt_ id.
string
required
Human label given on create. Empty when none was given.
string
required
The organization that owns the run.
string
required
The blueprint being tuned.
string
required
The headline each trial was scored on and the run maximized, as <target>.<objective>.
string
required
deprecated
Deprecated: read primary. The objective part of primary.
object
required
The parameter space the trials were sampled from.
object
required
The overrides given on create, applied to every trial (both maps empty when none were given).
object
required
The trial budget given on create — max_trials.
array
required
The examples every trial is scored against, as resolved.
string
required
The run’s lifecycle status; cancelled after a successful cancel.
object
required
Per-status trial counts. Trials that were still pending or running move to cancelled.
string
The project the run is in: its blueprint’s. This is null outside any project. v2.0.0+
string
required
Subject id (usr_... or key_...) that created this run.
string
required
When the run was created (date-time).
string
The trial the run picked as its winner: the highest-scoring feasible trial that completed. Set once the run ends — including when it is cancelled — and absent when no trial qualifies.
object
The winning trial, inlined. null when no trial qualifies. See Get Optimization.
string
When the run began executing. Absent if it was cancelled while still pending.
string
When the run reached a terminal status.
string
Why the run failed. Present only when status is failed, so absent on a cancelled run.