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 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'current-workspace-id: <current-workspace-id>' \
  --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",
          "name": "Success Path",
          "isAttachmentDataPulledIn": true
        }
      ],
      "parentEdges": [
        {
          "sourceAgentGraphNodeId": "d2cbeb35-9110-426c-967a-c0dba38289a9",
          "targetAgentGraphNodeId": "22b6aa40-7d7c-449f-b151-0229834b48ba",
          "condition": "price > 50000",
          "name": "Success Path",
          "isAttachmentDataPulledIn": true
        }
      ],
      "toolConfiguration": {
        "toolFunctionName": "GPTAction_Custom_BitcoinPriceFetcher_xjUR",
        "toolName": "Bitcoin Price Fetcher",
        "description": "Fetches the current Bitcoin price from CoinGecko API and returns the USD value",
        "requiresConsent": false,
        "isMemoryTool": false,
        "memoryLookupInstruction": "",
        "isBackgroundTool": false,
        "isBatchExecutionEnabled": false,
        "isCodeExecutionEnabled": false,
        "inputParams": [
          {
            "fillType": "ai_fill",
            "position": 0,
            "required": true,
            "dataType": "string",
            "reloadProps": false,
            "remoteOptions": false,
            "paramName": "api_url",
            "paramDescription": "The URL of the API endpoint to call",
            "question": "What API endpoint URL should be used?",
            "linkedOutputParamNodeId": "d2cbeb35-9110-426c-967a-c0dba38289a9",
            "linkedOutputParamName": "bitcoin_price_usd",
            "staticValue": "https://api.example.com/data",
            "outputExample": "https://api.coingecko.com/api/v3/simple/price",
            "options": [
              {
                "label": "United States",
                "value": "US"
              }
            ],
            "paramTip": "Make sure to include the full URL with protocol (https://)"
          }
        ],
        "outputParams": [
          {
            "isArray": false,
            "paramName": "bitcoin_price_usd",
            "position": 0,
            "paramDescription": "The current price of Bitcoin in USD, extracted from the API response",
            "dataType": "number",
            "parentId": null,
            "paramPath": "data.bitcoin.usd",
            "outputExample": "94523.50",
            "typeOptions": {
              "format": "currency",
              "precision": 2
            }
          }
        ],
        "iconSrc": null,
        "accuracyScore": null,
        "preferredModel": "gpt-4o",
        "prompt": "You are a helpful assistant. Given the input parameters, fetch the current Bitcoin price and return it in a user-friendly format."
      }
    }
  ],
  "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?"
    ],
    "agentPersonality": "You are a friendly financial assistant who explains complex topics in simple terms",
    "agentRestrictions": "Do not provide investment advice. Only provide factual price information."
  }
}
'
{
  "agentId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
  "agentName": "My AI Agent",
  "activeGraphId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "draftGraphId": "b2c3d4e5-f6a7-8901-bcde-f12345678901"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

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"