{
  "openapi": "3.1.0",
  "info": {
    "title": "Cars Helping Kids — Car Donations Agent API",
    "version": "1.0.0",
    "description": "Submit an explicitly authorized vehicle-donation request to Cars Helping Kids for case review. Cars Helping Kids is the vehicle-donation program operated by Fainting Goat Foundation Co Inc, EIN 99-0472123. A request does not transfer ownership or guarantee acceptance, pickup timing, value, documents, or a tax deduction.",
    "termsOfService": "https://carshelpingkids.org/terms",
    "contact": {
      "name": "Cars Helping Kids — Car Donations",
      "url": "https://carshelpingkids.org/donate-car",
      "email": "donate@carshelpingkids.org"
    },
    "license": {
      "name": "API access subject to Cars Helping Kids Terms of Use",
      "identifier": "LicenseRef-CarsHelpingKids-Terms"
    }
  },
  "externalDocs": {
    "description": "Cars Helping Kids agent-access documentation",
    "url": "https://carshelpingkids.org/ai-agent-car-donation"
  },
  "servers": [
    {
      "url": "https://carshelpingkids.org",
      "description": "Production"
    }
  ],
  "tags": [
    {
      "name": "Car Donations",
      "description": "Cars Helping Kids vehicle-donation intake"
    }
  ],
  "paths": {
    "/api/agent/donations": {
      "get": {
        "operationId": "getCarDonationAgentService",
        "summary": "Get Cars Helping Kids agent-intake links",
        "description": "Returns the production MCP, OpenAPI, human-form, privacy, and terms links without returning donor data.",
        "tags": ["Car Donations"],
        "responses": {
          "200": {
            "description": "Agent-intake service links",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "submitCarDonation",
        "summary": "Submit an authorized car-donation request",
        "description": "Creates a Cars Helping Kids donor-review record and operational notifications. Call only after the donor reviews the exact details, explicitly authorizes submission and donation-related contact, confirms they are at least 18 and own or are legally authorized to dispose of the vehicle, confirms accuracy, and accepts the terms and privacy policy. Generate one UUID for a new attempt and send the same value as submission_id and the Idempotency-Key header; reuse it unchanged for retries.",
        "tags": ["Car Donations"],
        "security": [],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "The same UUID supplied as submission_id. Reuse it only when retrying the identical submission.",
            "schema": {
              "type": "string",
              "format": "uuid",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AuthorizedDonationRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The request was durably stored for Cars Helping Kids review.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DonationReceipt"
                }
              }
            }
          },
          "400": {
            "description": "Invalid JSON, consent, fields, or idempotency key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A browser request used an untrusted Origin.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The idempotency key was already used with different details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The request was not durably stored. Retry with the same idempotency key or use the human form.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AuthorizedDonationRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "submission_id",
          "donor_authorized",
          "donor",
          "vehicle",
          "pickup"
        ],
        "properties": {
          "submission_id": {
            "type": "string",
            "format": "uuid",
            "description": "Generate once for a new donation attempt and reuse unchanged for retries."
          },
          "donor_authorized": {
            "type": "boolean",
            "const": true,
            "description": "True only after the donor gives the complete authorization described by this operation."
          },
          "donor": {
            "$ref": "#/components/schemas/Donor"
          },
          "vehicle": {
            "$ref": "#/components/schemas/Vehicle"
          },
          "pickup": {
            "$ref": "#/components/schemas/Pickup"
          },
          "notes": {
            "type": "string",
            "maxLength": 500,
            "default": ""
          }
        }
      },
      "Donor": {
        "type": "object",
        "additionalProperties": false,
        "required": ["name", "phone"],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "phone": {
            "type": "string",
            "minLength": 10,
            "maxLength": 40,
            "description": "Must contain at least 10 digits."
          },
          "email": {
            "anyOf": [
              {"type": "string", "format": "email", "maxLength": 254},
              {"type": "string", "const": ""}
            ],
            "default": ""
          }
        }
      },
      "Vehicle": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "year",
          "make",
          "model",
          "condition",
          "title_status",
          "lien_status"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": ["Car", "Truck", "SUV", "Motorcycle", "RV", "Boat", "Trailer", "Other"]
          },
          "year": {
            "type": "integer",
            "minimum": 1886,
            "maximum": 2028
          },
          "make": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "model": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "condition": {
            "type": "string",
            "enum": ["runs_and_drives", "starts_not_drivable", "does_not_run", "wrecked_or_incomplete", "unknown"]
          },
          "title_status": {
            "type": "string",
            "enum": ["title_in_hand", "title_missing", "title_issue", "unknown"]
          },
          "lien_status": {
            "type": "string",
            "enum": ["no_lien", "lien_exists", "unknown"]
          },
          "keys": {
            "type": "string",
            "enum": ["yes", "no", "unknown"],
            "default": "unknown"
          }
        }
      },
      "Pickup": {
        "type": "object",
        "additionalProperties": false,
        "required": ["zip"],
        "properties": {
          "zip": {
            "type": "string",
            "pattern": "^[0-9]{5}$"
          },
          "city": {
            "type": "string",
            "maxLength": 100,
            "default": ""
          },
          "state": {
            "type": "string",
            "maxLength": 50,
            "default": ""
          },
          "access": {
            "type": "string",
            "enum": ["standard_tow_access", "limited_or_special_access", "unknown"],
            "default": "unknown"
          },
          "timing": {
            "type": "string",
            "enum": ["as_soon_as_possible", "within_7_days", "within_30_days", "flexible", "unknown"],
            "default": "unknown"
          }
        }
      },
      "DonationReceipt": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "ok",
          "status",
          "reference",
          "replayed",
          "program",
          "legal_recipient",
          "receipt_url",
          "next_step",
          "submission_meaning"
        ],
        "properties": {
          "ok": {"type": "boolean", "const": true},
          "status": {"type": "string", "const": "received_for_review"},
          "reference": {"type": "string", "pattern": "^CHK-[0-9A-F]{8}$"},
          "replayed": {"type": "boolean"},
          "program": {"type": "string", "const": "Cars Helping Kids — Car Donations"},
          "legal_recipient": {"type": "string", "const": "Fainting Goat Foundation Co Inc"},
          "receipt_url": {"type": "string", "format": "uri"},
          "next_step": {"type": "string"},
          "submission_meaning": {"type": "string"}
        }
      },
      "Error": {
        "type": "object",
        "additionalProperties": true,
        "required": ["ok", "error"],
        "properties": {
          "ok": {"type": "boolean", "const": false},
          "error": {"type": "string"},
          "fields": {
            "type": "array",
            "items": {"type": "string"}
          }
        }
      }
    }
  },
  "x-cars-helping-kids": {
    "primaryService": "Car donations",
    "programName": "Cars Helping Kids",
    "legalRecipient": "Fainting Goat Foundation Co Inc",
    "ein": "99-0472123",
    "mcpEndpoint": "https://carshelpingkids.org/mcp",
    "officialMcpRegistryName": "org.carshelpingkids/car-donations",
    "humanDonationForm": "https://carshelpingkids.org/donate-car#lp-form"
  }
}
