Cancel async code run
import requests
url = "https://api.13-215-85-171.sslip.io/v1/machines/{id}/code/runs/{run_id}/cancel"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)curl --request POST \
--url https://api.13-215-85-171.sslip.io/v1/machines/{id}/code/runs/{run_id}/cancel \
--header 'Authorization: Bearer <token>'{
"id": "<string>",
"machine_id": "<string>",
"context_id": "<string>",
"timeout_secs": 123,
"created_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"started_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"cancel_requested_at": "2023-11-07T05:31:56Z",
"execution": {
"results": [
{
"text": "<string>",
"html": "<string>",
"markdown": "<string>",
"svg": "<string>",
"png": "<string>",
"jpeg": "<string>",
"pdf": "<string>",
"latex": "<string>",
"json": "<unknown>",
"javascript": "<string>",
"data": {},
"is_main_result": true
}
],
"artifacts": [
{
"id": "<string>",
"context_id": "<string>",
"mime_type": "<string>",
"name": "<string>",
"size_bytes": 123,
"sha256": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"execution_count": 123,
"expires_at": "2023-11-07T05:31:56Z",
"preview_url": "<string>",
"download_url": "<string>",
"metadata": {}
}
],
"logs": {
"stdout": [
"<string>"
],
"stderr": [
"<string>"
]
},
"error": {
"name": "<string>",
"value": "<string>",
"traceback": "<string>"
},
"execution_count": 123
},
"failure_reason": "<string>"
}{
"id": "<string>",
"machine_id": "<string>",
"context_id": "<string>",
"timeout_secs": 123,
"created_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"started_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"cancel_requested_at": "2023-11-07T05:31:56Z",
"execution": {
"results": [
{
"text": "<string>",
"html": "<string>",
"markdown": "<string>",
"svg": "<string>",
"png": "<string>",
"jpeg": "<string>",
"pdf": "<string>",
"latex": "<string>",
"json": "<unknown>",
"javascript": "<string>",
"data": {},
"is_main_result": true
}
],
"artifacts": [
{
"id": "<string>",
"context_id": "<string>",
"mime_type": "<string>",
"name": "<string>",
"size_bytes": 123,
"sha256": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"execution_count": 123,
"expires_at": "2023-11-07T05:31:56Z",
"preview_url": "<string>",
"download_url": "<string>",
"metadata": {}
}
],
"logs": {
"stdout": [
"<string>"
],
"stderr": [
"<string>"
]
},
"error": {
"name": "<string>",
"value": "<string>",
"traceback": "<string>"
},
"execution_count": 123
},
"failure_reason": "<string>"
}{
"error": "<string>",
"error_detail": {
"message": "<string>",
"retryable": true,
"suggested_action": "<string>",
"step_index": 123,
"attempt": 123,
"max_attempts": 123,
"cache_subject": "<string>",
"build_id": "<string>",
"request_id": "<string>",
"details": {}
},
"request_id": "<string>",
"build_id": "<string>"
}{
"error": "<string>",
"error_detail": {
"message": "<string>",
"retryable": true,
"suggested_action": "<string>",
"step_index": 123,
"attempt": 123,
"max_attempts": 123,
"cache_subject": "<string>",
"build_id": "<string>",
"request_id": "<string>",
"details": {}
},
"request_id": "<string>",
"build_id": "<string>"
}Code
Cancel async code run
POST
/
v1
/
machines
/
{id}
/
code
/
runs
/
{run_id}
/
cancel
Cancel async code run
import requests
url = "https://api.13-215-85-171.sslip.io/v1/machines/{id}/code/runs/{run_id}/cancel"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)curl --request POST \
--url https://api.13-215-85-171.sslip.io/v1/machines/{id}/code/runs/{run_id}/cancel \
--header 'Authorization: Bearer <token>'{
"id": "<string>",
"machine_id": "<string>",
"context_id": "<string>",
"timeout_secs": 123,
"created_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"started_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"cancel_requested_at": "2023-11-07T05:31:56Z",
"execution": {
"results": [
{
"text": "<string>",
"html": "<string>",
"markdown": "<string>",
"svg": "<string>",
"png": "<string>",
"jpeg": "<string>",
"pdf": "<string>",
"latex": "<string>",
"json": "<unknown>",
"javascript": "<string>",
"data": {},
"is_main_result": true
}
],
"artifacts": [
{
"id": "<string>",
"context_id": "<string>",
"mime_type": "<string>",
"name": "<string>",
"size_bytes": 123,
"sha256": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"execution_count": 123,
"expires_at": "2023-11-07T05:31:56Z",
"preview_url": "<string>",
"download_url": "<string>",
"metadata": {}
}
],
"logs": {
"stdout": [
"<string>"
],
"stderr": [
"<string>"
]
},
"error": {
"name": "<string>",
"value": "<string>",
"traceback": "<string>"
},
"execution_count": 123
},
"failure_reason": "<string>"
}{
"id": "<string>",
"machine_id": "<string>",
"context_id": "<string>",
"timeout_secs": 123,
"created_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"started_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"cancel_requested_at": "2023-11-07T05:31:56Z",
"execution": {
"results": [
{
"text": "<string>",
"html": "<string>",
"markdown": "<string>",
"svg": "<string>",
"png": "<string>",
"jpeg": "<string>",
"pdf": "<string>",
"latex": "<string>",
"json": "<unknown>",
"javascript": "<string>",
"data": {},
"is_main_result": true
}
],
"artifacts": [
{
"id": "<string>",
"context_id": "<string>",
"mime_type": "<string>",
"name": "<string>",
"size_bytes": 123,
"sha256": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"execution_count": 123,
"expires_at": "2023-11-07T05:31:56Z",
"preview_url": "<string>",
"download_url": "<string>",
"metadata": {}
}
],
"logs": {
"stdout": [
"<string>"
],
"stderr": [
"<string>"
]
},
"error": {
"name": "<string>",
"value": "<string>",
"traceback": "<string>"
},
"execution_count": 123
},
"failure_reason": "<string>"
}{
"error": "<string>",
"error_detail": {
"message": "<string>",
"retryable": true,
"suggested_action": "<string>",
"step_index": 123,
"attempt": 123,
"max_attempts": 123,
"cache_subject": "<string>",
"build_id": "<string>",
"request_id": "<string>",
"details": {}
},
"request_id": "<string>",
"build_id": "<string>"
}{
"error": "<string>",
"error_detail": {
"message": "<string>",
"retryable": true,
"suggested_action": "<string>",
"step_index": 123,
"attempt": 123,
"max_attempts": 123,
"cache_subject": "<string>",
"build_id": "<string>",
"request_id": "<string>",
"details": {}
},
"request_id": "<string>",
"build_id": "<string>"
}Authorizations
API key passed as Bearer token
Response
Run already terminal or now cancelled
Available options:
queued, running, succeeded, failed, cancelled Show child attributes
Show child attributes
⌘I