> ## Documentation Index
> Fetch the complete documentation index at: https://allhandsai-chore-regenerate-agent-sdk-openapi.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Archive Directory

> Archive a workspace directory for persistence before runtime deletion.

Produces a downloadable archive of ``path``. Symlinks are never followed
out of the requested directory, so the archive cannot include files from
outside it. The temporary archive is created outside ``path`` and removed
after the response is sent.



## OpenAPI

````yaml /openapi/agent-sdk.json get /api/conversations/{runtime_conversation_id}/file/archive
openapi: 3.1.0
info:
  description: OpenHands Agent Server - REST/WebSocket interface for OpenHands AI Agent
  title: OpenHands Agent Server
  version: 1.52.0
servers: []
security: []
paths:
  /api/conversations/{runtime_conversation_id}/file/archive:
    get:
      tags:
        - Files
      summary: Archive Directory
      description: >-
        Archive a workspace directory for persistence before runtime deletion.


        Produces a downloadable archive of ``path``. Symlinks are never followed

        out of the requested directory, so the archive cannot include files from

        outside it. The temporary archive is created outside ``path`` and
        removed

        after the response is sent.
      operationId: >-
        archive_directory_api_conversations__runtime_conversation_id__file_archive_get
      parameters:
        - in: path
          name: runtime_conversation_id
          required: true
          schema:
            format: uuid
            title: Runtime Conversation Id
            type: string
        - description: Absolute path of the directory to archive
          in: query
          name: path
          required: true
          schema:
            description: Absolute path of the directory to archive
            title: Path
            type: string
        - description: >-
            Archive format: 'git-delta' for a git patch of the working-tree
            changes against a base ref (requires a git repository); 'tar.gz' for
            a full gzip tarball of the entire directory (works on non-git
            directories too).
          in: query
          name: format
          required: false
          schema:
            default: git-delta
            description: >-
              Archive format: 'git-delta' for a git patch of the working-tree
              changes against a base ref (requires a git repository); 'tar.gz'
              for a full gzip tarball of the entire directory (works on non-git
              directories too).
            enum:
              - git-delta
              - tar.gz
            title: Format
            type: string
        - description: >-
            Only for format='git-delta': base ref to diff against. Defaults to
            the auto-detected comparison ref (origin branch, merge-base, or the
            empty tree for a fresh repo). Ignored for format='tar.gz'.
          in: query
          name: base_ref
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Only for format='git-delta': base ref to diff against. Defaults to
              the auto-detected comparison ref (origin branch, merge-base, or
              the empty tree for a fresh repo). Ignored for format='tar.gz'.
            title: Base Ref
        - description: >-
            Whether to apply the built-in default exclude patterns
            (node_modules/, .venv/, caches, build outputs, etc.). Defaults to
            true for compact archives; set false to allow a full workspace
            capture, including fat directories.
          in: query
          name: use_default_excludes
          required: false
          schema:
            default: true
            description: >-
              Whether to apply the built-in default exclude patterns
              (node_modules/, .venv/, caches, build outputs, etc.). Defaults to
              true for compact archives; set false to allow a full workspace
              capture, including fat directories.
            title: Use Default Excludes
            type: boolean
        - description: >-
            Additional glob patterns to exclude (repeatable, e.g.
            ?exclude=foo&exclude=*.bin). Combined with the built-in default
            excludes when use_default_excludes=true; used by itself when
            use_default_excludes=false.
          in: query
          name: exclude
          required: false
          schema:
            anyOf:
              - items:
                  type: string
                type: array
              - type: 'null'
            description: >-
              Additional glob patterns to exclude (repeatable, e.g.
              ?exclude=foo&exclude=*.bin). Combined with the built-in default
              excludes when use_default_excludes=true; used by itself when
              use_default_excludes=false.
            title: Exclude
      responses:
        '200':
          content:
            application/octet-stream:
              schema:
                format: binary
                type: string
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - APIKeyHeader: []
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    APIKeyHeader:
      in: header
      name: X-Session-API-Key
      type: apiKey

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.