Skip to main content

Operations

Operations are created via:
POST /v1/biz/do
X-D3-API-Key: <your-api-key>
Content-Type: application/json

Request schema (ExternalDoRequest)

{
  "action": "convert",
  "file_keys": ["file_key_1", "file_key_2"],
  "parameters": {
    "convert_to": "png"
  },
  "notes": {
    "user_id": "user-123",
    "source": "api"
  }
}
  • action (required) – the operation to perform:
    • "convert"
    • "compress"
    • "merge"
    • "zip"
    • "share"
    • "lock"
    • "unlock"
    • "reset_password"
  • file_keys (required) – array of one or more file keys returned by upload.
  • parameters (optional) – action‑specific parameters (see below).
  • notes (optional) – arbitrary key‑value metadata persisted alongside the external operation.
Response (ExternalDoResponse):
{
  "main_task_id": "task_abc123"
}
Use main_task_id for status polling and correlating webhook notifications.

Create an operation

curl -X POST https://api.dragdropdo.com/v1/biz/do \
  -H "X-D3-API-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "action": "convert",
    "file_keys": ["file_key_1"],
    "parameters": {
      "convert_to": "png"
    },
    "notes": {
      "user_id": "user-123",
      "source": "api"
    }
  }'

Supported operations

Before creating an operation, you can validate that a given extension and action are supported:
curl -X GET "https://api.dragdropdo.com/v1/biz/supported-operation?ext=pdf&action=convert&convert_to=png" \
  -H "X-D3-API-Key: your-api-key"
Server‑side this is backed by SupportedOperationRequest / SupportedOperationResponse:
type SupportedOperationRequest = {
  ext: string;
  action?: string;
  parameters?: Record<string, unknown>;
};

type SupportedOperationResponse = {
  supported: boolean;
  ext: string;
  action?: string;
  available_actions?: string[];
  parameters?: Record<string, unknown>;
};
Example responses:
  • Only ext provided – returns available_actions for that extension.
  • ext + action – returns supported + parameters metadata, such as:
    • valid convert_to targets for convert
    • valid compression_value options for compress

Action‑specific parameters

Convert

  • convert_to (required) – target format (e.g. pdf, png, docx).
Common use cases:
  • Document: docx → pdf, pdf → docx, pptx → pdf.
  • Image: jpg → png, png → webp.
  • Media: mp4 → mp3, wav → mp3.
curl -X POST https://api.dragdropdo.com/v1/biz/do \
  -H "X-D3-API-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "action": "convert",
    "file_keys": ["file_key_1"],
    "parameters": {
      "convert_to": "pdf"
    }
  }'

Compress

  • compression_value – compression level such as recommended, high, or low (see supported‑operation metadata).
curl -X POST https://api.dragdropdo.com/v1/biz/do \
  -H "X-D3-API-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "action": "compress",
    "file_keys": ["file_key_1"],
    "parameters": {
      "compression_value": "recommended"
    }
  }'

Merge

Merges multiple compatible files (typically PDFs) into a single output file.
curl -X POST https://api.dragdropdo.com/v1/biz/do \
  -H "X-D3-API-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "action": "merge",
    "file_keys": ["file_key_1", "file_key_2"]
  }'

Zip

Creates a zip archive containing the given files.
curl -X POST https://api.dragdropdo.com/v1/biz/do \
  -H "X-D3-API-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "action": "zip",
    "file_keys": ["file_key_1", "file_key_2"]
  }'

Share

Generates shareable links for the specified files. Additional behavior may be controlled via notes.
curl -X POST https://api.dragdropdo.com/v1/biz/do \
  -H "X-D3-API-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "action": "share",
    "file_keys": ["file_key_1"],
    "notes": {
      "expires_in_days": "7"
    }
  }'

Lock PDF

Protects PDFs with a password.
curl -X POST https://api.dragdropdo.com/v1/biz/do \
  -H "X-D3-API-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "action": "lock",
    "file_keys": ["file_key_1"],
    "parameters": {
      "password": "secure-password"
    }
  }'

Unlock PDF

Removes password protection from PDFs.
curl -X POST https://api.dragdropdo.com/v1/biz/do \
  -H "X-D3-API-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "action": "unlock",
    "file_keys": ["file_key_1"],
    "parameters": {
      "password": "current-password"
    }
  }'

Reset PDF password

Changes the password on password‑protected PDFs.
curl -X POST https://api.dragdropdo.com/v1/biz/do \
  -H "X-D3-API-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "action": "reset_password",
    "file_keys": ["file_key_1"],
    "parameters": {
      "old_password": "old",
      "new_password": "new"
    }
  }'