Tasks
/api/v2/tasksList all tasks
Retrieves a list of tasks.
To limit which tasks are returned, pass query parameters in your request.
If no query parameters are passed, InfluxDB returns all tasks up to the default limit.
Parameters
Query parameters
name
stringafter
stringuser
stringorg
stringorgID
stringstatus
stringactive
, inactivelimit
integerThe maximum number of tasks to return.
Default is 100.
The minimum is 1 and the maximum is 500.
To reduce the payload size, combine type=basic and limit (see Request samples).
For more information about the basic response, see the type parameter.
100offset
integersortBy
stringname is supported.
Specifies the field used to sort records in the list.nametype
stringbasic or system).
Default is system.
Specifies the level of detail for tasks in the response.
The default (system) response contains all the metadata properties for tasks.
To reduce the response size, pass basic to omit some task properties (flux, createdAt, updatedAt).basic
, systemscriptID
stringHeader parameters
Zap-Trace-Span
stringcurl --request GET \
"https://us-east-1-1.aws.cloud2.influxdata.com/api/v2/tasks" \
--header "Authorization: Bearer INFLUX_TOKEN"Responses
links
stringtasks
object[]Unauthorized. The error may indicate one of the following:
- The
Authorization: Tokenheader is missing or malformed. - The API token value is missing from the header.
- The token doesn’t have sufficient permissions to write to this organization and bucket.
code
stringunauthorized.unauthorizedmessage
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
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/tasksCreate a task
Creates a task and returns the task.
Use this endpoint to create a scheduled task that runs a Flux script.
InfluxDB Cloud
You can use either
fluxorscriptIDto provide the task script.flux: a string of “raw” Flux that contains task options and the script–for example:{ "flux": "option task = {name: \"CPU Total 1 Hour New\", every: 1h}\ from(bucket: \"telegraf\") |> range(start: -1h) |> filter(fn: (r) => (r._measurement == \"cpu\")) |> filter(fn: (r) =>\n\t\t(r._field == \"usage_system\")) |> filter(fn: (r) => (r.cpu == \"cpu-total\")) |> aggregateWindow(every: 1h, fn: max) |> to(bucket: \"cpu_usage_user_total_1h\", org: \"INFLUX_ORG\")", "status": "active", "description": "This task downsamples CPU data every hour" }scriptID: the ID of an invokable script for the task to run. To pass task options when usingscriptID, pass the options as properties in the request body–for example:{ "name": "CPU Total 1 Hour New", "description": "This task downsamples CPU data every hour", "every": "1h", "scriptID": "SCRIPT_ID", "scriptParameters": { "rangeStart": "-1h", "bucket": "telegraf", "filterField": "cpu-total" } }
Limitations:
- You can’t use
fluxandscriptIDfor the same task.
Related guides
Parameters
Header parameters
Zap-Trace-Span
stringRequest body required
application/jsoncron
stringdescription
stringevery
stringevery also determines when the task first runs, depending on the specified time.flux
stringThe Flux script that the task runs.
Limitations
- If you use the
fluxproperty, you can’t use thescriptIDandscriptParametersproperties.
name
stringoffset
string <duration>0 removes the offset.org
stringorgID
stringscriptID
stringThe ID of the script that the task runs.
Limitations
- If you use the
scriptIDproperty, you can’t use thefluxproperty.
scriptParameters
objectThe parameter key-value pairs passed to the script (referenced by scriptID) during the task run.
Limitations
scriptParametersrequiresscriptID.- If you use the
scriptIDandscriptParametersproperties, you can’t use thefluxproperty.
status
stringcurl --request POST \
"https://us-east-1-1.aws.cloud2.influxdata.com/api/v2/tasks" \
--header "Authorization: Bearer INFLUX_TOKEN" \
--header "Content-Type: application/json" \
--data-raw '{
"cron": "CRON",
"description": "DESCRIPTION",
"every": "EVERY",
"flux": "FLUX",
"name": "NAME",
"offset": "OFFSET",
"org": "ORG",
"orgID": "ORGID",
"scriptID": "SCRIPTID",
"scriptParameters": {},
"status": "active"
}'Responses
tasks list with the new task.authorizationID
stringAn authorization ID. Specifies the authorization used when the task communicates with the query engine.
To find an authorization ID, use the
GET /api/v2/authorizations endpoint to
list authorizations.
createdAt
string <date-time>cron
stringdescription
stringevery
string <duration>every also determines when the task first runs, depending on the specified time.flux
string <flux>The Flux script that the task executes.
Limitations
- If you use the
fluxproperty, you can’t use thescriptIDandscriptParametersproperties.
id
required
stringlabels
stringlastRunError
stringlastRunStatus
stringfailed
, success
, canceledlatestCompleted
string <date-time>links
object{"labels":"/api/v2/tasks/1/labels","logs":"/api/v2/tasks/1/logs","members":"/api/v2/tasks/1/members","owners":"/api/v2/tasks/1/owners","runs":"/api/v2/tasks/1/runs","self":"/api/v2/tasks/1"}labels
stringlogs
stringmembers
stringowners
stringruns
stringself
stringname
required
stringoffset
string <duration>0 removes the offset.org
stringorgID
required
stringownerID
stringA user ID. Specifies the owner of the task.
To find a user ID, you can use the
GET /api/v2/users endpoint to
list users.
scriptID
stringA script ID. Specifies the invokable script that the task executes.
Limitations
- If you use the
scriptIDproperty, you can’t use thefluxproperty.
Related guides
scriptParameters
objectKey-value pairs for params in the script.
Defines the invocation parameter values passed to the script specified by scriptID.
When running the task, InfluxDB executes the script with the parameters
you provide.
Limitations
- To use
scriptParameters, you must provide ascriptID. - If you use the
scriptIDandscriptParametersproperties, you can’t use thefluxproperty.
status
stringupdatedAt
string <date-time>Bad request. The response body contains detail about the error.
InfluxDB Cloud
- Returns this error if the task doesn’t contain one of
fluxorscriptID. - Returns this error if the task contains
fluxandscriptID.
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
stringUnauthorized. The error may indicate one of the following:
- The
Authorization: Tokenheader is missing or malformed. - The API token value is missing from the header.
- The token doesn’t have sufficient permissions to write to this organization and bucket.
code
stringunauthorized.unauthorizedmessage
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
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/tasks/{taskID}Retrieve a task
Parameters
Path parameters
taskID
required
stringHeader parameters
Zap-Trace-Span
stringcurl --request GET \
"https://us-east-1-1.aws.cloud2.influxdata.com/api/v2/tasks/{taskID}" \
--header "Authorization: Bearer INFLUX_TOKEN"Responses
authorizationID
stringAn authorization ID. Specifies the authorization used when the task communicates with the query engine.
To find an authorization ID, use the
GET /api/v2/authorizations endpoint to
list authorizations.
createdAt
string <date-time>cron
stringdescription
stringevery
string <duration>every also determines when the task first runs, depending on the specified time.flux
string <flux>The Flux script that the task executes.
Limitations
- If you use the
fluxproperty, you can’t use thescriptIDandscriptParametersproperties.
id
required
stringlabels
stringlastRunError
stringlastRunStatus
stringfailed
, success
, canceledlatestCompleted
string <date-time>links
object{"labels":"/api/v2/tasks/1/labels","logs":"/api/v2/tasks/1/logs","members":"/api/v2/tasks/1/members","owners":"/api/v2/tasks/1/owners","runs":"/api/v2/tasks/1/runs","self":"/api/v2/tasks/1"}labels
stringlogs
stringmembers
stringowners
stringruns
stringself
stringname
required
stringoffset
string <duration>0 removes the offset.org
stringorgID
required
stringownerID
stringA user ID. Specifies the owner of the task.
To find a user ID, you can use the
GET /api/v2/users endpoint to
list users.
scriptID
stringA script ID. Specifies the invokable script that the task executes.
Limitations
- If you use the
scriptIDproperty, you can’t use thefluxproperty.
Related guides
scriptParameters
objectKey-value pairs for params in the script.
Defines the invocation parameter values passed to the script specified by scriptID.
When running the task, InfluxDB executes the script with the parameters
you provide.
Limitations
- To use
scriptParameters, you must provide ascriptID. - If you use the
scriptIDandscriptParametersproperties, you can’t use thefluxproperty.
status
stringupdatedAt
string <date-time>Bad request. The response body contains detail about the error.
InfluxDB OSS v2
- Returns this error if an incorrect value is passed in the
orgparameter ororgIDparameter.
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
stringUnauthorized. The error may indicate one of the following:
- The
Authorization: Tokenheader is missing or malformed. - The API token value is missing from the header.
- The token doesn’t have sufficient permissions to write to this organization and bucket.
code
stringunauthorized.unauthorizedmessage
stringNot found. A requested resource was not found. The response body contains the requested resource type and the name value (if you passed it)–for example:
"organization name \"my-org\" not found""organization not found": indicates you passed an ID that did not match an organization.
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
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/tasks/{taskID}Update a task
Updates a task, and then cancels all scheduled runs of the task.
Use this endpoint to set, modify, or clear task properties–for example: cron, name, flux, status.
Once InfluxDB applies the update, it cancels all previously scheduled runs of the task.
To update a task, pass an object that contains the updated key-value pairs.
To activate or inactivate a task, set the status property.
"status": "inactive" cancels scheduled runs and prevents manual runs of the task.
InfluxDB Cloud
Use either
fluxorscriptIDto provide the task script.flux: a string of “raw” Flux that contains task options and the script–for example:{ "flux": "option task = {name: \"CPU Total 1 Hour New\", every: 1h}\ from(bucket: \"telegraf\") |> range(start: -1h) |> filter(fn: (r) => (r._measurement == \"cpu\")) |> filter(fn: (r) =>\n\t\t(r._field == \"usage_system\")) |> filter(fn: (r) => (r.cpu == \"cpu-total\")) |> aggregateWindow(every: 1h, fn: max) |> to(bucket: \"cpu_usage_user_total_1h\", org: \"INFLUX_ORG\")", "status": "active", "description": "This task downsamples CPU data every hour" }scriptID: the ID of an invokable script for the task to run. To pass task options when usingscriptID, pass the options as properties in the request body–for example:{ "name": "CPU Total 1 Hour New", "description": "This task downsamples CPU data every hour", "every": "1h", "scriptID": "SCRIPT_ID", "scriptParameters": { "rangeStart": "-1h", "bucket": "telegraf", "filterField": "cpu-total" } }
Limitations:
- You can’t use
fluxandscriptIDfor the same task.
Parameters
Path parameters
taskID
required
stringHeader parameters
Zap-Trace-Span
stringRequest body required
application/jsoncron
stringdescription
stringevery
stringflux
stringname
stringoffset
stringscriptID
stringscriptParameters
objectstatus
stringcurl --request PATCH \
"https://us-east-1-1.aws.cloud2.influxdata.com/api/v2/tasks/{taskID}" \
--header "Authorization: Bearer INFLUX_TOKEN" \
--header "Content-Type: application/json" \
--data-raw '{
"cron": "CRON",
"description": "DESCRIPTION",
"every": "EVERY",
"flux": "FLUX",
"name": "NAME",
"offset": "OFFSET",
"scriptID": "SCRIPTID",
"scriptParameters": {},
"status": "active"
}'Responses
authorizationID
stringAn authorization ID. Specifies the authorization used when the task communicates with the query engine.
To find an authorization ID, use the
GET /api/v2/authorizations endpoint to
list authorizations.
createdAt
string <date-time>cron
stringdescription
stringevery
string <duration>every also determines when the task first runs, depending on the specified time.flux
string <flux>The Flux script that the task executes.
Limitations
- If you use the
fluxproperty, you can’t use thescriptIDandscriptParametersproperties.
id
required
stringlabels
stringlastRunError
stringlastRunStatus
stringfailed
, success
, canceledlatestCompleted
string <date-time>links
object{"labels":"/api/v2/tasks/1/labels","logs":"/api/v2/tasks/1/logs","members":"/api/v2/tasks/1/members","owners":"/api/v2/tasks/1/owners","runs":"/api/v2/tasks/1/runs","self":"/api/v2/tasks/1"}labels
stringlogs
stringmembers
stringowners
stringruns
stringself
stringname
required
stringoffset
string <duration>0 removes the offset.org
stringorgID
required
stringownerID
stringA user ID. Specifies the owner of the task.
To find a user ID, you can use the
GET /api/v2/users endpoint to
list users.
scriptID
stringA script ID. Specifies the invokable script that the task executes.
Limitations
- If you use the
scriptIDproperty, you can’t use thefluxproperty.
Related guides
scriptParameters
objectKey-value pairs for params in the script.
Defines the invocation parameter values passed to the script specified by scriptID.
When running the task, InfluxDB executes the script with the parameters
you provide.
Limitations
- To use
scriptParameters, you must provide ascriptID. - If you use the
scriptIDandscriptParametersproperties, you can’t use thefluxproperty.
status
stringupdatedAt
string <date-time>Bad request. The response body contains detail about the error.
InfluxDB OSS v2
- Returns this error if an incorrect value is passed in the
orgparameter ororgIDparameter.
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
stringUnauthorized. The error may indicate one of the following:
- The
Authorization: Tokenheader is missing or malformed. - The API token value is missing from the header.
- The token doesn’t have sufficient permissions to write to this organization and bucket.
code
stringunauthorized.unauthorizedmessage
stringNot found. A requested resource was not found. The response body contains the requested resource type and the name value (if you passed it)–for example:
"organization name \"my-org\" not found""organization not found": indicates you passed an ID that did not match an organization.
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
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/tasks/{taskID}Delete a task
Deletes a task and associated records.
Use this endpoint to delete a task and all associated records (task runs, logs, and labels). Once the task is deleted, InfluxDB cancels all scheduled runs of the task.
If you want to disable a task instead of delete it, update the task status to inactive.
Parameters
Path parameters
taskID
required
stringHeader parameters
Zap-Trace-Span
stringcurl --request DELETE \
"https://us-east-1-1.aws.cloud2.influxdata.com/api/v2/tasks/{taskID}" \
--header "Authorization: Bearer INFLUX_TOKEN"Responses
Bad request. The response body contains detail about the error.
InfluxDB OSS v2
- Returns this error if an incorrect value is passed in the
orgparameter ororgIDparameter.
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
stringUnauthorized. The error may indicate one of the following:
- The
Authorization: Tokenheader is missing or malformed. - The API token value is missing from the header.
- The token doesn’t have sufficient permissions to write to this organization and bucket.
code
stringunauthorized.unauthorizedmessage
stringNot found. A requested resource was not found. The response body contains the requested resource type and the name value (if you passed it)–for example:
"organization name \"my-org\" not found""organization not found": indicates you passed an ID that did not match an organization.
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
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/tasks/{taskID}/labelsList labels for a task
Retrieves a list of all labels for a task.
Labels may be used for grouping and filtering tasks.
Parameters
Path parameters
taskID
required
stringHeader parameters
Zap-Trace-Span
stringcurl --request GET \
"https://us-east-1-1.aws.cloud2.influxdata.com/api/v2/tasks/{taskID}/labels" \
--header "Authorization: Bearer INFLUX_TOKEN"Responses
labels
stringlinks
stringBad request. The response body contains detail about the error.
InfluxDB OSS v2
- Returns this error if an incorrect value is passed in the
orgparameter ororgIDparameter.
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
stringUnauthorized. The error may indicate one of the following:
- The
Authorization: Tokenheader is missing or malformed. - The API token value is missing from the header.
- The token doesn’t have sufficient permissions to write to this organization and bucket.
code
stringunauthorized.unauthorizedmessage
stringNot found. A requested resource was not found. The response body contains the requested resource type and the name value (if you passed it)–for example:
"organization name \"my-org\" not found""organization not found": indicates you passed an ID that did not match an organization.
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
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/tasks/{taskID}/labelsAdd a label to a task
Adds a label to a task.
Use this endpoint to add a label that you can use to filter tasks in the InfluxDB UI.
Parameters
Path parameters
taskID
required
stringHeader parameters
Zap-Trace-Span
stringRequest body required
labelID to add to the task.application/jsonlabelID
required
stringcurl --request POST \
"https://us-east-1-1.aws.cloud2.influxdata.com/api/v2/tasks/{taskID}/labels" \
--header "Authorization: Bearer INFLUX_TOKEN" \
--header "Content-Type: application/json" \
--data-raw '{
"labelID": "LABELID"
}'Responses
label
stringlinks
stringBad request. The response body contains detail about the error.
InfluxDB OSS v2
- Returns this error if an incorrect value is passed in the
orgparameter ororgIDparameter.
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
stringUnauthorized. The error may indicate one of the following:
- The
Authorization: Tokenheader is missing or malformed. - The API token value is missing from the header.
- The token doesn’t have sufficient permissions to write to this organization and bucket.
code
stringunauthorized.unauthorizedmessage
stringNot found. A requested resource was not found. The response body contains the requested resource type and the name value (if you passed it)–for example:
"organization name \"my-org\" not found""organization not found": indicates you passed an ID that did not match an organization.
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
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/tasks/{taskID}/labels/{labelID}Delete a label from a task
Parameters
Path parameters
taskID
required
stringlabelID
required
stringHeader parameters
Zap-Trace-Span
stringcurl --request DELETE \
"https://us-east-1-1.aws.cloud2.influxdata.com/api/v2/tasks/{taskID}/labels/{labelID}" \
--header "Authorization: Bearer INFLUX_TOKEN"Responses
Bad request. The response body contains detail about the error.
InfluxDB OSS v2
- Returns this error if an incorrect value is passed in the
orgparameter ororgIDparameter.
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
stringUnauthorized. The error may indicate one of the following:
- The
Authorization: Tokenheader is missing or malformed. - The API token value is missing from the header.
- The token doesn’t have sufficient permissions to write to this organization and bucket.
code
stringunauthorized.unauthorizedmessage
stringNot found. A requested resource was not found. The response body contains the requested resource type and the name value (if you passed it)–for example:
"organization name \"my-org\" not found""organization not found": indicates you passed an ID that did not match an organization.
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
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/tasks/{taskID}/logsRetrieve all logs for a task
Retrieves a list of all logs for a task.
When an InfluxDB task runs, a “run” record is created in the task’s history. Logs associated with each run provide relevant log messages, timestamps, and the exit status of the run attempt.
Use this endpoint to retrieve only the log events for a task, without additional task metadata.
Parameters
Path parameters
taskID
required
stringHeader parameters
Zap-Trace-Span
stringcurl --request GET \
"https://us-east-1-1.aws.cloud2.influxdata.com/api/v2/tasks/{taskID}/logs" \
--header "Authorization: Bearer INFLUX_TOKEN"Responses
events list with logs for the task.
Each log event message contains detail about the event.
If a task run fails, InfluxDB logs an event with the reason for the failure.events
object[]Bad request. The response body contains detail about the error.
InfluxDB OSS v2
- Returns this error if an incorrect value is passed in the
orgparameter ororgIDparameter.
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
stringUnauthorized. The error may indicate one of the following:
- The
Authorization: Tokenheader is missing or malformed. - The API token value is missing from the header.
- The token doesn’t have sufficient permissions to write to this organization and bucket.
code
stringunauthorized.unauthorizedmessage
stringNot found. A requested resource was not found. The response body contains the requested resource type and the name value (if you passed it)–for example:
"organization name \"my-org\" not found""organization not found": indicates you passed an ID that did not match an organization.
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
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/tasks/{taskID}/membersList all task members
Deprecated: Tasks don’t use owner and member roles.
Use /api/v2/authorizations to assign user permissions.
Lists all users that have the member role for the specified task.
Parameters
Path parameters
taskID
required
stringHeader parameters
Zap-Trace-Span
stringcurl --request GET \
"https://us-east-1-1.aws.cloud2.influxdata.com/api/v2/tasks/{taskID}/members" \
--header "Authorization: Bearer INFLUX_TOKEN"Responses
users that have
the member role for a task.links
objectself
string <uri>users
object[]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/tasks/{taskID}/membersAdd a member to a task
Deprecated: Tasks don’t use owner and member roles.
Use /api/v2/authorizations to assign user permissions.
Adds a user to members of a task and returns the member.
Parameters
Path parameters
taskID
required
stringHeader parameters
Zap-Trace-Span
stringRequest body required
application/jsonid
required
stringname
stringcurl --request POST \
"https://us-east-1-1.aws.cloud2.influxdata.com/api/v2/tasks/{taskID}/members" \
--header "Authorization: Bearer INFLUX_TOKEN" \
--header "Content-Type: application/json" \
--data-raw '{
"id": "ID",
"name": "NAME"
}'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/tasks/{taskID}/members/{userID}Remove a member from a task
Deprecated: Tasks don’t use owner and member roles.
Use /api/v2/authorizations to assign user permissions.
Removes a member from a task.
Parameters
Path parameters
userID
required
stringtaskID
required
stringHeader parameters
Zap-Trace-Span
stringcurl --request DELETE \
"https://us-east-1-1.aws.cloud2.influxdata.com/api/v2/tasks/{taskID}/members/{userID}" \
--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/tasks/{taskID}/ownersList all owners of a task
Deprecated: Tasks don’t use owner and member roles.
Use /api/v2/authorizations to assign user permissions.
Retrieves all users that have owner permission for a task.
Parameters
Path parameters
taskID
required
stringHeader parameters
Zap-Trace-Span
stringcurl --request GET \
"https://us-east-1-1.aws.cloud2.influxdata.com/api/v2/tasks/{taskID}/owners" \
--header "Authorization: Bearer INFLUX_TOKEN"Responses
Success.
The response contains a list of users that have the owner role for the task.
If the task has no owners, the response contains an empty users array.
links
objectself
string <uri>users
object[]Unauthorized. The error may indicate one of the following:
- The
Authorization: Tokenheader is missing or malformed. - The API token value is missing from the header.
- The token doesn’t have sufficient permissions to write to this organization and bucket.
code
stringunauthorized.unauthorizedmessage
stringUnprocessable entity.
The error may indicate one of the following problems:
- The request body isn’t valid–the request is well-formed, but InfluxDB can’t process it due to semantic errors.
- You passed a parameter combination that InfluxDB doesn’t support.
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
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/tasks/{taskID}/ownersAdd an owner for a task
Deprecated: Tasks don’t use owner and member roles.
Use /api/v2/authorizations to assign user permissions.
Assigns a task owner role to a user.
Use this endpoint to create a resource owner for the task.
A resource owner is a user with role: owner for a specific resource.
Parameters
Path parameters
taskID
required
stringHeader parameters
Zap-Trace-Span
stringRequest body required
application/jsonid
required
stringname
stringcurl --request POST \
"https://us-east-1-1.aws.cloud2.influxdata.com/api/v2/tasks/{taskID}/owners" \
--header "Authorization: Bearer INFLUX_TOKEN" \
--header "Content-Type: application/json" \
--data-raw '{
"id": "ID",
"name": "NAME"
}'Responses
owner role is assigned to the user.
The response body contains the resource owner with
role and user detail.Unauthorized. The error may indicate one of the following:
- The
Authorization: Tokenheader is missing or malformed. - The API token value is missing from the header.
- The token doesn’t have sufficient permissions to write to this organization and bucket.
code
stringunauthorized.unauthorizedmessage
stringUnprocessable entity.
The error may indicate one of the following problems:
- The request body isn’t valid–the request is well-formed, but InfluxDB can’t process it due to semantic errors.
- You passed a parameter combination that InfluxDB doesn’t support.
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
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/tasks/{taskID}/owners/{userID}Remove an owner from a task
owner and member roles.
Use /api/v2/authorizations to assign user permissions.Parameters
Path parameters
userID
required
stringtaskID
required
stringHeader parameters
Zap-Trace-Span
stringcurl --request DELETE \
"https://us-east-1-1.aws.cloud2.influxdata.com/api/v2/tasks/{taskID}/owners/{userID}" \
--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/tasks/{taskID}/runsList runs for a task
Retrieves a list of runs for a task.
To limit which task runs are returned, pass query parameters in your request.
If no query parameters are passed, InfluxDB returns all task runs up to the default limit.
Parameters
Path parameters
taskID
required
stringQuery parameters
after
stringlimit
integer100.100afterTime
string <date-time>beforeTime
string <date-time>Header parameters
Zap-Trace-Span
stringcurl --request GET \
"https://us-east-1-1.aws.cloud2.influxdata.com/api/v2/tasks/{taskID}/runs" \
--header "Authorization: Bearer INFLUX_TOKEN"Responses
links
stringruns
object[]Unauthorized. The error may indicate one of the following:
- The
Authorization: Tokenheader is missing or malformed. - The API token value is missing from the header.
- The token doesn’t have sufficient permissions to write to this organization and bucket.
code
stringunauthorized.unauthorizedmessage
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
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/tasks/{taskID}/runsStart a task run, overriding the schedule
Schedules a task run to start immediately, ignoring scheduled runs.
Use this endpoint to manually start a task run. Scheduled runs will continue to run as scheduled. This may result in concurrently running tasks.
To retry a previous run (and avoid creating a new run),
use the POST /api/v2/tasks/{taskID}/runs/{runID}/retry endpoint.
Parameters
Path parameters
taskID
required
stringHeader parameters
Zap-Trace-Span
stringRequest body
application/jsonscheduledFor
string <date-time>now option.
Default is the server now time.curl --request POST \
"https://us-east-1-1.aws.cloud2.influxdata.com/api/v2/tasks/{taskID}/runs" \
--header "Authorization: Bearer INFLUX_TOKEN" \
--header "Content-Type: application/json" \
--data-raw '{
"scheduledFor": "SCHEDULEDFOR"
}'Responses
finishedAt
string <date-time>"2006-01-02T15:04:05.999999999Z07:00"flux
stringid
stringlinks
object{"retry":"/api/v2/tasks/1/runs/1/retry","self":"/api/v2/tasks/1/runs/1","task":"/api/v2/tasks/1"}retry
string <uri>self
string <uri>task
string <uri>log
object[]requestedAt
string <date-time>"2006-01-02T15:04:05.999999999Z07:00"scheduledFor
string <date-time>now option.startedAt
string <date-time>"2006-01-02T15:04:05.999999999Z07:00"status
stringscheduled
, started
, failed
, success
, canceledtaskID
stringUnauthorized. The error may indicate one of the following:
- The
Authorization: Tokenheader is missing or malformed. - The API token value is missing from the header.
- The token doesn’t have sufficient permissions to write to this organization and bucket.
code
stringunauthorized.unauthorizedmessage
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
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/tasks/{taskID}/runs/{runID}Retrieve a run for a task.
Retrieves a specific run for a task.
Use this endpoint to retrieve detail and logs for a specific task run.
Parameters
Path parameters
taskID
required
stringrunID
required
stringHeader parameters
Zap-Trace-Span
stringcurl --request GET \
"https://us-east-1-1.aws.cloud2.influxdata.com/api/v2/tasks/{taskID}/runs/{runID}" \
--header "Authorization: Bearer INFLUX_TOKEN"Responses
finishedAt
string <date-time>"2006-01-02T15:04:05.999999999Z07:00"flux
stringid
stringlinks
object{"retry":"/api/v2/tasks/1/runs/1/retry","self":"/api/v2/tasks/1/runs/1","task":"/api/v2/tasks/1"}retry
string <uri>self
string <uri>task
string <uri>log
object[]requestedAt
string <date-time>"2006-01-02T15:04:05.999999999Z07:00"scheduledFor
string <date-time>now option.startedAt
string <date-time>"2006-01-02T15:04:05.999999999Z07:00"status
stringscheduled
, started
, failed
, success
, canceledtaskID
stringBad request. The response body contains detail about the error.
InfluxDB OSS v2
- Returns this error if an incorrect value is passed in the
orgparameter ororgIDparameter.
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
stringUnauthorized. The error may indicate one of the following:
- The
Authorization: Tokenheader is missing or malformed. - The API token value is missing from the header.
- The token doesn’t have sufficient permissions to write to this organization and bucket.
code
stringunauthorized.unauthorizedmessage
stringNot found. A requested resource was not found. The response body contains the requested resource type and the name value (if you passed it)–for example:
"organization name \"my-org\" not found""organization not found": indicates you passed an ID that did not match an organization.
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
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/tasks/{taskID}/runs/{runID}Cancel a running task
Cancels a running task.
Use this endpoint with InfluxDB OSS to cancel a running task.
InfluxDB Cloud
- Doesn’t support this operation.
Parameters
Path parameters
taskID
required
stringrunID
required
stringHeader parameters
Zap-Trace-Span
stringcurl --request DELETE \
"https://us-east-1-1.aws.cloud2.influxdata.com/api/v2/tasks/{taskID}/runs/{runID}" \
--header "Authorization: Bearer INFLUX_TOKEN"Responses
Success. The DELETE is accepted and the run will be cancelled.
InfluxDB Cloud
- Doesn’t support this operation.
- Doesn’t return this status.
Bad request. The response body contains detail about the error.
InfluxDB OSS v2
- Returns this error if an incorrect value is passed in the
orgparameter ororgIDparameter.
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
stringUnauthorized. The error may indicate one of the following:
- The
Authorization: Tokenheader is missing or malformed. - The API token value is missing from the header.
- The token doesn’t have sufficient permissions to write to this organization and bucket.
code
stringunauthorized.unauthorizedmessage
stringNot found. A requested resource was not found. The response body contains the requested resource type and the name value (if you passed it)–for example:
"organization name \"my-org\" not found""organization not found": indicates you passed an ID that did not match an organization.
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
stringMethod not allowed.
InfluxDB Cloud
- Always returns this error; doesn’t support cancelling tasks.
InfluxDB OSS v2
- Doesn’t return this error.
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
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/tasks/{taskID}/runs/{runID}/logsRetrieve all logs for a run
Retrieves all logs for a task run.
A log is a list of run events with runID, time, and message properties.
Use this endpoint to help analyze task performance and troubleshoot failed task runs.
Parameters
Path parameters
taskID
required
stringrunID
required
stringHeader parameters
Zap-Trace-Span
stringcurl --request GET \
"https://us-east-1-1.aws.cloud2.influxdata.com/api/v2/tasks/{taskID}/runs/{runID}/logs" \
--header "Authorization: Bearer INFLUX_TOKEN"Responses
events list with logs for the task run.
Each log event message contains detail about the event.
If a run fails, InfluxDB logs an event with the reason for the failure.events
object[]Bad request. The response body contains detail about the error.
InfluxDB OSS v2
- Returns this error if an incorrect value is passed in the
orgparameter ororgIDparameter.
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
stringUnauthorized. The error may indicate one of the following:
- The
Authorization: Tokenheader is missing or malformed. - The API token value is missing from the header.
- The token doesn’t have sufficient permissions to write to this organization and bucket.
code
stringunauthorized.unauthorizedmessage
stringNot found. A requested resource was not found. The response body contains the requested resource type and the name value (if you passed it)–for example:
"organization name \"my-org\" not found""organization not found": indicates you passed an ID that did not match an organization.
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
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/tasks/{taskID}/runs/{runID}/retryRetry a task run
Queues a task run to retry and returns the scheduled run.
To manually start a new task run, use the
POST /api/v2/tasks/{taskID}/runs endpoint.
Limitations
- The task must be active (
status: "active").
Parameters
Path parameters
taskID
required
stringrunID
required
stringA task run ID. Specifies the task run to retry.
To find a task run ID, use the
GET /api/v2/tasks/{taskID}/runs endpoint
to list task runs.
Header parameters
Zap-Trace-Span
stringRequest body
application/jsoncurl --request POST \
"https://us-east-1-1.aws.cloud2.influxdata.com/api/v2/tasks/{taskID}/runs/{runID}/retry" \
--header "Authorization: Bearer INFLUX_TOKEN" \
--header "Content-Type: application/json; charset=utf-8"Responses
finishedAt
string <date-time>"2006-01-02T15:04:05.999999999Z07:00"flux
stringid
stringlinks
object{"retry":"/api/v2/tasks/1/runs/1/retry","self":"/api/v2/tasks/1/runs/1","task":"/api/v2/tasks/1"}retry
string <uri>self
string <uri>task
string <uri>log
object[]requestedAt
string <date-time>"2006-01-02T15:04:05.999999999Z07:00"scheduledFor
string <date-time>now option.startedAt
string <date-time>"2006-01-02T15:04:05.999999999Z07:00"status
stringscheduled
, started
, failed
, success
, canceledtaskID
stringBad request. The response body contains detail about the error.
InfluxDB may return this error for the following reasons:
- The task has
status: inactive.
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
stringUnauthorized. The error may indicate one of the following:
- The
Authorization: Tokenheader is missing or malformed. - The API token value is missing from the header.
- The token doesn’t have sufficient permissions to write to this organization and bucket.
code
stringunauthorized.unauthorizedmessage
stringNot found. A requested resource was not found. The response body contains the requested resource type and the name value (if you passed it)–for example:
"organization name \"my-org\" not found""organization not found": indicates you passed an ID that did not match an organization.
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
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.