Skip to content

Create a new agent version

POST
/api/v1/agent_version
curl --request POST \
--url https://app.prefactorai.com/api/v1/agent_version \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "agent_id": "013xrzp12g3nqk8ns6jadrqmpgrjkeny", "agent_schema_version_id": "013xrzp12g3nqk8ns6jadrqmpgrjkeny", "description": null, "external_identifier": "example", "id": "013xrzp12g3nqk8ns6jadrqmpgrjkeny", "name": null, "runtime_environment": null }'
AgentVersion_DetailsForCreate
object
agent_id
Agent_Id

A valid agent ID

string
Example
013xrzp12g3nqk8ns6jadrqmpgrjkeny
agent_schema_version_id
AgentSchemaVersion_Id

A valid agent schema version ID

string
Example
013xrzp12g3nqk8ns6jadrqmpgrjkeny
description
One of:

Deprecated. Accepted for backward compatibility; ignored. Use agents/update to set the agent description.

string
external_identifier
string
id
One of:
AgentVersion_Id

A valid agent version ID

string
Example
013xrzp12g3nqk8ns6jadrqmpgrjkeny
name
One of:

Deprecated. Accepted for backward compatibility; ignored. Use agents/update to set the agent name.

string
runtime_environment
One of:
AgentVersion_RuntimeEnvironment
object
agent_sdk
One of:

List of package name and version strings (e.g. “package@1.0.0”)

Array<string>
os
One of:

Operating system (e.g. “linux”)

string
prefactor_sdk
One of:

List of package name and version strings (e.g. “package@1.0.0”)

Array<string>
runtime
One of:

Language runtime version (e.g. “python@3.12”)

string

Success

Media typeapplication/json
object
details
AgentVersion_Details
object
account_id
Account_Id

A valid account ID

string
agent_id
Agent_Id

A valid agent ID

string
agent_schema_version_id
AgentSchemaVersion_Id

A valid agent schema version ID

string
current_agent_deployment_refs

Agent deployments that pin this version as their current version (empty if none).

Array<string>
external_identifier

External identifier for the agent version

string
external_identifier_repeats

Count of rows sharing this external identifier (helps distinguish duplicates).

integer
id
AgentVersion_Id

A valid agent version ID

string
inserted_at

When the agent version was created

string format: date-time
runtime_environment
One of:
AgentVersion_RuntimeEnvironment
object
agent_sdk
One of:

List of package name and version strings (e.g. “package@1.0.0”)

Array<string>
os
One of:

Operating system (e.g. “linux”)

string
prefactor_sdk
One of:

List of package name and version strings (e.g. “package@1.0.0”)

Array<string>
runtime
One of:

Language runtime version (e.g. “python@3.12”)

string
type

Type of resource (always ‘agent_version’)

string
Allowed values: agent_version
updated_at

When the agent version was last updated

string format: date-time
status
string
Allowed values: success
Example
{
"details": {
"account_id": "013xrzp12g3nqk8ns6jadrqmpgrjkeny",
"agent_id": "013xrzp12g3nqk8ns6jadrqmpgrjkeny",
"agent_schema_version_id": "013xrzp12g3nqk8ns6jadrqmpgrjkeny",
"current_agent_deployment_refs": [
"013xrzp12g3nqk8ns6jadrqmpgrjkeny"
],
"external_identifier": "v1.0.0",
"id": "013xrzp12g3nqk8ns6jadrqmpgrjkeny",
"inserted_at": "2024-01-01T00:00:00Z",
"runtime_environment": null,
"type": "agent_version",
"updated_at": "2024-01-01T00:00:00Z"
},
"status": "success"
}

Error

Media typeapplication/json
One of:
object
code
string
Allowed values: bad_request bad_authtoken not_authenticated not_permitted not_implemented unknown not_found unexpected_ref_type unexpected invalid_action alert_unknown alert_already_cleared invalid_value required_value idempotency_key_already_used
message
string
status
string
Allowed values: error
Example
{
"code": "bad_request",
"status": "error"
}