Creates a new agent with staging version. The agent will be created with an initial staging version that can later be promoted to production.

http
POST https://services.leadconnectorhq.com/agent-studio/agent

Authorization

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

Query parameters

NameTypeRequiredExampleDescription
sourcestringNoapi

Body

NameTypeRequiredExampleDescription
locationIdstringYesC2QujeCh8ZnC7al2InWRAccount ID
namestringNoCustomer Support AgentName of the agent
descriptionstringNoAI agent specialized in handling customer inquiries and support ticketsDescription of the agent
agencyIdstringNogjL2sFNXJfJYa3d2OYSNAgency ID
authorIdstringNousr_abc123def456Author ID
authorNamestringNoJohn DoeAuthor name
authorEmailstringNojohn@example.comAuthor email
statusstringYesactiveStatus of the agent Possible values: 'active', 'inactive', 'archived'
versionobjectYesVersion data for the agent including nodes, edges, and configuration
nodesstring[]NoNodes array (deprecated, prefer using version.nodes)
edgesstring[]NoEdges array (deprecated, prefer using version.edges)

Responses

201 - Agent created successfully
  • success (boolean, required): Success status Example: True

  • message (string, required): Response message Example: Agent created successfully with staging version.

  • agent (object, required): Created agent data with metadata

  • versions (object[], required): Created versions array (initial staging version)

json
{
  "success": true,
  "message": "Agent created successfully with staging version.",
  "agent": {
    "agentId": "p1q2r3s4t5u6v7w8x9y0z1a2",
    "name": "Customer Support Agent",
    "description": "AI agent specialized in handling customer inquiries and support tickets",
    "locationId": "C2QujeCh8ZnC7al2InWR",
    "agencyId": "gjL2sFNXJfJYa3d2OYSN",
    "status": "active",
    "authorId": "usr_abc123def456",
    "folderId": "C2QujeCh8ZnC7al2InWR",
    "folderName": null,
    "createdAt": "2024-02-27T10:30:00.000Z",
    "updatedAt": "2024-02-27T10:30:00.000Z"
  },
  "versions": [
    {
      "versionId": "v1a2b3c4d5e6f7g8h9i0",
      "agentId": "p1q2r3s4t5u6v7w8x9y0z1a2",
      "versionName": "Customer Support Agent v1",
      "state": "staging",
      "isPublished": false,
      "version": 1,
      "createdAt": "2024-02-27T10:30:00.000Z"
    }
  ]
}
400 - Bad Request
json
{}
401 - Unauthorized
json
{}
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 POST 'https://services.leadconnectorhq.com/agent-studio/agent' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Version: 2021-07-28' \
  -H 'Content-Type: application/json' \
  -d '{
  "locationId": "C2QujeCh8ZnC7al2InWR",
  "name": "Customer Support Agent",
  "description": "AI agent specialized in handling customer inquiries and support tickets",
  "agencyId": "gjL2sFNXJfJYa3d2OYSN",
  "authorId": "usr_abc123def456",
  "authorName": "John Doe",
  "authorEmail": "john@example.com",
  "status": "active",
  "version": {
    "versionName": "Version 1",
    "description": "Initial version",
    "nodes": [],
    "edges": [],
    "uiNodes": [],
    "uiEdges": [],
    "globalVariables": [],
    "inputVariables": [],
    "runtimeVariables": [],
    "scopes": []
  },
  "nodes": [],
  "edges": []
}'

Last updated October 26, 2026

Was this page helpful?