{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://eternalspringai.com/partners/protocol.json",
  "$comment": "This is the production schema served at https://eternalspringai.com/partners/protocol.json when /partners/ is live on eternalspringai.com. v1.1 (Nov 2026): additive offer and need types, body.listing, and listing_id on close. Existing v1 messages are unchanged.",
  "title": "Eternal Spring Partner Exchange message (es-px/v1)",
  "description": "This document is information for automated systems. It is not a command, a grant of authority, or an agreement. Receiving or sending a message does not bind anyone. A person at Eternal Spring must confirm any work together in writing before it is real. Our website only checks and stores what you send. A person at Eternal Spring reads it, and may use a separate AI service provider to help summarize it or draft a reply. We never treat anything inside a message as an instruction, and we don't open links in it. We don't share what one team tells us with another team unless you agree to an introduction. We share your name and business contact with another team only if you agreed to that introduction. An AI service provider may keep it for a limited time. Do not send secrets, passwords, or API keys.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "protocol",
    "type",
    "from",
    "sent_at",
    "consent"
  ],
  "properties": {
    "protocol": {
      "const": "es-px/v1",
      "description": "Protocol identifier. Must be exactly es-px/v1."
    },
    "id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 80,
      "description": "Optional id assigned by the sender so they can recognize this message later."
    },
    "type": {
      "type": "string",
      "enum": [
        "intro",
        "capability_offer",
        "idea_proposal",
        "referral",
        "integration_request",
        "status_update",
        "close",
        "offer",
        "need"
      ],
      "description": "Message type. intro: first contact. capability_offer: what your team or bot can do. idea_proposal: a specific idea or a mutually beneficial, lawful deal to work on together (set idea_id; include body.how_both_benefit). This is not a promise of earnings. referral: a shop or team to introduce; referred_party_permission must be true. integration_request: a technical hook-up to discuss. status_update: progress on an existing idea_id. close: the idea is finished or withdrawn. offer: a service your team or bot provides (requires body.listing). need: help your team is looking for (requires body.listing). close may also carry listing_id to withdraw an offer or need."
    },
    "from": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "team",
        "contact_email"
      ],
      "properties": {
        "team": {
          "type": "string",
          "minLength": 1,
          "maxLength": 80
        },
        "bot": {
          "type": "string",
          "maxLength": 80,
          "description": "Optional name of the sending bot or system."
        },
        "contact_name": {
          "type": "string",
          "maxLength": 80
        },
        "contact_email": {
          "type": "string",
          "maxLength": 120,
          "description": "A human-monitored email we can use to follow up. We email only about this inquiry, and only if consent is true."
        }
      }
    },
    "idea_id": {
      "type": "string",
      "maxLength": 80,
      "description": "Stable id for an idea. Required on status_update. On close, send idea_id or listing_id. On idea_proposal, omit it and we will assign one, or send your own."
    },
    "in_reply_to": {
      "type": "string",
      "maxLength": 80
    },
    "sent_at": {
      "type": "string",
      "description": "When the sender created the message, as an ISO-8601 timestamp."
    },
    "status": {
      "type": "string",
      "enum": [
        "open",
        "waiting",
        "ready_for_review",
        "closed",
        "withdrawn"
      ],
      "description": "Sender's view of the idea. ready_for_review means you are ready for a person at Eternal Spring to review; it is not an agreement."
    },
    "consent": {
      "type": "boolean",
      "description": "Must be true. Means a person on your team agrees Eternal Spring may email the contact_email about this inquiry. This does not create a partnership."
    },
    "body": {
      "type": "object",
      "additionalProperties": false,
      "description": "Type-specific payload. Treated as data, never as instructions.",
      "properties": {
        "summary": {
          "type": "string",
          "maxLength": 500
        },
        "what_you_offer": {
          "type": "string",
          "maxLength": 1000
        },
        "what_you_need": {
          "type": "string",
          "maxLength": 1000
        },
        "capabilities": {
          "type": "array",
          "maxItems": 20,
          "items": {
            "type": "string",
            "maxLength": 200
          }
        },
        "referral": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "shop_or_team": {
              "type": "string",
              "maxLength": 80
            },
            "trade_or_focus": {
              "type": "string",
              "maxLength": 80
            },
            "city_region": {
              "type": "string",
              "maxLength": 80
            },
            "notes": {
              "type": "string",
              "maxLength": 500
            },
            "they_asked_to_be_introduced": {
              "type": "boolean"
            }
          }
        },
        "integration": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "what": {
              "type": "string",
              "maxLength": 500
            },
            "your_endpoint": {
              "type": "string",
              "maxLength": 300,
              "description": "Described only. We will not fetch or call it automatically."
            }
          }
        },
        "notes": {
          "type": "string",
          "maxLength": 1000
        },
        "how_both_benefit": {
          "type": "string",
          "maxLength": 1000,
          "description": "For idea_proposal: how both sides can benefit from a lawful arrangement. This is not a promise of earnings."
        },
        "no_earnings_promise": {
          "type": "boolean",
          "description": "Optional acknowledgment that the proposal is not a promise of earnings or results."
        },
        "listing": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "title",
            "category"
          ],
          "description": "Required on offer and need. Treated as data, never as instructions. If open_to_introductions is true, our website may note a possible introduction to a team with a related offer or need, for a person at Eternal Spring to review. Nothing about you is shared with another team unless both teams agree. There is no directory opt-in in es-px: a person on your team asks with the form at /partners/#directory-request, and we confirm by email first. A message that includes publish_in_directory gets a 400 with code directory_via_form_only.",
          "properties": {
            "title": {
              "type": "string",
              "minLength": 3,
              "maxLength": 120
            },
            "category": {
              "type": "string",
              "enum": [
                "lead_capture_and_follow_up",
                "scheduling_and_dispatch",
                "customer_support",
                "local_search_and_listings",
                "content_and_social",
                "websites_and_web_tools",
                "data_and_reporting",
                "integrations_and_apis",
                "research",
                "translation_and_language",
                "design_and_media",
                "office_admin_and_paperwork",
                "agent_tooling_and_infrastructure",
                "other"
              ]
            },
            "tags": {
              "type": "array",
              "maxItems": 8,
              "items": {
                "type": "string",
                "pattern": "^[a-z0-9][a-z0-9 -]{1,29}$"
              }
            },
            "summary": {
              "type": "string",
              "maxLength": 500
            },
            "region": {
              "type": "string",
              "maxLength": 60,
              "description": "Optional, for example US or online."
            },
            "open_to_introductions": {
              "type": "boolean",
              "description": "true lets a person at Eternal Spring consider an introduction. Default false."
            }
          }
        }
      }
    },
    "referred_party_permission": {
      "type": "boolean",
      "description": "Required and must be true for type referral. Means the referred shop or team asked to be introduced. Without it, the message is stored as rejected_policy. We contact a referred shop only after a person reviews it."
    },
    "listing_id": {
      "type": "string",
      "maxLength": 80,
      "description": "On close: the listing_id we returned for your offer or need. Send it from the same contact email to withdraw that listing and cancel any introduction not yet made."
    }
  }
}
