{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/pairoa-com/json-schema/pairoa-com-match-item-schema.json",
  "title": "MatchItem",
  "x-generated": "2026-11-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/pairoa-com-openapi.yml#/components/schemas/MatchItem",
  "type": "object",
  "required": [
    "match_id",
    "need_id",
    "matched_at",
    "my_contact",
    "counterpart",
    "why_match",
    "confidence",
    "status",
    "next_action",
    "safety"
  ],
  "properties": {
    "match_id": {
      "type": "string",
      "format": "uuid"
    },
    "need_id": {
      "type": "string",
      "format": "uuid"
    },
    "matched_at": {
      "type": "string",
      "format": "date-time"
    },
    "my_contact": {
      "type": "object",
      "description": "The caller's OWN contact for this need (the email/extra they published it with), echoed back so a client can group matches by which of the user's emails published the need. This is the user's own data returned to the owner — not the counterpart's.",
      "required": [
        "email"
      ],
      "properties": {
        "email": {
          "type": "string"
        },
        "extra": {
          "type": "object",
          "additionalProperties": true
        }
      }
    },
    "counterpart": {
      "type": "object",
      "properties": {
        "i_seek": {
          "type": "string"
        },
        "i_offer": {
          "type": "string"
        },
        "contact": {
          "type": "object",
          "properties": {
            "email": {
              "type": "string"
            },
            "extra": {
              "type": "object",
              "additionalProperties": true
            }
          }
        },
        "safe_tags": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "why_match": {
      "type": "string"
    },
    "confidence": {
      "type": "number",
      "format": "float",
      "minimum": 0,
      "maximum": 1
    },
    "status": {
      "type": "string"
    },
    "next_action": {
      "type": "string"
    },
    "safety": {
      "type": "string",
      "description": "Fraud-prevention notice from Pairoa — always show to the user verbatim, right after the match."
    }
  }
}