---
title: Tasks
description: Schedule and manage Flux tasks that process and transform data on a recurring basis in InfluxDB OSS v2.
url: https://docs.influxdata.com/influxdb/v2/api/tasks/
estimated_tokens: 76227
product: InfluxDB OSS v2
version: v2
---

[Download InfluxDB API Spec](/openapi/influxdb-oss-v2-api.yml)

Schedule and manage Flux tasks that process and transform data on a recurring basis in InfluxDB OSS v2.

GET `/api/v2/tasks`

### List tasks

Retrieves a list of [tasks](/influxdb/v2/reference/glossary/#task).

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`.

#### Related guide

-   [Process data with InfluxDB tasks](/influxdb/v2/process-data/)

#### Parameters

##### Query parameters

`name` string

A [task](/influxdb/v2/reference/glossary/#task) name. Only returns tasks with the specified name. Different tasks may have the same name.

`after` string

A [task](/influxdb/v2/reference/glossary/#task) ID. Only returns tasks created after the specified task.

`user` string

A [user](/influxdb/v2/reference/glossary/#user) ID. Only returns tasks owned by the specified user.

`org` string

An [organization](/influxdb/v2/reference/glossary/#organization) name. Only returns tasks owned by the specified organization.

`orgID` string

An [organization](/influxdb/v2/reference/glossary/#organization) ID. Only returns tasks owned by the specified organization.

`status` string

A [task](/influxdb/v2/reference/glossary/#task) status. Only returns tasks that have the specified status (`active` or `inactive`).

Allowed values: `active` , `inactive`

`limit` integer

The maximum number of [tasks](/influxdb/v2/reference/glossary/#task) 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.

Default: `100`

`type` string

A [task](/influxdb/v2/reference/glossary/#task) type (`basic` 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`).

Allowed values: `basic` , `system`

##### Header parameters

`Zap-Trace-Span` string

OpenTracing span context

