Headless API documentation

Script complete AutoDock Vina package preparation.

AutoDock-Vina PrepServer exposes a staged API for creating docking workspaces, preparing receptor PDBQT files, uploading ligands, building reproducible docking packages, and downloading ready-to-run ZIP archives.

Page summary

What the headless API does

The headless API exposes staged `/api/v1` endpoints for scripted docking package preparation: create a workspace, add receptors, save docking centers, prepare receptor PDBQT files, upload ligands, build a package, list artifacts, and download the generated ZIP.

What this API does

The API walks through the same staged workflow as the browser interface: create a workspace, add a receptor, save a docking box, prepare receptor PDBQT files, upload ligands, build a package, and download the final ZIP.

It is intentionally not a single black-box endpoint. Each step returns stateful JSON, making failed receptor conversion, missing centers, ligand upload issues, and package-building problems easier to diagnose.

Base URL

For the public deployment, use:

https://autodockvina.com

Requirements

For the examples below, you only need a terminal with:

curl
bash
unzip

Response format

Versioned endpoints generally return JSON in this form:

{
  "ok": true,
  "data": {},
  "warnings": []
}

Data caution

Do not upload confidential receptor structures, proprietary ligand libraries, or sensitive project data to a public deployment unless the instance is explicitly configured for that purpose.

Workflow overview

The complete API flow.

A full docking-preparation workflow follows these stages.

1. Workspace Create isolated job folder
2. Receptor Fetch or upload structure
3. Center Save docking box
4. Prep Convert receptor PDBQT
5. Ligand Upload SDF/SMI/CSV/ZIP
6. Build Create package archive
7. Artifacts List downloadable files
8. Download Save ZIP locally
1

Create a workspace

Create an isolated server-side workspace for this docking job.

POST /api/v1/workspaces
2

Add a receptor

Fetch a receptor from the PDB or upload your own receptor file.

POST /api/v1/workspaces/<jobname>/receptors/fetch
POST /api/v1/workspaces/<jobname>/receptors/upload
3

Save a docking center

Save an XYZ docking box center and box size for the receptor.

POST /api/v1/workspaces/<jobname>/centers/save
4

Prepare receptor PDBQT

Clean the receptor and convert it to a docking-ready PDBQT file.

POST /api/v1/workspaces/<jobname>/prep/start
GET  /api/v1/workspaces/<jobname>/prep/status
5

Upload ligand input

Upload an SDF, SMI, SMILES, CSV, ZIP, or folder-style ligand input.

POST /api/v1/workspaces/<jobname>/ligands/upload
GET  /api/v1/workspaces/<jobname>/ligands
6

Build and download package

Build the docking package, list artifacts, and download the final ZIP.

POST /api/v1/workspaces/<jobname>/build
GET  /api/v1/workspaces/<jobname>/artifacts
GET  /api/v1/workspaces/<jobname>/download
Complete walkthrough

Run a real example with receptor 3EKY and ligand DR7.

This example downloads the repository ligand file Example/Ligand_SDF/DR7.sdf, fetches receptor 3EKY chain A, prepares the receptor, uploads the ligand, builds a portable docking package, and downloads the final ZIP.

What this example demonstrates

The example uses a real ligand file from the repository and a receptor fetched directly from the PDB. The final artifact is a downloadable ZIP containing the prepared receptor, ligand input, centers CSV, runner scripts, and package-specific instructions.

Create an example folder

Start in a clean folder so the downloaded ZIP is easy to find.

mkdir -p PrepServer_DR7_API_Demo
cd PrepServer_DR7_API_Demo

Download DR7 ligand

Download the example ligand from the repository raw file URL.

curl -L -o DR7.sdf \
  https://raw.githubusercontent.com/Joey305/autodock-WEBSERVER/main/Example/Ligand_SDF/DR7.sdf

ls -lh DR7.sdf

Set variables

Use a timestamped workspace name to avoid collisions.

BASE="https://autodockvina.com"
JOB="dr7-example-$(date +%s)"
LIGAND="DR7.sdf"

echo "Using JOB=$JOB"
echo "Using LIGAND=$LIGAND"
One-shot DR7 script

Copy, paste, and run the full workflow.

This script performs the complete staged API workflow from ligand download to ZIP download.

Full DR7 API example

cat > run_dr7_prepserver_api_demo.sh <<'EOF'
#!/usr/bin/env bash
set -e

BASE="https://autodockvina.com"
JOB="dr7-example-$(date +%s)"
LIGAND="DR7.sdf"
DR7_URL="https://raw.githubusercontent.com/Joey305/autodock-WEBSERVER/main/Example/Ligand_SDF/DR7.sdf"

echo "=========================================="
echo " AutoDock-Vina PrepServer DR7 API Example"
echo "=========================================="
echo ""
echo "BASE:   $BASE"
echo "JOB:    $JOB"
echo "LIGAND: $LIGAND"
echo ""

