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

# Delete task attachments

> Deletes one or more attachments from a task.



## OpenAPI

````yaml /api-reference/openapi.json delete /tasks/{task_id}/attachments
openapi: 3.1.0
info:
  title: COR API
  description: >-
    The COR API lets you integrate with projectcor.com applications using simple
    HTTP methods, in either XML or JSON formats, making this an ideal API for
    developing integrations with other softwares, external clients or mobile
    applications
  version: 1.0.0
servers:
  - url: https://api.projectcor.com/v1
    description: Production server
security:
  - bearerAuth: []
paths:
  /tasks/{task_id}/attachments:
    delete:
      tags:
        - Tasks
      summary: Delete task attachments
      description: Deletes one or more attachments from a task.
      parameters:
        - name: task_id
          in: path
          required: true
          schema:
            type: integer
          description: ID of the task
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - attachments
              properties:
                attachments:
                  oneOf:
                    - type: array
                      items:
                        type: integer
                    - type: integer
                  description: ID(s) of the attachment(s) to delete
                lastPage:
                  type: integer
                  description: Last page number (used for re-pagination)
                order:
                  type: object
                  default:
                    created_at: DESC
                  description: Sort criteria for replacement elements
      responses:
        '200':
          description: Attachments deleted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskAttachmentDeleteResponse'
        '404':
          description: Attachment not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CORErrorResponse'
              example:
                status: ERROR
                code: FS003
                message: Undefined attachment
        '417':
          description: Validation failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CORCustomError'
              example:
                status: 417
                name: CORCustomError
                code: AC001
                message: exists validation failed on taskId
components:
  schemas:
    TaskAttachmentDeleteResponse:
      type: object
      properties:
        deleted:
          type: boolean
        elements:
          type: array
          description: >-
            Attachments from the last page that fill the gaps left by deleted
            items
          items:
            $ref: '#/components/schemas/TaskAttachmentDetail'
    CORErrorResponse:
      type: object
      properties:
        status:
          type: string
        code:
          type: string
        message:
          type: string
    CORCustomError:
      type: object
      properties:
        status:
          type: integer
        name:
          type: string
        code:
          type: string
        message:
          type: string
    TaskAttachmentDetail:
      type: object
      properties:
        id:
          type: integer
        url:
          type: string
        size:
          type: integer
          description: File size in bytes
        source:
          type: string
          description: Storage source (e.g. `S3`, `GoogleDrive`, `DropBox`, `OneDrive`)
        user_id:
          type: integer
        available:
          type: boolean
        file_type:
          type: string
          description: File extension (e.g. `png`, `pdf`)
        media_type:
          type: string
          description: Media category (e.g. `image`, `pdf`, `video`)
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        originalname:
          type: string
          description: Original file name
        discussions_id:
          type: integer
          nullable: true
        parent_type:
          type: string
          description: Parent entity type (e.g. `tasks`)
        name:
          type: string
        parent_id:
          type: integer
        attachment_parent_id:
          type: integer
          nullable: true
          description: Parent attachment ID for versioning
        version:
          type: integer
        status:
          type: string
          nullable: true
          enum:
            - approved
            - pending
            - required
            - null
        currentVersionData:
          type: object
          nullable: true
        currentVersionId:
          type: integer
        currentVersion:
          type: integer
        user:
          type: object
          properties:
            id:
              type: integer
            first_name:
              type: string
            last_name:
              type: string
            picture:
              type: string
        graphicsCount:
          type: string
          nullable: true
        taskLogReworksId:
          type: integer
          nullable: true
        createdFrom:
          type: string
          description: 'Origin: `task_panel`, `rework`, or `feedback`'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````