{
  "openapi": "3.1.0",
  "info": {
    "title": "EasySend File Sharing API",
    "description": "Upload and share files via EasySend. No signup or API key required. Free up to 1GB.",
    "version": "1.0.0",
    "contact": {
      "name": "EasySend",
      "url": "https://easysend.co",
      "email": "support@easysend.co"
    }
  },
  "servers": [
    {
      "url": "https://easysend.co",
      "description": "Production"
    }
  ],
  "paths": {
    "/api/v1/upload": {
      "post": {
        "operationId": "uploadFiles",
        "summary": "Upload one or more files and get a share link",
        "description": "Upload files to create a shareable bundle. Returns a short link that anyone can use to download the files. No authentication required.",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": ["files"],
                "properties": {
                  "files": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "binary"
                    },
                    "description": "One or more files to upload"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Files uploaded successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "share_url": {
                      "type": "string",
                      "description": "The shareable download link",
                      "example": "/abc12"
                    },
                    "short_code": {
                      "type": "string",
                      "description": "The 5-character bundle code",
                      "example": "abc12"
                    },
                    "files": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "size": {
                            "type": "integer"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request (no files, size exceeded, etc.)"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/api/v1/bundle/{code}": {
      "get": {
        "operationId": "getBundleInfo",
        "summary": "Get information about a bundle",
        "description": "Returns bundle details including file list, sizes, download counts, and expiry time.",
        "parameters": [
          {
            "name": "code",
            "in": "path",
            "required": true,
            "description": "The 5-character bundle short code",
            "schema": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9]{5}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Bundle found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "bundle": {
                      "type": "object",
                      "properties": {
                        "short_code": {
                          "type": "string"
                        },
                        "file_count": {
                          "type": "integer"
                        },
                        "total_size": {
                          "type": "integer"
                        },
                        "view_count": {
                          "type": "integer"
                        },
                        "created_at": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "expires_at": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "files": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "name": {
                                "type": "string"
                              },
                              "size": {
                                "type": "integer"
                              },
                              "download_count": {
                                "type": "integer"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Bundle not found or expired"
          }
        }
      },
      "delete": {
        "operationId": "deleteBundle",
        "summary": "Delete a bundle",
        "description": "Delete a bundle and all its files. Requires the upload_token that was returned when the bundle was created.",
        "parameters": [
          {
            "name": "code",
            "in": "path",
            "required": true,
            "description": "The 5-character bundle short code",
            "schema": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9]{5}$"
            }
          },
          {
            "name": "X-Upload-Token",
            "in": "header",
            "required": true,
            "description": "The upload token returned when the bundle was created",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Bundle deleted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Invalid upload token"
          },
          "404": {
            "description": "Bundle not found"
          }
        }
      }
    }
  }
}
