Copies a version into a new draft at the next version number. Use it to start from an older published version (a rollback), or to keep several drafts side by side. Without base_version the latest version is copied.
Request#
Path parameters#
| Parameter | Type | Required | Description |
|---|---|---|---|
agent_id |
string | Yes | The agent. |
Body#
| Field | Type | Required | Description |
|---|---|---|---|
base_version |
integer or string | No | Version to copy: a number, latest, latest_published or an environment tag name. |
Example request#
curl -X POST "https://api.tried.com.au/create-agent-version/agent_3f9a1c0b2d4e5f6a7b8c9d0e" \
-H "Authorization: Bearer $TRIED_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"base_version": "prod"
}'const res = await fetch("https://api.tried.com.au/create-agent-version/agent_3f9a1c0b2d4e5f6a7b8c9d0e", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.TRIED_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"base_version": "prod"
}),
});
const data = await res.json();import os, requests
res = requests.post(
"https://api.tried.com.au/create-agent-version/agent_3f9a1c0b2d4e5f6a7b8c9d0e",
headers={"Authorization": f"Bearer {os.environ['TRIED_API_KEY']}"},
json={
"base_version": "prod",
},
)
data = res.json()Response#
201 Created with the new draft agent (is_published: false).
Errors#
| Status | When |
|---|---|
400 |
base_version is not a known reference, or points at no published version. |
401 |
Missing or invalid API key. |
403 |
The key's IP allowlist or scopes reject the request. This route needs the agents scope. |
404 |
The agent or version does not exist. |
429 |
Rate limit exceeded. See Rate limits. |
See Errors for the body format.