Skip to main content
GET
/
test-runs
# List runs for a test case
curl "https://api.magpipe.ai/functions/v1/test-runs?test_case_id=b2c3d4e5-2345-6789-abcd-ef0123456789" \
  -H "Authorization: Bearer YOUR_API_KEY"

# Get a single run by ID
curl "https://api.magpipe.ai/functions/v1/test-runs?id=c3d4e5f6-3456-789a-bcde-f01234567890" \
  -H "Authorization: Bearer YOUR_API_KEY"
{
  "runs": [
    {
      "id": "c3d4e5f6-3456-789a-bcde-f01234567890",
      "test_case_id": "b2c3d4e5-2345-6789-abcd-ef0123456789",
      "status": "failed",
      "started_at": "2024-01-15T10:10:00.000Z",
      "completed_at": "2024-01-15T10:10:45.000Z",
      "assertions": [
        { "name": "call_connected", "passed": true, "detail": "Call connected successfully" },
        { "name": "agent_joined", "passed": true, "detail": "Agent joined within 3 seconds" },
        { "name": "expected_phrases", "passed": false, "detail": "Phrase '9 AM' not found in transcript" },
        { "name": "prohibited_phrases", "passed": true, "detail": "No prohibited phrases detected" },
        { "name": "min_duration", "passed": true, "detail": "Call lasted 45 seconds (min: 10)" }
      ],
      "error_message": null,
      "ai_analysis": "The agent said '9:00 AM' instead of '9 AM'. Update the expected phrase or adjust the system prompt."
    }
  ]
}
Returns test run results. Use test_case_id to list all runs for a given test case, or id to fetch a single run with full detail.

Query Parameters

test_case_id
string
UUID of the test case. Returns all runs newest first. Use this to poll for results after Run Test Case.
id
string
UUID of a specific test run. Returns the full run object with nested test case data.
Provide exactly one of test_case_id or id.

Response

runs
array
Returned when querying by test_case_id.
run
object
Returned when querying by id. Same fields as above, plus a nested test_cases object with the full test case configuration.

Assertion Names

AssertionDescription
call_connectedThe test call connected successfully
agent_joinedThe AI agent joined the call
expected_phrasesAll expected_phrases found in transcript
prohibited_phrasesNo prohibited_phrases found in transcript
expected_functionsAll expected_functions were called
min_durationCall lasted at least min_duration_seconds
max_durationCall ended within max_duration_seconds
# List runs for a test case
curl "https://api.magpipe.ai/functions/v1/test-runs?test_case_id=b2c3d4e5-2345-6789-abcd-ef0123456789" \
  -H "Authorization: Bearer YOUR_API_KEY"

# Get a single run by ID
curl "https://api.magpipe.ai/functions/v1/test-runs?id=c3d4e5f6-3456-789a-bcde-f01234567890" \
  -H "Authorization: Bearer YOUR_API_KEY"
{
  "runs": [
    {
      "id": "c3d4e5f6-3456-789a-bcde-f01234567890",
      "test_case_id": "b2c3d4e5-2345-6789-abcd-ef0123456789",
      "status": "failed",
      "started_at": "2024-01-15T10:10:00.000Z",
      "completed_at": "2024-01-15T10:10:45.000Z",
      "assertions": [
        { "name": "call_connected", "passed": true, "detail": "Call connected successfully" },
        { "name": "agent_joined", "passed": true, "detail": "Agent joined within 3 seconds" },
        { "name": "expected_phrases", "passed": false, "detail": "Phrase '9 AM' not found in transcript" },
        { "name": "prohibited_phrases", "passed": true, "detail": "No prohibited phrases detected" },
        { "name": "min_duration", "passed": true, "detail": "Call lasted 45 seconds (min: 10)" }
      ],
      "error_message": null,
      "ai_analysis": "The agent said '9:00 AM' instead of '9 AM'. Update the expected phrase or adjust the system prompt."
    }
  ]
}