curl --request POST \
--url https://devtune.ai/api/v2/projects/{projectId}/actions/{actionId}/status \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"acknowledgeHighStakes": true,
"publishedUrl": "<string>"
}
'import requests
url = "https://devtune.ai/api/v2/projects/{projectId}/actions/{actionId}/status"
payload = {
"acknowledgeHighStakes": True,
"publishedUrl": "<string>"
}
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({acknowledgeHighStakes: true, publishedUrl: '<string>'})
};
fetch('https://devtune.ai/api/v2/projects/{projectId}/actions/{actionId}/status', 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://devtune.ai/api/v2/projects/{projectId}/actions/{actionId}/status",
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([
'acknowledgeHighStakes' => true,
'publishedUrl' => '<string>'
]),
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://devtune.ai/api/v2/projects/{projectId}/actions/{actionId}/status"
payload := strings.NewReader("{\n \"acknowledgeHighStakes\": true,\n \"publishedUrl\": \"<string>\"\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://devtune.ai/api/v2/projects/{projectId}/actions/{actionId}/status")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"acknowledgeHighStakes\": true,\n \"publishedUrl\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://devtune.ai/api/v2/projects/{projectId}/actions/{actionId}/status")
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 \"acknowledgeHighStakes\": true,\n \"publishedUrl\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"actionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"actionIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"blocked": true,
"changed": true,
"fromStatus": "suggested",
"toStatus": "suggested",
"transition": "accept",
"transitionedAt": "2023-11-07T05:31:56Z"
},
"meta": {
"timestamp": "2023-11-07T05:31:56Z",
"projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": "<string>",
"message": "<string>",
"status": 123,
"reason": "<string>"
}{
"error": "<string>",
"message": "<string>",
"status": 123,
"reason": "<string>"
}{
"error": "<string>",
"message": "<string>",
"status": 123,
"reason": "<string>"
}{
"error": "<string>",
"message": "<string>",
"status": 123,
"reason": "<string>"
}{
"error": "<string>",
"message": "<string>",
"status": 123,
"reason": "<string>"
}{
"error": "<string>",
"message": "<string>",
"status": 123,
"reason": "<string>"
}Change an action status
Moves an action through its lifecycle, as the member who created the API key; they must be a project member who can manage actions (403 otherwise, including for a key with no creator). Transitions come in pairs. accept moves a suggestion to accepted and unaccept returns it to the suggestions; unaccept is refused with not_reversible once the action has an owner, is in progress or blocked, has ever gone live or has a measurement, or has a brief, draft, edit, Library item, retest, prompt request added from another prompt, or dismissal note attached, whenever it was written, or was accepted before DevTune recorded that it came from a suggestion; an action someone created, such as a prompt action, is refused with invalid_transition; and a suggestion accepted as already covered by an existing page is not undone. archive takes a suggestion or accepted or live work off the queue; restore returns an archived suggestion to the suggestions, or archived work to the status it had, live work keeping its go-live date. Work archived while blocked returns to blocked, except work archived before DevTune kept that state, which returns to the status it had before it was blocked. block and unblock apply to accepted work; unblock returns it to the status it had before. mark_live moves accepted work to live and opens its before/after measurement in Results from now; publishedUrl, when given, is added to the pages the action already carries, which all stay. reopen moves live work back to accepted: its measurement, go-live date and published pages stay, and marking it live again continues the same measurement. accept, archive of a suggestion, restore of an archived suggestion and unaccept act on every suggestion merged into the named one. A high-stakes target page refuses accept with acknowledgment_required until acknowledgeHighStakes is true, which needs a human’s confirmation; a locked page refuses it with page_locked. Repeating accept, unaccept, archive, block, unblock, reopen, or mark_live without a new page returns changed false and writes nothing; restore of an action that is not archived is refused with invalid_transition, because the status it would return to is not known. Any other refusal is a 409 whose reason is invalid_transition, superseded (a newer action for the same Agent Picks loss is open) or conflict (the action, its merged suggestions or its target page’s protection changed during the request, or the merged suggestions cannot all move in one change; read the action and retry); nothing is written. Some suggestions archived before DevTune recorded which suggestions were archived together share their archive time with others and are always refused with conflict; they stay archived. The key, its creator’s membership and their permission are checked again where the change is written, so access revoked mid-request is refused with 403. A change queues action.updated webhooks naming the API as the actor. Nothing is published to the customer’s site.
curl --request POST \
--url https://devtune.ai/api/v2/projects/{projectId}/actions/{actionId}/status \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"acknowledgeHighStakes": true,
"publishedUrl": "<string>"
}
'import requests
url = "https://devtune.ai/api/v2/projects/{projectId}/actions/{actionId}/status"
payload = {
"acknowledgeHighStakes": True,
"publishedUrl": "<string>"
}
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({acknowledgeHighStakes: true, publishedUrl: '<string>'})
};
fetch('https://devtune.ai/api/v2/projects/{projectId}/actions/{actionId}/status', 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://devtune.ai/api/v2/projects/{projectId}/actions/{actionId}/status",
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([
'acknowledgeHighStakes' => true,
'publishedUrl' => '<string>'
]),
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://devtune.ai/api/v2/projects/{projectId}/actions/{actionId}/status"
payload := strings.NewReader("{\n \"acknowledgeHighStakes\": true,\n \"publishedUrl\": \"<string>\"\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://devtune.ai/api/v2/projects/{projectId}/actions/{actionId}/status")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"acknowledgeHighStakes\": true,\n \"publishedUrl\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://devtune.ai/api/v2/projects/{projectId}/actions/{actionId}/status")
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 \"acknowledgeHighStakes\": true,\n \"publishedUrl\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"actionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"actionIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"blocked": true,
"changed": true,
"fromStatus": "suggested",
"toStatus": "suggested",
"transition": "accept",
"transitionedAt": "2023-11-07T05:31:56Z"
},
"meta": {
"timestamp": "2023-11-07T05:31:56Z",
"projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": "<string>",
"message": "<string>",
"status": 123,
"reason": "<string>"
}{
"error": "<string>",
"message": "<string>",
"status": 123,
"reason": "<string>"
}{
"error": "<string>",
"message": "<string>",
"status": 123,
"reason": "<string>"
}{
"error": "<string>",
"message": "<string>",
"status": 123,
"reason": "<string>"
}{
"error": "<string>",
"message": "<string>",
"status": 123,
"reason": "<string>"
}{
"error": "<string>",
"message": "<string>",
"status": 123,
"reason": "<string>"
}Authorizations
API key with dtk_live_ prefix. Obtain it from API Keys in the account sidebar. New keys start with all supported scopes selected for the chosen project, and you can narrow them to specific read/write scopes as needed.
Body
accept, unaccept, archive, restore, block, unblock, mark_live, reopen Only with accept. Confirms a human approved changing a high-stakes page.
Only with mark_live. The http(s) page where the fix shipped.
2048