Skip to main content
POST
/
agent-graphs
/
complete
Create a complete agent graph
curl --request POST \
  --url https://api.beamstudio.ai/agent-graphs/complete \
  --header 'Content-Type: application/json' \
  --header 'current-workspace-id: <current-workspace-id>' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "agentName": "Bitcoin Price Agent",
  "nodes": [
    {
      "id": "d2cbeb35-9110-426c-967a-c0dba38289a9",
      "objective": "Fetch the current Bitcoin price and return it to the user in a friendly format",
      "evaluationCriteria": [
        "The response contains a valid price number",
        "The price is greater than 0"
      ],
      "isEntryNode": true,
      "isExitNode": false,
      "xCoordinate": 116,
      "yCoordinate": 150,
      "isEvaluationEnabled": false,
      "isAttachmentDataPulledIn": true,
      "onError": "STOP",
      "autoRetryWhenAccuracyLessThan": 80,
      "autoRetryLimitWhenAccuracyIsLow": 1,
      "autoRetryCountWhenFailure": 1,
      "autoRetryWaitTimeWhenFailureInMs": 1000,
      "enableAutoRetryWhenAccuracyIsLow": false,
      "enableAutoRetryWhenFailure": false,
      "childEdges": [
        {
          "sourceAgentGraphNodeId": "d2cbeb35-9110-426c-967a-c0dba38289a9",
          "targetAgentGraphNodeId": "22b6aa40-7d7c-449f-b151-0229834b48ba",
          "condition": "price > 50000",
          "isAttachmentDataPulledIn": true,
          "conditionGroups": [
            {
              "rules": [
                {
                  "sourceNodeId": "d2cbeb35-9110-426c-967a-c0dba38289a9",
                  "sourceOutputParamName": "status",
                  "operator": "equals",
                  "comparisonValueType": "static",
                  "comparisonValue": "success",
                  "comparisonNodeId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
                  "comparisonOutputParamName": "expectedStatus",
                  "nextRuleOperator": "AND"
                }
              ],
              "nextGroupOperator": "AND"
            }
          ]
        }
      ],
      "parentEdges": [
        {
          "sourceAgentGraphNodeId": "d2cbeb35-9110-426c-967a-c0dba38289a9",
          "targetAgentGraphNodeId": "22b6aa40-7d7c-449f-b151-0229834b48ba",
          "condition": "price > 50000",
          "isAttachmentDataPulledIn": true,
          "conditionGroups": [
            {
              "rules": [
                {
                  "sourceNodeId": "d2cbeb35-9110-426c-967a-c0dba38289a9",
                  "sourceOutputParamName": "status",
                  "operator": "equals",
                  "comparisonValueType": "static",
                  "comparisonValue": "success",
                  "comparisonNodeId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
                  "comparisonOutputParamName": "expectedStatus",
                  "nextRuleOperator": "AND"
                }
              ],
              "nextGroupOperator": "AND"
            }
          ]
        }
      ],
      "nodeType": "executionNode",
      "nodeConfigurations": {
        "conditionType": "llm_based",
        "llmModel": "GPT40",
        "fallbackModels": "GPT40,GPT4OMINI",
        "waitType": "time_based",
        "timeToWaitValue": 30,
        "timeToWaitUnit": "minutes",
        "timeoutType": "time_based",
        "timeoutValue": 60,
        "timeoutUnit": "minutes",
        "onTimeout": "continue",
        "rule": "output.status == \"success\"",
        "conditions": [
          {}
        ],
        "linkedAgentGraphNodeId": "node-123e4567-e89b-12d3-a456-426614174000"
      }
    }
  ],
  "agentDescription": "An AI agent that fetches real-time cryptocurrency prices and provides market insights",
  "settings": {
    "prompts": [
      "What is the current Bitcoin price?",
      "Can you fetch the latest cryptocurrency rates?"
    ]
  }
}
'
{
  "agentId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
  "agentName": "My AI Agent",
  "activeGraphId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "draftGraphId": "b2c3d4e5-f6a7-8901-bcde-f12345678901"
}

Authorizations

x-api-key
string
header
required

Headers

current-workspace-id
string
required

Body

application/json
agentName
string
required

The name of the agent to be created. This will be displayed in the UI and used to identify the agent

Example:

"Bitcoin Price Agent"

nodes
object[]
required

The complete list of nodes that make up the agent workflow graph. Nodes are connected by edges to form the execution flow. Must include at least one entry node (isEntryNode: true). Each node can have a tool configuration and is connected to other nodes via edges

agentDescription
string

A detailed description of what the agent does and its capabilities

Example:

"An AI agent that fetches real-time cryptocurrency prices and provides market insights"

settings
object

Configuration settings for the agent including personality, restrictions, and suggested prompts

Response

Agent and graph created successfully

agentId
string<uuid>
required

UUID of the created agent

Example:

"f47ac10b-58cc-4372-a567-0e02b2c3d479"

agentName
string
required

Name of the created agent

Example:

"My AI Agent"

activeGraphId
string<uuid>
required

UUID of the active/published graph

Example:

"a1b2c3d4-e5f6-7890-abcd-ef1234567890"

draftGraphId
string<uuid>
required

UUID of the draft graph

Example:

"b2c3d4e5-f6a7-8901-bcde-f12345678901"