{
  "openapi": "3.1.0",
  "info": {
    "title": "Humetric Public Discovery API",
    "version": "1.0.0",
    "description": "Machine-readable access to consent-filtered public professional profiles. Missing fields are private or absent and must not be inferred.",
    "contact": {
      "name": "Humetric",
      "email": "humetric2026@gmail.com",
      "url": "https://humetric.net/agents"
    },
    "license": {
      "name": "Humetric Terms of Use",
      "url": "https://humetric.net/terms"
    }
  },
  "servers": [
    {
      "url": "https://humetric.net"
    }
  ],
  "externalDocs": {
    "description": "Humetric agent instructions",
    "url": "https://humetric.net/agent-instructions.md"
  },
  "paths": {
    "/api/v1/profiles/{slug}": {
      "get": {
        "operationId": "getPublicProfile",
        "summary": "Read one public profile",
        "description": "Returns the current exposure-filtered public profile. Use Accept: text/markdown or format=markdown for the Markdown representation.",
        "security": [],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 120
            }
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "description": "Explicitly select the Markdown representation.",
            "schema": {
              "type": "string",
              "enum": [
                "markdown"
              ]
            }
          },
          {
            "name": "Accept",
            "in": "header",
            "required": false,
            "description": "Supports application/json and text/markdown with q-values.",
            "schema": {
              "type": "string"
            },
            "examples": {
              "json": {
                "value": "application/json"
              },
              "markdown": {
                "value": "text/markdown"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Public profile in the negotiated representation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProfileResponse"
                }
              },
              "text/markdown": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/ProfileNotFound"
          },
          "406": {
            "$ref": "#/components/responses/NotAcceptable"
          }
        }
      }
    },
    "/api/mcp": {
      "post": {
        "operationId": "mcp",
        "summary": "MCP Streamable HTTP endpoint",
        "description": "Authenticated Model Context Protocol endpoint. Candidate tools operate only on the authenticated user's own profile; recruiter tools require an authorized workspace. Tool availability is role-gated, MCP has no anonymous public viewer, and contact fields are never returned.",
        "security": [
          {
            "oauthBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/McpJsonRpcMessage"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "MCP JSON-RPC response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpJsonRpcMessage"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "oauthBearer": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "OAuth 2.0 access token",
        "description": "MCP clients discover the authorization server from /.well-known/oauth-protected-resource/api/mcp."
      }
    },
    "responses": {
      "BadRequest": {
        "description": "The request is invalid.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Unauthorized": {
        "description": "Authentication is required or invalid.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Forbidden": {
        "description": "The authenticated identity is not allowed to use the requested interface.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "ProfileNotFound": {
        "description": "No public profile is available at this URL.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          },
          "text/markdown": {
            "schema": {
              "type": "string"
            }
          }
        }
      },
      "NotAcceptable": {
        "description": "The requested Accept media types are not supported.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string"
          },
          "docs": {
            "type": "string",
            "format": "uri-reference"
          }
        },
        "additionalProperties": true
      },
      "PeopleSearchResponse": {
        "type": "object",
        "required": [
          "query",
          "mode",
          "highlightsVersion",
          "count",
          "results"
        ],
        "properties": {
          "query": {
            "type": "string"
          },
          "mode": {
            "type": "string",
            "enum": [
              "hybrid",
              "keyword_only"
            ]
          },
          "highlightsVersion": {
            "type": "string"
          },
          "count": {
            "type": "integer",
            "minimum": 0
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicProfileResult"
            }
          }
        },
        "additionalProperties": false
      },
      "PublicProfile": {
        "type": "object",
        "required": [
          "display_name",
          "last_updated"
        ],
        "properties": {
          "display_name": {
            "type": "string"
          },
          "last_updated": {
            "type": "string",
            "format": "date"
          },
          "slug": {
            "type": "string"
          },
          "headline": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "location": {
            "type": "string"
          },
          "years_experience": {
            "type": "number"
          },
          "skills": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "experiences": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProfileExperience"
            }
          },
          "educations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProfileEducation"
            }
          },
          "projects": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProfileProject"
            }
          },
          "github": {
            "$ref": "#/components/schemas/PublicIdentityLink"
          },
          "linkedin": {
            "$ref": "#/components/schemas/PublicIdentityLink"
          },
          "website": {
            "$ref": "#/components/schemas/PublicIdentityLink"
          },
          "contact_status": {
            "type": "string",
            "enum": [
              "open_to_offers",
              "passive",
              "not_looking"
            ]
          },
          "approvedDiscoveryQueries": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "additionalProperties": true
      },
      "PublicProfileResult": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PublicProfile"
          },
          {
            "type": "object",
            "required": [
              "canonicalUrl",
              "relevance",
              "highlights"
            ],
            "properties": {
          "canonicalUrl": {
            "type": "string",
            "format": "uri"
          },
          "relevance": {
            "type": "number"
          },
          "highlights": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProfileHighlight"
            }
          }
            },
            "additionalProperties": true
          }
        ]
      },
      "ProfileHighlight": {
        "type": "object",
        "required": [
          "chunkId",
          "type",
          "text",
          "score"
        ],
        "properties": {
          "chunkId": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "score": {
            "type": "number"
          }
        },
        "additionalProperties": false
      },
      "PublicIdentityLink": {
        "type": "object",
        "required": [
          "url",
          "verified"
        ],
        "properties": {
          "url": {
            "type": "string",
            "format": "uri"
          },
          "verified": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "ProfileExperience": {
        "type": "object",
        "required": [
          "title"
        ],
        "properties": {
          "title": {
            "type": "string"
          },
          "company": {
            "type": [
              "string",
              "null"
            ]
          },
          "start_date": {
            "type": [
              "string",
              "null"
            ]
          },
          "end_date": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "additionalProperties": true
      },
      "ProfileEducation": {
        "type": "object",
        "required": [
          "school"
        ],
        "properties": {
          "school": {
            "type": "string"
          },
          "degree": {
            "type": [
              "string",
              "null"
            ]
          },
          "field": {
            "type": [
              "string",
              "null"
            ]
          },
          "start_year": {
            "type": [
              "integer",
              "null"
            ]
          },
          "end_year": {
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "additionalProperties": true
      },
      "ProfileProject": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "technologies": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "additionalProperties": true
      },
      "ProfileResponse": {
        "type": "object",
        "required": [
          "canonicalUrl",
          "profile",
          "chunksVersion",
          "evidence"
        ],
        "properties": {
          "canonicalUrl": {
            "type": "string",
            "format": "uri"
          },
          "profileVersion": {
            "type": "string"
          },
          "lastUpdated": {
            "type": "string",
            "format": "date-time"
          },
          "profile": {
            "$ref": "#/components/schemas/PublicProfile"
          },
          "chunksVersion": {
            "type": "string"
          },
          "approvedDiscoveryQueries": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "evidence": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProfileHighlight"
            }
          }
        },
        "additionalProperties": false
      },
      "McpJsonRpcMessage": {
        "type": "object",
        "description": "MCP JSON-RPC request or response. The exact shape is defined by the MCP protocol version negotiated during initialization.",
        "required": [
          "jsonrpc"
        ],
        "properties": {
          "jsonrpc": {
            "const": "2.0"
          },
          "id": {},
          "method": {
            "type": "string"
          },
          "params": {
            "type": "object",
            "additionalProperties": true
          },
          "result": {
            "type": "object",
            "additionalProperties": true
          },
          "error": {
            "type": "object",
            "additionalProperties": true
          }
        },
        "additionalProperties": true
      }
    }
  }
}
