curl --request POST \
--url https://api.example.com/v1/models/{model_id}/variables \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"key": "greeting_quality",
"readable_name": "Greeting Quality",
"description": "Evaluates the quality and professionalism of the greeting",
"type": "INTEGER",
"weight": 10,
"required": true,
"order_number": 1,
"category_id": 1
}
'import requests
url = "https://api.example.com/v1/models/{model_id}/variables"
payload = {
"key": "greeting_quality",
"readable_name": "Greeting Quality",
"description": "Evaluates the quality and professionalism of the greeting",
"type": "INTEGER",
"weight": 10,
"required": True,
"order_number": 1,
"category_id": 1
}
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({
key: 'greeting_quality',
readable_name: 'Greeting Quality',
description: 'Evaluates the quality and professionalism of the greeting',
type: 'INTEGER',
weight: 10,
required: true,
order_number: 1,
category_id: 1
})
};
fetch('https://api.example.com/v1/models/{model_id}/variables', 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.example.com/v1/models/{model_id}/variables",
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([
'key' => 'greeting_quality',
'readable_name' => 'Greeting Quality',
'description' => 'Evaluates the quality and professionalism of the greeting',
'type' => 'INTEGER',
'weight' => 10,
'required' => true,
'order_number' => 1,
'category_id' => 1
]),
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.example.com/v1/models/{model_id}/variables"
payload := strings.NewReader("{\n \"key\": \"greeting_quality\",\n \"readable_name\": \"Greeting Quality\",\n \"description\": \"Evaluates the quality and professionalism of the greeting\",\n \"type\": \"INTEGER\",\n \"weight\": 10,\n \"required\": true,\n \"order_number\": 1,\n \"category_id\": 1\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://api.example.com/v1/models/{model_id}/variables")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"key\": \"greeting_quality\",\n \"readable_name\": \"Greeting Quality\",\n \"description\": \"Evaluates the quality and professionalism of the greeting\",\n \"type\": \"INTEGER\",\n \"weight\": 10,\n \"required\": true,\n \"order_number\": 1,\n \"category_id\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/models/{model_id}/variables")
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 \"key\": \"greeting_quality\",\n \"readable_name\": \"Greeting Quality\",\n \"description\": \"Evaluates the quality and professionalism of the greeting\",\n \"type\": \"INTEGER\",\n \"weight\": 10,\n \"required\": true,\n \"order_number\": 1,\n \"category_id\": 1\n}"
response = http.request(request)
puts response.read_body{
"id": 1,
"client_prompt_template_id": 1,
"client_prompt_template_category_id": 1,
"key": "greeting_quality",
"readable_name": "Greeting Quality",
"description": "Evaluates greeting professionalism",
"type": "INTEGER",
"weight": 10,
"required": true,
"order_number": 1,
"enabled": true,
"created_at": "2026-01-11T10:00:00Z",
"created_by": "client_abc123"
}{
"code": "001-001-0001",
"message": "The requested resource was not found"
}{
"code": "001-001-0001",
"message": "The requested resource was not found"
}{
"code": "001-001-0001",
"message": "The requested resource was not found"
}{
"code": "001-001-0001",
"message": "The requested resource was not found"
}Crear Variable
Creates a new variable within the specified analysis model.
Variable keys must be unique within the same model (case-insensitive). If category_id is provided, it must reference an existing category in the same model.
Note: Variables can be added to models that already have call analyses.
Requires scope: write:model-variable
curl --request POST \
--url https://api.example.com/v1/models/{model_id}/variables \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"key": "greeting_quality",
"readable_name": "Greeting Quality",
"description": "Evaluates the quality and professionalism of the greeting",
"type": "INTEGER",
"weight": 10,
"required": true,
"order_number": 1,
"category_id": 1
}
'import requests
url = "https://api.example.com/v1/models/{model_id}/variables"
payload = {
"key": "greeting_quality",
"readable_name": "Greeting Quality",
"description": "Evaluates the quality and professionalism of the greeting",
"type": "INTEGER",
"weight": 10,
"required": True,
"order_number": 1,
"category_id": 1
}
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({
key: 'greeting_quality',
readable_name: 'Greeting Quality',
description: 'Evaluates the quality and professionalism of the greeting',
type: 'INTEGER',
weight: 10,
required: true,
order_number: 1,
category_id: 1
})
};
fetch('https://api.example.com/v1/models/{model_id}/variables', 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.example.com/v1/models/{model_id}/variables",
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([
'key' => 'greeting_quality',
'readable_name' => 'Greeting Quality',
'description' => 'Evaluates the quality and professionalism of the greeting',
'type' => 'INTEGER',
'weight' => 10,
'required' => true,
'order_number' => 1,
'category_id' => 1
]),
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.example.com/v1/models/{model_id}/variables"
payload := strings.NewReader("{\n \"key\": \"greeting_quality\",\n \"readable_name\": \"Greeting Quality\",\n \"description\": \"Evaluates the quality and professionalism of the greeting\",\n \"type\": \"INTEGER\",\n \"weight\": 10,\n \"required\": true,\n \"order_number\": 1,\n \"category_id\": 1\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://api.example.com/v1/models/{model_id}/variables")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"key\": \"greeting_quality\",\n \"readable_name\": \"Greeting Quality\",\n \"description\": \"Evaluates the quality and professionalism of the greeting\",\n \"type\": \"INTEGER\",\n \"weight\": 10,\n \"required\": true,\n \"order_number\": 1,\n \"category_id\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/models/{model_id}/variables")
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 \"key\": \"greeting_quality\",\n \"readable_name\": \"Greeting Quality\",\n \"description\": \"Evaluates the quality and professionalism of the greeting\",\n \"type\": \"INTEGER\",\n \"weight\": 10,\n \"required\": true,\n \"order_number\": 1,\n \"category_id\": 1\n}"
response = http.request(request)
puts response.read_body{
"id": 1,
"client_prompt_template_id": 1,
"client_prompt_template_category_id": 1,
"key": "greeting_quality",
"readable_name": "Greeting Quality",
"description": "Evaluates greeting professionalism",
"type": "INTEGER",
"weight": 10,
"required": true,
"order_number": 1,
"enabled": true,
"created_at": "2026-01-11T10:00:00Z",
"created_by": "client_abc123"
}{
"code": "001-001-0001",
"message": "The requested resource was not found"
}{
"code": "001-001-0001",
"message": "The requested resource was not found"
}{
"code": "001-001-0001",
"message": "The requested resource was not found"
}{
"code": "001-001-0001",
"message": "The requested resource was not found"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The analysis model ID
Body
Request body for creating or updating a variable.
Unique identifier key for this variable within the model
1 - 128"greeting_quality"
Data type: STRING, INTEGER, DECIMAL, BOOLEAN, DATE, TIME, or DATETIME
STRING, INTEGER, DECIMAL, BOOLEAN, DATE, TIME, DATETIME Whether this variable must have a value in analysis results
true
Human-readable display name for UI presentation
128"Greeting Quality"
Description of what this variable measures
256"Evaluates the quality and professionalism of the greeting"
Weight for scoring calculations. Higher weight = more impact on score.
x >= 010
Display order within the category or model
x >= 01
ID of the category this variable belongs to. Must exist in the same model.
1
Response
Successful Response
Response model for variable.
Unique identifier
1
Parent model ID
1
Variable key
"greeting_quality"
Data type
STRING, INTEGER, DECIMAL, BOOLEAN, DATE, TIME, DATETIME Whether this variable is required
Whether the variable is active
Creation timestamp
Creator identifier
Category ID if assigned
Human-readable display name
Variable description
Scoring weight
Display order
Last update timestamp
Last updater identifier