echo "0) Download example ligand"
curl -L -o "$LIGAND" "$DR7_URL"
ls -lh "$LIGAND"
echo ""

echo "1) Health check"
curl -sS "$BASE/api/v1/health"
echo ""
echo ""

echo "2) Create workspace"
curl -sS -X POST "$BASE/api/v1/workspaces" \
  -H "Content-Type: application/json" \
  -d "{\"workspace_name\":\"$JOB\"}"
echo ""
echo ""

echo "3) Fetch receptor 3EKY chain A"
curl -sS -X POST "$BASE/api/v1/workspaces/$JOB/receptors/fetch" \
  -H "Content-Type: application/json" \
  -d '{"pdb_id":"3EKY","chains":"A"}'
echo ""
echo ""

echo "4) Save example docking center"
curl -sS -X POST "$BASE/api/v1/workspaces/$JOB/centers/save" \
  -H "Content-Type: application/json" \
  -d '{
    "method":"xyz",
    "receptor":"Receptors/3eky.pdb",
    "center":[10.5, 22.1, -3.4],
    "size":20
  }'
echo ""
echo ""

echo "5) Confirm saved centers"
curl -sS "$BASE/api/v1/workspaces/$JOB/centers"
echo ""
echo ""

echo "6) Prepare receptor"
curl -sS -X POST "$BASE/api/v1/workspaces/$JOB/prep/start" \
  -H "Content-Type: application/json" \
  -d '{
    "remove_hets":"all",
    "remove_chains":"",
    "altloc":"collapse"
  }'
echo ""
echo ""

echo "7) Check receptor-preparation status"
curl -sS "$BASE/api/v1/workspaces/$JOB/prep/status"
echo ""
echo ""

echo "8) Check summary before ligand upload"
curl -sS "$BASE/api/v1/workspaces/$JOB/summary"
echo ""
echo ""

echo "9) Upload DR7 ligand"
curl -sS -X POST "$BASE/api/v1/workspaces/$JOB/ligands/upload" \
  -F "mode=single" \
  -F "file=@$LIGAND"
echo ""
echo ""

echo "10) Confirm ligand upload"
curl -sS "$BASE/api/v1/workspaces/$JOB/ligands"
echo ""
echo ""

echo "11) Build portable docking package"
curl -sS -X POST "$BASE/api/v1/workspaces/$JOB/build" \
  -H "Content-Type: application/json" \
  -d '{
    "package_mode":"portable",
    "vina_poses":20,
    "confgen_poses":64
  }'
echo ""
echo ""

echo "12) List generated artifacts"
curl -sS "$BASE/api/v1/workspaces/$JOB/artifacts"
echo ""
echo ""

echo "13) Download final ZIP"
curl -L -o "${JOB}_docking_package.zip" \
  "$BASE/api/v1/workspaces/$JOB/download"
echo ""
echo ""

echo "14) Confirm local ZIP"
ls -lh "${JOB}_docking_package.zip"
echo ""

echo "Done."
echo "Downloaded package: ${JOB}_docking_package.zip"
EOF

chmod +x run_dr7_prepserver_api_demo.sh
./run_dr7_prepserver_api_demo.sh
Manual staged walkthrough

Run the same example one step at a time.

Use this section when you want to inspect each API response manually.

1. Health check

BASE="https://autodockvina.com"

curl -sS "$BASE/api/v1/health"
echo ""

2. Create workspace

JOB="dr7-example-$(date +%s)"

curl -sS -X POST "$BASE/api/v1/workspaces" \
  -H "Content-Type: application/json" \
  -d "{\"workspace_name\":\"$JOB\"}"
echo ""

3. Fetch receptor

curl -sS -X POST "$BASE/api/v1/workspaces/$JOB/receptors/fetch" \
  -H "Content-Type: application/json" \
  -d '{"pdb_id":"3EKY","chains":"A"}'
echo ""

4. Save docking center

curl -sS -X POST "$BASE/api/v1/workspaces/$JOB/centers/save" \
  -H "Content-Type: application/json" \
  -d '{
    "method":"xyz",
    "receptor":"Receptors/3eky.pdb",
    "center":[10.5, 22.1, -3.4],
    "size":20
  }'
echo ""

5. Check centers

curl -sS "$BASE/api/v1/workspaces/$JOB/centers"
echo ""

6. Prepare receptor

curl -sS -X POST "$BASE/api/v1/workspaces/$JOB/prep/start" \
  -H "Content-Type: application/json" \
  -d '{
    "remove_hets":"all",
    "remove_chains":"",
    "altloc":"collapse"
  }'
echo ""

7. Check prep status

curl -sS "$BASE/api/v1/workspaces/$JOB/prep/status"
echo ""

8. Download and upload DR7

