# Engines

Source: https://webagent-docs-staging.lookover.ai/api-reference/engines

> Agent engines and their versions.

## GET /v1/engines

List the built-in engines and the project's own

Responses: 200 `ListEnginesResponse`, default `ErrorBody`

## POST /v1/engines

Create an engine of the project, first version 1.0.0: a fork of `baseEngineId` (a built-in or the project's), or, when it is omitted, one from scratch (empty instructions, starter defaults)

Request body (JSON): `ForkEngineRequest`

Responses: 201 `EngineDetail`, default `ErrorBody`

## GET /v1/engines/{id}

Get an engine: the newest published version and the open draft

Parameters:
- `id` (path, required): string

Responses: 200 `EngineDetail`, default `ErrorBody`

## DELETE /v1/engines/{id}

Delete one of the project's engines. 403 `forbidden` for a built-in, 409 `conflict` for the project default

Parameters:
- `id` (path, required): string

Responses: 200 `DeleteEngineResponse`, default `ErrorBody`

## PATCH /v1/engines/{id}/draft

Edit the engine's draft (opened from the latest version on the first edit) and its name, description and icon. 403 `forbidden` for a built-in

Parameters:
- `id` (path, required): string

Request body (JSON): `PatchEngineDraftRequest`

Responses: 200 `EngineDetail`, default `ErrorBody`

## POST /v1/engines/{id}/publish

Publish the draft as the next version (`bump` default patch). 409 `conflict` with no draft changes, 403 `forbidden` for a built-in

Parameters:
- `id` (path, required): string

Request body (JSON): `PublishEngineRequest`

Responses: 200 `EngineDetail`, default `ErrorBody`

## GET /v1/engines/{id}/stats

Task numbers of an engine from the project's finished tasks, per version (newest first) and in total; `sinceMs` default the last 30 days. A built-in shows only the caller's own tasks on it

Parameters:
- `id` (path, required): string
- `sinceMs` (query): integer

Responses: 200 `EngineStatsResponse`, default `ErrorBody`

## PUT /v1/engines/default

Set the project's default engine

Request body (JSON): `SetDefaultEngineRequest`

Responses: 200 `SetDefaultEngineResponse`, default `ErrorBody`
