/v1/projects/{project_id}/agent-variablesCreate an Agent VariableCreates a new template variable. Variables follow the DG_<VARIABLE_NAME> naming format and can substitute any JSON value in an agent configuration.
Parameters
project_idstringpathrequiredThe unique identifier of the project
Request body
Agent variable details
application/json
CreateAgentVariableV1Request
Request body for creating an agent variable
api_versionintegerAPI version. Defaults to 1
keystringrequiredThe variable name, following the DG_<VARIABLE_NAME> format
valuevaluerequiredThe value to substitute. Can be any valid JSON type (string, number, boolean, object, or array)
{
"api_version": 1,
"key": "string",
"value": null
}Responses
AgentVariableV1
A template variable for agent configurations
created_atstring · date-timeTimestamp when the variable was created
keystringrequiredThe variable name, following the DG_<VARIABLE_NAME> format
updated_atstring · date-timeTimestamp when the variable was last updated
valuevaluerequiredThe value to substitute. Can be any valid JSON type
variable_idstringrequiredThe unique identifier of the variable
{
"created_at": "2026-06-09T00:00:00Z",
"key": "string",
"updated_at": "2026-06-09T00:00:00Z",
"value": null,
"variable_id": "string"
}ErrorResponse
oneOf · 3 options
ErrorResponseTextError
ErrorResponseLegacyError
err_codestringThe error code
err_msgstringThe error message
request_idstringThe request ID
ErrorResponseModernError
categorystringThe category of the error
detailsstringA description of the error
messagestringA message about the error
request_idstringThe unique identifier of the request
{
"err_code": "string",
"err_msg": "string",
"request_id": "string"
}