{
  "openapi": "3.1.0",
  "info": {
    "title": "HireWave Trust Agent API",
    "version": "0.1.0",
    "description": "Static HTTP surfaces for agent-mediated hiring packets. This descriptor exposes discovery, job packets, and templates; it does not provide autonomous application submission."
  },
  "servers": [
    {
      "url": "https://hirewave.ai"
    }
  ],
  "tags": [
    {
      "name": "Discovery",
      "description": "Agent discovery and static contract documents."
    },
    {
      "name": "Jobs",
      "description": "Canonical agent-readable job packets."
    },
    {
      "name": "Templates",
      "description": "Recruiter, candidate, and trust receipt packet templates."
    }
  ],
  "paths": {
    "/.well-known/agent-card.json": {
      "get": {
        "tags": [
          "Discovery"
        ],
        "operationId": "getAgentCard",
        "summary": "Get the static HireWave agent discovery card.",
        "responses": {
          "200": {
            "description": "Agent discovery card.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentCard"
                }
              }
            }
          }
        }
      }
    },
    "/.well-known/hirewave-agent.json": {
      "get": {
        "tags": [
          "Discovery"
        ],
        "operationId": "getHireWaveManifest",
        "summary": "Get the compact HireWave-specific agent manifest.",
        "responses": {
          "200": {
            "description": "HireWave manifest.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/jobs.json": {
      "get": {
        "tags": [
          "Jobs"
        ],
        "operationId": "listJobs",
        "summary": "List stable HireWave job packets.",
        "responses": {
          "200": {
            "description": "Job index.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobsIndex"
                }
              }
            }
          }
        }
      }
    },
    "/jobs/{slug}.json": {
      "get": {
        "tags": [
          "Jobs"
        ],
        "operationId": "getStableJobPacket",
        "summary": "Get a stable canonical job packet by slug.",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "agent-distribution-lead"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Structured JobPosting plus HireWave trust contract.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobPacket"
                }
              }
            }
          }
        }
      }
    },
    "/j/{payload}.json": {
      "get": {
        "tags": [
          "Jobs"
        ],
        "operationId": "getEncodedJobPacket",
        "summary": "Get a generated job packet from an encoded payload.",
        "parameters": [
          {
            "name": "payload",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "URL-safe base64 JSON payload generated by the HireWave builder."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Structured JobPosting plus HireWave trust contract.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobPacket"
                }
              }
            }
          },
          "400": {
            "description": "Invalid encoded job packet.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/packet-templates.json": {
      "get": {
        "tags": [
          "Templates"
        ],
        "operationId": "getPacketTemplates",
        "summary": "Get recruiter, candidate, and trust receipt packet templates.",
        "responses": {
          "200": {
            "description": "Static packet templates.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PacketTemplates"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AgentCard": {
        "type": "object",
        "required": [
          "name",
          "description",
          "supportedInterfaces",
          "version",
          "capabilities",
          "defaultInputModes",
          "defaultOutputModes",
          "skills"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "supportedInterfaces": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "url",
                "protocolBinding",
                "protocolVersion"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "format": "uri"
                },
                "protocolBinding": {
                  "type": "string"
                },
                "protocolVersion": {
                  "type": "string"
                }
              }
            }
          },
          "version": {
            "type": "string"
          },
          "capabilities": {
            "type": "object"
          },
          "defaultInputModes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "defaultOutputModes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "skills": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        }
      },
      "JobsIndex": {
        "type": "object",
        "properties": {
          "jobs": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "slug",
                "title",
                "company",
                "publicPage",
                "json"
              ],
              "properties": {
                "slug": {
                  "type": "string"
                },
                "title": {
                  "type": "string"
                },
                "company": {
                  "type": "string"
                },
                "publicPage": {
                  "type": "string",
                  "format": "uri"
                },
                "json": {
                  "type": "string",
                  "format": "uri"
                }
              }
            }
          }
        }
      },
      "JobPacket": {
        "type": "object",
        "required": [
          "@type",
          "title",
          "hiringOrganization",
          "hirewave",
          "agentReadableRoutes"
        ],
        "properties": {
          "@type": {
            "type": "string",
            "const": "JobPosting"
          },
          "title": {
            "type": "string"
          },
          "hiringOrganization": {
            "type": "object"
          },
          "hirewave": {
            "type": "object"
          },
          "agentReadableRoutes": {
            "type": "object"
          }
        }
      },
      "PacketTemplates": {
        "type": "object",
        "required": [
          "schemaVersion",
          "recruiterAgentClaimPacket",
          "candidateConsentProfile",
          "candidateApplicationPacket",
          "trustReceipt"
        ],
        "properties": {
          "schemaVersion": {
            "type": "string",
            "const": "hirewave-packet-templates-v1"
          },
          "recruiterAgentClaimPacket": {
            "type": "object"
          },
          "candidateConsentProfile": {
            "type": "object"
          },
          "candidateApplicationPacket": {
            "type": "object"
          },
          "trustReceipt": {
            "type": "object"
          }
        }
      },
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string"
          }
        }
      }
    }
  }
}