Skip to main content
PATCH
/
v4
/
variables
/
{variableId}
Update a variable
curl --request PATCH \
  --url https://api.kadoa.com/v4/variables/{variableId} \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "key": "<string>",
  "value": "<string>",
  "dataType": "STRING"
}
'
import requests

url = "https://api.kadoa.com/v4/variables/{variableId}"

payload = {
"key": "<string>",
"value": "<string>",
"dataType": "STRING"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'PATCH',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({key: '<string>', value: '<string>', dataType: 'STRING'})
};

fetch('https://api.kadoa.com/v4/variables/{variableId}', 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.kadoa.com/v4/variables/{variableId}",
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([
'key' => '<string>',
'value' => '<string>',
'dataType' => 'STRING'
]),
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.kadoa.com/v4/variables/{variableId}"

payload := strings.NewReader("{\n \"key\": \"<string>\",\n \"value\": \"<string>\",\n \"dataType\": \"STRING\"\n}")

req, _ := http.NewRequest("PATCH", 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.patch("https://api.kadoa.com/v4/variables/{variableId}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"key\": \"<string>\",\n \"value\": \"<string>\",\n \"dataType\": \"STRING\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.kadoa.com/v4/variables/{variableId}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"key\": \"<string>\",\n \"value\": \"<string>\",\n \"dataType\": \"STRING\"\n}"

response = http.request(request)
puts response.read_body
{
  "variable": {
    "id": "<string>",
    "key": "<string>",
    "value": "<string>",
    "createdAt": "<string>",
    "dataType": "STRING",
    "updatedAt": "<string>"
  },
  "error": "<string>"
}
{
"error": true,
"message": "<string>",
"details": "<unknown>"
}
{
"error": true,
"message": "<string>",
"details": "<unknown>"
}
{
"error": true,
"message": "<string>",
"details": "<unknown>"
}
{
"error": true,
"message": "<string>",
"details": "<unknown>"
}
{
"error": true,
"message": "<string>",
"details": "<unknown>"
}
{
"error": true,
"message": "<string>",
"details": "<unknown>"
}

Authorizations

x-api-key
string
header
required

API key for authentication

Path Parameters

variableId
string
required

Variable ID

Body

application/json

Body

Request body for updating a variable (at least one field required)

key
string

New variable key

Minimum string length: 1
value
string

New variable value

dataType
enum<string>
default:STRING

The data type of the variable value

Available options:
STRING,
SECRET,
OBJECT,
ARRAY,
NUMBER

Response

200

Response containing a single variable

variable
Variable · object | null
required

A key-value variable scoped to a team or user

error
string | null
required