Example request [Ask AI about this](#)

```sh
curl --request GET \
  "http://localhost:8086/api/v2/tasks" \
  --header "Authorization: Bearer INFLUX_TOKEN"
```

#### Responses

200 Success. The response body contains the list of tasks.

`links` string

`tasks` object\[\]

401

Unauthorized. The error may indicate one of the following:

-   The `Authorization: Token` header 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` string

The HTTP status code description. Default is `unauthorized`.

Allowed: `unauthorized`

`message` string

A human-readable message that may contain detail about the error.

500 Internal server error. The server encountered an unexpected situation.

`code` required string

code is the machine-readable error code.

Allowed: `internal 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 type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

default Non 2XX error response from server.

`code` required string

code is the machine-readable error code.

Allowed: `internal 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 type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

POST `/api/v2/tasks`

### Create a task

Creates a [task](/influxdb/v2/reference/glossary/#task) and returns the task.

#### Related guides

-   [Get started with tasks](/influxdb/v2/process-data/get-started/)
-   [Create a task](/influxdb/v2/process-data/manage-tasks/create-task/)
-   [Common tasks](/influxdb/v2/process-data/common-tasks/)
-   [Task configuration options](/influxdb/v2/process-data/task-options/)

#### Parameters

##### Header parameters

`Zap-Trace-Span` string

OpenTracing span context

#### Request body required

The task to create.

Content-Type: `application/json`

`description` string

An optional description of the task.

`flux` required string

The Flux script to run for this task.

`org` string

The name of the organization that owns this Task.

`orgID` string

The ID of the organization that owns this Task.

`status` string

Example request [Ask AI about this](#)

```sh
curl --request POST \
  "http://localhost:8086/api/v2/tasks" \
  --header "Authorization: Bearer INFLUX_TOKEN" \
  --header "Content-Type: application/json" \
  --data-raw '{
  "description": "DESCRIPTION",
  "flux": "FLUX",
  "org": "ORG",
  "orgID": "ORGID",
  "status": "active"
}'
```

#### Responses

201 Success. The response body contains a `tasks` list with the task.

`authorizationID` string

An 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](#operation/GetAuthorizations) to list authorizations.

`createdAt` string <date-time>

`cron` string

A [Cron expression](https://en.wikipedia.org/wiki/Cron#Overview) that defines the schedule on which the task runs. InfluxDB uses the system time when evaluating Cron expressions.

`description` string

A description of the task.

`every` string <duration>

The interval ([duration literal](/influxdb/v2/reference/glossary/#rfc3339-timestamp)) at which the task runs. `every` also determines when the task first runs, depending on the specified time.

`flux` required string <flux>

The Flux script that the task executes.

`id` required string

`labels` string

`lastRunError` string

`lastRunStatus` string

Allowed: `failed` , `success` , `canceled`

`latestCompleted` string <date-time>

A timestamp ([RFC3339 date/time format](/influxdb/v2/reference/glossary/#rfc3339-timestamp)) of the latest scheduled and completed run.

`links` object

Example: `{"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` string

`logs` string

`members` string

`owners` string

`runs` string

`self` string

`name` required string

The name of the task.

`offset` string <duration>

A [duration](/flux/v0.x/spec/lexical-elements/#duration-literals) to delay execution of the task after the scheduled time has elapsed. `0` removes the offset.

`org` string

An [organization](/influxdb/v2/reference/glossary/#organization) name. Specifies the organization that owns the task.

`orgID` required string

An [organization](/influxdb/v2/reference/glossary/#organization) ID. Specifies the organization that owns the task.

`ownerID` string

A [user](/influxdb/v2/reference/glossary/#user) ID. Specifies the owner of the task.

To find a user ID, you can use the [`GET /api/v2/users` endpoint](#operation/GetUsers) to list users.

`status` string

`updatedAt` string <date-time>

400

Bad request. The response body contains detail about the error.

#### InfluxDB OSS v2

-   Returns this error if an incorrect value is passed for `org` or `orgID`.

`code` required string

code is the machine-readable error code.

Allowed: `internal 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 type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

401

Unauthorized. The error may indicate one of the following:

-   The `Authorization: Token` header 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` string

The HTTP status code description. Default is `unauthorized`.

Allowed: `unauthorized`

`message` string

A human-readable message that may contain detail about the error.

500 Internal server error. The server encountered an unexpected situation.

`code` required string

code is the machine-readable error code.

Allowed: `internal 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 type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

default Unexpected error

`code` required string

code is the machine-readable error code.

Allowed: `internal 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 type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

GET `/api/v2/tasks/{taskID}`

### Retrieve a task

Retrieves a [task](/influxdb/v2/reference/glossary/#task).

#### Parameters

##### Path parameters

`taskID` required string

The ID of the task to retrieve.

##### Header parameters

`Zap-Trace-Span` string

OpenTracing span context

Example request [Ask AI about this](#)

```sh
curl --request GET \
  "http://localhost:8086/api/v2/tasks/{taskID}" \
  --header "Authorization: Bearer INFLUX_TOKEN"
```

#### Responses

200 Success. The response body contains the task.

`authorizationID` string

An 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](#operation/GetAuthorizations) to list authorizations.

`createdAt` string <date-time>

`cron` string

A [Cron expression](https://en.wikipedia.org/wiki/Cron#Overview) that defines the schedule on which the task runs. InfluxDB uses the system time when evaluating Cron expressions.

`description` string

A description of the task.

`every` string <duration>

The interval ([duration literal](/influxdb/v2/reference/glossary/#rfc3339-timestamp)) at which the task runs. `every` also determines when the task first runs, depending on the specified time.

`flux` required string <flux>

The Flux script that the task executes.

`id` required string

`labels` string

`lastRunError` string

`lastRunStatus` string

Allowed: `failed` , `success` , `canceled`

`latestCompleted` string <date-time>

A timestamp ([RFC3339 date/time format](/influxdb/v2/reference/glossary/#rfc3339-timestamp)) of the latest scheduled and completed run.

`links` object

Example: `{"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` string

`logs` string

`members` string

`owners` string

`runs` string

`self` string

`name` required string

The name of the task.

`offset` string <duration>

A [duration](/flux/v0.x/spec/lexical-elements/#duration-literals) to delay execution of the task after the scheduled time has elapsed. `0` removes the offset.

`org` string

An [organization](/influxdb/v2/reference/glossary/#organization) name. Specifies the organization that owns the task.

`orgID` required string

An [organization](/influxdb/v2/reference/glossary/#organization) ID. Specifies the organization that owns the task.

`ownerID` string

A [user](/influxdb/v2/reference/glossary/#user) ID. Specifies the owner of the task.

To find a user ID, you can use the [`GET /api/v2/users` endpoint](#operation/GetUsers) to list users.

`status` string

`updatedAt` string <date-time>

400

Bad request. The response body contains detail about the error.

#### InfluxDB OSS v2

-   Returns this error if an incorrect value is passed in the `org` parameter or `orgID` parameter.

`code` required string

code is the machine-readable error code.

Allowed: `internal 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 type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

401

Unauthorized. The error may indicate one of the following:

-   The `Authorization: Token` header 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` string

The HTTP status code description. Default is `unauthorized`.

Allowed: `unauthorized`

`message` string

A human-readable message that may contain detail about the error.

404

Not 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 string

code is the machine-readable error code.

Allowed: `internal 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 type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

500 Internal server error. The server encountered an unexpected situation.

`code` required string

code is the machine-readable error code.

Allowed: `internal 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 type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

default Non 2XX error response from server.

`code` required string

code is the machine-readable error code.

Allowed: `internal 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 type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

PATCH `/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, and 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.

#### Parameters

##### Path parameters

`taskID` required string

The ID of the task to update.

##### Header parameters

`Zap-Trace-Span` string

OpenTracing span context

#### Request body required

An object that contains updated task properties to apply.

Content-Type: `application/json`

`cron` string

Update the ‘cron’ option in the flux script.

`description` string

Update the description of the task.

`every` string

Update the ’every’ option in the flux script.

`flux` string

The Flux script that the task runs.

`name` string

Update the ’name’ option in the flux script.

`offset` string

Update the ‘offset’ option in the flux script.

`status` string

Example request [Ask AI about this](#)

```sh
curl --request PATCH \
  "http://localhost:8086/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",
  "status": "active"
}'
```

#### Responses

200 Success. The response body contains the updated task.

`authorizationID` string

An 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](#operation/GetAuthorizations) to list authorizations.

`createdAt` string <date-time>

`cron` string

A [Cron expression](https://en.wikipedia.org/wiki/Cron#Overview) that defines the schedule on which the task runs. InfluxDB uses the system time when evaluating Cron expressions.

`description` string

A description of the task.

`every` string <duration>

The interval ([duration literal](/influxdb/v2/reference/glossary/#rfc3339-timestamp)) at which the task runs. `every` also determines when the task first runs, depending on the specified time.

`flux` required string <flux>

The Flux script that the task executes.

`id` required string

`labels` string

`lastRunError` string

`lastRunStatus` string

Allowed: `failed` , `success` , `canceled`

`latestCompleted` string <date-time>

A timestamp ([RFC3339 date/time format](/influxdb/v2/reference/glossary/#rfc3339-timestamp)) of the latest scheduled and completed run.

`links` object

Example: `{"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` string

`logs` string

`members` string

`owners` string

`runs` string

`self` string

`name` required string

The name of the task.

`offset` string <duration>

A [duration](/flux/v0.x/spec/lexical-elements/#duration-literals) to delay execution of the task after the scheduled time has elapsed. `0` removes the offset.

`org` string

An [organization](/influxdb/v2/reference/glossary/#organization) name. Specifies the organization that owns the task.

`orgID` required string

An [organization](/influxdb/v2/reference/glossary/#organization) ID. Specifies the organization that owns the task.

`ownerID` string

A [user](/influxdb/v2/reference/glossary/#user) ID. Specifies the owner of the task.

To find a user ID, you can use the [`GET /api/v2/users` endpoint](#operation/GetUsers) to list users.

`status` string

`updatedAt` string <date-time>

400

Bad request. The response body contains detail about the error.

#### InfluxDB OSS v2

-   Returns this error if an incorrect value is passed in the `org` parameter or `orgID` parameter.

`code` required string

code is the machine-readable error code.

Allowed: `internal 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 type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

401

Unauthorized. The error may indicate one of the following:

-   The `Authorization: Token` header 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` string

The HTTP status code description. Default is `unauthorized`.

Allowed: `unauthorized`

`message` string

A human-readable message that may contain detail about the error.

404

Not 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 string

code is the machine-readable error code.

Allowed: `internal 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 type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

500 Internal server error. The server encountered an unexpected situation.

`code` required string

code is the machine-readable error code.

Allowed: `internal 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 type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

default Non 2XX error response from server.

`code` required string

code is the machine-readable error code.

Allowed: `internal 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 type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

DELETE `/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`](#operation/PatchTasksID).

#### Parameters

##### Path parameters

`taskID` required string

The ID of the task to delete.

##### Header parameters

`Zap-Trace-Span` string

OpenTracing span context

Example request [Ask AI about this](#)

```sh
curl --request DELETE \
  "http://localhost:8086/api/v2/tasks/{taskID}" \
  --header "Authorization: Bearer INFLUX_TOKEN"
```

#### Responses

204 Success. The task and runs are deleted. Scheduled runs are canceled.

400

Bad request. The response body contains detail about the error.

#### InfluxDB OSS v2

-   Returns this error if an incorrect value is passed in the `org` parameter or `orgID` parameter.

`code` required string

code is the machine-readable error code.

Allowed: `internal 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 type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

401

Unauthorized. The error may indicate one of the following:

-   The `Authorization: Token` header 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` string

The HTTP status code description. Default is `unauthorized`.

Allowed: `unauthorized`

`message` string

A human-readable message that may contain detail about the error.

404

Not 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 string

code is the machine-readable error code.

Allowed: `internal 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 type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

500 Internal server error. The server encountered an unexpected situation.

`code` required string

code is the machine-readable error code.

Allowed: `internal 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 type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

default Non 2XX error response from server.

`code` required string

code is the machine-readable error code.

Allowed: `internal 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 type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

GET `/api/v2/tasks/{taskID}/labels`

### List 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 string

The ID of the task to retrieve labels for.

##### Header parameters

`Zap-Trace-Span` string

OpenTracing span context

Example request [Ask AI about this](#)

```sh
curl --request GET \
  "http://localhost:8086/api/v2/tasks/{taskID}/labels" \
  --header "Authorization: Bearer INFLUX_TOKEN"
```

#### Responses

200 Success. The response body contains a list of all labels for the task.

`labels` string

`links` string

400

Bad request. The response body contains detail about the error.

#### InfluxDB OSS v2

-   Returns this error if an incorrect value is passed in the `org` parameter or `orgID` parameter.

`code` required string

code is the machine-readable error code.

Allowed: `internal 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 type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

401

Unauthorized. The error may indicate one of the following:

-   The `Authorization: Token` header 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` string

The HTTP status code description. Default is `unauthorized`.

Allowed: `unauthorized`

`message` string

A human-readable message that may contain detail about the error.

404

Not 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 string

code is the machine-readable error code.

Allowed: `internal 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 type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

500 Internal server error. The server encountered an unexpected situation.

`code` required string

code is the machine-readable error code.

Allowed: `internal 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 type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

default Non 2XX error response from server.

`code` required string

code is the machine-readable error code.

Allowed: `internal 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 type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

POST `/api/v2/tasks/{taskID}/labels`

### Add 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 string

The ID of the task to label.

##### Header parameters

`Zap-Trace-Span` string

OpenTracing span context

#### Request body required

An object that contains a *`labelID`* to add to the task.

Content-Type: `application/json`

`labelID` required string

A label ID. Specifies the label to attach.

Example request [Ask AI about this](#)

```sh
curl --request POST \
  "http://localhost:8086/api/v2/tasks/{taskID}/labels" \
  --header "Authorization: Bearer INFLUX_TOKEN" \
  --header "Content-Type: application/json" \
  --data-raw '{
  "labelID": "LABELID"
}'
```

#### Responses

201 Success. The response body contains a list of all labels for the task.

`label` string

`links` string

400

Bad request. The response body contains detail about the error.

#### InfluxDB OSS v2

-   Returns this error if an incorrect value is passed in the `org` parameter or `orgID` parameter.

`code` required string

code is the machine-readable error code.

Allowed: `internal 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 type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

401

Unauthorized. The error may indicate one of the following:

-   The `Authorization: Token` header 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` string

The HTTP status code description. Default is `unauthorized`.

Allowed: `unauthorized`

`message` string

A human-readable message that may contain detail about the error.

404

Not 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 string

code is the machine-readable error code.

Allowed: `internal 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 type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

500 Internal server error. The server encountered an unexpected situation.

`code` required string

code is the machine-readable error code.

Allowed: `internal 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 type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

default Non 2XX error response from server.

`code` required string

code is the machine-readable error code.

Allowed: `internal 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 type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

DELETE `/api/v2/tasks/{taskID}/labels/{labelID}`

### Delete a label from a task

Deletes a label from a task.

#### Parameters

##### Path parameters

`taskID` required string

The ID of the task to delete the label from.

`labelID` required string

The ID of the label to delete.

##### Header parameters

`Zap-Trace-Span` string

OpenTracing span context

Example request [Ask AI about this](#)

```sh
curl --request DELETE \
  "http://localhost:8086/api/v2/tasks/{taskID}/labels/{labelID}" \
  --header "Authorization: Bearer INFLUX_TOKEN"
```

#### Responses

204 Success. The label is deleted.

400

Bad request. The response body contains detail about the error.

#### InfluxDB OSS v2

-   Returns this error if an incorrect value is passed in the `org` parameter or `orgID` parameter.

`code` required string

code is the machine-readable error code.

Allowed: `internal 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 type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

401

Unauthorized. The error may indicate one of the following:

-   The `Authorization: Token` header 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` string

The HTTP status code description. Default is `unauthorized`.

Allowed: `unauthorized`

`message` string

A human-readable message that may contain detail about the error.

404

Not 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 string

code is the machine-readable error code.

Allowed: `internal 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 type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

500 Internal server error. The server encountered an unexpected situation.

`code` required string

code is the machine-readable error code.

Allowed: `internal 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 type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

default Non 2XX error response from server.

`code` required string

code is the machine-readable error code.

Allowed: `internal 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 type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

GET `/api/v2/tasks/{taskID}/logs`

### Retrieve all logs for a task

Retrieves a list of all logs for a [task](/influxdb/v2/reference/glossary/#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 string

The task ID.

##### Header parameters

`Zap-Trace-Span` string

OpenTracing span context

Example request [Ask AI about this](#)

```sh
curl --request GET \
  "http://localhost:8086/api/v2/tasks/{taskID}/logs" \
  --header "Authorization: Bearer INFLUX_TOKEN"
```

#### Responses

200 Success. The response body contains an `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\[\]

400

Bad request. The response body contains detail about the error.

#### InfluxDB OSS v2

-   Returns this error if an incorrect value is passed in the `org` parameter or `orgID` parameter.

`code` required string

code is the machine-readable error code.

Allowed: `internal 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 type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

401

Unauthorized. The error may indicate one of the following:

-   The `Authorization: Token` header 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` string

The HTTP status code description. Default is `unauthorized`.

Allowed: `unauthorized`

`message` string

A human-readable message that may contain detail about the error.

404

Not 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 string

code is the machine-readable error code.

Allowed: `internal 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 type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

500 Internal server error. The server encountered an unexpected situation.

`code` required string

code is the machine-readable error code.

Allowed: `internal 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 type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

default Non 2XX error response from server.

`code` required string

code is the machine-readable error code.

Allowed: `internal 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 type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

GET `/api/v2/tasks/{taskID}/members`

### List all task members

**Deprecated**: Tasks don’t use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-\(API-tokens\)) to assign user permissions.

Lists all users that have the `member` role for the specified [task](/influxdb/v2/reference/glossary/#task).

#### Parameters

##### Path parameters

`taskID` required string

The task ID.

##### Header parameters

`Zap-Trace-Span` string

OpenTracing span context

Example request [Ask AI about this](#)

```sh
curl --request GET \
  "http://localhost:8086/api/v2/tasks/{taskID}/members" \
  --header "Authorization: Bearer INFLUX_TOKEN"
```

#### Responses

200 Success. The response body contains a list of `users` that have the `member` role for a task.

`links` object

`self` string <uri>

`users` object\[\]

default Unexpected error

`code` required string

code is the machine-readable error code.

Allowed: `internal 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 type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

POST `/api/v2/tasks/{taskID}/members`

### Add a member to a task

**Deprecated**: Tasks don’t use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-\(API-tokens\)) to assign user permissions.

Adds a user to members of a task and returns the member.

#### Parameters

##### Path parameters

`taskID` required string

The task ID.

##### Header parameters

`Zap-Trace-Span` string

OpenTracing span context

#### Request body required

A user to add as a member of the task.

Content-Type: `application/json`

`id` required string

The ID of the user to add to the resource.

`name` string

The name of the user to add to the resource.

Example request [Ask AI about this](#)

```sh
curl --request POST \
  "http://localhost:8086/api/v2/tasks/{taskID}/members" \
  --header "Authorization: Bearer INFLUX_TOKEN" \
  --header "Content-Type: application/json" \
  --data-raw '{
  "id": "ID",
  "name": "NAME"
}'
```

#### Responses

201 Created. The user is added to task members.

default Unexpected error

`code` required string

code is the machine-readable error code.

Allowed: `internal 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 type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

DELETE `/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`](#tag/Authorizations-\(API-tokens\)) to assign user permissions.

Removes a member from a [task](/influxdb/v2/reference/glossary/#task).

#### Parameters

##### Path parameters

`userID` required string

The ID of the member to remove.

`taskID` required string

The task ID.

##### Header parameters

`Zap-Trace-Span` string

OpenTracing span context

Example request [Ask AI about this](#)

```sh
curl --request DELETE \
  "http://localhost:8086/api/v2/tasks/{taskID}/members/{userID}" \
  --header "Authorization: Bearer INFLUX_TOKEN"
```

#### Responses

204 Member removed

default Unexpected error

`code` required string

code is the machine-readable error code.

Allowed: `internal 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 type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

GET `/api/v2/tasks/{taskID}/owners`

### List all owners of a task

**Deprecated**: Tasks don’t use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-\(API-tokens\)) to assign user permissions.

Retrieves all users that have owner permission for a task.

#### Parameters

##### Path parameters

`taskID` required string

The ID of the task to retrieve owners for.

##### Header parameters

`Zap-Trace-Span` string

OpenTracing span context

Example request [Ask AI about this](#)

```sh
curl --request GET \
  "http://localhost:8086/api/v2/tasks/{taskID}/owners" \
  --header "Authorization: Bearer INFLUX_TOKEN"
```

#### Responses

200

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` object

`self` string <uri>

`users` object\[\]

401

Unauthorized. The error may indicate one of the following:

-   The `Authorization: Token` header 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` string

The HTTP status code description. Default is `unauthorized`.

Allowed: `unauthorized`

`message` string

A human-readable message that may contain detail about the error.

422

Unprocessable 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 string

code is the machine-readable error code.

Allowed: `internal 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 type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

500 Internal server error. The server encountered an unexpected situation.

`code` required string

code is the machine-readable error code.

Allowed: `internal 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 type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

default Unexpected error

`code` required string

code is the machine-readable error code.

Allowed: `internal 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 type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

POST `/api/v2/tasks/{taskID}/owners`

### Add an owner for a task

**Deprecated**: Tasks don’t use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-\(API-tokens\)) 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 string

The task ID.

##### Header parameters

`Zap-Trace-Span` string

OpenTracing span context

#### Request body required

A user to add as an owner of the task.

Content-Type: `application/json`

`id` required string

The ID of the user to add to the resource.

`name` string

The name of the user to add to the resource.

Example request [Ask AI about this](#)

```sh
curl --request POST \
  "http://localhost:8086/api/v2/tasks/{taskID}/owners" \
  --header "Authorization: Bearer INFLUX_TOKEN" \
  --header "Content-Type: application/json" \
  --data-raw '{
  "id": "ID",
  "name": "NAME"
}'
```

#### Responses

201 Created. The task `owner` role is assigned to the user. The response body contains the resource owner with role and user detail.

401

Unauthorized. The error may indicate one of the following:

-   The `Authorization: Token` header 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` string

The HTTP status code description. Default is `unauthorized`.

Allowed: `unauthorized`

`message` string

A human-readable message that may contain detail about the error.

422

Unprocessable 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 string

code is the machine-readable error code.

Allowed: `internal 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 type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

500 Internal server error. The server encountered an unexpected situation.

`code` required string

code is the machine-readable error code.

Allowed: `internal 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 type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

default Unexpected error

`code` required string

code is the machine-readable error code.

Allowed: `internal 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 type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

DELETE `/api/v2/tasks/{taskID}/owners/{userID}`

### Remove an owner from a task

**Deprecated**: Tasks don’t use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-\(API-tokens\)) to assign user permissions.

#### Parameters

##### Path parameters

`userID` required string

The ID of the owner to remove.

`taskID` required string

The task ID.

##### Header parameters

`Zap-Trace-Span` string

OpenTracing span context

Example request [Ask AI about this](#)

```sh
curl --request DELETE \
  "http://localhost:8086/api/v2/tasks/{taskID}/owners/{userID}" \
  --header "Authorization: Bearer INFLUX_TOKEN"
```

#### Responses

204 Owner removed

default Unexpected error

`code` required string

code is the machine-readable error code.

Allowed: `internal 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 type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

GET `/api/v2/tasks/{taskID}/runs`

### List runs for a task

Retrieves a list of runs for a [task](/influxdb/v2/process-data/).

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 string

The ID of the task to get runs for. Only returns runs for this task.

##### Query parameters

`after` string

A task run ID. Only returns runs created after this run.

`limit` integer

Limits the number of task runs returned. Default is `100`.

Default: `100`

`afterTime` string <date-time>

A timestamp ([RFC3339 date/time format](/influxdb/v2/reference/glossary/#rfc3339-timestamp)). Only returns runs scheduled after this time.

`beforeTime` string <date-time>

A timestamp ([RFC3339 date/time format](/influxdb/v2/reference/glossary/#rfc3339-timestamp)). Only returns runs scheduled before this time.

##### Header parameters

`Zap-Trace-Span` string

OpenTracing span context

Example request [Ask AI about this](#)

```sh
curl --request GET \
  "http://localhost:8086/api/v2/tasks/{taskID}/runs" \
  --header "Authorization: Bearer INFLUX_TOKEN"
```

#### Responses

200 Success. The response body contains the list of task runs.

`links` string

`runs` object\[\]

401

Unauthorized. The error may indicate one of the following:

-   The `Authorization: Token` header 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` string

The HTTP status code description. Default is `unauthorized`.

Allowed: `unauthorized`

`message` string

A human-readable message that may contain detail about the error.

500 Internal server error. The server encountered an unexpected situation.

`code` required string

code is the machine-readable error code.

Allowed: `internal 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 type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

default Non 2XX error response from server.

`code` required string

code is the machine-readable error code.

Allowed: `internal 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 type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

POST `/api/v2/tasks/{taskID}/runs`

### Start 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](#operation/PostTasksIDRunsIDRetry).

#### Parameters

##### Path parameters

`taskID` required string

##### Header parameters

`Zap-Trace-Span` string

OpenTracing span context

#### Request body

Content-Type: `application/json`

`scheduledFor` string <date-time>

The time [RFC3339 date/time format](/influxdb/v2/reference/glossary/#rfc3339-timestamp) used for the run’s `now` option. Default is the server *now* time.

Example request [Ask AI about this](#)

```sh
curl --request POST \
  "http://localhost:8086/api/v2/tasks/{taskID}/runs" \
  --header "Authorization: Bearer INFLUX_TOKEN" \
  --header "Content-Type: application/json" \
  --data-raw '{
  "scheduledFor": "SCHEDULEDFOR"
}'
```

#### Responses

201 Success. The run is scheduled to start.

`finishedAt` string <date-time>

The time ([RFC3339Nano date/time format](https://go.dev/src/time/format.go)) the run finished executing.

Example: `"2006-01-02T15:04:05.999999999Z07:00"`

`flux` string

Flux used for the task

`id` string

`links` object

Example: `{"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\[\]

An array of logs associated with the run.

`requestedAt` string <date-time>

The time ([RFC3339Nano date/time format](/influxdb/v2/reference/glossary/#rfc3339nano-timestamp)) the run was manually requested.

Example: `"2006-01-02T15:04:05.999999999Z07:00"`

`scheduledFor` string <date-time>

The time [RFC3339 date/time format](/influxdb/v2/reference/glossary/#rfc3339-timestamp) used for the run’s `now` option.

`startedAt` string <date-time>

The time ([RFC3339Nano date/time format](https://go.dev/src/time/format.go)) the run started executing.

Example: `"2006-01-02T15:04:05.999999999Z07:00"`

`status` string

Allowed: `scheduled` , `started` , `failed` , `success` , `canceled`

`taskID` string

401

Unauthorized. The error may indicate one of the following:

-   The `Authorization: Token` header 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` string

The HTTP status code description. Default is `unauthorized`.

Allowed: `unauthorized`

`message` string

A human-readable message that may contain detail about the error.

500 Internal server error. The server encountered an unexpected situation.

`code` required string

code is the machine-readable error code.

Allowed: `internal 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 type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

default Non 2XX error response from server.

`code` required string

code is the machine-readable error code.

Allowed: `internal 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 type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

GET `/api/v2/tasks/{taskID}/runs/{runID}`

### Retrieve a run for a task.

Retrieves a specific run for a [task](/influxdb/v2/reference/glossary/#task).

Use this endpoint to retrieve detail and logs for a specific task run.

#### Parameters

##### Path parameters

`taskID` required string

The ID of the task to retrieve runs for.

`runID` required string

The ID of the run to retrieve.

##### Header parameters

`Zap-Trace-Span` string

OpenTracing span context

Example request [Ask AI about this](#)

```sh
curl --request GET \
  "http://localhost:8086/api/v2/tasks/{taskID}/runs/{runID}" \
  --header "Authorization: Bearer INFLUX_TOKEN"
```

#### Responses

200 Success. The response body contains the task run.

`finishedAt` string <date-time>

The time ([RFC3339Nano date/time format](https://go.dev/src/time/format.go)) the run finished executing.

Example: `"2006-01-02T15:04:05.999999999Z07:00"`

`flux` string

Flux used for the task

`id` string

`links` object

Example: `{"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\[\]

An array of logs associated with the run.

`requestedAt` string <date-time>

The time ([RFC3339Nano date/time format](/influxdb/v2/reference/glossary/#rfc3339nano-timestamp)) the run was manually requested.

Example: `"2006-01-02T15:04:05.999999999Z07:00"`

`scheduledFor` string <date-time>

The time [RFC3339 date/time format](/influxdb/v2/reference/glossary/#rfc3339-timestamp) used for the run’s `now` option.

`startedAt` string <date-time>

The time ([RFC3339Nano date/time format](https://go.dev/src/time/format.go)) the run started executing.

Example: `"2006-01-02T15:04:05.999999999Z07:00"`

`status` string

Allowed: `scheduled` , `started` , `failed` , `success` , `canceled`

`taskID` string

400

Bad request. The response body contains detail about the error.

#### InfluxDB OSS v2

-   Returns this error if an incorrect value is passed in the `org` parameter or `orgID` parameter.

`code` required string

code is the machine-readable error code.

Allowed: `internal 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 type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

401

Unauthorized. The error may indicate one of the following:

-   The `Authorization: Token` header 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` string

The HTTP status code description. Default is `unauthorized`.

Allowed: `unauthorized`

`message` string

A human-readable message that may contain detail about the error.

404

Not 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 string

code is the machine-readable error code.

Allowed: `internal 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 type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

500 Internal server error. The server encountered an unexpected situation.

`code` required string

code is the machine-readable error code.

Allowed: `internal 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 type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

default Non 2XX error response from server.

`code` required string

code is the machine-readable error code.

Allowed: `internal 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 type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

DELETE `/api/v2/tasks/{taskID}/runs/{runID}`

### Cancel a running task

Cancels a running [task](/influxdb/v2/reference/glossary/#task).

Use this endpoint with InfluxDB OSS to cancel a running task.

#### InfluxDB Cloud

-   Doesn’t support this operation.

#### Parameters

##### Path parameters

`taskID` required string

The ID of the task to cancel.

`runID` required string

The ID of the task run to cancel.

##### Header parameters

`Zap-Trace-Span` string

OpenTracing span context

Example request [Ask AI about this](#)

```sh
curl --request DELETE \
  "http://localhost:8086/api/v2/tasks/{taskID}/runs/{runID}" \
  --header "Authorization: Bearer INFLUX_TOKEN"
```

#### Responses

204

Success. The `DELETE` is accepted and the run will be cancelled.

#### InfluxDB Cloud

-   Doesn’t support this operation.
-   Doesn’t return this status.

400

Bad request. The response body contains detail about the error.

#### InfluxDB OSS v2

-   Returns this error if an incorrect value is passed in the `org` parameter or `orgID` parameter.

`code` required string

code is the machine-readable error code.

Allowed: `internal 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 type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

401

Unauthorized. The error may indicate one of the following:

-   The `Authorization: Token` header 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` string

The HTTP status code description. Default is `unauthorized`.

Allowed: `unauthorized`

`message` string

A human-readable message that may contain detail about the error.

404

Not 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 string

code is the machine-readable error code.

Allowed: `internal 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 type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

405

Method not allowed.

#### InfluxDB Cloud

-   Always returns this error; doesn’t support cancelling tasks.

#### InfluxDB OSS v2

-   Doesn’t return this error.

`code` required string

code is the machine-readable error code.

Allowed: `internal 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 type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

500 Internal server error. The server encountered an unexpected situation.

`code` required string

code is the machine-readable error code.

Allowed: `internal 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 type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

default Non 2XX error response from server.

`code` required string

code is the machine-readable error code.

Allowed: `internal 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 type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

GET `/api/v2/tasks/{taskID}/runs/{runID}/logs`

### Retrieve 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 string

The ID of the task to get logs for.

`runID` required string

The ID of the run to get logs for.

##### Header parameters

`Zap-Trace-Span` string

OpenTracing span context

Example request [Ask AI about this](#)

```sh
curl --request GET \
  "http://localhost:8086/api/v2/tasks/{taskID}/runs/{runID}/logs" \
  --header "Authorization: Bearer INFLUX_TOKEN"
```

#### Responses

200 Success. The response body contains an `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\[\]

400

Bad request. The response body contains detail about the error.

#### InfluxDB OSS v2

-   Returns this error if an incorrect value is passed in the `org` parameter or `orgID` parameter.

`code` required string

code is the machine-readable error code.

Allowed: `internal 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 type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

401

Unauthorized. The error may indicate one of the following:

-   The `Authorization: Token` header 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` string

The HTTP status code description. Default is `unauthorized`.

Allowed: `unauthorized`

`message` string

A human-readable message that may contain detail about the error.

404

Not 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 string

code is the machine-readable error code.

Allowed: `internal 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 type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

500 Internal server error. The server encountered an unexpected situation.

`code` required string

code is the machine-readable error code.

Allowed: `internal 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 type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

default Non 2XX error response from server.

`code` required string

code is the machine-readable error code.

Allowed: `internal 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 type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

POST `/api/v2/tasks/{taskID}/runs/{runID}/retry`

### Retry a task run

Queues a [task](/influxdb/v2/reference/glossary/#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](#operation/PostTasksIDRuns).

#### Limitations

-   The task must be *active* (`status: "active"`).

#### Parameters

##### Path parameters

`taskID` required string

A [task](/influxdb/v2/reference/glossary/#task) ID. Specifies the task to retry.

`runID` required string

A [task](/influxdb/v2/reference/glossary/#task) run ID. Specifies the task run to retry.

To find a task run ID, use the [`GET /api/v2/tasks/{taskID}/runs` endpoint](#operation/GetTasksIDRuns) to list task runs.

##### Header parameters

`Zap-Trace-Span` string

OpenTracing span context

#### Request body

Content-Type: `application/json`

Example request [Ask AI about this](#)

```sh
curl --request POST \
  "http://localhost:8086/api/v2/tasks/{taskID}/runs/{runID}/retry" \
  --header "Authorization: Bearer INFLUX_TOKEN" \
  --header "Content-Type: application/json; charset=utf-8"
```

#### Responses

200 Success. The response body contains the queued run.

`finishedAt` string <date-time>

The time ([RFC3339Nano date/time format](https://go.dev/src/time/format.go)) the run finished executing.

Example: `"2006-01-02T15:04:05.999999999Z07:00"`

`flux` string

Flux used for the task

`id` string

`links` object

Example: `{"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\[\]

An array of logs associated with the run.

`requestedAt` string <date-time>

The time ([RFC3339Nano date/time format](/influxdb/v2/reference/glossary/#rfc3339nano-timestamp)) the run was manually requested.

Example: `"2006-01-02T15:04:05.999999999Z07:00"`

`scheduledFor` string <date-time>

The time [RFC3339 date/time format](/influxdb/v2/reference/glossary/#rfc3339-timestamp) used for the run’s `now` option.

`startedAt` string <date-time>

The time ([RFC3339Nano date/time format](https://go.dev/src/time/format.go)) the run started executing.

Example: `"2006-01-02T15:04:05.999999999Z07:00"`

`status` string

Allowed: `scheduled` , `started` , `failed` , `success` , `canceled`

`taskID` string

400

Bad 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 string

code is the machine-readable error code.

Allowed: `internal 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 type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

401

Unauthorized. The error may indicate one of the following:

-   The `Authorization: Token` header 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` string

The HTTP status code description. Default is `unauthorized`.

Allowed: `unauthorized`

`message` string

A human-readable message that may contain detail about the error.

404

Not 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 string

code is the machine-readable error code.

Allowed: `internal 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 type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

500 Internal server error. The server encountered an unexpected situation.

`code` required string

code is the machine-readable error code.

Allowed: `internal 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 type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

default Non 2XX error response from server.

`code` required string

code is the machine-readable error code.

Allowed: `internal 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 type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

#### Related

-   [Get started with tasks](/influxdb/v2/process-data/get-started/)
