Skip to main content
POST
JavaScript

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
agentId
string<uuid>
required

The production agent to improve. It is never modified until you promote.

Example:

"b3b0c8e2-4c1d-4f6a-9e2b-1a2b3c4d5e6f"

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.

Example:

"f2f0c8e2-4c1d-4f6a-9e2b-1a2b3c4d5e6f"

objectiveLabel
string
required

Human-readable label for the objective, shown everywhere the job appears.

Required string length: 1 - 200
Example:

"Consent collection should pass"

targetValue
number
default:90

The pass-rate percentage that counts as fixed. Defaults to 90.

Required range: 1 <= x <= 100
Example:

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

Required range: 1 <= x <= 50
maxSimCalls
integer

Cap on simulated calls dialed. Defaults to 200.

Required range: 1 <= x <= 2000

Response

The job was created and its loop started.

data
object
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.