curl --request PATCH \
--url https://api.usertour.io/v2/projects/{projectId}/content/{contentId}/versions/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"steps": [
{
"name": "<string>",
"id": "<string>",
"cvid": "<string>",
"key": "<string>",
"sequence": 123,
"themeId": "<string>",
"placement": {
"sideOffset": 123,
"alignOffset": 123,
"backdrop": true,
"blockTarget": true
},
"width": 123,
"skippable": true,
"explicitCompletionStep": true,
"content": [
{
"type": "text",
"markdown": "<string>",
"object": "block",
"id": "<string>"
}
],
"triggers": [
{
"do": [
{
"type": "goto_step",
"step": "<string>"
}
],
"when": [
{
"type": "group",
"conditions": "<array>"
}
],
"waitSeconds": 123
}
],
"onClick": [
{
"type": "goto_step",
"step": "<string>"
}
]
}
],
"startRules": {
"when": [
{
"type": "group",
"conditions": "<array>"
}
],
"waitSeconds": 123,
"startIfNotComplete": true
},
"hideRules": {
"when": [
{
"type": "group",
"conditions": "<array>"
}
]
},
"themeId": "<string>",
"data": {
"buttonText": "<string>",
"preventDismiss": true,
"autoDismiss": true,
"content": [
{
"type": "text",
"markdown": "<string>",
"object": "block",
"id": "<string>"
}
],
"items": [
{
"name": "<string>",
"id": "<string>",
"description": "<string>",
"completeWhen": [],
"clickActions": [],
"onlyShowWhen": [
{
"type": "group",
"conditions": "<array>"
}
]
}
]
},
"scheduledAt": "<string>"
}
'import requests
url = "https://api.usertour.io/v2/projects/{projectId}/content/{contentId}/versions/{id}"
payload = {
"steps": [
{
"name": "<string>",
"id": "<string>",
"cvid": "<string>",
"key": "<string>",
"sequence": 123,
"themeId": "<string>",
"placement": {
"sideOffset": 123,
"alignOffset": 123,
"backdrop": True,
"blockTarget": True
},
"width": 123,
"skippable": True,
"explicitCompletionStep": True,
"content": [
{
"type": "text",
"markdown": "<string>",
"object": "block",
"id": "<string>"
}
],
"triggers": [
{
"do": [
{
"type": "goto_step",
"step": "<string>"
}
],
"when": [
{
"type": "group",
"conditions": "<array>"
}
],
"waitSeconds": 123
}
],
"onClick": [
{
"type": "goto_step",
"step": "<string>"
}
]
}
],
"startRules": {
"when": [
{
"type": "group",
"conditions": "<array>"
}
],
"waitSeconds": 123,
"startIfNotComplete": True
},
"hideRules": { "when": [
{
"type": "group",
"conditions": "<array>"
}
] },
"themeId": "<string>",
"data": {
"buttonText": "<string>",
"preventDismiss": True,
"autoDismiss": True,
"content": [
{
"type": "text",
"markdown": "<string>",
"object": "block",
"id": "<string>"
}
],
"items": [
{
"name": "<string>",
"id": "<string>",
"description": "<string>",
"completeWhen": [],
"clickActions": [],
"onlyShowWhen": [
{
"type": "group",
"conditions": "<array>"
}
]
}
]
},
"scheduledAt": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
steps: [
{
name: '<string>',
id: '<string>',
cvid: '<string>',
key: '<string>',
sequence: 123,
themeId: '<string>',
placement: {sideOffset: 123, alignOffset: 123, backdrop: true, blockTarget: true},
width: 123,
skippable: true,
explicitCompletionStep: true,
content: [{type: 'text', markdown: '<string>', object: 'block', id: '<string>'}],
triggers: [
{
do: [{type: 'goto_step', step: '<string>'}],
when: [{type: 'group', conditions: '<array>'}],
waitSeconds: 123
}
],
onClick: [{type: 'goto_step', step: '<string>'}]
}
],
startRules: {
when: [{type: 'group', conditions: '<array>'}],
waitSeconds: 123,
startIfNotComplete: true
},
hideRules: {when: [{type: 'group', conditions: '<array>'}]},
themeId: '<string>',
data: {
buttonText: '<string>',
preventDismiss: true,
autoDismiss: true,
content: [{type: 'text', markdown: '<string>', object: 'block', id: '<string>'}],
items: [
{
name: '<string>',
id: '<string>',
description: '<string>',
completeWhen: [],
clickActions: [],
onlyShowWhen: [{type: 'group', conditions: '<array>'}]
}
]
},
scheduledAt: '<string>'
})
};
fetch('https://api.usertour.io/v2/projects/{projectId}/content/{contentId}/versions/{id}', 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.usertour.io/v2/projects/{projectId}/content/{contentId}/versions/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'steps' => [
[
'name' => '<string>',
'id' => '<string>',
'cvid' => '<string>',
'key' => '<string>',
'sequence' => 123,
'themeId' => '<string>',
'placement' => [
'sideOffset' => 123,
'alignOffset' => 123,
'backdrop' => true,
'blockTarget' => true
],
'width' => 123,
'skippable' => true,
'explicitCompletionStep' => true,
'content' => [
[
'type' => 'text',
'markdown' => '<string>',
'object' => 'block',
'id' => '<string>'
]
],
'triggers' => [
[
'do' => [
[
'type' => 'goto_step',
'step' => '<string>'
]
],
'when' => [
[
'type' => 'group',
'conditions' => '<array>'
]
],
'waitSeconds' => 123
]
],
'onClick' => [
[
'type' => 'goto_step',
'step' => '<string>'
]
]
]
],
'startRules' => [
'when' => [
[
'type' => 'group',
'conditions' => '<array>'
]
],
'waitSeconds' => 123,
'startIfNotComplete' => true
],
'hideRules' => [
'when' => [
[
'type' => 'group',
'conditions' => '<array>'
]
]
],
'themeId' => '<string>',
'data' => [
'buttonText' => '<string>',
'preventDismiss' => true,
'autoDismiss' => true,
'content' => [
[
'type' => 'text',
'markdown' => '<string>',
'object' => 'block',
'id' => '<string>'
]
],
'items' => [
[
'name' => '<string>',
'id' => '<string>',
'description' => '<string>',
'completeWhen' => [
],
'clickActions' => [
],
'onlyShowWhen' => [
[
'type' => 'group',
'conditions' => '<array>'
]
]
]
]
],
'scheduledAt' => '<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://api.usertour.io/v2/projects/{projectId}/content/{contentId}/versions/{id}"
payload := strings.NewReader("{\n \"steps\": [\n {\n \"name\": \"<string>\",\n \"id\": \"<string>\",\n \"cvid\": \"<string>\",\n \"key\": \"<string>\",\n \"sequence\": 123,\n \"themeId\": \"<string>\",\n \"placement\": {\n \"sideOffset\": 123,\n \"alignOffset\": 123,\n \"backdrop\": true,\n \"blockTarget\": true\n },\n \"width\": 123,\n \"skippable\": true,\n \"explicitCompletionStep\": true,\n \"content\": [\n {\n \"type\": \"text\",\n \"markdown\": \"<string>\",\n \"object\": \"block\",\n \"id\": \"<string>\"\n }\n ],\n \"triggers\": [\n {\n \"do\": [\n {\n \"type\": \"goto_step\",\n \"step\": \"<string>\"\n }\n ],\n \"when\": [\n {\n \"type\": \"group\",\n \"conditions\": \"<array>\"\n }\n ],\n \"waitSeconds\": 123\n }\n ],\n \"onClick\": [\n {\n \"type\": \"goto_step\",\n \"step\": \"<string>\"\n }\n ]\n }\n ],\n \"startRules\": {\n \"when\": [\n {\n \"type\": \"group\",\n \"conditions\": \"<array>\"\n }\n ],\n \"waitSeconds\": 123,\n \"startIfNotComplete\": true\n },\n \"hideRules\": {\n \"when\": [\n {\n \"type\": \"group\",\n \"conditions\": \"<array>\"\n }\n ]\n },\n \"themeId\": \"<string>\",\n \"data\": {\n \"buttonText\": \"<string>\",\n \"preventDismiss\": true,\n \"autoDismiss\": true,\n \"content\": [\n {\n \"type\": \"text\",\n \"markdown\": \"<string>\",\n \"object\": \"block\",\n \"id\": \"<string>\"\n }\n ],\n \"items\": [\n {\n \"name\": \"<string>\",\n \"id\": \"<string>\",\n \"description\": \"<string>\",\n \"completeWhen\": [],\n \"clickActions\": [],\n \"onlyShowWhen\": [\n {\n \"type\": \"group\",\n \"conditions\": \"<array>\"\n }\n ]\n }\n ]\n },\n \"scheduledAt\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.usertour.io/v2/projects/{projectId}/content/{contentId}/versions/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"steps\": [\n {\n \"name\": \"<string>\",\n \"id\": \"<string>\",\n \"cvid\": \"<string>\",\n \"key\": \"<string>\",\n \"sequence\": 123,\n \"themeId\": \"<string>\",\n \"placement\": {\n \"sideOffset\": 123,\n \"alignOffset\": 123,\n \"backdrop\": true,\n \"blockTarget\": true\n },\n \"width\": 123,\n \"skippable\": true,\n \"explicitCompletionStep\": true,\n \"content\": [\n {\n \"type\": \"text\",\n \"markdown\": \"<string>\",\n \"object\": \"block\",\n \"id\": \"<string>\"\n }\n ],\n \"triggers\": [\n {\n \"do\": [\n {\n \"type\": \"goto_step\",\n \"step\": \"<string>\"\n }\n ],\n \"when\": [\n {\n \"type\": \"group\",\n \"conditions\": \"<array>\"\n }\n ],\n \"waitSeconds\": 123\n }\n ],\n \"onClick\": [\n {\n \"type\": \"goto_step\",\n \"step\": \"<string>\"\n }\n ]\n }\n ],\n \"startRules\": {\n \"when\": [\n {\n \"type\": \"group\",\n \"conditions\": \"<array>\"\n }\n ],\n \"waitSeconds\": 123,\n \"startIfNotComplete\": true\n },\n \"hideRules\": {\n \"when\": [\n {\n \"type\": \"group\",\n \"conditions\": \"<array>\"\n }\n ]\n },\n \"themeId\": \"<string>\",\n \"data\": {\n \"buttonText\": \"<string>\",\n \"preventDismiss\": true,\n \"autoDismiss\": true,\n \"content\": [\n {\n \"type\": \"text\",\n \"markdown\": \"<string>\",\n \"object\": \"block\",\n \"id\": \"<string>\"\n }\n ],\n \"items\": [\n {\n \"name\": \"<string>\",\n \"id\": \"<string>\",\n \"description\": \"<string>\",\n \"completeWhen\": [],\n \"clickActions\": [],\n \"onlyShowWhen\": [\n {\n \"type\": \"group\",\n \"conditions\": \"<array>\"\n }\n ]\n }\n ]\n },\n \"scheduledAt\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.usertour.io/v2/projects/{projectId}/content/{contentId}/versions/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"steps\": [\n {\n \"name\": \"<string>\",\n \"id\": \"<string>\",\n \"cvid\": \"<string>\",\n \"key\": \"<string>\",\n \"sequence\": 123,\n \"themeId\": \"<string>\",\n \"placement\": {\n \"sideOffset\": 123,\n \"alignOffset\": 123,\n \"backdrop\": true,\n \"blockTarget\": true\n },\n \"width\": 123,\n \"skippable\": true,\n \"explicitCompletionStep\": true,\n \"content\": [\n {\n \"type\": \"text\",\n \"markdown\": \"<string>\",\n \"object\": \"block\",\n \"id\": \"<string>\"\n }\n ],\n \"triggers\": [\n {\n \"do\": [\n {\n \"type\": \"goto_step\",\n \"step\": \"<string>\"\n }\n ],\n \"when\": [\n {\n \"type\": \"group\",\n \"conditions\": \"<array>\"\n }\n ],\n \"waitSeconds\": 123\n }\n ],\n \"onClick\": [\n {\n \"type\": \"goto_step\",\n \"step\": \"<string>\"\n }\n ]\n }\n ],\n \"startRules\": {\n \"when\": [\n {\n \"type\": \"group\",\n \"conditions\": \"<array>\"\n }\n ],\n \"waitSeconds\": 123,\n \"startIfNotComplete\": true\n },\n \"hideRules\": {\n \"when\": [\n {\n \"type\": \"group\",\n \"conditions\": \"<array>\"\n }\n ]\n },\n \"themeId\": \"<string>\",\n \"data\": {\n \"buttonText\": \"<string>\",\n \"preventDismiss\": true,\n \"autoDismiss\": true,\n \"content\": [\n {\n \"type\": \"text\",\n \"markdown\": \"<string>\",\n \"object\": \"block\",\n \"id\": \"<string>\"\n }\n ],\n \"items\": [\n {\n \"name\": \"<string>\",\n \"id\": \"<string>\",\n \"description\": \"<string>\",\n \"completeWhen\": [],\n \"clickActions\": [],\n \"onlyShowWhen\": [\n {\n \"type\": \"group\",\n \"conditions\": \"<array>\"\n }\n ]\n }\n ]\n },\n \"scheduledAt\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "contentVersion",
"number": 123,
"firstPublishedAt": "<string>",
"themeId": "<string>",
"questions": [
{
"object": "question",
"cvid": "<string>",
"name": "<string>"
}
],
"updatedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"steps": [
{
"object": "step",
"id": "<string>",
"cvid": "<string>",
"name": "<string>",
"sequence": 123,
"themeId": "<string>",
"content": [
{
"type": "text",
"markdown": "<string>",
"object": "block",
"id": "<string>"
}
],
"target": {
"selector": "<string>",
"text": "<string>",
"nth": 2
},
"placement": {
"sideOffset": 123,
"alignOffset": 123,
"backdrop": true,
"blockTarget": true
},
"width": 123,
"skippable": true,
"explicitCompletionStep": true,
"triggers": [
{
"do": [
{
"type": "goto_step",
"step": "<string>"
}
],
"when": [
{
"type": "group",
"conditions": "<array>"
}
],
"waitSeconds": 123
}
],
"onClick": [
{
"type": "goto_step",
"step": "<string>"
}
],
"advanced": {
"hasUnsupported": true
}
}
],
"startRules": {
"when": [
{
"type": "group",
"conditions": "<array>"
}
],
"frequency": {
"every": {
"duration": 123,
"times": 123
},
"atLeast": {
"duration": 123
}
},
"waitSeconds": 123,
"startIfNotComplete": true
},
"hideRules": {
"when": [
{
"type": "group",
"conditions": "<array>"
}
]
},
"data": "<unknown>",
"scheduledAt": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"issues": [
{
"rule": "<string>",
"message": "<string>",
"path": "<string>"
}
],
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"issues": [
{
"rule": "<string>",
"message": "<string>",
"path": "<string>"
}
],
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"issues": [
{
"rule": "<string>",
"message": "<string>",
"path": "<string>"
}
],
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"issues": [
{
"rule": "<string>",
"message": "<string>",
"path": "<string>"
}
],
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"issues": [
{
"rule": "<string>",
"message": "<string>",
"path": "<string>"
}
],
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"issues": [
{
"rule": "<string>",
"message": "<string>",
"path": "<string>"
}
],
"doc_url": "<string>"
}
}Update a content version
Write steps, start/hide rules, themeId, or type-specific data to a draft version.
curl --request PATCH \
--url https://api.usertour.io/v2/projects/{projectId}/content/{contentId}/versions/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"steps": [
{
"name": "<string>",
"id": "<string>",
"cvid": "<string>",
"key": "<string>",
"sequence": 123,
"themeId": "<string>",
"placement": {
"sideOffset": 123,
"alignOffset": 123,
"backdrop": true,
"blockTarget": true
},
"width": 123,
"skippable": true,
"explicitCompletionStep": true,
"content": [
{
"type": "text",
"markdown": "<string>",
"object": "block",
"id": "<string>"
}
],
"triggers": [
{
"do": [
{
"type": "goto_step",
"step": "<string>"
}
],
"when": [
{
"type": "group",
"conditions": "<array>"
}
],
"waitSeconds": 123
}
],
"onClick": [
{
"type": "goto_step",
"step": "<string>"
}
]
}
],
"startRules": {
"when": [
{
"type": "group",
"conditions": "<array>"
}
],
"waitSeconds": 123,
"startIfNotComplete": true
},
"hideRules": {
"when": [
{
"type": "group",
"conditions": "<array>"
}
]
},
"themeId": "<string>",
"data": {
"buttonText": "<string>",
"preventDismiss": true,
"autoDismiss": true,
"content": [
{
"type": "text",
"markdown": "<string>",
"object": "block",
"id": "<string>"
}
],
"items": [
{
"name": "<string>",
"id": "<string>",
"description": "<string>",
"completeWhen": [],
"clickActions": [],
"onlyShowWhen": [
{
"type": "group",
"conditions": "<array>"
}
]
}
]
},
"scheduledAt": "<string>"
}
'import requests
url = "https://api.usertour.io/v2/projects/{projectId}/content/{contentId}/versions/{id}"
payload = {
"steps": [
{
"name": "<string>",
"id": "<string>",
"cvid": "<string>",
"key": "<string>",
"sequence": 123,
"themeId": "<string>",
"placement": {
"sideOffset": 123,
"alignOffset": 123,
"backdrop": True,
"blockTarget": True
},
"width": 123,
"skippable": True,
"explicitCompletionStep": True,
"content": [
{
"type": "text",
"markdown": "<string>",
"object": "block",
"id": "<string>"
}
],
"triggers": [
{
"do": [
{
"type": "goto_step",
"step": "<string>"
}
],
"when": [
{
"type": "group",
"conditions": "<array>"
}
],
"waitSeconds": 123
}
],
"onClick": [
{
"type": "goto_step",
"step": "<string>"
}
]
}
],
"startRules": {
"when": [
{
"type": "group",
"conditions": "<array>"
}
],
"waitSeconds": 123,
"startIfNotComplete": True
},
"hideRules": { "when": [
{
"type": "group",
"conditions": "<array>"
}
] },
"themeId": "<string>",
"data": {
"buttonText": "<string>",
"preventDismiss": True,
"autoDismiss": True,
"content": [
{
"type": "text",
"markdown": "<string>",
"object": "block",
"id": "<string>"
}
],
"items": [
{
"name": "<string>",
"id": "<string>",
"description": "<string>",
"completeWhen": [],
"clickActions": [],
"onlyShowWhen": [
{
"type": "group",
"conditions": "<array>"
}
]
}
]
},
"scheduledAt": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
steps: [
{
name: '<string>',
id: '<string>',
cvid: '<string>',
key: '<string>',
sequence: 123,
themeId: '<string>',
placement: {sideOffset: 123, alignOffset: 123, backdrop: true, blockTarget: true},
width: 123,
skippable: true,
explicitCompletionStep: true,
content: [{type: 'text', markdown: '<string>', object: 'block', id: '<string>'}],
triggers: [
{
do: [{type: 'goto_step', step: '<string>'}],
when: [{type: 'group', conditions: '<array>'}],
waitSeconds: 123
}
],
onClick: [{type: 'goto_step', step: '<string>'}]
}
],
startRules: {
when: [{type: 'group', conditions: '<array>'}],
waitSeconds: 123,
startIfNotComplete: true
},
hideRules: {when: [{type: 'group', conditions: '<array>'}]},
themeId: '<string>',
data: {
buttonText: '<string>',
preventDismiss: true,
autoDismiss: true,
content: [{type: 'text', markdown: '<string>', object: 'block', id: '<string>'}],
items: [
{
name: '<string>',
id: '<string>',
description: '<string>',
completeWhen: [],
clickActions: [],
onlyShowWhen: [{type: 'group', conditions: '<array>'}]
}
]
},
scheduledAt: '<string>'
})
};
fetch('https://api.usertour.io/v2/projects/{projectId}/content/{contentId}/versions/{id}', 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.usertour.io/v2/projects/{projectId}/content/{contentId}/versions/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'steps' => [
[
'name' => '<string>',
'id' => '<string>',
'cvid' => '<string>',
'key' => '<string>',
'sequence' => 123,
'themeId' => '<string>',
'placement' => [
'sideOffset' => 123,
'alignOffset' => 123,
'backdrop' => true,
'blockTarget' => true
],
'width' => 123,
'skippable' => true,
'explicitCompletionStep' => true,
'content' => [
[
'type' => 'text',
'markdown' => '<string>',
'object' => 'block',
'id' => '<string>'
]
],
'triggers' => [
[
'do' => [
[
'type' => 'goto_step',
'step' => '<string>'
]
],
'when' => [
[
'type' => 'group',
'conditions' => '<array>'
]
],
'waitSeconds' => 123
]
],
'onClick' => [
[
'type' => 'goto_step',
'step' => '<string>'
]
]
]
],
'startRules' => [
'when' => [
[
'type' => 'group',
'conditions' => '<array>'
]
],
'waitSeconds' => 123,
'startIfNotComplete' => true
],
'hideRules' => [
'when' => [
[
'type' => 'group',
'conditions' => '<array>'
]
]
],
'themeId' => '<string>',
'data' => [
'buttonText' => '<string>',
'preventDismiss' => true,
'autoDismiss' => true,
'content' => [
[
'type' => 'text',
'markdown' => '<string>',
'object' => 'block',
'id' => '<string>'
]
],
'items' => [
[
'name' => '<string>',
'id' => '<string>',
'description' => '<string>',
'completeWhen' => [
],
'clickActions' => [
],
'onlyShowWhen' => [
[
'type' => 'group',
'conditions' => '<array>'
]
]
]
]
],
'scheduledAt' => '<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://api.usertour.io/v2/projects/{projectId}/content/{contentId}/versions/{id}"
payload := strings.NewReader("{\n \"steps\": [\n {\n \"name\": \"<string>\",\n \"id\": \"<string>\",\n \"cvid\": \"<string>\",\n \"key\": \"<string>\",\n \"sequence\": 123,\n \"themeId\": \"<string>\",\n \"placement\": {\n \"sideOffset\": 123,\n \"alignOffset\": 123,\n \"backdrop\": true,\n \"blockTarget\": true\n },\n \"width\": 123,\n \"skippable\": true,\n \"explicitCompletionStep\": true,\n \"content\": [\n {\n \"type\": \"text\",\n \"markdown\": \"<string>\",\n \"object\": \"block\",\n \"id\": \"<string>\"\n }\n ],\n \"triggers\": [\n {\n \"do\": [\n {\n \"type\": \"goto_step\",\n \"step\": \"<string>\"\n }\n ],\n \"when\": [\n {\n \"type\": \"group\",\n \"conditions\": \"<array>\"\n }\n ],\n \"waitSeconds\": 123\n }\n ],\n \"onClick\": [\n {\n \"type\": \"goto_step\",\n \"step\": \"<string>\"\n }\n ]\n }\n ],\n \"startRules\": {\n \"when\": [\n {\n \"type\": \"group\",\n \"conditions\": \"<array>\"\n }\n ],\n \"waitSeconds\": 123,\n \"startIfNotComplete\": true\n },\n \"hideRules\": {\n \"when\": [\n {\n \"type\": \"group\",\n \"conditions\": \"<array>\"\n }\n ]\n },\n \"themeId\": \"<string>\",\n \"data\": {\n \"buttonText\": \"<string>\",\n \"preventDismiss\": true,\n \"autoDismiss\": true,\n \"content\": [\n {\n \"type\": \"text\",\n \"markdown\": \"<string>\",\n \"object\": \"block\",\n \"id\": \"<string>\"\n }\n ],\n \"items\": [\n {\n \"name\": \"<string>\",\n \"id\": \"<string>\",\n \"description\": \"<string>\",\n \"completeWhen\": [],\n \"clickActions\": [],\n \"onlyShowWhen\": [\n {\n \"type\": \"group\",\n \"conditions\": \"<array>\"\n }\n ]\n }\n ]\n },\n \"scheduledAt\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.usertour.io/v2/projects/{projectId}/content/{contentId}/versions/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"steps\": [\n {\n \"name\": \"<string>\",\n \"id\": \"<string>\",\n \"cvid\": \"<string>\",\n \"key\": \"<string>\",\n \"sequence\": 123,\n \"themeId\": \"<string>\",\n \"placement\": {\n \"sideOffset\": 123,\n \"alignOffset\": 123,\n \"backdrop\": true,\n \"blockTarget\": true\n },\n \"width\": 123,\n \"skippable\": true,\n \"explicitCompletionStep\": true,\n \"content\": [\n {\n \"type\": \"text\",\n \"markdown\": \"<string>\",\n \"object\": \"block\",\n \"id\": \"<string>\"\n }\n ],\n \"triggers\": [\n {\n \"do\": [\n {\n \"type\": \"goto_step\",\n \"step\": \"<string>\"\n }\n ],\n \"when\": [\n {\n \"type\": \"group\",\n \"conditions\": \"<array>\"\n }\n ],\n \"waitSeconds\": 123\n }\n ],\n \"onClick\": [\n {\n \"type\": \"goto_step\",\n \"step\": \"<string>\"\n }\n ]\n }\n ],\n \"startRules\": {\n \"when\": [\n {\n \"type\": \"group\",\n \"conditions\": \"<array>\"\n }\n ],\n \"waitSeconds\": 123,\n \"startIfNotComplete\": true\n },\n \"hideRules\": {\n \"when\": [\n {\n \"type\": \"group\",\n \"conditions\": \"<array>\"\n }\n ]\n },\n \"themeId\": \"<string>\",\n \"data\": {\n \"buttonText\": \"<string>\",\n \"preventDismiss\": true,\n \"autoDismiss\": true,\n \"content\": [\n {\n \"type\": \"text\",\n \"markdown\": \"<string>\",\n \"object\": \"block\",\n \"id\": \"<string>\"\n }\n ],\n \"items\": [\n {\n \"name\": \"<string>\",\n \"id\": \"<string>\",\n \"description\": \"<string>\",\n \"completeWhen\": [],\n \"clickActions\": [],\n \"onlyShowWhen\": [\n {\n \"type\": \"group\",\n \"conditions\": \"<array>\"\n }\n ]\n }\n ]\n },\n \"scheduledAt\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.usertour.io/v2/projects/{projectId}/content/{contentId}/versions/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"steps\": [\n {\n \"name\": \"<string>\",\n \"id\": \"<string>\",\n \"cvid\": \"<string>\",\n \"key\": \"<string>\",\n \"sequence\": 123,\n \"themeId\": \"<string>\",\n \"placement\": {\n \"sideOffset\": 123,\n \"alignOffset\": 123,\n \"backdrop\": true,\n \"blockTarget\": true\n },\n \"width\": 123,\n \"skippable\": true,\n \"explicitCompletionStep\": true,\n \"content\": [\n {\n \"type\": \"text\",\n \"markdown\": \"<string>\",\n \"object\": \"block\",\n \"id\": \"<string>\"\n }\n ],\n \"triggers\": [\n {\n \"do\": [\n {\n \"type\": \"goto_step\",\n \"step\": \"<string>\"\n }\n ],\n \"when\": [\n {\n \"type\": \"group\",\n \"conditions\": \"<array>\"\n }\n ],\n \"waitSeconds\": 123\n }\n ],\n \"onClick\": [\n {\n \"type\": \"goto_step\",\n \"step\": \"<string>\"\n }\n ]\n }\n ],\n \"startRules\": {\n \"when\": [\n {\n \"type\": \"group\",\n \"conditions\": \"<array>\"\n }\n ],\n \"waitSeconds\": 123,\n \"startIfNotComplete\": true\n },\n \"hideRules\": {\n \"when\": [\n {\n \"type\": \"group\",\n \"conditions\": \"<array>\"\n }\n ]\n },\n \"themeId\": \"<string>\",\n \"data\": {\n \"buttonText\": \"<string>\",\n \"preventDismiss\": true,\n \"autoDismiss\": true,\n \"content\": [\n {\n \"type\": \"text\",\n \"markdown\": \"<string>\",\n \"object\": \"block\",\n \"id\": \"<string>\"\n }\n ],\n \"items\": [\n {\n \"name\": \"<string>\",\n \"id\": \"<string>\",\n \"description\": \"<string>\",\n \"completeWhen\": [],\n \"clickActions\": [],\n \"onlyShowWhen\": [\n {\n \"type\": \"group\",\n \"conditions\": \"<array>\"\n }\n ]\n }\n ]\n },\n \"scheduledAt\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "contentVersion",
"number": 123,
"firstPublishedAt": "<string>",
"themeId": "<string>",
"questions": [
{
"object": "question",
"cvid": "<string>",
"name": "<string>"
}
],
"updatedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"steps": [
{
"object": "step",
"id": "<string>",
"cvid": "<string>",
"name": "<string>",
"sequence": 123,
"themeId": "<string>",
"content": [
{
"type": "text",
"markdown": "<string>",
"object": "block",
"id": "<string>"
}
],
"target": {
"selector": "<string>",
"text": "<string>",
"nth": 2
},
"placement": {
"sideOffset": 123,
"alignOffset": 123,
"backdrop": true,
"blockTarget": true
},
"width": 123,
"skippable": true,
"explicitCompletionStep": true,
"triggers": [
{
"do": [
{
"type": "goto_step",
"step": "<string>"
}
],
"when": [
{
"type": "group",
"conditions": "<array>"
}
],
"waitSeconds": 123
}
],
"onClick": [
{
"type": "goto_step",
"step": "<string>"
}
],
"advanced": {
"hasUnsupported": true
}
}
],
"startRules": {
"when": [
{
"type": "group",
"conditions": "<array>"
}
],
"frequency": {
"every": {
"duration": 123,
"times": 123
},
"atLeast": {
"duration": 123
}
},
"waitSeconds": 123,
"startIfNotComplete": true
},
"hideRules": {
"when": [
{
"type": "group",
"conditions": "<array>"
}
]
},
"data": "<unknown>",
"scheduledAt": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"issues": [
{
"rule": "<string>",
"message": "<string>",
"path": "<string>"
}
],
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"issues": [
{
"rule": "<string>",
"message": "<string>",
"path": "<string>"
}
],
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"issues": [
{
"rule": "<string>",
"message": "<string>",
"path": "<string>"
}
],
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"issues": [
{
"rule": "<string>",
"message": "<string>",
"path": "<string>"
}
],
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"issues": [
{
"rule": "<string>",
"message": "<string>",
"path": "<string>"
}
],
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"issues": [
{
"rule": "<string>",
"message": "<string>",
"path": "<string>"
}
],
"doc_url": "<string>"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Content version ID
Content ID
Project ID
Body
Show child attributes
Show child attributes
PATCHES the stored rules field-by-field: an omitted setting (frequency / priority / waitSeconds / startIfNotComplete) keeps its stored value — including one inherited from the forked version — so to turn a setting off, send it explicitly (e.g. startIfNotComplete: false). when, when present, fully replaces the condition list. null clears the rules entirely (content stops auto-starting). Which settings and which when condition types the CONTENT TYPE supports varies (e.g. no priority on a launcher, attribute/segment-only targeting on an announcement) — unsupported ones are rejected per type.
Show child attributes
Show child attributes
Temporarily-hide rules. Only some content types support them (rejected per type).
Show child attributes
Show child attributes
Theme to apply (cannot be cleared).
Type-specific body for a non-flow content version: checklist / launcher / banner / tracker / announcement / resource-center. Field-level merged onto the existing data.
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
Show child attributes
Show child attributes
Announcement versions only: the "announcement time" — the feed hides the announcement until this instant passes, and orders the feed by it (newest first). ISO date or datetime WITH timezone. null = clear (publish stamps the publish time instead). A future value defers visibility; the value carries across version forks.
Response
Updated content version
contentVersion When this version FIRST went live (ISO). Non-null means the version is frozen: it can never be edited again — not even after unpublishing — edit by forking (by forking). null means it never went live — OR its first publish predates this stamp (older versions were never backfilled), so on old data null is not proof it never shipped. This is history, not live state: for "is it live NOW, where" read the content's environments[]; for who published what when, the publish history (available through the MCP).
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
While when matches, on-screen content of this version is hidden — the session is SUSPENDED, not ended: when the conditions stop matching the same session reappears at the same step. Use start-rule conditions to keep content from starting; use hide rules to blank it in specific places (e.g. a settings page).
Show child attributes
Show child attributes
Decompiled type-specific body for non-flow content — the same six per-type shapes as the write data (that schema is the field dictionary), fully populated on read. Present only when the data expand is requested; a flow has no data — its body is steps.
Announcement versions only: the "announcement time" gating feed visibility and ordering. Absent on other content types and until set (publish stamps it when the author left it null, so published announcements always carry one).