Create or update test cases
curl --request POST \
--url https://guidinghand.ai/v1/test_cases/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"cases": [
{
"name": "Apps switched to dark mode",
"prompt": "All my windows suddenly went black. How do I get the white back?",
"start_state": "win10-22h2",
"success": {
"check_script": "<string>",
"rubric": "<string>"
},
"key": "DSP-01",
"setup_script": "<string>",
"customer": {
"persona": "Retired teacher. Not technical. Short, polite answers.",
"facts": {
"Wi-Fi network": "HomeNet",
"Wi-Fi password": {
"secret": "blue-kite-42"
}
},
"clicks_admin_prompts": true,
"does_steps": true
},
"operator": {},
"limits": {
"minutes": 10,
"steps": 250
},
"runs_on": "vm",
"category": "Display & graphics",
"tags": [
"uac"
],
"metadata": {
"customer_id": "cus_42"
}
}
],
"test_set_id": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
cases: [
{
name: 'Apps switched to dark mode',
prompt: 'All my windows suddenly went black. How do I get the white back?',
start_state: 'win10-22h2',
success: {check_script: '<string>', rubric: '<string>'},
key: 'DSP-01',
setup_script: '<string>',
customer: {
persona: 'Retired teacher. Not technical. Short, polite answers.',
facts: {'Wi-Fi network': 'HomeNet', 'Wi-Fi password': {secret: 'blue-kite-42'}},
clicks_admin_prompts: true,
does_steps: true
},
operator: {},
limits: {minutes: 10, steps: 250},
runs_on: 'vm',
category: 'Display & graphics',
tags: ['uac'],
metadata: {customer_id: 'cus_42'}
}
],
test_set_id: '<string>'
})
};
fetch('https://guidinghand.ai/v1/test_cases/batch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://guidinghand.ai/v1/test_cases/batch"
payload = {
"cases": [
{
"name": "Apps switched to dark mode",
"prompt": "All my windows suddenly went black. How do I get the white back?",
"start_state": "win10-22h2",
"success": {
"check_script": "<string>",
"rubric": "<string>"
},
"key": "DSP-01",
"setup_script": "<string>",
"customer": {
"persona": "Retired teacher. Not technical. Short, polite answers.",
"facts": {
"Wi-Fi network": "HomeNet",
"Wi-Fi password": { "secret": "blue-kite-42" }
},
"clicks_admin_prompts": True,
"does_steps": True
},
"operator": {},
"limits": {
"minutes": 10,
"steps": 250
},
"runs_on": "vm",
"category": "Display & graphics",
"tags": ["uac"],
"metadata": { "customer_id": "cus_42" }
}
],
"test_set_id": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"data": [
{
"object": "test_case",
"test_case_id": "tc_8Kq2mZ0aLp4x",
"key": "DSP-01",
"name": "Apps switched to dark mode",
"prompt": "All my windows suddenly went black. How do I get the white back?",
"start_state": "win10-22h2",
"setup_script": "<string>",
"success": {
"check_script": "<string>",
"rubric": "<string>"
},
"customer": {
"persona": "Retired teacher. Not technical. Short, polite answers.",
"facts": {
"Wi-Fi network": "HomeNet",
"Wi-Fi password": {
"secret": "blue-kite-42"
}
},
"clicks_admin_prompts": true,
"does_steps": true
},
"operator": {
"approvals": "approve"
},
"limits": {
"minutes": 10,
"steps": 250
},
"runs_on": "vm",
"category": "Display & graphics",
"tags": [
"uac"
],
"metadata": {
"customer_id": "cus_42"
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"created": 123,
"updated": 123
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"code": "<string>",
"answered_by": "customer",
"test_case_ids": [
"<string>"
]
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"code": "<string>",
"answered_by": "customer",
"test_case_ids": [
"<string>"
]
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"code": "<string>",
"answered_by": "customer",
"test_case_ids": [
"<string>"
]
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"code": "<string>",
"answered_by": "customer",
"test_case_ids": [
"<string>"
]
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"code": "<string>",
"answered_by": "customer",
"test_case_ids": [
"<string>"
]
}
}Test cases
Create or update test cases
Creates or updates up to 500 cases at once, matched by key (a case without a key is created). With test_set_id, also adds them to that test set. The body can be up to 8 MB. Needs the admin role or an API key.
POST
/
v1
/
test_cases
/
batch
Create or update test cases
curl --request POST \
--url https://guidinghand.ai/v1/test_cases/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"cases": [
{
"name": "Apps switched to dark mode",
"prompt": "All my windows suddenly went black. How do I get the white back?",
"start_state": "win10-22h2",
"success": {
"check_script": "<string>",
"rubric": "<string>"
},
"key": "DSP-01",
"setup_script": "<string>",
"customer": {
"persona": "Retired teacher. Not technical. Short, polite answers.",
"facts": {
"Wi-Fi network": "HomeNet",
"Wi-Fi password": {
"secret": "blue-kite-42"
}
},
"clicks_admin_prompts": true,
"does_steps": true
},
"operator": {},
"limits": {
"minutes": 10,
"steps": 250
},
"runs_on": "vm",
"category": "Display & graphics",
"tags": [
"uac"
],
"metadata": {
"customer_id": "cus_42"
}
}
],
"test_set_id": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
cases: [
{
name: 'Apps switched to dark mode',
prompt: 'All my windows suddenly went black. How do I get the white back?',
start_state: 'win10-22h2',
success: {check_script: '<string>', rubric: '<string>'},
key: 'DSP-01',
setup_script: '<string>',
customer: {
persona: 'Retired teacher. Not technical. Short, polite answers.',
facts: {'Wi-Fi network': 'HomeNet', 'Wi-Fi password': {secret: 'blue-kite-42'}},
clicks_admin_prompts: true,
does_steps: true
},
operator: {},
limits: {minutes: 10, steps: 250},
runs_on: 'vm',
category: 'Display & graphics',
tags: ['uac'],
metadata: {customer_id: 'cus_42'}
}
],
test_set_id: '<string>'
})
};
fetch('https://guidinghand.ai/v1/test_cases/batch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://guidinghand.ai/v1/test_cases/batch"
payload = {
"cases": [
{
"name": "Apps switched to dark mode",
"prompt": "All my windows suddenly went black. How do I get the white back?",
"start_state": "win10-22h2",
"success": {
"check_script": "<string>",
"rubric": "<string>"
},
"key": "DSP-01",
"setup_script": "<string>",
"customer": {
"persona": "Retired teacher. Not technical. Short, polite answers.",
"facts": {
"Wi-Fi network": "HomeNet",
"Wi-Fi password": { "secret": "blue-kite-42" }
},
"clicks_admin_prompts": True,
"does_steps": True
},
"operator": {},
"limits": {
"minutes": 10,
"steps": 250
},
"runs_on": "vm",
"category": "Display & graphics",
"tags": ["uac"],
"metadata": { "customer_id": "cus_42" }
}
],
"test_set_id": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"data": [
{
"object": "test_case",
"test_case_id": "tc_8Kq2mZ0aLp4x",
"key": "DSP-01",
"name": "Apps switched to dark mode",
"prompt": "All my windows suddenly went black. How do I get the white back?",
"start_state": "win10-22h2",
"setup_script": "<string>",
"success": {
"check_script": "<string>",
"rubric": "<string>"
},
"customer": {
"persona": "Retired teacher. Not technical. Short, polite answers.",
"facts": {
"Wi-Fi network": "HomeNet",
"Wi-Fi password": {
"secret": "blue-kite-42"
}
},
"clicks_admin_prompts": true,
"does_steps": true
},
"operator": {
"approvals": "approve"
},
"limits": {
"minutes": 10,
"steps": 250
},
"runs_on": "vm",
"category": "Display & graphics",
"tags": [
"uac"
],
"metadata": {
"customer_id": "cus_42"
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"created": 123,
"updated": 123
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"code": "<string>",
"answered_by": "customer",
"test_case_ids": [
"<string>"
]
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"code": "<string>",
"answered_by": "customer",
"test_case_ids": [
"<string>"
]
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"code": "<string>",
"answered_by": "customer",
"test_case_ids": [
"<string>"
]
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"code": "<string>",
"answered_by": "customer",
"test_case_ids": [
"<string>"
]
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"code": "<string>",
"answered_by": "customer",
"test_case_ids": [
"<string>"
]
}
}Authorizations
An org API key (gh_live_…) from Settings → API keys in the console.
Body
application/json