Updates a specific agent version by versionId. Supports updating nodes, edges, variables, and configuration.

http
PATCH https://services.leadconnectorhq.com/agent-studio/agent/versions/{versionId}

Authorization

NameTypeRequiredExampleDescription
AuthorizationstringYesBearer token generated from the Leadway portal. See Authentication.
VersionstringYes2021-07-28API version.

Path parameters

NameTypeRequiredExampleDescription
versionIdstringYesv1a2b3c4d5e6f7g8h9i0

Query parameters

NameTypeRequiredExampleDescription
sourcestringNoapi

Body

NameTypeRequiredExampleDescription
locationIdstringYesC2QujeCh8ZnC7al2InWRAccount ID for authorization
versionNamestringNoCustomer Support Agent v2Version name
descriptionstringNoUpdated version with improved customer handling logicDescription of the version
nodesobject[]NoComplete array of nodes for the agent workflow. Provide all nodes including unchanged ones.
edgesobject[]NoComplete array of edges connecting the nodes. Provide all edges including unchanged ones.
globalVariablesobject[]NoGlobal variables accessible throughout the agent workflow
inputVariablesobject[]NoInput variables required from user at execution time
runtimeVariablesobject[]NoRuntime variables generated during agent execution
globalConfigobjectNoGlobal configuration including prompts and settings
userIdstringNousr_abc123def456User ID performing the update
userNamestringNoJohn DoeUser name performing the update

Responses

200 - Version updated successfully
  • success (boolean, required): Success status Example: True

  • message (string, required): Response message Example: Agent updated successfully

  • data (object, required): Updated agent or version data

json
{
  "success": true,
  "message": "Agent updated successfully",
  "data": {
    "agentId": "p1q2r3s4t5u6v7w8x9y0z1a2",
    "versionId": "v1a2b3c4d5e6f7g8h9i0",
    "name": "Updated Customer Support Agent",
    "description": "Updated AI agent with enhanced customer support capabilities",
    "status": "active",
    "updatedAt": "2024-02-27T11:45:00.000Z"
  }
}
400 - Bad Request
json
{}
401 - Unauthorized
json
{}
404 - Version not found
422 - Unprocessable Entity
json
{}
500 - Internal Server Error
  • statusCode (number): Example: 500

  • message (string): Example: Internal Server Error

json
{
  "statusCode": 500,
  "message": "Internal Server Error"
}

Example

curl -X PATCH 'https://services.leadconnectorhq.com/agent-studio/agent/versions/YOUR_versionId' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Version: 2021-07-28' \
  -H 'Content-Type: application/json' \
  -d '{
  "locationId": "C2QujeCh8ZnC7al2InWR",
  "versionName": "Customer Support Agent v2",
  "description": "Updated version with improved customer handling logic",
  "nodes": [
    {
      "nodeId": "node_1",
      "nodeName": "Start",
      "type": "start",
      "isStartNode": true
    },
    {
      "nodeId": "node_2",
      "nodeName": "LLM Node",
      "type": "llm",
      "nodeConfig": {
        "prompt": "How can I help you?",
        "llmProvider": "openai",
        "llmModel": "gpt-4"
      }
    }
  ],
  "edges": [
    {
      "startNode": "node_1",
      "endNode": "node_2"
    }
  ],
  "globalVariables": [
    {
      "key": "apiKey",
      "type": "string",
      "value": "your-api-key"
    }
  ],
  "inputVariables": [
    {
      "key": "customerName",
      "type": "string",
      "description": "Customer name for personalization"
    }
  ],
  "runtimeVariables": [
    {
      "key": "sessionId",
      "type": "string",
      "description": "Current session identifier"
    }
  ],
  "globalConfig": {
    "globalPrompt": {
      "currentPrompt": "You are a helpful customer support assistant.",
      "history": []
    }
  },
  "userId": "usr_abc123def456",
  "userName": "John Doe"
}'

Last updated October 26, 2026

Was this page helpful?