POST/api/v1/projects/<PROJECT_ID>/variables
Creates a new variable in the specified project. The variable ID is server-generated; omitted fields use schema defaults.
Authentication
Request
- Method: POST
- URL:
https://api.markerkit.com/v1/projects/<PROJECT_ID>/variables
Parameters
name
string Variable name. Default: "Untitled Variable".
type
"primitive""expression""interpolate-color""iterator""primitive-from-iterator""coords-from-data-source""coords-from-iterator""random""custom"Variable type. Default: "primitive".
data_source_id
string Related Data Source ID. Default: "".
iterator_id
string Related Iterator Variable ID. Default: "".
custom_value
string Custom value (for type="custom" or others). Default: "".
expression
string Expression source (for type="expression"). Default: "".
data_path
object Path config for extracting data (for data-driven types). Default: { nodes: [], node_id: "", filters: [], collapsed_nodes: [] }.
color_interpolation_range_start
number Start of color interpolation range. Default: 0.
color_interpolation_range_end
number End of color interpolation range. Default: 100.
color_interpolation_factor_variable_id
string Variable ID used as interpolation factor. Default: "".
color_interpolation_colors
string []Palette colors. Default: [] .
color_interpolation_smooth
boolean Smooth interpolation. Default: true.
random_from
number Random range start (for type="random"). Default: 0.
random_to
number Random range end (for type="random"). Default: 1.
Response
200 OK: The created Variable object.400 Bad Request: Validation failed. Returns a formatted error message.401 Unauthorized: API key is missing or invalid.404 Not Found: Project not found or not accessible by the user.500 Internal Server Error: Failed to create Variable.