Skip to main content
POST
/
api
/
v1
/
assistant-graphs
/
{graph_id}
/
test
curl -X POST https://api.burki.dev/api/v1/assistant-graphs/1/test \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "test_messages": [
      "Hello, I need help",
      "I want to buy your enterprise plan",
      "What are the pricing options?"
    ]
  }'
{
  "success": true,
  "graph_id": 1,
  "test_messages": [
    "Hello, I need help",
    "I want to buy your enterprise plan",
    "What are the pricing options?"
  ],
  "starting_node_id": 101,
  "path_taken": [
    {
      "node_id": 101,
      "node_name": "Receptionist",
      "message_processed": "Hello, I need help"
    },
    {
      "node_id": 102,
      "node_name": "Sales Specialist",
      "message_processed": "I want to buy your enterprise plan",
      "transition_reason": "Intent matched: purchase, buy"
    },
    {
      "node_id": 102,
      "node_name": "Sales Specialist",
      "message_processed": "What are the pricing options?",
      "transition_reason": "No transition triggered"
    }
  ],
  "transitions": [
    {
      "from_node": "Receptionist",
      "to_node": "Sales Specialist",
      "triggered_by_message": "I want to buy your enterprise plan",
      "condition_type": "intent",
      "matched_condition": "sales,purchase,buy",
      "handoff_sentence": "Let me connect you with our sales team."
    }
  ],
  "summary": {
    "total_messages": 3,
    "total_transitions": 1,
    "final_node": "Sales Specialist"
  }
}
Test a graph flow with simulated messages. This endpoint allows you to validate transition conditions and conversation paths without making actual phone calls.

Path Parameters

graph_id
integer
required
The unique identifier of the graph to test.

Request Body

test_messages
array
required
Array of simulated user messages to process through the graph.
starting_node_id
integer
Optional node ID to start from. Defaults to the graph’s entry node.

Response

success
boolean
Whether the test completed successfully.
graph_id
integer
The tested graph ID.
test_messages
array
The messages that were tested.
starting_node_id
integer
The node where the test started.
path_taken
array
Array of nodes visited during the test simulation.
transitions
array
Details of each transition that occurred.
curl -X POST https://api.burki.dev/api/v1/assistant-graphs/1/test \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "test_messages": [
      "Hello, I need help",
      "I want to buy your enterprise plan",
      "What are the pricing options?"
    ]
  }'
{
  "success": true,
  "graph_id": 1,
  "test_messages": [
    "Hello, I need help",
    "I want to buy your enterprise plan",
    "What are the pricing options?"
  ],
  "starting_node_id": 101,
  "path_taken": [
    {
      "node_id": 101,
      "node_name": "Receptionist",
      "message_processed": "Hello, I need help"
    },
    {
      "node_id": 102,
      "node_name": "Sales Specialist",
      "message_processed": "I want to buy your enterprise plan",
      "transition_reason": "Intent matched: purchase, buy"
    },
    {
      "node_id": 102,
      "node_name": "Sales Specialist",
      "message_processed": "What are the pricing options?",
      "transition_reason": "No transition triggered"
    }
  ],
  "transitions": [
    {
      "from_node": "Receptionist",
      "to_node": "Sales Specialist",
      "triggered_by_message": "I want to buy your enterprise plan",
      "condition_type": "intent",
      "matched_condition": "sales,purchase,buy",
      "handoff_sentence": "Let me connect you with our sales team."
    }
  ],
  "summary": {
    "total_messages": 3,
    "total_transitions": 1,
    "final_node": "Sales Specialist"
  }
}

Testing Scenarios

Test Sales Routing

{
  "test_messages": [
    "Hi there",
    "I'm interested in your product",
    "How much does it cost?"
  ]
}
Expected: Routes from Receptionist → Sales Specialist

Test Support Routing

{
  "test_messages": [
    "Hello",
    "I have a problem with my account",
    "It's not working properly"
  ]
}
Expected: Routes from Receptionist → Support Agent

Test Escalation

{
  "test_messages": [
    "I am extremely frustrated",
    "This is unacceptable",
    "I want to speak to a manager"
  ],
  "starting_node_id": 103
}
Expected: Routes from Support Agent → Human Escalation

Best Practices

1

Test All Paths

Create test cases for each possible transition path in your graph to ensure complete coverage.
2

Test Edge Cases

Include messages that might match multiple conditions to verify priority handling works correctly.
3

Test Natural Language

For natural language conditions, test various phrasings to ensure the LLM evaluation works as expected.
4

Verify Handoffs

Check that the correct handoff sentences are returned for each transition.

Error Responses

Status CodeDescription
401Unauthorized - Invalid or missing API key
404Graph not found in your organization
500Server error during test
The test endpoint simulates conversation flow without actually executing assistant responses. It evaluates transition conditions based on the provided messages to show you the path a real conversation would take.