> ## Documentation Index
> Fetch the complete documentation index at: https://task-social.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete a task

> Deletes a task owned by the authenticated user.



## OpenAPI

````yaml /openapi-bundled.yaml delete /api/v1/tasks/{id}
openapi: 3.1.0
info:
  title: TaskSocial API
  version: 1.0.0
  description: REST API for TaskSocial, a social accountability application.
servers:
  - url: https://tasksocial-production.up.railway.app
    description: TaskSocial production API
security: []
tags:
  - name: Authentication
    description: User registration and authentication
  - name: Tasks
    description: Task creation and management
paths:
  /api/v1/tasks/{id}:
    parameters:
      - $ref: '#/components/parameters/TaskIdParameter'
    delete:
      tags:
        - Tasks
      summary: Delete a task
      description: Deletes a task owned by the authenticated user.
      operationId: deleteTask
      responses:
        '200':
          description: Task deleted successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                message: Task deleted successfully
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: The authenticated user does not own the task.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Task not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          $ref: '#/components/responses/ServerError'
      security:
        - cookieAuth: []
components:
  parameters:
    TaskIdParameter:
      name: id
      in: path
      required: true
      description: MongoDB ObjectId of the task.
      schema:
        type: string
  schemas:
    Error:
      type: object
      properties:
        message:
          type: string
  responses:
    Unauthorized:
      description: Authentication is required or the authentication token is invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ServerError:
      description: Unexpected server error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    cookieAuth:
      type: apiKey
      in: cookie
      name: tokenName
      description: >
        JWT authentication cookie. The server sets this cookie after a
        successful login. You do not need to generate or provide an API key
        manually. Use the login endpoint first, then the browser or HTTP client
        sends this cookie with protected requests.

````