{
  "openapi": "3.1.0",
  "info": {
    "title": "LegiChain V3 — media",
    "description": "LegiChain V3 regional API. Metadata uses API; applicant bytes use assigned compute; manual evidence uses media.",
    "version": "3.0.0"
  },
  "paths": {
    "/healthz/live": {
      "get": {
        "tags": [
          "health"
        ],
        "summary": "Live",
        "operationId": "media_get_healthz_live",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiLive"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "402": {
            "$ref": "#/components/responses/Error402"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "405": {
            "$ref": "#/components/responses/Error405"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "410": {
            "$ref": "#/components/responses/Error410"
          },
          "413": {
            "$ref": "#/components/responses/Error413"
          },
          "415": {
            "$ref": "#/components/responses/Error415"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "502": {
            "$ref": "#/components/responses/Error502"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "security": [],
        "x-authentication": "public",
        "x-audience": "customer"
      }
    },
    "/healthz/ready": {
      "get": {
        "tags": [
          "health"
        ],
        "summary": "Ready",
        "operationId": "media_get_healthz_ready",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiReady"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "402": {
            "$ref": "#/components/responses/Error402"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "405": {
            "$ref": "#/components/responses/Error405"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "410": {
            "$ref": "#/components/responses/Error410"
          },
          "413": {
            "$ref": "#/components/responses/Error413"
          },
          "415": {
            "$ref": "#/components/responses/Error415"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "502": {
            "$ref": "#/components/responses/Error502"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "security": [],
        "x-authentication": "public",
        "x-audience": "customer"
      }
    },
    "/manual/photos": {
      "put": {
        "tags": [
          "manual-media"
        ],
        "summary": "Photo",
        "operationId": "media_put_manual_photos",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiPhotoReceipt"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "402": {
            "$ref": "#/components/responses/Error402"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "405": {
            "$ref": "#/components/responses/Error405"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "410": {
            "$ref": "#/components/responses/Error410"
          },
          "413": {
            "$ref": "#/components/responses/Error413"
          },
          "415": {
            "$ref": "#/components/responses/Error415"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "502": {
            "$ref": "#/components/responses/Error502"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "requestBody": {
          "required": true,
          "description": "Camera photo, at most 8 MiB, authorized by the 120-second manual photo grant.",
          "content": {
            "image/jpeg": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            },
            "image/png": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            }
          }
        },
        "security": [
          {
            "ManualPhotoToken": []
          }
        ],
        "x-authentication": "manual-photo",
        "x-audience": "customer"
      }
    },
    "/f/{token}": {
      "head": {
        "tags": [
          "media"
        ],
        "summary": "Media",
        "operationId": "media_head_f_token",
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Authorized evidence metadata without downloading the stored body. Range is ignored.",
            "headers": {
              "Content-Length": {
                "schema": {
                  "type": "integer"
                }
              },
              "Content-Disposition": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "402": {
            "$ref": "#/components/responses/Error402"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "405": {
            "$ref": "#/components/responses/Error405"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "410": {
            "$ref": "#/components/responses/Error410"
          },
          "413": {
            "$ref": "#/components/responses/Error413"
          },
          "415": {
            "$ref": "#/components/responses/Error415"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "502": {
            "$ref": "#/components/responses/Error502"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "security": [],
        "x-authentication": "signed-path-token",
        "x-audience": "customer"
      },
      "get": {
        "tags": [
          "media"
        ],
        "summary": "Media",
        "operationId": "media_get_f_token",
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Range",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "description": "One bytes=start-end, bytes=start- or bytes=-suffix range."
          },
          {
            "name": "If-Range",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "description": "Exact strong ETag or Last-Modified; mismatch returns the full representation."
          }
        ],
        "responses": {
          "200": {
            "description": "Retained evidence bytes. The signed path token grants access; expiry, tenant mismatch and unavailable evidence have identical 404 responses.",
            "headers": {
              "Content-Length": {
                "schema": {
                  "type": "integer"
                }
              },
              "Content-Disposition": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/json": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "video/mp4": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "video/webm": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "audio/wav": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "206": {
            "description": "Requested single byte range.",
            "headers": {
              "Content-Length": {
                "schema": {
                  "type": "integer"
                }
              },
              "Content-Disposition": {
                "schema": {
                  "type": "string"
                }
              },
              "Content-Range": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/json": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "video/mp4": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "video/webm": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "audio/wav": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "416": {
            "description": "Malformed, multiple or unsatisfiable byte range; empty body.",
            "headers": {
              "Content-Range": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "402": {
            "$ref": "#/components/responses/Error402"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "405": {
            "$ref": "#/components/responses/Error405"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "410": {
            "$ref": "#/components/responses/Error410"
          },
          "413": {
            "$ref": "#/components/responses/Error413"
          },
          "415": {
            "$ref": "#/components/responses/Error415"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "502": {
            "$ref": "#/components/responses/Error502"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "security": [],
        "x-authentication": "signed-path-token",
        "x-audience": "customer"
      }
    }
  },
  "components": {
    "schemas": {
      "CustomerJsonValue": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "number"
          },
          {
            "type": "boolean"
          },
          {
            "type": "null"
          },
          {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomerJsonValue"
            }
          },
          {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/CustomerJsonValue"
            }
          }
        ]
      },
      "ApiLive": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "region": {
            "type": "string"
          },
          "role": {
            "type": "string"
          }
        },
        "required": [
          "status",
          "region",
          "role"
        ],
        "additionalProperties": true
      },
      "ApiReady": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "region": {
            "type": "string"
          }
        },
        "required": [
          "status",
          "region"
        ],
        "additionalProperties": true
      },
      "ApiPhotoReceipt": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "bytes": {
            "type": "integer"
          }
        },
        "required": [
          "id",
          "url",
          "bytes"
        ],
        "additionalProperties": true
      },
      "ApiValidationIssue": {
        "type": "object",
        "properties": {
          "loc": {
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            }
          },
          "msg": {
            "type": "string"
          },
          "type": {
            "type": "string"
          }
        },
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "additionalProperties": true
      },
      "ApiError": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "details": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/CustomerJsonValue"
            }
          }
        },
        "required": [
          "code",
          "message"
        ],
        "additionalProperties": true
      },
      "ApiErrorResponse": {
        "type": "object",
        "properties": {
          "error": {
            "$ref": "#/components/schemas/ApiError"
          },
          "detail": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiValidationIssue"
            }
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": true
      }
    },
    "securitySchemes": {
      "ManualPhotoToken": {
        "type": "http",
        "scheme": "bearer",
        "description": "Short-lived manual-photo grant bound to the call, operator seat and generation.",
        "bearerFormat": "JWT"
      }
    },
    "responses": {
      "Error400": {
        "description": "Malformed request",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ApiErrorResponse"
            }
          }
        }
      },
      "Error401": {
        "description": "Authentication required or expired",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ApiErrorResponse"
            }
          }
        },
        "headers": {
          "WWW-Authenticate": {
            "schema": {
              "type": "string"
            }
          }
        }
      },
      "Error402": {
        "description": "Credit authority unavailable",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ApiErrorResponse"
            }
          }
        }
      },
      "Error403": {
        "description": "Scope or permission denied",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ApiErrorResponse"
            }
          }
        }
      },
      "Error404": {
        "description": "Not found or unavailable",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ApiErrorResponse"
            }
          }
        }
      },
      "Error405": {
        "description": "Method not allowed",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ApiErrorResponse"
            }
          }
        }
      },
      "Error409": {
        "description": "State, revision or idempotency conflict",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ApiErrorResponse"
            }
          }
        }
      },
      "Error410": {
        "description": "Retention expired",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ApiErrorResponse"
            }
          }
        }
      },
      "Error413": {
        "description": "Request exceeds byte budget",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ApiErrorResponse"
            }
          }
        }
      },
      "Error415": {
        "description": "Unsupported media type",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ApiErrorResponse"
            }
          }
        }
      },
      "Error422": {
        "description": "Invalid fields or business input",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ApiErrorResponse"
            }
          }
        }
      },
      "Error429": {
        "description": "Rate or admission limit",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ApiErrorResponse"
            }
          }
        },
        "headers": {
          "Retry-After": {
            "description": "Optional server-specified delay in seconds; do not retry a non-idempotent mutation with a new key.",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          }
        }
      },
      "Error500": {
        "description": "Internal error",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ApiErrorResponse"
            }
          }
        }
      },
      "Error502": {
        "description": "Invalid upstream response",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ApiErrorResponse"
            }
          }
        }
      },
      "Error503": {
        "description": "Dependency or capacity temporarily unavailable",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ApiErrorResponse"
            }
          }
        },
        "headers": {
          "Retry-After": {
            "description": "Optional server-specified delay in seconds; do not retry a non-idempotent mutation with a new key.",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          }
        }
      }
    }
  },
  "webhooks": {},
  "x-contract-version": "2026-11-04.fraud52",
  "x-compatibility": "V3 additions are additive; unknown response properties must be tolerated. Idempotent input snapshots and billed attempts remain immutable. No V2 wire compatibility is implied."
}