curl -L -o DR7.sdf \
  https://raw.githubusercontent.com/Joey305/autodock-WEBSERVER/main/Example/Ligand_SDF/DR7.sdf

curl -sS -X POST "$BASE/api/v1/workspaces/$JOB/ligands/upload" \
  -F "mode=single" \
  -F "file=@DR7.sdf"
echo ""

9. Build package

curl -sS -X POST "$BASE/api/v1/workspaces/$JOB/build" \
  -H "Content-Type: application/json" \
  -d '{
    "package_mode":"portable",
    "vina_poses":20,
    "confgen_poses":64
  }'
echo ""

10. Download ZIP

curl -L -o "${JOB}_docking_package.zip" \
  "$BASE/api/v1/workspaces/$JOB/download"

ls -lh "${JOB}_docking_package.zip"

How to recognize success

After receptor preparation, the summary should include:

{
  "converted_count": 1,
  "converted_list": ["3eky.pdbqt"],
  "prep_done": true,
  "receptors_prepped": 1
}

After package build, the artifact list should include job.zip.

Optional SMILES workflow

Use a SMILES/SMI ligand file instead of SDF.

If you do not have an SDF file, you can create a simple .smi file locally and upload it through the same ligand endpoint.

Create and upload a simple SMI file

The first column is the SMILES string. The optional second column is a ligand ID. Replace the example SMILES with your molecule of interest.

cat > example_ligand.smi <<'EOF'
CC(=O)Oc1ccccc1C(=O)O aspirin_example
EOF

curl -sS -X POST "$BASE/api/v1/workspaces/$JOB/ligands/upload" \
  -F "mode=single" \
  -F "file=@example_ligand.smi"
echo ""

curl -sS "$BASE/api/v1/workspaces/$JOB/ligands"
echo ""
Downloaded package

What is inside the generated ZIP?

Portable package layout

job/
├── Receptors/
├── Receptors_PDBQT/
├── Ligands/
├── vina_centers.csv
├── run_confgen_local.sh
├── run_vina_local.sh
├── run_all_local.sh
├── README_RUN_LOCAL.md
└── bundled Python helper scripts

Inspect the ZIP locally

unzip "${JOB}_docking_package.zip" -d "${JOB}_package"
cd "${JOB}_package"
find . -maxdepth 3 -type f | sort | head -80

Why local ls does not show server files

Workspace files are created on the server under a path like /tmp/autodock_prep/<jobname>. Your local folder only receives files after you download the generated ZIP artifact.

Endpoint reference

Available API endpoints.

Method Endpoint Purpose
GET /api/v1/health Check service health, API version, public mode, and temporary workspace root.
POST /api/v1/workspaces Create a new workspace or reuse a named workspace when supported.
GET /api/v1/workspaces/<jobname> Read workspace state.
GET /api/v1/workspaces/<jobname>/summary Read receptor status, center rows, ligand state, generated artifacts, and package readiness.
POST /api/v1/workspaces/<jobname>/receptors/upload Upload receptor files by single file, ZIP, or folder-style form upload.
POST /api/v1/workspaces/<jobname>/receptors/fetch Fetch a receptor by PDB ID and optional chain selection.
GET /api/v1/workspaces/<jobname>/receptors List registered receptors in a workspace.
POST /api/v1/workspaces/<jobname>/centers/resolve Resolve a docking center from JSON payload input without necessarily saving it.
POST /api/v1/workspaces/<jobname>/centers/save Save a docking center and box size for a receptor.
GET /api/v1/workspaces/<jobname>/centers List saved docking centers.
POST /api/v1/workspaces/<jobname>/prep/start Prepare receptors and convert them into PDBQT outputs.
GET /api/v1/workspaces/<jobname>/prep/status Read receptor-preparation status and logs.
POST /api/v1/workspaces/<jobname>/ligands/upload Upload ligand files, ZIPs, or folder-style ligand inputs.
GET /api/v1/workspaces/<jobname>/ligands List uploaded ligand files and ligand metadata.
POST /api/v1/workspaces/<jobname>/build Build a portable or LSF-style docking package.
GET /api/v1/workspaces/<jobname>/artifacts List generated ZIP artifacts.
GET /api/v1/workspaces/<jobname>/download Download the latest or requested ZIP artifact.
Payload reference

Common request bodies.

Workspace creation

{
  "workspace_name": "demo-docking-job",
  "reuse": false
}

Fetch receptor

{
  "pdb_id": "3EKY",
  "chains": "A"
}

Save XYZ docking center

{
  "method": "xyz",
  "receptor": "Receptors/3eky.pdb",
  "center": [10.5, 22.1, -3.4],
  "size": 20
}

Prepare receptor

{
  "remove_hets": "all",
  "remove_chains": "",
  "altloc": "collapse"
}

Build portable package

