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

# Cancel Task

> Cancels an existing task by its ID



## OpenAPI

````yaml POST /media/task/cancel/{taskId}
openapi: 3.0.1
info:
  title: Charp.ai API
  description: >-
    API ecosystem for vendor management, authentication, campaign management,
    and tools for enhancing campaign execution including realtime media
    generation
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://whilter-api-host
security:
  - bearerAuth: []
tags:
  - name: Authentication
    description: Operations related to API authentication
  - name: Realtime Media
    description: Operations for generating personalized videos in real-time
  - name: Webhooks
    description: Webhook endpoints for receiving notifications
  - name: Virtual Try-On
    description: Operations related to virtual try-on functionality
  - name: Tasks
    description: Operations related to task management
paths:
  /media/task/cancel/{taskId}:
    post:
      tags:
        - Tasks
      summary: Cancel a task
      description: Cancels an existing task by its ID
      operationId: cancelTask
      parameters:
        - name: taskId
          in: path
          required: true
          description: The unique identifier of the task to cancel
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Task cancelled successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CancelTaskResponse'
        '400':
          description: Bad request - Invalid task ID
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    CancelTaskResponse:
      type: object
      properties:
        client-id:
          type: string
          description: Client ID provided during vendor onboarding
        campaign-id:
          type: string
          description: Identifier for the campaign
        template-id:
          type: string
          format: uuid
          description: Unique identifier for the template to use
        task-id:
          type: string
          format: uuid
          description: Unique identifier for the created task
        message:
          type: string
          description: Response message
          example: Task cancelled successfully
    ErrorResponse:
      type: object
      properties:
        error:
          type: boolean
          description: Indicates an error occurred
          example: true
        message:
          type: string
          description: Error message
          example: Invalid authentication token
        code:
          type: string
          description: Error code
          example: UNAUTHORIZED
        timestamp:
          type: string
          format: date-time
          description: Timestamp when the error occurred
          example: '2025-01-27T10:30:46Z'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````