Agent Control

Update AI Config variation

PATCH
/api/v2/projects/{projectKey}/ai-configs/{configKey}/variations/{variationKey}

Edit an existing variation of an AI Config. This creates a new version of the variation.

The request body must be a JSON object of the fields to update. The values you include replace the existing values for the fields.

If the variation is in use in a project environment where approval settings require review for this AI Config, this endpoint returns 403 and the change must be submitted through an approval request.

Here's an example:

  {    "messages": [      {        "role": "system",        "content": "The new message"      }    ]  }

Authorization

ApiKey read, write
Authorization<token>

In: header

Scope: read, write

Path Parameters

projectKey*string
configKey*string
variationKey*string

Request Body

application/json

AI Config variation object to update

comment?string

Human-readable description of what this patch changes

description?string

Description for agent when the config is in agent mode.

instructions?string

Instructions for agent when the config is in agent mode.

messages?array<>
model?
modelConfigKey?string
modelConfigVersion?integer

The exact model config version to set this variation to. Requires modelConfigKey to be set (either in this patch or already on the variation), and the version must exist for that model config. When omitted, the variation keeps the version it is currently set to, unless the patch changes modelConfigKey, in which case the variation records the new model config's current (latest) version.

Range1 <= value
name?string
outputFormat?

JSON Schema defining the structured output format for the variation.

published?boolean
state?string

One of 'archived', 'published'

tools?array<>

List of tools to use for this variation. The latest version of the tool will be used.

toolKeys?array<string>

List of tool keys to use for this variation. The latest version of the tool will be used.

skills?array<>

List of agent skills to attach to this variation. Replaces the current attachments.

judgeConfiguration?

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X PATCH "https://example.com/api/v2/projects/string/ai-configs/string/variations/string" \  -H "Content-Type: application/json" \  -d '{    "judgeConfiguration": {      "judges": [        {          "samplingRate": 0.36160767,          "judgeConfigKey": "judgeConfigKey"        },        {          "samplingRate": 0.36160767,          "judgeConfigKey": "judgeConfigKey"        }      ]    },    "instructions": "instructions",    "description": "description",    "published": true,    "modelConfigKey": "modelConfigKey",    "tools": [      {        "version": 6,        "key": "key"      },      {        "version": 6,        "key": "key"      }    ],    "skills": [      {        "version": 1,        "key": "key"      },      {        "version": 1,        "key": "key"      }    ],    "toolKeys": [      "toolKeys",      "toolKeys"    ],    "name": "name",    "messages": [      {        "role": "role",        "content": "content"      },      {        "role": "role",        "content": "content"      }    ],    "comment": "comment",    "model": "{}",    "state": "state",    "outputFormat": {      "key": ""    },    "modelConfigVersion": 1  }'
{  "judgeConfiguration": {    "judges": [      {        "samplingRate": 0.36160767,        "judgeConfigKey": "judgeConfigKey"      },      {        "samplingRate": 0.36160767,        "judgeConfigKey": "judgeConfigKey"      }    ]  },  "instructions": "instructions",  "color": "color",  "_links": {    "parent": {      "href": "href",      "type": "type"    }  },  "description": "description",  "modelConfigKey": "modelConfigKey",  "judgingConfigKeys": [    "judgingConfigKeys",    "judgingConfigKeys"  ],  "version": 5,  "tools": [    {      "customParameters": {        "key": ""      },      "version": 7,      "key": "key"    },    {      "customParameters": {        "key": ""      },      "version": 7,      "key": "key"    }  ],  "skills": [    {      "version": 9,      "key": "key"    },    {      "version": 9,      "key": "key"    }  ],  "createdAt": 1,  "_publishedAt": 2,  "_archivedAt": 5,  "name": "name",  "messages": [    {      "role": "role",      "content": "content"    },    {      "role": "role",      "content": "content"    }  ],  "comment": "comment",  "model": "{}",  "_id": "_id",  "state": "state",  "outputFormat": {    "key": ""  },  "key": "key",  "modelConfigVersion": 6}