{
  "package_mode": "portable",
  "vina_poses": 20,
  "confgen_poses": 64
}

Build LSF package

{
  "package_mode": "lsf",
  "workers": 16,
  "queue": "general",
  "project": "brd",
  "mem_per_core": 2000,
  "vina_poses": 20,
  "confgen_poses": 64
}
Supported inputs

Accepted receptor and ligand file types.

Receptors

  • .pdb
  • .pdbqt
  • .cif
  • .mmcif
  • .ent
  • ZIP archives containing receptor files
  • Folder-style browser uploads
  • PDB fetch by RCSB PDB ID

Ligands

  • .sdf
  • .smi
  • .smiles
  • .csv
  • ZIP archives containing supported ligand files
  • Folder-style browser uploads

macOS metadata files

Ligand and receptor upload workflows are designed to ignore common macOS metadata files, including .DS_Store, ._*, and __MACOSX/.

Package modes

Portable and LSF-style output packages.

Portable mode

Portable mode is recommended for most users. It builds a ZIP package containing normalized receptor, ligand, center, and helper-script files for downstream local or server-side execution.

{
  "package_mode": "portable"
}

LSF mode

LSF mode is intended for lab or HPC environments that use an LSF scheduler. Use it only when your target environment matches the generated scheduler assumptions.

{
  "package_mode": "lsf"
}
Troubleshooting

Common API errors and how to fix them.

workspace_missing

The requested workspace does not exist. This can happen after a server restart because temporary workspaces may be ephemeral.

{
  "ok": false,
  "error": "workspace_missing"
}

Fix: create a new workspace and rerun the staged workflow.

centers_incomplete

The receptor exists, but no docking center was saved for its expected PDBQT filename.

{
  "ok": false,
  "error": "centers_incomplete"
}

If the receptor is Receptors/3eky.pdb, the saved center should map to 3eky.pdbqt.

obabel_missing

Open Babel is not installed or not available on the server path.

{
  "ok": false,
  "error": "obabel_missing"
}

Server administrators should verify which obabel and obabel -V.

Open Babel plugin error

Open Babel is installed but cannot find its plugin directory.

Unable to find OpenBabel plugins.
Try setting the BABEL_LIBDIR environment variable.

On Heroku, set BABEL_LIBDIR to the Open Babel plugin folder, then restart the app.

receptor_conversion_failed

Receptor preparation ran, but conversion to PDBQT failed.

{
  "ok": false,
  "error": "receptor_conversion_failed"
}

Check the preparation log through the prep status endpoint.

ligands_missing

The package build step was requested before ligand upload.

{
  "ok": false,
  "error": "ligands_missing"
}

Upload an SDF, SMI, SMILES, CSV, ZIP, or folder input before building.

Deployment notes

Open Babel configuration for deployed instances.

Heroku Open Babel checklist

# Aptfile
openbabel

# Buildpacks

heroku buildpacks:add --index 1 heroku-community/apt --app autodockvina
heroku buildpacks:add --index 2 heroku/python --app autodockvina

# Verify obabel

heroku run --no-tty "which obabel && obabel -V" --app autodockvina

# Find plugins if needed

heroku run --no-tty "find /app/.apt -type f ( -name 'pdbformat.so' -o -name 'pdbqtformat.so' -o -name 'plugindefines.txt' ) -print" --app autodockvina

# Example plugin path

heroku config:set BABEL_LIBDIR=/app/.apt/usr/lib/x86_64-linux-gnu/openbabel/3.1.1 --app autodockvina
heroku restart --app autodockvina

# Confirm PDB and PDBQT formats

heroku run --no-tty 'echo BABEL_LIBDIR=$BABEL_LIBDIR && which obabel && obabel -V && obabel -L formats | grep -E "pdb|pdbqt"' --app autodockvina

Warhead Hunter

Solvent-exposed ligand atom and warhead/linker follow-up.

warheadhunter.com

PROTAC Builder

Degrader design continuation and linker-recruiter-warhead assembly.

protacbuilder.com

V-LiSEMOD

Viral ligand solvent-exposed moiety and PROTACability-style triage.

vlisemod.com

Prefer the visual workflow?

Use the browser interface to create the same type of docking package without writing API calls.

Open build workflow
FAQ

Headless API FAQ

Is the API a single automatic docking endpoint?

No. The API is intentionally staged so scripts can inspect workspace state, receptor intake, center saving, receptor preparation, ligand upload, package generation, artifacts, and download separately.

Can API users define docking boxes without a browser?

Yes. API workflows can save explicit XYZ centers and use supported selector-based center resolution where the uploaded receptor format is supported by the resolver.

What should automation handle after downloading a ZIP?

Automation should unpack the package, verify generated inputs, provide the correct AutoDock Vina runtime environment, run docking with appropriate parameters, and preserve logs for review.