Send a signal to an exec
Sends a signal to the exec’s process group (default SIGKILL). It’s asynchronous: the response shows the exec as it is right after; with SIGKILL it ends shortly after with status exited and exit_code 137 (128 + the signal number). Signalling an exec that already ended changes nothing.
An exec still starting can only be cancelled: SIGKILL makes sure the command never runs (it ends failed with reason cancelled); another signal gets exec_not_started. Retry once it’s running.
With an Idempotency-Key, a retry replays the first answer. Two overlapping requests with the same key may both deliver the signal.
curl --request POST \
--url https://api.telnyx.com/v2/ai/sandboxes/{sandbox_id}/execs/{exec_id}/kill \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"signal": "SIGTERM"
}
'import requests
url = "https://api.telnyx.com/v2/ai/sandboxes/{sandbox_id}/execs/{exec_id}/kill"
payload = { "signal": "SIGTERM" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({signal: 'SIGTERM'})
};
fetch('https://api.telnyx.com/v2/ai/sandboxes/{sandbox_id}/execs/{exec_id}/kill', 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.telnyx.com/v2/ai/sandboxes/{sandbox_id}/execs/{exec_id}/kill",
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([
'signal' => 'SIGTERM'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.telnyx.com/v2/ai/sandboxes/{sandbox_id}/execs/{exec_id}/kill"
payload := strings.NewReader("{\n \"signal\": \"SIGTERM\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.telnyx.com/v2/ai/sandboxes/{sandbox_id}/execs/{exec_id}/kill")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"signal\": \"SIGTERM\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.telnyx.com/v2/ai/sandboxes/{sandbox_id}/execs/{exec_id}/kill")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"signal\": \"SIGTERM\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "exec-0192f1c9-3e2a-7b1d-8c4f-5a6b7c8d9e0f",
"sandbox_id": "sb-0192f1c2-7a4b-7c3e-9d1e-2f3a4b5c6d7e",
"command": [
"python",
"evaluate.py",
"--split",
"test"
],
"env": {
"LOG_LEVEL": "info"
},
"workdir": "/app",
"timeout": 3600,
"status": "running",
"exit_code": null,
"reason": null,
"created_at": "2026-11-13T10:05:00Z",
"finished_at": null
}
}{
"errors": [
{
"title": "<string>",
"code": "<string>",
"detail": "<string>",
"meta": {
"url": null
},
"source": {
"parameter": null,
"pointer": null
}
}
]
}{
"errors": [
{
"code": "10009",
"title": "Authentication failed",
"detail": "Could not find any usable credentials in the request."
}
]
}{
"errors": [
{
"title": "sandboxes_not_whitelisted",
"detail": "The organization isn't whitelisted."
}
]
}{
"errors": [
{
"code": "10005",
"title": "Resource not found",
"detail": "Sandbox not found."
}
]
}{
"errors": [
{
"title": "exec_not_started",
"detail": "The exec hasn't started; only SIGKILL can be sent."
}
]
}{
"errors": [
{
"title": "idempotency_key_reused",
"detail": "This Idempotency-Key was used with a different request."
}
]
}{
"errors": [
{
"code": "10037",
"title": "Service unavailable",
"detail": "A dependency can't answer right now; retry later."
}
]
}Authorizations
Headers
Optional client-chosen key (e.g. a UUID, at most 255 characters) that makes the call safe to retry. Within 24 h, the same key with the same request returns the stored response instead of acting twice; the same key with a different request fails with idempotency_key_reused; a request with a key that's still being processed fails with request_in_progress.
1 - 255Path Parameters
Body
Was this page helpful?
curl --request POST \
--url https://api.telnyx.com/v2/ai/sandboxes/{sandbox_id}/execs/{exec_id}/kill \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"signal": "SIGTERM"
}
'import requests
url = "https://api.telnyx.com/v2/ai/sandboxes/{sandbox_id}/execs/{exec_id}/kill"
payload = { "signal": "SIGTERM" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({signal: 'SIGTERM'})
};
fetch('https://api.telnyx.com/v2/ai/sandboxes/{sandbox_id}/execs/{exec_id}/kill', 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.telnyx.com/v2/ai/sandboxes/{sandbox_id}/execs/{exec_id}/kill",
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([
'signal' => 'SIGTERM'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.telnyx.com/v2/ai/sandboxes/{sandbox_id}/execs/{exec_id}/kill"
payload := strings.NewReader("{\n \"signal\": \"SIGTERM\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.telnyx.com/v2/ai/sandboxes/{sandbox_id}/execs/{exec_id}/kill")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"signal\": \"SIGTERM\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.telnyx.com/v2/ai/sandboxes/{sandbox_id}/execs/{exec_id}/kill")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"signal\": \"SIGTERM\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "exec-0192f1c9-3e2a-7b1d-8c4f-5a6b7c8d9e0f",
"sandbox_id": "sb-0192f1c2-7a4b-7c3e-9d1e-2f3a4b5c6d7e",
"command": [
"python",
"evaluate.py",
"--split",
"test"
],
"env": {
"LOG_LEVEL": "info"
},
"workdir": "/app",
"timeout": 3600,
"status": "running",
"exit_code": null,
"reason": null,
"created_at": "2026-11-13T10:05:00Z",
"finished_at": null
}
}{
"errors": [
{
"title": "<string>",
"code": "<string>",
"detail": "<string>",
"meta": {
"url": null
},
"source": {
"parameter": null,
"pointer": null
}
}
]
}{
"errors": [
{
"code": "10009",
"title": "Authentication failed",
"detail": "Could not find any usable credentials in the request."
}
]
}{
"errors": [
{
"title": "sandboxes_not_whitelisted",
"detail": "The organization isn't whitelisted."
}
]
}{
"errors": [
{
"code": "10005",
"title": "Resource not found",
"detail": "Sandbox not found."
}
]
}{
"errors": [
{
"title": "exec_not_started",
"detail": "The exec hasn't started; only SIGKILL can be sent."
}
]
}{
"errors": [
{
"title": "idempotency_key_reused",
"detail": "This Idempotency-Key was used with a different request."
}
]
}{
"errors": [
{
"code": "10037",
"title": "Service unavailable",
"detail": "A dependency can't answer right now; retry later."
}
]
}