curl --request POST \
--url https://api.peec.ai/customer/v1/actions/steps/completion \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"actions": [
{
"action_id": "01a0422f-e0c4-7820-85a1-31515a321f15",
"completed": true,
"steps": [
{
"step_id": "3f1c8a92-4d5b-4e77-9c21-8ab0f6d21e10",
"completed": true,
"options": [
{
"option_id": "9d4e2b71-6c8a-4f13-b5d0-1e7a3c9f2b84",
"completed": true
}
]
}
]
}
],
"project_id": "or_f45b94ba-5e35-4982-93ed-285e72ee14eb"
}
'import requests
url = "https://api.peec.ai/customer/v1/actions/steps/completion"
payload = {
"actions": [
{
"action_id": "01a0422f-e0c4-7820-85a1-31515a321f15",
"completed": True,
"steps": [
{
"step_id": "3f1c8a92-4d5b-4e77-9c21-8ab0f6d21e10",
"completed": True,
"options": [
{
"option_id": "9d4e2b71-6c8a-4f13-b5d0-1e7a3c9f2b84",
"completed": True
}
]
}
]
}
],
"project_id": "or_f45b94ba-5e35-4982-93ed-285e72ee14eb"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
actions: [
{
action_id: '01a0422f-e0c4-7820-85a1-31515a321f15',
completed: true,
steps: [
{
step_id: '3f1c8a92-4d5b-4e77-9c21-8ab0f6d21e10',
completed: true,
options: [{option_id: '9d4e2b71-6c8a-4f13-b5d0-1e7a3c9f2b84', completed: true}]
}
]
}
],
project_id: 'or_f45b94ba-5e35-4982-93ed-285e72ee14eb'
})
};
fetch('https://api.peec.ai/customer/v1/actions/steps/completion', 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.peec.ai/customer/v1/actions/steps/completion",
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([
'actions' => [
[
'action_id' => '01a0422f-e0c4-7820-85a1-31515a321f15',
'completed' => true,
'steps' => [
[
'step_id' => '3f1c8a92-4d5b-4e77-9c21-8ab0f6d21e10',
'completed' => true,
'options' => [
[
'option_id' => '9d4e2b71-6c8a-4f13-b5d0-1e7a3c9f2b84',
'completed' => true
]
]
]
]
]
],
'project_id' => 'or_f45b94ba-5e35-4982-93ed-285e72ee14eb'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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.peec.ai/customer/v1/actions/steps/completion"
payload := strings.NewReader("{\n \"actions\": [\n {\n \"action_id\": \"01a0422f-e0c4-7820-85a1-31515a321f15\",\n \"completed\": true,\n \"steps\": [\n {\n \"step_id\": \"3f1c8a92-4d5b-4e77-9c21-8ab0f6d21e10\",\n \"completed\": true,\n \"options\": [\n {\n \"option_id\": \"9d4e2b71-6c8a-4f13-b5d0-1e7a3c9f2b84\",\n \"completed\": true\n }\n ]\n }\n ]\n }\n ],\n \"project_id\": \"or_f45b94ba-5e35-4982-93ed-285e72ee14eb\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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.peec.ai/customer/v1/actions/steps/completion")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"actions\": [\n {\n \"action_id\": \"01a0422f-e0c4-7820-85a1-31515a321f15\",\n \"completed\": true,\n \"steps\": [\n {\n \"step_id\": \"3f1c8a92-4d5b-4e77-9c21-8ab0f6d21e10\",\n \"completed\": true,\n \"options\": [\n {\n \"option_id\": \"9d4e2b71-6c8a-4f13-b5d0-1e7a3c9f2b84\",\n \"completed\": true\n }\n ]\n }\n ]\n }\n ],\n \"project_id\": \"or_f45b94ba-5e35-4982-93ed-285e72ee14eb\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.peec.ai/customer/v1/actions/steps/completion")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"actions\": [\n {\n \"action_id\": \"01a0422f-e0c4-7820-85a1-31515a321f15\",\n \"completed\": true,\n \"steps\": [\n {\n \"step_id\": \"3f1c8a92-4d5b-4e77-9c21-8ab0f6d21e10\",\n \"completed\": true,\n \"options\": [\n {\n \"option_id\": \"9d4e2b71-6c8a-4f13-b5d0-1e7a3c9f2b84\",\n \"completed\": true\n }\n ]\n }\n ]\n }\n ],\n \"project_id\": \"or_f45b94ba-5e35-4982-93ed-285e72ee14eb\"\n}"
response = http.request(request)
puts response.read_body{
"updated": [
{
"action_id": "<string>"
}
],
"skipped": [
{
"action_id": "<string>",
"reason": "not_found"
}
],
"rejected": [
{
"action_id": "<string>",
"reason": "step_not_found",
"message": "<string>"
}
]
}{
"message": "<string>"
}Set Action Step Completion
Record which of an action’s steps are done. Each entry names one action and either sets completed for every step it holds, or lists the steps to write; a step in turn either sets completed for all of its options or names them individually, each with its own value, so one call can tick some and untick others. An action is all or nothing: anything Peec cannot apply leaves every step on it untouched and comes back under skipped or rejected, so a partly-written action is never a state you have to read back. Other actions in the same call are unaffected. The action’s own status is never changed by this endpoint, including when every step on it is complete. An action that is already deleted reads as absent unless the key is a platform admin one. A content optimisation is reachable only on a project with content optimisation enabled; elsewhere its id is returned in skipped.
curl --request POST \
--url https://api.peec.ai/customer/v1/actions/steps/completion \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"actions": [
{
"action_id": "01a0422f-e0c4-7820-85a1-31515a321f15",
"completed": true,
"steps": [
{
"step_id": "3f1c8a92-4d5b-4e77-9c21-8ab0f6d21e10",
"completed": true,
"options": [
{
"option_id": "9d4e2b71-6c8a-4f13-b5d0-1e7a3c9f2b84",
"completed": true
}
]
}
]
}
],
"project_id": "or_f45b94ba-5e35-4982-93ed-285e72ee14eb"
}
'import requests
url = "https://api.peec.ai/customer/v1/actions/steps/completion"
payload = {
"actions": [
{
"action_id": "01a0422f-e0c4-7820-85a1-31515a321f15",
"completed": True,
"steps": [
{
"step_id": "3f1c8a92-4d5b-4e77-9c21-8ab0f6d21e10",
"completed": True,
"options": [
{
"option_id": "9d4e2b71-6c8a-4f13-b5d0-1e7a3c9f2b84",
"completed": True
}
]
}
]
}
],
"project_id": "or_f45b94ba-5e35-4982-93ed-285e72ee14eb"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
actions: [
{
action_id: '01a0422f-e0c4-7820-85a1-31515a321f15',
completed: true,
steps: [
{
step_id: '3f1c8a92-4d5b-4e77-9c21-8ab0f6d21e10',
completed: true,
options: [{option_id: '9d4e2b71-6c8a-4f13-b5d0-1e7a3c9f2b84', completed: true}]
}
]
}
],
project_id: 'or_f45b94ba-5e35-4982-93ed-285e72ee14eb'
})
};
fetch('https://api.peec.ai/customer/v1/actions/steps/completion', 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.peec.ai/customer/v1/actions/steps/completion",
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([
'actions' => [
[
'action_id' => '01a0422f-e0c4-7820-85a1-31515a321f15',
'completed' => true,
'steps' => [
[
'step_id' => '3f1c8a92-4d5b-4e77-9c21-8ab0f6d21e10',
'completed' => true,
'options' => [
[
'option_id' => '9d4e2b71-6c8a-4f13-b5d0-1e7a3c9f2b84',
'completed' => true
]
]
]
]
]
],
'project_id' => 'or_f45b94ba-5e35-4982-93ed-285e72ee14eb'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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.peec.ai/customer/v1/actions/steps/completion"
payload := strings.NewReader("{\n \"actions\": [\n {\n \"action_id\": \"01a0422f-e0c4-7820-85a1-31515a321f15\",\n \"completed\": true,\n \"steps\": [\n {\n \"step_id\": \"3f1c8a92-4d5b-4e77-9c21-8ab0f6d21e10\",\n \"completed\": true,\n \"options\": [\n {\n \"option_id\": \"9d4e2b71-6c8a-4f13-b5d0-1e7a3c9f2b84\",\n \"completed\": true\n }\n ]\n }\n ]\n }\n ],\n \"project_id\": \"or_f45b94ba-5e35-4982-93ed-285e72ee14eb\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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.peec.ai/customer/v1/actions/steps/completion")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"actions\": [\n {\n \"action_id\": \"01a0422f-e0c4-7820-85a1-31515a321f15\",\n \"completed\": true,\n \"steps\": [\n {\n \"step_id\": \"3f1c8a92-4d5b-4e77-9c21-8ab0f6d21e10\",\n \"completed\": true,\n \"options\": [\n {\n \"option_id\": \"9d4e2b71-6c8a-4f13-b5d0-1e7a3c9f2b84\",\n \"completed\": true\n }\n ]\n }\n ]\n }\n ],\n \"project_id\": \"or_f45b94ba-5e35-4982-93ed-285e72ee14eb\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.peec.ai/customer/v1/actions/steps/completion")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"actions\": [\n {\n \"action_id\": \"01a0422f-e0c4-7820-85a1-31515a321f15\",\n \"completed\": true,\n \"steps\": [\n {\n \"step_id\": \"3f1c8a92-4d5b-4e77-9c21-8ab0f6d21e10\",\n \"completed\": true,\n \"options\": [\n {\n \"option_id\": \"9d4e2b71-6c8a-4f13-b5d0-1e7a3c9f2b84\",\n \"completed\": true\n }\n ]\n }\n ]\n }\n ],\n \"project_id\": \"or_f45b94ba-5e35-4982-93ed-285e72ee14eb\"\n}"
response = http.request(request)
puts response.read_body{
"updated": [
{
"action_id": "<string>"
}
],
"skipped": [
{
"action_id": "<string>",
"reason": "not_found"
}
],
"rejected": [
{
"action_id": "<string>",
"reason": "step_not_found",
"message": "<string>"
}
]
}{
"message": "<string>"
}