{
  "components": {
    "parameters": {
      "CostUnitsHeader": {
        "in": "header",
        "name": "X-LegiPro-Cost-Units",
        "required": false,
        "schema": {
          "minimum": 0,
          "type": "integer"
        }
      },
      "TenantHeader": {
        "in": "header",
        "name": "X-LegiPro-Tenant",
        "required": true,
        "schema": {
          "type": "string"
        }
      },
      "WorkspaceHeader": {
        "in": "header",
        "name": "X-LegiPro-Workspace",
        "required": true,
        "schema": {
          "type": "string"
        }
      }
    },
    "responses": {
      "Forbidden": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        },
        "description": "Token scope is not allowed for this route."
      },
      "NotFound": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        },
        "description": "Requested artifact or passage was not found."
      },
      "RateLimited": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        },
        "description": "Rate or cost budget exceeded."
      },
      "Unauthorized": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        },
        "description": "Missing or invalid bearer token."
      }
    },
    "schemas": {
      "GraphqlRequest": {
        "properties": {
          "query": {
            "type": "string"
          },
          "variables": {
            "type": "object"
          }
        },
        "required": [
          "query"
        ],
        "type": "object"
      },
      "HealthResponse": {
        "properties": {
          "generated_at": {
            "format": "date-time",
            "type": "string"
          },
          "ok": {
            "type": "boolean"
          },
          "status": {
            "type": "string"
          }
        },
        "required": [
          "ok",
          "generated_at"
        ],
        "type": "object"
      },
      "McpJsonRpcRequest": {
        "properties": {
          "id": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              }
            ]
          },
          "jsonrpc": {
            "const": "2.0"
          },
          "method": {
            "type": "string"
          },
          "params": {
            "type": "object"
          }
        },
        "required": [
          "jsonrpc",
          "method",
          "id"
        ],
        "type": "object"
      },
      "Problem": {
        "properties": {
          "audit_id": {
            "type": "string"
          },
          "error": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        },
        "required": [
          "error",
          "message",
          "audit_id"
        ],
        "type": "object"
      },
      "RetrieveRequest": {
        "anyOf": [
          {
            "required": [
              "artifact_id"
            ]
          },
          {
            "required": [
              "source_id"
            ]
          },
          {
            "required": [
              "passage_id"
            ]
          }
        ],
        "properties": {
          "artifact_id": {
            "type": "string"
          },
          "passage_id": {
            "type": "string"
          },
          "source_id": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "RetrieveResponse": {
        "properties": {
          "artifact_id": {
            "type": "string"
          },
          "audit_id": {
            "type": "string"
          },
          "content": {
            "type": "string"
          },
          "content_type": {
            "type": "string"
          },
          "source_ref": {
            "properties": {
              "artifact_id": {
                "type": "string"
              },
              "authority_rank": {
                "minimum": 1,
                "type": "integer"
              },
              "effective_date": {
                "type": "string"
              },
              "passage_id": {
                "type": "string"
              },
              "retrieved_by": {
                "enum": [
                  "lexical",
                  "semantic",
                  "graph",
                  "explicit",
                  "hybrid"
                ],
                "type": "string"
              },
              "source_id": {
                "type": "string"
              },
              "source_status": {
                "enum": [
                  "current",
                  "stale",
                  "mixed",
                  "unknown"
                ],
                "type": "string"
              }
            },
            "required": [
              "source_id",
              "artifact_id",
              "authority_rank"
            ],
            "type": "object"
          }
        },
        "required": [
          "artifact_id",
          "content",
          "audit_id"
        ],
        "type": "object"
      },
      "RotorAck": {
        "properties": {
          "deduplicated": {
            "type": "boolean"
          },
          "ok": {
            "type": "boolean"
          },
          "task_id": {
            "type": "string"
          }
        },
        "required": [
          "ok",
          "task_id"
        ],
        "type": "object"
      },
      "RotorCloseoutRequest": {
        "properties": {
          "artifact_path": {
            "type": "string"
          },
          "artifact_sha256": {
            "pattern": "^[a-f0-9]{64}$",
            "type": "string"
          },
          "closeout_id": {
            "type": "string"
          },
          "lane": {
            "type": "string"
          },
          "status": {
            "enum": [
              "done",
              "blocked",
              "no_delta"
            ],
            "type": "string"
          },
          "task_id": {
            "type": "string"
          }
        },
        "required": [
          "task_id",
          "lane",
          "closeout_id",
          "artifact_path",
          "artifact_sha256"
        ],
        "type": "object"
      },
      "RotorHeartbeatRequest": {
        "properties": {
          "lane": {
            "type": "string"
          },
          "lease_id": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "task_id": {
            "type": "string"
          }
        },
        "required": [
          "task_id",
          "lane",
          "lease_id"
        ],
        "type": "object"
      },
      "RotorTask": {
        "properties": {
          "corpus": {
            "type": "string"
          },
          "lane": {
            "type": "string"
          },
          "lease_id": {
            "type": "string"
          },
          "task_id": {
            "type": "string"
          }
        },
        "required": [
          "task_id",
          "corpus",
          "lane"
        ],
        "type": "object"
      },
      "SearchRequest": {
        "properties": {
          "limit": {
            "default": 5,
            "maximum": 20,
            "minimum": 1,
            "type": "integer"
          },
          "mode": {
            "default": "balanced",
            "enum": [
              "balanced",
              "exact",
              "explore"
            ],
            "type": "string"
          },
          "query": {
            "minLength": 1,
            "type": "string"
          },
          "strictReferences": {
            "default": true,
            "type": "boolean"
          }
        },
        "required": [
          "query"
        ],
        "type": "object"
      },
      "SearchResponse": {
        "properties": {
          "audit_id": {
            "type": "string"
          },
          "corpus_snapshot_id": {
            "type": "string"
          },
          "index_snapshot_id": {
            "type": "string"
          },
          "query": {
            "type": "string"
          },
          "results": {
            "items": {
              "$ref": "#/components/schemas/SearchResult"
            },
            "type": "array"
          }
        },
        "required": [
          "query",
          "results",
          "audit_id"
        ],
        "type": "object"
      },
      "SearchResult": {
        "properties": {
          "score": {
            "type": "number"
          },
          "snippet": {
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "source_ref": {
            "properties": {
              "artifact_id": {
                "type": "string"
              },
              "authority_rank": {
                "minimum": 1,
                "type": "integer"
              },
              "effective_date": {
                "type": "string"
              },
              "passage_id": {
                "type": "string"
              },
              "retrieved_by": {
                "enum": [
                  "lexical",
                  "semantic",
                  "graph",
                  "explicit",
                  "hybrid"
                ],
                "type": "string"
              },
              "source_id": {
                "type": "string"
              },
              "source_status": {
                "enum": [
                  "current",
                  "stale",
                  "mixed",
                  "unknown"
                ],
                "type": "string"
              }
            },
            "required": [
              "source_id",
              "artifact_id",
              "authority_rank"
            ],
            "type": "object"
          },
          "title": {
            "type": "string"
          }
        },
        "required": [
          "title",
          "source",
          "score"
        ],
        "type": "object"
      }
    },
    "securitySchemes": {
      "BearerAuth": {
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "info": {
    "description": "This static artifact is intended for partner review and SDK planning. It is not a claim that /openapi.json is a live API route. Scenario, answer-ready, client reliance, semantic search and professional certification remain false.",
    "summary": "Static reviewer/codegen snapshot for bounded LegiPro REST, GraphQL, MCP and protected rotor surfaces.",
    "title": "LegiPro Partner API Static Snapshot",
    "version": "2026-06-27"
  },
  "openapi": "3.1.0",
  "paths": {
    "/graphql": {
      "post": {
        "operationId": "postGraphql",
        "parameters": [
          {
            "$ref": "#/components/parameters/TenantHeader"
          },
          {
            "$ref": "#/components/parameters/WorkspaceHeader"
          },
          {
            "$ref": "#/components/parameters/CostUnitsHeader"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GraphqlRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "GraphQL JSON response."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Execute bounded GraphQL queries over search/corpus/artifact/workspace views.",
        "tags": [
          "AI Tool Runtime"
        ]
      }
    },
    "/mcp": {
      "post": {
        "operationId": "postMcp",
        "parameters": [
          {
            "$ref": "#/components/parameters/TenantHeader"
          },
          {
            "$ref": "#/components/parameters/WorkspaceHeader"
          },
          {
            "$ref": "#/components/parameters/CostUnitsHeader"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/McpJsonRpcRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "MCP JSON-RPC response."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Call bounded MCP JSON-RPC tools such as search_sources or get_artifact.",
        "tags": [
          "AI Tool Runtime"
        ]
      }
    },
    "/mcp/health": {
      "get": {
        "operationId": "getMcpHealth",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthResponse"
                }
              }
            },
            "description": "MCP health."
          }
        },
        "summary": "Check MCP runtime health.",
        "tags": [
          "Health"
        ]
      }
    },
    "/v0/rotor/closeout": {
      "post": {
        "description": "Internal worker-token route. Product/demo bearer tokens must not call rotor routes.",
        "operationId": "postRotorCloseout",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RotorCloseoutRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RotorAck"
                }
              }
            },
            "description": "Closeout accepted or de-duplicated."
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Protected idempotent worker closeout.",
        "tags": [
          "Internal Control Plane"
        ]
      }
    },
    "/v0/rotor/heartbeat": {
      "post": {
        "operationId": "postRotorHeartbeat",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RotorHeartbeatRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RotorAck"
                }
              }
            },
            "description": "Heartbeat accepted."
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Protected worker heartbeat.",
        "tags": [
          "Internal Control Plane"
        ]
      }
    },
    "/v0/rotor/tasks/next": {
      "get": {
        "description": "Internal worker-token route. Product/demo bearer tokens must not call rotor routes.",
        "operationId": "getRotorNextTask",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RotorTask"
                }
              }
            },
            "description": "Next claimable task or empty result."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Protected worker next-task preview/claim path.",
        "tags": [
          "Internal Control Plane"
        ]
      }
    },
    "/v0/search": {
      "get": {
        "operationId": "getV0Search",
        "parameters": [
          {
            "in": "query",
            "name": "query",
            "required": true,
            "schema": {
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 5,
              "maximum": 20,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "mode",
            "schema": {
              "default": "balanced",
              "enum": [
                "balanced",
                "exact",
                "explore"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "strictReferences",
            "schema": {
              "default": true,
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchResponse"
                }
              }
            },
            "description": "Search response."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "summary": "Run bounded public lexical/fuzzy search.",
        "tags": [
          "Partner Product API"
        ]
      }
    },
    "/v0/search/health": {
      "get": {
        "operationId": "getSearchHealth",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthResponse"
                }
              }
            },
            "description": "Search service is reachable."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Check public search health.",
        "tags": [
          "Health"
        ]
      }
    },
    "/v1/retrieve": {
      "post": {
        "operationId": "postV1Retrieve",
        "parameters": [
          {
            "$ref": "#/components/parameters/TenantHeader"
          },
          {
            "$ref": "#/components/parameters/WorkspaceHeader"
          },
          {
            "$ref": "#/components/parameters/CostUnitsHeader"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RetrieveRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RetrieveResponse"
                }
              }
            },
            "description": "Retrieved artifact/passage."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Retrieve an artifact or passage by stable reference.",
        "tags": [
          "Partner Product API"
        ]
      }
    },
    "/v1/search": {
      "post": {
        "operationId": "postV1Search",
        "parameters": [
          {
            "$ref": "#/components/parameters/TenantHeader"
          },
          {
            "$ref": "#/components/parameters/WorkspaceHeader"
          },
          {
            "$ref": "#/components/parameters/CostUnitsHeader"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchResponse"
                }
              }
            },
            "description": "Search response."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Run partner-scoped search with tenant/workspace headers.",
        "tags": [
          "Partner Product API"
        ]
      }
    }
  },
  "security": [
    {
      "BearerAuth": []
    }
  ],
  "servers": [
    {
      "description": "Public LegiPro demo/reviewer origin",
      "url": "https://legipro.fr"
    }
  ],
  "tags": [
    {
      "description": "Bounded product integration routes for search and retrieval.",
      "name": "Partner Product API"
    },
    {
      "description": "Bounded GraphQL and MCP tool entrypoints.",
      "name": "AI Tool Runtime"
    },
    {
      "description": "Protected worker/rotor operations; never use product/demo tokens here.",
      "name": "Internal Control Plane"
    },
    {
      "description": "Read-only health and contract checks.",
      "name": "Health"
    }
  ],
  "x-legipro-boundary": "Static OpenAPI snapshot for review/codegen only; not a live OpenAPI route and not a professional reliance claim.",
  "x-legipro-generated-at": "2026-06-28T01:21:59Z",
  "x-legipro-live-openapi-route": false,
  "x-legipro-readiness-flags": {
    "answer_ready": false,
    "client_reliance": false,
    "human_review_complete": false,
    "professional_certification": false,
    "promotion_allowed": false,
    "scenario_ready": false,
    "semantic_search_active": false
  },
  "x-legipro-roadmap-task-id": "SAAS-0033",
  "x-legipro-sdk-status": "typescript_python_beta_repo_only_pre_ga",
  "x-legipro-static-snapshot": true
}
