---
title: "Start an Autoimprove job"
method: POST
path: "/v1/autoimprove/job"
tags: ["Autoimprove"]
---

# Start an Autoimprove job

`POST /v1/autoimprove/job`

## Request

- Base URL: `https://api.roark.ai`
- URL: `https://api.roark.ai/v1/autoimprove/job`
- Auth: HTTP bearer

Commission Roark on an objective. It clones the agent into a staging shadow (or uses your designated staging agent), authors a validation suite of simulated callers, measures a baseline, changes the staging configuration, and re-tests until the objective metric passes its target. Production is never touched by the loop; verified changes wait for promotion.

Requires an active provider integration (Vapi, Retell, or ElevenLabs) with agent config writes enabled. One live job per agent: starting a second returns a conflict.

The job runs asynchronously; poll GET /v1/autoimprove/job/{jobId} or watch it in the dashboard. When its status is NEEDS_INPUT, answer via the answer endpoint; when AWAITING_PROMOTE, promote or dismiss.

## Request body

- CreateAutoimproveJobInput
  - `agentId` string, uuid, required: The production agent to improve. It is never modified until you promote.
  - `objectiveMetricDefinitionId` string, uuid, required: The metric that defines success: a pass/fail metric, or a threshold variant of a scale metric (for example "PII Handling >= 4"). Roark measures the pass rate of this metric across simulated calls.
  - `objectiveLabel` string, required: Human-readable label for the objective, shown everywhere the job appears.
  - `targetValue` number: The pass-rate percentage that counts as fixed. Defaults to 90.
  - `stagingAgentId` string, uuid: An existing agent to stage changes on instead of the default shadow clone. Must be a different agent from agentId, on the same provider.
  - `customerIntegrationId` string, uuid: The provider integration whose credentials Roark uses. Omit to use the project's active integration for the agent's provider. The integration must have agent config writes enabled.
  - `validationRunPlanId` string, uuid: An existing simulation run plan to validate with. Omit to let Roark author its own suite.
  - `maxIterations` integer: Cap on decision turns. Defaults to 50.
  - `maxSimCalls` integer: Cap on simulated calls dialed. Defaults to 200.

## Response `201`

The job was created and its loop started.

- object
  - `data` AutoimproveJob, required: One Autoimprove job: Roark autonomously improving one agent toward one objective metric. Roark only ever changes the staging agent (a shadow clone by default); production changes exactly once, when verified changes are promoted.
    - `id` string, uuid, required
    - `organizationId` string, uuid, required
    - `projectId` string, uuid, required
    - `agentId` string, uuid, required
    - `stagingAgentId` string, uuid, required
    - `stagingKind` 'DESIGNATED' | 'SHADOW' | 'CHANNEL', required
    - `customerIntegrationId` string, uuid, nullable, required
    - `objectiveMetricDefinitionId` string, uuid, required
    - `objectiveLabel` string, required
    - `targetValue` number, required
    - `baselineValue` number, nullable, required
    - `currentValue` number, nullable, required
    - `trigger` 'ISSUE' | 'RUN_THRESHOLD_FAILED' | 'USER' | 'DEGRADATION', required
    - `issueId` string, uuid, nullable, required
    - `objectiveId` string, uuid, nullable, required
    - `validationRunPlanId` string, uuid, nullable, required
    - `status` 'RUNNING' | 'NEEDS_INPUT' | 'PAUSED' | 'AWAITING_PROMOTE' | 'PROMOTED' | 'NO_FIX' | 'CANCELLED' | 'FAILED', required
    - `workingMemory` string, nullable, required
    - `finalReport` string, nullable, required
    - `maxIterations` integer, required
    - `maxSimCalls` integer, required
    - `iterationCount` integer, required
    - `simCallsUsed` integer, required
    - `initiatedByUserId` string, uuid, nullable, required
    - `concludedAt` string, nullable, required: When the job reached a terminal status (ISO 8601).
    - `createdAt` string, required: When the job was created (ISO 8601).
    - `updatedAt` string, required: When the job last changed (ISO 8601).

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: The integration does not allow agent config writes
- `404`: Not Found
- `409`: A job is already live for this agent
- `429`: Too Many Requests
- `500`: Internal Server Error

## Changes

> 188 revisions in range; 1 not diffed.

- **2026-09-22** `29256c5296cf`: 1 breaking, 1 warning
  - the response property `data/customerIntegrationId` became nullable for the status `201`
  - added the new `CHANNEL` enum value to the `data/stagingKind` response property for the response status `201`
- **2026-09-21** `99617fc5ccab`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/roarkhq/apis/roark-analytics-api/changes/v1/autoimprove/job/post.md)

---

[API](https://skmtc.dev/roarkhq/apis/roark-analytics-api.md) - [All operations](https://skmtc.dev/roarkhq/apis/roark-analytics-api/llms.txt) - [OpenAPI document](https://skmtc.dev/roarkhq/apis/roark-analytics-api/revisions/efc3377249d1?raw)
