openapi: "3.1.0"
info:
  title: "PROTAC Builder Public API"
  version: "1.0.0"
  description: "Public endpoints currently exposed by the Flask-based PROTAC Builder application. The spec is generated from the existing route surface and intentionally avoids undocumented claims."
servers:
  -
    url: "https://protacbuilder.com"
paths:
  /api/linkers/curated:
    get:
      summary: "List curated linker templates"
      responses:
        200:
          description: "Curated linker payload"
  /api/ligases:
    get:
      summary: "List ligases exposed by the app"
      responses:
        200:
          description: "Ligase list payload"
  /api/ligase/render:
    get:
      summary: "Render a ligase structure representation"
      responses:
        200:
          description: "Ligase render response"
  /api/ligase/raw/{name}:
    get:
      summary: "Load raw ligase data by name"
      parameters:
        -
          name: "name"
          in: "path"
          required: true
          schema:
            type: "string"
      responses:
        200:
          description: "Ligase raw response"
        404:
          description: "Ligase not found"
  /api/recruiter/{name}:
    get:
      summary: "Load recruiter data by name"
      parameters:
        -
          name: "name"
          in: "path"
          required: true
          schema:
            type: "string"
      responses:
        200:
          description: "Recruiter response"
        404:
          description: "Recruiter not found"
  /api/recruiter/converted/{session_id}:
    get:
      summary: "Load converted recruiter data for a handoff session"
      parameters:
        -
          name: "session_id"
          in: "path"
          required: true
          schema:
            type: "string"
      responses:
        200:
          description: "Converted recruiter response"
        400:
          description: "Missing session ID"
  /api/ligand/smiles:
    get:
      summary: "Fetch ligand SMILES data"
      responses:
        200:
          description: "Ligand SMILES response"
  /api/ligand/data:
    get:
      summary: "Fetch ligand data"
      responses:
        200:
          description: "Ligand data response"
  /api/ligand/modify:
    post:
      summary: "Modify ligand data"
      responses:
        200:
          description: "Ligand modification response"
  /api/ligand/store:
    post:
      summary: "Store ligand data"
      responses:
        200:
          description: "Ligand storage response"
  /api/molecule/smiles-to-mol:
    post:
      summary: "Convert SMILES to MOL"
      responses:
        200:
          description: "Converted MOL payload"
  /api/molecule/mol-to-smiles:
    post:
      summary: "Convert MOL to SMILES"
      responses:
        200:
          description: "Converted SMILES payload"
  /api/molecule/render-smiles:
    post:
      summary: "Render structure from SMILES"
      responses:
        200:
          description: "Rendered structure response"
  /api/protac/generate:
    post:
      summary: "Generate a PROTAC from components"
      responses:
        200:
          description: "Generated PROTAC response"
  /api/protac/download-smiles:
    post:
      summary: "Download generated PROTAC SMILES"
      responses:
        200:
          description: "Download response"
  /api/protac/log:
    post:
      summary: "Log frontend PROTAC activity"
      responses:
        200:
          description: "Log acknowledgement"
  /api/protac/batch-linkers:
    post:
      summary: "Generate PROTACs across linker batches"
      responses:
        200:
          description: "Batch generation response"
  /api/protac/structure/convert:
    post:
      summary: "Convert PROTAC structure representations"
      responses:
        200:
          description: "Structure conversion response"
  /api/protac/structure/mapped-smiles:
    post:
      summary: "Generate mapped SMILES for a structure"
      responses:
        200:
          description: "Mapped SMILES response"
  /api/protac/linkers/inspect:
    post:
      summary: "Inspect linker CSV input"
      responses:
        200:
          description: "Linker inspection response"
  /api/protac/builder/batch:
    post:
      summary: "Run builder batch workflow"
      responses:
        200:
          description: "Builder batch response"
  /api/protac/builder/cli:
    post:
      summary: "Run builder CLI-style workflow"
      responses:
        200:
          description: "Builder CLI response"
  /api/protac/builder/usage:
    get:
      summary: "Retrieve builder usage summary"
      responses:
        200:
          description: "Usage summary"
  /api/protac/builder/template/linkers:
    get:
      summary: "Download linker template CSV"
      responses:
        200:
          description: "CSV download"
  /api/protac/builder/template/download-count:
    get:
      summary: "Retrieve template download count"
      responses:
        200:
          description: "Download count"
  /api/warheadhunter/job/{job_id}:
    get:
      summary: "Retrieve proxied Warhead Hunter job index"
      parameters:
        -
          name: "job_id"
          in: "path"
          required: true
          schema:
            type: "string"
      responses:
        200:
          description: "Warhead Hunter job metadata"
  /api/warheadhunter/job/{job_id}/file/{filename}:
    get:
      summary: "Retrieve a proxied Warhead Hunter job file"
      parameters:
        -
          name: "job_id"
          in: "path"
          required: true
          schema:
            type: "string"
        -
          name: "filename"
          in: "path"
          required: true
          schema:
            type: "string"
      responses:
        200:
          description: "Warhead Hunter file response"
  /api/e3ligase/pdb/{ligase}/{filename}:
    get:
      summary: "Download a ligase PDB file"
      parameters:
        -
          name: "ligase"
          in: "path"
          required: true
          schema:
            type: "string"
        -
          name: "filename"
          in: "path"
          required: true
          schema:
            type: "string"
      responses:
        200:
          description: "PDB file response"
  /api/e3ligase/sdf/{ligase}/{filename}:
    get:
      summary: "Download a ligase SDF file"
      parameters:
        -
          name: "ligase"
          in: "path"
          required: true
          schema:
            type: "string"
        -
          name: "filename"
          in: "path"
          required: true
          schema:
            type: "string"
      responses:
        200:
          description: "SDF file response"
  /api/warhead/sdf/{pdb_id}/{ligand_code}:
    get:
      summary: "Download a warhead SDF file"
      parameters:
        -
          name: "pdb_id"
          in: "path"
          required: true
          schema:
            type: "string"
        -
          name: "ligand_code"
          in: "path"
          required: true
          schema:
            type: "string"
      responses:
        200:
          description: "Warhead SDF response"
  /api/deeppk/run:
    post:
      summary: "Run the DeepPK-related pipeline"
      responses:
        200:
          description: "Pipeline response"
        500:
          description: "Pipeline error"
  /api/deeppk/download/{job_id}/{filename}:
    get:
      summary: "Download a DeepPK artifact"
      parameters:
        -
          name: "job_id"
          in: "path"
          required: true
          schema:
            type: "string"
        -
          name: "filename"
          in: "path"
          required: true
          schema:
            type: "string"
      responses:
        200:
          description: "Artifact download"
        404:
          description: "File not found"
  /api/admet/run:
    post:
      summary: "Run ADMET report generation"
      responses:
        200:
          description: "ADMET response"
        400:
          description: "Bad input"
        500:
          description: "Server error"
  /api/admet/download/{filename}:
    get:
      summary: "Download an ADMET artifact"
      parameters:
        -
          name: "filename"
          in: "path"
          required: true
          schema:
            type: "string"
      responses:
        200:
          description: "Artifact download"
        404:
          description: "File not found"
