Variables
/api/v2/variablesList all variables
Parameters
Query parameters
org
stringorgID
stringHeader parameters
Zap-Trace-Span
stringcurl --request GET \
"https://us-east-1-1.aws.cloud2.influxdata.com/api/v2/variables" \
--header "Authorization: Bearer INFLUX_TOKEN"Responses
variables
object[]{
"variables": [
{
"arguments": {
"type": "constant",
"values": [
"howdy",
"hello",
"hi",
"yo",
"oy"
]
},
"id": "1221432",
"name": ":ok:",
"selected": [
"hello"
]
},
{
"arguments": {
"type": "map",
"values": {
"a": "fdjaklfdjkldsfjlkjdsa",
"b": "dfaksjfkljekfajekdljfas",
"c": "fdjksajfdkfeawfeea"
}
},
"id": "1221432",
"name": ":ok:",
"selected": [
"c"
]
},
{
"arguments": {
"language": "flux",
"query": "from(bucket: \"foo\") |\u003e showMeasurements()",
"type": "query"
},
"id": "1221432",
"name": ":ok:",
"selected": [
"host"
]
}
]
}code
required
stringinternal error
, not implemented
, not found
, conflict
, invalid
, unprocessable entity
, empty value
, unavailable
, forbidden
, too many requests
, unauthorized
, method not allowed
, request too large
, unsupported media typeerr
stringmessage
stringop
stringcode
required
stringinternal error
, not implemented
, not found
, conflict
, invalid
, unprocessable entity
, empty value
, unavailable
, forbidden
, too many requests
, unauthorized
, method not allowed
, request too large
, unsupported media typeerr
stringmessage
stringop
string/api/v2/variablesCreate a variable
Parameters
Header parameters
Zap-Trace-Span
stringRequest body required
application/jsonarguments
required
stringcreatedAt
string <date-time>description
stringid
stringlabels
stringlinks
objectlabels
string <uri>org
string <uri>self
string <uri>name
required
stringorgID
required
stringselected
string[]sort_order
integerupdatedAt
string <date-time>curl --request POST \
"https://us-east-1-1.aws.cloud2.influxdata.com/api/v2/variables" \
--header "Authorization: Bearer INFLUX_TOKEN" \
--header "Content-Type: application/json" \
--data-raw '{
"arguments": {},
"createdAt": "CREATEDAT",
"description": "DESCRIPTION",
"id": "ID",
"labels": [],
"links": {},
"name": "NAME",
"orgID": "ORGID",
"selected": [
"example"
],
"sort_order": 0,
"updatedAt": "UPDATEDAT"
}'Responses
arguments
required
stringcreatedAt
string <date-time>description
stringid
stringlabels
stringlinks
objectlabels
string <uri>org
string <uri>self
string <uri>name
required
stringorgID
required
stringselected
string[]sort_order
integerupdatedAt
string <date-time>code
required
stringinternal error
, not implemented
, not found
, conflict
, invalid
, unprocessable entity
, empty value
, unavailable
, forbidden
, too many requests
, unauthorized
, method not allowed
, request too large
, unsupported media typeerr
stringmessage
stringop
string/api/v2/variables/{variableID}Retrieve a variable
Parameters
Path parameters
variableID
required
stringHeader parameters
Zap-Trace-Span
stringcurl --request GET \
"https://us-east-1-1.aws.cloud2.influxdata.com/api/v2/variables/{variableID}" \
--header "Authorization: Bearer INFLUX_TOKEN"Responses
arguments
required
stringcreatedAt
string <date-time>description
stringid
stringlabels
stringlinks
objectlabels
string <uri>org
string <uri>self
string <uri>name
required
stringorgID
required
stringselected
string[]sort_order
integerupdatedAt
string <date-time>code
required
stringinternal error
, not implemented
, not found
, conflict
, invalid
, unprocessable entity
, empty value
, unavailable
, forbidden
, too many requests
, unauthorized
, method not allowed
, request too large
, unsupported media typeerr
stringmessage
stringop
stringcode
required
stringinternal error
, not implemented
, not found
, conflict
, invalid
, unprocessable entity
, empty value
, unavailable
, forbidden
, too many requests
, unauthorized
, method not allowed
, request too large
, unsupported media typeerr
stringmessage
stringop
string/api/v2/variables/{variableID}Replace a variable
Parameters
Path parameters
variableID
required
stringHeader parameters
Zap-Trace-Span
stringRequest body required
application/jsonarguments
required
stringcreatedAt
string <date-time>description
stringid
stringlabels
stringlinks
objectlabels
string <uri>org
string <uri>self
string <uri>name
required
stringorgID
required
stringselected
string[]sort_order
integerupdatedAt
string <date-time>curl --request PUT \
"https://us-east-1-1.aws.cloud2.influxdata.com/api/v2/variables/{variableID}" \
--header "Authorization: Bearer INFLUX_TOKEN" \
--header "Content-Type: application/json" \
--data-raw '{
"arguments": {},
"createdAt": "CREATEDAT",
"description": "DESCRIPTION",
"id": "ID",
"labels": [],
"links": {},
"name": "NAME",
"orgID": "ORGID",
"selected": [
"example"
],
"sort_order": 0,
"updatedAt": "UPDATEDAT"
}'Responses
arguments
required
stringcreatedAt
string <date-time>description
stringid
stringlabels
stringlinks
objectlabels
string <uri>org
string <uri>self
string <uri>name
required
stringorgID
required
stringselected
string[]sort_order
integerupdatedAt
string <date-time>code
required
stringinternal error
, not implemented
, not found
, conflict
, invalid
, unprocessable entity
, empty value
, unavailable
, forbidden
, too many requests
, unauthorized
, method not allowed
, request too large
, unsupported media typeerr
stringmessage
stringop
string/api/v2/variables/{variableID}Update a variable
Parameters
Path parameters
variableID
required
stringHeader parameters
Zap-Trace-Span
stringRequest body required
application/jsonarguments
required
stringcreatedAt
string <date-time>description
stringid
stringlabels
stringlinks
objectlabels
string <uri>org
string <uri>self
string <uri>name
required
stringorgID
required
stringselected
string[]sort_order
integerupdatedAt
string <date-time>curl --request PATCH \
"https://us-east-1-1.aws.cloud2.influxdata.com/api/v2/variables/{variableID}" \
--header "Authorization: Bearer INFLUX_TOKEN" \
--header "Content-Type: application/json" \
--data-raw '{
"arguments": {},
"createdAt": "CREATEDAT",
"description": "DESCRIPTION",
"id": "ID",
"labels": [],
"links": {},
"name": "NAME",
"orgID": "ORGID",
"selected": [
"example"
],
"sort_order": 0,
"updatedAt": "UPDATEDAT"
}'Responses
arguments
required
stringcreatedAt
string <date-time>description
stringid
stringlabels
stringlinks
objectlabels
string <uri>org
string <uri>self
string <uri>name
required
stringorgID
required
stringselected
string[]sort_order
integerupdatedAt
string <date-time>code
required
stringinternal error
, not implemented
, not found
, conflict
, invalid
, unprocessable entity
, empty value
, unavailable
, forbidden
, too many requests
, unauthorized
, method not allowed
, request too large
, unsupported media typeerr
stringmessage
stringop
string/api/v2/variables/{variableID}Delete a variable
Parameters
Path parameters
variableID
required
stringHeader parameters
Zap-Trace-Span
stringcurl --request DELETE \
"https://us-east-1-1.aws.cloud2.influxdata.com/api/v2/variables/{variableID}" \
--header "Authorization: Bearer INFLUX_TOKEN"Responses
code
required
stringinternal error
, not implemented
, not found
, conflict
, invalid
, unprocessable entity
, empty value
, unavailable
, forbidden
, too many requests
, unauthorized
, method not allowed
, request too large
, unsupported media typeerr
stringmessage
stringop
string/api/v2/variables/{variableID}/labelsList all labels for a variable
Parameters
Path parameters
variableID
required
stringHeader parameters
Zap-Trace-Span
stringcurl --request GET \
"https://us-east-1-1.aws.cloud2.influxdata.com/api/v2/variables/{variableID}/labels" \
--header "Authorization: Bearer INFLUX_TOKEN"Responses
labels
stringlinks
stringcode
required
stringinternal error
, not implemented
, not found
, conflict
, invalid
, unprocessable entity
, empty value
, unavailable
, forbidden
, too many requests
, unauthorized
, method not allowed
, request too large
, unsupported media typeerr
stringmessage
stringop
string/api/v2/variables/{variableID}/labelsAdd a label to a variable
Parameters
Path parameters
variableID
required
stringHeader parameters
Zap-Trace-Span
stringRequest body required
application/jsonlabelID
required
stringcurl --request POST \
"https://us-east-1-1.aws.cloud2.influxdata.com/api/v2/variables/{variableID}/labels" \
--header "Authorization: Bearer INFLUX_TOKEN" \
--header "Content-Type: application/json" \
--data-raw '{
"labelID": "LABELID"
}'Responses
label
stringlinks
stringcode
required
stringinternal error
, not implemented
, not found
, conflict
, invalid
, unprocessable entity
, empty value
, unavailable
, forbidden
, too many requests
, unauthorized
, method not allowed
, request too large
, unsupported media typeerr
stringmessage
stringop
string/api/v2/variables/{variableID}/labels/{labelID}Delete a label from a variable
Parameters
Path parameters
variableID
required
stringlabelID
required
stringHeader parameters
Zap-Trace-Span
stringcurl --request DELETE \
"https://us-east-1-1.aws.cloud2.influxdata.com/api/v2/variables/{variableID}/labels/{labelID}" \
--header "Authorization: Bearer INFLUX_TOKEN"Responses
code
required
stringinternal error
, not implemented
, not found
, conflict
, invalid
, unprocessable entity
, empty value
, unavailable
, forbidden
, too many requests
, unauthorized
, method not allowed
, request too large
, unsupported media typeerr
stringmessage
stringop
stringcode
required
stringinternal error
, not implemented
, not found
, conflict
, invalid
, unprocessable entity
, empty value
, unavailable
, forbidden
, too many requests
, unauthorized
, method not allowed
, request too large
, unsupported media typeerr
stringmessage
stringop
stringWas this page helpful?
Thank you for your feedback!
Support and feedback
Thank you for being part of our community! We welcome and encourage your feedback and bug reports for InfluxDB and this documentation. To find support, use the following resources:
Customers with an annual or support contract can contact InfluxData Support.