Test Suite Endpoints
Create Test Suite
Create a new test suite with tests
POST
/
api
/
platform
/
testSuites
Create Test Suite
curl --request POST \
--url https://api.example.com/api/platform/testSuites \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"templateService": "<string>",
"templateName": "<string>",
"impersonateUserId": "<string>",
"visibility": "<string>"
}
'import requests
url = "https://api.example.com/api/platform/testSuites"
payload = {
"name": "<string>",
"description": "<string>",
"templateService": "<string>",
"templateName": "<string>",
"impersonateUserId": "<string>",
"visibility": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
templateService: '<string>',
templateName: '<string>',
impersonateUserId: '<string>',
visibility: '<string>'
})
};
fetch('https://api.example.com/api/platform/testSuites', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/platform/testSuites",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'description' => '<string>',
'templateService' => '<string>',
'templateName' => '<string>',
'impersonateUserId' => '<string>',
'visibility' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/platform/testSuites"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"templateService\": \"<string>\",\n \"templateName\": \"<string>\",\n \"impersonateUserId\": \"<string>\",\n \"visibility\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/platform/testSuites")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"templateService\": \"<string>\",\n \"templateName\": \"<string>\",\n \"impersonateUserId\": \"<string>\",\n \"visibility\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/platform/testSuites")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"templateService\": \"<string>\",\n \"templateName\": \"<string>\",\n \"impersonateUserId\": \"<string>\",\n \"visibility\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"suiteId": "<string>",
"name": "<string>"
}Request
POST /api/platform/testSuites
Body Parameters
Suite name
Suite description
Service type:
"slack" or "linear"Template to use for tests
Default user ID for tests
"public" or "private"Example Request
curl -X POST https://api.agentdiff.dev/api/platform/testSuites \
-H "X-API-Key: ad_live_sk_..." \
-H "Content-Type: application/json" \
-d '{
"name": "My Agent Tests",
"description": "Custom tests for my Slack agent",
"templateService": "slack",
"templateName": "slack_default",
"impersonateUserId": "U01AGENBOT9",
"visibility": "private"
}'
Response
New suite identifier
Suite name
Example Response
{
"suiteId": "suite-789",
"name": "My Agent Tests"
}
Adding Tests
After creating a suite, add tests:curl -X POST https://api.agentdiff.dev/api/platform/testSuites/suite-789/tests \
-H "X-API-Key: ad_live_sk_..." \
-H "Content-Type: application/json" \
-d '{
"tests": [
{
"name": "Post welcome message",
"prompt": "Post a welcome message to #general",
"expectedOutput": {
"assertions": [{
"diff_type": "added",
"entity": "messages",
"where": {
"channel_id": {"eq": "C01GENERAL99"},
"message_text": {"contains": "welcome"}
},
"expected_count": 1
}]
}
}
]
}'
Complete Example
from agent_diff import AgentDiff
client = AgentDiff()
# 1. Create suite
suite = client.create_test_suite({
"name": "My Slack Tests",
"description": "Custom Slack agent tests",
"templateService": "slack",
"templateName": "slack_default",
"impersonateUserId": "U01AGENBOT9"
})
# 2. Add tests
client.create_tests(suite.suiteId, {
"tests": [
{
"name": "Post message",
"prompt": "Post 'Hello' to #general",
"expectedOutput": {
"assertions": [{
"diff_type": "added",
"entity": "messages",
"where": {"message_text": {"contains": "Hello"}},
"expected_count": 1
}]
}
},
{
"name": "Create channel",
"prompt": "Create a new channel called 'test-channel'",
"expectedOutput": {
"assertions": [{
"diff_type": "added",
"entity": "channels",
"where": {"name": {"eq": "test-channel"}},
"expected_count": 1
}]
}
}
]
})
# 3. Use the suite
suite = client.get_test_suite(suite.suiteId, expand=True)
print(f"Created suite with {len(suite.tests)} tests")
SDK Usage
suite = client.create_test_suite({
"name": "My Tests",
"templateService": "slack",
"templateName": "slack_default",
"impersonateUserId": "U01AGENBOT9"
})
print(f"Created suite: {suite.suiteId}")
const suite = await client.createTestSuite({
name: 'My Tests',
templateService: 'slack',
templateName: 'slack_default',
impersonateUserId: 'U01AGENBOT9'
});
console.log(`Created suite: ${suite.suiteId}`);
⌘I
Create Test Suite
curl --request POST \
--url https://api.example.com/api/platform/testSuites \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"templateService": "<string>",
"templateName": "<string>",
"impersonateUserId": "<string>",
"visibility": "<string>"
}
'import requests
url = "https://api.example.com/api/platform/testSuites"
payload = {
"name": "<string>",
"description": "<string>",
"templateService": "<string>",
"templateName": "<string>",
"impersonateUserId": "<string>",
"visibility": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
templateService: '<string>',
templateName: '<string>',
impersonateUserId: '<string>',
visibility: '<string>'
})
};
fetch('https://api.example.com/api/platform/testSuites', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/platform/testSuites",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'description' => '<string>',
'templateService' => '<string>',
'templateName' => '<string>',
'impersonateUserId' => '<string>',
'visibility' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/platform/testSuites"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"templateService\": \"<string>\",\n \"templateName\": \"<string>\",\n \"impersonateUserId\": \"<string>\",\n \"visibility\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/platform/testSuites")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"templateService\": \"<string>\",\n \"templateName\": \"<string>\",\n \"impersonateUserId\": \"<string>\",\n \"visibility\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/platform/testSuites")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"templateService\": \"<string>\",\n \"templateName\": \"<string>\",\n \"impersonateUserId\": \"<string>\",\n \"visibility\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"suiteId": "<string>",
"name": "<string>"
}