{
 "openapi": "3.1.0",
 "info": {
  "title": "Temple Share API",
  "version": "1f3bfe1",
  "description": "Free, anonymous file sharing for humans and scripts. Any file type, up to 10 GB per file, chunked + resumable (tus), SHA-256 verified, optional end-to-end encryption, burn-after-download, expiry 1 h to 7 d. No account needed and no IP logs."
 },
 "servers": [
  {
   "url": "https://share.thetempleofdoom.com"
  }
 ],
 "paths": {
  "/api/v1/health": {
   "get": {
    "summary": "Health",
    "responses": {
     "200": {
      "description": "OK"
     },
     "400": {
      "description": "Bad input"
     },
     "429": {
      "description": "Rate limited"
     }
    }
   }
  },
  "/api/v1/limits": {
   "get": {
    "summary": "Limits and storage",
    "responses": {
     "200": {
      "description": "OK"
     },
     "400": {
      "description": "Bad input"
     },
     "429": {
      "description": "Rate limited"
     }
    }
   }
  },
  "/api/v1/uploads": {
   "post": {
    "summary": "Create an upload; returns a tus URL",
    "responses": {
     "200": {
      "description": "OK"
     },
     "400": {
      "description": "Bad input"
     },
     "429": {
      "description": "Rate limited"
     }
    },
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "name",
         "size"
        ],
        "properties": {
         "name": {
          "type": "string",
          "description": "File name."
         },
         "size": {
          "type": "integer",
          "description": "Exact size in bytes."
         },
         "type": {
          "type": "string",
          "description": "MIME type (informational only; downloads are always attachments)."
         },
         "sha256": {
          "type": "string",
          "description": "Optional full-file SHA-256 hex; the server compares it when the upload completes."
         },
         "files": {
          "type": "integer",
          "description": "Number of files in this share (bundle). Add the rest with share+token."
         },
         "share": {
          "type": "string",
          "description": "Existing share id to add this file to."
         },
         "token": {
          "type": "string",
          "description": "Manage token of that share."
         },
         "expires": {
          "type": "string",
          "description": "Lifetime: 1h, 6h, 24h (default), 3d, 7d (max)."
         },
         "max_downloads": {
          "type": "integer",
          "description": "Delete after this many downloads (0 = unlimited)."
         },
         "burn": {
          "type": "boolean",
          "description": "Burn after first download (same as max_downloads 1)."
         },
         "description": {
          "type": "string",
          "description": "Optional note shown on the download page."
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/uploads/{upload_id}": {
   "get": {
    "summary": "Upload status",
    "responses": {
     "200": {
      "description": "OK"
     },
     "400": {
      "description": "Bad input"
     },
     "429": {
      "description": "Rate limited"
     }
    },
    "parameters": [
     {
      "name": "upload_id",
      "in": "path",
      "required": true,
      "description": "Upload id <share>-<n> (last part of the tus URL).",
      "schema": {
       "type": "string"
      }
     }
    ]
   }
  },
  "/api/v1/paste": {
   "post": {
    "summary": "Create a paste",
    "responses": {
     "200": {
      "description": "OK"
     },
     "400": {
      "description": "Bad input"
     },
     "429": {
      "description": "Rate limited"
     }
    },
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "text"
        ],
        "properties": {
         "text": {
          "type": "string",
          "description": "The text (max 1 MB)."
         },
         "name": {
          "type": "string",
          "description": "File name (default paste.txt)."
         },
         "expires": {
          "type": "string",
          "description": "Lifetime: 1h, 6h, 24h (default), 3d, 7d (max)."
         },
         "max_downloads": {
          "type": "integer",
          "description": "Delete after this many downloads (0 = unlimited)."
         },
         "burn": {
          "type": "boolean",
          "description": "Burn after first download (same as max_downloads 1)."
         },
         "description": {
          "type": "string",
          "description": "Optional note shown on the download page."
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/shares/{id}": {
   "get": {
    "summary": "Share info",
    "responses": {
     "200": {
      "description": "OK"
     },
     "400": {
      "description": "Bad input"
     },
     "429": {
      "description": "Rate limited"
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "Share id (10 characters, from the link /d/<id>).",
      "schema": {
       "type": "string"
      }
     }
    ]
   },
   "delete": {
    "summary": "Delete share",
    "responses": {
     "200": {
      "description": "OK"
     },
     "400": {
      "description": "Bad input"
     },
     "429": {
      "description": "Rate limited"
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "Share id (10 characters, from the link /d/<id>).",
      "schema": {
       "type": "string"
      }
     }
    ],
    "security": [
     {
      "shareToken": []
     }
    ]
   }
  },
  "/api/v1/shares/{id}/links": {
   "get": {
    "summary": "Download links and commands",
    "responses": {
     "200": {
      "description": "OK"
     },
     "400": {
      "description": "Bad input"
     },
     "429": {
      "description": "Rate limited"
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "Share id (10 characters, from the link /d/<id>).",
      "schema": {
       "type": "string"
      }
     }
    ]
   }
  },
  "/api/v1/shares/{id}/verify": {
   "post": {
    "summary": "Compare your SHA-256",
    "responses": {
     "200": {
      "description": "OK"
     },
     "400": {
      "description": "Bad input"
     },
     "429": {
      "description": "Rate limited"
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "Share id (10 characters, from the link /d/<id>).",
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "sha256"
        ],
        "properties": {
         "file": {
          "type": "integer",
          "description": "File number in the share (0 for single files)."
         },
         "sha256": {
          "type": "string",
          "description": "SHA-256 hex of the whole file."
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/report": {
   "post": {
    "summary": "Report abuse",
    "responses": {
     "200": {
      "description": "OK"
     },
     "400": {
      "description": "Bad input"
     },
     "429": {
      "description": "Rate limited"
     }
    },
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "id",
         "reason"
        ],
        "properties": {
         "id": {
          "type": "string",
          "description": "Share id or link."
         },
         "reason": {
          "type": "string",
          "description": "What is wrong."
         },
         "category": {
          "type": "string",
          "description": "malware, phishing, copyright, illegal, other."
         },
         "contact": {
          "type": "string",
          "description": "Optional way to reach you."
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/tokens": {
   "post": {
    "summary": "Get a free API token",
    "responses": {
     "200": {
      "description": "OK"
     },
     "400": {
      "description": "Bad input"
     },
     "429": {
      "description": "Rate limited"
     }
    }
   }
  },
  "/api/v1/tokens/shares": {
   "get": {
    "summary": "Your shares",
    "responses": {
     "200": {
      "description": "OK"
     },
     "400": {
      "description": "Bad input"
     },
     "429": {
      "description": "Rate limited"
     }
    },
    "security": [
     {
      "apiKey": []
     }
    ]
   }
  },
  "/api/v1/admin/takedown": {
   "post": {
    "summary": "Owner: take a share down",
    "responses": {
     "200": {
      "description": "OK"
     },
     "400": {
      "description": "Bad input"
     },
     "429": {
      "description": "Rate limited"
     }
    },
    "security": [
     {
      "apiKey": []
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "id"
        ],
        "properties": {
         "id": {
          "type": "string",
          "description": "Share id."
         },
         "reason": {
          "type": "string",
          "description": "Reason kept on the tombstone."
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/admin/reports": {
   "get": {
    "summary": "Owner: abuse reports",
    "responses": {
     "200": {
      "description": "OK"
     },
     "400": {
      "description": "Bad input"
     },
     "429": {
      "description": "Rate limited"
     }
    },
    "security": [
     {
      "apiKey": []
     }
    ]
   }
  }
 },
 "components": {
  "securitySchemes": {
   "apiKey": {
    "type": "apiKey",
    "in": "header",
    "name": "X-API-Key"
   },
   "shareToken": {
    "type": "apiKey",
    "in": "header",
    "name": "X-Share-Token"
   }
  }
 }
}