{
  "openapi": "3.1.0",
  "info": {
    "title": "DAMG Human Task API for AI Agents",
    "version": "0.1.0",
    "description": "Human task API for AI agents, human fallback API, human testing intake, and human-in-the-loop task fulfillment for manual task requests, website testing, app testing, game testing, and real-world task completion for AI workflows. Accepted requests receive a manually generated PayPal payment link before work begins."
  },
  "paths": {
    "/api/human-task-capabilities": {
      "get": {
        "summary": "Get human fallback capabilities for AI agents",
        "description": "Returns current task types, prepaid task payment links, policy references, endpoints, and minimal payload guidance for AI agents and automation workflows.",
        "responses": {
          "200": {
            "description": "Current capabilities, endpoint references, accepted task types, prepaid tasks, and safety policy."
          }
        }
      }
    },
    "/api/human-task-request": {
      "post": {
        "summary": "Submit a human task request for AI workflow review",
        "description": "Submit a structured manual task request to the human fallback API for AI agents, automations, and software workflows. Requests are reviewed before acceptance. If accepted, a manually generated PayPal payment link is sent before work begins.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "requester_email",
                  "task_type",
                  "task_title",
                  "task_description",
                  "budget_usd",
                  "success_criteria",
                  "agreement_confirmed"
                ],
                "properties": {
                  "requester_email": {
                    "type": "string",
                    "format": "email"
                  },
                  "task_type": {
                    "type": "string",
                    "enum": [
                      "phone_call",
                      "local_verification",
                      "web_research",
                      "vendor_quote",
                      "appointment_scheduling",
                      "human_review",
                      "field_task",
                      "document_collection",
                      "manual_web_task",
                      "human_testing",
                      "custom_request"
                    ]
                  },
                  "task_title": {
                    "type": "string"
                  },
                  "task_description": {
                    "type": "string"
                  },
                  "budget_usd": {
                    "type": ["number", "string"]
                  },
                  "success_criteria": {
                    "type": "string"
                  },
                  "agreement_confirmed": {
                    "type": "boolean",
                    "const": true
                  },
                  "requester_name": {
                    "type": "string"
                  },
                  "company_or_agent_name": {
                    "type": "string"
                  },
                  "location": {
                    "type": "string"
                  },
                  "deadline": {
                    "type": "string"
                  },
                  "desired_output_format": {
                    "type": "string",
                    "enum": ["email", "json", "summary", "report"]
                  },
                  "additional_context": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Request received for review. If accepted, a manually generated PayPal payment link will be sent before work begins."
          },
          "201": {
            "description": "Request received for review. If accepted, a manually generated PayPal payment link will be sent before work begins."
          },
          "400": {
            "description": "Validation error."
          },
          "403": {
            "description": "Prohibited, unsafe, or unconfirmed request."
          }
        }
      }
    },
    "/api/prepaid-human-task-intake": {
      "post": {
        "summary": "Submit task instructions after prepaid payment",
        "description": "Submit minimal task instructions after paying for a fixed-scope prepaid human fallback task using PayPal or manual USDC on Base. Designed for AI agents and automations that need low-token structured intake. If payment_method is crypto, transaction_hash, payment_reference_id, selected_payment_tier, crypto_amount_sent, crypto_asset=USDC, and crypto_network=Base are required.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "requester_email",
                  "paypal_transaction_id",
                  "task_purchased",
                  "task_details",
                  "success_criteria",
                  "agreement_confirmed"
                ],
                "properties": {
                  "requester_email": {
                    "type": "string",
                    "format": "email"
                  },
                  "payment_method": {
                    "type": "string",
                    "enum": ["paypal", "crypto"],
                    "description": "Use paypal for PayPal payments or crypto for manual USDC on Base payments."
                  },
                  "paypal_transaction_id": {
                    "type": "string",
                    "description": "Required when payment_method is paypal."
                  },
                  "selected_payment_tier": {
                    "type": "string",
                    "enum": [
                      "$15 Business Hours Verification",
                      "$15 Phone Number Verification",
                      "$20 Local Listing Verification",
                      "$25 Item or Service Availability Check",
                      "$35 One Vendor Quote Request",
                      "$85 Three Vendor Quote Requests",
                      "$30 Manual Web Research Mini Task",
                      "$25 AI Output Human Review",
                      "$30 Manual Web Task Check",
                      "$30 Appointment Info Check",
                      "$35 Document Collection Check",
                      "$25 Custom Micro Task Review Deposit",
                      "$15 Quick Human Check",
                      "$25 Website/App Mini Test",
                      "$25 Game First Impression",
                      "$35 Checkout/Form Test",
                      "$60+ Extended Playtest / UX Review"
                    ],
                    "description": "Required when payment_method is crypto."
                  },
                  "crypto_asset": {
                    "type": "string",
                    "const": "USDC",
                    "description": "Required when payment_method is crypto. Only USDC is accepted."
                  },
                  "crypto_network": {
                    "type": "string",
                    "const": "Base",
                    "description": "Required when payment_method is crypto. Only Base is accepted."
                  },
                  "crypto_amount_sent": {
                    "type": "string",
                    "description": "Required when payment_method is crypto."
                  },
                  "transaction_hash": {
                    "type": "string",
                    "description": "Required when payment_method is crypto. Submit the Base transaction hash."
                  },
                  "payment_reference_id": {
                    "type": "string",
                    "description": "Required when payment_method is crypto. Unique order/reference ID used to match the payment to the intake request."
                  },
                  "sender_wallet_address": {
                    "type": "string"
                  },
                  "payment_notes": {
                    "type": "string"
                  },
                  "crypto_payment_address": {
                    "type": "string",
                    "const": "0xE301976Ae257F90ae2254d848AE63D27972C2A35",
                    "description": "Accepted manual crypto receive address for USDC on Base."
                  },
                  "task_purchased": {
                    "type": "string",
                    "enum": [
                      "Business Hours Verification",
                      "Phone Number Verification",
                      "Local Listing Verification",
                      "Item or Service Availability Check",
                      "One Vendor Quote Request",
                      "Three Vendor Quote Requests",
                      "Manual Web Research Mini Task",
                      "AI Output Human Review",
                      "Manual Web Task Check",
                      "Appointment Info Check",
                      "Document Collection Check",
                      "Custom Micro Task Review Deposit",
                      "Quick Human Check",
                      "Website/App Mini Test",
                      "Game First Impression",
                      "Checkout/Form Test",
                      "Extended Playtest / UX Review"
                    ]
                  },
                  "task_details": {
                    "type": "string"
                  },
                  "success_criteria": {
                    "type": "string"
                  },
                  "desired_output_format": {
                    "type": "string",
                    "enum": ["email", "json", "summary", "report"]
                  },
                  "result_callback_url": {
                    "type": "string",
                    "format": "uri"
                  },
                  "deadline": {
                    "type": "string"
                  },
                  "additional_context": {
                    "type": "string"
                  },
                  "agreement_confirmed": {
                    "type": "boolean",
                    "const": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Prepaid task details received for review. Crypto responses include payment_status=pending_manual_review. Work begins only after payment and request details are accepted."
          },
          "400": {
            "description": "Validation error."
          },
          "403": {
            "description": "Agreement not confirmed or request cannot be reviewed."
          }
        }
      }
    }
  }
}
