Record a new run
A daemon records a run it has started, so CliqHub shows it. CliqHub also records the
workspace (from workspace_path) and links the team. Sending a run that already exists
updates it and marks it running again, so daemons can safely resend. A run name is
generated when none is sent.
Daemon only: requires the daemon’s realm token (cliq_dt_…); the record is created in that token’s realm.
curl --request POST \
--url https://{host}/v1/runs/create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"run_id": "0c8d7e6f-5a4b-4c3d-9e2f-1a0b9c8d7e6f",
"workspace_id": "9b2e6f10-4c3a-4e7d-8f21-6a5b4c3d2e1f",
"workspace_path": "/home/dev/acme-api",
"team_id": "3f6c2a8e-6b1d-4c1e-9a57-0d2f4b8e91c4",
"daemon_id": "7d1c2b3a-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
"run_name": "fix-login-timeout",
"inputs": {
"pr_url": "https://github.com/acme/api/pull/42"
}
}
'import requests
url = "https://{host}/v1/runs/create"
payload = {
"run_id": "0c8d7e6f-5a4b-4c3d-9e2f-1a0b9c8d7e6f",
"workspace_id": "9b2e6f10-4c3a-4e7d-8f21-6a5b4c3d2e1f",
"workspace_path": "/home/dev/acme-api",
"team_id": "3f6c2a8e-6b1d-4c1e-9a57-0d2f4b8e91c4",
"daemon_id": "7d1c2b3a-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
"run_name": "fix-login-timeout",
"inputs": { "pr_url": "https://github.com/acme/api/pull/42" }
}
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({
run_id: '0c8d7e6f-5a4b-4c3d-9e2f-1a0b9c8d7e6f',
workspace_id: '9b2e6f10-4c3a-4e7d-8f21-6a5b4c3d2e1f',
workspace_path: '/home/dev/acme-api',
team_id: '3f6c2a8e-6b1d-4c1e-9a57-0d2f4b8e91c4',
daemon_id: '7d1c2b3a-4e5f-4a6b-8c7d-9e0f1a2b3c4d',
run_name: 'fix-login-timeout',
inputs: {pr_url: 'https://github.com/acme/api/pull/42'}
})
};
fetch('https://{host}/v1/runs/create', 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://{host}/v1/runs/create",
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([
'run_id' => '0c8d7e6f-5a4b-4c3d-9e2f-1a0b9c8d7e6f',
'workspace_id' => '9b2e6f10-4c3a-4e7d-8f21-6a5b4c3d2e1f',
'workspace_path' => '/home/dev/acme-api',
'team_id' => '3f6c2a8e-6b1d-4c1e-9a57-0d2f4b8e91c4',
'daemon_id' => '7d1c2b3a-4e5f-4a6b-8c7d-9e0f1a2b3c4d',
'run_name' => 'fix-login-timeout',
'inputs' => [
'pr_url' => 'https://github.com/acme/api/pull/42'
]
]),
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://{host}/v1/runs/create"
payload := strings.NewReader("{\n \"run_id\": \"0c8d7e6f-5a4b-4c3d-9e2f-1a0b9c8d7e6f\",\n \"workspace_id\": \"9b2e6f10-4c3a-4e7d-8f21-6a5b4c3d2e1f\",\n \"workspace_path\": \"/home/dev/acme-api\",\n \"team_id\": \"3f6c2a8e-6b1d-4c1e-9a57-0d2f4b8e91c4\",\n \"daemon_id\": \"7d1c2b3a-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n \"run_name\": \"fix-login-timeout\",\n \"inputs\": {\n \"pr_url\": \"https://github.com/acme/api/pull/42\"\n }\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://{host}/v1/runs/create")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"run_id\": \"0c8d7e6f-5a4b-4c3d-9e2f-1a0b9c8d7e6f\",\n \"workspace_id\": \"9b2e6f10-4c3a-4e7d-8f21-6a5b4c3d2e1f\",\n \"workspace_path\": \"/home/dev/acme-api\",\n \"team_id\": \"3f6c2a8e-6b1d-4c1e-9a57-0d2f4b8e91c4\",\n \"daemon_id\": \"7d1c2b3a-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n \"run_name\": \"fix-login-timeout\",\n \"inputs\": {\n \"pr_url\": \"https://github.com/acme/api/pull/42\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/v1/runs/create")
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 \"run_id\": \"0c8d7e6f-5a4b-4c3d-9e2f-1a0b9c8d7e6f\",\n \"workspace_id\": \"9b2e6f10-4c3a-4e7d-8f21-6a5b4c3d2e1f\",\n \"workspace_path\": \"/home/dev/acme-api\",\n \"team_id\": \"3f6c2a8e-6b1d-4c1e-9a57-0d2f4b8e91c4\",\n \"daemon_id\": \"7d1c2b3a-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n \"run_name\": \"fix-login-timeout\",\n \"inputs\": {\n \"pr_url\": \"https://github.com/acme/api/pull/42\"\n }\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
User PAT (cliq_tok_…, including session-scoped) or realm token (cliq_dt_…).
Body
The daemon's workspace id.
The team's id.
The daemon running it (required).
1Absolute workspace folder on the daemon; CliqHub records the workspace by it.
1Workspace display name.
The daemon's run id. CliqHub generates one when omitted.
Display name.
For a sub-run, the run that started it.
For a sub-run, the phase of the parent that started it.
The run's inputs.
The caller's correlation id (run_context.id).
256Labels sent at start.
Show child attributes
Show child attributes
local or docker.
curl --request POST \
--url https://{host}/v1/runs/create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"run_id": "0c8d7e6f-5a4b-4c3d-9e2f-1a0b9c8d7e6f",
"workspace_id": "9b2e6f10-4c3a-4e7d-8f21-6a5b4c3d2e1f",
"workspace_path": "/home/dev/acme-api",
"team_id": "3f6c2a8e-6b1d-4c1e-9a57-0d2f4b8e91c4",
"daemon_id": "7d1c2b3a-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
"run_name": "fix-login-timeout",
"inputs": {
"pr_url": "https://github.com/acme/api/pull/42"
}
}
'import requests
url = "https://{host}/v1/runs/create"
payload = {
"run_id": "0c8d7e6f-5a4b-4c3d-9e2f-1a0b9c8d7e6f",
"workspace_id": "9b2e6f10-4c3a-4e7d-8f21-6a5b4c3d2e1f",
"workspace_path": "/home/dev/acme-api",
"team_id": "3f6c2a8e-6b1d-4c1e-9a57-0d2f4b8e91c4",
"daemon_id": "7d1c2b3a-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
"run_name": "fix-login-timeout",
"inputs": { "pr_url": "https://github.com/acme/api/pull/42" }
}
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({
run_id: '0c8d7e6f-5a4b-4c3d-9e2f-1a0b9c8d7e6f',
workspace_id: '9b2e6f10-4c3a-4e7d-8f21-6a5b4c3d2e1f',
workspace_path: '/home/dev/acme-api',
team_id: '3f6c2a8e-6b1d-4c1e-9a57-0d2f4b8e91c4',
daemon_id: '7d1c2b3a-4e5f-4a6b-8c7d-9e0f1a2b3c4d',
run_name: 'fix-login-timeout',
inputs: {pr_url: 'https://github.com/acme/api/pull/42'}
})
};
fetch('https://{host}/v1/runs/create', 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://{host}/v1/runs/create",
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([
'run_id' => '0c8d7e6f-5a4b-4c3d-9e2f-1a0b9c8d7e6f',
'workspace_id' => '9b2e6f10-4c3a-4e7d-8f21-6a5b4c3d2e1f',
'workspace_path' => '/home/dev/acme-api',
'team_id' => '3f6c2a8e-6b1d-4c1e-9a57-0d2f4b8e91c4',
'daemon_id' => '7d1c2b3a-4e5f-4a6b-8c7d-9e0f1a2b3c4d',
'run_name' => 'fix-login-timeout',
'inputs' => [
'pr_url' => 'https://github.com/acme/api/pull/42'
]
]),
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://{host}/v1/runs/create"
payload := strings.NewReader("{\n \"run_id\": \"0c8d7e6f-5a4b-4c3d-9e2f-1a0b9c8d7e6f\",\n \"workspace_id\": \"9b2e6f10-4c3a-4e7d-8f21-6a5b4c3d2e1f\",\n \"workspace_path\": \"/home/dev/acme-api\",\n \"team_id\": \"3f6c2a8e-6b1d-4c1e-9a57-0d2f4b8e91c4\",\n \"daemon_id\": \"7d1c2b3a-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n \"run_name\": \"fix-login-timeout\",\n \"inputs\": {\n \"pr_url\": \"https://github.com/acme/api/pull/42\"\n }\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://{host}/v1/runs/create")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"run_id\": \"0c8d7e6f-5a4b-4c3d-9e2f-1a0b9c8d7e6f\",\n \"workspace_id\": \"9b2e6f10-4c3a-4e7d-8f21-6a5b4c3d2e1f\",\n \"workspace_path\": \"/home/dev/acme-api\",\n \"team_id\": \"3f6c2a8e-6b1d-4c1e-9a57-0d2f4b8e91c4\",\n \"daemon_id\": \"7d1c2b3a-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n \"run_name\": \"fix-login-timeout\",\n \"inputs\": {\n \"pr_url\": \"https://github.com/acme/api/pull/42\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/v1/runs/create")
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 \"run_id\": \"0c8d7e6f-5a4b-4c3d-9e2f-1a0b9c8d7e6f\",\n \"workspace_id\": \"9b2e6f10-4c3a-4e7d-8f21-6a5b4c3d2e1f\",\n \"workspace_path\": \"/home/dev/acme-api\",\n \"team_id\": \"3f6c2a8e-6b1d-4c1e-9a57-0d2f4b8e91c4\",\n \"daemon_id\": \"7d1c2b3a-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n \"run_name\": \"fix-login-timeout\",\n \"inputs\": {\n \"pr_url\": \"https://github.com/acme/api/pull/42\"\n }\n}"
response = http.request(request)
puts response.read_body