{
  "lookupRecord": {
    "get": {
      "operationId": "lookupRecord",
      "tags": ["Records"],
      "summary": "Look up a record by external ID",
      "description": "Looks up one readable record by namespace and external ID. First-party Pigeon sessions may use list=true to browse live library saves in descending updated_at and ID order. Each page uses current visibility. Edits can move saves to an earlier page. In list mode, fields adds a selected canonical record to each row under record.",
      "parameters": [
        {
          "name": "ns",
          "in": "query",
          "description": "Required once for lookup. Colon-separated ASCII namespace segments.",
          "schema": {"type": "string", "minLength": 1, "maxLength": 128, "pattern": "^[A-Za-z0-9_.-]+(?::[A-Za-z0-9_.-]+)*$"}
        },
        {
          "name": "external_id",
          "in": "query",
          "description": "Required once for lookup. External ID within the namespace, at most 2048 UTF-8 bytes with no NUL.",
          "schema": {"type": "string", "minLength": 1, "maxLength": 2048}
        },
        {"name": "list", "in": "query", "description": "Use owner-only list mode.", "schema": {"type": "boolean"}},
        {
          "name": "kind",
          "in": "query",
          "description": "In list mode, filter by save kind.",
          "schema": {"$ref": "#/SaveKind"}
        },
        {"name": "limit", "in": "query", "description": "List page size.", "schema": {"type": "integer", "minimum": 1, "maximum": 100, "default": 50}},
        {"name": "cursor", "in": "query", "description": "Use next_cursor from the previous list page with the same kind.", "schema": {"type": "string"}},
        {"$ref": "../components/parameters.yaml#/Fields"}
      ],
      "x-route-error-codes": {"400": ["invalid_request", "invalid_cursor"], "403": ["scope_denied", "forbidden"], "404": ["not_found"], "422": ["unsupported_schema"]},
      "responses": {
        "200": {
          "description": "A record for lookup, or a page of save rows for list mode.",
          "headers": {
            "request-id": {"$ref": "../components/headers.yaml#/RequestId"},
            "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}
          },
          "content": {
            "application/json": {"schema": {"oneOf": [{"$ref": "../components/schemas.yaml#/RecordDetail"}, {"$ref": "#/SaveListPage"}]}}
          }
        },
        "400": {
          "description": "Invalid field selection, list input or cursor.",
          "headers": {"request-id": {"$ref": "../components/headers.yaml#/RequestId"}, "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}},
          "content": {"application/problem+json": {"schema": {"$ref": "../components/schemas.yaml#/Problem"}}},
          "x-error-codes": ["invalid_cursor", "invalid_fields", "invalid_request"]
        },
        "401": {
          "description": "The credential is missing, invalid or tied to a superseded grant.",
          "headers": {"request-id": {"$ref": "../components/headers.yaml#/RequestId"}, "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}},
          "content": {"application/problem+json": {"schema": {"$ref": "../components/schemas.yaml#/Problem"}}},
          "x-error-codes": ["episode_superseded", "unauthorized"]
        },
        "403": {
          "description": "The active credential or configuration does not permit this action.",
          "headers": {"request-id": {"$ref": "../components/headers.yaml#/RequestId"}, "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}},
          "content": {"application/problem+json": {"schema": {"$ref": "../components/schemas.yaml#/Problem"}}},
          "x-error-codes": ["connection_disconnected", "connection_paused", "connection_required", "forbidden", "pro_required", "sapphire_account_required", "scope_denied"]
        },
        "404": {
          "description": "The requested object was not found.",
          "headers": {"request-id": {"$ref": "../components/headers.yaml#/RequestId"}, "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}},
          "content": {"application/problem+json": {"schema": {"$ref": "../components/schemas.yaml#/Problem"}}},
          "x-error-codes": ["not_found"]
        },
        "409": {
          "description": "Pigeon data deletion is in progress.",
          "headers": {"request-id": {"$ref": "../components/headers.yaml#/RequestId"}, "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}},
          "content": {"application/problem+json": {"schema": {"$ref": "../components/schemas.yaml#/Problem"}}},
          "x-error-codes": ["pigeon_data_deleting"]
        },
        "410": {
          "description": "The account, snapshot, cursor or history is no longer available.",
          "headers": {"request-id": {"$ref": "../components/headers.yaml#/RequestId"}, "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}},
          "content": {"application/problem+json": {"schema": {"$ref": "../components/schemas.yaml#/Problem"}}},
          "x-error-codes": ["account_deleted"]
        },
        "413": {
          "description": "The request, response or resulting work exceeds its limit.",
          "headers": {"request-id": {"$ref": "../components/headers.yaml#/RequestId"}, "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}},
          "content": {"application/problem+json": {"schema": {"$ref": "../components/schemas.yaml#/Problem"}}},
          "x-error-codes": ["response_too_large"]
        },
        "422": {
          "description": "The request violates a protocol or data rule.",
          "headers": {"request-id": {"$ref": "../components/headers.yaml#/RequestId"}, "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}},
          "content": {"application/problem+json": {"schema": {"$ref": "../components/schemas.yaml#/Problem"}}},
          "x-error-codes": ["unsupported_schema"]
        },
        "429": {
          "description": "A request or work budget is exhausted.",
          "headers": {"request-id": {"$ref": "../components/headers.yaml#/RequestId"}, "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}, "Retry-After": {"$ref": "../components/headers.yaml#/RetryAfter"}},
          "content": {"application/problem+json": {"schema": {"$ref": "../components/schemas.yaml#/Problem"}}},
          "x-error-codes": ["rate_limited"]
        },
        "503": {
          "description": "The Hub or an operation dependency is unavailable.",
          "headers": {"request-id": {"$ref": "../components/headers.yaml#/RequestId"}, "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}, "Retry-After": {"$ref": "../components/headers.yaml#/RetryAfter"}},
          "content": {"application/problem+json": {"schema": {"$ref": "../components/schemas.yaml#/Problem"}}},
          "x-error-codes": ["hub_not_ready", "identity_unavailable", "internal_error"]
        }
      }
    }
  },
  "SaveKind": {
    "type": "string",
    "enum": ["place", "event", "recipe", "guide", "workout", "note", "link", "media", "product", "tab"]
  },
  "SaveListPage": {
    "type": "object",
    "additionalProperties": false,
    "required": ["results", "next_cursor"],
    "properties": {
      "results": {
        "type": "array",
        "items": {
          "type": "object",
          "additionalProperties": false,
          "required": ["id", "kind", "title", "updated_at", "edited", "flags"],
          "properties": {
            "id": {"type": "string", "format": "uuid"},
            "kind": {"$ref": "#/SaveKind"},
            "title": {"type": ["string", "null"]},
            "updated_at": {"type": "string", "format": "date-time"},
            "record": {"$ref": "../components/schemas.yaml#/SelectedRecord"},
            "edited": {"type": "boolean", "description": "The save has retained edits to its imported original, or an assistant edit exists for a save without an original."},
            "flags": {"type": "array", "items": {"type": "string", "enum": ["no_longer_in_original"]}}
          }
        }
      },
      "next_cursor": {"type": ["string", "null"]}
    }
  },
  "getRecord": {
    "get": {
      "operationId": "getRecord",
      "tags": ["Records"],
      "summary": "Read a record",
      "description": "Returns the current authorized canonical record, including state. Malformed IDs, missing records, other accounts’ records, and records outside the caller’s read grant return not_found. Send results include only readable targets. Tombstones may be visible to the originating connection or Pigeon. A selected response is marked selected_fields and cannot serve as a full record for replacement.",
      "parameters": [
        {"$ref": "../components/parameters.yaml#/RecordId"},
        {"$ref": "../components/parameters.yaml#/Fields"}
      ],
      "x-route-error-codes": {"403": ["scope_denied"], "404": ["not_found"], "422": ["unsupported_schema"]},
      "responses": {
        "200": {
          "description": "Successful response.",
          "headers": {
            "request-id": {"$ref": "../components/headers.yaml#/RequestId"},
            "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}
          },
          "content": {
            "application/json": {
              "schema": {
                "$ref": "../components/schemas.yaml#/RecordDetail"
              }
            }
          }
        },
        "400": {
          "description": "Invalid field selection.",
          "headers": {"request-id": {"$ref": "../components/headers.yaml#/RequestId"}, "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}},
          "content": {"application/problem+json": {"schema": {"$ref": "../components/schemas.yaml#/Problem"}}},
          "x-error-codes": ["invalid_fields"]
        },
        "401": {
          "description": "The credential is missing, invalid or tied to a superseded grant.",
          "headers": {"request-id": {"$ref": "../components/headers.yaml#/RequestId"}, "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}},
          "content": {"application/problem+json": {"schema": {"$ref": "../components/schemas.yaml#/Problem"}}},
          "x-error-codes": ["episode_superseded", "unauthorized"]
        },
        "403": {
          "description": "The active credential or configuration does not permit this action.",
          "headers": {"request-id": {"$ref": "../components/headers.yaml#/RequestId"}, "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}},
          "content": {"application/problem+json": {"schema": {"$ref": "../components/schemas.yaml#/Problem"}}},
          "x-error-codes": ["connection_disconnected", "connection_paused", "connection_required", "pro_required", "sapphire_account_required", "scope_denied"]
        },
        "404": {
          "description": "The requested object was not found.",
          "headers": {"request-id": {"$ref": "../components/headers.yaml#/RequestId"}, "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}},
          "content": {"application/problem+json": {"schema": {"$ref": "../components/schemas.yaml#/Problem"}}},
          "x-error-codes": ["not_found"]
        },
        "409": {
          "description": "The request conflicts with the current state.",
          "headers": {"request-id": {"$ref": "../components/headers.yaml#/RequestId"}, "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}},
          "content": {"application/problem+json": {"schema": {"$ref": "../components/schemas.yaml#/Problem"}}},
          "x-error-codes": ["pigeon_data_deleting"]
        },
        "410": {
          "description": "The account, snapshot, cursor or history is no longer available.",
          "headers": {"request-id": {"$ref": "../components/headers.yaml#/RequestId"}, "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}},
          "content": {"application/problem+json": {"schema": {"$ref": "../components/schemas.yaml#/Problem"}}},
          "x-error-codes": ["account_deleted"]
        },
        "413": {
          "description": "The request, response or resulting work exceeds its limit.",
          "headers": {"request-id": {"$ref": "../components/headers.yaml#/RequestId"}, "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}},
          "content": {"application/problem+json": {"schema": {"$ref": "../components/schemas.yaml#/Problem"}}},
          "x-error-codes": ["response_too_large"]
        },
        "422": {
          "description": "The request violates a protocol or data rule.",
          "headers": {"request-id": {"$ref": "../components/headers.yaml#/RequestId"}, "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}},
          "content": {"application/problem+json": {"schema": {"$ref": "../components/schemas.yaml#/Problem"}}},
          "x-error-codes": ["invalid_id", "unsupported_schema"]
        },
        "429": {
          "description": "A request or work budget is exhausted.",
          "headers": {"request-id": {"$ref": "../components/headers.yaml#/RequestId"}, "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}, "Retry-After": {"$ref": "../components/headers.yaml#/RetryAfter"}},
          "content": {"application/problem+json": {"schema": {"$ref": "../components/schemas.yaml#/Problem"}}},
          "x-error-codes": ["rate_limited"]
        },
        "503": {
          "description": "The Hub or an operation dependency is unavailable.",
          "headers": {"request-id": {"$ref": "../components/headers.yaml#/RequestId"}, "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}, "Retry-After": {"$ref": "../components/headers.yaml#/RetryAfter"}},
          "content": {"application/problem+json": {"schema": {"$ref": "../components/schemas.yaml#/Problem"}}},
          "x-error-codes": ["hub_not_ready", "identity_unavailable", "internal_error"]
        }
      }
    }
  },
  "listRecordHistory": {
    "get": {
      "operationId": "listRecordHistory",
      "tags": ["Records"],
      "summary": "List record history",
      "description": "Returns canonical snapshots and committed revision metadata for a live readable record. Revisions are ascending. Advance after to the last revision processed.",
      "parameters": [
        {"$ref": "../components/parameters.yaml#/RecordId"},
        {
          "name": "after",
          "in": "query",
          "required": false,
          "description": "Exclusive revision number.",
          "schema": {"type": "integer", "minimum": 0, "maximum": 2147483647, "default": 0}
        },
        {
          "name": "limit",
          "in": "query",
          "required": false,
          "description": "Maximum entries to return.",
          "schema": {"type": "integer", "minimum": 1, "maximum": 200, "default": 200}
        }
      ],
      "x-route-error-codes": {"400": ["invalid_limit"], "403": ["scope_denied"], "404": ["not_found"], "410": ["history_expired"], "422": ["unsupported_schema"], "503": ["history_corrupt"]},
      "responses": {
        "200": {
          "description": "Successful response.",
          "headers": {
            "request-id": {"$ref": "../components/headers.yaml#/RequestId"},
            "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}
          },
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": ["revision", "revision_op", "seq", "snapshot", "at"],
                  "properties": {
                    "revision": {"type": "integer", "minimum": 1},
                    "revision_op": {"type": "string", "format": "uuid"},
                    "seq": {"type": "integer", "minimum": 0},
                    "snapshot": {"$ref": "../components/schemas.yaml#/Record"},
                    "at": {"type": "string", "format": "date-time"}
                  }
                }
              }
            }
          }
        },
        "400": {
          "description": "The request could not be parsed or contains an invalid parameter.",
          "headers": {"request-id": {"$ref": "../components/headers.yaml#/RequestId"}, "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}},
          "content": {"application/problem+json": {"schema": {"$ref": "../components/schemas.yaml#/Problem"}}},
          "x-error-codes": ["invalid_limit"]
        },
        "401": {
          "description": "The credential is missing, invalid or tied to a superseded grant.",
          "headers": {"request-id": {"$ref": "../components/headers.yaml#/RequestId"}, "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}},
          "content": {"application/problem+json": {"schema": {"$ref": "../components/schemas.yaml#/Problem"}}},
          "x-error-codes": ["episode_superseded", "unauthorized"]
        },
        "403": {
          "description": "The active credential or configuration does not permit this action.",
          "headers": {"request-id": {"$ref": "../components/headers.yaml#/RequestId"}, "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}},
          "content": {"application/problem+json": {"schema": {"$ref": "../components/schemas.yaml#/Problem"}}},
          "x-error-codes": ["connection_disconnected", "connection_paused", "connection_required", "pro_required", "sapphire_account_required", "scope_denied"]
        },
        "404": {
          "description": "The requested object was not found.",
          "headers": {"request-id": {"$ref": "../components/headers.yaml#/RequestId"}, "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}},
          "content": {"application/problem+json": {"schema": {"$ref": "../components/schemas.yaml#/Problem"}}},
          "x-error-codes": ["not_found"]
        },
        "409": {
          "description": "The request conflicts with the current state.",
          "headers": {"request-id": {"$ref": "../components/headers.yaml#/RequestId"}, "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}},
          "content": {"application/problem+json": {"schema": {"$ref": "../components/schemas.yaml#/Problem"}}},
          "x-error-codes": ["pigeon_data_deleting"]
        },
        "410": {
          "description": "The account, snapshot, cursor or history is no longer available.",
          "headers": {"request-id": {"$ref": "../components/headers.yaml#/RequestId"}, "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}},
          "content": {"application/problem+json": {"schema": {"$ref": "../components/schemas.yaml#/Problem"}}},
          "x-error-codes": ["account_deleted", "history_expired"]
        },
        "413": {
          "description": "The request, response or resulting work exceeds its limit.",
          "headers": {"request-id": {"$ref": "../components/headers.yaml#/RequestId"}, "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}},
          "content": {"application/problem+json": {"schema": {"$ref": "../components/schemas.yaml#/Problem"}}},
          "x-error-codes": ["response_too_large"]
        },
        "422": {
          "description": "The request violates a protocol or data rule.",
          "headers": {"request-id": {"$ref": "../components/headers.yaml#/RequestId"}, "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}},
          "content": {"application/problem+json": {"schema": {"$ref": "../components/schemas.yaml#/Problem"}}},
          "x-error-codes": ["invalid_id", "unsupported_schema"]
        },
        "429": {
          "description": "A request or work budget is exhausted.",
          "headers": {"request-id": {"$ref": "../components/headers.yaml#/RequestId"}, "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}, "Retry-After": {"$ref": "../components/headers.yaml#/RetryAfter"}},
          "content": {"application/problem+json": {"schema": {"$ref": "../components/schemas.yaml#/Problem"}}},
          "x-error-codes": ["rate_limited"]
        },
        "503": {
          "description": "The hub or an operation dependency is unavailable.",
          "headers": {"request-id": {"$ref": "../components/headers.yaml#/RequestId"}, "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}, "Retry-After": {"$ref": "../components/headers.yaml#/RetryAfter"}},
          "content": {"application/problem+json": {"schema": {"$ref": "../components/schemas.yaml#/Problem"}}},
          "x-error-codes": ["history_corrupt", "hub_not_ready", "identity_unavailable", "internal_error"]
        }
      }
    }
  },
  "getRecordOriginal": {
    "get": {
      "operationId": "getRecordOriginal",
      "tags": ["Records"],
      "summary": "Read the original extraction",
      "description": "Returns the current body and its adopted extraction for a linked record.",
      "parameters": [
        {"$ref": "../components/parameters.yaml#/RecordId"}
      ],
      "x-route-error-codes": {"403": ["scope_denied"], "404": ["not_found"], "422": ["unsupported_schema"]},
      "responses": {
        "200": {
          "description": "Successful response.",
          "headers": {
            "request-id": {"$ref": "../components/headers.yaml#/RequestId"},
            "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}
          },
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["mine", "original","baseline","review"],
                "properties": {
                  "mine": {},
                  "baseline":{"type":"object","required":["version","body"],"properties":{"version":{"type":"integer","minimum":1},"body":{}}},
                  "review":{"type":["object","null"],"required":["from_version","candidate_version"],"properties":{"from_version":{"type":"integer"},"candidate_version":{"type":"integer"}}},
                  "original": {
                    "type": "object",
                    "required": ["source", "artifact", "version", "schema", "body", "inputs", "evidence", "gaps"],
                    "properties": {
                      "source": {"type": "string", "format": "uuid"},
                      "artifact": {"type": "string", "format": "uuid"},
                      "version": {"type": "integer", "minimum": 1},
                      "schema": {"type": "string"},
                      "body": {},
                      "inputs": {"type": "object", "additionalProperties": {"type": "string"}},
                      "evidence": {
                        "type": "object",
                        "additionalProperties": {
                          "type": "object",
                          "required": ["input", "start", "end", "quote"],
                          "properties": {
                            "input": {"type": "string"},
                            "start": {"type": "integer", "minimum": 0},
                            "end": {"type": "integer", "minimum": 0},
                            "quote": {"type": "string"}
                          }
                        }
                      },
                      "gaps": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": ["code"],
                          "properties": {"code": {"type": "string"}, "part": {"type": "string"}, "field": {"type": "string"}, "note": {"type": "string"}}
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "401": {
          "description": "The credential is missing, invalid or tied to a superseded grant.",
          "headers": {"request-id": {"$ref": "../components/headers.yaml#/RequestId"}, "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}},
          "content": {"application/problem+json": {"schema": {"$ref": "../components/schemas.yaml#/Problem"}}},
          "x-error-codes": ["episode_superseded", "unauthorized"]
        },
        "403": {
          "description": "The active credential or configuration does not permit this action.",
          "headers": {"request-id": {"$ref": "../components/headers.yaml#/RequestId"}, "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}},
          "content": {"application/problem+json": {"schema": {"$ref": "../components/schemas.yaml#/Problem"}}},
          "x-error-codes": ["connection_disconnected", "connection_paused", "connection_required", "pro_required", "sapphire_account_required", "scope_denied"]
        },
        "404": {
          "description": "The requested object was not found.",
          "headers": {"request-id": {"$ref": "../components/headers.yaml#/RequestId"}, "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}},
          "content": {"application/problem+json": {"schema": {"$ref": "../components/schemas.yaml#/Problem"}}},
          "x-error-codes": ["not_found"]
        },
        "409": {
          "description": "The request conflicts with the current state.",
          "headers": {"request-id": {"$ref": "../components/headers.yaml#/RequestId"}, "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}},
          "content": {"application/problem+json": {"schema": {"$ref": "../components/schemas.yaml#/Problem"}}},
          "x-error-codes": ["pigeon_data_deleting"]
        },
        "410": {
          "description": "The account, snapshot, cursor or history is no longer available.",
          "headers": {"request-id": {"$ref": "../components/headers.yaml#/RequestId"}, "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}},
          "content": {"application/problem+json": {"schema": {"$ref": "../components/schemas.yaml#/Problem"}}},
          "x-error-codes": ["account_deleted"]
        },
        "413": {
          "description": "The request, response or resulting work exceeds its limit.",
          "headers": {"request-id": {"$ref": "../components/headers.yaml#/RequestId"}, "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}},
          "content": {"application/problem+json": {"schema": {"$ref": "../components/schemas.yaml#/Problem"}}},
          "x-error-codes": ["response_too_large"]
        },
        "422": {
          "description": "The request violates a protocol or data rule.",
          "headers": {"request-id": {"$ref": "../components/headers.yaml#/RequestId"}, "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}},
          "content": {"application/problem+json": {"schema": {"$ref": "../components/schemas.yaml#/Problem"}}},
          "x-error-codes": ["invalid_id", "unsupported_schema"]
        },
        "429": {
          "description": "A request or work budget is exhausted.",
          "headers": {"request-id": {"$ref": "../components/headers.yaml#/RequestId"}, "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}, "Retry-After": {"$ref": "../components/headers.yaml#/RetryAfter"}},
          "content": {"application/problem+json": {"schema": {"$ref": "../components/schemas.yaml#/Problem"}}},
          "x-error-codes": ["rate_limited"]
        },
        "503": {
          "description": "The Hub or an operation dependency is unavailable.",
          "headers": {"request-id": {"$ref": "../components/headers.yaml#/RequestId"}, "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}, "Retry-After": {"$ref": "../components/headers.yaml#/RetryAfter"}},
          "content": {"application/problem+json": {"schema": {"$ref": "../components/schemas.yaml#/Problem"}}},
          "x-error-codes": ["hub_not_ready", "identity_unavailable", "internal_error"]
        }
      }
    }
  },
  "reviewRecordOriginal": {
    "post": {
      "operationId": "reviewRecordOriginal",
      "tags": ["Records"],
      "summary": "Resolve an original review",
      "description": "Keep the user's version or adopt the candidate extraction using the current revision and candidate version.",
      "parameters": [
        {"$ref": "../components/parameters.yaml#/RecordId"},
        {"$ref": "../components/parameters.yaml#/IdempotencyKey"}
      ],
      "requestBody": {
        "required": true,
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": ["choice", "base", "candidate_version"],
              "properties": {
                "choice": {"type": "string", "enum": ["keep_mine", "take_original"]},
                "base": {"$ref": "../components/schemas.yaml#/RevisionBase"},
                "candidate_version": {"type": "integer", "minimum": 1}
              },
              "additionalProperties": false
            }
          }
        }
      },
      "x-route-error-codes": {"404": ["not_found"], "409": ["review_changed"], "413": ["body_too_large", "reference_work_exceeded"], "422": ["dangling_reference", "idempotency_key_required", "idempotency_key_reused", "invalid_request", "unsupported_schema"]},
      "responses": {
        "200": {
          "description": "Successful response.",
          "headers": {
            "request-id": {"$ref": "../components/headers.yaml#/RequestId"},
            "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}
          },
          "content": {
            "application/json": {
              "schema": {"type": "object", "required": ["record"], "properties": {"record": {"$ref": "../components/schemas.yaml#/Record"}}}
            }
          }
        },
        "400": {
          "description": "The request could not be parsed or contains an invalid parameter.",
          "headers": {"request-id": {"$ref": "../components/headers.yaml#/RequestId"}, "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}},
          "content": {"application/problem+json": {"schema": {"$ref": "../components/schemas.yaml#/Problem"}}},
          "x-error-codes": ["invalid_json"]
        },
        "401": {
          "description": "The credential is missing, invalid or tied to a superseded grant.",
          "headers": {"request-id": {"$ref": "../components/headers.yaml#/RequestId"}, "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}},
          "content": {"application/problem+json": {"schema": {"$ref": "../components/schemas.yaml#/Problem"}}},
          "x-error-codes": ["episode_superseded", "unauthorized"]
        },
        "403": {
          "description": "The active credential or configuration does not permit this action.",
          "headers": {"request-id": {"$ref": "../components/headers.yaml#/RequestId"}, "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}},
          "content": {"application/problem+json": {"schema": {"$ref": "../components/schemas.yaml#/Problem"}}},
          "x-error-codes": ["connection_disconnected", "connection_paused", "connection_required", "pro_required", "sapphire_account_required", "scope_denied"]
        },
        "404": {
          "description": "The requested object was not found.",
          "headers": {"request-id": {"$ref": "../components/headers.yaml#/RequestId"}, "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}},
          "content": {"application/problem+json": {"schema": {"$ref": "../components/schemas.yaml#/Problem"}}},
          "x-error-codes": ["not_found"]
        },
        "409": {
          "description": "The request conflicts with the current state.",
          "headers": {"request-id": {"$ref": "../components/headers.yaml#/RequestId"}, "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}},
          "content": {"application/problem+json": {"schema": {"$ref": "../components/schemas.yaml#/Problem"}}},
          "x-error-codes": ["pigeon_data_deleting", "review_changed"]
        },
        "410": {
          "description": "The account, snapshot, cursor or history is no longer available.",
          "headers": {"request-id": {"$ref": "../components/headers.yaml#/RequestId"}, "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}},
          "content": {"application/problem+json": {"schema": {"$ref": "../components/schemas.yaml#/Problem"}}},
          "x-error-codes": ["account_deleted"]
        },
        "413": {
          "description": "The request or its resulting work exceeds a size limit.",
          "headers": {"request-id": {"$ref": "../components/headers.yaml#/RequestId"}, "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}},
          "content": {"application/problem+json": {"schema": {"$ref": "../components/schemas.yaml#/Problem"}}},
          "x-error-codes": ["body_too_large", "operation_too_large", "reference_work_exceeded", "response_too_large"]
        },
        "422": {
          "description": "The request violates a protocol or data rule.",
          "headers": {"request-id": {"$ref": "../components/headers.yaml#/RequestId"}, "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}},
          "content": {"application/problem+json": {"schema": {"$ref": "../components/schemas.yaml#/Problem"}}},
          "x-error-codes": ["dangling_reference", "idempotency_key_required", "idempotency_key_reused", "invalid_id", "invalid_request", "unsupported_schema"]
        },
        "429": {
          "description": "A request or work budget is exhausted.",
          "headers": {"request-id": {"$ref": "../components/headers.yaml#/RequestId"}, "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}, "Retry-After": {"$ref": "../components/headers.yaml#/RetryAfter"}},
          "content": {"application/problem+json": {"schema": {"$ref": "../components/schemas.yaml#/Problem"}}},
          "x-error-codes": ["rate_limited"]
        },
        "503": {
          "description": "The Hub or an operation dependency is unavailable.",
          "headers": {"request-id": {"$ref": "../components/headers.yaml#/RequestId"}, "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}, "Retry-After": {"$ref": "../components/headers.yaml#/RetryAfter"}},
          "content": {"application/problem+json": {"schema": {"$ref": "../components/schemas.yaml#/Problem"}}},
          "x-error-codes": ["hub_not_ready", "identity_unavailable", "internal_error"]
        }
      }
    }
  },
  "proposeRecordCorrection": {
    "post": {
      "operationId": "proposeRecordCorrection",
      "tags": ["Records"],
      "summary": "Submit a correction proposal",
      "description": "A connection with write access can submit a proposal against the adopted extraction. Submission leaves that extraction unchanged.",
      "parameters": [
        {"$ref": "../components/parameters.yaml#/RecordId"}
      ],
      "requestBody": {
        "required": true,
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": ["ops"],
              "properties": {
                "ops": {"type": "array", "items": {"$ref": "../components/schemas.yaml#/CorrectionIntent"}, "minItems": 1, "maxItems": 1000},
                "note": {"type": "string", "maxLength": 4096, "default": ""}
              },
              "additionalProperties": false
            }
          }
        }
      },
      "x-route-error-codes": {"404": ["not_found"], "413": ["body_too_large", "correction_budget_exceeded", "proposal_too_large", "publication_work_exceeded"], "422": ["correction_invalid", "invalid_body", "invalid_request", "unsupported_schema"]},
      "responses": {
        "200": {
          "description": "Successful response.",
          "headers": {
            "request-id": {"$ref": "../components/headers.yaml#/RequestId"},
            "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}
          },
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["id", "account", "record", "source", "artifact", "version", "ops", "note", "status", "created_at"],
                "properties": {
                  "id": {"type": "string", "format": "uuid"},
                  "account": {"type": "string", "format": "uuid"},
                  "record": {"type": "string", "format": "uuid"},
                  "source": {"type": "string", "format": "uuid"},
                  "artifact": {"type": "string", "format": "uuid"},
                  "version": {"type": "integer", "minimum": 1},
                  "ops": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": ["intent"],
                      "properties": {"intent": {"$ref": "../components/schemas.yaml#/CorrectionIntent"}, "base": {}}
                    }
                  },
                  "note": {"type": "string"},
                  "status": {"const": "open"},
                  "created_at": {"type": "string", "format": "date-time"}
                }
              }
            }
          }
        },
        "400": {
          "description": "The request could not be parsed or contains an invalid parameter.",
          "headers": {"request-id": {"$ref": "../components/headers.yaml#/RequestId"}, "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}},
          "content": {"application/problem+json": {"schema": {"$ref": "../components/schemas.yaml#/Problem"}}},
          "x-error-codes": ["invalid_json"]
        },
        "401": {
          "description": "The credential is missing, invalid or tied to a superseded grant.",
          "headers": {"request-id": {"$ref": "../components/headers.yaml#/RequestId"}, "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}},
          "content": {"application/problem+json": {"schema": {"$ref": "../components/schemas.yaml#/Problem"}}},
          "x-error-codes": ["episode_superseded", "unauthorized"]
        },
        "403": {
          "description": "The active credential or configuration does not permit this action.",
          "headers": {"request-id": {"$ref": "../components/headers.yaml#/RequestId"}, "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}},
          "content": {"application/problem+json": {"schema": {"$ref": "../components/schemas.yaml#/Problem"}}},
          "x-error-codes": ["connection_disconnected", "connection_paused", "connection_required", "pro_required", "sapphire_account_required", "scope_denied"]
        },
        "404": {
          "description": "The requested object was not found.",
          "headers": {"request-id": {"$ref": "../components/headers.yaml#/RequestId"}, "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}},
          "content": {"application/problem+json": {"schema": {"$ref": "../components/schemas.yaml#/Problem"}}},
          "x-error-codes": ["not_found"]
        },
        "409": {
          "description": "The request conflicts with the current state.",
          "headers": {"request-id": {"$ref": "../components/headers.yaml#/RequestId"}, "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}},
          "content": {"application/problem+json": {"schema": {"$ref": "../components/schemas.yaml#/Problem"}}},
          "x-error-codes": ["pigeon_data_deleting"]
        },
        "410": {
          "description": "The account, snapshot, cursor or history is no longer available.",
          "headers": {"request-id": {"$ref": "../components/headers.yaml#/RequestId"}, "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}},
          "content": {"application/problem+json": {"schema": {"$ref": "../components/schemas.yaml#/Problem"}}},
          "x-error-codes": ["account_deleted"]
        },
        "413": {
          "description": "The request or its resulting work exceeds a size limit.",
          "headers": {"request-id": {"$ref": "../components/headers.yaml#/RequestId"}, "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}},
          "content": {"application/problem+json": {"schema": {"$ref": "../components/schemas.yaml#/Problem"}}},
          "x-error-codes": ["body_too_large", "correction_budget_exceeded", "operation_too_large", "proposal_too_large", "publication_work_exceeded"]
        },
        "422": {
          "description": "The request violates a protocol or data rule.",
          "headers": {"request-id": {"$ref": "../components/headers.yaml#/RequestId"}, "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}},
          "content": {"application/problem+json": {"schema": {"$ref": "../components/schemas.yaml#/Problem"}}},
          "x-error-codes": ["correction_invalid", "invalid_body", "invalid_id", "invalid_request", "unsupported_schema"]
        },
        "429": {
          "description": "A request or work budget is exhausted.",
          "headers": {"request-id": {"$ref": "../components/headers.yaml#/RequestId"}, "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}, "Retry-After": {"$ref": "../components/headers.yaml#/RetryAfter"}},
          "content": {"application/problem+json": {"schema": {"$ref": "../components/schemas.yaml#/Problem"}}},
          "x-error-codes": ["rate_limited"]
        },
        "503": {
          "description": "The Hub or an operation dependency is unavailable.",
          "headers": {"request-id": {"$ref": "../components/headers.yaml#/RequestId"}, "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}, "Retry-After": {"$ref": "../components/headers.yaml#/RetryAfter"}},
          "content": {"application/problem+json": {"schema": {"$ref": "../components/schemas.yaml#/Problem"}}},
          "x-error-codes": ["hub_not_ready", "identity_unavailable", "internal_error"]
        }
      }
    }
  },
  "getOwnerMetadata": {
    "get": {
      "operationId": "getOwnerMetadata",
      "tags": [
        "Records"
      ],
      "summary": "Read owner-only record metadata",
      "description": "Requires the built-in Pigeon owner and access to the record. A live event can have calendar_sync. Other records return an empty object.",
      "parameters": [
        {
          "$ref": "../components/parameters.yaml#/RecordId"
        }
      ],
      "x-route-error-codes": {"403": ["owner_required"], "404": ["not_found"], "422": ["unsupported_schema"]},
      "responses": {
        "200": {
          "description": "Successful response.",
          "headers": {
            "request-id": {
              "$ref": "../components/headers.yaml#/RequestId"
            },
            "Cache-Control": {
              "$ref": "../components/headers.yaml#/CacheControl"
            }
          },
          "content": {
            "application/json": {
              "schema": {
                "$ref": "../components/schemas.yaml#/OwnerMetadata"
              }
            }
          }
        },
        "401": {
          "description": "The credential is missing, invalid or tied to a superseded grant.",
          "headers": {"request-id": {"$ref": "../components/headers.yaml#/RequestId"}, "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}},
          "content": {"application/problem+json": {"schema": {"$ref": "../components/schemas.yaml#/Problem"}}},
          "x-error-codes": ["episode_superseded", "unauthorized"]
        },
        "403": {
          "description": "The active credential or configuration does not permit this action.",
          "headers": {"request-id": {"$ref": "../components/headers.yaml#/RequestId"}, "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}},
          "content": {"application/problem+json": {"schema": {"$ref": "../components/schemas.yaml#/Problem"}}},
          "x-error-codes": ["connection_disconnected", "connection_paused", "connection_required", "owner_required", "pro_required", "sapphire_account_required", "scope_denied"]
        },
        "404": {
          "description": "The requested object was not found.",
          "headers": {"request-id": {"$ref": "../components/headers.yaml#/RequestId"}, "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}},
          "content": {"application/problem+json": {"schema": {"$ref": "../components/schemas.yaml#/Problem"}}},
          "x-error-codes": ["not_found"]
        },
        "409": {
          "description": "The request conflicts with the current state.",
          "headers": {"request-id": {"$ref": "../components/headers.yaml#/RequestId"}, "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}},
          "content": {"application/problem+json": {"schema": {"$ref": "../components/schemas.yaml#/Problem"}}},
          "x-error-codes": ["pigeon_data_deleting"]
        },
        "410": {
          "description": "The account, snapshot, cursor or history is no longer available.",
          "headers": {"request-id": {"$ref": "../components/headers.yaml#/RequestId"}, "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}},
          "content": {"application/problem+json": {"schema": {"$ref": "../components/schemas.yaml#/Problem"}}},
          "x-error-codes": ["account_deleted"]
        },
        "422": {
          "description": "The request violates a protocol or data rule.",
          "headers": {"request-id": {"$ref": "../components/headers.yaml#/RequestId"}, "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}},
          "content": {"application/problem+json": {"schema": {"$ref": "../components/schemas.yaml#/Problem"}}},
          "x-error-codes": ["invalid_id", "unsupported_schema"]
        },
        "429": {
          "description": "A request or work budget is exhausted.",
          "headers": {"request-id": {"$ref": "../components/headers.yaml#/RequestId"}, "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}, "Retry-After": {"$ref": "../components/headers.yaml#/RetryAfter"}},
          "content": {"application/problem+json": {"schema": {"$ref": "../components/schemas.yaml#/Problem"}}},
          "x-error-codes": ["rate_limited"]
        },
        "503": {
          "description": "The Hub or an operation dependency is unavailable.",
          "headers": {"request-id": {"$ref": "../components/headers.yaml#/RequestId"}, "Cache-Control": {"$ref": "../components/headers.yaml#/CacheControl"}, "Retry-After": {"$ref": "../components/headers.yaml#/RetryAfter"}},
          "content": {"application/problem+json": {"schema": {"$ref": "../components/schemas.yaml#/Problem"}}},
          "x-error-codes": ["hub_not_ready", "identity_unavailable", "internal_error"]
        }
      }
    }
  }
}
