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

# Archive a task

> Moves a task to the archive. Archived tasks are hidden from date views but can be restored or permanently deleted.



## OpenAPI

````yaml https://znift.com/api/v1/openapi.json post /api/v1/tasks/{taskId}/archive
openapi: 3.1.0
info:
  title: Znift Tasks API
  version: 1.0.0
  description: >-
    Public REST API for managing Znift tasks. Designed for AI agents, CLI tools,
    and automation. Authenticate with an API key via the x-api-key header.
servers:
  - url: https://znift.com
    description: Znift Production API
security:
  - apiKey: []
paths:
  /api/v1/tasks/{taskId}/archive:
    post:
      summary: Archive a task
      description: >-
        Moves a task to the archive. Archived tasks are hidden from date views
        but can be restored or permanently deleted.
      operationId: archiveTask
      parameters:
        - name: taskId
          in: path
          required: true
          schema:
            type: string
          description: Task ID
      responses:
        '200':
          description: Archive a task successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Success'
        '401':
          description: Invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Task not found
components:
  schemas:
    Success:
      type: object
      properties:
        success:
          type: boolean
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
          required:
            - code
            - message
      required:
        - error
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: API key with znift_ prefix. Create one in Profile > API Keys.

````