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

# Extract Archive

> Extract contents of a ZIP archive

## Overview

Extracts the contents of a ZIP archive to a specified folder. Supports password-protected archives.

## Path Parameters

<ParamField path="entryId" type="integer" required>
  The ZIP file entry ID
</ParamField>

## Query Parameters

<ParamField query="workspaceId" type="integer">
  Workspace context
</ParamField>

## Request Body

<ParamField body="parentId" type="integer" required>
  Destination folder ID. Use `0` for root.
</ParamField>

<ParamField body="password" type="string">
  Password for encrypted archives. Use `null` for unencrypted.
</ParamField>

## Response

<ResponseField name="message" type="string">
  Success message
</ResponseField>

<ResponseField name="status" type="string">
  Request status (`success`)
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  # Extract unencrypted archive
  curl -X POST "https://app.drime.cloud/api/v1/file-entries/123/extract?workspaceId=0" \
    -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "parentId": 456,
      "password": null
    }'

  # Extract password-protected archive
  curl -X POST "https://app.drime.cloud/api/v1/file-entries/123/extract?workspaceId=0" \
    -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "parentId": 456,
      "password": "secretpassword"
    }'
  ```

  ```javascript JavaScript theme={null}
  const entryId = 123;

  const response = await fetch(
    `https://app.drime.cloud/api/v1/file-entries/${entryId}/extract?workspaceId=0`,
    {
      method: 'POST',
      headers: {
        'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        parentId: 456, // destination folder
        password: null // or 'password' for encrypted archives
      })
    }
  );

  const data = await response.json();
  console.log(data.message);
  ```

  ```python Python theme={null}
  import requests

  entry_id = 123

  response = requests.post(
      f'https://app.drime.cloud/api/v1/file-entries/{entry_id}/extract',
      params={'workspaceId': 0},
      headers={'Authorization': 'Bearer YOUR_ACCESS_TOKEN'},
      json={
          'parentId': 456,
          'password': None  # or 'password' for encrypted
      }
  )

  print(response.json()['message'])
  ```
</RequestExample>

<ResponseExample>
  ```json 200 - Success theme={null}
  {
    "message": "Archive extracted successfully.",
    "status": "success"
  }
  ```

  ```json 422 - Invalid Archive theme={null}
  {
    "status": "error",
    "message": "Invalid archive or wrong password."
  }
  ```
</ResponseExample>
