Request cURL
curl -s -X POST "https://app.upfour.io/v1/escalation-policies/00000000-0000-4000-8000-000000000001/test" \
-H "Authorization: Bearer $UP4_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"mode": "full"
}'
JavaScript
const res = await fetch("https://app.upfour.io/v1/escalation-policies/00000000-0000-4000-8000-000000000001/test", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.UP4_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
mode: "full",
}),
});
console.log(res.status, await res.json());
Python
import os
import requests
res = requests.post(
"https://app.upfour.io/v1/escalation-policies/00000000-0000-4000-8000-000000000001/test",
headers={"Authorization": f"Bearer {os.environ['UP4_API_KEY']}"},
json={
"mode": "full",
},
)
print(res.status_code, res.json())
Go
package main
import (
"fmt"
"io"
"net/http"
"os"
"strings"
)
func main() {
payload := strings.NewReader(`{
"mode": "full"
}`)
req, _ := http.NewRequest("POST", "https://app.upfour.io/v1/escalation-policies/00000000-0000-4000-8000-000000000001/test", payload)
req.Header.Set("Authorization", "Bearer "+os.Getenv("UP4_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
out, _ := io.ReadAll(res.Body)
fmt.Println(res.StatusCode, string(out))
}
PHP
<?php
$payload = <<<'JSON'
{
"mode": "full"
}
JSON;
$ch = curl_init("https://app.upfour.io/v1/escalation-policies/00000000-0000-4000-8000-000000000001/test");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("UP4_API_KEY"),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => $payload,
]);
$response = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_RESPONSE_CODE), " ", $response, "\n";
curl_close($ch);
Response
202
{
"data": {
"created_at": "2026-10-27T09:00:00Z",
"id": "00000000-0000-4000-8000-000000000002",
"mode": "full",
"policy_id": "00000000-0000-4000-8000-000000000001",
"status": "scheduled",
"steps": [
{
"position": 0,
"scheduled_at": "2026-10-27T09:00:00Z",
"status": "scheduled",
"targets": [
{
"attempts": 0,
"channel_id": "00000000-0000-4000-8000-000000000003",
"channel_name": "On-call email",
"channel_type": "email",
"status": "scheduled"
}
],
"urgency": "high",
"wait_seconds": 0
}
]
}
}
400
{
"error": {
"code": "bad_request",
"message": "The request is malformed or fails validation.",
"request_id": "req_…"
}
}
403
{
"error": {
"code": "permission_denied",
"message": "The credentials do not permit this action.",
"request_id": "req_…"
}
}
404
{
"error": {
"code": "not_found",
"message": "The requested resource does not exist or is outside the caller's scope.",
"request_id": "req_…"
}
}