InfluxData Tasks API

Process and analyze your data with [tasks](https://docs.influxdata.com/influxdb/cloud/reference/glossary/#task) in the InfluxDB task engine. Use the `/api/v2/tasks` endpoints to schedule and manage tasks, retry task runs, and retrieve run logs. To configure a task, provide the script and the schedule to run the task. For examples, see how to create a task with the [`POST /api/v2/tasks` endpoint](#operation/PostTasks). ### Properties A `task` object contains information about an InfluxDB task resource. The following table defines the properties that appear in this object: ### Related guides - [Get started with tasks](https://docs.influxdata.com/influxdb/cloud/process-data/get-started/) - [Common data processing tasks](https://docs.influxdata.com/influxdb/cloud/process-data/common-tasks/) - [Create a script](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/#create-an-invokable-script)

OpenAPI Specification

influxdata-tasks-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: InfluxDB Cloud API Service Authorizations (API tokens) Authorizations (API tokens) Tasks API
  version: 2.0.1
  description: 'The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.

    '
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
servers:
- url: /api/v2
security:
- TokenAuthentication: []
tags:
- name: Tasks
  description: 'Process and analyze your data with [tasks](https://docs.influxdata.com/influxdb/cloud/reference/glossary/#task)

    in the InfluxDB task engine.

    Use the `/api/v2/tasks` endpoints to schedule and manage tasks, retry task runs, and retrieve run logs.


    To configure a task, provide the script and the schedule to run the task.

    For examples, see how to create a task with the [`POST /api/v2/tasks` endpoint](#operation/PostTasks).


    <span id="tasks-schemaref-task" />


    ### Properties


    A `task` object contains information about an InfluxDB task resource.


    The following table defines the properties that appear in this object:


    <SchemaDefinition schemaRef="#/components/schemas/Task" />


    ### Related guides


    - [Get started with tasks](https://docs.influxdata.com/influxdb/cloud/process-data/get-started/)

    - [Common data processing tasks](https://docs.influxdata.com/influxdb/cloud/process-data/common-tasks/)

    - [Create a script](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/#create-an-invokable-script)

    '
paths:
  /tasks/{taskID}/runs:
    get:
      operationId: GetTasksIDRuns
      tags:
      - Tasks
      summary: List runs for a task
      description: 'Retrieves a list of runs for a [task](https://docs.influxdata.com/influxdb/cloud/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:
      - $ref: '#/components/parameters/TraceSpan'
      - in: path
        name: taskID
        schema:
          type: string
        required: true
        description: 'The ID of the task to get runs for.

          Only returns runs for this task.

          '
      - in: query
        name: after
        schema:
          type: string
        description: A task run ID. Only returns runs created after this run.
      - in: query
        name: limit
        schema:
          type: integer
          minimum: 1
          maximum: 500
          default: 100
        description: 'Limits the number of task runs returned. Default is `100`.

          '
      - in: query
        name: afterTime
        schema:
          type: string
          format: date-time
        description: 'A timestamp ([RFC3339 date/time format](https://docs.influxdata.com/influxdb/cloud/reference/glossary/#rfc3339-timestamp)).

          Only returns runs scheduled after this time.

          '
      - in: query
        name: beforeTime
        schema:
          type: string
          format: date-time
        description: 'A timestamp ([RFC3339 date/time format](https://docs.influxdata.com/influxdb/cloud/reference/glossary/#rfc3339-timestamp)).

          Only returns runs scheduled before this time.

          '
      responses:
        '200':
          description: Success. The response body contains the list of task runs.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Runs'
        '401':
          $ref: '#/components/responses/AuthorizationError'
        '500':
          $ref: '#/components/responses/InternalServerError'
        default:
          $ref: '#/components/responses/GeneralServerError'
    post:
      operationId: PostTasksIDRuns
      tags:
      - Tasks
      summary: Start a task run, overriding the schedule
      description: '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:
      - $ref: '#/components/parameters/TraceSpan'
      - in: path
        name: taskID
        schema:
          type: string
        required: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RunManually'
      responses:
        '201':
          description: Success. The run is scheduled to start.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Run'
        '401':
          $ref: '#/components/responses/AuthorizationError'
        '500':
          $ref: '#/components/responses/InternalServerError'
        default:
          $ref: '#/components/responses/GeneralServerError'
  /tasks/{taskID}/runs/{runID}:
    get:
      operationId: GetTasksIDRunsID
      tags:
      - Tasks
      summary: Retrieve a run for a task.
      description: 'Retrieves a specific run for a [task](https://docs.influxdata.com/influxdb/cloud/reference/glossary/#task).


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

        '
      parameters:
      - $ref: '#/components/parameters/TraceSpan'
      - in: path
        name: taskID
        schema:
          type: string
        required: true
        description: The ID of the task to retrieve runs for.
      - in: path
        name: runID
        schema:
          type: string
        required: true
        description: The ID of the run to retrieve.
      responses:
        '200':
          description: Success. The response body contains the task run.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Run'
              examples:
                runSuccess:
                  summary: A successful task run.
                  value:
                    links:
                      logs: /api/v2/tasks/0996e56b2f378000/runs/09b070dadaa7d000/logs
                      retry: /api/v2/tasks/0996e56b2f378000/runs/09b070dadaa7d000/retry
                      self: /api/v2/tasks/0996e56b2f378000/runs/09b070dadaa7d000
                      task: /api/v2/tasks/0996e56b2f378000
                    id: 09b070dadaa7d000
                    taskID: 0996e56b2f378000
                    status: success
                    scheduledFor: '2022-07-18T14:46:06Z'
                    startedAt: '2022-07-18T14:46:07.16222Z'
                    finishedAt: '2022-07-18T14:46:07.308254Z'
                    requestedAt: '2022-07-18T14:46:06Z'
                    log:
                    - runID: 09b070dadaa7d000
                      time: '2022-07-18T14:46:07.101231Z'
                      message: 'Started task from script: "option task = {name: \"task1\", every: 30m} from(bucket: \"iot_center\") |> range(start: -90d) |> filter(fn: (r) => r._measurement == \"environment\")               |> aggregateWindow(every: 1h, fn: mean)"'
                    - runID: 09b070dadaa7d000
                      time: '2022-07-18T14:46:07.242859Z'
                      message: Completed(success)
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/AuthorizationError'
        '404':
          $ref: '#/components/responses/ResourceNotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
        default:
          $ref: '#/components/responses/GeneralServerError'
    delete:
      operationId: DeleteTasksIDRunsID
      tags:
      - Tasks
      summary: Cancel a running task
      description: 'Cancels a running [task](https://docs.influxdata.com/influxdb/cloud/reference/glossary/#task).


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


        #### InfluxDB Cloud


        - Doesn''t support this operation.

        '
      parameters:
      - $ref: '#/components/parameters/TraceSpan'
      - in: path
        name: taskID
        schema:
          type: string
        required: true
        description: The ID of the task to cancel.
      - in: path
        name: runID
        schema:
          type: string
        required: true
        description: The ID of the task run to cancel.
      responses:
        '204':
          description: 'Success. The `DELETE` is accepted and the run will be cancelled.


            #### InfluxDB Cloud


            - Doesn''t support this operation.

            - Doesn''t return this status.

            '
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/AuthorizationError'
        '404':
          $ref: '#/components/responses/ResourceNotFoundError'
        '405':
          description: "Method not allowed.\n\n#### InfluxDB Cloud\n\n  - Always returns this error; doesn't support cancelling tasks.\n\n#### InfluxDB OSS\n\n  - Doesn't return this error.\n"
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          $ref: '#/components/responses/InternalServerError'
        default:
          $ref: '#/components/responses/GeneralServerError'
  /tasks/{taskID}/runs/{runID}/retry:
    post:
      operationId: PostTasksIDRunsIDRetry
      tags:
      - Tasks
      summary: Retry a task run
      description: 'Queues a [task](https://docs.influxdata.com/influxdb/cloud/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"`).

        '
      requestBody:
        content:
          application/json; charset=utf-8:
            schema:
              type: object
      parameters:
      - $ref: '#/components/parameters/TraceSpan'
      - in: path
        name: taskID
        schema:
          type: string
        required: true
        description: 'A [task](https://docs.influxdata.com/influxdb/cloud/reference/glossary/#task)  ID.

          Specifies the task to retry.

          '
      - in: path
        name: runID
        schema:
          type: string
        required: true
        description: 'A [task](https://docs.influxdata.com/influxdb/cloud/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.

          '
      responses:
        '200':
          description: Success. The response body contains the queued run.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Run'
              examples:
                retryTaskRun:
                  summary: A task run scheduled to retry
                  value:
                    links:
                      logs: /api/v2/tasks/09a776832f381000/runs/09d60ffe08738000/logs
                      retry: /api/v2/tasks/09a776832f381000/runs/09d60ffe08738000/retry
                      self: /api/v2/tasks/09a776832f381000/runs/09d60ffe08738000
                      task: /api/v2/tasks/09a776832f381000
                    id: 09d60ffe08738000
                    taskID: 09a776832f381000
                    status: scheduled
                    scheduledFor: '2022-08-15T00:00:00Z'
                    requestedAt: '2022-08-16T20:05:11.84145Z'
        '400':
          description: 'Bad request.

            The response body contains detail about the error.


            InfluxDB may return this error for the following reasons:


            - The task has `status: inactive`.

            '
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                inactiveTask:
                  summary: Can't retry an inactive task
                  value:
                    code: invalid
                    message: 'failed to retry run: inactive task'
        '401':
          $ref: '#/components/responses/AuthorizationError'
        '404':
          $ref: '#/components/responses/ResourceNotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
        default:
          $ref: '#/components/responses/GeneralServerError'
  /tasks/{taskID}/logs:
    get:
      operationId: GetTasksIDLogs
      tags:
      - Tasks
      summary: Retrieve all logs for a task
      description: 'Retrieves a list of all logs for a [task](https://docs.influxdata.com/influxdb/cloud/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:
      - $ref: '#/components/parameters/TraceSpan'
      - in: path
        name: taskID
        schema:
          type: string
        required: true
        description: The task ID.
      responses:
        '200':
          description: '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.

            '
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Logs'
              examples:
                taskSuccess:
                  summary: Events for a successful task run.
                  value:
                    events:
                    - runID: 09b070dadaa7d000
                      time: '2022-07-18T14:46:07.101231Z'
                      message: 'Started task from script: "option task = {name: \"task1\", every: 30m} from(bucket: \"iot_center\") |> range(start: -90d) |> filter(fn: (r) => r._measurement == \"environment\") |> aggregateWindow(every: 1h, fn: mean)"'
                    - runID: 09b070dadaa7d000
                      time: '2022-07-18T14:46:07.242859Z'
                      message: Completed(success)
                taskFailure:
                  summary: Events for a failed task run.
                  value:
                    events:
                    - runID: 09a946fc3167d000
                      time: '2022-07-13T07:06:54.198167Z'
                      message: 'Started task from script: "option task = {name: \"test task\", every: 3d, offset: 0s}"'
                    - runID: 09a946fc3167d000
                      time: '2022-07-13T07:07:13.104037Z'
                      message: Completed(failed)
                    - runID: 09a946fc3167d000
                      time: '2022-07-13T08:24:37.115323Z'
                      message: 'error exhausting result iterator: error in query specification while starting program: this Flux script returns no streaming data. Consider adding a "yield" or invoking streaming functions directly, without performing an assignment'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/AuthorizationError'
        '404':
          $ref: '#/components/responses/ResourceNotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
        default:
          $ref: '#/components/responses/GeneralServerError'
  /tasks/{taskID}/runs/{runID}/logs:
    get:
      operationId: GetTasksIDRunsIDLogs
      tags:
      - Tasks
      summary: Retrieve all logs for a run
      description: '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:
      - $ref: '#/components/parameters/TraceSpan'
      - in: path
        name: taskID
        schema:
          type: string
        required: true
        description: The ID of the task to get logs for.
      - in: path
        name: runID
        schema:
          type: string
        required: true
        description: The ID of the run to get logs for.
      responses:
        '200':
          description: '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.

            '
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Logs'
              examples:
                taskSuccess:
                  summary: Events for a successful task run.
                  value:
                    events:
                    - runID: 09b070dadaa7d000
                      time: '2022-07-18T14:46:07.101231Z'
                      message: 'Started task from script: "option task = {name: \"task1\", every: 30m} from(bucket: \"iot_center\") |> range(start: -90d) |> filter(fn: (r) => r._measurement == \"environment\") |> aggregateWindow(every: 1h, fn: mean)"'
                    - runID: 09b070dadaa7d000
                      time: '2022-07-18T14:46:07.242859Z'
                      message: Completed(success)
                taskFailure:
                  summary: Events for a failed task.
                  value:
                    events:
                    - runID: 09a946fc3167d000
                      time: '2022-07-13T07:06:54.198167Z'
                      message: 'Started task from script: "option task = {name: \"test task\", every: 3d, offset: 0s}"'
                    - runID: 09a946fc3167d000
                      time: '2022-07-13T07:07:13.104037Z'
                      message: Completed(failed)
                    - runID: 09a946fc3167d000
                      time: '2022-07-13T08:24:37.115323Z'
                      message: 'error exhausting result iterator: error in query specification while starting program: this Flux script returns no streaming data. Consider adding a "yield" or invoking streaming functions directly, without performing an assignment'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/AuthorizationError'
        '404':
          $ref: '#/components/responses/ResourceNotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
        default:
          $ref: '#/components/responses/GeneralServerError'
  /tasks/{taskID}/labels:
    get:
      operationId: GetTasksIDLabels
      tags:
      - Tasks
      summary: List labels for a task
      description: 'Retrieves a list of all labels for a task.


        Labels may be used for grouping and filtering tasks.

        '
      parameters:
      - $ref: '#/components/parameters/TraceSpan'
      - in: path
        name: taskID
        schema:
          type: string
        required: true
        description: The ID of the task to retrieve labels for.
      responses:
        '200':
          description: Success. The response body contains a list of all labels for the task.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LabelsResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/AuthorizationError'
        '404':
          $ref: '#/components/responses/ResourceNotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
        default:
          $ref: '#/components/responses/GeneralServerError'
    post:
      operationId: PostTasksIDLabels
      tags:
      - Tasks
      summary: Add a label to a task
      description: '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:
      - $ref: '#/components/parameters/TraceSpan'
      - in: path
        name: taskID
        schema:
          type: string
        required: true
        description: The ID of the task to label.
      requestBody:
        description: An object that contains a _`labelID`_ to add to the task.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LabelMapping'
      responses:
        '201':
          description: Success. The response body contains a list of all labels for the task.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LabelResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/AuthorizationError'
        '404':
          $ref: '#/components/responses/ResourceNotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
        default:
          $ref: '#/components/responses/GeneralServerError'
  /tasks/{taskID}/labels/{labelID}:
    delete:
      operationId: DeleteTasksIDLabelsID
      tags:
      - Tasks
      summary: Delete a label from a task
      description: 'Deletes a label from a task.

        '
      parameters:
      - $ref: '#/components/parameters/TraceSpan'
      - in: path
        name: taskID
        schema:
          type: string
        required: true
        description: The ID of the task to delete the label from.
      - in: path
        name: labelID
        schema:
          type: string
        required: true
        description: The ID of the label to delete.
      responses:
        '204':
          description: Success. The label is deleted.
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/AuthorizationError'
        '404':
          $ref: '#/components/responses/ResourceNotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
        default:
          $ref: '#/components/responses/GeneralServerError'
  /tasks/{taskID}/members:
    get:
      operationId: GetTasksIDMembers
      deprecated: true
      tags:
      - Tasks
      summary: List all task members
      description: '**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](https://docs.influxdata.com/influxdb/cloud/reference/glossary/#task).

        '
      parameters:
      - $ref: '#/components/parameters/TraceSpan'
      - in: path
        name: taskID
        schema:
          type: string
        required: true
        description: The task ID.
      responses:
        '200':
          description: 'Success. The response body contains a list of `users` that have

            the `member` role for a task.

            '
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceMembers'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    post:
      operationId: PostTasksIDMembers
      deprecated: true
      tags:
      - Tasks
      summary: Add a member to a task
      description: '**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:
      - $ref: '#/components/parameters/TraceSpan'
      - in: path
        name: taskID
        schema:
          type: string
        required: true
        description: The task ID.
      requestBody:
        description: A user to add as a member of the task.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddResourceMemberRequestBody'
      responses:
        '201':
          description: Created. The user is added to task members.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceMember'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /tasks/{taskID}/members/{userID}:
    delete:
      operationId: DeleteTasksIDMembersID
      deprecated: true
      tags:
      - Tasks
      summary: Remove a member from a task
      description: '**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](https://docs.influxdata.com/influxdb/cloud/reference/glossary/#task).

        '
      parameters:
      - $ref: '#/components/parameters/TraceSpan'
      - in: path
        name: userID
        schema:
          type: string
        required: true
        description: The ID of the member to remove.
      - in: path
        name: taskID
        schema:
          type: string
        required: true
        description: The task ID.
      responses:
        '204':
          description: Member removed
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /tasks/{taskID}/owners:
    get:
      operationId: GetTasksIDOwners
      deprecated: true
      tags:
      - Tasks
      summary: List all owners of a task
      description: '**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:
      - $ref: '#/components/parameters/TraceSpan'
      - in: path
        name: taskID
        schema:
          type: string
        required: true
        description: The ID of the task to retrieve owners for.
      responses:
        '200':
          description: '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.

            '
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceOwners'
        '401':
          $ref: '#/components/responses/AuthorizationError'
        '422':
          description: '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.

            '
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          $ref: '#/components/responses/InternalServerError'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    post:
      operationId: PostTasksIDOwners
      deprecated: true
      tags:
      - Tasks
      summary: Add an owner for a task
      description: '**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:
      - $ref: '#/components/parameters/TraceSpan'
      - in: path
        name: taskID
        schema:
          type: string
        required: true
        description: The task ID.
      requestBody:
        description: A user to add as an owner of the task.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddResourceMemberRequestBody'
      responses:
        '201':
          description: 'Created. The task `owner` role is assigned to the user.

            The response body contains the resource owner with

            role and user detail.

            '
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceOwner'
              examples:
                createdOwner:
                  summary: User has the owner role for the resource
                  value:
                    role: owner
                    links:
                      logs: /api/v2/users/0772396d1f411000/logs
                      self: /api/v2/users/0772396d1f411000
                    id: 0772396d1f411000
                    name: USER_NAME
                    status: active
        '401':
          $ref: '#/components/responses/AuthorizationError'
        '422':
          description: '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.

            '
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          $ref: '#/components/responses/InternalServerError'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /tasks/{taskID}/owners/{userID}:
    delete:
      operationId: DeleteTasksIDOwnersID
      deprecated: true
      tags:
      - Tasks
      summary: Remove an owner from a task
      description: '**Deprecated**: Tasks don''t use `owner` and `member` roles.

        Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions.

        '
      parameters:
      - $ref: '#/components/parameters/TraceSpan'
      - in: path
        name: userID
        schema:
          type: string
        required: true
        description: The ID of the owner to remove.
      - in: path
        name: taskID
        schema:
          type: string
        required: true
        description: The task ID.
      responses:
        '204':
          description: Owner removed
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /tasks:
    get:
      operationId: GetTasks
      tags:
      - Tasks
      summary: List all tasks
      description: 'Retrieves a list of [tasks](https://docs.influxdata.com/influxdb/cloud/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`.

        '
      parameters:
      - $ref: '#/components/parameters/TraceSpan'
      - in: query
        name: name
        description: 'A [task](https://docs.influxdata.com/influxdb/cloud/reference/glossary/#task) name.

          Only returns tasks with the specified name.

          Different tasks may have the same name.

          '
        schema:
          type: string
      - in: query
        name: after
        schema:
          type: string
        description: 'A [task](https://docs.influxdata.com/influxdb/cloud/reference/glossary/#task) ID.

          Only returns tasks created after the specified task.

          '
      - in: query
 

# --- truncated at 32 KB (74 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/influxdata/refs/heads/main/openapi/influxdata-tasks-api-openapi.yml