> ## Documentation Index
> Fetch the complete documentation index at: https://docs.apigene.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Task Delete

> Endpoint to delete an existing task by its ID.
Only the original creator of the task is authorized to delete the task.

Args:
    task_id (str): The unique identifier of the task to be deleted.

Returns:
    dict: A confirmation message on successful deletion.

Raises:
    HTTPException 403: If the current user is not authorized to delete the task.
    HTTPException 404: If the task is not found.
    HTTPException 500: If a runtime error occurs during deletion.



## OpenAPI

````yaml delete /api/task/{task_id}
openapi: 3.1.0
info:
  title: Apigene
  description: Apigene API
  version: 1.0.0
  contact:
    name: Apigene Support
    url: https://app.apigene.ai
    email: support@apigene.ai
servers:
  - url: https://app.apigene.ai
security:
  - BearerAuth: []
paths:
  /api/task/{task_id}:
    delete:
      tags:
        - Task
      summary: Task Delete
      description: |-
        Endpoint to delete an existing task by its ID.
        Only the original creator of the task is authorized to delete the task.

        Args:
            task_id (str): The unique identifier of the task to be deleted.

        Returns:
            dict: A confirmation message on successful deletion.

        Raises:
            HTTPException 403: If the current user is not authorized to delete the task.
            HTTPException 404: If the task is not found.
            HTTPException 500: If a runtime error occurs during deletion.
      operationId: task_delete
      parameters:
        - name: task_id
          in: path
          required: true
          schema:
            type: string
            title: Task Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - BearerAuth: []
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        JWT Authorization header using the Bearer scheme. Example:
        'Authorization: Bearer {token}'

````